:root {
  --bg: #fcfbf8; --surface: #ffffff; --ink: #1d1c19; --ink-2: #6f6b63; --line: #e7e3db;
  --accent: #1d1c19; --on-accent: #ffffff; --rust: #b0532a; --pick: #b0532a; --danger: #b42318; --ok: #2f6b3a;
  --serif: Newsreader, 'Iowan Old Style', Georgia, serif; --sans: Inter, system-ui, -apple-system, sans-serif;
  --radius: 3px; --gap: 14px; --pad: max(18px, 4vw);
  color-scheme: light;
}
/* Clients always get the bright gallery; dark mode only applies to your admin. */
@media (prefers-color-scheme: dark) {
  body.admin { --bg: #12110e; --surface: #1a1915; --ink: #ece6d8; --ink-2: #9b9484; --line: #302c25;
    --accent: #ece6d8; --on-accent: #12110e; --rust: #d9703f; --pick: #d9703f; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html.noscroll { overflow: hidden; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; margin-top: 18px; }
.muted { color: var(--ink-2); } .small { font-size: 13px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); padding: 2px 6px; border-radius: 3px; }
[hidden] { display: none !important; }

/* buttons: squared, small caps labels */
.btn { appearance: none; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 600 11.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  padding: 12px 18px; border-radius: var(--radius); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--bg)); }
.btn.ghost { border-color: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.btn:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }

.brand { font: 600 11.5px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; text-decoration: none; }
.kicker { font: 600 11.5px/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; margin: 0; }

/* gate */
body.center { min-height: 100dvh; display: grid; place-items: center; padding: 32px var(--pad); }
.gate { width: 100%; max-width: 560px; }
.gate .brand { display: inline-block; padding-bottom: 14px; margin-bottom: 56px; border-bottom: 2px solid var(--ink); }
.gate h1 { font: 400 clamp(52px, 11vw, 88px)/.92 var(--serif); letter-spacing: -0.03em; }
.gate h1 em { color: var(--rust); font-weight: 300; }
.gate-dek { font: 300 21px/1.45 var(--serif); color: var(--ink-2); margin: 22px 0 0; max-width: 30em; }
.gate-form { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.gate-form input { flex: 1 1 220px; font: 500 22px/1 ui-monospace, Menlo, monospace; letter-spacing: .2em; text-transform: uppercase;
  padding: 12px 0; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); }
.gate-form input::placeholder { color: var(--line); }
.gate-form input:focus { outline: none; border-bottom-color: var(--rust); }
.gate-form .btn { padding: 14px 22px; }
.error { color: var(--danger); margin-top: 16px; }

/* hero */
.hero { position: relative; min-height: min(86vh, 920px); display: flex; flex-direction: column; justify-content: space-between; color: #f5f1e8; background: #1b1a17; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-select: none; animation: heroIn 1.1s ease both; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.38) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 48%, rgba(0,0,0,.62) 100%); pointer-events: none; }
.hero-top, .hero-text { position: relative; z-index: 1; padding: 22px var(--pad); }
.hero-text { padding-bottom: clamp(28px, 5vw, 64px); max-width: 1400px; }
.hero h1 { font: 400 clamp(46px, 8.5vw, 136px)/.9 var(--serif); letter-spacing: -0.035em; margin-top: 16px; text-wrap: balance; }
.hero.plain { min-height: 0; color: var(--ink); background: transparent; }
.hero.plain::after { display: none; }
.hero.plain .hero-text { padding-top: 12vh; border-bottom: 2px solid var(--ink); margin: 0 var(--pad); padding-left: 0; padding-right: 0; }
.hero.plain .kicker { color: var(--rust); }
@keyframes heroIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-img { animation: none; } }

