/* Markit review board. Markit's own black and white: a very dark green ground in
   dark, a clean near-white in light. Pills, flat fills, glass panels, gold for the
   one main action. */

@font-face { font-family: "Jakarta"; font-weight: 500; font-display: swap; src: url("/fonts/jakarta-500.ttf") format("truetype"); }
@font-face { font-family: "Jakarta"; font-weight: 600; font-display: swap; src: url("/fonts/jakarta-600.ttf") format("truetype"); }
@font-face { font-family: "Jakarta"; font-weight: 700; font-display: swap; src: url("/fonts/jakarta-700.ttf") format("truetype"); }
@font-face { font-family: "Jakarta"; font-weight: 800; font-display: swap; src: url("/fonts/jakarta-800.ttf") format("truetype"); }

:root {
  --page: #03110D;
  --panel: #071B16;
  --well: #0A211B;
  --well-2: #102A23;
  --text: #F1F3F1;
  --muted: #96A49E;
  --gold: #E0A63C;
  --gold-press: #EDBE66;
  --gold-ink: #1B1303;
  --done: #2E7D66;
  --danger: #F2937F;
  --glass: rgba(6, 27, 22, 0.76);
  --dot: rgba(241, 243, 241, 0.085);
  --scrim: rgba(1, 8, 6, 0.6);
  --seg-thumb: #F1F3F1;
  --seg-ink: #03110D;
  color-scheme: dark;
}
:root[data-mode="light"] {
  --page: #F7F8F7;
  --panel: #FFFFFF;
  --well: #ECEFED;
  --well-2: #DFE4E1;
  --text: #0B100E;
  --muted: #5A6561;
  --gold-ink: #1B1303;
  --done: #17463A;
  --danger: #B3402B;
  --glass: rgba(255, 255, 255, 0.78);
  --dot: rgba(11, 16, 14, 0.1);
  --scrim: rgba(11, 16, 14, 0.28);
  --seg-thumb: #0B100E;
  --seg-ink: #F7F8F7;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 500 15px/1.45 "Jakarta", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; }
h1, h2, p { margin: 0; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; flex: none; }
.num { font-variant-numeric: tabular-nums; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
}

/* ── buttons ── */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; white-space: nowrap;
  transition: background-color 0.18s ease, transform 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.pill:active, .round:active, .chip:active { transform: scale(0.97); }
.pill.gold, .round.gold { background: var(--gold); color: var(--gold-ink); }
.pill.gold:hover, .round.gold:hover { background: var(--gold-press); }
.pill.quiet, .round.quiet { background: var(--well); color: var(--text); }
.pill.quiet:hover, .round.quiet:hover { background: var(--well-2); }
.pill.small { height: 34px; padding: 0 14px; font-size: 13px; }
.pill[disabled] { opacity: 0.5; cursor: default; }
.round { width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--well); transition: background-color 0.18s ease, transform 0.18s cubic-bezier(0.2, 0, 0, 1); }
.round:hover { background: var(--well-2); }

