/* ============================================================
   Trading Hub — design tokens
   Dark is the signature look; light is its ivory counterpart.
   ============================================================ */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f6f4ee;
  --bg-glow: rgba(176, 138, 70, 0.10);
  --card: #fffefb;
  --card-2: #f2efe7;
  --card-3: #ebe7dc;
  --line: rgba(28, 24, 12, 0.08);
  --line-2: rgba(28, 24, 12, 0.14);
  --text: #16150f;
  --text-2: #57534a;
  --muted: #8c887d;
  --gold: #94702f;          /* accent ink on light */
  --gold-bright: #b8924f;
  --gold-soft: rgba(148, 112, 47, 0.10);
  --gold-line: rgba(148, 112, 47, 0.35);
  --btn: #16150f;
  --btn-ink: #f6f4ee;
  --pos: #2a78d6;           /* profit: blue, as in MT5 (validated pair) */
  --neg: #e34948;           /* loss: red */
  --pos-ink: #1f63b5;
  --neg-ink: #b42f2f;
  --pos-soft: rgba(42, 120, 214, 0.09);
  --neg-soft: rgba(227, 73, 72, 0.09);
  --target: #a39f93;
  --warn-bg: #fbf1dc;
  --warn-ink: #6f4a07;
  --grid: rgba(28, 24, 12, 0.07);
  --shadow: 0 1px 1px rgba(28, 24, 12, 0.03), 0 8px 24px -12px rgba(28, 24, 12, 0.12);
  --hero: radial-gradient(120% 130% at 100% 0%, rgba(184, 146, 79, 0.20), transparent 55%), linear-gradient(180deg, #fffefb, #f8f5ec);
  --tabbar: rgba(255, 254, 251, 0.78);
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --r: 20px;
  --tab-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0b0b0a;
    --bg-glow: rgba(214, 182, 122, 0.08);
    --card: #141412;
    --card-2: #1b1b18;
    --card-3: #23231f;
    --line: rgba(255, 250, 235, 0.07);
    --line-2: rgba(255, 250, 235, 0.13);
    --text: #f3f1ea;
    --text-2: #bcb8ad;
    --muted: #7f7b71;
    --gold: #d8b97f;
    --gold-bright: #e9cf9c;
    --gold-soft: rgba(216, 185, 127, 0.11);
    --gold-line: rgba(216, 185, 127, 0.38);
    --btn: #d8b97f;
    --btn-ink: #15130e;
    --pos: #3987e5;
    --neg: #e66767;
    --pos-ink: #78b0f2;
    --neg-ink: #f08e8e;
    --pos-soft: rgba(57, 135, 229, 0.12);
    --neg-soft: rgba(230, 103, 103, 0.12);
    --target: #6f6b62;
    --warn-bg: #2c2312;
    --warn-ink: #f0cd85;
    --grid: rgba(255, 250, 235, 0.06);
    --shadow: 0 1px 0 rgba(255, 250, 235, 0.03) inset, 0 12px 30px -18px rgba(0, 0, 0, 0.9);
    --hero: radial-gradient(120% 130% at 100% 0%, rgba(216, 185, 127, 0.20), transparent 55%), linear-gradient(180deg, #191916, #121210);
    --tabbar: rgba(22, 22, 20, 0.72);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0b0a; --bg-glow: rgba(214, 182, 122, 0.08); --card: #141412; --card-2: #1b1b18; --card-3: #23231f;
  --line: rgba(255, 250, 235, 0.07); --line-2: rgba(255, 250, 235, 0.13); --text: #f3f1ea; --text-2: #bcb8ad; --muted: #7f7b71;
  --gold: #d8b97f; --gold-bright: #e9cf9c; --gold-soft: rgba(216, 185, 127, 0.11); --gold-line: rgba(216, 185, 127, 0.38);
  --btn: #d8b97f; --btn-ink: #15130e; --pos: #3987e5; --neg: #e66767; --pos-ink: #78b0f2; --neg-ink: #f08e8e;
  --pos-soft: rgba(57, 135, 229, 0.12); --neg-soft: rgba(230, 103, 103, 0.12); --target: #6f6b62; --warn-bg: #2c2312; --warn-ink: #f0cd85;
  --grid: rgba(255, 250, 235, 0.06); --shadow: 0 1px 0 rgba(255, 250, 235, 0.03) inset, 0 12px 30px -18px rgba(0, 0, 0, 0.9);
  --hero: radial-gradient(120% 130% at 100% 0%, rgba(216, 185, 127, 0.20), transparent 55%), linear-gradient(180deg, #191916, #121210);
  --tabbar: rgba(22, 22, 20, 0.72);
}

/* ============================================================ base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(90% 45% at 50% -10%, var(--bg-glow), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--sans);
  font-feature-settings: 'tnum' 1, 'cv11' 1, 'ss03' 1;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
::selection { background: var(--gold-soft); }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 40px);
}
header.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 2px 20px; }
header.top h1 { font: 400 40px/1 var(--serif); letter-spacing: -0.01em; margin: 0; }
header.top h1 em { color: var(--gold); }
header.top .sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; margin: 0 0 12px; }
h3 { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin: 18px 0 8px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 16px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.pos { color: var(--pos-ink); }
.neg { color: var(--neg-ink); }
.nowrap { white-space: nowrap; }
.gold { color: var(--gold); }

/* ============================================================ hero */
.hero { background: var(--hero); border: 1px solid var(--line-2); border-radius: 24px; padding: 20px 18px 18px; margin-bottom: 14px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero::before { content: ''; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line), transparent); }
.hero .big { font: 400 56px/1 var(--serif); letter-spacing: -0.015em; margin: 10px 0 14px; }
.hero .big .pence { font-size: 34px; color: var(--text-2); }
.hero .stats { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.chip b { font-weight: 600; }
.chip.pos { background: var(--pos-soft); }
.chip.neg { background: var(--neg-soft); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-width: 0; box-shadow: var(--shadow); }
.tile .k { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tile .v { font: 600 24px/1.15 var(--sans); letter-spacing: -0.02em; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v.two { font-size: 17px; white-space: normal; }
.tile .s { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ============================================================ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 14px; padding: 12px 18px; min-height: 50px;
  background: var(--btn); color: var(--btn-ink); font-weight: 600; font-size: 15px; letter-spacing: 0.005em;
  cursor: pointer; text-decoration: none; transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.985); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.soft { background: var(--gold-soft); color: var(--gold); }
.btn.danger { background: transparent; color: var(--neg-ink); border-color: var(--line); }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: 0.45; }
.icon-btn { width: 42px; height: 42px; border-radius: 21px; border: 1px solid var(--line-2); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--text); position: relative; flex: none; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; letter-spacing: 0.02em; color: var(--gold); background: var(--gold-soft); border: 1px solid var(--gold-line); cursor: pointer; position: relative; flex: none; }
.avatar.lg { width: 64px; height: 64px; font: 400 26px/1 var(--serif); }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; cursor: default; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.action { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; box-shadow: var(--shadow); }
.action .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }

label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
input[type='text'], input[type='email'], input[type='number'], input[type='date'], input[type='datetime-local'], input[type='password'], select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card-2); font-size: 16px; appearance: none; -webkit-appearance: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-line); box-shadow: 0 0 0 4px var(--gold-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; }
details summary { cursor: pointer; }

