/* Traced
   Layout: a quiet sidebar and one content column floating over a backdrop.
   Colors, card surfaces and backdrops come from the five looks in styles.css; this file only holds structure
   and a plain white/black fallback. */

:root {
  --bg: #F4F4F5;
  --panel: #FFFFFF;
  --panel-2: rgba(0, 0, 0, 0.035);
  --ink: #0B0B0C;
  --ink-2: #3A3A3E;
  --muted: #6E6E73;
  --line: rgba(0, 0, 0, 0.07);
  --line-2: rgba(0, 0, 0, 0.14);
  --win: #0E9F6E;
  --loss: #DC3545;
  --warn: #B7791F;
  --accent: #0B0B0C;
  --accent-ink: #FFFFFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.2);
  --scrim: rgba(0, 0, 0, 0.3);

  /* card surface: every look sets these */
  --card-bg: #FFFFFF;
  --card-sheen: none;
  --card-border: rgba(0, 0, 0, 0.07);
  --card-shadow: var(--shadow);
  --card-filter: none;
  --side-bg: transparent;
  --side-filter: none;
  --side-border: var(--line);
  --h1: 600 clamp(24px, 2.6vw, 30px)/1.1 var(--f-ui);
  --h1-track: -0.03em;
  --gap: 16px;

  --f-ui: 'Geist', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --f-display: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;

  --r-lg: 18px;
  --r: 14px;
  --r-sm: 10px;
  --side: 236px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #050505;
  --panel: #111113;
  --panel-2: rgba(255, 255, 255, 0.045);
  --ink: #EDEDEE;
  --ink-2: #BDBDC1;
  --muted: #88888E;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --win: #3DD68C;
  --loss: #FF5C6C;
  --warn: #F0B44C;
  --accent: #EDEDEE;
  --accent-ink: #050505;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.7);
  --scrim: rgba(0, 0, 0, 0.55);
  --card-bg: #111113;
  --card-border: rgba(255, 255, 255, 0.07);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font: 400 14px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pos { color: var(--win); }
.neg { color: var(--loss); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- backdrop ---------- */
#backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
#backdrop .img { position: absolute; inset: -40px; background-size: cover; background-position: center; }
#backdrop .veil { position: absolute; inset: 0; }

/* ---------- shell ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 14px 18px max(14px, env(safe-area-inset-left, 0px));
  border-right: 1px solid var(--side-border);
  background: var(--side-bg); backdrop-filter: var(--side-filter); -webkit-backdrop-filter: var(--side-filter);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; text-decoration: none; color: var(--ink); }
.mark { width: 30px; height: 30px; flex: none; }
.wordmark { height: 12px; width: auto; color: var(--ink); }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-weight: 500; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 10px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }

.main {
  min-width: 0; width: 100%; max-width: 1680px; margin-inline: auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 80px max(16px, env(safe-area-inset-left, 0px));
  padding-left: clamp(16px, 3vw, 44px); padding-right: clamp(16px, 3vw, 44px);
  outline: none;
}

.tabbar { display: none; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }

@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto;
    background: var(--panel); backdrop-filter: none; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    display: grid; justify-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; text-decoration: none;
    color: var(--muted); font: 500 10.5px/1 var(--f-ui); cursor: pointer;
  }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar [aria-current="page"] { color: var(--ink); }
  .tabbar .fab span.ico { width: 40px; height: 40px; margin-top: -4px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .nav a { transition: none; } }

/* ---------- page parts ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font: var(--h1); letter-spacing: var(--h1-track); text-wrap: balance; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eyebrow { font: 500 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.stack { display: grid; gap: var(--gap); min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.panel {
  background: var(--card-sheen), var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--r-lg);
  padding: 18px; min-width: 0; box-shadow: var(--card-shadow);
  backdrop-filter: var(--card-filter); -webkit-backdrop-filter: var(--card-filter);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2, .panel h2 { margin: 0; font: 600 15px/1.2 var(--f-ui); letter-spacing: -0.01em; }
.panel-head .sub { color: var(--muted); font-size: 12.5px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 16px 18px 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.kpi .label { font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font: 600 clamp(20px, 1.9vw, 26px)/1.05 var(--f-ui); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi.big .value { font-size: clamp(28px, 3vw, 40px); }
.kpis.five { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpis.five .kpi { padding: 14px 16px; }
/* Dashboard: the headline number gets a tall card, the other four sit two by two beside it. */
.kpis.dash { grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); }
.kpis.dash .big { grid-row: span 2; align-content: space-between; }
@media (max-width: 640px) { .kpis.dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis.dash .big { grid-column: span 2; grid-row: auto; } }

/* ---------- controls ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--panel) 70%, transparent); color: var(--ink);
  font: 550 13.5px/1 var(--f-ui); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.danger { color: var(--loss); }
.btn.danger.solid { background: var(--loss); color: #fff; border-color: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
:is(.btn, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > span, .label-sm { font: 500 11px/1 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-width: 0; height: 38px; padding: 0 12px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); font: 500 14px/1.2 var(--f-ui); transition: border-color .15s, background .15s;
}
.input.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.input:hover { border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.input:focus { border-color: var(--ink); outline: none; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.55; resize: vertical; font-weight: 400; }
select.input { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input::placeholder { color: var(--muted); opacity: .75; }
/* the browser's own list (phones, and as a fallback) follows white/black too */
select.input option { background: var(--panel); color: var(--ink); }

/* dropdowns drawn in the app's style (see ui.js) */
.sel-native { display: none !important; }
.sel { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; padding-right: 10px; }
.sel .sel-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel .sel-chev { width: 14px; height: 14px; flex: none; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
.sel[aria-expanded="true"] { border-color: var(--ink); }
.sel[aria-expanded="true"] .sel-chev { transform: rotate(-90deg); }
.sel:disabled { opacity: .5; cursor: default; }
.sel-pop {
  position: fixed; inset: auto; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain;
  max-width: min(420px, calc(100vw - 16px)); min-width: 160px;
  background: color-mix(in srgb, var(--panel) 98%, transparent); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  animation: sel-in .12s ease; outline: none;
}
@keyframes sel-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .sel-pop { animation: none; } }
.sel-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border-radius: 8px; font: 500 14px/1.25 var(--f-ui); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.sel-opt.active { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.sel-opt[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.sel-opt svg { width: 15px; height: 15px; flex: none; }
.sel-opt.off { opacity: .4; cursor: default; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.row.tight { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 11px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.seg button, .seg label { border: 0; background: none; padding: 6px 11px; border-radius: 8px; color: var(--muted); font: 550 12.5px/1.2 var(--f-ui); cursor: pointer; white-space: nowrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg button[aria-pressed="true"], .seg input:checked + label { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); }
.seg.full { display: flex; }
.seg.full > * { flex: 1; text-align: center; }
.seg .long:checked + label { color: var(--win); }
.seg .short:checked + label { color: var(--loss); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font: 500 12.5px/1 var(--f-ui); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.chip.good[aria-pressed="true"] { background: var(--win); color: #fff; }
.chip.bad[aria-pressed="true"] { background: var(--loss); color: #fff; }
.chip.static { cursor: default; }
.chip .x { border: 0; background: none; padding: 0; margin-right: -4px; color: inherit; opacity: .6; cursor: pointer; display: grid; }
.chip .x svg { width: 13px; height: 13px; }
.chip-add { width: 150px; height: 28px; border-radius: 999px; padding: 0 11px; font-size: 12.5px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 11px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); white-space: nowrap; }
.badge.win { background: color-mix(in srgb, var(--win) 15%, transparent); color: var(--win); }
.badge.loss { background: color-mix(in srgb, var(--loss) 15%, transparent); color: var(--loss); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.outline { background: transparent; border: 1px solid var(--line-2); }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); margin: 0; flex: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(16px); background: var(--bg); }

/* ---------- tables and lists ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font: 500 11px/1 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.table .r { text-align: right; }
.table td.sym { font-weight: 600; }
.table.static tbody tr { cursor: default; }

.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); text-decoration: none; cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; }
.list-item .s { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1.2fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-row .name small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.bar-track { position: relative; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.bar-track .fill { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.bar-track .mid { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); left: 50%; }
.bar-row .val { font: 600 13px/1 var(--f-mono); text-align: right; min-width: 84px; }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--muted); }
.empty > svg { width: 34px; height: 34px; color: var(--muted); }
.empty h3 { margin: 0; color: var(--ink); font: 600 16px/1.3 var(--f-ui); }
.empty p { margin: 0; max-width: 46ch; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid; flex-wrap: wrap; }
.banner svg { width: 18px; height: 18px; flex: none; }
.banner .grow { flex: 1; min-width: 200px; }
.banner.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); }
.banner.bad { border-color: color-mix(in srgb, var(--loss) 45%, transparent); background: color-mix(in srgb, var(--loss) 10%, var(--panel)); }
.banner.info { border-color: var(--line-2); background: var(--panel); }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.zero { stroke: var(--line-2); }
.chart .axis { fill: var(--muted); font: 500 10.5px var(--f-mono); }
.chart .xh { stroke: var(--line-2); stroke-dasharray: 3 3; }
.chart .tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; z-index: 2;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px; box-shadow: var(--shadow);
  font-size: 12px; white-space: nowrap; color: var(--muted);
}
.chart .tip b { display: block; color: var(--ink); font: 600 13px/1.3 var(--f-mono); }
.chart-empty { display: grid; place-items: center; height: 180px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 0.9fr); gap: 6px; }
.cal .dow { font: 500 10.5px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 2px 4px 6px; }
.cal .cell {
  min-height: 76px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); display: grid; align-content: space-between; gap: 4px;
  text-decoration: none; background: color-mix(in srgb, var(--panel) 50%, transparent); position: relative; overflow: hidden;
}
.cal .cell.out { opacity: .35; }
.cal .cell.today { border-color: var(--ink); }
.cal .cell .d { font: 500 11.5px/1 var(--f-mono); color: var(--muted); }
.cal .cell .p { font: 600 13px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; }
.cal .cell .n { font-size: 11px; color: var(--muted); }
.cal .cell.win { background: color-mix(in srgb, var(--win) calc(var(--k, .3) * 30%), transparent); border-color: color-mix(in srgb, var(--win) 30%, transparent); }
.cal .cell.loss { background: color-mix(in srgb, var(--loss) calc(var(--k, .3) * 30%), transparent); border-color: color-mix(in srgb, var(--loss) 30%, transparent); }
.cal .cell.week { background: transparent; border-style: dashed; }
@media (max-width: 720px) {
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .cal .week, .cal .dow.wk { display: none; }
  .cal .cell { min-height: 52px; padding: 5px; }
  .cal .cell .n { display: none; }
  .cal .cell .p { font-size: 10.5px; }
}

/* ---------- insights ---------- */
.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.insight { padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 60%, transparent); display: grid; gap: 8px; align-content: start; }
.insight .tag { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.insight .tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.insight.bad .tag { color: var(--loss); }
.insight.good .tag { color: var(--win); }
.insight.info .tag { color: var(--muted); }
.insight h3 { margin: 0; font: 600 14.5px/1.35 var(--f-ui); letter-spacing: -0.01em; }
.insight p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- dialogs ---------- */
dialog.modal {
  border: 1px solid var(--line-2); border-radius: 20px; padding: 0; background: var(--panel); color: var(--ink);
  width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.modal.wide { width: min(960px, calc(100vw - 24px)); }
dialog.modal.narrow { width: min(460px, calc(100vw - 24px)); }
dialog.modal[open] { display: flex; flex-direction: column; animation: pop .18s ease; }
dialog.modal::backdrop { background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.modal.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); border-radius: 22px 0 0 22px; border-right: 0; animation: slide .22s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open], dialog.modal.drawer { animation: none; } }
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.m-head h2 { margin: 0; font: 600 17px/1.2 var(--f-ui); letter-spacing: -0.02em; }
.m-body { padding: 18px 20px 22px; overflow-y: auto; display: grid; gap: 18px; align-content: start; flex: 1; }
.m-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.m-foot .grow { flex: 1; }
.section-title { font: 600 13px/1 var(--f-ui); color: var(--ink-2); margin: 0 0 -6px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 104px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--panel-2); cursor: zoom-in; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb .rm svg { width: 12px; height: 12px; }
.dropzone { display: grid; place-items: center; width: 104px; height: 72px; border-radius: 10px; border: 1px dashed var(--line-2); color: var(--muted); cursor: pointer; position: relative; font-size: 12px; text-align: center; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lightbox { max-width: 100%; max-height: 80dvh; display: block; margin: auto; border-radius: 10px; }

.calc-strip { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 5%, transparent); font-variant-numeric: tabular-nums; }
.calc-strip div { display: grid; gap: 4px; }
.calc-strip b { font: 600 16px/1 var(--f-mono); }

/* ---------- trade detail ---------- */
.tv-head { display: grid; gap: 10px; }
.tv-sym { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 650 24px/1 var(--f-ui); letter-spacing: -0.02em; }
.tv-pnl { font: 650 44px/1 var(--f-ui); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px 12px; }
.facts div { display: grid; gap: 5px; }
.facts b { font: 600 14px/1.2 var(--f-mono); font-variant-numeric: tabular-nums; }
.note-text { white-space: pre-wrap; color: var(--ink-2); margin: 0; }

/* ---------- prop desk ---------- */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.acct { display: grid; gap: 16px; }
.acct-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.acct-top h3 { margin: 0; font: 600 16px/1.2 var(--f-ui); letter-spacing: -0.01em; }
.acct-top .firm { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.acct-id { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* the first-time tour (see tour.js) */
.tour-head { border-bottom: 0; padding-bottom: 0; }
.tour { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 4px 6px 2px; }
.tour-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.tour-ico svg { width: 30px; height: 30px; }
.tour-step { font: 600 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.tour h3 { margin: 0; font: 700 22px/1.2 var(--f-display); letter-spacing: -.01em; }
.tour p { margin: 0; color: var(--ink-2); max-width: 36ch; line-height: 1.5; }
.tour .tour-tip { font-size: 13px; color: var(--muted); }
.tour-go { margin-top: 2px; }
.tour-go svg { width: 14px; height: 14px; }
.tour-dots { display: flex; gap: 6px; margin-top: 8px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 20%, transparent); transition: width .2s, background .2s; }
.tour-dots i.on { width: 20px; background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .tour-dots i { transition: none; } }

/* the demo's banner (see demo.js) */
.demo-bar {
  position: fixed; z-index: 60; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 14px; border-radius: 14px; font-size: 13px; color: var(--ink-2);
  background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.demo-bar .grow { min-width: 0; }
.demo-bar .btn { flex: none; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent, var(--win)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, var(--win)) 22%, transparent); }
@media (max-width: 760px) {
  .demo-bar { bottom: calc(78px + env(safe-area-inset-bottom)); flex-wrap: wrap; justify-content: flex-end; width: calc(100vw - 24px); }
  .demo-bar .grow { flex: 1 1 100%; }
  .demo-dot { display: none; }
}

/* prop firm logos (see firms.js) */
.firm-logo { display: inline-block; flex: none; width: 22px; height: 22px; border-radius: 6px; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--line-2); }
.firm-logo.lg { width: 38px; height: 38px; border-radius: 10px; }
.firm-ini { display: inline-grid; place-items: center; background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink-2); font: 700 10px/1 var(--f-ui); letter-spacing: .02em; }
.firm-logo.lg.firm-ini { font-size: 13px; }
.firm-in { position: relative; }
.firm-in .input { width: 100%; }
.firm-in .input.has-logo { padding-left: 40px; }
.firm-in-logo { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: flex; pointer-events: none; }
.firm-opt { display: flex; align-items: center; gap: 10px; min-width: 0; }
.firm-pop .sel-opt { white-space: normal; }
.acct .bal { font: 600 30px/1 var(--f-ui); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 34px; }
.track .rail { position: absolute; left: 0; right: 0; top: 13px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--loss) 45%, transparent), color-mix(in srgb, var(--ink) 10%, transparent) 50%, color-mix(in srgb, var(--win) 45%, transparent)); }
.track .start { position: absolute; top: 9px; width: 1px; height: 16px; background: var(--muted); }
.track .now { position: absolute; top: 7px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--panel); border: 3px solid var(--ink); box-shadow: var(--shadow); }
.track-labels { display: flex; justify-content: space-between; gap: 10px; font: 500 11px/1.3 var(--f-mono); color: var(--muted); margin-top: -4px; }
.track-labels b { color: var(--ink-2); font-weight: 600; }
.meter { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.acct-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.acct-stats div { display: grid; gap: 5px; }
.acct-stats b { font: 600 14px/1.2 var(--f-mono); font-variant-numeric: tabular-nums; }
.acct-foot { display: flex; gap: 6px; flex-wrap: wrap; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); display: grid; }
.menu-pop button { text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.menu-pop button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.menu-pop button.danger { color: var(--loss); }

/* ---------- daily ---------- */
.day-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-strip a { display: grid; gap: 4px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; background: color-mix(in srgb, var(--panel) 50%, transparent); }
.week-strip a[aria-current="date"] { border-color: var(--ink); }
.week-strip .d { font: 500 11px/1 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.week-strip .p { font: 600 13px/1 var(--f-mono); }
.mood { display: flex; gap: 6px; flex-wrap: wrap; }
.saved-note { font-size: 12px; color: var(--muted); }

/* ---------- study ---------- */
.study { display: grid; grid-template-columns: 220px 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1180px) { .study { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto 1fr; } .study .notes-col { grid-column: 1; } .study .editor { grid-column: 2; grid-row: 1 / span 2; } }
@media (max-width: 760px) { .study { grid-template-columns: minmax(0, 1fr); } .study .editor { grid-column: auto; grid-row: auto; } }
.pick { display: grid; gap: 2px; }
.pick button { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-weight: 500; min-width: 0; }
.pick button svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.pick button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick button small { color: var(--muted); font-family: var(--f-mono); }
.pick button:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.pick button[aria-current="true"] { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.video { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 14px; overflow: hidden; background: #000; }
.video > div, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stamps { display: flex; flex-wrap: wrap; gap: 6px; }
.stamp { display: inline-flex; gap: 8px; align-items: center; max-width: 100%; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 12.5px; }
.stamp b { font: 600 12px/1 var(--f-mono); }
.stamp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; color: var(--muted); }
.title-input { border: 0; background: transparent; padding: 0; font: 600 22px/1.2 var(--f-ui); letter-spacing: -0.02em; width: 100%; color: var(--ink); }
.title-input:focus { outline: none; }

/* ---------- share studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .studio { grid-template-columns: minmax(0, 1fr); } }
.stage { display: grid; place-items: center; padding: clamp(10px, 2vw, 22px); }
.stage canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; border-radius: 10px; box-shadow: var(--shadow-lg); }
@media (min-width: 981px) { .studio .sticky { position: sticky; top: 20px; } }
/* Card backgrounds: tiles fill the row, so they're big enough to see and easy to tap on a phone */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 14px 12px; }
.swatch { display: grid; justify-items: center; align-content: start; gap: 8px; width: 100%; border: 0; background: none; padding: 0; cursor: pointer; font: 500 12.5px/1.25 var(--f-ui); color: var(--muted); text-align: center; }
.swatch i { display: block; width: 100%; max-width: 92px; aspect-ratio: 1; border-radius: 16px; border: 1px solid var(--line-2); background-size: cover; background-position: center; transition: transform .12s; }
.swatch i svg { width: 24px; height: 24px; }
.swatch:hover i { transform: translateY(-1px); }
.swatch[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.swatch[aria-pressed="true"] i { outline: 2px solid var(--ink); outline-offset: 3px; }
.swatch[disabled] { opacity: .5; cursor: progress; }
.swatch-wrap { position: relative; display: grid; }
.swatch-badge { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; pointer-events: none; }
.swatch-badge svg { width: 11px; height: 11px; }
.swatch-x { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); cursor: pointer; opacity: 0; transition: opacity .15s; }
.swatch-x svg { width: 12px; height: 12px; }
.swatch-wrap:hover .swatch-x, .swatch-x:focus-visible { opacity: 1; }
@media (hover: none) { .swatch-x { opacity: 1; width: 30px; height: 30px; } }
@media (prefers-reduced-motion: reduce) { .swatch i { transition: none; } }
.color-dot { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer; padding: 0; }
.color-dot[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
input[type="color"].color-dot { appearance: none; background: none; overflow: hidden; }
input[type="color"].color-dot::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].color-dot::-webkit-color-swatch { border: 0; border-radius: 50%; }
input[type="range"] { accent-color: var(--ink); width: 100%; }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings .toc { position: sticky; top: 20px; display: grid; gap: 2px; }
.settings .toc a { padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 500; }
.settings .toc a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
@media (max-width: 860px) { .settings { grid-template-columns: minmax(0, 1fr); } .settings .toc { display: none; } }
.set-group { display: grid; gap: 18px; scroll-margin-top: 20px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.set-row .t { font-weight: 600; }
.set-row .d { color: var(--muted); font-size: 12.5px; }
.set-row.col { grid-template-columns: minmax(0, 1fr); }
hr.soft { border: 0; height: 1px; background: var(--line); margin: 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; z-index: 100; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 14px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 500; font-size: 13.5px;
  box-shadow: var(--shadow-lg); transition: opacity .18s, transform .18s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 880px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.sample-tag { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; border: 1px dashed var(--warn); color: var(--warn); }
.kbd { font: 500 11px/1 var(--f-mono); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); }

/* ---------- orbit navigation (optional, Settings > Look) ----------
   The pages circle a core button. The ring turns slowly and pauses on hover; each page stays upright by turning back. */
@property --orbit-r { syntax: '<length>'; inherits: true; initial-value: 0px; }
@keyframes orbit-turn { to { rotate: 360deg; } }
@keyframes orbit-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.75); opacity: 0; } }
.orbit-core, .orbit { display: none; }
[data-nav="orbit"] .app { grid-template-columns: minmax(0, 1fr); }
[data-nav="orbit"] .sidebar, [data-nav="orbit"] .tabbar, [data-nav="orbit"] .scrim { display: none !important; }
[data-nav="orbit"] .main { margin-inline: auto; padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
[data-nav="orbit"] .toast { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
[data-nav="orbit"] .orbit-core {
  display: grid; place-items: center; position: fixed; z-index: 75; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 62px; height: 62px; margin-left: -31px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid var(--line-2); color: var(--ink);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform .2s ease;
}
[data-nav="orbit"] .orbit-core:hover { transform: scale(1.06); }
.orbit-core svg { width: 22px; height: 22px; }
.orbit-core::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--line-2); animation: orbit-pulse 3.4s ease-out infinite; pointer-events: none; }
.orbit-core::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 3px, var(--ink) 0 3px, transparent 3.6px); animation: orbit-turn 7s linear infinite;
}
.orbit-core[aria-expanded="true"]::before, .orbit-core[aria-expanded="true"]::after { animation: none; opacity: 0; }