.field, textarea {
  width: 100%; border: 0; outline: 0; resize: none;
  background: var(--well); color: var(--text);
  border-radius: 18px; padding: 13px 16px; font-weight: 500;
}
.field { height: 48px; border-radius: 999px; padding: 0 18px; }
.field::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.field:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ── the way in ── */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: #0A2821; color: #F1F3F1; }
.gate-card { width: min(360px, 100%); display: grid; gap: 14px; text-align: center; }
.gate-card .mark { width: 64px; height: 52px; color: #E0A63C; margin: 0 auto 6px; }
.gate-card h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: #EFE9DC; }
.gate-card p { color: #A9B8B1; }
.gate-card .field { background: #10352C; color: #F1F3F1; margin-top: 2px; }
.gate-card .field::placeholder { color: #9DB0A8; }
.gate-card .pill { height: 52px; margin-top: 4px; }

/* ── the board ── */
#app { position: fixed; inset: 0; }
#board {
  position: absolute; inset: 0; overflow: hidden;
  touch-action: none; cursor: default; user-select: none; -webkit-user-select: none;
  background-color: var(--page);
  background-image: radial-gradient(circle, var(--dot) 1.2px, transparent 1.6px);
  background-size: 32px 32px;
  transition: background-color 0.3s ease;
}
#board.grabbing { cursor: grabbing; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; --pin: 1; }

.section-title { position: absolute; display: flex; align-items: baseline; gap: 16px; white-space: nowrap; }
.section-title b { font-size: 44px; font-weight: 800; letter-spacing: -0.025em; }
.section-title span { font-size: 22px; font-weight: 600; color: var(--muted); }

.phone { position: absolute; width: 278px; }
.phone .rim { background: #000; border-radius: 41px; padding: 7px; }
.phone .screen { position: relative; aspect-ratio: 440 / 956; border-radius: 34px; overflow: hidden; background: var(--well); cursor: crosshair; }
.phone .screen img, .phone .screen video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.phone .label { display: flex; align-items: center; gap: 8px; padding: 14px 8px 0; font-size: 16px; font-weight: 600; color: var(--muted); }
.phone .label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone .count { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.phone .count.all-done { background: var(--well-2); color: var(--muted); }
.phone.flash .rim { animation: flash 1.4s ease; }
@keyframes flash { 0%, 60% { background: var(--gold); } 100% { background: #000; } }

.phone.film-tile .screen { cursor: pointer; }
.phone.film-tile .go { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; pointer-events: none; }
.phone.film-tile .go .i { width: 34px; height: 34px; margin-left: 4px; }
.phone.film-tile .veil { position: absolute; inset: 0; background: rgba(3, 17, 13, 0.34); pointer-events: none; }

.pins { position: absolute; inset: 0; pointer-events: none; }
.pin {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink); font-size: 12.5px; font-weight: 800; line-height: 1;
  display: grid; place-items: center; pointer-events: auto; cursor: pointer;
  outline: 3px solid rgba(3, 17, 13, 0.62);
  transform: scale(var(--pin)); transform-origin: 50% 50%;
}
.pin.done { background: var(--done); color: #F1F3F1; }
.pin.done .i { width: 15px; height: 15px; }
.pin.draft { animation: breathe 1.3s ease-in-out infinite; pointer-events: none; }
.pin.draft .i { width: 15px; height: 15px; }
.pin.pulse::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; outline: 3px solid var(--gold); animation: ring 0.9s cubic-bezier(0.2, 0, 0, 1) 2; }
@keyframes breathe { 50% { transform: scale(calc(var(--pin) * 1.16)); } }
@keyframes ring { from { transform: scale(1); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }

/* ── top bar ── */
.bar { position: absolute; top: 14px; left: 14px; right: 410px; display: flex; align-items: center; gap: 8px; pointer-events: none; z-index: 5; }
.bar > * { pointer-events: auto; }
.bar .spacer { flex: 1; pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 18px 0 14px; border-radius: 999px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px; }
.brand .mark { width: 26px; height: 21px; color: var(--gold); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px; font-weight: 700; white-space: nowrap; transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1); }
.chip .i { width: 16px; height: 16px; }
.chip.me { padding-left: 8px; max-width: 190px; }
.chip.me #me-name { overflow: hidden; text-overflow: ellipsis; }
.face { width: 30px; height: 30px; border-radius: 50%; background: var(--well-2); color: var(--text); display: inline-grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; text-transform: uppercase; }
.face.mine { background: var(--gold); color: var(--gold-ink); }

.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 46px; padding: 4px; border-radius: 999px; --n: 2; --at: 0; }
.seg button { position: relative; z-index: 1; padding: 0 18px; border-radius: 999px; font-weight: 700; color: var(--muted); transition: color 0.25s ease; }
.seg button[aria-pressed="true"] { color: var(--seg-ink); }
.seg .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: 999px; background: var(--seg-thumb); transform: translateX(calc(var(--at) * 100%)); transition: transform 0.36s cubic-bezier(0.3, 1.25, 0.5, 1), background-color 0.3s ease; }
.seg.small { height: 36px; background: var(--well); font-size: 13px; --n: 3; }
.seg.small button { padding: 0 12px; }

.menu { position: absolute; top: 68px; left: 14px; z-index: 7; min-width: 230px; max-height: min(70vh, 560px); overflow: auto; padding: 8px; border-radius: 24px; display: grid; gap: 2px; }
.menu button.item { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 42px; padding: 0 14px; border-radius: 999px; font-weight: 600; text-align: left; }
.menu button.item:hover { background: var(--well-2); }
.menu button.item span { color: var(--muted); font-size: 13px; }
.me-menu { left: auto; right: 410px; width: 260px; padding: 12px; gap: 8px; }

.zoom { position: absolute; left: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; height: 46px; padding: 4px; border-radius: 999px; }
.zoom button { height: 38px; min-width: 38px; padding: 0 10px; border-radius: 999px; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.zoom button:hover { background: var(--well-2); }

/* ── the note for a tapped spot ── */
.pinbox { position: absolute; z-index: 6; width: 300px; padding: 12px; border-radius: 26px; display: grid; gap: 10px; }
.pinbox .where { font-size: 13px; font-weight: 700; color: var(--muted); padding: 2px 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinbox textarea { min-height: 76px; }
.row { display: flex; align-items: flex-end; gap: 8px; }
.pinbox .row { justify-content: flex-end; }
.pinbox .pill { height: 42px; }

/* ── chat ── */
.chat { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 384px; z-index: 10; border-radius: 30px; display: flex; flex-direction: column; overflow: hidden; }
.chat .handle { display: none; }
.chat header { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px 22px; }
.chat h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.here { flex: 1; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; }
.empty { margin: auto; text-align: center; color: var(--muted); padding: 24px; max-width: 240px; }
.empty b { display: block; color: var(--text); font-size: 17px; font-weight: 700; margin-bottom: 4px; }

.msg { padding: 12px; border-radius: 22px; display: grid; gap: 8px; transition: background-color 0.4s ease; }
.msg.tagged { background: var(--well); }
.msg.flash { background: var(--well-2); }
.msg.is-done .text, .msg.is-done .crop, .msg.is-done .shot { opacity: 0.55; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who .face { width: 26px; height: 26px; font-size: 11.5px; }
.who b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who time { color: var(--muted); font-size: 12.5px; font-weight: 600; flex: none; }
.tag { justify-self: start; max-width: 100%; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 4px; border-radius: 999px; background: var(--well-2); font-size: 13px; font-weight: 700; }
.tag .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; }
.tag .n .i { width: 13px; height: 13px; }
.msg.is-done .tag .n { background: var(--done); color: #F1F3F1; }
.tag .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.re { background: none; padding-left: 0; color: var(--muted); height: 22px; }
.tag.re .i { width: 15px; height: 15px; }
.crop { position: relative; display: block; width: 100%; aspect-ratio: 5 / 2; border-radius: 16px; overflow: hidden; background-color: var(--well-2); background-repeat: no-repeat; background-size: 100% auto; }
.crop .dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--gold); outline: 3px solid rgba(3, 17, 13, 0.62); }
.shot { display: block; width: 100%; height: 190px; object-fit: cover; border-radius: 16px; background: var(--well-2); cursor: pointer; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 500; padding: 0 2px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.act { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--muted); background: transparent; }
.act:hover { background: var(--well-2); color: var(--text); }
.act .i { width: 14px; height: 14px; }
.act.on { background: var(--done); color: #F1F3F1; }
.msg:not(.tagged) .act:hover { background: var(--well); }

.composer { padding: 10px 12px 12px; display: grid; gap: 8px; }
.composer textarea { min-height: 46px; max-height: 140px; border-radius: 23px; padding: 12px 16px; }
.composer .round { width: 46px; height: 46px; }
.reply-chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--well-2); font-size: 12.5px; font-weight: 700; }
.reply-chip .i { width: 13px; height: 13px; }

.toast { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 20; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ── the film ── */
#film { position: absolute; inset: 0; z-index: 8; background: var(--page); display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 74px 424px 14px 16px; gap: 14px; touch-action: none; }
#film-back { position: absolute; top: 14px; left: 14px; }
.film-stage { min-height: 0; display: grid; place-items: center; width: 100%; }
.phone.big { position: relative; width: auto; height: 100%; max-height: 800px; aspect-ratio: 454 / 970; }
.phone.big .rim { height: 100%; border-radius: 13% / 6.1%; padding: 1.6%; }
.phone.big .screen { height: 100%; aspect-ratio: auto; border-radius: 11.6% / 5.4%; cursor: crosshair; }
#ink { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.film-foot { width: min(680px, 100%); display: grid; gap: 8px; }
.tools { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 10px 0 8px; border-radius: 999px; }
.tools .num { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 34px; text-align: center; }
.scrub { position: relative; flex: 1; height: 28px; display: grid; align-items: center; }
#seek { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--well-2); outline-offset: 6px; margin: 0; cursor: pointer; }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 0; }
#seek::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 0; }
#ticks { position: absolute; left: 9px; right: 9px; top: 0; bottom: 0; pointer-events: none; }
.tick { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--gold); outline: 2px solid var(--page); pointer-events: auto; cursor: pointer; }
.tick.done { background: var(--done); }
.markbox { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 6px; border-radius: 999px; }
.markbox .hint { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; color: var(--muted); font-weight: 600; }
.markbox .hint span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.markbox .hint .i { color: var(--gold); }
.markbox .field { flex: 1; height: 46px; }

/* ── narrow screens: the chat is a drawer ── */
@media (max-width: 860px) {
  .bar { right: 14px; flex-wrap: wrap; }
  .brand span, #me-name { display: none; }
  .brand { padding: 0 12px; }
  .chip.me { padding: 0 8px; }
  .chip, .seg, .brand { height: 42px; }
  .seg button { padding: 0 13px; }
  .me-menu { right: 14px; }
  .zoom { bottom: 84px; }
  .chat { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 70px; border-radius: 28px 28px 0 0; transition: height 0.42s cubic-bezier(0.3, 1.1, 0.4, 1); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .chat.open { height: min(76vh, 640px); }
  .chat .handle { display: grid; place-items: center; height: 18px; width: 100%; flex: none; }
  .chat .grabber { width: 40px; height: 5px; border-radius: 999px; background: var(--muted); opacity: 0.6; }
  .chat header { padding: 4px 16px 12px 22px; }
  #film { bottom: 70px; padding: 68px 12px 12px; }
  .pinbox { left: 12px !important; right: 12px; top: auto !important; bottom: 82px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
