/* ВЫКРУТИСЬ — дизайн-система.
   Один визуальный мир: космос, тёплый белый, серебро, сигнальный оранжевый только для главного действия. */

:root {
  --bg: #000;
  --ink: #f5f5f7;
  --ink-2: rgba(245, 245, 247, 0.74);
  --ink-3: rgba(245, 245, 247, 0.52);
  --ink-4: rgba(245, 245, 247, 0.3);
  --glass-a: rgba(44, 44, 48, 0.72);
  --glass-b: rgba(20, 20, 23, 0.74);
  --fill: rgba(255, 255, 255, 0.06);
  --fill-2: rgba(255, 255, 255, 0.1);
  --fill-3: rgba(255, 255, 255, 0.16);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-2: rgba(255, 255, 255, 0.17);
  --accent: #ff7a1a;
  --accent-2: #ff9d52;
  --accent-soft: rgba(255, 122, 26, 0.15);
  --pos: #30d158;
  --neg: #ff453a;
  --sky: #7cc4ff;
  --gold: #ffd60a;
  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.44, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --panel-w: 392px;
  color-scheme: dark;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077 20.4%, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }

#app { position: fixed; inset: 0; overflow: hidden; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; }
#globe.grabbing { cursor: grabbing; }
#globe.pointing { cursor: pointer; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; transition: opacity 0.5s; }
#vignette { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(120% 90% at 60% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }

.g-label {
  position: absolute; left: 0; top: 0; margin: -9px 0 0 9px; white-space: nowrap; opacity: 0;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.01em; color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.75);
  transition: opacity 0.35s var(--ease); will-change: transform;
}
.g-label.cap { font-weight: 650; color: #fff; font-size: 12.5px; }
.g-label.here { color: var(--accent-2); font-weight: 700; margin-left: 12px; }
.g-label.ap { font: 600 10.5px/1 var(--mono); letter-spacing: 0.06em; color: #a9dcff; margin: -5px 0 0 8px; }

/* ---------- Стекло ---------- */
.glass {
  background: linear-gradient(180deg, var(--glass-a), var(--glass-b));
  -webkit-backdrop-filter: blur(38px) saturate(175%);
  backdrop-filter: blur(38px) saturate(175%);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 28px 80px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ---------- Верхняя панель ---------- */
#topbar {
  position: absolute; z-index: 10; top: 0; left: 0; right: 0;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 0;
  display: flex; align-items: center; gap: 10px; pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
#topbar > * { pointer-events: auto; }
#brand { font-weight: 800; font-size: 13px; letter-spacing: 0.22em; padding: 10px 6px 10px 4px; color: var(--ink); opacity: 0.92; transition: opacity 0.2s; }
#brand:hover { opacity: 1; }
#brand b { color: var(--accent); font-weight: 800; }
.pill {
  height: 40px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 550; white-space: nowrap;
  transition: transform 0.35s var(--spring), background 0.2s, border-color 0.2s;
}
.pill:hover { border-color: var(--stroke-2); }
.pill:active { transform: scale(0.965); }
.pill .i { font-size: 16px; color: var(--ink-3); }
.pill .sub { color: var(--ink-3); font-weight: 500; }
.pill .dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
#search-btn { margin: 0 auto; min-width: min(360px, 34vw); justify-content: flex-start; color: var(--ink-3); font-weight: 500; }
#search-btn kbd { margin-left: auto; font: 500 11px var(--font); color: var(--ink-4); border: 1px solid var(--stroke); border-radius: 6px; padding: 2px 6px; }
#vitals { display: flex; gap: 2px; padding: 0 8px; height: 40px; border-radius: 999px; align-items: center; }
.vital { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.vital svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.vital .ring circle { fill: none; stroke-width: 2.6; }
.vital .ring .track { stroke: rgba(255, 255, 255, 0.1); }
.vital .ring .val { stroke: var(--c, #fff); stroke-linecap: round; transition: stroke-dashoffset 0.9s var(--ease), stroke 0.4s; }
.vital .i { font-size: 13px; color: var(--c, #fff); opacity: 0.95; }
.vital.low .ring .val { stroke: var(--neg); }
.vital.low .i { color: var(--neg); animation: pulse 1.2s ease-in-out infinite; }
#balance .amt { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Контекстная панель ---------- */
#panel {
  position: absolute; z-index: 10; left: 20px; top: calc(70px + env(safe-area-inset-top, 0px)); bottom: 104px; width: var(--panel-w);
  border-radius: var(--r-xl); display: flex; flex-direction: column; overflow: hidden;
  transition: transform 0.7s var(--ease), opacity 0.5s var(--ease);
}
#panel.hidden { transform: translateX(-30px) scale(0.98); opacity: 0; pointer-events: none; }
.panel-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 20px 24px; scrollbar-width: none; }
.panel-scroll::-webkit-scrollbar { display: none; }
.panel-view { display: flex; flex-direction: column; gap: 18px; animation: view-in 0.55s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px); } }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-2); font-size: 14px; font-weight: 550; margin: -4px 0 -6px -6px; padding: 4px 8px 4px 2px; border-radius: 10px; align-self: flex-start; }
.back:hover { background: var(--accent-soft); }
.back .i { font-size: 17px; }

.hero { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.eyebrow .flag { font-size: 15px; letter-spacing: 0; }
.title { font-size: 31px; line-height: 1.08; font-weight: 700; letter-spacing: -0.025em; }
.title.sm { font-size: 24px; }
.subtitle { color: var(--ink-2); font-size: 14.5px; }
.bigflag { font-size: 46px; line-height: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--fill); border: 1px solid var(--stroke); font-size: 12px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.chip .i { font-size: 13px; }
.chip.accent { background: var(--accent-soft); border-color: rgba(255, 122, 26, 0.32); color: var(--accent-2); }
.chip.pos { background: rgba(48, 209, 88, 0.13); border-color: rgba(48, 209, 88, 0.28); color: var(--pos); }
.chip.neg { background: rgba(255, 69, 58, 0.13); border-color: rgba(255, 69, 58, 0.28); color: var(--neg); }
.chip.sky { background: rgba(124, 196, 255, 0.12); border-color: rgba(124, 196, 255, 0.28); color: var(--sky); }

.section-h { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: -8px; }
.section-h button { color: var(--accent-2); font-size: 12.5px; font-weight: 550; letter-spacing: 0; text-transform: none; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  position: relative; text-align: left; border-radius: var(--r-md); padding: 14px 14px 13px; background: var(--fill); border: 1px solid var(--stroke);
  display: flex; flex-direction: column; gap: 10px; min-height: 96px;
  transition: transform 0.45s var(--spring), background 0.25s, border-color 0.25s;
  animation: tile-in 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 38ms + 80ms);
}
@keyframes tile-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
.tile:hover { background: var(--fill-2); border-color: var(--stroke-2); transform: translateY(-2px); }
.tile:active { transform: scale(0.97); }
.tile .ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--fill-2); font-size: 18px; color: var(--ink); }
.tile.primary .ico { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(255, 122, 26, 0.35); }
.tile .t { font-weight: 620; font-size: 14.5px; letter-spacing: -0.01em; }
.tile .s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; line-height: 1.3; }
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; gap: 12px; }
.tile.wide .txt { flex: 1; min-width: 0; }
.tile.disabled { opacity: 0.42; pointer-events: none; }
.tile .badge { position: absolute; top: 12px; right: 12px; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--stroke); border: 1px solid var(--stroke); border-radius: var(--r-md); overflow: hidden; }
.kv > div { background: rgba(28, 28, 31, 0.92); padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv .k { font-size: 11.5px; color: var(--ink-3); font-weight: 550; }
.kv .v { font-size: 15px; font-weight: 620; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.kv .v small { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.list { display: flex; flex-direction: column; border-radius: var(--r-md); border: 1px solid var(--stroke); background: var(--fill); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; text-align: left; width: 100%; position: relative; transition: background 0.2s; min-width: 0; }
.row + .row::before { content: ""; position: absolute; left: 13px; right: 0; top: 0; height: 1px; background: var(--stroke); }
button.row:hover { background: var(--fill-2); }
button.row:active { background: var(--fill-3); }
.row .lead { width: 34px; height: 34px; border-radius: 10px; background: var(--fill-2); display: grid; place-items: center; font-size: 17px; flex: none; }
.row .lead.code { font: 650 11px var(--mono); letter-spacing: 0.04em; color: var(--sky); }
.row .lead.flag { font-size: 20px; background: none; }
.row .mid { flex: 1; min-width: 0; }
.row .t { font-weight: 580; font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s.wrap { white-space: normal; }
.row .trail { text-align: right; flex: none; font-size: 14px; font-weight: 600; }
.row .trail small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.row .chev { color: var(--ink-4); font-size: 15px; flex: none; }
.row.locked { opacity: 0.5; }
.list .row.sel { background: var(--fill-2); box-shadow: inset 3px 0 0 var(--accent); }
.stagger > * { animation: tile-in 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms + 60ms); }

/* ---------- Кнопки и поля ---------- */
.btn {
  height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 620; font-size: 15px; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--fill-2); border: 1px solid var(--stroke); white-space: nowrap;
  transition: transform 0.4s var(--spring), background 0.2s, opacity 0.2s, box-shadow 0.3s;
}
.btn:hover { background: var(--fill-3); }
.btn:active { transform: scale(0.96); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 8px 26px rgba(255, 122, 26, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn.primary:hover { background: #ff8a33; box-shadow: 0 10px 32px rgba(255, 122, 26, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn.white { background: #f5f5f7; color: #000; border-color: transparent; }
.btn.white:hover { background: #fff; }
.btn.lg { height: 54px; font-size: 17px; padding: 0 30px; }
.btn.sm { height: 34px; font-size: 13.5px; padding: 0 14px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: 0.38; pointer-events: none; }
.btn .i { font-size: 18px; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); font-size: 17px; color: var(--ink-2); transition: transform 0.4s var(--spring), background 0.2s; flex: none; }
.iconbtn:hover { background: var(--fill-3); color: var(--ink); }
.iconbtn:active { transform: scale(0.9); }

.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border: 1px solid var(--stroke); border-radius: 12px; padding: 3px; }
.seg button { position: relative; z-index: 1; height: 32px; border-radius: 9px; font-size: 13px; font-weight: 580; color: var(--ink-2); transition: color 0.25s; white-space: nowrap; padding: 0 8px; }
.seg button.on { color: var(--ink); }
.seg .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: rgba(255, 255, 255, 0.16); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12); transition: transform 0.5s var(--spring), width 0.4s var(--ease); }

.field { display: flex; align-items: center; gap: 10px; height: 48px; border-radius: 14px; background: var(--fill); border: 1px solid var(--stroke); padding: 0 14px; transition: border-color 0.2s, background 0.2s; }
.field:focus-within { border-color: rgba(255, 122, 26, 0.6); background: var(--fill-2); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; user-select: text; -webkit-user-select: text; }
.field input::placeholder { color: var(--ink-4); }
.field .i { font-size: 18px; color: var(--ink-3); }
.field .unit { color: var(--ink-3); font-weight: 600; font-size: 14px; }
.field.big { height: 64px; border-radius: 18px; }
.field.big input { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }

/* ---------- Док ---------- */
#dock {
  position: absolute; z-index: 10; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; gap: 6px; padding: 8px; border-radius: 26px;
  transition: transform 0.7s var(--ease), opacity 0.5s;
}
.dock-item { position: relative; width: 58px; height: 58px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); transition: transform 0.45s var(--spring), background 0.2s, color 0.2s; }
.dock-item .i { font-size: 22px; }
.dock-item span { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; }
.dock-item:hover { background: var(--fill-2); color: var(--ink); transform: translateY(-4px) scale(1.06); }
.dock-item:active { transform: scale(0.94); }
.dock-item.on { color: var(--accent-2); }
.dock-item .dot { position: absolute; top: 8px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(20, 20, 23, 0.9); }

