/* ASPNetWorld — cream paper, brown ink, a Welsh red stamp.
   Source Serif 4 + Commissioner, OFL, files in assets/fonts. */

/* ---- variables and reset ---- */

:root {
  --paper: #f3ecdf;
  --paper-2: #e7dcc8;
  --card: #faf6ee;
  --ink: #2a1c14;
  --ink-soft: #5e4a3b;
  --line: #d4c4ad;
  --red: #7c2430;
  --red-deep: #5e1724;
  --tick: #2c5c38;
  --shadow: 3px 3px 0 rgba(42, 28, 20, 0.14);
  --sans: "Commissioner", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --shell: 1120px;
  --rail: 280px;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Commissioner";
  src: url("../fonts/commissioner-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Commissioner";
  src: url("../fonts/commissioner-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
  background-image: linear-gradient(180deg, rgba(124, 36, 48, 0.05), transparent 220px);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4,
.brand,
.nav-main,
.btn,
.tile__name,
.specs,
.pager,
.tabset,
.userchip,
.crumbs,
.cloud,
.badge,
.toc,
.faq summary {
  font-family: var(--sans);
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--red-deep);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--red);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

::selection {
  background: #e4c2c6;
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--red);
  color: var(--card);
  padding: 6px 12px;
  z-index: 50;
  text-decoration: none;
  font-family: var(--sans);
}

.skip:focus {
  top: 12px;
}

.shell {
  width: min(var(--shell), calc(100% - 28px));
  margin-inline: auto;
}

/* ---- typography ---- */

.prose {
  font-size: 1.05rem;
  line-height: 1.68;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.lede p {
  margin: 0 0 0.9em;
}

.prose h2 {
  font-size: 1.42rem;
  margin: 1.55em 0 0.4em;
}

.prose h3 {
  font-size: 1.12rem;
  margin: 1.25em 0 0.3em;
}

.prose ul,
.prose ol {
  padding-left: 1.15em;
}

.prose li {
  margin: 0.28em 0;
}

.prose li::marker {
  color: var(--red);
}

.prose strong {
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-2);
  padding: 0 4px;
}

.tablewrap {
  overflow-x: auto;
  margin: 0 0 1em;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  min-width: 420px;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--line);
}

.prose th {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.lede {
  font-size: 1.08rem;
  max-width: 42em;
}

.lede h1,
.pagehead h1,
.proghead h1 {
  font-size: 2rem;
  margin: 0 0 0.35em;
}

/* margin definition, textbook style */
.def {
  float: right;
  clear: right;
  width: 11.2rem;
  margin: 0.2rem 0 0.7rem 16px;
  padding: 2px 0 4px 10px;
  border-left: 3px solid var(--red);
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.def__term {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
}

.def p {
  margin: 0;
}

/* ---- layout ---- */

.topbar {
  padding-top: 14px;
}

.topbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.brand__mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: block;
  max-width: none;
}

.glyph {
  display: inline-block;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--g) center / contain no-repeat;
  mask: var(--g) center / contain no-repeat;
}

.glyph--menu { --g: url("../img/ui/menu.svg"); width: 18px; height: 18px; }
.glyph--bell { --g: url("../img/ui/bell.svg"); width: 20px; height: 20px; }
.glyph--x { --g: url("../img/ui/close.svg"); width: 16px; height: 16px; }
.glyph--up { --g: url("../img/ui/up.svg"); width: 14px; height: 14px; }
.glyph--prev { --g: url("../img/ui/prev.svg"); width: 14px; height: 14px; }
.glyph--next { --g: url("../img/ui/next.svg"); width: 14px; height: 14px; }
.glyph--down { --g: url("../img/ui/down.svg"); width: 16px; height: 16px; }
.glyph--search { --g: url("../img/ui/search.svg"); width: 16px; height: 16px; }
.glyph--pages { --g: url("../img/ui/pages.svg"); width: 16px; height: 16px; }

.slogan {
  margin: 0;
  flex: 1 1 180px;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  position: relative;
  font-size: 0.92rem;
}

.signin {
  font-weight: 700;
  text-decoration: none;
}

.signin:hover {
  text-decoration: underline;
}

.burger {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 5px 10px;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
}

.burger .glyph {
  display: block;
}

.nav-main {
  border-top: 1px solid var(--line);
  border-bottom: 3px solid var(--ink);
  background: rgba(250, 246, 238, 0.55);
}

.nav-main ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 0;
  padding: 0;
}

.nav-main a {
  display: inline-block;
  padding: 9px 0 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
}

.nav-main a:hover {
  color: var(--red);
}