[data-nav="orbit"] .orbit:not([hidden]) {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 70;
  background: color-mix(in srgb, var(--bg) 64%, transparent);
  backdrop-filter: blur(20px) saturate(120%); -webkit-backdrop-filter: blur(20px) saturate(120%);
  opacity: 0; transition: opacity .28s ease;
}
.orbit.open { opacity: 1 !important; }
.orbit-stage { --R: min(215px, 37vw, 33vh); position: relative; width: calc(var(--R) * 2); height: calc(var(--R) * 2); margin-bottom: 40px; }
.orbit-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px solid var(--line-2); pointer-events: none;
  transform: translate(-50%, -50%) scale(.55); opacity: 0; transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .45s; }
.orbit.open .orbit-ring { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.orbit-ring.r1 { width: calc(var(--R) * 2); height: calc(var(--R) * 2); }
.orbit-ring.r2 { width: calc(var(--R) * 1.25); height: calc(var(--R) * 1.25); border-style: dashed; border-color: var(--line); animation: orbit-turn 26s linear infinite; }
.orbit-ring.r3 { width: calc(var(--R) * 2.75); height: calc(var(--R) * 2.75); border-color: var(--line); animation: orbit-turn 70s linear infinite reverse; }
.orbit-ring.r2::after, .orbit-ring.r3::after { content: ""; position: absolute; left: 50%; top: -3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--muted); }
.orbit-spin { position: absolute; inset: 0; animation: orbit-turn 110s linear infinite; }
.planet {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; text-decoration: none; outline: none;
  transform: rotate(var(--a)) translate(var(--orbit-r)) rotate(calc(-1 * var(--a)));
  transition: --orbit-r .7s cubic-bezier(.2, .9, .25, 1.15); transition-delay: calc(var(--i) * 40ms);
}
.orbit.open .planet { --orbit-r: var(--R); }
.planet-in {
  position: absolute; left: -45px; top: -27px; width: 90px; display: grid; justify-items: center; gap: 8px;
  transform-origin: 45px 27px; animation: orbit-turn 110s linear infinite reverse;
}
.planet-body {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  background: var(--card-sheen), color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line-2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1); transition: transform .2s ease, background .2s;
}
.planet-body svg { width: 20px; height: 20px; }
.planet-label { font: 500 12px/1.2 var(--f-ui); color: var(--ink-2); white-space: nowrap; opacity: 0; transition: opacity .3s .25s; }
.orbit.open .planet-label { opacity: 1; }
.planet:hover .planet-body, .planet:focus-visible .planet-body { transform: scale(1.14); }
.planet:focus-visible .planet-body { outline: 2px solid var(--accent); outline-offset: 3px; }
.planet[aria-current="page"] .planet-body { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.orbit-stage:hover .orbit-spin, .orbit-stage:hover .planet-in, .orbit-stage:focus-within .orbit-spin, .orbit-stage:focus-within .planet-in { animation-play-state: paused; }
.orbit-center {
  position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; align-content: center; gap: 4px; font: 600 12.5px/1 var(--f-ui);
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 9%, transparent), 0 0 80px color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translate(-50%, -50%) scale(.4); opacity: 0; transition: transform .5s cubic-bezier(.2, .9, .25, 1.2), opacity .3s;
}
.orbit-center svg { width: 22px; height: 22px; }
.orbit.open .orbit-center { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.orbit-hint { position: absolute; left: 16px; right: 16px; top: calc(22px + env(safe-area-inset-top, 0px)); margin: 0; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { .orbit-hint { display: none; } .planet-label { font-size: 11px; } .planet-body { width: 48px; height: 48px; } .orbit-center { width: 88px; height: 88px; } }
@media (prefers-reduced-motion: reduce) {
  .orbit-spin, .planet-in, .orbit-ring, .orbit-core::before, .orbit-core::after { animation: none !important; }
  .planet, .orbit-ring, .orbit-center { transition: none; }
}

/* ---------- Discord profile and candle colors (Settings) ---------- */
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); flex: none; }
.avatar.empty { display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.avatar.empty svg { width: 22px; height: 22px; }
.btn.discord { background: #5865F2; color: #FFFFFF; border-color: transparent; }
.btn.discord:hover { filter: brightness(1.08); }
.btn.discord svg { width: 18px; height: 18px; }
.candle-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(128px, 100%), 1fr)); gap: 10px; }
.candle-opt { display: grid; gap: 8px; padding: 10px 10px 9px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-2); font: 500 12.5px/1.2 var(--f-ui); cursor: pointer; text-align: left; }
.candle-opt[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; color: var(--ink); }

