/* LeCoqRoti — studio catalogue
   variables, then type, layout, pieces, pages, queries */

:root {
  --paper: #f3eee4;
  --paper-2: #e7e0d2;
  --ink: #1c1714;
  --muted: #6a5f56;
  --line: #d4cbbd;
  --seal: #c4371c;
  --seal-ink: #8d2814;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 40rem;
  --wide: 1120px;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%; /* safari: иначе прыгает */
  scroll-behavior: smooth;
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile img { transition: none; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.5;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; vertical-align: middle; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, .brand, .tile-lead .tile-name {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
h1, h2, h3 { text-wrap: balance; }
p, ul, ol { text-wrap: pretty; }

a { color: inherit; }
a:hover { color: var(--seal); }

:focus {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

::selection { background: var(--seal); color: #fffaf6; }

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- type ---------- */

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 50;
  text-decoration: none;
}
.skip:focus { top: 10px; }

.readbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 40;
  pointer-events: none;
  background: transparent;
}
.readbar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--seal);
}

.spine {
  display: none;
}

/* ---------- mast ---------- */

.mast {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "burger user"
    "brand brand"
    "tag tag"
    "nav nav";
  align-items: center;
  gap: 6px 12px;
  padding: 16px 16px 8px;
  position: relative;
}

.brandline {
  grid-area: brand;
  text-align: center;
  margin-top: 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 1.62rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 46px;
  height: 46px;
  display: block;
  flex: none;
}

.tag {
  grid-area: tag;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  margin: 2px 0 8px;
  font-size: 0.98rem;
}

.user {
  grid-area: user;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  font-size: 0.92rem;
}
.user a { text-decoration: none; }
.user a:hover { color: var(--seal); }

.navtoggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.navbtn {
  grid-area: burger;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 6px 0;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.navbtn .when-open { display: none; }
.navtoggle:focus + .navbtn { outline: 2px solid var(--seal); outline-offset: 3px; }
.navtoggle:checked + .navbtn .when-shut { display: none; }
.navtoggle:checked + .navbtn .when-open { display: block; }

.nav { grid-area: nav; display: none; }
.navtoggle:checked ~ .nav { display: block; }
.nav ul {
  list-style: none;
  margin: 8px 0 4px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.nav a {
  text-decoration: none;
  font-size: 0.95rem;
}
.nav a[aria-current="page"] {
  color: var(--seal);
  box-shadow: inset 0 -1px 0 var(--seal);
}

/* ---------- hanko ---------- */

.hanko {
  display: inline-block;
  width: 64px;
  height: 64px;
  transform: rotate(-4deg);
  flex: none;
}
.ui-ico {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
}
.navbtn .ui-ico,
.bell-btn .ui-ico { width: 20px; height: 20px; }
.dlg-x .ui-ico,
.shotbar .ui-ico { width: 15px; height: 15px; }
.find-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.signoff {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}
.signoff p { margin: 0; font-family: var(--serif); font-style: italic; }

/* ---------- frames ---------- */

.wrap {
  width: min(var(--wide), calc(100% - 32px));
  margin-inline: auto;
}
.narrow {
  width: min(var(--measure), calc(100% - 32px));
  margin-inline: auto;
}

main { padding-bottom: 56px; }

.home-intro { padding-top: 18px; }
.home h1 {
  font-size: clamp(2.35rem, 7vw, 4.35rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  max-width: 11ch;
  margin: 0.15em 0 0.35em;
}
.lede {
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 38rem;
}
.lede p { margin: 0 0 0.9em; }
.lede ul { margin: 0.2em 0 1em; padding-left: 1.1em; }

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  margin: 46px 0 16px;
  padding-top: 10px;
  border-top: 1px solid var(--ink);
}
.sec-head h2 { margin: 0; font-size: 1.65rem; }
.sec-head h2 .num {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--seal);
  margin-right: 8px;
  font-weight: 600;
}
.sec-head a { text-decoration: none; font-size: 0.92rem; }
.sec-head a:hover { color: var(--seal); }

/* picks: one large, a short list beside it */
.picks { margin-top: 28px; }
.picks-grid { display: grid; gap: 22px; }
.pick-lead {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px 16px;
  text-decoration: none;
  align-items: center;
  padding-bottom: 8px;
}
.pick-lead img { width: 72px; height: 72px; }
.pick-lead h3 { margin: 0 0 4px; font-size: 1.85rem; }
.pick-lead p { margin: 0; color: var(--muted); }
.kicker {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seal);
}
.pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pick-list li { border-top: 1px solid var(--line); }
.pick-list a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  padding: 9px 0;
}
.pick-list .tile-name { margin-top: 0; font-weight: 600; }
.pick-list img { width: 40px; height: 40px; }
.pick-list .tile-ver { color: var(--muted); font-size: 12px; }

