/* dcbot web – design tokens, layout and components.
 * Mobile first: bottom tab bar on phones, sidebar from 900 px. Dark and light theme
 * follow the system. No external fonts or resources (strict Content-Security-Policy).
 */
:root {
  --bg: #0d0f14;
  --bg-2: #11141b;
  --surface: #161a23;
  --surface-2: #1c2130;
  --surface-3: #242a3b;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #e8eaf0;
  --text-2: #b7bdcc;
  --muted: #8189a0;
  --accent: #7c6cff;
  --accent-2: #5b8cff;
  --accent-soft: rgba(124, 108, 255, .16);
  --accent-text: #ffffff;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, .14);
  --red: #f4516c;
  --red-soft: rgba(244, 81, 108, .14);
  --amber: #f5a524;
  --amber-soft: rgba(245, 165, 36, .15);
  --slate-soft: rgba(148, 163, 184, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .18);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .45);
  --radius: 16px;
  --radius-sm: 10px;
  --tabbar: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f9;
    --bg-2: #eceef4;
    --surface: #ffffff;
    --surface-2: #f6f7fb;
    --surface-3: #eceef5;
    --line: rgba(15, 23, 42, .08);
    --line-strong: rgba(15, 23, 42, .16);
    --text: #121521;
    --text-2: #3a4152;
    --muted: #6b7386;
    --accent: #6b5af5;
    --accent-2: #3f74f0;
    --accent-soft: rgba(107, 90, 245, .12);
    --green: #16a34a;
    --green-soft: rgba(22, 163, 74, .12);
    --red: #e11d48;
    --red-soft: rgba(225, 29, 72, .1);
    --amber: #d97706;
    --amber-soft: rgba(217, 119, 6, .12);
    --slate-soft: rgba(100, 116, 139, .14);
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
.num, .mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
svg.icon.sm { width: 16px; height: 16px; }
svg.icon.lg { width: 28px; height: 28px; }
svg.icon.filled { fill: currentColor; }

/* ============================================================ app shell */
.app { min-height: 100vh; }
.sidebar { display: none; }
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: calc(.7rem + env(safe-area-inset-top, 0px)) 1rem .7rem;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .mark { width: 30px; height: 30px; flex: none; }
.topbar .title { font-size: 1.08rem; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.topbar .title small { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); }
.clock-chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2); font-size: .85rem; font-weight: 600; cursor: pointer;
}
.clock-chip.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
#view { padding: 1rem 1rem calc(var(--tabbar) + var(--safe-bottom) + 1.5rem); max-width: 1120px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--tabbar) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .68rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: .35rem 0;
}
.tabbar a.active { color: var(--accent); }
.tabbar a.add span.plus {
  display: grid; place-items: center; width: 48px; height: 48px; margin-top: -18px; border-radius: 16px;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent);
}
.tabbar a.add { color: var(--text-2); }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: .4rem; position: sticky; top: 0; height: 100vh;
    padding: 1.2rem .9rem; background: var(--bg-2); border-right: 1px solid var(--line);
  }
  .sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .5rem 1.2rem; }
  .sidebar .brand .mark { width: 36px; height: 36px; }
  .sidebar .brand b { display: block; font-size: 1rem; }
  .sidebar .brand span { display: block; font-size: .78rem; color: var(--muted); max-width: 160px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar nav a {
    display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 12px;
    color: var(--text-2); text-decoration: none; font-weight: 600;
  }
  .sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
  .sidebar nav a.active { background: var(--accent-soft); color: var(--accent); }
  .sidebar .session-box { margin-top: auto; padding: .9rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); }
  .session-box .who { font-weight: 700; }
  .session-box .bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: .6rem 0 .5rem; }
  .session-box .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 1s linear; }
  .session-box .bar.warn i { background: var(--amber); }
  .session-box .left { font-size: .8rem; color: var(--muted); }
  .tabbar { display: none; }
  .topbar { padding: 1rem 1.6rem; }
  .topbar .mark, .topbar .clock-chip { display: none; }
  .topbar .title { font-size: 1.35rem; }
  #view { padding: 1.4rem 1.6rem 3rem; }
}