/* ---------- sign-in screen ---------- */
html.gated .app, html.gated .tabbar, html.gated .orbit-core { visibility: hidden; }
.gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; overflow: hidden; background: var(--bg); }
.gate > .bd { z-index: 0; }
.gate-card {
  position: relative; z-index: 2; width: min(400px, 100%); display: grid; gap: 14px; padding: 26px 24px 20px; border-radius: 22px;
  background: var(--card-sheen), color-mix(in srgb, var(--panel) 82%, transparent); border: 1px solid var(--line-2);
  backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%); box-shadow: var(--shadow-lg);
}
.gate-brand { display: grid; justify-items: center; gap: 12px; margin: 4px 0 8px; text-align: center; color: var(--ink); }
.gate-brand .gate-mark { width: 64px; height: 64px; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--ink) 22%, transparent)); }
.gate-brand .wordmark { height: 15px; }
.gate-brand small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.gate-lock { display: inline-grid; place-items: center; color: var(--muted); }
.gate-lock svg { width: 14px; height: 14px; }
.gate-lock .shackle { transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 16px 10.5px; }
.gate-err { margin: 0; font-size: 13px; }
.gate-note { display: flex; gap: 8px; align-items: center; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.gate-note svg { width: 14px; height: 14px; flex: none; }
.gate-card .check { font-size: 12.5px; color: var(--ink-2); align-items: flex-start; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: -6px; }
.pw-meter i { height: 4px; border-radius: 4px; background: var(--line-2); transition: background .2s; }
.pw-meter i.on.s1 { background: var(--loss); } .pw-meter i.on.s2 { background: var(--warn); } .pw-meter i.on.s3, .pw-meter i.on.s4 { background: var(--win); }
.gate-card.shake { animation: g-shake .4s; }
@keyframes g-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.gate-half, .gate-fx { display: none; }

/* create account: the card folds into a bright core, rings and sparks burst out, a check draws, the app fades in */
.gate.fx-create .gate-card { animation: g-fold .5s cubic-bezier(.6, 0, .4, 1) forwards; }
.gate.fx-create .gate-fx { display: block; position: absolute; left: 50%; top: 50%; z-index: 3; width: 0; height: 0; }
.gate-fx i { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 2px solid var(--ink); opacity: 0; animation: g-ring 1.1s .45s cubic-bezier(.1, .7, .3, 1) forwards; }
.gate-fx i:nth-child(2) { animation-delay: .58s; } .gate-fx i:nth-child(3) { animation-delay: .71s; }
.gate-fx b { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); opacity: 0; rotate: var(--a); animation: g-spark .9s .45s cubic-bezier(.1, .8, .3, 1) forwards; }
.gate-fx em { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border-radius: 50%; background: var(--ink); opacity: 0; transform: scale(.2); animation: g-core 1.4s .4s ease forwards; }
.gate-fx em::after { content: ""; position: absolute; left: 22px; top: 19px; width: 26px; height: 14px; border-left: 4px solid var(--bg); border-bottom: 4px solid var(--bg); transform: rotate(-45deg) scale(0); transform-origin: left bottom; animation: g-check .35s .8s ease forwards; }
.gate.fx-create { animation: g-out .45s 1.45s ease forwards; }
@keyframes g-fold { to { transform: scale(.08); opacity: 0; border-radius: 50%; } }
@keyframes g-ring { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(7); } }
@keyframes g-spark { 0% { opacity: 1; transform: translateX(0) scale(1.4); } 100% { opacity: 0; transform: translateX(46vmin) scale(.4); } }
@keyframes g-core { 0% { opacity: 0; transform: scale(.2); } 25% { opacity: 1; transform: scale(1.15); } 40% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes g-check { to { transform: rotate(-45deg) scale(1); } }
@keyframes g-out { to { opacity: 0; } }

/* log in: the shackle lifts, the card drops back, the screen splits open down the middle */
.gate.fx-login .gate-lock .shackle { transform: translateY(-3px) rotate(28deg); }
.gate.fx-login .gate-card { animation: g-drop .5s .35s cubic-bezier(.6, 0, .4, 1) forwards; }
.gate.fx-login > .bd { animation: g-out .2s .7s forwards; }
.gate.fx-login .gate-half { display: block; position: absolute; top: 0; bottom: 0; width: 50.5%; z-index: 1; background: var(--bg); }
.gate.fx-login .gate-half.l { left: 0; animation: g-left .65s .8s cubic-bezier(.7, 0, .3, 1) forwards; box-shadow: 1px 0 0 var(--line-2); }
.gate.fx-login .gate-half.r { right: 0; animation: g-right .65s .8s cubic-bezier(.7, 0, .3, 1) forwards; box-shadow: -1px 0 0 var(--line-2); }
.gate.fx-login { animation: g-clear .01s 1.45s forwards; }
@keyframes g-drop { to { transform: scale(.92) translateY(10px); opacity: 0; filter: blur(6px); } }
@keyframes g-left { to { transform: translateX(-102%); } }
@keyframes g-right { to { transform: translateX(102%); } }
@keyframes g-clear { to { background: transparent; } }
.gate.fx-fade { animation: g-out .25s forwards; }

/* ---------- security settings ---------- */
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 12px; border-radius: 12px; background: var(--panel-2); font: 600 14px/1.4 var(--f-mono); letter-spacing: .04em; }
.secret { font: 600 14px/1.5 var(--f-mono); letter-spacing: .08em; word-break: break-all; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); user-select: all; }
.conn { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.conn:last-child { border-bottom: 0; }
.conn .logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font: 700 13px/1 var(--f-ui); background: var(--ink); color: var(--bg); flex: none; }
.conn .grow { flex: 1; min-width: 0; }
/* Traced Discord: sidebar link and dashboard card */
.side-dc { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 8px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font: 500 13.5px/1 var(--f-ui); }
.side-dc:hover { color: #fff; background: #5865F2; }
.side-dc svg { width: 18px; height: 18px; flex: none; }
.dc-card { display: flex; align-items: center; gap: 14px; margin-bottom: var(--gap); padding: 14px 16px; border-color: color-mix(in srgb, #5865F2 45%, transparent); background: linear-gradient(100deg, color-mix(in srgb, #5865F2 18%, transparent), transparent 70%), var(--card-bg); }
.dc-card .dc-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: #5865F2; color: #fff; }
.dc-card .dc-ico svg { width: 22px; height: 22px; }
.dc-card .grow { flex: 1; min-width: 0; }
.dc-card .t { font-weight: 600; color: var(--ink); }
.dc-card .muted { font-size: 13px; }
@media (max-width: 560px) { .dc-card { flex-wrap: wrap; } .dc-card .grow { flex-basis: calc(100% - 60px); } }
.plan-pick { display: grid; gap: 10px; }
.plan-opt { position: relative; display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); font: 400 14px/1.4 var(--f-ui); cursor: pointer; }
.plan-opt:hover { border-color: var(--ink); }
.plan-opt b { font-size: 16px; }
.plan-opt span { color: var(--ink-2); }
.plan-opt .badge { position: absolute; top: 14px; right: 14px; }
.plan-opt[disabled] { opacity: .6; cursor: progress; }

/* ---------- Connect accounts: guides ---------- */
.guide-pick { padding: 14px 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.guide-pick .t { font-weight: 600; margin-bottom: 6px; }
.guide-pick ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); font-size: 13.5px; }
.guide-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .guide-grid { grid-template-columns: minmax(220px, 280px) 1fr; align-items: start; } }
.guide-list { display: grid; gap: 8px; }
.method { display: grid; gap: 8px; justify-items: start; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-2); font: 500 14px/1.3 var(--f-ui); cursor: pointer; }
.method:hover { color: var(--ink); }
.method[aria-pressed="true"] { color: var(--ink); outline: 2px solid var(--ink); outline-offset: 2px; }
.method .name { font-weight: 600; }
.guide { display: grid; gap: 14px; min-width: 0; }
.guide-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.guide-head h3 { margin: 0; font-size: 18px; }
.guide-head .muted { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.guide-head .muted svg { width: 14px; height: 14px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 14px 44px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 13px/1 var(--f-ui); background: var(--ink); color: var(--bg); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 2px; width: 1px; background: var(--line-2); }
.steps .t { font-weight: 600; margin-bottom: 3px; }
.steps .d { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.steps .d a { color: var(--ink); }
.steps.soon li::before { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); }

/* Wide and ultrawide screens: the page stays centered in the space beside the sidebar and grows with it. */
@media (min-width: 2200px) { .main { max-width: 2000px; } }
@media (min-width: 2800px) { .main { max-width: 2400px; } }
/* sign-in screen: Discord, the "or" divider, small text links and the Turnstile human check */
.gate-card .btn.discord { gap: 10px; }
.gate-back { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px 6px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 500 13px/1 var(--f-ui); cursor: pointer; }
.gate-back:hover { color: var(--ink); background: var(--panel-2); }
.gate-back svg { width: 16px; height: 16px; }
.gate-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.gate-links { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.gate-links .grow { flex: 1; }
.gate-legal { margin: -4px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.gate-legal a { color: var(--ink-2); }
.gate-info { margin: 0; font-size: 13px; color: var(--win); }
.linkish { appearance: none; background: none; border: 0; padding: 2px 0; color: var(--ink); font: 500 13px/1.3 var(--f-ui); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { text-decoration-color: currentColor; }
.ts { min-height: 65px; }
.ts.quiet { min-height: 0; }
.qr { display: grid; place-items: center; padding: 12px; border-radius: 14px; background: #FFFFFF; width: max-content; margin-inline: auto; }
.qr img { display: block; width: 180px; height: 180px; }