/* dek + meta */
.dek { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 32px clamp(32px, 6vw, 96px); padding: clamp(36px, 6vw, 80px) var(--pad); max-width: 1500px; }
@media (max-width: 760px) { .dek { grid-template-columns: 1fr; } }
.dek-intro p { font: 300 clamp(20px, 2.2vw, 27px)/1.42 var(--serif); margin: 0 0 .8em; max-width: 34em; text-wrap: pretty; }
.dek-intro p:first-child::first-letter { float: left; font-weight: 400; font-size: 3.4em; line-height: .82; padding: .06em .08em 0 0; color: var(--rust); }
.dek-intro .dek-empty::first-letter { all: unset; }
.dek-intro .dek-empty { color: var(--ink-2); font-style: italic; }
.meta { margin: 0; border-top: 2px solid var(--ink); }
.meta div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.meta dt { font: 600 10.5px/1.9 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.meta dd { margin: 0; font: 400 17px/1.4 var(--serif); }

/* toolbar */
.toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  padding: 12px var(--pad); margin-bottom: var(--gap); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toolbar-note { margin: 0; font: italic 300 16px/1.4 var(--serif); color: var(--ink-2); flex: 1 1 320px; }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius); }
.seg button { border: 0; background: none; font: 600 11.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 11px 14px; cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--on-accent); }

.colophon { display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; margin: 40px var(--pad) 0; padding: 18px 0 110px; border-top: 2px solid var(--ink); font-size: 12.5px; color: var(--ink-2); }
.colophon .brand { color: var(--ink); }

/* admin header (kept simple) */
.top { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding: 22px var(--pad) 18px; }
.top-title { flex: 1 1 260px; }
.top-title h1 { font: 400 32px/1.05 var(--serif); letter-spacing: -0.02em; }
.top-title p { margin: 4px 0 0; font-size: 13px; }
.top-actions { display: flex; gap: 8px; }

/* justified-ish grid: rows of tiles sized by aspect ratio */
.grid { display: flex; flex-wrap: wrap; gap: var(--gap); padding: 0 var(--pad); }
.grid::after { content: ''; flex-grow: 999; }
.tile { --h: 320px; position: relative; margin: 0; height: var(--h); flex-grow: 1; aspect-ratio: var(--ar); max-width: 100%; border-radius: 0; overflow: hidden; background: var(--line); }
@media (max-width: 1100px) { .tile { --h: 240px; } }
@media (max-width: 640px) { .tile { --h: 150px; } :root { --gap: 6px; } }
.tile-open { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .25s ease, opacity .2s; }
.tile:hover img { transform: scale(1.015); }
.tile figcaption { position: absolute; left: 8px; bottom: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); opacity: 0; transition: opacity .2s; pointer-events: none; }
.tile:hover figcaption, .tile.picked figcaption { opacity: 1; }
.pick { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.28);
  display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.pick svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tile:hover .pick svg { opacity: .55; }