body.cinema #topbar, body.cinema #dock, body.cinema #panel { opacity: 0; pointer-events: none; }
body.cinema #topbar { transform: translateY(-20px); }
body.cinema #dock { transform: translateX(-50%) translateY(30px); }
body.cinema #panel { transform: translateX(-30px); }
body.cinema #labels { opacity: 0.0; }
body.cinema.flying #labels { opacity: 1; }

/* ---------- Подсказка у курсора ---------- */
#tip { position: absolute; z-index: 12; left: 0; top: 0; pointer-events: none; padding: 7px 11px; border-radius: 12px; font-size: 12.5px; font-weight: 580; opacity: 0; transition: opacity 0.18s; white-space: nowrap; }
#tip.on { opacity: 1; }
#tip small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11.5px; }

/* ---------- Листы (модальные окна) ---------- */
#sheets { position: absolute; inset: 0; z-index: 75; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.45s var(--ease); pointer-events: auto; }
.scrim.on { opacity: 1; }
.sheet-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px 16px; pointer-events: none; }
.sheet {
  pointer-events: auto; width: min(100%, var(--w, 560px)); max-height: min(100%, 860px); border-radius: var(--r-xl); display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(26px) scale(0.965); transition: transform 0.65s var(--spring), opacity 0.35s var(--ease);
}
.sheet.on { opacity: 1; transform: none; }
.sheet.out { opacity: 0; transform: translateY(14px) scale(0.98); transition: transform 0.3s var(--ease-io), opacity 0.25s; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 6px 24px; }
.sheet-head, .sheet-foot { flex-shrink: 0; }
.sheet-body { min-height: 0; }
.sheet-body > * { flex-shrink: 0; }
.sheet[inert] { visibility: hidden; }
body.modal-open #dock, body.modal-open #topbar, body.modal-open .city-card, body.modal-open .city-browser { pointer-events: none; }
.journal-sheet { background: #202125; }
.journal-sheet > .journal-tabs { margin: 14px 24px 0; flex-shrink: 0; display: flex; }
.journal-sheet > .journal-tabs button { flex: 1 0 auto; }
.journal-tabs .thumb { display: none; }
.journal-tabs button.on { background: rgba(255,255,255,.16); border-radius: 8px; }
.journal-sheet .passport-spread-head { flex-wrap: wrap; }
.journal-sheet .passport-book-viewport { flex-shrink: 0; }
.journal-sheet .sheet-foot { padding: 12px 24px; background: #202125; }
.journal-sheet .sheet-foot .passport-book-controls { width: 100%; }
.passport-spine { pointer-events: none; }
.sheet-head .ttl { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.12; }
.sheet-head p { color: var(--ink-3); font-size: 13.5px; margin-top: 3px; }
.sheet-body { padding: 14px 24px 24px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.sheet-foot { padding: 14px 24px 22px; border-top: 1px solid var(--stroke); display: flex; gap: 10px; align-items: center; background: rgba(18, 18, 20, 0.5); }
.sheet-foot .grow { flex: 1; min-width: 0; }
.sheet-foot .sum { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-foot .sum small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.note { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.note b { color: var(--ink-2); font-weight: 600; }
.empty { text-align: center; color: var(--ink-3); padding: 28px 10px; font-size: 14px; }
.empty .i { font-size: 30px; margin: 0 auto 10px; color: var(--ink-4); }

/* ---------- События ---------- */
.ev .sheet-body { gap: 18px; padding-top: 6px; }
.ev-kicker { font-size: 12px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); }
.ev-text { font-size: 16.5px; line-height: 1.5; color: var(--ink-2); max-width: 62ch; }
.ev-text b { color: var(--ink); font-weight: 600; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { text-align: left; padding: 14px 16px; border-radius: 16px; background: var(--fill); border: 1px solid var(--stroke); display: flex; align-items: center; gap: 12px; transition: transform 0.4s var(--spring), background 0.2s, border-color 0.2s; animation: tile-in 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 200ms); }
.choice:hover { background: var(--fill-2); border-color: var(--stroke-2); transform: translateX(3px); }
.choice:active { transform: scale(0.985); }
.choice .t { font-weight: 600; font-size: 15px; }
.choice .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.choice .mid { flex: 1; }
.choice.locked { opacity: 0.45; pointer-events: none; }
.effects { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Тосты ---------- */
#toasts { position: absolute; z-index: 80; top: calc(64px + env(safe-area-inset-top, 0px)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 580; max-width: 100%; animation: toast-in 0.6s var(--spring) both; }
.toast.out { animation: toast-out 0.35s var(--ease-io) both; }
.toast .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-3); font-size: 14px; flex: none; }
.toast.pos .ico { background: rgba(48, 209, 88, 0.2); color: var(--pos); }
.toast.neg .ico { background: rgba(255, 69, 58, 0.2); color: var(--neg); }
.toast.accent .ico { background: var(--accent); color: #fff; }
.toast small { color: var(--ink-3); font-weight: 500; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(0.96); } }

/* ---------- Поиск ---------- */
.spot { --w: 620px; align-self: start; margin-top: 9vh; }
.spot .field { height: 58px; border: 0; background: none; border-radius: 0; border-bottom: 1px solid var(--stroke); padding: 0 22px; }
.spot .field input { font-size: 19px; }
.spot .results { max-height: min(56vh, 480px); overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.spot .grp { font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); padding: 10px 12px 4px; }
.spot .row { border-radius: 12px; }
.spot .row + .row::before { display: none; }
.spot .row.sel { background: var(--fill-2); }

/* ---------- Графики и биржа ---------- */
.chart { position: relative; width: 100%; height: 220px; border-radius: var(--r-md); touch-action: none; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.quote { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.quote .px { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.delta { font-weight: 620; font-size: 14px; }
.delta.pos { color: var(--pos); } .delta.neg { color: var(--neg); }
.spark { width: 72px; height: 28px; flex: none; }
.badge-delta { min-width: 66px; text-align: center; padding: 4px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: #fff; font-variant-numeric: tabular-nums; }
.badge-delta.pos { background: rgba(48, 209, 88, 0.85); } .badge-delta.neg { background: rgba(255, 69, 58, 0.88); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.news-item { padding: 12px 14px; border-radius: 14px; background: var(--fill); border: 1px solid var(--stroke); display: flex; flex-direction: column; gap: 4px; }
.news-item .when { font-size: 11.5px; color: var(--ink-4); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.news-item .hd { font-weight: 600; font-size: 14.5px; line-height: 1.3; }

/* ---------- Кошелёк ---------- */
.wallet-total { font-size: 44px; font-weight: 720; letter-spacing: -0.035em; line-height: 1.05; }
.conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.conv .side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cur-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--fill); border: 1px solid var(--stroke); font-weight: 620; font-size: 14px; transition: background 0.2s; }
.cur-btn:hover { background: var(--fill-2); }
.cur-btn .s { color: var(--ink-3); font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swap { width: 40px; height: 40px; border-radius: 50%; background: var(--fill-2); display: grid; place-items: center; font-size: 18px; transition: transform 0.6s var(--spring), background 0.2s; }
.swap:hover { background: var(--fill-3); transform: rotate(180deg); }

/* ---------- Перелёт ---------- */
#flight { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
#flight video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s var(--ease-io); background: #000; }
#flight.video video { opacity: 1; }
#flight .shade { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s; background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 24%, transparent 62%, rgba(0, 0, 0, 0.8) 100%); }
#flight.on .shade { opacity: 1; }
.fl-top { position: absolute; top: calc(26px + env(safe-area-inset-top, 0px)); left: 32px; right: 32px; display: flex; align-items: flex-start; gap: 16px; opacity: 0; transform: translateY(-12px); transition: opacity 0.8s var(--ease) 0.3s, transform 0.9s var(--ease) 0.3s; }
#flight.on .fl-top, #flight.on .fl-bottom { opacity: 1; transform: none; }
.fl-top .who { flex: 1; }
.fl-kicker { font-size: 12px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.fl-route { font-size: clamp(26px, 4vw, 44px); font-weight: 720; letter-spacing: -0.03em; line-height: 1.08; margin-top: 6px; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6); }
.fl-route .arrow { color: var(--accent); margin: 0 0.18em; }
.fl-actions { display: flex; gap: 8px; pointer-events: auto; }
.fl-bottom { position: absolute; left: 32px; right: 32px; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 18px; opacity: 0; transform: translateY(14px); transition: opacity 0.8s var(--ease) 0.4s, transform 0.9s var(--ease) 0.4s; }
.fl-stats { display: flex; gap: clamp(18px, 4vw, 54px); flex-wrap: wrap; }
.fl-stat .k { font-size: 11.5px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.fl-stat .v { font-size: clamp(20px, 2.4vw, 28px); font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.fl-track { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.fl-code { font: 700 20px var(--mono); letter-spacing: 0.05em; }
.fl-code small { display: block; font: 500 12px var(--font); color: var(--ink-3); letter-spacing: 0; margin-top: 2px; }
.fl-code.r { text-align: right; }
.fl-bar { position: relative; height: 2px; background: rgba(255, 255, 255, 0.2); border-radius: 2px; }
.fl-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; width: 0; }
.fl-bar b { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; left: 0; color: #fff; display: grid; place-items: center; font-size: 22px; filter: drop-shadow(0 0 10px rgba(255, 122, 26, 0.9)); }
.fl-bar b .i { transform: rotate(90deg); fill: currentColor; stroke: none; }

.pass-wrap { position: absolute; inset: 0; display: grid; place-items: center; z-index: 42; pointer-events: none; padding: 16px; }
.pass { width: min(100%, 420px); border-radius: 26px; overflow: hidden; color: #111; background: #f5f5f7; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); opacity: 0; transform: translateY(60px) scale(0.92) rotateX(18deg); transition: transform 0.9s var(--spring), opacity 0.5s var(--ease); transform-origin: 50% 100%; }
.pass.on { opacity: 1; transform: none; }
.pass.out { opacity: 0; transform: translateY(-80px) scale(0.9); transition: transform 0.7s var(--ease-io), opacity 0.5s; }
.pass-top { background: #111; color: #f5f5f7; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; letter-spacing: 0.16em; font-size: 12px; }
.pass-top b { color: var(--accent); }
.pass-main { padding: 22px 22px 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.pass-main .code { font: 750 40px var(--font); letter-spacing: -0.02em; line-height: 1; }
.pass-main .city { font-size: 12.5px; color: #6e6e73; margin-top: 4px; font-weight: 550; }
.pass-main .r { text-align: right; }
.pass-main .pl { font-size: 24px; color: var(--accent); }
.pass-main .pl .i { transform: rotate(90deg); fill: currentColor; stroke: none; }
.pass-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; padding: 6px 22px 20px; }
.pass-grid .k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #86868b; }
.pass-grid .v { font-size: 15px; font-weight: 650; margin-top: 2px; }
.pass-cut { position: relative; height: 1px; border-top: 2px dashed #c7c7cc; margin: 0 18px; }
.pass-cut::before, .pass-cut::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: #000; }
.pass-cut::before { left: -32px; } .pass-cut::after { right: -32px; }
.pass-code { padding: 16px 22px 20px; display: flex; align-items: center; gap: 14px; }
.pass-code .bars { flex: 1; height: 44px; background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 5px, #111 5px 6px, transparent 6px 9px, #111 9px 12px, transparent 12px 14px); border-radius: 4px; }
.pass-code .night { font-size: 12px; font-weight: 650; color: #6e6e73; text-align: right; line-height: 1.3; }

.arrive { --w: 480px; text-align: center; }
.arrive .sheet-body { align-items: center; padding: 34px 28px 28px; gap: 14px; }
.arrive .bigflag { font-size: 72px; animation: stamp 0.9s var(--spring) both 0.25s; }
@keyframes stamp { from { opacity: 0; transform: scale(2.2) rotate(-14deg); } }
.arrive h2 { font-size: 30px; font-weight: 720; letter-spacing: -0.028em; }
.arrive .kv { width: 100%; text-align: left; }

/* ---------- 3D-магазин ---------- */
#store { position: absolute; inset: 0; z-index: 45; background: #0b0b0c; opacity: 0; pointer-events: none; transition: opacity 0.8s var(--ease-io); }
#store.on { opacity: 1; pointer-events: auto; }
#store canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#store canvas.pointing { cursor: pointer; }
#store canvas.grabbing { cursor: grabbing; }
.st-top { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); left: 20px; right: 20px; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.st-top > * { pointer-events: auto; }
.st-name { margin-right: auto; padding: 0 18px; height: 44px; border-radius: 999px; display: flex; align-items: center; gap: 10px; font-weight: 650; }
.st-name small { color: var(--ink-3); font-weight: 500; }
.st-help { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; font-size: 13px; color: var(--ink-2); display: flex; gap: 14px; align-items: center; white-space: nowrap; transition: opacity 0.6s; pointer-events: none; }
.st-help kbd { font: 600 11px var(--font); border: 1px solid var(--stroke-2); border-radius: 6px; padding: 2px 6px; color: var(--ink); margin-right: 4px; }
.st-cartbtn { position: relative; }
.st-cartbtn .count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; transition: transform 0.5s var(--spring); }
.st-cartbtn .count.bump { transform: scale(1.5); }
.st-card { position: absolute; z-index: 3; width: 292px; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(10px) scale(0.96); transition: opacity 0.3s var(--ease), transform 0.5s var(--spring); pointer-events: none; }
.st-card.on { opacity: 1; transform: none; pointer-events: auto; }
.st-card .top { display: flex; gap: 12px; align-items: center; }
.st-card .emoji { width: 56px; height: 56px; border-radius: 16px; background: var(--fill-2); display: grid; place-items: center; font-size: 32px; flex: none; }
.st-card .nm { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; line-height: 1.2; }
.st-card .ds { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.st-card .price { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.st-card .price small { font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--fill); border: 1px solid var(--stroke); border-radius: 999px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; transition: background 0.2s, transform 0.3s var(--spring); }
.stepper button:hover { background: var(--fill-2); }
.stepper button:active { transform: scale(0.85); }
.stepper span { min-width: 26px; text-align: center; font-weight: 650; }
.fly-item { position: absolute; z-index: 5; font-size: 34px; pointer-events: none; left: 0; top: 0; will-change: transform; }
.st-fade { position: absolute; inset: 0; background: #000; pointer-events: none; opacity: 1; transition: opacity 1.2s var(--ease-io); }
.st-fade.off { opacity: 0; }
#joy { position: absolute; left: 24px; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); width: 116px; height: 116px; border-radius: 50%; display: none; touch-action: none; }
#joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
@media (pointer: coarse) { #joy { display: block; } .st-help { display: none; } }


/* ---------- Город (2.5D) ---------- */
#city { position: absolute; inset: 0; z-index: 6; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.7s var(--ease-io); }
#city.on { pointer-events: auto; }
#city.ready { opacity: 1; }
#city canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#city canvas.grabbing { cursor: grabbing; }
#city canvas.pointing { cursor: pointer; }
.city-pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.city-pin { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(22, 22, 25, 0.86); border: 1px solid rgba(255, 255, 255, 0.14); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; transform-origin: 50% 100%; will-change: transform; opacity: 0; transition: background 0.2s, border-color 0.2s; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); margin-top: -10px; }
.city-pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; background: rgba(22, 22, 25, 0.86); border-right: 1px solid rgba(255, 255, 255, 0.14); border-bottom: 1px solid rgba(255, 255, 255, 0.14); transform: translateX(-50%) rotate(45deg); }
.city-pin .pi { width: 22px; height: 22px; border-radius: 50%; background: var(--c); display: grid; place-items: center; color: #111; font-size: 13px; flex: none; }
.city-pin.hover, .city-pin:hover { background: rgba(44, 44, 50, 0.96); border-color: rgba(255, 255, 255, 0.3); }
.city-pin.airport .pi, .city-pin.store .pi { color: #fff; }
.city-card { position: absolute; z-index: 5; width: 300px; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(10px) scale(0.96); transition: opacity 0.3s var(--ease), transform 0.5s var(--spring); pointer-events: none; }
.city-card.on { opacity: 1; transform: none; pointer-events: auto; }
.city-card .top { display: flex; gap: 12px; align-items: center; }
.city-card .ico { width: 46px; height: 46px; border-radius: 14px; background: var(--c); color: #111; display: grid; place-items: center; font-size: 22px; flex: none; }
.city-card .nm { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; line-height: 1.2; }
.city-card .ds { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.city-card .go, .city-card .acts { display: flex; flex-direction: column; gap: 8px; }
.city-hud { position: absolute; inset: 0; pointer-events: none; }
.city-hud > * { pointer-events: none; }
.city-top { position: absolute; top: calc(70px + env(safe-area-inset-top, 0px)); left: 20px; right: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.city-top > * { pointer-events: auto; }
.city-title { height: 44px; padding: 0 16px; border-radius: 999px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.city-title .flag { font-size: 18px; }
.city-title small { color: var(--ink-3); }
.city-legend { margin-left: auto; height: 44px; padding: 0 14px; border-radius: 999px; display: flex; align-items: center; gap: 12px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.city-legend > span { display: flex; align-items: center; gap: 5px; }
.city-legend .i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: #111; padding: 3px; }
.city-help { position: absolute; left: 20px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); padding: 10px 16px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.city-view { position: absolute; right: 20px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.city-view > * { pointer-events: auto; }
@media (max-width: 860px) { .city-view { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); right: 16px; } }
.city-help kbd { font: 600 11px var(--font); border: 1px solid var(--stroke-2); border-radius: 6px; padding: 2px 6px; color: var(--ink); margin-right: 4px; }
@media (max-width: 860px) {
  .city-legend, .city-help { display: none; }
  .city-top { top: calc(112px + env(safe-area-inset-top, 0px)); }
}

/* ---------- Заставка и загрузка ---------- */
#intro { position: absolute; inset: 0; z-index: 70; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(24px, 6vw, 72px); pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.25) 46%, transparent 70%); transition: opacity 1s var(--ease-io); }
#intro.out { opacity: 0; }
#intro > * { pointer-events: auto; }
#intro .inner { max-width: 640px; display: flex; flex-direction: column; gap: 22px; }
#intro h1 { font-size: clamp(44px, 7.4vw, 104px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95; white-space: nowrap; }
#intro h1 span { display: inline-block; animation: rise 1.1s var(--ease) both; animation-delay: calc(var(--i) * 45ms + 250ms); }
#intro h1 em { font-style: normal; color: var(--accent); }
@keyframes rise { from { opacity: 0; transform: translateY(0.5em); filter: blur(8px); } }
#intro .lead { font-size: clamp(16px, 1.7vw, 21px); color: var(--ink-2); line-height: 1.45; max-width: 34em; animation: rise 1.1s var(--ease) both 0.8s; }
#intro .cta { display: flex; gap: 12px; flex-wrap: wrap; animation: rise 1.1s var(--ease) both 1s; }
#intro .facts { display: flex; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; animation: rise 1.1s var(--ease) both 1.15s; padding-top: 8px; }
#intro .fact b { display: block; font-size: clamp(20px, 2.2vw, 28px); font-weight: 700; letter-spacing: -0.02em; }
#intro .fact span { font-size: 12.5px; color: var(--ink-3); font-weight: 550; }

#loader { position: absolute; inset: 0; z-index: 90; background: #000; display: grid; place-items: center; transition: opacity 0.9s var(--ease-io); }
#loader.out { opacity: 0; pointer-events: none; }
#loader .box { display: flex; flex-direction: column; align-items: center; gap: 22px; }
#loader .mark { font-weight: 800; letter-spacing: 0.3em; font-size: 14px; padding-left: 0.3em; }
#loader .mark b { color: var(--accent); }
#loader .bar { width: 180px; height: 2px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden; }
#loader .bar i { display: block; height: 100%; width: 0%; background: #fff; transition: width 0.5s var(--ease); }
#loader .err { color: var(--ink-3); font-size: 13px; max-width: 320px; text-align: center; }

/* ---------- Старт: выбор города ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-card { min-height: 132px; padding: 15px; border-radius: 18px; text-align: left; background: var(--fill); border: 1px solid var(--stroke); display: flex; flex-direction: column; gap: 6px; transition: transform 0.4s var(--spring), background 0.2s, border-color 0.2s, box-shadow 0.25s; }
.mode-card:hover { background: var(--fill-2); border-color: var(--stroke-2); transform: translateY(-2px); }
.mode-card.selected { border-color: rgba(255, 122, 26, 0.58); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.14), 0 12px 30px rgba(0, 0, 0, 0.18); }
.mode-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--fill-2); display: grid; place-items: center; font-size: 19px; margin-bottom: 3px; }
.mode-card.selected .mode-icon { background: var(--accent); color: #fff; }
.mode-card .t { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.mode-card .s { color: var(--ink-3); font-size: 12.5px; line-height: 1.35; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.start-card { text-align: left; padding: 13px 14px; border-radius: 16px; background: var(--fill); border: 1px solid var(--stroke); display: flex; flex-direction: column; gap: 3px; transition: transform 0.4s var(--spring), background 0.2s, border-color 0.2s; }
.start-card:hover { background: var(--fill-2); transform: translateY(-2px); border-color: var(--stroke-2); }
.start-card .f { font-size: 22px; }
.start-card .t { font-weight: 620; font-size: 14.5px; }
.start-card .s { font-size: 12px; color: var(--ink-3); }
.start-card .lvl { font-size: 11.5px; font-weight: 650; margin-top: 4px; }
.quick-age { display: flex; flex-wrap: wrap; gap: 7px; margin-top: -3px; }
.quick-age .chip { min-height: 32px; padding: 6px 11px; }
.island-start-card { width: 100%; padding: 16px; border-radius: 18px; background: linear-gradient(145deg, rgba(124, 196, 255, 0.09), rgba(255, 122, 26, 0.08)); border: 1px solid var(--stroke-2); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; text-align: left; transition: transform 0.4s var(--spring), border-color 0.2s, background 0.2s; }
.island-start-card:hover { transform: translateY(-2px); border-color: rgba(255, 122, 26, 0.42); background: linear-gradient(145deg, rgba(124, 196, 255, 0.13), rgba(255, 122, 26, 0.13)); }
.island-start-card .f { font-size: 32px; }
.island-start-card .t { font-weight: 650; font-size: 15px; }
.island-start-card .s { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.island-start-card > .i { color: var(--ink-3); }

/* ---------- Журнал ---------- */
.journal-tabs { overflow-x: auto; scrollbar-width: none; }
.journal-tabs::-webkit-scrollbar { display: none; }
.story-card { padding: 18px; border-radius: 20px; background: linear-gradient(155deg, rgba(255, 122, 26, 0.11), rgba(255, 255, 255, 0.045) 58%); border: 1px solid rgba(255, 122, 26, 0.22); display: flex; flex-direction: column; gap: 11px; }
.story-card.compact { padding: 15px; gap: 7px; }
.story-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.story-head h3, .passport-card h3, .document-card h3 { font-size: 17px; line-height: 1.2; font-weight: 680; letter-spacing: -0.015em; }
.story-kicker { color: var(--accent-2); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.story-chapter { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.story-objective { font-size: 18px; line-height: 1.28; font-weight: 670; letter-spacing: -0.015em; }
.story-copy { color: var(--ink-2); font-size: 13.5px; line-height: 1.48; }
.story-progress { height: 6px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.story-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.6s var(--ease); }
.story-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 14px; color: var(--ink-3); font-size: 11.5px; font-weight: 570; }
.story-hint { padding: 14px; border-radius: 17px; border: 1px dashed var(--stroke-2); background: var(--fill); display: flex; flex-direction: column; gap: 10px; }
.story-hint.revealed { border-style: solid; border-color: rgba(124, 196, 255, 0.3); background: rgba(124, 196, 255, 0.075); }
.story-hint-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.story-hint-top strong { font-size: 13.5px; }
.story-hint-top span { color: var(--ink-3); font-size: 11.5px; }
.story-hint p { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.story-actions { display: flex; flex-direction: column; gap: 8px; }
.story-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.story-facts > div { min-width: 0; padding: 10px 12px; border-radius: 13px; background: var(--fill); border: 1px solid var(--stroke); display: flex; justify-content: space-between; gap: 10px; }
.story-facts span { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-facts b { font-size: 12px; font-weight: 650; text-align: right; }
.passport-card { padding: 16px; border-radius: 18px; background: var(--fill); border: 1px solid var(--stroke); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; }
.passport-icon, .document-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--fill-2); display: grid; place-items: center; font-size: 20px; flex: none; }
.passport-main { min-width: 0; }
.passport-main p { color: var(--ink-3); font-size: 11.5px; margin-top: 3px; }
.passport-book { outline: none; display: flex; flex-direction: column; gap: 10px; user-select: none; touch-action: pan-y; }
.passport-book:focus-visible .passport-book-viewport { box-shadow: 0 0 0 2px rgba(255, 122, 26, 0.55); }
.passport-profile-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 1px; scrollbar-width: none; }
.passport-profile-bar::-webkit-scrollbar { display: none; }
.passport-profile-bar .btn { flex: 0 0 auto; }
.passport-cover-band { min-height: 58px; padding: 10px 14px; border-radius: 17px 17px 8px 8px; background: linear-gradient(135deg, #2a1711, #432216 58%, #251510); border: 1px solid rgba(255, 179, 113, 0.2); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; color: #f4d9bf; }
.passport-cover-v { width: 34px; height: 34px; border: 1px solid rgba(244, 217, 191, .52); border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.passport-cover-band b { display: block; font-size: 12px; letter-spacing: .12em; }
.passport-cover-band small { display: block; margin-top: 2px; color: rgba(244, 217, 191, .62); font-size: 10px; }
.passport-page-counter { min-width: 44px; text-align: right; font-size: 12px; font-weight: 650; }
.passport-book-viewport { min-height: 420px; border-radius: 8px 8px 18px 18px; overflow: hidden; transition: box-shadow .2s; }
.passport-spread { position: relative; min-height: 420px; padding: 24px 27px 18px; overflow: hidden; color: #352a22; background: repeating-linear-gradient(0deg, rgba(92,73,52,.022) 0 1px, transparent 1px 5px), #efe7d8; border: 1px solid rgba(128,95,60,.28); display: flex; flex-direction: column; gap: 18px; }
.passport-spine { position: absolute; inset: 0 auto 0 50%; width: 1px; background: rgba(71,50,30,.12); box-shadow: -7px 0 17px rgba(75,51,28,.05), 7px 0 17px rgba(75,51,28,.05); }
.passport-spread-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; position: relative; z-index: 1; }
.passport-brand { color: #9b5d31; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.passport-spread-head h3 { margin-top: 3px; font-size: 23px; line-height: 1.08; letter-spacing: -.025em; }
.passport-spread-head p { margin-top: 4px; color: rgba(53,42,34,.62); font-size: 11px; }
.passport-fictional { flex: none; padding: 4px 7px; border: 1px solid rgba(133,76,37,.28); border-radius: 5px; color: rgba(133,76,37,.72); font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.passport-spread-body { position: relative; z-index: 1; flex: 1; min-height: 0; }
.passport-identity-layout { display: grid; grid-template-columns: 128px 1fr; gap: 18px; align-items: stretch; }
.passport-portrait { min-height: 174px; border: 1px solid rgba(91,66,44,.22); border-radius: 9px; background: radial-gradient(circle at 50% 35%, rgba(166,126,83,.19), transparent 44%), rgba(255,255,255,.28); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; }
.passport-portrait-mark { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: rgba(86,61,40,.09); border: 1px solid rgba(86,61,40,.18); font-size: 22px; font-weight: 700; }
.passport-portrait small { color: rgba(53,42,34,.46); font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.passport-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.passport-field { min-width: 0; padding-bottom: 8px; border-bottom: 1px solid rgba(91,66,44,.16); }
.passport-field span { display: block; color: rgba(53,42,34,.5); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.passport-field b { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 13px; font-weight: 690; }
.passport-stamp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 8px 4px; }
.passport-stamp { min-height: 100px; padding: 12px; border: 2px dashed rgba(142,71,43,.42); border-radius: 50% 46% 48% 44%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transform: rotate(var(--rot)); color: rgba(116,55,35,.78); }
.passport-stamp-flag { font-size: 19px; }
.passport-stamp strong { margin-top: 3px; font-size: 11px; }
.passport-stamp small { margin-top: 2px; font-size: 8px; }
.passport-stamp em { margin-top: 5px; font-size: 7px; font-weight: 700; letter-spacing: .1em; font-style: normal; }
.passport-permits { display: grid; gap: 10px; }
.passport-permit { padding: 13px; border: 1px solid rgba(91,66,44,.18); border-radius: 10px; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.passport-permit strong { display: block; font-size: 13px; }
.passport-permit small { display: block; margin-top: 2px; color: rgba(53,42,34,.45); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.passport-permit .chip { flex: none; }
.passport-history { display: flex; flex-direction: column; gap: 0; padding: 3px 0; }
.passport-history-event { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; min-height: 58px; }
.passport-history-event i { width: 10px; height: 10px; margin-top: 3px; border-radius: 50%; background: #8e5e37; box-shadow: 0 0 0 4px rgba(142,94,55,.12); }
.passport-history-event:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 15px; bottom: 0; width: 1px; background: rgba(91,66,44,.2); }
.passport-history-event strong { display: block; font-size: 12px; }
.passport-history-event small { display: block; margin-top: 4px; color: rgba(53,42,34,.48); font-size: 9px; }
.passport-history-empty { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.passport-history-empty b { font-size: 14px; }
.passport-history-empty p { max-width: 360px; color: rgba(53,42,34,.55); font-size: 11px; line-height: 1.45; }
.passport-spread-note { position: relative; z-index: 1; max-width: 86%; color: rgba(53,42,34,.48); font-size: 9px; line-height: 1.4; }
.passport-spread-foot { position: relative; z-index: 1; padding-top: 9px; border-top: 1px solid rgba(91,66,44,.15); display: flex; justify-content: space-between; gap: 12px; color: rgba(53,42,34,.42); font-size: 8px; font-weight: 650; letter-spacing: .08em; }
.passport-book-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.passport-book-controls > span { color: var(--ink-4); font-size: 10.5px; text-align: center; }
.passport-book-controls .passport-prev { justify-self: start; }
.passport-book-controls .passport-next { justify-self: end; }
.passport-prev .i { transform: rotate(180deg); }
.artifacts-view { display: flex; flex-direction: column; gap: 12px; }
.artifact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.artifact-card { min-width: 0; overflow: hidden; border-radius: 19px; border: 1px solid var(--stroke); background: var(--fill); }
.artifact-card-photo { background: linear-gradient(155deg, rgba(124, 196, 255, .08), var(--fill) 48%); }
.artifact-card-press { background: linear-gradient(155deg, rgba(255, 190, 95, .09), var(--fill) 48%); }
.artifact-image, .artifact-fallback { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.artifact-fallback { position: relative; overflow: hidden; padding: 20px; background: radial-gradient(circle at 70% 20%, rgba(255,255,255,.12), transparent 32%), linear-gradient(150deg, #1c2026, #0f1115); color: #f6f7f8; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.artifact-fallback-photo::after { content: ""; position: absolute; inset: 13% 10%; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; background: linear-gradient(155deg, transparent 30%, rgba(255,255,255,.04)); transform: rotate(-1.4deg); }
.artifact-fallback-press { color: #2a241d; background: repeating-linear-gradient(0deg, rgba(73,59,42,.025) 0 1px, transparent 1px 5px), #ece2d1; }
.artifact-fallback-mark { position: absolute; top: 15px; left: 17px; z-index: 1; font-size: 10px; font-weight: 800; letter-spacing: .14em; opacity: .62; }
.artifact-fallback strong, .artifact-fallback p { position: relative; z-index: 1; }
.artifact-fallback strong { font-size: 15px; line-height: 1.15; }
.artifact-fallback p { max-width: 92%; font-size: 11px; line-height: 1.42; opacity: .72; }
.artifact-card-copy { padding: 14px; display: flex; flex-direction: column; gap: 7px; }
.artifact-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-4); font-size: 9px; font-weight: 760; letter-spacing: .1em; }
.artifact-card h3 { font-size: 15px; line-height: 1.2; }
.artifact-card-copy > p { color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.artifact-card-copy > small { color: var(--ink-4); font-size: 10.5px; line-height: 1.4; }
.artifact-empty { min-height: 150px; padding: 24px; border: 1px dashed var(--stroke-2); border-radius: 18px; color: var(--ink-3); display: grid; place-items: center; text-align: center; font-size: 13px; line-height: 1.5; }
.documents-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.document-card { min-width: 0; padding: 14px; border-radius: 18px; background: var(--fill); border: 1px solid var(--stroke); display: flex; flex-direction: column; gap: 7px; }
.document-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.document-group { width: fit-content; padding: 3px 8px; border-radius: 999px; background: var(--fill-2); color: var(--ink-3); font-size: 10.5px; font-weight: 650; }
.document-meta { display: flex; flex-direction: column; gap: 2px; color: var(--ink-3); font-size: 11.5px; }
.document-source { margin-top: auto; padding-top: 5px; border-top: 1px solid var(--stroke); color: var(--ink-4); font-size: 10.5px; overflow-wrap: anywhere; }
.documents-view, .obligations-view { display: flex; flex-direction: column; gap: 14px; }
.documents-toolbar { display: grid; grid-template-columns: minmax(170px, 1.4fr) repeat(3, minmax(118px, .8fr)); gap: 8px; }
.documents-toolbar input, .documents-toolbar select { width: 100%; min-width: 0; min-height: 40px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--fill); color: var(--ink); font: inherit; font-size: 12.5px; }
.documents-toolbar input:focus, .documents-toolbar select:focus { outline: none; border-color: rgba(255, 122, 26, .55); box-shadow: 0 0 0 3px rgba(255, 122, 26, .1); }
.documents-view-body { min-height: 120px; }
.document-card-button { width: 100%; color: inherit; text-align: left; cursor: pointer; transition: transform .28s var(--spring), border-color .2s, background .2s; }
.document-card-button:hover { transform: translateY(-2px); border-color: var(--stroke-2); background: var(--fill-2); }
.document-status { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: var(--fill-2); color: var(--ink-3); font-size: 10.5px; font-weight: 680; white-space: nowrap; }
.document-status.status-valid, .document-status.status-paid { background: rgba(67, 203, 119, .12); color: var(--pos); }
.document-status.status-pending, .document-status.status-temporary, .document-status.status-open { background: rgba(255, 184, 77, .12); color: #e2a84f; }
.document-status.status-expired, .document-status.status-lost, .document-status.status-damaged, .document-status.status-suspended, .document-status.status-revoked, .document-status.status-overdue { background: rgba(255, 94, 94, .12); color: var(--neg); }
.documents-empty, .obligations-empty { min-height: 150px; padding: 24px; border: 1px dashed var(--stroke-2); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--ink-3); }
.documents-empty b, .obligations-empty b { color: var(--ink); }
.documents-empty p, .obligations-empty p { max-width: 410px; font-size: 12.5px; line-height: 1.45; }
.document-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.document-detail-title { padding: 16px; border-radius: 18px; border: 1px solid var(--stroke); background: var(--fill); }
.document-detail-title h3 { margin-top: 7px; font-size: 20px; line-height: 1.15; }
.document-detail-title p { margin-top: 5px; color: var(--ink-3); font-size: 11.5px; }
.document-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.document-detail-field { min-width: 0; padding: 10px 11px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--fill); }
.document-detail-field span { display: block; color: var(--ink-4); font-size: 9.5px; font-weight: 680; text-transform: uppercase; letter-spacing: .05em; }
.document-detail-field b { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 12px; font-weight: 640; }
.document-detail-history { margin: 12px 0; padding: 13px; border-radius: 14px; background: var(--fill); border: 1px solid var(--stroke); }
.document-detail-history h4 { margin-bottom: 7px; font-size: 12px; }
.document-detail-history p { color: var(--ink-3); font-size: 11px; line-height: 1.5; }
.document-task-head { display: flex; align-items: flex-start; gap: 12px; }
.document-task-head > div { min-width: 0; }
.document-task-head span { color: var(--accent-2); font-size: 9px; font-weight: 760; letter-spacing: .11em; }
.document-task-head h3 { margin-top: 3px; font-size: 18px; }
.document-task-copy { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.document-task-help { padding: 11px 13px; border-radius: 14px; border: 1px solid var(--stroke); background: var(--fill); }
.document-task-help summary { cursor: pointer; font-size: 12.5px; font-weight: 650; }
.document-task-help p { margin-top: 6px; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; }
.document-task-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.document-task-field { padding: 10px; border: 1px solid var(--stroke); border-radius: 13px; background: var(--fill); display: flex; flex-direction: column; gap: 6px; }
.document-task-field > span { color: var(--ink-3); font-size: 10px; font-weight: 650; }
.document-task-field input[type="text"] { min-height: 36px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--stroke); background: var(--bg); color: var(--ink); font: inherit; font-size: 12px; }
.document-task-field input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.document-task-field.has-error { border-color: rgba(255, 94, 94, .6); background: rgba(255, 94, 94, .06); }
.document-task-feedback { min-height: 0; }
.document-task-result { padding: 12px 13px; border-radius: 13px; border: 1px solid var(--stroke); }
.document-task-result b { font-size: 12.5px; }
.document-task-result p { margin-top: 4px; font-size: 11.5px; line-height: 1.45; }
.document-task-result.success { background: rgba(67, 203, 119, .08); border-color: rgba(67, 203, 119, .28); }
.document-task-result.error { background: rgba(255, 94, 94, .07); border-color: rgba(255, 94, 94, .26); }
.obligation-section { display: flex; flex-direction: column; gap: 8px; }
.obligation-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.obligation-section-head h3 { font-size: 14px; }
.obligation-section-head p { margin-top: 2px; color: var(--ink-4); font-size: 10.5px; }
.obligation-section-head > span { min-width: 27px; height: 27px; padding: 0 8px; border-radius: 999px; background: var(--fill-2); display: grid; place-items: center; color: var(--ink-3); font-size: 11px; font-weight: 680; }
.obligation-list { display: grid; gap: 8px; }
.obligation-card { padding: 13px; border: 1px solid var(--stroke); border-radius: 15px; background: var(--fill); display: flex; flex-direction: column; gap: 7px; }
.obligation-card.obligation-overdue { border-color: rgba(255, 94, 94, .3); }
.obligation-top, .obligation-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.obligation-card h3 { font-size: 14px; }
.obligation-meta { color: var(--ink-3); font-size: 11.5px; }
.obligation-meta b { color: var(--ink); font-size: 12px; }
.obligation-source { color: var(--ink-4); font-size: 10.5px; }
.obligation-actions { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 2px; }
.life-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.life-admin-card { min-width: 0; padding: 14px; border-radius: 16px; border: 1px solid var(--stroke); background: linear-gradient(155deg, rgba(255, 122, 26, .055), var(--fill)); display: flex; flex-direction: column; gap: 8px; }
.life-admin-card > span, .business-admin-head > div:first-child > span { color: var(--accent-2); font-size: 9px; font-weight: 760; letter-spacing: .1em; }
.life-admin-card h4 { font-size: 14px; }
.life-admin-card p { min-height: 34px; color: var(--ink-3); font-size: 11.5px; line-height: 1.45; }
.life-admin-card label, .life-admin-form label { display: flex; flex-direction: column; gap: 5px; color: var(--ink-3); font-size: 10.5px; }
.life-admin-card input, .life-admin-card select, .life-admin-form input, .life-admin-form select { min-height: 38px; width: 100%; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--stroke); background: var(--bg); color: var(--ink); font: inherit; font-size: 12px; }
.life-admin-form { display: grid; gap: 10px; margin-top: 10px; padding: 14px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--fill); }
.life-admin-check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.life-admin-check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.business-admin-head { padding: 16px; border-radius: 18px; border: 1px solid var(--stroke); background: var(--fill); display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 10px; }
.business-admin-head h3 { margin-top: 4px; font-size: 20px; }
.business-admin-head p { margin-top: 4px; color: var(--ink-3); font-size: 11.5px; }
.business-admin-stats { text-align: right; flex: none; }
.business-admin-stats b { display: block; font-size: 20px; }
.business-admin-stats span { color: var(--ink-4); font-size: 10px; }
.business-invoice-list { display: grid; gap: 7px; margin-bottom: 10px; }
.business-invoice { padding: 11px 12px; border: 1px solid var(--stroke); border-radius: 13px; background: var(--fill); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.business-invoice b { display: block; font-size: 12px; }
.business-invoice span { display: block; margin-top: 2px; color: var(--ink-3); font-size: 10.5px; }
.stamps { display: flex; flex-wrap: wrap; gap: 8px; }
.stamp { padding: 8px 12px 8px 9px; border-radius: 12px; border: 1.5px dashed rgba(255, 157, 82, 0.45); color: var(--accent-2); display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 620; transform: rotate(var(--rot, -2deg)); }
.stamp .f { font-size: 20px; }
.stamp small { display: block; font-size: 10.5px; font-weight: 600; opacity: 0.7; letter-spacing: 0.05em; }
.goal { display: flex; gap: 12px; align-items: center; padding: 11px 13px; position: relative; }
.goal + .goal::before { content: ""; position: absolute; left: 13px; right: 0; top: 0; height: 1px; background: var(--stroke); }
.goal .ck { width: 24px; height: 24px; border-radius: 50%; border: 1.6px solid var(--ink-4); display: grid; place-items: center; font-size: 14px; color: transparent; flex: none; transition: all 0.4s var(--spring); }
.goal.done .ck { background: var(--pos); border-color: var(--pos); color: #fff; }
.goal.done .t { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.goal .t { font-weight: 580; font-size: 14.5px; }
.goal .s { font-size: 12.5px; color: var(--ink-3); }
.log { display: flex; flex-direction: column; gap: 10px; }
.log-item { display: grid; grid-template-columns: 74px 1fr; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.log-item time { color: var(--ink-4); font-weight: 600; font-size: 12px; padding-top: 1px; }
.bar-meter { height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.bar-meter i { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--accent)); transition: width 0.9s var(--ease); }
.vitals-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.vital-card { padding: 10px 8px; border-radius: 14px; background: var(--fill); border: 1px solid var(--stroke); display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.vital-card .i { font-size: 17px; color: var(--c); }
.vital-card b { font-size: 15px; font-weight: 680; }
.vital-card span { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }

/* ---------- Каталог мест в 3D-городе ---------- */
.city-browser { position: absolute; z-index: 36; top: 86px; right: 18px; width: min(430px, calc(100% - 36px)); max-height: calc(100% - 112px); padding: 14px; border-radius: 22px; display: none; flex-direction: column; gap: 10px; overflow: hidden; }
.city-browser.on { display: flex; }
.city-browser-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.city-browser-head b { display: block; font-size: 17px; }
.city-browser-head small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11px; }
.city-browser-search { width: 100%; min-height: 42px; border: 1px solid var(--stroke); border-radius: 13px; padding: 0 13px; background: var(--fill); color: var(--ink); font: inherit; outline: none; }
.city-browser-search:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--stroke)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.city-browser-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.city-browser-chips::-webkit-scrollbar { display: none; }
.city-browser-chips button { flex: 0 0 auto; border: 1px solid var(--stroke); border-radius: 999px; padding: 7px 10px; background: var(--fill); color: var(--ink-2); font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.city-browser-chips button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.city-browser-results { min-height: 120px; overflow-y: auto; display: grid; gap: 7px; padding-right: 2px; }
.city-browser-row { width: 100%; border: 1px solid var(--stroke); border-radius: 15px; background: var(--fill); color: var(--ink); padding: 10px 11px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.city-browser-row:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--ink) 22%, var(--stroke)); }
.city-browser-row.preferred { border-color: color-mix(in srgb, var(--accent) 45%, var(--stroke)); background: color-mix(in srgb, var(--accent) 7%, var(--fill)); }
.city-browser-row-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.city-browser-row-copy { min-width: 0; }
.city-browser-row-copy b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.city-browser-row-copy small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-browser-relevant, .city-browser-open { font-size: 9.5px; font-weight: 700; white-space: nowrap; color: var(--ink-3); }
.city-browser-relevant { color: var(--accent-2); }
.city-browser-empty { padding: 28px 12px; text-align: center; color: var(--ink-3); font-size: 12px; }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
  :root { --panel-w: auto; }
  #topbar { padding-left: 16px; padding-right: 16px; gap: 6px; flex-wrap: wrap; }
  #brand { display: none; }
  #search-btn { order: 5; flex: 1 1 100%; min-width: 0; margin: 0; }
  #search-btn kbd { display: none; }
  #clock { flex: 1; min-width: 0; overflow: hidden; }
  #clock .date, #clock .date + .dotsep { display: none; }
  #vitals { display: none; }
  #panel { left: 16px; right: 16px; top: auto; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); max-height: 46%; border-radius: 26px; }
  #panel.hidden { transform: translateY(30px); }
  #dock { gap: 2px; padding: 6px; max-width: calc(100% - 32px); }
  .dock-item { width: 52px; height: 52px; }
  .cols { grid-template-columns: 1fr; }
  .sheet-wrap { padding: 12px 16px; align-items: end; }
  .sheet { max-height: 92%; }
  .fl-top, .fl-bottom { left: 18px; right: 18px; }
  #vignette { background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
  .mode-grid, .documents-grid, .story-facts, .artifact-grid { grid-template-columns: 1fr; }
  .documents-toolbar { grid-template-columns: 1fr 1fr; }
  .documents-toolbar input { grid-column: 1 / -1; }
  .documents-toolbar select:last-child { grid-column: 1 / -1; }
  .document-detail-grid, .document-task-fields { grid-template-columns: 1fr; }
  .life-admin-grid { grid-template-columns: 1fr; }
  .business-admin-head { align-items: flex-start; }
  .mode-card { min-height: 0; }
  .journal-tabs { display: flex; }
  .journal-tabs button { flex: 0 0 auto; }
  .passport-card { grid-template-columns: auto 1fr; }
  .passport-card > .chip { grid-column: 1 / -1; width: fit-content; }
  .passport-book-viewport, .passport-spread { min-height: 455px; }
  .passport-spread { padding: 19px 18px 15px; }
  .passport-spine { display: none; }
  .passport-spread-head { gap: 10px; }
  .passport-spread-head h3 { font-size: 20px; }
  .passport-fictional { font-size: 7px; }
  .passport-identity-layout { grid-template-columns: 92px 1fr; gap: 13px; }
  .passport-portrait { min-height: 158px; }
  .passport-portrait-mark { width: 56px; height: 56px; font-size: 18px; }
  .passport-fields { grid-template-columns: 1fr; gap: 8px; }
  .passport-field { padding-bottom: 6px; }
  .passport-stamp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .passport-stamp { min-height: 88px; }
  .passport-book-controls > span { display: none; }
  .passport-book-controls { grid-template-columns: 1fr 1fr; }
  .city-browser { top: 76px; left: 12px; right: 12px; width: auto; max-height: calc(100% - 100px); border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}
html.static *, html.static *::before, html.static *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }

/* Stable map controls and departure scenes */
.city-pins { z-index: 1; isolation: isolate; }
.city-legend { display: none; }
.city-help { max-width: 375px; white-space: normal; flex-wrap: wrap; gap: 5px 10px; border-radius: 16px; font-size: 11px; }
.city-hud { z-index: 3; }
.city-pin { touch-action: none; }
#city.dragging .city-pin { cursor: grabbing; }
.city-card { z-index: 6; }
.city-view { display: flex; gap: 7px; padding: 6px; border-radius: 18px; background: rgba(24,30,35,.88); }
.transport-scene { position: absolute; inset: 0; z-index: 65; background: #b8d5df; }
.transport-scene canvas { display: block; width: 100%; height: 100%; }
.transport-scene header { position: absolute; inset: 0 0 auto; padding: clamp(20px,4vw,50px); display: flex; justify-content: space-between; align-items: start; gap: 20px; color: #fff; background: linear-gradient(#182a3aca, transparent); }
.transport-scene header small { font-size: 10px; letter-spacing: .16em; }
.transport-scene h2 { font-size: clamp(28px,4vw,48px); margin: 8px 0; }
.transport-phase { font-size: 14px; color: #eef5f7; }
.transport-scene .btn { background: #182a3ac9; }
.transport-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: #ffffff33; }
.transport-progress i { display: block; height: 100%; background: #ff8c42; }
@media (prefers-reduced-motion: reduce) {
  .sheet, .passport-book *, .city-card, .seg .thumb { transition: none !important; animation: none !important; }
}