.seg { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 14px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 38px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line); }
.seg.side button.on.buy { background: var(--pos); color: #fff; }
.seg.side button.on.sell { background: var(--neg); color: #fff; }

/* toggle switch */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 15px; background: var(--card-3); border: 1px solid var(--line-2); transition: background 0.2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch input:checked + span { background: var(--gold); border-color: var(--gold); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ============================================================ tables & rows */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: right; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { text-align: right; padding: 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { text-align: left; padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
table.days { font-size: 13.5px; }
table.days th, table.days td { padding-left: 5px; padding-right: 5px; }
table.days th:first-child, table.days td:first-child { padding-left: 14px; }
table.days th:last-child, table.days td:last-child { padding-right: 14px; }
table.days th { letter-spacing: 0.05em; font-size: 10px; }
table.days .d { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
tr.tap { cursor: pointer; }
tr.tap:active { background: var(--card-2); }
tr.weekend td { text-align: center; color: var(--muted); font-size: 10px; background: var(--card-2); padding: 6px; letter-spacing: 0.18em; text-transform: uppercase; }
tr.today td { font-weight: 650; }
tr.today td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
.tag { display: inline-block; font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--text-2); font-weight: 600; vertical-align: 1px; letter-spacing: 0.02em; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.tag.gold { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-line); }
.tag.pos { background: var(--pos-soft); color: var(--pos-ink); border-color: transparent; }
.tag.neg { background: var(--neg-soft); color: var(--neg-ink); border-color: transparent; }

.trade { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.trade:last-child { border-bottom: 0; }
.trade .sym { font-weight: 700; letter-spacing: 0.01em; }
.trade .side { font-weight: 600; }
.trade .side.sell { color: var(--neg-ink); }
.trade .side.buy { color: var(--pos-ink); }
.trade .px, .trade .tm { color: var(--text-2); font-size: 13.5px; }
.trade .pl { font-weight: 700; text-align: right; }
.trade .tm { text-align: right; }
.trade.sel { grid-template-columns: auto 1fr auto; align-items: center; }
.day-h { padding: 10px 16px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted); background: var(--card-2); text-transform: uppercase; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row.tap { cursor: pointer; }
.list-row.tap:active { background: var(--card-2); }
.bar-track { height: 4px; border-radius: 2px; background: var(--card-3); overflow: hidden; margin-top: 8px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 2px; }

.insight { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; margin-bottom: 8px; font-size: 14.5px; background: var(--card-2); border: 1px solid var(--line); }
.insight.good { background: var(--pos-soft); }
.insight.bad { background: var(--neg-soft); }
.insight .ic { flex: none; font-weight: 700; width: 18px; text-align: center; color: var(--gold); }
.insight.good .ic { color: var(--pos-ink); }
.insight.bad .ic { color: var(--neg-ink); }
.warn-box { background: var(--warn-bg); color: var(--warn-ink); padding: 12px 14px; border-radius: 14px; margin-bottom: 10px; font-size: 14.5px; }
.ai-text { white-space: pre-wrap; font-size: 15px; line-height: 1.55; }

.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); margin-bottom: 14px; background: linear-gradient(135deg, var(--gold-soft), transparent 80%), var(--card); border: 1px solid var(--gold-line); cursor: pointer; }
.banner .t { font-weight: 600; }
.banner .chev { color: var(--gold); font-size: 20px; }

/* predictor */
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.outcome { border-radius: 16px; padding: 14px; border: 1px solid var(--line); }
.outcome.loss { background: var(--neg-soft); }
.outcome.win { background: var(--pos-soft); }
.outcome .k { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.outcome .v { font: 600 26px/1.15 var(--sans); letter-spacing: -0.02em; margin: 6px 0 4px; }
.outcome .s { font-size: 12px; color: var(--text-2); }
.kv { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; gap: 14px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--text-2); }
.kv > span:last-child { font-weight: 600; text-align: right; }
.kv > span:first-child .small { font-weight: 400; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos a { display: block; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: var(--card-2); position: relative; border: 1px solid var(--line); }
.photos img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.photos .cap { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; padding: 14px 6px 5px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); color: #fff; }

/* ============================================================ charts */
.chart { position: relative; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .grid.zero { stroke: var(--line-2); }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.dashed { stroke-dasharray: 4 5; stroke-width: 1.5; }
.chart .line.actual { stroke: var(--gold); }
.chart .line.target { stroke: var(--target); }
.chart .dot { stroke: var(--card); stroke-width: 2; }
.chart .dot.actual { fill: var(--gold); }
.chart .dot.target { fill: var(--target); }
.chart .cross { stroke: var(--line-2); stroke-width: 1; }
.chart path.pos { fill: var(--pos); }
.chart path.neg { fill: var(--neg); }
.chart .bar.on path { opacity: 0.75; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; flex-wrap: wrap; }
.key { display: inline-block; width: 16px; height: 0; border-top: 2px solid; margin-right: 7px; vertical-align: middle; }
.key.actual { border-color: var(--gold); }
.key.target { border-color: var(--target); }
.key.dashed { border-top-style: dashed; }
.tip { position: fixed; z-index: 50; display: none; pointer-events: none; background: var(--card); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 11px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); max-width: 260px; }
.tip .tip-h { font-weight: 700; margin-bottom: 3px; }
.tip b { font-weight: 650; }

/* ============================================================ floating tab bar */
nav.tabs {
  position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 10px);
  max-width: 560px; margin: 0 auto; height: var(--tab-h);
  display: grid; grid-template-columns: repeat(6, 1fr); align-items: center;
  background: var(--tabbar); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--line-2); border-radius: 24px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.45);
}
nav.tabs[hidden] { display: none; }
nav.tabs button { height: 100%; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); cursor: pointer; position: relative; }
nav.tabs button.on { color: var(--gold); }
nav.tabs button.on::after { content: ''; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 2px; background: var(--gold); }
nav.tabs button.on span { opacity: 0; }
nav.tabs button.add .plus { width: 42px; height: 42px; border-radius: 15px; display: grid; place-items: center; background: var(--btn); color: var(--btn-ink); box-shadow: 0 6px 16px -6px var(--gold-line); }
nav.tabs button.add span { display: none; }
nav.tabs button.add.on::after { display: none; }

/* ============================================================ sheets & toasts */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); z-index: 30; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.18s; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 26px 26px 0 0; border: 1px solid var(--line-2); border-bottom: 0; padding: 8px 18px calc(env(safe-area-inset-bottom) + 24px); animation: up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 14px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.sheet-h h2 { margin: 0; font: 400 28px/1.1 var(--serif); }
@keyframes up { from { transform: translateY(48px); } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); animation: toast 0.25s ease-out; text-align: center; }
@keyframes toast { from { transform: translate(-50%, 10px); opacity: 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin 0.8s linear infinite; display: inline-block; vertical-align: -4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 26px 14px; color: var(--muted); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ============================================================ sign-in / request access */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 28px) 22px calc(env(safe-area-inset-bottom) + 28px); max-width: 460px; margin: 0 auto; position: relative; }
.auth::before { content: ''; position: fixed; inset: -20% -20% auto; height: 70vh; background: radial-gradient(50% 50% at 50% 40%, var(--bg-glow), transparent 70%); pointer-events: none; z-index: -1; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, var(--card-3), var(--card)); border: 1px solid var(--gold-line); color: var(--gold); }
.brand .name { font: 400 22px/1 var(--serif); letter-spacing: 0.01em; }
.auth .hero-copy { margin: 13vh 0 34px; }
.auth h1 { font: 400 52px/0.98 var(--serif); letter-spacing: -0.02em; margin: 0 0 16px; }
.auth h1 em { color: var(--gold); }
.auth .lede { color: var(--text-2); font-size: 16px; max-width: 34ch; margin: 0; }
.auth .panel { background: var(--card); border: 1px solid var(--line-2); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.auth .fine { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }
.auth .status { text-align: center; margin: 12vh 0 0; }
.auth .status .seal { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 22px; display: grid; place-items: center; border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--gold); }
.auth .status h1 { font-size: 44px; }
.steps { list-style: none; margin: 28px 0 0; padding: 0; text-align: left; }
.steps li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--text-2); }
.steps li:last-child { border-bottom: 0; }
.steps .n { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); }
.steps li.done .n { background: var(--gold); border-color: var(--gold); color: var(--btn-ink); }
.steps li.done { color: var(--text); }