.tile.picked .pick { background: var(--pick); border-color: var(--pick); }
.tile.picked .pick svg { opacity: 1; stroke: var(--on-accent); }
.tile.picked { outline: 3px solid var(--pick); outline-offset: -3px; }
.note-dot { position: absolute; top: 12px; left: 12px; width: 10px; height: 10px; border-radius: 50%; background: #f5c400; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
@media (hover: none) { .pick svg { opacity: .55; } .tile figcaption { opacity: 1; } }

/* bottom bar */
.bar { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translate(-50%, 150%); transition: transform .25s ease;
  display: flex; align-items: center; gap: 18px; padding: 8px 8px 8px 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: 0 8px 30px rgba(0,0,0,.14); z-index: 20; width: max-content; max-width: calc(100% - 32px); }
.bar.show { transform: translate(-50%, 0); }
.bar-actions { display: flex; gap: 4px; }

/* download sheet */
.sheet { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); width: min(440px, calc(100% - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet-inner { padding: 22px; }
.sheet fieldset { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.sheet legend { font-size: 13px; margin-bottom: 6px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.opt:has(input:checked) { border-color: var(--ink); }
.opt input { margin-top: 4px; accent-color: var(--ink); }
.opt span { display: grid; } .opt small { color: var(--ink-2); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* viewer */
.viewer { position: fixed; inset: 0; background: #0b0b0b; color: #eee; z-index: 50; display: grid; grid-template-rows: auto 1fr auto; }
.v-top { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; font-size: 13px; }
.v-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-count { color: #999; }
.v-btn { background: none; border: 0; color: #eee; font-size: 18px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }
.v-btn:hover { background: rgba(255,255,255,.1); }
.v-stage { position: relative; overflow: hidden; touch-action: none; display: grid; place-items: center; cursor: zoom-in; }
.viewer.zoomed .v-stage { cursor: grab; }
.v-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transform-origin: center; will-change: transform; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.35); color: #fff; border: 0; width: 44px; height: 64px; font-size: 30px; cursor: pointer; border-radius: 8px; }
.v-prev { left: 10px; } .v-next { right: 10px; }
.viewer.zoomed .v-nav { opacity: 0; pointer-events: none; }
@media (hover: none) { .v-nav { display: none; } }
.v-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
.v-foot:empty { padding: 0; }
.viewer .btn { background: #222; color: #eee; border-color: #333; }
.viewer .btn.primary { background: #f1efea; color: #111; border-color: #f1efea; }
.v-noteinput { flex: 1 1 260px; max-width: 460px; font: inherit; padding: 9px 14px; border-radius: 999px; border: 1px solid #333; background: #181818; color: #eee; }
.v-state { font-weight: 600; } .v-note { margin: 0; color: #bbb; font-style: italic; }

.toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -150%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 60; transition: transform .25s ease; }
.toast.show { transform: translate(-50%, 0); }

/* admin */
body.admin { padding-bottom: 60px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 0 var(--pad) 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel h2 { margin-bottom: 4px; }
.panel.danger { background: transparent; border-style: dashed; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.form-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.form-grid input { font: inherit; color: var(--ink); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.form-grid label.check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; color: var(--ink); }
.form-grid label.check input { margin-top: 3px; accent-color: var(--ink); }
.form-grid label.check span { display: grid; } .form-grid label.check small { color: var(--ink-2); }
.form-actions { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 640px) { .list th:nth-child(3), .list td:nth-child(3), .list th:nth-child(5), .list td:nth-child(5) { display: none; } }
.stage { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.s-proof { color: #a05a00; } .s-delivery { color: var(--ok); } .s-closed { color: var(--ink-2); }
.share { display: flex; gap: 16px; flex-wrap: wrap; align-items: end; margin-top: 10px; }
.share > div { display: grid; gap: 2px; min-width: 0; } .share code { overflow-wrap: anywhere; }
.stages { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
details { margin-top: 14px; } summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.lr { display: flex; gap: 10px; align-items: start; margin-top: 12px; flex-wrap: wrap; }
.lr textarea { flex: 1 1 300px; font: 13px ui-monospace, Menlo, monospace; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); resize: vertical; }
.picks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.picks li { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.picks img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--line); }
.picks span { display: grid; min-width: 0; } .picks em { color: var(--ink-2); }
.drop { margin-top: 12px; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--ink-2); font-size: 14px; }
.drop.over { border-color: var(--ink); color: var(--ink); }
.progress { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.progress li { display: flex; justify-content: space-between; gap: 10px; }
.progress .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress .pstat { color: var(--ink-2); flex-shrink: 0; }
.progress .ok .pstat { color: var(--ok); } .progress .err, .progress .err .pstat { color: var(--danger); }
.thumbs { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.thumbs li { position: relative; font-size: 11px; color: var(--ink-2); }
.thumbs li.pending { opacity: .4; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--line); display: block; }
.thumbs span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.thumbs .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; opacity: 0; }
.thumbs li:hover .x, .thumbs .x:focus-visible { opacity: 1; }
@media (hover: none) { .thumbs .x { opacity: 1; } }


/* ---- editorial overrides ---- */
.tile figcaption { font: 500 11px/1 var(--sans); letter-spacing: .06em; display: flex; gap: 8px; align-items: baseline; }
.tile figcaption .num { font: italic 400 14px/1 var(--serif); letter-spacing: 0; }
.tile.picked { outline-color: var(--pick); }
.tile.picked .pick { background: var(--pick); border-color: var(--pick); }
.tile.picked .pick svg { stroke: #fff; }
.bar { border-radius: var(--radius); border-color: var(--ink); padding: 8px 8px 8px 20px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.16); }
.bar b { font: 400 20px/1 var(--serif); }
.sheet { border-radius: var(--radius); }
.sheet h2 { font: 400 28px/1.1 var(--serif); letter-spacing: -0.02em; }
.opt { border-radius: var(--radius); }
.opt b { font-weight: 600; }
.toast { border-radius: var(--radius); }
.viewer .btn { background: transparent; color: #eee; border-color: #555; }
.viewer .btn.primary { background: #f3efe6; color: #17150f; border-color: #f3efe6; }
.v-name { font: 400 16px/1.2 var(--serif); }
.v-noteinput { border-radius: var(--radius); }
.panel { border-radius: 4px; }
.panel h2 { font: 400 22px/1.2 var(--serif); letter-spacing: -0.01em; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid textarea { font: inherit; color: var(--ink); padding: 9px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); resize: vertical; }
.form-grid label small { font-size: 12px; }
.thumbs .cover-tag, .thumbs .cover-btn { position: absolute; left: 4px; top: 4px; font: 600 9.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 5px 6px; border-radius: 2px; }
.thumbs .cover-tag { background: var(--rust); color: #fff; }
.thumbs .cover-btn { border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; opacity: 0; }
.thumbs li:hover .cover-btn, .thumbs .cover-btn:focus-visible { opacity: 1; }
@media (hover: none) { .thumbs .cover-btn { opacity: 1; } }

/* viewer: filmstrip + link */
.viewer { grid-template-rows: auto 1fr auto auto; }
.v-txt { background: none; border: 1px solid #444; color: #ddd; font: 600 10.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  padding: 9px 12px; border-radius: 2px; cursor: pointer; white-space: nowrap; }
.v-txt:hover { border-color: #888; color: #fff; }
.v-btn svg { width: 18px; height: 18px; fill: currentColor; vertical-align: middle; }
.v-strip-toggle[aria-pressed="false"] { opacity: .5; }
.v-strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; height: 76px; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; }
.v-strip::-webkit-scrollbar { display: none; }
.viewer.no-strip .v-strip { display: none; }
.v-th { flex: 0 0 auto; height: 100%; padding: 0; border: 0; background: #222; cursor: pointer; position: relative; opacity: .45; transition: opacity .15s; }
.v-th img { height: 100%; width: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-select: none; }
.v-th:hover { opacity: .8; }
.v-th.on { opacity: 1; outline: 2px solid #f3efe6; outline-offset: -2px; }
.v-th.picked::after { content: ''; position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: #d9703f; box-shadow: 0 0 0 1.5px #0b0b0b; }
@media (max-width: 640px) {
  .v-strip { height: 58px; padding: 6px 10px; }
  .v-top { gap: 6px; padding-left: 14px; }
  .v-count { display: none; }
}
/* center the filmstrip when it fits, scroll normally when it doesn't */
.v-th:first-child { margin-left: auto; } .v-th:last-child { margin-right: auto; }
.lr-actions { display: flex; flex-direction: column; gap: 8px; }

/* crop editor */
.cropper { position: fixed; inset: 0; z-index: 70; background: #0b0b0b; color: #eee; display: grid; grid-template-rows: auto 1fr auto; }
.c-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; }
.c-title { font: 400 16px/1.2 var(--serif); }
.c-stage { position: relative; display: grid; place-items: center; padding: 8px 16px 16px; min-height: 0; overflow: hidden; }
.c-frame { position: relative; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.c-frame:active { cursor: grabbing; }
.c-img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-touch-callout: none; }
.c-box { position: absolute; outline: 1.5px solid #fff; box-shadow: 0 0 0 100vmax rgba(8,8,8,.62); transition: left .12s, top .12s, width .12s, height .12s; }
.c-box.active { transition: none; }
.c-box:focus-visible { outline: 2px solid var(--rust); }
.c-box i { position: absolute; background: rgba(255,255,255,.35); opacity: 0; transition: opacity .15s; }
.c-box.active i, .c-frame:hover .c-box i { opacity: 1; }
.c-box .g1, .c-box .g2 { top: 0; bottom: 0; width: 1px; } .c-box .g1 { left: 33.333%; } .c-box .g2 { left: 66.666%; }
.c-box .g3, .c-box .g4 { left: 0; right: 0; height: 1px; } .c-box .g3 { top: 33.333%; } .c-box .g4 { top: 66.666%; }
.c-panel { padding: 10px 16px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid #222; display: grid; gap: 12px; }
.c-ratios { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; justify-content: center; }
.c-ratios::-webkit-scrollbar { display: none; }
.c-ratios button { flex: 0 0 auto; background: none; border: 1px solid #3a3a3a; color: #ccc; font: 600 11.5px/1 var(--sans); letter-spacing: .08em; padding: 9px 12px; border-radius: 2px; cursor: pointer; }
.c-ratios button[aria-checked="true"] { background: #f3efe6; color: #17150f; border-color: #f3efe6; }
.c-controls { display: flex; align-items: center; justify-content: center; gap: 12px 20px; flex-wrap: wrap; }
.c-zoomwrap { display: flex; align-items: center; gap: 10px; font: 600 10.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #999; }
.c-zoom { width: min(260px, 50vw); accent-color: #f3efe6; }
.c-size { font: 400 14px/1 var(--serif); color: #bbb; min-width: 11em; text-align: center; }
.c-actions { display: flex; gap: 8px; }
.cropper .btn.primary { background: #f3efe6; color: #17150f; border-color: #f3efe6; }
@media (max-width: 640px) { .c-ratios { justify-content: flex-start; } .c-size { min-width: 0; } }


/* ===== bright client theme (overrides the earlier dark viewer/editor styles) ===== */
.hero::after { background: linear-gradient(to bottom, rgba(0,0,0,.22) 0%, rgba(0,0,0,0) 16%, rgba(0,0,0,0) 58%, rgba(0,0,0,.42) 100%); }
.hero { background: var(--line); }
.hero.plain .hero-text { border-bottom-width: 1px; }
.meta { border-top-width: 1px; }
.colophon { border-top-width: 1px; }
.gate .brand { border-bottom-width: 1px; }
.toolbar { background: color-mix(in srgb, var(--bg) 92%, transparent); }

.viewer, .cropper { background: var(--bg); color: var(--ink); }
.v-count, .c-zoomwrap { color: var(--ink-2); }
.v-btn { color: var(--ink); }
.v-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.v-nav { background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.viewer .btn, .cropper .btn { background: transparent; color: var(--ink); border-color: var(--ink); }
.viewer .btn.primary, .cropper .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.v-txt { border-color: var(--line); color: var(--ink); }
.v-txt:hover { border-color: var(--ink); color: var(--ink); }
.v-noteinput { border-color: var(--line); background: var(--surface); color: var(--ink); }
.v-note { color: var(--ink-2); }
.v-th { background: var(--line); opacity: .55; }
.v-th.on { outline-color: var(--ink); }
.v-th.picked::after { background: var(--pick); box-shadow: 0 0 0 1.5px #fff; }
.c-panel { border-top-color: var(--line); }
.c-ratios button { border-color: var(--line); color: var(--ink); background: var(--surface); }
.c-ratios button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.c-zoom { accent-color: var(--ink); }
.c-size { color: var(--ink-2); }
.c-box { box-shadow: 0 0 0 100vmax rgba(252,251,248,.72); outline-color: var(--ink); }
.c-box i { background: rgba(29,28,25,.25); }
