/* Tana — Hashtag Labs design language (see /DESIGN.md). Manrope + JetBrains Mono, follows the system theme.
   Tana's identity colours: hider blue, chaser orange (like Stradeo's orange, they are identity, not status). */

@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }

:root {
  --bg: #FAFAF8; --card: #FFFFFF; --subtle: #F2F2EE; --border: #E6E5E0; --ink: #0B0B0A; --muted: #6B6B65;
  --brand: #FFD600; --on-brand: #0B0B0A;
  --hider: #1D5FD1; --hider-soft: rgba(29,95,209,.14); --chaser: #E8650A; --chaser-ink: #9A3F02; --chaser-soft: #FFF1E6;
  --danger: #C0262D; --danger-soft: rgba(192,38,45,.1); --success: #1F8A4C; --info: #2563C9; --stale: #A3A39C;
  --map: #ECEAE3; --scrim: rgba(11,11,10,.45);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0A; --card: #171716; --subtle: #1F1F1D; --border: #2A2A27; --ink: #F4F4F1; --muted: #8A8A83;
    --hider: #4D8BF5; --hider-soft: rgba(77,139,245,.16); --chaser: #F08A43; --chaser-ink: #FFB27A; --chaser-soft: #3A1E08;
    --danger: #EF6A6F; --danger-soft: rgba(239,106,111,.14); --success: #4CC27F; --info: #6F9EF0; --stale: #6B6B65;
    --map: #1C1C1A; --scrim: rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 "Manrope", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 20px); }
.col { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.narrow { width: 100%; max-width: 460px; margin: 0 auto; }
.screen > .narrow { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.narrow > *, .col > * { flex-shrink: 0; }

h1, h2, h3, p { margin: 0; }
.h1 { font-size: 40px; line-height: 1.04; letter-spacing: -.03em; font-weight: 700; }
.h2 { font-size: 30px; line-height: 1.1; letter-spacing: -.03em; font-weight: 700; }
.h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 16px; color: var(--muted); }

/* ---------- controls ---------- */
.btn {
  height: 52px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--border); background: transparent;
  font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform .1s ease, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--brand); color: var(--on-brand); border: 0; font-weight: 700; height: 56px; font-size: 17px; }