.nav-main a.is-on {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding-top: 22px;
  padding-bottom: 48px;
}

main {
  min-width: 0;
}

.rail {
  display: grid;
  gap: 18px;
  align-content: start;
}

.foot {
  border-top: 3px solid var(--ink);
  padding: 18px 0 28px;
  background: #efe6d6;
}

.foot__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  justify-content: space-between;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.foot a {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  text-decoration: none;
}

.foot a:hover {
  color: var(--red);
  text-decoration: underline;
}

.foot p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ---- components ---- */

.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
  margin: 8px 0 14px;
}

.tile {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 8px 12px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.tile:hover {
  background: rgba(124, 36, 48, 0.045);
}

.tile__icon {
  width: 56px;
  height: 56px;
  flex: none;
  max-width: none;
}

.tile__text {
  min-width: 0; /* safari: иначе прыгает */
  display: block;
}

.tile__name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.tile:hover .tile__name {
  color: var(--red-deep);
}

.tile__line {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.35;
}

.tile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  align-items: baseline;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
}

.tile__ver {
  overflow-wrap: anywhere;
}

.tile__cat {
  color: var(--ink);
}

.tile__size {
  background: var(--paper-2);
  padding: 0 6px;
  border-radius: 2px;
  color: var(--ink);
}

.tile__fresh {
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.sechead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  margin: 28px 0 0;
}

.sechead h2 {
  margin: 0;
  font-size: 1.35rem;
}

.sechead a,
.morelink {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.9rem;
}

.railbox {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px 14px 14px;
}

.railbox h2 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-deep);
}

.termday {
  background: var(--card);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 12px 14px 14px;
}

.termday h2 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

.termday h3 {
  margin: 6px 0 4px;
  font-size: 1.25rem;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0;
}

.termday p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.gloss dt {
  font-family: var(--sans);
  font-weight: 700;
  margin-top: 8px;
}

.gloss dt:first-child {
  margin-top: 0;
}

.gloss dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.catlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catlist li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
  font-family: var(--sans);
  font-size: 0.92rem;
}

.catlist a {
  color: var(--ink);
  text-decoration: none;
}

.catlist a:hover,
.catlist a.is-on {
  color: var(--red);
}

.catlist span {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.cloud a {
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
}

.cloud a:hover {
  color: var(--red);
}

.cloud .s { font-size: 0.82rem; }
.cloud .m { font-size: 1.02rem; }
.cloud .l { font-size: 1.28rem; }
.cloud .xl { font-size: 1.55rem; color: var(--red-deep); }

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 12px;
  padding: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.crumbs li {
  display: inline-flex;
  align-items: center;
}

.crumbs li + li::before {
  content: "›";
  margin: 0 7px;
  color: var(--line);
  font-size: 1rem;
}

.crumbs a {
  color: var(--ink-soft);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 16px;
}

.pager ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.pager a,
.pager span {
  display: inline-block;
  min-width: 2rem;
  text-align: center;
  padding: 4px 8px;
  text-decoration: none;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid transparent;
}

.pager a:hover {
  border-color: var(--line);
}

.pager a[aria-current="page"] {
  background: var(--red);
  color: var(--card);
  border-color: var(--red-deep);
}

.pager__step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700; /* words, not the page numbers */
  min-width: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 2px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}

.btn--red {
  background: var(--red);
  border-color: var(--red-deep);
  color: #faf6ee;
}

.btn--red:hover {
  background: var(--red-deep);
  color: #fff;
}

.btn--quiet:hover {
  border-color: var(--red);
  color: var(--red-deep);
}

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.favbtn.is-in,
.favbtn[aria-pressed="true"] {
  color: var(--red);
  border-color: var(--red);
}

.proghead {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
  margin-bottom: 14px;
}

.proghead__icon {
  width: 64px;
  height: 64px;
  max-width: none;
}

.proghead h1 {
  overflow-wrap: break-word;
}

.kicker {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  margin-bottom: 4px;
}

.updated {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.shots {
  margin: 16px 0 8px;
}

.shots__bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.shots figcaption,
.shots__bar p {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.shots__nav {
  display: flex;
  gap: 6px;
}

.shots__nav button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3px 8px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
}

.shots__row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.shots__row a {
  flex: none;
  scroll-snap-align: start;
  line-height: 0;
  width: min(440px, 78vw);
}

.shots__row img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
}

.tabset {
  margin-top: 18px;
}

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--ink);
}

.tablist button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 14px 8px 0;
  margin-right: 12px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.tablist button[aria-selected="true"],