/* ============================================================ basics */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.card + .card, .stack > * + * { margin-top: .85rem; }
.card h2 { font-size: 1.02rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; }
.card-head h2 { display: flex; align-items: center; gap: .5rem; }
.section-title { display: flex; align-items: center; gap: .5rem; margin: 1.4rem .2rem .7rem; font-size: .8rem;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.section-title .count { background: var(--surface-3); color: var(--text-2); border-radius: 99px; padding: 0 .5rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.spacer { flex: 1; }
.grid-2 { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.min0 { min-width: 0; }
.layout-2 { display: flex; flex-direction: column; gap: .85rem; margin-top: .85rem; }
@media (min-width: 900px) {
  .layout-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
}
.form-actions.center { justify-content: center; }

/* ============================================================ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: .55rem 1rem; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: .92rem; cursor: pointer; text-decoration: none;
  background: var(--surface-3); color: var(--text); transition: transform .08s ease, background .15s ease, opacity .15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: .35rem .7rem; font-size: .84rem; border-radius: 10px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); cursor: pointer; flex: none;
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn:disabled { opacity: .4; cursor: default; }

/* ============================================================ forms */
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 650; color: var(--muted); letter-spacing: .01em; }
.field > span em { font-style: normal; font-weight: 500; opacity: .8; }
.field.wide { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: .62rem .75rem; min-height: 44px; transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
select {
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="date"], input[type="datetime-local"] { min-height: 44px; }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; padding: 0; border-radius: 6px; accent-color: var(--accent); appearance: auto; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
.form-grid { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 700px) { .form-grid.three { grid-template-columns: repeat(3, 1fr); } }
.hint { font-size: .8rem; color: var(--muted); }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line); }
.seg button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.long { background: var(--green); color: #fff; }
.seg button.on.short { background: var(--red); color: #fff; }

.chips { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; flex: none; min-height: 36px; padding: .35rem .8rem;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2);
  font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
@media (max-width: 599px) { .form-grid .field.full-sm { grid-column: 1 / -1; } }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-size: .76rem; font-weight: 650; white-space: nowrap; }

.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--surface-3); border-radius: 8px; }
.stars button.on { color: var(--amber); }
.stars button svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.stars.small button svg { width: 16px; height: 16px; }
.stars.small button { padding: 1px; }

/* ============================================================ badges */
.side { display: inline-flex; align-items: center; gap: .25rem; padding: .16rem .5rem; border-radius: 8px;
  font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.side.long { background: var(--green-soft); color: var(--green); }
.side.short { background: var(--red-soft); color: var(--red); }
.badge { display: inline-flex; align-items: center; padding: .14rem .55rem; border-radius: 999px; font-size: .74rem;
  font-weight: 800; letter-spacing: .03em; background: var(--slate-soft); color: var(--text-2); white-space: nowrap; }
.badge.tp { background: var(--green-soft); color: var(--green); }
.badge.sl { background: var(--red-soft); color: var(--red); }
.badge.be { background: var(--slate-soft); color: var(--text-2); }
.badge.open { background: var(--accent-soft); color: var(--accent); }

/* ============================================================ KPIs */
.kpis { display: grid; gap: .7rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem .95rem;
  box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-top: .15rem; }
.kpi .sub { font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.kpi.hero { grid-column: 1 / -1; background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
@media (min-width: 700px) { .kpi.hero { grid-column: span 2; } }
.kpi.hero .value { font-size: 2rem; }
.splitbar { display: flex; height: 7px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin-top: .55rem; }
.splitbar i { display: block; height: 100%; }
.splitbar .g { background: var(--green); } .splitbar .r { background: var(--red); } .splitbar .s { background: var(--muted); }
.meter { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: .55rem; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ============================================================ date navigation */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.date-nav { display: flex; align-items: center; gap: .4rem; flex: 1 1 auto; }
.date-btn { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .4rem .9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 700; cursor: pointer; }
.date-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; border: 0; padding: 0; }
.page-head select { width: auto; flex: 0 1 200px; }

/* ============================================================ trade cards */
.tcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem 1rem 1.15rem; box-shadow: var(--shadow); overflow: hidden; }
.tcard + .tcard { margin-top: .75rem; }
.tcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--muted); opacity: .5; }
.tcard.tp::before { background: var(--green); opacity: 1; }
.tcard.sl::before { background: var(--red); opacity: 1; }
.tcard.open::before { background: var(--accent); opacity: 1; }
.tcard-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tcard-top .sym { font-weight: 800; font-size: 1.05rem; }
.tcard-top .id { color: var(--muted); font-size: .85rem; text-decoration: none; }
.tcard-top .result { margin-left: auto; text-align: right; line-height: 1.2; }
.tcard-top .result b { display: block; font-size: 1.12rem; font-weight: 800; }
.tcard-top .result span { font-size: .8rem; font-weight: 700; }
.tcard-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .45rem; color: var(--text-2); font-size: .86rem; }
.tcard-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.tcard-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.thumbs { display: flex; gap: .5rem; overflow-x: auto; margin-top: .75rem; padding-bottom: 2px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { position: relative; flex: none; width: 96px; height: 68px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-3); cursor: pointer; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.add { display: grid; place-items: center; color: var(--muted); border-style: dashed; border-color: var(--line-strong);
  background: transparent; font-size: .72rem; font-weight: 700; }
.thumb.add span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.thumb .progress { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px; border-radius: 99px;
  background: rgba(0, 0, 0, .45); overflow: hidden; }
.thumb .progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
details.notes { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .7rem; }
details.notes summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  color: var(--text-2); font-weight: 650; font-size: .9rem; }
details.notes summary::-webkit-details-marker { display: none; }
details.notes summary .preview { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0; flex: 1; }
details.notes summary .chev { margin-left: auto; transition: transform .2s; }
details.notes[open] summary .chev { transform: rotate(90deg); }
details.notes[open] summary .preview { display: none; }
details.notes .form-grid { margin-top: .8rem; }