/* ============================================================ members (admin) */
.statbar { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; box-shadow: var(--shadow); }
.statbar > div { padding: 14px; text-align: center; }
.statbar > div + div { border-left: 1px solid var(--line); }
.statbar .v { font: 600 26px/1 var(--sans); letter-spacing: -0.02em; }
.statbar .k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.request { background: var(--card); border: 1px solid var(--gold-line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.request::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--gold-bright), var(--gold)); }
.request .who { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.request .who b { display: block; font-size: 16px; }
.request blockquote { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); color: var(--text-2); font: italic 400 17px/1.35 var(--serif); }
.quote { margin: 0 0 14px; padding: 12px 16px; border-left: 2px solid var(--gold); border-radius: 0 12px 12px 0; background: var(--card-2); color: var(--text-2); font: italic 400 18px/1.35 var(--serif); }
.back { border: 0; background: none; color: var(--gold); font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--muted); }
.status-dot.active { background: var(--pos); }
.status-dot.pending { background: var(--gold); }
.status-dot.suspended, .status-dot.declined { background: var(--neg); }
.temp-pass { font: 600 22px/1.2 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.04em; text-align: center; padding: 16px; border-radius: 14px; background: var(--card-2); border: 1px dashed var(--gold-line); user-select: all; margin: 10px 0; word-break: break-all; }

@media (min-width: 700px) {
  header.top h1 { font-size: 46px; }
  .hero .big { font-size: 64px; }
}
