/* MindGames: black ground, warm white, a pink -> red -> orange gradient. Display type is a heavy
   geometric sans; people's names are set in a book serif, like an author's name on a cover. */
:root {
  --bg: #000;
  --bg-1: #0b0b0b;
  --bg-2: #141414;
  --bg-3: #1d1d1d;
  --ink: #f4f1ec;
  --ink-2: #c9c5be;
  --muted: #8d8a84;
  --faint: #5b5955;
  --line: rgba(244, 241, 236, 0.12);
  --line-2: rgba(244, 241, 236, 0.22);
  --pink: #ff3d7f;
  --red: #f2384a;
  --orange: #f68b1f;
  --grad: linear-gradient(180deg, var(--pink), var(--red) 55%, var(--orange));
  --grad-h: linear-gradient(90deg, var(--pink), var(--red) 55%, var(--orange));
  --good: #f4f1ec;
  --display: 'Montserrat', system-ui, sans-serif;
  --serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 2px;
  --nav-w: 236px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font-family: var(--display); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--pink); }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--pink); color: #000; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--bg-3); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.privacy .blur-me { filter: blur(7px); transition: filter .15s; }
.privacy .blur-me:hover { filter: none; }

/* ---------- type ---------- */
.display { font-family: var(--display); font-weight: 900; text-transform: uppercase; letter-spacing: .01em; line-height: .95; }
.kicker { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); }
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.grad-text { background: var(--grad-h); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1, h2, h3 { margin: 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.nav-maze { height: 92px; flex: none; background-size: cover; background-position: center; border-bottom: 1px solid var(--line); position: relative; }
.brand { position: absolute; left: 16px; bottom: 14px; display: flex; align-items: center; gap: 10px; background: #000; padding: 8px 12px 8px 8px; }
.brand svg { flex: none; }
.brand-word { font-weight: 900; font-size: 17px; letter-spacing: .02em; line-height: .9; text-transform: uppercase; }
.brand-word small { display: block; font-size: 8.5px; letter-spacing: .22em; color: var(--orange); font-weight: 700; margin-top: 3px; }
.nav-cta { margin: 16px; }
.nav-list { display: flex; flex-direction: column; padding: 4px 8px; gap: 1px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); border-left: 3px solid transparent; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { color: var(--ink); background: var(--bg-1); }
.nav-item.on { color: var(--ink); border-left-color: var(--pink); background: linear-gradient(90deg, rgba(255,61,127,.10), transparent 70%); }
.nav-item .badge { margin-left: auto; }
.nav-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); }
.nav-foot button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-align: left; }
.nav-foot button:hover { color: var(--ink); }
.main { min-width: 0; position: relative; }
.page { padding: 28px clamp(16px, 4vw, 48px) 120px; max-width: 1240px; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: clamp(34px, 5vw, 56px); }
.page-title .count { font-size: .42em; color: var(--orange); vertical-align: super; margin-left: 8px; letter-spacing: 0; }

.topbar, .tabbar { display: none; }

.demo-flag { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--grad-h); color: #000; font-weight: 800; font-size: 10.5px; letter-spacing: .18em; padding: 4px 12px; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 899px) { .demo-flag { top: auto; bottom: calc(62px + env(safe-area-inset-bottom)); left: 0; right: 0; transform: none; text-align: center; padding: 3px 8px; font-size: 9.5px; } }