/* list rows (trades page) */
.list { display: flex; flex-direction: column; gap: .6rem; }
.lrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: .8rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .8rem;
  text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .15s, transform .08s; }
.lrow:hover { border-color: var(--line-strong); }
.lrow:active { transform: scale(.99); }
.lrow .pic { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); }
.lrow .pic img { width: 100%; height: 100%; object-fit: cover; }
.lrow .pic.long { background: var(--green-soft); color: var(--green); }
.lrow .pic.short { background: var(--red-soft); color: var(--red); }
.lrow .main-line { display: flex; align-items: center; gap: .45rem; font-weight: 750; min-width: 0; }
.lrow .main-line .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .sub-line { font-size: .8rem; color: var(--muted); margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .res { text-align: right; line-height: 1.25; }
.lrow .res b { display: block; font-weight: 800; }
.lrow .res span { font-size: .8rem; font-weight: 700; }

/* ============================================================ trade detail */
.hero { position: relative; overflow: hidden; }
.hero .glow { position: absolute; inset: -40% -10% auto auto; width: 70%; height: 180%; pointer-events: none;
  background: radial-gradient(closest-side, var(--accent-soft), transparent); }
.hero.tp .glow { background: radial-gradient(closest-side, var(--green-soft), transparent); }
.hero.sl .glow { background: radial-gradient(closest-side, var(--red-soft), transparent); }
.hero-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; position: relative; }
.hero-top h2 { font-size: 1.4rem; font-weight: 800; }
.hero-figures { display: flex; align-items: flex-start; gap: 1.4rem; flex-wrap: wrap; margin-top: .8rem; position: relative; }
.hero-figures .big { font-size: 2.2rem; font-weight: 850; letter-spacing: -.03em; line-height: 1; }
.hero-figures .mid { font-size: 1.2rem; font-weight: 800; }
.hero-figures small { display: block; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: .25rem; }
.notice { display: flex; gap: .55rem; align-items: flex-start; padding: .65rem .8rem; border-radius: 12px;
  background: var(--surface-2); color: var(--text-2); font-size: .85rem; margin-top: .9rem; position: relative; }