.tablist button.is-on {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* hook script sets hidden; without js the notes stay readable */
.tabpane[hidden] {
  display: block !important;
}

.js .tabpane[hidden] {
  display: none !important;
}

.tabpane {
  padding-top: 14px;
}

.specs {
  margin: 0;
}

.specs div {
  display: grid;
  grid-template-columns: 7.4rem minmax(0, 1fr);
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.specs dt {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.specs dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 8px 0 10px;
}

.faq summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

.faq details p {
  margin: 8px 0 0;
  color: var(--ink);
}

.authorbox {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  margin: 22px 0;
  padding: 12px 0 4px;
  border-top: 1px solid var(--ink);
}

.authorbox h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.authorbox p {
  margin: 0;
  color: var(--ink-soft);
}

.monogram {
  width: 52px;
  height: 52px;
  background: var(--red);
  color: #faf6ee;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--card);
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  flex: none;
}

.who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.who:hover {
  color: var(--red);
}

.bell {
  position: relative;
  background: none;
  border: 0;
  padding: 4px;
  color: var(--ink);
  line-height: 0;
}

.bell__n {
  position: absolute;
  top: -3px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.belldrop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(340px, calc(100vw - 36px));
  background: var(--card);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  z-index: 30;
  padding: 6px 0 0;
}

.belldrop[hidden] {
  display: none;
}

.belldrop ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.belldrop li a {
  display: block;
  padding: 8px 12px 2px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.35;
}

.belldrop li time {
  display: block;
  padding: 0 12px 8px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.belldrop .is-unread {
  background: #f6e4d8;
}

.belldrop .allnot {
  display: block;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}

.logout {
  background: none;
  border: 0;
  padding: 0;
  color: var(--red-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: var(--sans);
  font-size: 0.88rem;
}

.talk {
  margin-top: 10px;
}

.talk__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.talk__head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.sort {
  display: flex;
  gap: 8px;
}

.sort button {
  background: none;
  border: 0;
  padding: 2px;
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink-soft);
}

.sort button.is-on {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cform,
.replybox {
  margin: 12px 0;
}

.cform textarea,
.replybox textarea,
.form input,
.form textarea {
  width: 100%;
  max-width: 100%;
  background: var(--card);
  border: 1px solid #b7a58d;
  border-radius: 2px;
  padding: 8px 10px;
  font-size: 16px; /* stops iOS zooming the page */
}

.cform textarea,
.replybox textarea {
  min-height: 7rem;
  resize: vertical;
}

.hint {
  margin: 6px 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.formerr,
.fielderr {
  color: var(--red-deep);
  font-family: var(--sans);
  font-size: 0.9rem;
  margin: 6px 0;
}

.formerr {
  padding: 8px 10px;
  background: #f8e8e6;
  border-left: 3px solid var(--red);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--red);
  background: #fbf6f4;
}

.hp {
  position: absolute;
  left: -8000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.clist {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.cmt {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.cmt.is-held {
  opacity: 0.55;
}

.cmt__name {
  font-family: var(--sans);
  font-weight: 700;
  margin-right: 8px;
}

.cmt time {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.cmt__body {
  margin: 4px 0 6px;
}

.cmt__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.like,
.replybtn {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--sans);
  color: var(--ink-soft);
}

.like.is-on {
  color: var(--red);
  font-weight: 700;
}

.cmt__replies {
  grid-column: 2;
  margin: 4px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--paper-2);
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--red-deep);
  border: 1px solid var(--red);
  padding: 0 6px;
  border-radius: 2px;
  margin-left: 6px;
}

.badge--no {
  color: var(--ink-soft);
  border-color: #b7a58d;
}

.empty-note {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px dashed #b7a58d;
  color: var(--ink-soft);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal__dim {
  position: absolute;
  inset: 0;
  background: rgba(42, 28, 20, 0.46);
}

.modal__sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 740px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--ink);
  box-shadow: 5px 6px 0 rgba(42, 28, 20, 0.18);
  padding: 18px 18px 22px;
}

.modal__x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
}

.modal h2 {
  margin: 0 36px 10px 0;
  font-size: 1.35rem;
}

.modal h3 {
  margin: 16px 0 6px;
  font-size: 1rem;
}

.mirrors {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.oldlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.oldlist li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.oldlist p {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
}

.backtop {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: var(--card);
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 10px;
  border-radius: 2px;
}

.js .backtop {
  opacity: 0;
  pointer-events: none;
}

.js .backtop.is-in {
  opacity: 1;
  pointer-events: auto;
}

.backtop:hover {
  background: var(--red);
  color: #fff;
}

.form {
  max-width: 28rem;
}

.form label,
.setform label {
  display: block;
  margin: 12px 0 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.88rem;
}

.form .check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.form .check input {
  width: auto;
}

.form .rowbtns,
.setform .rowbtns {
  margin-top: 14px;
}

.saved {
  background: #e5f0e4;
  border-left: 3px solid var(--tick);
  padding: 8px 12px;
  font-family: var(--sans);
  margin: 0 0 12px;
}

.acctabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  border-bottom: 1px solid var(--ink);
  margin: 8px 0 16px;
}

.acctabs a {
  font-family: var(--sans);
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.acctabs a[aria-current="page"] {
  color: var(--red);
  border-bottom-color: var(--red);
}

.whoami {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.whoami .avatar {
  width: 52px;
  height: 52px;
  font-size: 16px;
}

.notes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notes li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.notes a {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.notes a:hover {
  color: var(--red);
}

.notes time {
  display: block;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.notes .is-unread a {
  color: var(--red-deep);
}

.mycomments article {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.mycomments h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.mycomments p {
  margin: 0;
}

.toc {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
}

.toc p {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red-deep);
}

.toc ol {
  margin: 0;
  padding-left: 1.2em;
}

.toc a {
  color: var(--ink);
}

.find {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin: 12px 0 18px;
}

.find label {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  flex: 1 1 200px;
}

.find input {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid #b7a58d;
  border-radius: 2px;
  padding: 8px 10px;
  font-size: 16px;
}

.errcode {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 4.2rem;
  line-height: 0.9;
  color: var(--red);
  margin: 0 0 8px;
  letter-spacing: -0.04em;
}

.poplist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.poplist li {
  border-bottom: 1px solid var(--line);
}

.poplist a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 700;
}

.poplist a:hover {
  color: var(--red);
}

/* ---- pages ---- */

.home .lede h1 {
  max-width: 16em;
}

.narrow {
  max-width: 40em;
}

/* ---- queries ---- */

@media (max-width: 639px) {
  .brand {
    margin-right: auto;
  }

  .burger {
    order: 2;
  }

  .userchip {
    order: 4;
    flex: 1 0 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .def {
    float: none;
    width: auto;
    margin: 0 0 14px;
  }

  .proghead {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .proghead__icon {
    width: 56px;
    height: 56px;
  }

  .lede h1,
  .pagehead h1,
  .proghead h1 {
    font-size: 1.65rem;
  }

  .specs div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .slogan {
    flex: 1 0 100%;
    order: 5;
    font-size: 0.92rem;
  }
}

@media (min-width: 640px) {
  .tile-grid--2,
  .tile-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 22px;
  }
}

@media (max-width: 63.99em) {
  .js .burger {
    display: inline-flex;
  }

  .js .nav-main:not(.is-open) {
    display: none;
  }

  .nav-main ul {
    flex-direction: column;
    gap: 0;
    padding: 4px 0 8px;
  }

  .nav-main a {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }

  .nav-main a.is-on {
    border-bottom-color: var(--line);
    box-shadow: inset 3px 0 0 var(--red);
    padding-left: 8px;
  }
}

@media (min-width: 64em) {
  .split {
    grid-template-columns: minmax(0, 1fr) var(--rail);
    gap: 40px;
    align-items: start;
  }

  .burger {
    display: none;
  }
}

@media (max-width: 380px) {
  .shell {
    width: calc(100% - 20px);
  }

  .userchip .who span:last-child {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* program page: the definition notes need a little air under the fold */
.page-program .prose h2 {
  clear: right;
}

/* ---- audit fixes ---- */
.tablist { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tablist::-webkit-scrollbar { display: none; }
.tablist button { flex: none; white-space: nowrap; }

@media (max-width: 639px) {
  .slogan { display: none; }
  .brand { margin-right: auto; }
  .userchip { order: 1; flex: 0 1 auto; margin-left: 0; gap: 8px; }
  .userchip .who { font-size: 0; gap: 0; }
  .userchip .who .avatar { font-size: 0.78rem; }
  .burger { order: 3; }
}
.acctabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.acctabs a { flex: none; white-space: nowrap; }
@media (max-width: 639px) {
  .burger { font-size: 0; gap: 0; padding: 8px 10px; }
  .burger .glyph { width: 20px; height: 20px; }
}
@media (max-width: 639px) {
  .topbar__row { flex-wrap: nowrap; column-gap: 10px; }
  .brand { font-size: 1.05rem; min-width: 0; }
  .brand__mark { width: 32px; height: 32px; }
  .logout { font-size: 0.85rem; white-space: nowrap; }
}

/* seo: текст вступления после первого блока программ */
.home-about { margin-top: 32px; margin-bottom: 32px; }
.home-about__body { margin-top: 10px; }

/* ---- натяжка на сайт ---- */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* шапка прилипает; поиск в ней всегда под рукой */
.topbar { position: sticky; top: 0; z-index: 60; background: var(--paper); }
.topfind { display: none; order: 6; flex: 1 0 100%; gap: 6px; padding-bottom: 4px; }
.topfind.is-open { display: flex; }
.topfind input {
  flex: 1 1 auto; min-width: 0; height: 40px; box-sizing: border-box; padding: 0 12px;
  font: inherit; font-family: var(--sans); font-size: 0.95rem;
  border: 1px solid var(--ink); border-radius: 2px; background: var(--card); color: var(--ink);
}
.topfind input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.topfind button, .findtog {
  height: 40px; width: 40px; box-sizing: border-box; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink); border-radius: 2px; cursor: pointer;
}
.topfind button { background: var(--ink); color: var(--card); }
.topfind button:hover { background: var(--red-deep); border-color: var(--red-deep); }
.findtog { order: 2; background: var(--card); color: var(--ink); }
/* «Sign in» — кнопка той же высоты */
.userchip .signin {
  display: inline-flex; align-items: center; height: 40px; box-sizing: border-box; padding: 0 16px;
  background: var(--red); color: #faf6ee; border: 1px solid var(--red-deep); border-radius: 2px; text-decoration: none; font-family: var(--sans);
}
.userchip .signin:hover { background: var(--red-deep); color: #fff; text-decoration: none; }
.burger { height: 40px; box-sizing: border-box; }
@media (min-width: 64em) {
  .findtog { display: none; }
  .topbar__row { flex-wrap: nowrap; }
  .slogan { flex: 0 1 auto; }
  .topfind { display: flex; order: 0; flex: 0 1 320px; margin-left: auto; padding: 0; }
  .userchip { margin-left: 0; }
}
@media (max-width: 63.99em) {
  .findtog { margin-left: auto; }
  .userchip { margin-left: 0; }
}
@media (max-width: 639px) {
  .findtog { order: 1; }
  .userchip { order: 2; }
  .burger { order: 3; }
  .topbar__row { flex-wrap: wrap; }
  .topfind { order: 6; }
}
/* кнопки действий программы — одна высота */
.acts .btn { height: 44px; box-sizing: border-box; padding: 0 18px; font-size: 0.98rem; }
.acts .btn--red { font-weight: 700; padding: 0 22px; box-shadow: 0 2px 0 var(--red-deep); }
/* правая колонка не тянется на всю высоту */
.split { align-items: start; }
.home-about__body, .home-about__body p { max-width: none; }
.mirrors { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.modal__body > section + section { margin-top: 10px; }
.oldlist a { margin-right: 10px; }

/* ---- скриншоты: «проектор в классе» ---- */
.shots.is-proj .shots__row, .shots.is-proj .shots__nav { display: none; }
.proj { margin-top: 10px; }
.proj__screen {
  position: relative; background: #1f1611; border-radius: 3px; padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow);
}
.proj__frame { display: block; }
.proj__frame img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; margin: 0 auto; background: #2a1f18; }
.proj__count {
  position: absolute; top: 22px; left: 22px; padding: 3px 9px; border-radius: 999px;
  background: rgba(250, 246, 238, 0.92); color: var(--ink); font-family: var(--sans); font-size: 0.8rem; font-weight: 700;
}
.proj__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgba(250, 246, 238, 0.9); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.proj__arrow:hover { background: var(--red); color: #fff; }
.proj__arrow--l { left: 22px; }
.proj__arrow--r { right: 22px; }
.proj__cap { margin: 10px 2px 0; font-family: var(--sans); font-size: 0.86rem; color: var(--ink-soft); }
.proj__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.proj__thumbs button {
  flex: 0 0 96px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 2px; background: #2a1f18; cursor: pointer; opacity: 0.6;
}
.proj__thumbs button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.proj__thumbs button:hover { opacity: 1; }
.proj__thumbs button[aria-current="true"] { border-color: var(--red); opacity: 1; }
@media (max-width: 559px) {
  .proj__screen { padding: 8px; }
  .proj__arrow { width: 34px; height: 34px; }
  .proj__arrow--l { left: 12px; } .proj__arrow--r { right: 12px; }
  .proj__count { top: 14px; left: 14px; }
  .proj__thumbs button { flex-basis: 72px; height: 46px; }
}
#notice { margin-top: 28px; }
#notice textarea, .cform textarea, .replybox textarea { width: 100%; box-sizing: border-box; }
.rail .specs div { grid-template-columns: 7.5rem minmax(0, 1fr); }