@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; gap: 10px; height: 56px; padding: 0 var(--gutter); background: rgba(0,0,0,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .topbar .brand-word { font-size: 15px; }
  .topbar .spacer { flex: 1; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(0,0,0,.95); border-top: 1px solid var(--line); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .tab svg { width: 20px; height: 20px; }
  .tab.on { color: var(--ink); }
  .tab.on svg { color: var(--pink); }
  .tab-plus { align-self: center; justify-self: center; width: 52px; height: 52px; display: grid; place-items: center; background: var(--grad); color: #000; border: 0; margin-top: -14px; box-shadow: 0 6px 24px rgba(242,56,74,.35); }
  .tab-plus svg { width: 24px; height: 24px; }
  .page { padding: 20px var(--gutter) 110px; }
}

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line-2); background: var(--bg-1); color: var(--ink); font-weight: 700; font-size: 13px; letter-spacing: .02em; cursor: pointer; border-radius: var(--r); white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.hot { background: var(--grad-h); border: 0; color: #000; }
.btn.hot:hover { filter: brightness(1.08); color: #000; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--bg-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 11.5px; gap: 5px; }
.btn.xs svg { width: 13px; height: 13px; }
.btn.block { width: 100%; height: 46px; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; background: none; border: 1px solid transparent; color: var(--ink-2); cursor: pointer; border-radius: var(--r); }
.icon-btn:hover { color: var(--ink); background: var(--bg-2); }
.icon-btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.input, .select, .textarea { width: 100%; background: var(--bg-1); border: 1px solid var(--line-2); color: var(--ink); padding: 10px 12px; border-radius: var(--r); font-size: 15px; outline: 0; min-height: 42px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--orange); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input.name { font-family: var(--serif); font-size: 26px; padding: 12px 14px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 599px) { .grid2 { grid-template-columns: 1fr; } }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { background: none; border: 0; padding: 8px 12px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; letter-spacing: .03em; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #000; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--ink-2); border-radius: 999px; background: transparent; cursor: default; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
button.chip, a.chip { cursor: pointer; }
button.chip:hover, a.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.on { background: var(--ink); color: #000; border-color: var(--ink); }
.chip.hot { border-color: transparent; background: var(--grad-h); color: #000; }
.chip svg { width: 12px; height: 12px; }
.chip .x { margin-right: -4px; opacity: .6; cursor: pointer; }
.src { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border: 1px solid var(--line); color: var(--muted); border-radius: 2px; text-transform: lowercase; white-space: nowrap; }
.src.scan { border-color: rgba(246,139,31,.45); color: var(--orange); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; background: var(--grad-h); color: #000; font-size: 11px; font-weight: 800; border-radius: 999px; }

/* ---------- cards & sections ---------- */
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.empty { display: grid; place-items: center; text-align: center; gap: 14px; padding: 48px 16px; color: var(--muted); }
.empty .maze-tile { width: 132px; height: 132px; background-size: cover; }
.empty h3 { color: var(--ink); font-size: 20px; font-weight: 800; text-transform: uppercase; }

/* ---------- avatar ---------- */
.avatar { flex: none; display: grid; place-items: center; overflow: hidden; background: var(--bg-3); font-family: var(--serif); color: #000; font-weight: 700; position: relative; }
.avatar.ini { background: var(--grad); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.round { border-radius: 50%; }

/* ---------- people list ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.pcard { display: flex; gap: 14px; padding: 16px; background: var(--bg); min-width: 0; position: relative; }
.pcard:hover { background: var(--bg-1); color: var(--ink); }
.pcard .who { min-width: 0; flex: 1; }
.pcard .nm { font-family: var(--serif); font-size: 19px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .meta { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pcard .finds { position: absolute; top: 12px; right: 12px; }
.warmth { display: inline-flex; gap: 2px; }
.warmth i { width: 9px; height: 9px; background: var(--bg-3); display: block; }
.warmth i.on { background: var(--grad); }
.warmth.big i { width: 18px; height: 18px; cursor: pointer; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 260px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- dossier ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: end; position: relative; padding: 8px 0 24px; border-bottom: 1px solid var(--line); }
.hero .avatar { width: 128px; height: 128px; font-size: 44px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -.01em; }
.hero .line { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.hero .line a { border-bottom: 1px solid var(--line-2); }
.hero .acts { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.photo-drop { position: relative; cursor: pointer; display: inline-block; width: max-content; justify-self: start; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop .cam { position: absolute; right: 4px; bottom: 4px; width: 28px; height: 28px; display: grid; place-items: center; background: #000; border: 1px solid var(--line-2); }
.photo-drop .cam svg { width: 14px; height: 14px; }
@media (max-width: 599px) { .hero { grid-template-columns: 1fr; } .hero .avatar { width: 96px; height: 96px; font-size: 34px; } }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 40px; }
@media (max-width: 1099px) { .cols { grid-template-columns: 1fr; } }
.facts { display: flex; flex-direction: column; }
.fact { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.fact > svg { width: 17px; height: 17px; color: var(--muted); }
.fact .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact .v small { display: block; color: var(--muted); font-size: 11.5px; }
.fact .tools { display: flex; gap: 4px; align-items: center; opacity: .0; transition: opacity .1s; }
.fact:hover .tools, .fact:focus-within .tools { opacity: 1; }
@media (hover: none) { .fact .tools { opacity: 1; } }
.addfact { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; margin-top: 10px; }
@media (max-width: 599px) { .addfact { grid-template-columns: 1fr; } }

.finds-box { border: 1px solid transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--grad-h) border-box; padding: 16px; margin-top: 24px; }
.find { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.find:last-child { border-bottom: 0; }
.find > svg { width: 17px; height: 17px; margin-top: 3px; color: var(--orange); }
.find .v { min-width: 0; overflow-wrap: anywhere; }
.find .ev { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-family: var(--serif); font-style: italic; }
.find .why { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.conf { width: 64px; height: 4px; background: var(--bg-3); position: relative; }
.conf i { position: absolute; inset: 0 auto 0 0; background: var(--grad-h); }
.find .yn { display: flex; gap: 6px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 3px; background: var(--grad); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ''; position: absolute; left: -22px; top: 5px; width: 13px; height: 13px; background: #000; border: 3px solid var(--ink); }
.tl-item .when { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.tl-item .what { font-weight: 700; margin-top: 2px; }
.tl-item .where { color: var(--ink-2); font-size: 13.5px; }
.tl-item .notes { margin-top: 6px; color: var(--ink-2); font-family: var(--serif); font-size: 14px; line-height: 1.55; }
.tl-item .who { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.chain { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin: 8px 0 4px; }
.chain .node { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line-2); background: var(--bg-1); font-family: var(--serif); font-size: 14px; }
.chain .node.me { background: var(--grad-h); color: #000; font-family: var(--display); font-weight: 800; font-size: 11px; letter-spacing: .1em; padding: 9px 12px; border: 0; }
.chain .edge { width: 34px; height: 3px; background: var(--grad-h); position: relative; }
.chain .edge span { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--muted); white-space: nowrap; letter-spacing: .04em; }
.links-list { display: flex; flex-direction: column; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.link-row .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); width: 150px; flex: none; }
.link-row .n { flex: 1; font-family: var(--serif); }

.note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note p { margin: 0; font-family: var(--serif); font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.note .t { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; gap: 10px; }

.lookups { display: flex; flex-direction: column; gap: 12px; }
.lookups .g { display: flex; flex-direction: column; gap: 6px; }
.lookups .g > span { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* scan */
.scan-box { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 16px; margin-top: 24px; border: 1px solid var(--line-2); background: var(--bg-1); }
.scan-maze { width: 180px; height: 180px; }
.scan-maze .solve { stroke-dasharray: var(--len); stroke-dashoffset: calc(var(--len) * (1 - var(--p))); transition: stroke-dashoffset .8s ease; }
.scan-log { font-family: var(--mono); font-size: 12px; color: var(--ink-2); max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.scan-log b { color: var(--orange); font-weight: 500; }
.mods { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
@media (max-width: 599px) { .scan-box { grid-template-columns: 1fr; } .scan-maze { width: 120px; height: 120px; } }

/* ---------- sheet (modal) ---------- */
.veil { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.72); display: flex; justify-content: flex-end; animation: fade .15s; }
.sheet { width: min(640px, 100%); height: 100%; background: var(--bg); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; animation: slide .18s ease-out; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 22px; font-weight: 900; text-transform: uppercase; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.sheet-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.sheet .group { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.sheet .group + .group { border-top: 1px solid var(--line); padding-top: 18px; }
.dialog { margin: auto; width: min(460px, calc(100% - 32px)); height: auto; max-height: 90vh; border: 1px solid var(--line-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 899px) { .sheet { width: 100%; border-left: 0; } }

/* typeahead */
.ta { position: relative; }
.ta-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--bg-2); border: 1px solid var(--line-2); max-height: 280px; overflow-y: auto; }
.ta-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.ta-item:hover, .ta-item.on { background: var(--bg-3); }
.ta-item small { color: var(--muted); display: block; font-size: 11.5px; }
.ta-item .tag { margin-left: auto; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); font-weight: 700; flex: none; }
.ta-sep { padding: 6px 12px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); background: var(--bg-1); }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; background: var(--ink); color: #000; padding: 10px 12px 10px 16px; font-weight: 700; font-size: 13px; box-shadow: 0 10px 40px rgba(0,0,0,.6); animation: fade .2s; }
.toast.err { background: var(--red); color: #fff; }
.toast .btn { height: 28px; background: #000; color: var(--ink); border: 0; }
@media (max-width: 899px) { .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; background: #000 center / cover no-repeat; padding: 16px; }
.auth-box { width: min(420px, 100%); background: #000; padding: 36px 32px 32px; }
.auth-box .logo-big { font-weight: 900; font-size: clamp(44px, 12vw, 64px); text-transform: uppercase; line-height: .88; letter-spacing: .005em; }
.auth-box .by { font-family: var(--serif); font-size: 22px; margin: 18px 0 4px; }
.auth-box .tag { font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); line-height: 1.5; margin-bottom: 26px; }
.auth-box form { display: flex; flex-direction: column; gap: 14px; }
.auth-box .err { color: var(--pink); font-size: 13px; min-height: 18px; }
.qr { background: #fff; padding: 10px; width: 200px; margin: 6px auto; }
.qr svg { width: 100%; height: auto; display: block; }
.code-input { font-family: var(--mono); font-size: 28px; letter-spacing: .4em; text-align: center; }

/* ---------- map (graph) ---------- */
.graph-wrap { position: relative; height: calc(100vh - 0px); overflow: hidden; background: #000; touch-action: none; }
@media (max-width: 899px) { .graph-wrap { height: calc(100vh - 56px - 62px - env(safe-area-inset-bottom)); } }
.graph-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.graph-wrap canvas.drag { cursor: grabbing; }
.graph-ui { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; pointer-events: none; }
.graph-ui > * { pointer-events: auto; }
.graph-title { background: #000; padding: 8px 12px; font-weight: 900; text-transform: uppercase; font-size: 22px; line-height: 1; }
.graph-title small { display: block; font-size: 10px; letter-spacing: .16em; color: var(--orange); margin-top: 4px; }
.panel { background: rgba(0,0,0,.88); border: 1px solid var(--line-2); backdrop-filter: blur(6px); }
.graph-tools { display: flex; gap: 6px; align-items: center; padding: 6px; flex-wrap: wrap; }
.graph-legend { position: absolute; left: 16px; bottom: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--ink-2); }
.graph-legend i { display: inline-block; width: 22px; height: 3px; margin-right: 8px; vertical-align: middle; }
.graph-card { position: absolute; right: 16px; bottom: 16px; width: min(340px, calc(100% - 32px)); padding: 16px; }
.graph-card .nm { font-family: var(--serif); font-size: 22px; }
.graph-card .chain { margin-top: 10px; }
@media (max-width: 599px) { .graph-legend { display: none; } }

/* ---------- places map ---------- */
.places { display: grid; grid-template-columns: 340px 1fr; height: 100vh; }
.places-list { overflow-y: auto; border-right: 1px solid var(--line); padding: 20px 16px 100px; }
.places-map { position: relative; }
.places-map .leaflet-container { position: absolute; inset: 0; background: #000; font-family: var(--display); }
/* OpenStreetMap's light tiles turned into a dark map. */
.places-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(.85) brightness(.82) contrast(1.15); }
.place-row { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.place-row .n { font-weight: 700; }
.place-row .s { font-size: 12.5px; color: var(--muted); }
.place-row.on .n { color: var(--pink); }
.pin { width: 26px; height: 26px; background: var(--grad); transform: rotate(45deg); display: grid; place-items: center; border: 2px solid #000; box-shadow: 0 0 0 1px var(--ink); }
.pin span { transform: rotate(-45deg); color: #000; font-weight: 900; font-size: 11px; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #000 !important; color: var(--ink) !important; border: 1px solid var(--line-2); border-radius: 2px !important; box-shadow: none !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-family: var(--display); }
.leaflet-container a { color: var(--ink) !important; }
.leaflet-control-zoom a { background: #000 !important; color: var(--ink) !important; border-color: var(--line-2) !important; }
.leaflet-control-attribution { background: rgba(0,0,0,.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
@media (max-width: 899px) {
  .places { grid-template-columns: 1fr; grid-template-rows: 48vh 1fr; height: auto; }
  .places-map { height: 48vh; order: -1; }
  .places-list { border-right: 0; }
}

/* ---------- misc lists ---------- */
.list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.li .who { flex: 1; min-width: 0; }
.li .nm { font-family: var(--serif); font-size: 17px; }
.li .sub { font-size: 12.5px; color: var(--muted); }
.li .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.overdue { color: var(--pink); font-weight: 700; }
.month { margin-top: 28px; }
.month:first-child { margin-top: 0; }
.month h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 24px; }
.stat { background: #000; padding: 14px 16px; }
.stat b { display: block; font-size: 28px; font-weight: 900; line-height: 1; }
.stat span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding-top: 2px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.palette { position: fixed; inset: 0; z-index: 85; background: rgba(0,0,0,.75); display: flex; justify-content: center; padding-top: 12vh; }
.palette-box { width: min(620px, calc(100% - 32px)); background: var(--bg-1); border: 1px solid var(--line-2); align-self: flex-start; }
.palette-box .input { border: 0; border-bottom: 1px solid var(--line); font-size: 18px; padding: 16px; background: transparent; }
.palette-res { max-height: 56vh; overflow-y: auto; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--orange); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.hide-mobile { }
@media (max-width: 899px) { .hide-mobile { display: none !important; } }
.only-mobile { display: none; }
@media (max-width: 899px) { .only-mobile { display: initial; } }
