/* GrayTrading. Tokens copied from Gray Dojo (public/css/app.css) so the sites match. */
/* ---------- tokens ---------- */
/* "Dojo": warm paper and charcoal, one vermilion seal-red accent. */
:root {
  --bg: #f4f1ea;
  --surface: #fffdf9;
  --surface-2: #f0ebe2;
  --border: #e4ddd1;
  --text: #1e1b17;
  --text-2: #4b453d;
  --muted: #776f64;
  --accent: #c9432a;
  --accent-ink: #ffffff;
  --accent-soft: #fae5dc;
  --good: #2b7a4b;
  --good-soft: #e1f0e5;
  --bad: #b32424;
  --bad-soft: #f8e0de;
  --warn: #a36712;
  --ring: rgba(201, 67, 42, 0.32);
  --ink: #1e1b17;
  --ink-text: #fffdf9;
  /* sequential vermilion ramp (data viz) */
  --seq-0: #eee8de;
  --seq-1: #f4c4b2;
  --seq-2: #e78a6b;
  --seq-3: #c9432a;
  --seq-4: #852816;
  --bar: #d4532f;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.05), 0 2px 6px rgba(60, 40, 20, 0.04);
  --shadow-lg: 0 18px 50px rgba(50, 30, 10, 0.18);
  --radius: 16px;
  --nav-w: 244px;
  --font-ui: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #151311;
    --surface: #1d1a17;
    --surface-2: #27231f;
    --border: #36312b;
    --text: #f2ede5;
    --text-2: #d2c9bc;
    --muted: #9a9083;
    --accent: #ff6e4d;
    --accent-ink: #1c0c06;
    --accent-soft: #3b211a;
    --good: #5cc788;
    --good-soft: #152a1d;
    --bad: #f25c5c;
    --bad-soft: #3a1a1a;
    --warn: #e6a94a;
    --ring: rgba(255, 110, 77, 0.45);
    --ink: #f2ede5;
    --ink-text: #151311;
    --seq-0: #2a2622;
    --seq-1: #5e2c1e;
    --seq-2: #a4432b;
    --seq-3: #e2633f;
    --seq-4: #ffb39c;
    --bar: #f2704f;
    --shadow: none;
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #151311;
  --surface: #1d1a17;
  --surface-2: #27231f;
  --border: #36312b;
  --text: #f2ede5;
  --text-2: #d2c9bc;
  --muted: #9a9083;
  --accent: #ff6e4d;
  --accent-ink: #1c0c06;
  --accent-soft: #3b211a;
  --good: #5cc788;
  --good-soft: #152a1d;
  --bad: #f25c5c;
  --bad-soft: #3a1a1a;
  --warn: #e6a94a;
  --ring: rgba(255, 110, 77, 0.45);
  --ink: #f2ede5;
  --ink-text: #151311;
  --seq-0: #2a2622;
  --seq-1: #5e2c1e;
  --seq-2: #a4432b;
  --seq-3: #e2633f;
  --seq-4: #ffb39c;
  --bar: #f2704f;
  --shadow: none;
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Shared Gray Hub accent (grayhub.dev/theme.js sets --gh-accent; absent = Dojo's own orange) */
:root[data-accent] {
  --accent: var(--gh-accent);
  --accent-ink: var(--gh-accent-ink);
  --accent-soft: color-mix(in srgb, var(--gh-accent) 18%, var(--surface));
  --ring: color-mix(in srgb, var(--gh-accent) 40%, transparent);
  --bar: var(--gh-accent);
  --seq-1: color-mix(in srgb, var(--gh-accent) 30%, var(--surface));
  --seq-2: color-mix(in srgb, var(--gh-accent) 60%, var(--surface));
  --seq-3: var(--gh-accent);
  --seq-4: color-mix(in srgb, var(--gh-accent) 65%, var(--text));
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 0.6em; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.prose a, .center a, .muted a, .composer a, .mention { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  min-width: 0;
  width: 100%;
}
input[type='color'] { width: 44px; height: 38px; padding: 3px; cursor: pointer; }
input[type='checkbox'] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
label.inline input:not([type='checkbox']) { width: auto; }
.label { font-size: 0.85rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.88em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
pre { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
pre code { background: none; padding: 0; }

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }
.nav {
  width: var(--nav-w);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font: 800 1.15rem var(--font-display); padding: 4px 8px 14px; }
.brand:hover { color: var(--text); }
.logo {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  display: inline-grid; place-items: center; flex: none;
}
.logo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.logo.big { width: 56px; height: 56px; border-radius: 16px; }
.logo.big svg { width: 32px; height: 32px; }
.nav-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 14px 10px 4px; }
.nav nav { display: flex; flex-direction: column; gap: 2px; }
.nav nav a, .nav .me {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  font-weight: 600; color: var(--text-2);
}
.nav nav a:hover, .nav .me:hover { background: var(--surface-2); color: var(--text); }
.nav nav a.on { background: var(--accent-soft); color: var(--accent); }
.ni { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.ni svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-foot { margin-top: auto; display: flex; align-items: center; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.nav-foot .me { flex: 1; min-width: 0; }
.nav-foot .me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-link { font-size: 0.8rem; color: var(--muted); padding: 8px 10px 0; }
#view { flex: 1; min-width: 0; }
.page { max-width: 1100px; margin: 0 auto; padding: 28px 28px 60px; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 2px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 0 10px; }
.section-head h2, .section-head h3 { margin: 0; }
.card > .section-head:first-child, .grid2 > section > .section-head:first-child { margin-top: 0; }
.section-title { margin: 26px 0 12px; }
.back { display: inline-block; color: var(--muted); font-size: 0.88rem; margin-bottom: 10px; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.grid2, .grid3, .grid4 { display: grid; gap: 14px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid2.top { align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 120px; }
.row > label:has(input[type='color']) { flex: none; min-width: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.grid2 > .card, .grid3 > .card, .grid4 > .card { margin-bottom: 0; }
.stats-row { margin-bottom: 14px; }
.card.empty { text-align: center; padding: 30px 20px; }
.card.empty p:last-child { margin: 0; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.3;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 5px 11px; font-size: 0.86rem; border-radius: 9px; }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.btn-row.left { justify-content: flex-start; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 1rem; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; font-size: 0.9rem; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.seg.sm button { padding: 4px 10px; font-size: 0.85rem; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.long { color: var(--good); }
.seg button.on.short { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
button.chip { cursor: pointer; }
.tagchip .tag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tag); }
.tagchip.on { background: var(--tag); border-color: var(--tag); color: #fff; }
.tagchip.on .tag-dot { background: #fff; }
.new-tag input { width: 120px; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: color-mix(in srgb, var(--tag) 16%, var(--surface)); color: color-mix(in srgb, var(--tag) 75%, var(--text));
  border: 1px solid color-mix(in srgb, var(--tag) 30%, transparent);
}
a.tag:hover { background: var(--tag); color: var(--tag-ink, #fff); }
a.tag:hover .tag-dot { background: var(--tag-ink, #fff); }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tag); flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.card > .tags:first-child { margin-top: 0; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); padding: 6px 12px; font-size: 0.85rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; flex: none; }
.dot.big { width: 16px; height: 16px; vertical-align: 2px; }
.toggle { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.public-toggle { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-weight: 500; }
.public-toggle b { color: var(--text); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--ink-text); padding: 10px 18px; border-radius: 12px;
  font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: 0.2s; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.8rem; flex: none; object-fit: cover; }
.av.lg { width: 72px; height: 72px; font-size: 1.8rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table th.right { text-align: right; }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.tag-table .tag-color { width: 30px; height: 26px; padding: 2px; vertical-align: middle; }
.scroll-x { overflow-x: auto; }
.plain-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }

/* ---------- journal ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.stat b { font: 800 1.45rem var(--font-display); font-variant-numeric: tabular-nums; }
.entry { padding: 15px 18px; }
.entry-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.88rem; margin-bottom: 4px; }
.who { display: inline-flex; align-items: center; gap: 7px; }
.who .av { width: 22px; height: 22px; font-size: 0.7rem; }
.kind { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.kind.trade { background: var(--accent-soft); color: var(--accent); }
.entry-title h3 { margin: 2px 0 4px; font-size: 1.08rem; }
.entry-title:hover h3 { color: var(--accent); }
.trade-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 0.9rem; margin: 2px 0 6px; }
.dir { font-weight: 700; font-size: 0.85rem; text-transform: capitalize; }
.dir.long { color: var(--good); }
.dir.short { color: var(--bad); }
.pnl { font-weight: 700; font-variant-numeric: tabular-nums; }
.entry-snip { color: var(--text-2); margin: 0; font-size: 0.93rem; overflow-wrap: anywhere; }
.filters { display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.trade-grid input { background: var(--surface); }
.md-editor { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.md-editor:focus-within { box-shadow: 0 0 0 3px var(--ring); border-color: var(--accent); }
.md-bar { display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.md-bar button { border: 0; background: transparent; padding: 4px 9px; border-radius: 7px; cursor: pointer; font-weight: 700; color: var(--text-2); font-size: 0.85rem; }
.md-bar button:hover, .md-bar button.on { background: var(--surface); color: var(--text); }
.md-editor textarea { border: 0; border-radius: 0; min-height: 260px; box-shadow: none; }
.md-preview { padding: 12px 14px; min-height: 260px; }
.prose { overflow-wrap: anywhere; }
.prose h2 { font-size: 1.25rem; margin-top: 0.9em; }
.prose h3 { font-size: 1.08rem; margin-top: 0.8em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 0.7em; }
.prose blockquote { margin: 0 0 0.7em; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--text-2); }
.prose > :last-child { margin-bottom: 0; }
.cashtag { font-weight: 700; color: var(--accent); }
.cb { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; font-size: 0.7rem; margin-right: 6px; vertical-align: -2px; }
.cb.on { background: var(--good); border-color: var(--good); color: #fff; }
.entry-full { padding: 24px 28px; }
.entry-full h1 { margin-bottom: 6px; }
.trade-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.trade-table div { display: flex; flex-direction: column; }
.trade-table span { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.trade-table b { font-variant-numeric: tabular-nums; }

/* ---------- calendar ---------- */
.cal { padding: 14px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head span { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 6px; }
.cal-cell {
  min-height: 92px; border-radius: 11px; padding: 7px 8px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 2px; position: relative; border: 1px solid transparent; transition: border-color 0.12s;
}
.cal-cell:hover { border-color: var(--accent); color: var(--text); }
.cal-cell.out { opacity: 0.4; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-cell.win { background: var(--good-soft); }
.cal-cell.loss { background: var(--bad-soft); }
.cal-num { font-weight: 700; font-size: 0.85rem; }
.cal-pnl { font-weight: 800; font-size: 0.9rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-meta { display: flex; gap: 6px; font-size: 0.74rem; color: var(--muted); }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.cal-dots i { width: 8px; height: 8px; border-radius: 50%; }
.cal-dots i.sq { border-radius: 2px; }
.cal-key { margin: 10px 0 0; }

/* ---------- trackers ---------- */
.tracker-card { display: block; border-left: 4px solid var(--tc); }
.tracker-card:hover { color: var(--text); box-shadow: var(--shadow-lg); }
.tracker-card .dot { background: var(--tc); }
.tpl { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.field-row { display: grid; grid-template-columns: 1.3fr 0.8fr 2fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.field-row [hidden] { display: block; visibility: hidden; }
.field-ops { display: flex; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.log { padding: 12px 16px; }
.log-head { display: flex; align-items: center; gap: 8px; }
.log-head .dot { margin-right: 0; }
.log-form { border-color: var(--accent); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px 14px; margin: 8px 0 0; }
.kv div { display: flex; flex-direction: column; }
.kv dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.kv dd { margin: 0; font-weight: 600; }
.log .prose { margin-top: 8px; color: var(--text-2); }
.breakdown { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 24px; }
.fs h3 { font-size: 0.9rem; margin-bottom: 6px; }
.bars { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.bars td { padding: 3px 4px; }
.bars td:first-child { white-space: nowrap; width: 1%; padding-right: 10px; }
.barcell { display: flex; align-items: center; gap: 6px; }
.bar { display: inline-block; height: 10px; border-radius: 5px; background: var(--bar); min-width: 3px; }
#addlog { width: auto; padding: 5px 10px; font-size: 0.86rem; font-weight: 600; }

/* ---------- social ---------- */
.hero { display: flex; gap: 20px; align-items: center; padding: 26px; margin-bottom: 24px; }
.hero h1 { font-size: 2.2rem; }
.hero p { font-size: 1.05rem; color: var(--text-2); max-width: 60ch; }
.profile-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.profile-head h1 { margin-bottom: 0; }
.profile-stats { display: flex; gap: 22px; }
.profile-stats div { display: flex; flex-direction: column; align-items: flex-start; max-width: 120px; }
.profile-stats b { font: 800 1.4rem var(--font-display); }

/* ---------- auth ---------- */
.auth { max-width: 420px; padding-top: 60px; }
.auth .card { padding: 28px; }
.auth-logo { text-align: center; margin-bottom: 10px; }
.auth h1 { text-align: center; font-size: 1.6rem; }
.auth > .card > .muted { text-align: center; }

/* ---------- chat ---------- */
#view.chat-mode { height: 100vh; overflow: hidden; }
.chat { display: grid; grid-template-columns: 210px minmax(0, 1fr) 180px; height: 100%; }
.chat-side, .chat-online { border-right: 1px solid var(--border); padding: 16px 10px; overflow-y: auto; background: var(--surface); }
.chat-online { border-right: 0; border-left: 1px solid var(--border); padding: 16px 14px; }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px; }
.chan-list { display: flex; flex-direction: column; gap: 1px; }
.chan-list a { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 9px; font-weight: 600; color: var(--text-2); }
.chan-list a:hover { background: var(--surface-2); color: var(--text); }
.chan-list a.on { background: var(--accent-soft); color: var(--accent); }
.hash { color: var(--muted); width: 16px; text-align: center; font-size: 0.85rem; }
.online-n { font-size: 0.72rem; background: var(--good-soft); color: var(--good); border-radius: 999px; padding: 0 7px; }
.admin-opt { padding: 14px 8px 0; font-weight: 500; }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-head h2 { margin: 0; }
.chat-head p { margin: 0; }
.chan-jump { display: none; width: auto; }
.ch-tools { display: flex; gap: 2px; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; }
.msgs > :first-child { margin-top: auto; }
.msgs .empty { padding: 40px 0; }
.msg { display: flex; gap: 11px; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; position: relative; }
.msg.grouped { padding-top: 1px; }
.msg:hover { background: var(--surface-2); }
.msg .av { width: 34px; height: 34px; margin-top: 2px; }
.msg-time-side { width: 34px; flex: none; font-size: 0.68rem; color: var(--muted); text-align: right; padding-top: 4px; visibility: hidden; }
.msg:hover .msg-time-side { visibility: visible; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-text { overflow-wrap: anywhere; }
.msg-text p:last-child, .msg-text ul:last-child { margin-bottom: 0; }
.msg-ops { position: absolute; right: 6px; top: 4px; display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.msg:hover .msg-ops { display: flex; }
.edit-msg textarea { margin-top: 4px; }
.composer { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); background: var(--surface); align-items: flex-end; }
.composer textarea { resize: none; max-height: 180px; }
.composer.ro { justify-content: center; padding: 16px; }
.online-user { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.9rem; font-weight: 600; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); flex: none; }
#online { margin-top: 8px; }

/* ---------- mobile ---------- */
.tabbar { display: none; }
@media (max-width: 1100px) {
  .chat { grid-template-columns: 190px minmax(0, 1fr); }
  .chat-online { display: none; }
}
@media (max-width: 900px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .page { padding: 18px 14px 90px; }
  h1 { font-size: 1.5rem; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 0.7rem; font-weight: 600; color: var(--muted); border-radius: 10px; }
  .tabbar a.on { color: var(--accent); }
  .cal { padding: 8px; }
  .cal-head, .cal-grid { gap: 3px; }
  .cal-cell { min-height: 58px; padding: 4px; border-radius: 7px; }
  .cal-pnl { font-size: 0.66rem; }
  .cal-meta { display: none; }
  .cal-dots i { width: 6px; height: 6px; }
  .field-row { grid-template-columns: 1fr 1fr auto; }
  .field-row [data-k='options'] { grid-column: 1 / -1; grid-row: 2; }
  .field-row [hidden] { display: none; }
  .hero { flex-direction: column; text-align: center; align-items: center; }
  .hero .btn-row { justify-content: center; }
  #view.chat-mode { height: calc(100dvh - 62px - env(safe-area-inset-bottom)); }
  .chat { grid-template-columns: minmax(0, 1fr); }
  .chat-side { display: none; }
  .chan-jump { display: block; }
  .chat-head { padding: 10px 14px; flex-wrap: wrap; }
  .chat-head h2 { display: none; }
  .msgs { padding: 10px 14px; }
  .composer { padding: 10px 14px; }
  .msg-ops { display: flex; position: static; border: 0; background: none; align-self: flex-start; }
  .toast { bottom: 84px; }
}