/* ---------- tiles ---------- */

.shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 12px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  gap: 2px;
}
.tile img {
  width: 56px;
  height: 56px;
  transition: transform 0.18s ease;
}
.tile:hover img { transform: translateY(-2px); }
.tile:hover { color: var(--ink); }
.tile:hover .tile-name { color: var(--seal); }
.tile-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.tile-name {
  display: block;
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.25;
  letter-spacing: 0;
  font-family: var(--sans);
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.tile-ver {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tile-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 7px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  max-width: 100%;
}
.size {
  border: 1px solid var(--line);
  padding: 0 5px;
  line-height: 1.5;
  color: var(--ink);
}
.fresh {
  color: var(--seal);
  letter-spacing: 0.04em;
}

/* first tile on the home shelf is the large one */
.shelf-lead .tile:first-child {
  grid-column: 1 / -1;
  flex-direction: row;
  text-align: left;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.shelf-lead .tile:first-child img { width: 84px; height: 84px; }
.shelf-lead .tile:first-child .tile-name {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
}
.shelf-lead .tile:first-child .tile-meta { justify-content: flex-start; }
.shelf-lead .tile:first-child .tile-copy { align-items: flex-start; }

/* ---------- program ---------- */

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 18px 0 16px;
}
.crumb a { color: inherit; }

.prog-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px 14px;
  align-items: start;
  margin-bottom: 18px;
}
.prog-head img { width: 64px; height: 64px; }
.prog-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin: 0 0 6px;
  max-width: 22ch;
  overflow-wrap: anywhere;
}
.catlink {
  display: inline-block;
  text-decoration: none;
  color: var(--seal);
  font-size: 0.92rem;
}
.stamp-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 16px 0 8px;
}
.btn {
  display: inline-block;
  background: var(--seal);
  color: #fffaf6;
  text-decoration: none;
  border: 0;
  padding: 11px 16px;
  line-height: 1.2;
}
.btn:hover { background: var(--seal-ink); color: #fffaf6; }
.btn:focus-visible { outline-color: var(--ink); }
.textbtn {
  background: none;
  border: 0;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--ink);
}
[data-mn-fav] {
  background: none;
  border: 0;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
[data-mn-fav][aria-pressed="true"] { color: var(--seal); }

.shotbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 8px;
}
.shotbar p { margin: 0; font-size: 0.86rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.shotbar button {
  background: none;
  border: 1px solid var(--ink);
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.shotbar button + button { margin-left: 6px; }
.shots {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; /* safari: иначе прыгает */
  padding-bottom: 6px;
}
.shot {
  flex: 0 0 86%;
  scroll-snap-align: start;
  display: block;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.shot img { display: block; width: 100%; height: auto; }

.blank {
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  padding: 12px 0 4px;
}

.prog-grid { display: block; margin-top: 22px; }

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 8px;
}
.tablist button {
  background: none;
  border: 0;
  padding: 8px 0 9px;
  font-size: 0.98rem;
}
.tablist button[aria-selected="true"] {
  color: var(--seal);
  box-shadow: inset 0 -2px 0 var(--seal);
}

/* no-js: every panel stays readable, hidden or not */
html:not(.js) .panes [hidden] {
  display: block !important;
}

.side {
  margin-top: 28px;
  padding-top: 8px;
}
.side h2 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--sans);
  font-weight: 600;
  margin: 0 0 8px;
}
.side dl { margin: 0; }
.side dt {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 11px;
}
.side dd { margin: 1px 0 0; }

.doc {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}
.toc {
  margin: 8px 0 18px;
  padding: 8px 0 4px;
}
.toc p {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seal);
}
.toc ol { margin: 0; padding-left: 1.1em; }
.toc a { text-decoration: none; font-size: 0.92rem; }
.toc a.is-here { color: var(--seal); }

/* ---------- long copy ---------- */

