@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/inter.woff2) format('woff2');
}

/* Kraken-style tokens: flat surfaces, neutral greys, ink pills, no shadows. */
:root {
  --bg: #ffffff;
  --panel: #f5f5f6;
  --panel-2: #ececee;
  --line: #ececee;
  --text: #05070b;
  --muted: #6b6f76;
  --faint: #a3a6ac;
  --ink: #05070b;
  --ink-fg: #ffffff;
  --good: #0a8f4a;
  --bad: #d6293e;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --panel: #111112; --panel-2: #1c1c1e; --line: #1f1f22;
    --text: #f5f5f6; --muted: #8b8f97; --faint: #55585e;
    --ink: #f5f5f6; --ink-fg: #05070b; --good: #2fd47a; --bad: #ff5a6a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --panel: #111112; --panel-2: #1c1c1e; --line: #1f1f22;
  --text: #f5f5f6; --muted: #8b8f97; --faint: #55585e;
  --ink: #f5f5f6; --ink-fg: #05070b; --good: #2fd47a; --bad: #ff5a6a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  transition: background 180ms ease, color 180ms ease;
}
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: var(--ink); color: var(--ink-fg); }

.label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.center { text-align: center; }
.msg { min-height: 1.4em; color: var(--bad); font-size: 14px; margin: 10px 0 0; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -0.04em; }

/* Press feel */
.press { transition: transform 180ms var(--ease), background 180ms ease, opacity 180ms ease; }
.press:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .press:active { transform: none; } * { transition-duration: 0ms !important; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; height: 46px; padding: 0 22px;
  border-radius: 999px; border: none; cursor: pointer; white-space: nowrap;
}
.btn.ink { background: var(--ink); color: var(--ink-fg); }
.btn.ink:hover { opacity: .88; }
.btn.grey { background: var(--panel); color: var(--text); }
.btn.grey:hover { background: var(--panel-2); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn.wide { width: 100%; margin-top: 16px; }
.danger-text { color: var(--bad) !important; }
.icon-btn { border: none; background: none; color: var(--text); width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--panel); }

input {
  font: inherit; height: 46px; padding: 0 16px; border: none; border-radius: 14px;
  background: var(--panel); color: var(--text); width: 100%;
  transition: box-shadow 180ms ease;
}
input:focus { outline: none; box-shadow: 0 0 0 2px var(--ink); }
.code-input { font-variant-numeric: tabular-nums; letter-spacing: .3em; font-size: 18px; font-weight: 600; }
.stack { display: grid; gap: 8px; }

/* Sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 32px; letter-spacing: -0.03em; margin: 28px 0 4px; }
.auth-card form { margin-top: 22px; }

/* Shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px;
  background: var(--panel); border-radius: 20px; padding: 22px 12px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.side .wordmark { padding: 0 12px 22px; }
.nav, .side-bottom { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px;
  border: none; background: none; color: var(--muted); font: inherit; font-weight: 500;
  border-radius: 12px; cursor: pointer; text-align: left;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { background: var(--bg); color: var(--text); font-weight: 600; }
.main { padding: 18px 28px 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; height: 44px; margin-bottom: 18px; }
.mode-wrap { display: flex; align-items: center; gap: 12px; }
.mode-pill { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--panel); }
.mode-pill.live { background: var(--bad); color: #fff; }
.stream { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stream .on { color: var(--good); }
.view-title { font-size: 28px; letter-spacing: -0.03em; margin: 4px 0 18px; }
.view { animation: viewIn 220ms var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Overview */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: 'left right' 'more right'; gap: 0 28px; align-items: start; }
.ov-left { grid-area: left; }
.ov-right { grid-area: right; align-self: stretch; }
.ov-more { grid-area: more; }
.hero-money { font-size: 64px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.05; font-variant-numeric: tabular-nums; margin: 2px 0 14px; }
.hero-money .cents { color: var(--faint); }
.small-hero { font-size: 44px; }
.changes { display: flex; flex-wrap: wrap; gap: 14px 34px; margin-bottom: 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.actions.wrap { margin: 12px 0 8px; }

.chart-card { margin-bottom: 18px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; }
.chart { width: 100%; height: 180px; display: block; overflow: visible; }
.chart path, .chart line { vector-effect: non-scaling-stroke; }
.chart .ln { fill: none; stroke: var(--text); stroke-width: 2; }
.chart .ln-muted { fill: none; stroke: var(--faint); stroke-width: 2; }
.chart .area { fill: var(--panel); stroke: none; }
.chart .ref { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .dot { fill: var(--text); }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.small-chart { height: 120px; margin-top: 6px; }
#prob-chart { height: 100px; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 16px; align-items: center; }
.lg { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.lg-ink { background: var(--text); }
.lg-muted { background: var(--faint); }
.lg-dash { background: repeating-linear-gradient(90deg, var(--faint) 0 4px, transparent 4px 7px); }
.chart-legend span:first-child { color: var(--text); font-weight: 500; margin-right: auto; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.tile, .acc-card { background: var(--panel); border-radius: 14px; padding: 14px 16px; }
.regime-card { margin-bottom: 10px; }
.regime-note { margin: 10px 0 0; }
.acc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bar div { height: 100%; width: 0; background: var(--text); border-radius: 999px; transition: width 400ms var(--ease); }
.bar.thin { height: 4px; margin: 8px 0 18px; background: var(--bg); }
.bar.thin div { transition: none; }

.panel { background: var(--panel); border-radius: 20px; padding: 20px; }
.ov-right .panel { position: sticky; top: 18px; }
.panel-head { display: flex; justify-content: space-between; }
.countdown { font-size: 44px; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.big-prob { display: flex; justify-content: space-between; margin-bottom: 14px; }
.big-prob .right { text-align: right; }
.prob { display: block; font-size: 34px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.muted-num { color: var(--muted); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.side-tile { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; transition: background 600ms ease; }
.side-name { font-weight: 600; }
.quote { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; }
.quote .sep { color: var(--faint); margin: 0 6px; font-weight: 400; }
.flash-up { color: var(--good); }
.flash-down { color: var(--bad); }
.quote span { transition: color 500ms ease; }
.btc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.note-row { display: grid; gap: 4px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.note { font-weight: 500; }

/* Tables */
.table-card { background: var(--panel); border-radius: 20px; padding: 6px 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 12px 12px 10px; white-space: nowrap; font-size: 13px; }
td { padding: 11px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
tbody tr { transition: background 180ms ease; }
tbody tr:hover { background: var(--bg); }
tr.new-row { animation: rowIn 600ms var(--ease); }
@keyframes rowIn { from { background: var(--panel-2); } to { background: transparent; } }
.tag { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.tag.live { background: var(--bad); color: #fff; }
.empty { color: var(--muted); padding: 14px 12px; margin: 0; }

/* Account */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li svg { width: 16px; height: 16px; margin-top: 2px; color: var(--bad); }
.checks li.ok svg { color: var(--good); }
.rules { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* Activity */
.events { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.events li { padding: 11px 12px; border-top: 1px solid var(--line); display: flex; gap: 16px; }
.events li:first-child { border-top: none; }
.events time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 110px; }

/* Modals */
.modal-back {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center;
  padding: 16px; z-index: 50; animation: fadeIn 180ms ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--bg); border-radius: 24px; padding: 22px 26px 26px;
  animation: popIn 220ms var(--ease);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.amount-wrap { display: flex; justify-content: center; align-items: baseline; gap: 4px; margin: 18px 0 6px; }
.amount-wrap .cur { font-size: 56px; font-weight: 600; color: var(--faint); }
.amount { font-size: 64px; font-weight: 600; letter-spacing: -0.04em; height: 84px; width: 260px; background: none; text-align: left; padding: 0; }
.amount:focus { box-shadow: none; }
.amount::-webkit-outer-spin-button, .amount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount { -moz-appearance: textfield; appearance: textfield; }
.row-tile { background: var(--panel); border-radius: 14px; padding: 14px 16px; margin: 4px 0 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#wd-confirm .label { margin-top: 12px; }

/* Phone */
@media (max-width: 1100px) {
  .overview { grid-template-columns: 1fr; grid-template-areas: 'left' 'right' 'more'; }
  .ov-right { margin-bottom: 24px; }
  .ov-right .panel { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky; top: 0; height: auto; margin: 0; border-radius: 0; padding: 10px 12px; z-index: 10;
    flex-direction: row; align-items: center; gap: 8px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .side-top { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
  .side .wordmark { padding: 0 8px 0 4px; }
  .nav { display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { height: 36px; padding: 0 12px; flex: none; }
  .nav-item svg { display: none; }
  .nav-item.active { background: var(--ink); color: var(--ink-fg); }
  .side-bottom { display: flex; }
  .side-bottom .nav-item span { display: none; }
  .side-bottom .nav-item svg { display: block; }
  .main { padding: 14px 16px 50px; }
  .hero-money { font-size: 48px; }
  .tiles, .acc-grid { grid-template-columns: repeat(2, 1fr); }
  .account-grid { grid-template-columns: 1fr; }
  .btn { height: 42px; padding: 0 16px; }
  .amount-wrap .cur { font-size: 40px; }
  .amount { font-size: 48px; width: 200px; height: 64px; }
}