.btn.ink { background: var(--ink); color: var(--bg); border: 0; font-weight: 700; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.small { height: 40px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn.round { border-radius: 999px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.card { border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.card.pad16 { padding: 16px; }
.list > * + * { border-top: 1px solid var(--border); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 52px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; font-size: 14px; }
.kv > :first-child { color: var(--muted); }
.kv > :last-child { font-weight: 600; text-align: right; }

label.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.input {
  height: 56px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); padding: 0 16px;
  font-size: 20px; font-weight: 600; width: 100%; min-width: 0;
}
.input:focus { border-color: var(--ink); outline: none; }
.input.code { font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; font-size: 22px; }
textarea.input { height: 110px; padding: 12px 14px; font-size: 15px; font-weight: 400; resize: none; }

.chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 14px; font-weight: 600; background: var(--card); cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.pill.hider { background: var(--hider); color: #fff; }
.pill.chaser { background: var(--chaser); color: #0B0B0A; }
.pill.spect { background: var(--card); border: 1px solid var(--border); color: var(--muted); }
.pill.clock { background: var(--card); border: 1px solid var(--border); font-family: var(--mono); font-weight: 600; }
.pill.dark { background: #0B0B0A; color: #FAFAF8; font-weight: 600; }

.seg { display: flex; gap: 6px; padding: 4px; border-radius: 10px; background: var(--subtle); }
.seg button { flex: 1; height: 38px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 700; }

.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--border); position: relative; flex: none; border: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; transition: transform .15s; }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(18px); background: var(--bg); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); font-size: 18px; cursor: pointer; }
.stepper span { min-width: 58px; text-align: center; font-family: var(--mono); font-weight: 600; }

.avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--subtle); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.avatar svg { width: 16px; height: 16px; }
.badge { font-size: 12px; font-weight: 700; border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; color: var(--muted); }
.ok { color: var(--success); font-weight: 600; font-size: 13px; }
.warn { color: var(--chaser-ink); font-weight: 700; font-size: 13px; }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%) translateY(-12px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 200; pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- home ---------- */
.home-art { position: absolute; left: 0; right: 0; top: 90px; height: 440px; pointer-events: none; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo b { font-size: 30px; font-weight: 700; letter-spacing: -.05em; }

/* ---------- map screens ---------- */
.mapwrap, .mapwrap.maplibregl-map { position: absolute; inset: 0; background: var(--map); }
.mapwrap .maplibregl-ctrl-attrib { font-size: 10px; }
.mapwrap .maplibregl-ctrl-bottom-right { bottom: var(--sheet-h, 0px); }
.topbar { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 12px); display: flex; align-items: center; gap: 8px; z-index: 5; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.banners { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 64px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 5; pointer-events: none; }
.banners > * { pointer-events: auto; }
.banner { width: 100%; min-height: 52px; border-radius: 10px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-weight: 700; font-size: 15px; }
.banner.near { background: var(--chaser-soft); border: 1px solid var(--chaser); color: var(--chaser-ink); }
.banner.danger { background: var(--danger); color: #fff; }
.banner.info { background: var(--card); border: 1px solid var(--border); color: var(--ink); font-weight: 600; }
.banner .r { margin-left: auto; font-family: var(--mono); font-weight: 600; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--bg); border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 16px); display: flex; flex-direction: column; gap: 12px;
  max-height: 78vh; overflow-y: auto;
}
.sheet .grab { align-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--border); flex: none; }
.bigcount { border-radius: 14px; background: var(--brand); color: var(--on-brand); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bigcount > .mono { font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.progress3 { display: flex; gap: 6px; }
.progress3 i { flex: 1; height: 6px; border-radius: 6px; background: var(--border); }
.progress3 i.done { background: var(--ink); }
.progress3 i.now { background: var(--ink); opacity: .5; }

/* markers */
.mk { position: relative; transform: translate(-50%, -50%); pointer-events: none; }
.mk-me { width: 22px; height: 22px; border-radius: 999px; background: var(--ink); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--border); }
.mk-me.hider { background: var(--hider); }
.mk-halo { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 999px; background: var(--ink); opacity: .08; animation: halo 2.4s ease-in-out infinite; }
.mk-me.hider + .mk-halo, .mk-halo.hider { background: var(--hider); opacity: .18; }
.mk-mate { width: 18px; height: 18px; background: var(--chaser); border: 3px solid #fff; border-radius: 4px; transform: rotate(45deg); }
.mk-dot { width: 18px; height: 18px; border-radius: 999px; background: var(--hider); border: 3px solid #fff; }
.mk-dot.stale { background: var(--stale); }
.mk-dot.reveal { background: var(--danger); }
.mk-pin { width: 22px; height: 22px; border-radius: 999px 999px 999px 0; transform: rotate(-45deg); background: var(--chaser); border: 3px solid #fff; }
.mk-tana { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); border: 2px solid #0B0B0A; display: flex; align-items: center; justify-content: center; }
.mk-label { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); white-space: nowrap; background: var(--card); color: var(--ink); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; }
.mk-label.h { color: var(--hider); }
.mk-label.c { color: var(--chaser-ink); }
.mk-label.s { color: var(--muted); font-weight: 600; }
.mk-label.r { color: var(--danger); }
@keyframes halo { 0%,100% { transform: scale(1); opacity: .12 } 50% { transform: scale(1.35); opacity: .04 } }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 24px); }
.overlay.ink { background: #0B0B0A; color: #FAFAF8; }
.overlay.orange { background: var(--chaser); color: #0B0B0A; }
.overlay.blue { background: var(--hider); color: #fff; }
.overlay.scrim { background: var(--scrim); justify-content: flex-end; padding: 0; }
.overlay.scrim > .sheet { position: relative; }
.overlay .center { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.overlay .h1 { font-size: 48px; line-height: .98; letter-spacing: -.04em; }
.overlay .btn { border-color: rgba(255,255,255,.25); }
.overlay.orange .btn:not(.primary):not(.ink) { border-color: rgba(11,11,10,.3); }
.darkmode { position: fixed; inset: 0; z-index: 60; background: #000; color: #8A8A83; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.darkmode .mono { font-size: 30px; color: #6B6B65; }

.role-art { flex: 1; display: flex; align-items: center; justify-content: center; }

/* animations */
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes pulse { from { transform: scale(.3); opacity: .6 } to { transform: scale(1.7); opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }
@keyframes buzz { 0%,30%,100% { transform: translateX(0) } 5% { transform: translateX(-4px) } 10% { transform: translateX(4px) } 15% { transform: translateX(-3px) } 20% { transform: translateX(3px) } }
@keyframes wander { 0%,100% { transform: translate(0,0) } 25% { transform: translate(-18px,14px) } 50% { transform: translate(10px,26px) } 75% { transform: translate(16px,-6px) } }
@keyframes chase { 0%,100% { transform: translate(0,0) } 40% { transform: translate(70px,-60px) } 60% { transform: translate(90px,-40px) } 80% { transform: translate(40px,-10px) } }
@keyframes pop { from { transform: scale(0) rotate(-90deg) } to { transform: none } }
@keyframes fadeblink { 0%,100% { opacity: 1 } 50% { opacity: .1 } }
@keyframes shake { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-6deg) } 75% { transform: rotate(6deg) } }
@keyframes flash { 0%,100% { background: var(--chaser) } 50% { background: #F2823A } }
.a-spin { transform-box: fill-box; transform-origin: center; animation: spin 40s linear infinite; }
.a-spin-r { transform-box: fill-box; transform-origin: center; animation: spin 28s linear infinite reverse; }
.a-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 3s ease-out infinite; }
.a-pulse2 { transform-box: fill-box; transform-origin: center; animation: pulse 3s ease-out 1.5s infinite; }
.a-wander { animation: wander 9s ease-in-out infinite; }
.a-chase { animation: chase 9s ease-in-out infinite; }
.a-rise { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.a-rise2 { animation: rise .6s cubic-bezier(.2,.8,.2,1) .1s both; }
.a-rise3 { animation: rise .6s cubic-bezier(.2,.8,.2,1) .2s both; }
.a-buzz { animation: buzz 2.4s ease-in-out infinite; }
.a-pop { transform-box: fill-box; transform-origin: center; animation: pop .8s cubic-bezier(.2,1.4,.3,1) both; }
.a-blink { animation: fadeblink 3.2s ease-in-out infinite; }
.a-shake { animation: shake .6s ease-in-out infinite; }
.a-flash { animation: flash 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