.prose, .rich {
  font-size: 1.075rem;
  line-height: 1.68;
  hanging-punctuation: first last;
}
.prose h2, .rich h2 {
  font-size: 1.55rem;
  margin: 1.6em 0 0.4em;
  scroll-margin-top: 18px;
}
.prose h3, .rich h3 {
  font-size: 1.22rem;
  margin: 1.3em 0 0.3em;
  scroll-margin-top: 18px;
}
.prose p, .rich p { margin: 0.7em 0; }
.prose ul, .prose ol, .rich ul, .rich ol { padding-left: 1.15em; }
.prose li + li, .rich li + li { margin-top: 0.3em; }
.prose a, .rich a { color: var(--seal-ink); }
.prose blockquote, .rich blockquote {
  margin: 1.1em 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--seal);
  font-family: var(--serif);
  font-style: italic;
}
.prose code, .rich code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-2);
  padding: 0 4px;
}
.prose table, .rich table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1em 0;
}
.prose th, .prose td, .rich th, .rich td {
  text-align: left;
  vertical-align: top;
  padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--line);
}
.prose th, .rich th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }

.faq { margin-top: 36px; max-width: var(--measure); }
.faq h2 { font-size: 1.55rem; margin-bottom: 8px; }
.faq details { border-top: 1px solid var(--line); padding: 9px 0 11px; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.12rem;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  color: var(--seal);
  display: inline-block;
  width: 1.1em;
}
.faq details[open] summary::before { content: "\2013"; }
.faq details p { margin: 0.6em 0 0.2em; color: var(--ink); }

/* ---------- comments ---------- */

.comments { margin-top: 42px; max-width: 46rem; }
.comments-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  border-top: 1px solid var(--ink);
  padding-top: 10px;
}
.comments-head h2 { margin: 0; font-size: 1.55rem; }
.sort { display: flex; gap: 14px; }
.sort button {
  background: none;
  border: 0;
  padding: 4px 0;
}
.sort button[aria-pressed="true"] {
  color: var(--seal);
  box-shadow: inset 0 -1px 0 var(--seal);
}

.cform { margin: 14px 0 8px; }
.cform-guest { font-family: var(--serif); font-style: italic; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 6px 0 0; }

.cmt {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cmt-body { min-width: 0; }
.cmt-who { font-weight: 600; margin-right: 8px; }
.cmt time { color: var(--muted); font-size: 0.86rem; }
.cmt p { margin: 4px 0; overflow-wrap: anywhere; }
.cmt-tools { display: flex; gap: 14px; }
.cmt-tools button {
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--muted);
}
.cmt-tools button:hover { color: var(--seal); }
[data-mn-like].is-on { color: var(--seal); }

.cmt.is-hold { opacity: 0.58; }
.badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--seal);
  color: var(--seal);
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: 1px;
}
.badge-ink { border-color: var(--ink); color: var(--ink); }

.replies { grid-column: 1 / -1; margin-left: 18px; }
.reply {
  margin: 8px 0 4px;
  padding-top: 6px;
}

/* ---------- dialog ---------- */

.dlg {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(28, 23, 20, 0.48);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 14px;
  overflow: auto;
}
.dlg:target { display: flex !important; } /* hash still opens it if the app script is absent */
.dlg-card {
  background: var(--paper);
  width: min(560px, 100%);
  border: 1px solid var(--ink);
  padding: 18px 18px 16px;
  position: relative;
  margin-top: 6vh;
}
.dlg-card h2 { margin: 0 36px 8px 0; font-size: 1.55rem; }
.dlg-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  padding: 0;
}
.mirror { margin: 14px 0; }
.mirror h3 { margin: 0 0 6px; font-size: 1.05rem; }
.mirror a { display: inline-block; margin: 0 14px 6px 0; }

/* ---------- forms ---------- */

