/* ============ Top bar ============ */
#top { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(6px); z-index: 20; }
.top-in { height: 100%; display: flex; align-items: center; gap: 18px; padding: 0 var(--pad); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.wm { font: 850 25px/1 var(--f-head); letter-spacing: -0.04em; }
.top-tag { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-tag .sep { margin: 0 8px; color: var(--mark); }
.top-now { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.top-act { display: flex; gap: 6px; align-items: center; }
.t-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border: 1px solid transparent; border-radius: var(--r); background: none; font-size: 14px; font-weight: 600; text-decoration: none; }
.t-btn:hover { border-color: var(--rule); background: var(--card); }
.t-sub { background: var(--ink); color: var(--paper); }
.t-sub:hover { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.t-staff { font-size: 12px; border-color: var(--rule); }

/* ============ Rail: the folio of pages ============ */
#rail { display: flex; align-items: stretch; gap: 8px; padding: 9px var(--pad) 11px; border-top: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 90%, transparent); z-index: 20; }
.r-step { flex: none; width: 46px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); display: grid; place-items: center; }
.r-step:not(:disabled):hover { border-color: var(--ink); }
.r-list { flex: 1; min-width: 0; list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.r-item { height: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-content: center; padding: 0 12px; border-radius: var(--r); text-decoration: none; color: var(--ink-2); transition: background .15s, color .15s; }
.r-item:hover { background: var(--card); color: var(--ink); }
.r-thumb { grid-row: 1 / 3; width: 42px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.3; opacity: .75; }
.r-num { font-size: 11px; color: var(--ink-3); align-self: end; }
.r-lbl { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: start; }
.r-item.on { background: var(--ink); color: var(--paper); }
.r-item.on .r-num { color: var(--ice); }
.r-item.on .r-thumb { opacity: 1; }

/* ============ Stage and spreads ============ */
#stage { min-height: 0; padding: calc(var(--pad) + 2px) calc(var(--pad) + 6px); overflow: hidden; outline: none; }
.spread { height: 100%; display: grid; gap: var(--gap); }
.pad-l { padding: 32px; }
.tile { background: var(--card); border-radius: var(--r); min-width: 0; min-height: 0; container-type: size; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
a.tile { transition: box-shadow .2s; }
a.tile:hover { box-shadow: inset 0 -4px 0 var(--sec, var(--brand)); }
a.tile:hover .t-h, .brief:hover .b-h { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--sec, var(--brand)); }

.slug { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.slug span::before { content: '/'; margin-right: 8px; color: var(--mark); }
.sq { display: inline-block; width: 9px; height: 9px; background: var(--sec, var(--ink)); flex: none; margin-right: 1px; }
.t-img { margin: 0; overflow: hidden; background: var(--sheet); border-radius: var(--r) var(--r) 0 0; }
.t-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.tile:hover .t-img img { transform: scale(1.03); }
.t-body { padding: 16px 20px 16px; display: flex; flex-direction: column; gap: 9px; min-height: 0; overflow: hidden; flex: 0 1 auto; }
.t-h { font-weight: 760; font-size: 19px; line-height: 1.18; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.dek { color: var(--ink-2); font-size: 14.5px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.t-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--ink-3); margin-top: auto; padding-top: 2px; }
.t-foot span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-foot span:last-child { white-space: nowrap; }

/* Lead */
.t-lead .t-imgwrap { position: relative; flex: 1 1 0; min-height: 90px; }
.t-lead .t-img { position: absolute; inset: 0; }
.t-lead .t-h { font-size: clamp(24px, 1.3vw + 1.4vh, 38px); line-height: 1.08; font-weight: 820; letter-spacing: -0.025em; }
.t-lead .dek { font-size: 16px; -webkit-line-clamp: 2; }
.t-lead .t-body { padding: 18px 24px 18px; gap: 11px; }
.keytag { position: absolute; left: 18px; bottom: 18px; max-width: min(320px, 70%); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; padding: 10px 14px 10px 12px; background: var(--ink); color: var(--paper); border-radius: var(--r); }
.keytag b { font: 850 30px/1 var(--f-head); letter-spacing: -0.03em; color: var(--ice); }
.keytag small { font-size: 12.5px; line-height: 1.3; color: color-mix(in srgb, var(--paper) 85%, transparent); }
.fc { margin: 2px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.fc > div { padding: 10px 14px 10px 0; }
.fc .fc-c { padding: 10px 0 10px 14px; border-left: 1px solid var(--rule); }
.fc dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sec, var(--brand)); font-weight: 700; margin-bottom: 3px; }
.fc .fc-c dt { color: var(--brand); }
.fc dd { margin: 0; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* Image tiles */
.t-img-tile .t-img { flex: 1 1 0; min-height: 70px; }
.t-img-tile .t-h { font-size: clamp(17px, .6vw + 1vh, 21px); }

/* Briefs band */
.briefs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
.brief { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; min-height: 0; overflow: hidden; }
.brief + .brief { border-left: 1px solid var(--rule); }
.b-h { font-size: 16px; font-weight: 740; line-height: 1.22; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.b-catch { font-size: 13px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.b-catch b { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-right: 4px; }

/* Row tiles */
.t-row { flex-direction: row; }
.t-row .t-img { flex: 0 0 38%; border-radius: var(--r) 0 0 var(--r); }
.t-row .t-body { flex: 1; padding: 14px 18px; gap: 7px; }
.t-row .t-h { font-size: 17px; }
.t-row .dek { font-size: 13.5px; -webkit-line-clamp: 2; }
.tested { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); white-space: nowrap; }
.tested svg { color: var(--sec, var(--ink)); }

/* Room-aware tiles: drop secondary lines before anything gets cut. */
@container (max-height: 560px) { .t-lead .dek { display: none; } }
@container (max-height: 470px) { .t-lead .fc { display: none; } }
@container (max-height: 380px) { .t-img-tile .dek { display: none; } }
@container (max-height: 300px) { .t-img-tile .t-img { display: none; } .t-img-tile .t-h { -webkit-line-clamp: 4; } }
@container (max-height: 185px) { .t-row .dek { display: none; } }
@container (max-height: 150px) { .t-row .t-h { -webkit-line-clamp: 2; } }
@container (max-width: 360px) { .t-row .t-img { display: none; } }
@container (max-height: 186px) { .brief .b-catch { display: none; } }

/* ============ Front page ============ */
.front { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); }
.a-lead { grid-column: 1 / 7; grid-row: 1 / 7; }
.a-s1 { grid-column: 7 / 10; grid-row: 1 / 5; }
.a-s2 { grid-column: 10 / 13; grid-row: 1 / 5; }
.a-br { grid-column: 7 / 13; grid-row: 5 / 7; }
.dots { display: none; }

/* ============ Section page ============ */
.sect { grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 4fr); grid-template-rows: repeat(3, minmax(0, 1fr)); }
.a-head { grid-column: 1; grid-row: 1 / 4; }
.a-big { grid-column: 2; grid-row: 1 / 4; }
.a-r1 { grid-column: 3; grid-row: 1; }
.a-r2 { grid-column: 3; grid-row: 2; }
.a-r3 { grid-column: 3; grid-row: 3; }
.sec-head { padding: 24px 24px 20px; gap: 10px; background: var(--card); border-top: 6px solid var(--sec); }
.sec-no { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.sec-name { font-size: clamp(34px, 2.6vw + 1vh, 58px); font-weight: 860; line-height: .95; letter-spacing: -0.045em; color: var(--sec); overflow-wrap: anywhere; }
.sec-blurb { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.sec-stats { display: flex; gap: 22px; margin: 6px 0 0; }
.sec-stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.sec-stats dd { margin: 0; font: 760 17px var(--f-head); }
.sec-lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-top: 8px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 8px; border: 1px solid var(--rule); border-radius: var(--r); }
.chip b { color: var(--sec); }
.where { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.where li { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 0; border: 1px dashed var(--rule); border-radius: var(--r); color: var(--ink-3); font-size: 12px; }
.where li.on { border-style: solid; border-color: var(--sec); color: var(--ink); }
.where li.on svg { color: var(--sec); }
.sec-all, .sec-next { font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); }
.sec-next { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--ink); font-weight: 600; }
.sec-next:hover, .sec-all:hover { color: var(--sec); }

/* ============ Index ============ */
.idx { grid-template-columns: 290px minmax(0, 1fr); }
.ix-side { padding: 22px; gap: 10px; }
.ix-h { font-size: 30px; font-weight: 840; line-height: 1; letter-spacing: -0.035em; }
.ix-n { font-size: 12px; color: var(--ink-3); }
.ix-search { position: relative; margin-top: 6px; }
.ix-search svg { position: absolute; left: 11px; top: 13px; color: var(--ink-3); }
.ix-search .field { padding-left: 34px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { font-size: 12px; padding: 6px 9px; border: 1px solid var(--rule); border-radius: var(--r); background: none; }
.fchip:hover { border-color: var(--ink); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.ix-cols, .ix-row { display: grid; grid-template-columns: 74px 128px minmax(0, 1fr) 118px 104px minmax(0, 190px); gap: 16px; align-items: center; padding: 0 22px; }
.ix-cols { flex: none; height: 44px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); border-bottom: 2px solid var(--ink); }
.ix-list { --row: 60px; flex: 1 1 0; min-height: 0; list-style: none; margin: 0; padding: 0; overflow: hidden; }
.ix-row { height: var(--row); text-decoration: none; border-bottom: 1px solid var(--rule); font-size: 14px; }
.ix-row:hover { background: var(--sheet); }
.ix-row:hover .ix-t { text-decoration: underline; text-decoration-color: var(--sec); }
.ix-date, .ix-sec, .ix-kind { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-sec { display: flex; align-items: center; gap: 7px; }
.ix-t { font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ix-shown { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.ix-shown svg { color: var(--sec); flex: none; }
.ix-size { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-none { padding: 30px 22px; color: var(--ink-2); }
.ix-pager { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 12px; height: 56px; padding: 0 18px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-2); }

/* ============ Decks (figures, about) ============ */
.figs { grid-template-rows: auto minmax(0, 1fr); }
.deck-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 18px 22px; container-type: inline-size; }
.deck-h { font-size: clamp(26px, 1.5vw + 1vh, 38px); font-weight: 840; line-height: 1.02; letter-spacing: -0.035em; }
.deck-h.sm { font-size: 22px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--sheet); border-radius: calc(var(--r) + 2px); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 9px 14px; border: 0; border-radius: var(--r); background: none; font-weight: 650; font-size: 14px; color: var(--ink-2); }
.tabs [role="tab"] span { font-size: 11px; color: var(--ink-3); }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tabs [role="tab"][aria-selected="true"] span { color: var(--ice); }
.deck-body { padding: 22px; }
.panel { height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 16px; animation: fade .3s ease; }
.panel-intro { max-width: 72ch; color: var(--ink-2); font-size: 15.5px; }

.fig-grid { flex: 1 1 0; min-height: 0; display: grid; gap: 16px; }
.fig { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--sheet); border-radius: var(--r); text-decoration: none; overflow: hidden; border-top: 4px solid var(--sec); }
.fig::before { inset: -8px; }
.fig:hover { background: color-mix(in srgb, var(--sec) 10%, var(--sheet)); }
.fig-n { font: 860 clamp(30px, 2vw + 1vh, 46px)/1 var(--f-head); letter-spacing: -0.04em; color: var(--sec); }
.fig-l { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.fig-s { margin-top: auto; display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.figs .ix-pager { padding: 0; height: 40px; border: 0; }

.shown { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.sh-col { padding: 0 18px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.sh-col + .sh-col { border-left: 1px solid var(--rule); }
.sh-h { display: flex; align-items: center; gap: 8px; font-size: 17px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.sh-h span { margin-left: auto; font-size: 26px; font-weight: 700; }
.sh-hint { font-size: 13px; color: var(--ink-2); line-height: 1.4; min-height: 3.6em; }
.sh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sh-list a { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; line-height: 1.3; text-decoration: none; padding: 7px 9px; background: var(--sheet); border-radius: var(--r); }
.sh-list a:hover { background: color-mix(in srgb, var(--sec) 14%, var(--sheet)); }
.sh-list .sq { transform: translateY(1px); }

.cal-panel { justify-content: center; }
.cal-wrap { flex: 1 1 0; min-height: 0; display: grid; place-items: center; }
.cal { width: 100%; height: 100%; max-height: 380px; }
.cal-yr { stroke: var(--rule); stroke-dasharray: 3 4; }
.cal-yt { font: 600 13px var(--f-mono); fill: var(--ink-3); }
.cal-lane { font: 700 14px var(--f-head); fill: var(--ink); }
.cal-line { stroke: var(--rule); stroke-width: 2; }
.cal-dot circle { fill: var(--sec); stroke: var(--card); stroke-width: 3; transition: r .15s; cursor: pointer; }
.cal-dot:hover circle, .cal-dot:focus circle, .cal-dot.on circle { r: 13; stroke: var(--ink); stroke-width: 2; }
.cal-dot:focus { outline: none; }
.cal-card { flex: none; min-height: 92px; padding: 14px 18px; background: var(--sheet); border-radius: var(--r); display: grid; gap: 5px; align-content: center; color: var(--ink-2); }
.cal-t { font: 760 18px/1.2 var(--f-head); color: var(--ink); text-decoration: none; }
.cal-t:hover { text-decoration: underline; }
.cal-k { font-size: 13px; }
.cal-k b { color: var(--brand); }

/* About */
.shape { list-style: none; margin: auto 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.shape li { padding: 20px; background: var(--sheet); border-radius: var(--r); display: grid; gap: 8px; align-content: start; }
.shape li span { font-size: 40px; font-weight: 700; color: var(--brand); line-height: 1; }
.shape li b { font: 780 20px var(--f-head); }
.shape li p { color: var(--ink-2); font-size: 14.5px; }
.labels { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; min-height: 0; }
.defs { margin: 6px 0 0; display: grid; gap: 0; }
.defs div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.defs dt { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.defs dd { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }
.limits { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 34px; }
.limits h2 { font-size: 20px; font-weight: 780; margin-bottom: 6px; }
.limits p { color: var(--ink-2); font-size: 15px; max-width: 60ch; }
.letter { justify-content: center; align-items: center; text-align: left; }
.letter > div { max-width: 520px; display: grid; gap: 14px; }
.letter a { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.sub { display: grid; gap: 10px; }
.sub-msg { font-size: 12.5px; color: var(--ink-2); min-height: 1.2em; }

/* ============ Reader ============ */
.reader { height: 100%; display: grid; grid-template-columns: minmax(320px, 36%) minmax(0, 1fr); gap: var(--gap); }

.rd-cover { position: relative; margin: 0; flex: 1 1 0; min-height: 120px; max-height: 58%; overflow: hidden; border-radius: var(--r) var(--r) 0 0; background: var(--sheet); }
.rd-cover img { width: 100%; height: 100%; object-fit: cover; }
.rd-head { padding: 20px 26px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; flex: 0 1 auto; }
.rd-h { font-size: clamp(25px, 1.3vw + 1.2vh, 38px); line-height: 1.07; font-weight: 830; letter-spacing: -0.03em; }
.rd-dek { font-size: 16px; color: var(--ink-2); line-height: 1.45; }
.rd-by { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
@container (max-height: 640px) { .rd-dek { display: none; } }
@container (max-height: 520px) { .rd-cover { display: none; } }


.rd-view { flex: 1 1 0; min-height: 0; padding: 26px 32px 6px; overflow: hidden; touch-action: pan-y; }
.flow { position: relative; height: 100%; column-fill: auto; overflow: hidden; }
.prose { font-size: 16.5px; line-height: 1.62; }
.prose p { margin: 0 0 .85em; }
.prose h2 { font-size: 19px; font-weight: 780; margin: .4em 0 .5em; line-height: 1.2; break-after: avoid; break-inside: avoid; }
.prose h2::before { content: ''; display: block; width: 26px; height: 3px; background: var(--sec); margin-bottom: 9px; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 .85em; }
.prose blockquote { margin: 0 0 1em; padding-left: 14px; border-left: 3px solid var(--sec); font-weight: 600; }
.prose em { font-style: italic; }
.factbox { break-inside: avoid; margin: 0 0 1.2em; padding: 14px 16px 6px; background: var(--sheet); border-radius: var(--r); }
.factbox .fc { grid-template-columns: 1fr; border-top: 0; }
.factbox .fc > div, .factbox .fc .fc-c { padding: 0 0 10px; border-left: 0; }
.factbox .fc dd { -webkit-line-clamp: unset; display: block; font-size: 15px; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.facts div { display: contents; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 7px 14px 7px 0; border-top: 1px solid var(--rule); }
.facts dd { margin: 0; font-size: 14px; line-height: 1.35; padding: 6px 0; border-top: 1px solid var(--rule); }
.src { font-size: 14px; color: var(--ink-2); padding-top: 10px; border-top: 1px solid var(--rule); }
.src b { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-right: 6px; color: var(--ink); }
.note { font-size: 11.5px; color: var(--ink-3); }
.upnext { break-inside: avoid; display: grid; gap: 8px; margin-top: 1.4em; }
.up-k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.up-item { display: grid; gap: 3px; padding: 11px 13px; background: var(--sheet); border-left: 3px solid var(--sec); text-decoration: none; line-height: 1.3; }
.up-item span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.up-item b { font-weight: 700; font-size: 15px; }
.up-item:hover b { text-decoration: underline; }
.rd-bar { flex: none; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-top: 1px solid var(--rule); }
.rd-close, .rd-copy { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; text-decoration: none; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: none; }
.rd-close:hover, .rd-copy:hover { border-color: var(--ink); }
.rd-pager { display: flex; align-items: center; gap: 12px; }
.rd-count { font-size: 12px; color: var(--ink-2); min-width: 92px; text-align: center; }
.rd-pips { display: flex; gap: 5px; }
.rd-pips i { width: 18px; height: 3px; background: var(--rule); border-radius: 2px; }
.rd-pips i.on { background: var(--sec, var(--ink)); }
#pg-next.to-next { width: auto; padding: 0 14px; border-radius: var(--r); background: var(--ink); color: var(--paper); border-color: var(--ink); }
#pg-next.to-next::before { content: 'Next story'; font: 600 12px var(--f-mono); margin-right: 4px; }

/* ============ Overlays ============ */
#layer { position: fixed; inset: 0; z-index: 70; display: none; }
#layer.open { display: block; }
.veil { position: absolute; inset: 0; background: rgba(12, 10, 16, .5); animation: fade .2s ease; }
.dlg { position: absolute; left: 50%; top: 12vh; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5); animation: fade .2s ease; }
.s-form { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.s-input { flex: 1; border: 0; background: none; font-size: 20px; font-weight: 600; outline: none; padding: 6px 0; }
.s-list { list-style: none; margin: 8px 0 0; padding: 0; }
.s-hit { display: grid; gap: 2px; padding: 10px 10px; border-radius: var(--r); text-decoration: none; border-left: 3px solid var(--sec); margin-top: 4px; }
.s-hit:hover, .s-hit:focus { background: var(--sheet); outline: none; }
.s-meta { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.s-t { font-weight: 680; line-height: 1.25; }
.s-none { padding: 18px 10px; color: var(--ink-2); }
.s-foot { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
.dlg-sub { padding: 26px; display: grid; gap: 12px; width: min(460px, calc(100vw - 32px)); }
.dlg-x { position: absolute; right: 14px; top: 14px; }
.kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
.dlg-h { font-size: 28px; font-weight: 840; letter-spacing: -0.03em; }
.dlg-p { color: var(--ink-2); }

/* ============ 404, auth, staff ============ */
.lost { max-width: 560px; margin: 6vh auto 0; padding: 36px; gap: 12px; height: auto; container-type: normal; }
.lost-a { display: flex; gap: 10px; margin-top: 8px; }
.auth { height: 100%; display: grid; place-items: center; }
.auth-card { width: min(420px, 100%); padding: 28px; height: auto; container-type: normal; }
.staff-h { margin: 6px 0 18px; display: grid; gap: 8px; }
.staff-sec { margin-top: 30px; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--r); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin-table th { font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.actions { white-space: nowrap; }
.subs { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.subs li { display: flex; gap: 14px; align-items: center; padding: 8px 12px; background: var(--card); border-radius: var(--r); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
.ed-cover { margin-top: 8px; border-radius: var(--r); }
.preview { background: var(--card); padding: 18px; border-radius: var(--r); }

/* ============ Tablet ============ */
@media (max-width: 1099px) {
  .top-tag { display: none; }
  .r-thumb { display: none; }
  .r-item { grid-template-columns: 1fr; padding: 0 8px; text-align: center; }
  .front { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr); }
  .a-lead { grid-column: 1 / 3; grid-row: 1 / 3; }
  .a-s1 { grid-column: 3; grid-row: 1; }
  .a-s2 { grid-column: 3; grid-row: 2; }
  .a-br { grid-column: 1 / 4; grid-row: 3; }
  .sect { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto repeat(3, minmax(0, 1fr)); }
  .a-head { grid-column: 1 / 3; grid-row: 1; container-type: inline-size; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "no no no" "name blurb next"; column-gap: 24px; align-items: center; padding: 16px 20px; }
  .a-head .sec-no { grid-area: no; }
  .a-head .sec-name { grid-area: name; font-size: 40px; }
  .a-head .sec-blurb { grid-area: blurb; }
  .a-head .sec-next { grid-area: next; margin: 0; padding: 0; border: 0; }
  .a-head .sec-stats, .a-head .sec-lbl, .a-head .chips, .a-head .where, .a-head .sec-all { display: none; }
  .a-big { grid-column: 1; grid-row: 2 / 5; }
  .a-r1 { grid-column: 2; grid-row: 2; }
  .a-r2 { grid-column: 2; grid-row: 3; }
  .a-r3 { grid-column: 2; grid-row: 4; }
  .idx { grid-template-columns: 240px minmax(0, 1fr); }
  .ix-cols, .ix-row { grid-template-columns: 70px minmax(0, 1fr) 96px; }
  .ix-cols span:nth-child(2), .ix-cols span:nth-child(4), .ix-cols span:nth-child(6), .ix-sec, .ix-kind, .ix-size { display: none; }
  .shape { grid-template-columns: 1fr 1fr; }
  .shown { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; row-gap: 14px; }
  .sh-col:nth-child(3) { border-left: 0; }
  .sh-hint { display: none; }
  .reader { grid-template-columns: minmax(260px, 34%) minmax(0, 1fr); }
}

/* ============ Phone ============ */
@media (max-width: 759px) {
  .top-in { gap: 8px; }
  .wm { font-size: 22px; }
  .top-now { display: none; }
  .top-act { margin-left: auto; }
  .t-lbl, .t-btn kbd { display: none; }
  .t-btn { padding: 0 8px; }
  #rail { padding: 6px 8px 8px; gap: 6px; }
  .r-step { width: 38px; }
  .r-list { display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .r-list li { flex: none; }
  .r-item { padding: 0 10px; }
  .r-num { font-size: 10px; }
  .r-lbl { font-size: 13px; }
  #stage { padding: 12px 14px 8px; }

  /* Spreads become a sideways deck of tiles with a dot row. */
  .front, .sect { display: flex; height: calc(100% - 22px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; padding: 0 2px; }
  .front > *, .sect > * { flex: 0 0 88%; scroll-snap-align: center; }
  .crop::before { inset: -7px; --m: linear-gradient(transparent, transparent); }
  .dots { display: flex; justify-content: center; gap: 6px; height: 22px; align-items: center; }
  .dots button { width: 22px; height: 4px; padding: 0; border: 0; border-radius: 2px; background: var(--rule); }
  .dots button.on { background: var(--ink); }
  .briefs { grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .brief + .brief { border-left: 0; border-top: 1px solid var(--rule); }
  .t-row { flex-direction: column; }
  .t-row .t-img { flex: 1 1 0; border-radius: var(--r) var(--r) 0 0; }
  .t-row .t-body { flex: 0 1 auto; }
  .a-head { display: flex; container-type: size; align-items: stretch; }
  .a-head .sec-stats, .a-head .sec-lbl, .a-head .chips, .a-head .where { display: revert; }
  .a-head .where { display: grid; }
  .a-head .chips { display: flex; }

  .idx { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
  .ix-side { padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; container-type: normal; }
  .ix-side .sec-no, .ix-side .ix-h, .ix-side .sec-lbl, .ix-side .fchips:nth-of-type(2) { display: none; }
  .ix-side .ix-n { grid-column: 1 / 3; order: 9; }
  .ix-side .ix-search { margin: 0; grid-column: 1 / 3; }
  .ix-side .fchips { grid-column: 1 / 3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ix-side .fchip { flex: none; }
  .ix-side select { grid-column: 1 / 3; }
  .ix-cols { display: none; }
  .ix-list { --row: 76px; }
  .ix-row { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 3px 10px; padding: 0 14px; align-content: center; }
  .ix-date { grid-row: 1; grid-column: 1; }
  .ix-t { grid-row: 2; grid-column: 1 / 3; }
  .ix-shown { grid-row: 1; grid-column: 2; }
  .ix-pager { height: 48px; }

  .deck-head { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
  .deck-body { padding: 14px; }
  .tabs [role="tab"] { padding: 8px 10px; font-size: 13px; }
  .panel { overflow-y: auto; }
  .shape { grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
  .shape li { padding: 12px; }
  .shape li span { font-size: 26px; }
  .shape li b { font-size: 16px; }
  .shape li p { font-size: 13px; }
  .labels, .limits { grid-template-columns: 1fr; gap: 16px; }
  .defs div { grid-template-columns: 1fr; gap: 2px; }
  .shown { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .sh-col { flex: 0 0 85%; scroll-snap-align: start; border-left: 0 !important; padding: 0 10px 0 0; }
  .cal-lane { font-size: 22px; }

  .reader { grid-template-columns: 1fr; }
  .rd-view { padding: 16px 18px 4px; }
  .rd-coverpage { break-after: column; display: flex; flex-direction: column; gap: 10px; height: 100%; overflow: hidden; }
  .rd-coverpage .rd-cover { flex: 1 1 0; max-height: none; margin: 0 0 4px; border-radius: var(--r); min-height: 100px; }
  .rd-coverpage .rd-h { font-size: 25px; }
  .rd-coverpage .rd-dek { font-size: 15px; }
  .rd-bar { height: 52px; padding: 0 10px; gap: 6px; }
  .rd-close span, .rd-copy span, .rd-pips { display: none; }
  .rd-count { min-width: 0; }
  #pg-next.to-next::before { content: 'Next'; }
  .editor { grid-template-columns: 1fr; }
}

@media (max-height: 560px) and (min-width: 760px) {
  /* Very short windows: let the stage scroll rather than crush the layout. */
  #stage { overflow-y: auto; }
  .spread { height: auto; min-height: 520px; }
  .reader { height: 520px; }
}

/* Pull quote (one per pipeline story): larger line in the section ink, kept inside the column. */
.prose blockquote { margin: .4em 0 1.1em; padding: 4px 0 4px 16px; border-left: 4px solid var(--sec); font-size: 1.18em; line-height: 1.4; font-weight: 650; break-inside: avoid; }