.notice.good { background: var(--green-soft); color: var(--green); }
.notice.warn { background: var(--amber-soft); color: var(--amber); }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.level { background: var(--surface-2); border-radius: 12px; padding: .6rem .75rem; min-width: 0; }
.level small { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.level b { display: block; font-size: 1.05rem; font-weight: 800; margin-top: .1rem; }
.level span { display: block; font-size: .78rem; color: var(--muted); }
.level.wide { grid-column: 1 / -1; }
.targets { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.gallery { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gallery figure { margin: 0; position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-3);
  aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.gallery figure img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.gallery figure figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem .55rem .4rem; font-size: .75rem;
  color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery figure .del { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 10px; border: 0;
  display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; }
.dropzone { margin-top: .8rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 118px; padding: 1rem; border-radius: 14px; border: 1.5px dashed var(--line-strong); color: var(--text-2);
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s; background: var(--bg-2); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone b { font-size: .95rem; }
.dropzone .hint { max-width: 320px; }
.uploads { display: flex; flex-direction: column; gap: .45rem; margin-top: .7rem; }
.upload-item { display: grid; grid-template-columns: 40px 1fr auto; gap: .6rem; align-items: center; font-size: .84rem; }
.upload-item img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-3); }
.upload-item .bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: .3rem; }
.upload-item .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload-item.done .bar i { background: var(--green); }
.upload-item.failed { color: var(--red); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .8rem 1.2rem; font-size: .85rem; color: var(--text-2); }
.timeline li::before { content: ""; position: absolute; left: 3px; top: .45rem; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 1rem; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: .74rem; color: var(--muted); }
details.more { margin-top: .8rem; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: .4rem; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .chev { transform: rotate(90deg); }
details.more .form-grid { margin-top: .8rem; }

/* sticky save bar (add trade) */
.savebar { position: sticky; bottom: calc(var(--tabbar) + var(--safe-bottom) + .6rem); z-index: 15; margin-top: 1rem;
  display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem .7rem 1rem; border-radius: 16px;
  background: var(--surface); background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-lg); }
.savebar .preview { flex: 1; min-width: 0; line-height: 1.25; }
.savebar .preview b { display: block; font-size: 1.05rem; }
.savebar .preview span { font-size: .78rem; color: var(--muted); }
@media (min-width: 900px) { .savebar { bottom: 1rem; } }

/* ============================================================ accounts */
.acc-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.acc { display: flex; flex-direction: column; gap: .7rem; }
.acc .name { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.05rem; }
.acc .avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; flex: none; }
.acc .figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.acc .figures div { background: var(--surface-2); border-radius: 10px; padding: .45rem .55rem; }
.acc .figures small { display: block; font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.acc .figures b { font-size: .98rem; }
.acc .actions { display: flex; gap: .4rem; margin-top: auto; }

/* ============================================================ empty / skeleton */
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .circle { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto .8rem;
  background: var(--accent-soft); color: var(--accent); }
.empty b { display: block; color: var(--text); font-size: 1rem; margin-bottom: .25rem; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; height: 110px; }
.skeleton + .skeleton { margin-top: .75rem; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================ overlays */
#toast { position: fixed; left: 50%; transform: translateX(-50%); z-index: 60; width: min(92vw, 460px);
  bottom: calc(var(--tabbar) + var(--safe-bottom) + .8rem); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
@media (min-width: 900px) { #toast { bottom: 1.4rem; left: auto; right: 1.4rem; transform: none; width: 380px; } }
.toast { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 14px; font-size: .9rem;
  background: #1f2433; color: #eef0f5; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .08);
  white-space: pre-line; animation: pop .22s ease; pointer-events: auto; }
.toast .ic { color: var(--green); margin-top: 1px; }
.toast.error .ic { color: #ff7a8f; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(5, 7, 12, .6); display: flex; align-items: flex-end;
  justify-content: center; animation: fade .18s ease; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: .6rem 1.1rem calc(1.2rem + var(--safe-bottom)); box-shadow: var(--shadow-lg); animation: up .24s cubic-bezier(.2, .9, .3, 1); }
.sheet .grip { width: 38px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: .2rem auto .9rem; }
.sheet h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.sheet p { color: var(--text-2); margin: .3rem 0 0; }
.sheet .form-actions { justify-content: flex-end; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 700px) {
  .scrim { align-items: center; }
  .sheet { width: min(460px, 92vw); border-radius: 20px; padding: 1.3rem 1.4rem 1.3rem; }
  .sheet .grip { display: none; }
}

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(3, 4, 8, .94); display: flex; flex-direction: column;
  animation: fade .18s ease; }
.lightbox .bar { display: flex; align-items: center; gap: .6rem; padding: calc(.7rem + env(safe-area-inset-top, 0px)) .9rem .7rem; color: #fff; }
.lightbox .bar .cap { flex: 1; min-width: 0; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox .stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: .5rem; touch-action: pan-y; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox .icon-btn { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .nav.prev { left: .6rem; } .lightbox .nav.next { right: .6rem; }

#ended { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1.2rem;
  background: rgba(5, 7, 12, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#ended .card { max-width: 420px; text-align: center; padding: 1.8rem 1.5rem; }
#ended .circle { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 1rem;
  background: var(--accent-soft); color: var(--accent); }
#ended h2 { margin-bottom: .5rem; }
#ended p { color: var(--text-2); margin: 0; }

/* ============================================================ server pages (link expired …) */
body.notice-page { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(1200px 600px at 80% -10%, var(--accent-soft), transparent), var(--bg); }
.notice-card { max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 2rem 1.6rem; text-align: center; box-shadow: var(--shadow-lg); }
.notice-card .mark { width: 56px; height: 56px; margin-bottom: 1rem; }
.notice-card h1 { font-size: 1.35rem; margin-bottom: .6rem; }
.notice-card p { color: var(--text-2); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