.form {
  display: grid;
  gap: 14px;
  max-width: 26rem;
}
.form label { display: grid; gap: 4px; font-size: 0.92rem; }
.form input[type="email"],
.form input[type="password"],
.form input[type="text"],
.form input[type="search"],
.form textarea,
.find input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 8px 0;
  appearance: none;
}
.form textarea { min-height: 120px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { accent-color: var(--seal); width: auto; }
.form-err, .field-err {
  color: var(--seal-ink);
  margin: 0;
  font-size: 0.9rem;
}
.saved {
  display: inline-block;
  color: var(--seal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  margin: 0;
}
.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.hp {
  position: absolute !important;
  left: -9999px;
  height: 0;
  width: 0;
  opacity: 0;
}

.auth h1, .textpage h1, .err h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0.4em 0 0.3em; }
.auth .lede, .err .lede { margin-bottom: 1.2em; }

/* ---------- account ---------- */

.who { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.cmt .avatar { width: 40px; height: 40px; }

.bell { position: relative; }
.bell-btn {
  background: none;
  border: 0;
  padding: 4px;
  position: relative;
}
.bell-n {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--seal);
  color: #fffaf6;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
}
.bell-drop {
  display: none;
  position: fixed;
  top: 52px;
  left: 12px;
  right: 12px;
  width: auto;
  background: var(--paper);
  border: 1px solid var(--ink);
  text-align: left;
  z-index: 20;
  padding-top: 4px;
}
.bell:focus-within .bell-drop,
.bell.is-open .bell-drop { display: block; }
.bell-drop ul { list-style: none; margin: 0; padding: 0; }
.bell-drop li { border-top: 1px solid var(--line); padding: 8px 12px; }
.bell-drop li:first-child { border-top: 0; }
.bell-drop a { text-decoration: none; display: inline; }
.bell-drop time { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.bell-drop .is-unread a { font-weight: 700; }
.bell-drop .is-unread time { color: var(--seal); }
.bell-all {
  display: block;
  padding: 10px 12px;
  border-top: 1px solid var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}

.acct-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  border-bottom: 1px solid var(--ink);
  margin: 8px 0 18px;
}
.acct-tabs a { text-decoration: none; padding-bottom: 6px; }
.acct-tabs a[aria-current="page"] {
  color: var(--seal);
  box-shadow: inset 0 -2px 0 var(--seal);
}

.note-list { list-style: none; margin: 0; padding: 0; max-width: 40rem; }
.note-list li { border-top: 1px solid var(--line); padding: 10px 0; }
.note-list time { display: block; color: var(--muted); font-size: 0.86rem; }
.note-list .is-unread a { font-weight: 700; }

.mine { list-style: none; margin: 0; padding: 0; max-width: 40rem; }
.mine li { border-top: 1px solid var(--line); padding: 12px 0; }
.mine a { font-family: var(--serif); font-size: 1.15rem; text-decoration: none; }

/* ---------- pager, folio, errors ---------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin: 34px 0 8px;
}
.pager ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pager a, .pager span {
  text-decoration: none;
  min-width: 1.6rem;
  text-align: center;
  display: inline-block;
  padding: 4px;
}
.pager [aria-current="page"] {
  color: var(--seal);
  box-shadow: inset 0 -1px 0 var(--seal);
}

.folio {
  border-top: 1px solid var(--ink);
  padding: 26px 16px 36px;
  text-align: center;
}
.folio .hanko { margin-bottom: 6px; }
.folio nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 8px 0;
}
.folio a { text-decoration: none; }
.folio small { color: var(--muted); display: block; }

.totop {
  display: none;
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  text-decoration: none;
  padding: 7px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 15;
}
.js-scrolled .totop { display: block; }
.totop:hover { color: var(--paper); background: var(--seal); border-color: var(--seal); }

.find { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; max-width: 28rem; }
.find label { flex: 1 1 180px; display: grid; gap: 4px; }
.rubrics { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.rubrics a { text-decoration: none; }

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

@media (min-width: 700px) {
  .mast {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
      ". brand user"
      "tag tag tag"
      "nav nav nav";
    padding: 22px 22px 6px;
  }
  .brand { font-size: 1.95rem; letter-spacing: 0.06em; gap: 12px; }
  .brand-mark { width: 58px; height: 58px; }
  .navbtn, .navtoggle { display: none; }
  .nav { display: block; }
  .bell-drop {
    position: absolute;
    top: calc(100% + 8px);
    left: auto;
    right: 0;
    width: min(320px, calc(100vw - 24px));
  }
  .nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
    gap: 6px 16px;
  }
  .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 16px; }
  .shot { flex-basis: 64%; }
  .home h1 { max-width: 14ch; }
}

@media (min-width: 1040px) {
  .lede { margin-left: 11%; }
  .picks-grid {
    grid-template-columns: 1.3fr 0.9fr;
    gap: 36px;
    align-items: end;
  }
  .shelf { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 36px 18px; }
  .shelf-lead .tile:first-child {
    grid-column: span 2;
    grid-row: span 2;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    text-align: left;
    border-bottom: 0;
    padding: 8px 10px 8px 0;
  }
  .shelf-lead .tile:first-child img { width: 104px; height: 104px; }
  .shelf-lead .tile:first-child .tile-name { font-size: 2rem; }

  .prog-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 28px 40px;
    align-items: start;
  }
  .side {
    margin-top: 46px;
    position: sticky;
    top: 16px;
    padding-top: 0;
  }
  .doc {
    display: grid;
    grid-template-columns: 180px minmax(0, var(--measure));
    gap: 20px 40px;
    justify-content: center;
    align-items: start;
  }
  .doc .toc {
    position: sticky;
    top: 16px;
    margin-top: 6px;
  }
  .shot { flex-basis: 52%; }
}

@media (min-width: 1400px) {
  .spine {
    display: block;
    position: fixed;
    top: 28vh;
    left: 10px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--muted);
  }
}

/* home: the lead tile's note only exists on that first link */
.tile-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  max-width: 28ch;
}

/* category: keep the pager off the folio rule */
.cat .pager { margin-bottom: 42px; }

/* audit fixes */
.form label.check { display: flex; align-items: center; gap: 8px; }
.form .check input { width: 16px; height: 16px; margin: 0; flex: none; }
@media (min-width: 1040px) {
  .picks-grid { align-items: start; }
  .shelf-lead .tile:first-child {
    justify-content: center;
    align-self: stretch;
    padding: 18px 16px;
    background: var(--paper-2);
    border-top: 3px solid var(--seal);
  }
}

/* seo: текст вступления после первого блока программ */
.home-about { margin-top: 32px; margin-bottom: 32px; }
.home-about__body { margin-top: 10px; }
/* seo: на телефоне заголовок главной меньше, подпись мельче */
@media (max-width: 719px) { .home h1, .home-intro h1 { font-size: 2.1rem; } .signoff { margin-top: 8px; } .signoff img { width: 34px; height: 34px; } }
@media (min-width: 720px) {
  .home h1 { font-size: clamp(2.35rem, 5vw, 3.6rem); max-width: 18ch; }
  .signoff { margin-top: 14px; }
  .picks { margin-top: 18px; }
}

/* сеть: шапка — поиск слева от марки, кнопка входа и колокольчик одной высоты */
:root { --ctl: 40px; }
.mast { grid-template-areas: "burger user" "brand brand" "tag tag" "find find" "nav nav"; }
.deskfind { grid-area: find; display: flex; align-items: center; gap: 0; border: 1px solid var(--ink); background: #fffaf3; height: var(--ctl); min-width: 0; }
.deskfind .ui-ico { width: 15px; height: 15px; margin: 0 8px 0 12px; opacity: .7; }
.deskfind input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 8px 0 0; appearance: none; outline-offset: -2px; }
.deskfind .btn { height: calc(var(--ctl) - 2px); padding: 0 14px; display: inline-flex; align-items: center; }
.user .btn, .user .signin { height: var(--ctl); display: inline-flex; align-items: center; padding: 0 16px; color: #fffaf6; font-weight: 600; letter-spacing: .02em; }
.user .btn:hover { color: #fffaf6; }
.user .out { height: var(--ctl); display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--ink); }
.user .out:hover { border-color: var(--seal); }
.bell-btn { width: var(--ctl); height: var(--ctl); display: inline-grid; place-items: center; border: 1px solid var(--ink); background: #fffaf3; position: relative; padding: 0; }
.bell-btn .bell-n { position: absolute; top: -7px; right: -7px; }
.bell.is-open .bell-drop { display: block; }
.who .avatar { width: var(--ctl); height: var(--ctl); }
@media (max-width: 699px) {
  .tag { display: none; }
  .brandline { margin-top: 0; }
  .brand { font-size: 1.4rem; }
  .brand-mark { width: 38px; height: 38px; }
  .navbtn .when-shut + .when-shut, .navbtn span { font-size: .8rem; }
  .who span:not(.avatar) { display: none; }
  .bell-drop { position: absolute; right: 0; left: auto; top: calc(100% + 8px); width: min(300px, calc(100vw - 24px)); z-index: 40; }
}
@media (min-width: 700px) {
  .mast { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "find brand user" "tag tag tag" "nav nav nav"; gap: 6px 22px; }
  .deskfind { max-width: 320px; justify-self: start; width: 100%; }
}
@media (min-width: 700px) and (max-width: 899px) { .deskfind .btn { display: none; } }

/* сеть: лента с поиском, когда шапка ушла за край */
.ribbon { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: rgba(243, 238, 228, .96); border-bottom: 1px solid var(--ink); transform: translateY(-110%); transition: transform .2s ease; }
.has-ribbon .ribbon { transform: none; }
.ribbon-home { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--serif); font-size: 1.1rem; letter-spacing: .04em; flex: none; }
.ribbon-home img { width: 30px; height: 30px; }
.ribbon-find { flex: 1 1 auto; display: flex; max-width: 460px; margin-left: auto; border: 1px solid var(--ink); background: #fffaf3; height: 38px; }
.ribbon-find input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 0 12px; appearance: none; outline-offset: -2px; }
.ribbon-find .btn { height: 36px; width: 42px; padding: 0; display: inline-grid; place-items: center; }
.ribbon-find .btn .ui-ico { filter: invert(1) brightness(2); }
.has-ribbon .readbar { top: 55px; }
@media (max-width: 420px) { .ribbon-home { font-size: 0; gap: 0; } }
@media (prefers-reduced-motion: reduce) { .ribbon { transition: none; } }

/* сеть: текст во всю ширину рабочей области */
.home-about .lede, .home-about__body, .wrap > .lede { max-width: none; margin-left: 0; }
.panes .prose { max-width: none; }
.comments, .faq { max-width: none; }

/* сеть: «выставочный зал» — работа в паспарту и музейная табличка */
.shots.is-hung { display: none; }
.shotbar.is-hung { margin-bottom: 10px; }
.hall { display: grid; gap: 16px; outline-offset: 4px; }
.hall-mat { display: block; background: #fffdf8; padding: clamp(10px, 3vw, 28px); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 0 18px 30px -22px rgba(28, 23, 20, .45); outline: 1px solid var(--ink); outline-offset: -6px; }
.hall-mat img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; background: var(--paper-2); }
.hall-label { align-self: start; background: #fffdf8; border: 1px solid var(--line); border-left: 3px solid var(--seal); padding: 14px 16px 16px; font-size: .9rem; }
.hall-no { margin: 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--seal); font-weight: 600; }
.hall-cap { margin: 6px 0 0; font-family: var(--serif); font-style: italic; color: var(--muted); line-height: 1.4; }
.hall-seals { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.hall-seal { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--seal); background: transparent; color: var(--seal); font-family: var(--serif); font-size: .95rem; padding: 0; transform: rotate(-6deg); }
.hall-seal:nth-child(even) { transform: rotate(5deg); }
.hall-seal[aria-pressed="true"] { background: var(--seal); color: #fffaf6; }
.hall-nav { display: flex; gap: 8px; margin: 14px 0 0; }
.hall-nav button { flex: 1; height: 36px; background: none; border: 1px solid var(--ink); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.hall-nav button:hover { border-color: var(--seal); color: var(--seal); }
@media (min-width: 860px) { .hall { grid-template-columns: minmax(0, 1fr) 220px; gap: 22px; } }

/* сеть: кнопки на странице программы одной высоты */
.acts > a, .acts > button { height: 42px; display: inline-flex; align-items: center; padding: 0 16px; line-height: 1; }
.acts .textbtn, .acts .fav { border: 1px solid var(--ink); text-decoration: none; background: #fffaf3; }
.acts .textbtn:hover, .acts .fav:hover { border-color: var(--seal); color: var(--seal); }
.acts .btn { font-weight: 600; }
.panes .prose ul, .panes .prose ol, .panes .prose p { max-width: none; }
/* сеть: главная подборка — карточка с печатью, без пустоты под ней */
@media (min-width: 1040px) {
  .picks-grid { align-items: stretch; }
  .pick-lead { align-content: center; background: var(--paper-2); border-top: 3px solid var(--seal); padding: 24px 22px; grid-template-columns: 96px 1fr; }
  .pick-lead img { width: 96px; height: 96px; }
  .pick-lead h3 { font-size: 2.3rem; }
}
/* сеть: окно открывает скрипт снятием hidden */
.dlg:not([hidden]) { display: flex; }
.dlg-body .mirror { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.dlg-body .mirror h3 { margin: 0 0 8px; font-size: 1.1rem; }
.dlg-body .mirror p { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.dlg-body .mirror .btn, .dlg-body .mirror .textbtn { height: 40px; display: inline-flex; align-items: center; padding: 0 14px; }
.dlg-body .mirror .textbtn { border: 1px solid var(--ink); text-decoration: none; }
.dlg-card { max-height: 88vh; overflow: auto; }
.fav[aria-pressed="true"] { color: var(--seal); border-color: var(--seal); }
