:root {
  --bg: #0d121c;
  --bg2: #111827;
  --card: #151d2b;
  --card2: #1a2332;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .14);
  --text: #e8edf5;
  --muted: #8a96aa;
  --dim: #5d6a80;
  --green: #31d39a;
  --green-bg: rgba(49, 211, 154, .12);
  --red: #f0566b;
  --red-bg: rgba(240, 86, 107, .12);
  --yellow: #f2c14e;
  --accent: #5ab8e8;
  --accent2: #3a8fc4;
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 70% 110%, #2a2133 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100%; }
.sidenav {
  width: 220px; flex: none; position: sticky; top: 0; height: 100vh;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--line); background: rgba(13, 18, 28, .7);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 8px 18px; }
.brand img { width: 30px; height: 30px; }
.sidenav nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.sidenav nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.sidenav nav a svg { width: 18px; height: 18px; fill: currentColor; }
.sidenav nav a:hover { background: var(--card); color: var(--text); }
.sidenav nav a.active { background: var(--card2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.sync { margin-top: auto; font-size: 12px; color: var(--dim); padding: 8px; }
.sync b { color: var(--muted); font-weight: 500; }

main { flex: 1; min-width: 0; padding: 22px 26px 40px; }
.bottomnav { display: none; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; position: relative; min-width: 0;
}
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.label { font-size: 11px; font-weight: 600; color: var(--muted); }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

/* ---------- News ---------- */
#news:empty { display: none; }
.newsbar { margin-bottom: 14px; padding: 12px 16px; }
.news-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.news-head .ins-title svg { fill: var(--yellow); }
.news-head .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-tabs { display: flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 2px; gap: 2px; }
.news-tabs button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.news-tabs button.on { background: var(--card2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.news-meta { font-size: 11px; color: var(--dim); }
.news-list { margin-top: 10px; display: grid; gap: 2px; max-height: 260px; overflow: auto; }
.news-day { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 0 4px; }
.news-day:first-child { padding-top: 0; }
.news-row {
  display: grid; grid-template-columns: 10px 46px 40px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 7px 10px; border-radius: 8px; font-size: 13px;
}
.news-row:hover { background: rgba(255, 255, 255, .03); }
.news-row.past { opacity: .45; }
.news-row.next { background: rgba(242, 193, 78, .07); box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .3); }
.news-row .t { font-variant-numeric: tabular-nums; font-weight: 600; }
.news-row .c { font-weight: 700; font-size: 12px; color: var(--muted); }
.news-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.news-row .fp { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.news-row .in { font-size: 11px; font-weight: 700; color: var(--yellow); margin-left: 6px; }
.ndot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.ndot.High { background: #f0566b; box-shadow: 0 0 0 3px rgba(240, 86, 107, .18); }
.ndot.Medium { background: #ff9a3c; box-shadow: 0 0 0 3px rgba(255, 154, 60, .18); }
.news-empty { margin-top: 10px; font-size: 13px; color: var(--muted); }
.newsbar.collapsed .news-list, .newsbar.collapsed .news-empty { display: none; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--bg2); border: 1px solid var(--line2); cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: .15s; }
.switch input:checked + span { background: var(--accent2); border-color: var(--accent2); }
.switch input:checked + span::after { left: 20px; background: #fff; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
code.topic { background: var(--bg2); border: 1px solid var(--line2); border-radius: 6px; padding: 3px 8px; font-size: 13px; user-select: all; }

/* ---------- Watchlist ---------- */
.wl-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.wl-card { padding: 12px 8px; }
.wl-add { display: flex; gap: 8px; padding: 0 6px 10px; }
.wl-add .search { flex: 1; }
.wl-head, .wl-row { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr) 96px 86px 66px; gap: 6px; align-items: center; }
.wl-head { padding: 6px 8px; font-size: 11px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.wl-head span:nth-child(n+4) { text-align: right; }
.wl-row { padding: 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums; }
.wl-row:hover { background: rgba(255, 255, 255, .03); }
.wl-row.alarm { background: linear-gradient(90deg, rgba(255, 154, 60, .08), transparent 60%); }
.wl-row.dragging { opacity: .4; }
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.wl-sym { font-weight: 700; display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; }
.wl-sym .ndot { width: 7px; height: 7px; }
.wl-alp { font-size: 10.5px; font-weight: 600; color: #ff9a3c; overflow: hidden; text-overflow: ellipsis; }
.wl-price, .wl-chg, .wl-pct { text-align: right; white-space: nowrap; }
.wl-price { font-weight: 600; }
.wl-price sup { font-size: .7em; vertical-align: .45em; margin-left: 1px; }
.wl-price .fut { font-size: 9px; font-weight: 800; color: var(--muted); border: 1px solid var(--line2); border-radius: 3px; padding: 0 3px; margin-left: 4px; vertical-align: 1px; }
.wl-chg, .wl-pct { font-size: 12.5px; }
.wl-flag { width: 24px; height: 24px; border: 0; background: none; padding: 3px; cursor: pointer; border-radius: 5px; color: var(--dim); opacity: .45; }
.wl-flag svg { width: 100%; height: 100%; fill: currentColor; }
.wl-row:hover .wl-flag { opacity: 1; }
.wl-flag:hover { background: var(--line); color: #ff9a3c; }
.wl-flag.on { color: #ff9a3c; opacity: 1; }
.wl-ic { display: flex; align-items: center; }
.wl-ic i { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; box-shadow: 0 0 0 2px var(--card); }
.wl-ic i:first-child { position: relative; z-index: 1; }
.wl-ic i + i { margin-left: -7px; }
.wl-add .search::placeholder { text-transform: none; }
.wl-sec-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 6px; }
.wl-sec-head.bare { padding: 0; height: 4px; }
.wl-sec-toggle { display: flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 0; }
.wl-sec-toggle svg { width: 16px; height: 16px; fill: currentColor; transition: transform .15s; }
.wl-sec-toggle small { font-weight: 600; color: var(--dim); letter-spacing: 0; }
.wl-sec-tools { opacity: 0; transition: opacity .15s; }
.wl-sec-head:hover .wl-sec-tools { opacity: 1; }
.wl-sec-tools .iconbtn { font-size: 12px; }
.wl-empty { padding: 10px 8px; font-size: 12px; color: var(--dim); }
.al-list { display: grid; gap: 4px; }
.al-item { display: grid; grid-template-columns: 76px 90px auto 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(255, 154, 60, .07); border: 1px solid rgba(255, 154, 60, .22); cursor: pointer; font-size: 13px; }
.al-item.past { background: transparent; border-color: var(--line); opacity: .65; }
.al-item:hover { border-color: rgba(255, 154, 60, .5); }
.al-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alchip svg { fill: #ff9a3c !important; }
.alchip.on { border-color: #ff9a3c; color: #ffb36b; }
.alarm-badge { background: rgba(255, 154, 60, .14); color: #ff9a3c; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.alarm-badge svg { width: 11px; height: 11px; fill: currentColor; }
.dtop { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.alflag { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 800; color: var(--dim); }
.alflag svg { width: 11px; height: 11px; fill: currentColor; }
.alflag.on { color: #ff9a3c; }
.wk-al { display: inline-flex; align-items: center; gap: 3px; color: #ff9a3c; font-weight: 600; margin-top: 2px; }
.wk-al svg { width: 10px; height: 10px; fill: currentColor; }
.more-list { display: grid; gap: 6px; }
.more-list a { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-weight: 600; }
.more-list a svg { width: 20px; height: 20px; fill: var(--muted); }

/* ---------- Kopieren ---------- */
.copy-wrap { position: relative; }
.copy-wrap input { padding-right: 38px !important; }
.copy-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.copy-btn svg { width: 16px; height: 16px; fill: currentColor; }
.copy-btn:hover { background: var(--line); color: var(--text); }
.copy-btn.done { color: var(--green); }
.copy-wrap input::-webkit-outer-spin-button, .copy-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.copy-wrap input[type=number] { -moz-appearance: textfield; }

/* ---------- Screenshot-Scan ---------- */
.scan-zone { border: 1px dashed var(--line2); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.scan-zone:hover, .scan-zone.drag { border-color: var(--accent2); background: rgba(90, 184, 232, .05); }
.scan-empty { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.scan-empty[hidden] { display: none; }
.scan-empty svg { width: 30px; height: 30px; fill: var(--accent); flex: none; }
.scan-result { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.scan-result[hidden] { display: none; }
.scan-result img { width: 120px; max-height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); }
.scan-sum { font-size: 15px; margin-bottom: 4px; }
.scan-vals { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.scan-vals span { color: var(--muted); }
.field input.scanned { border-color: rgba(49, 211, 154, .6); background: rgba(49, 211, 154, .06); }
.field input.scanned.approx { border-color: rgba(242, 193, 78, .7); background: rgba(242, 193, 78, .07); }
@media (max-width: 900px) { .scan-result { grid-template-columns: 84px 1fr; } .scan-result img { width: 84px; } }

/* ---------- Onboarding ---------- */
.onboarding { text-align: center; padding: 40px 20px; }
.ob-form { max-width: 560px; margin: 0 auto; text-align: left; }
.ob-done { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line2); }

/* ---------- Positionsrechner ---------- */
.pos-box { border: 1px solid rgba(90, 184, 232, .35); background: rgba(90, 184, 232, .06); border-radius: 10px; padding: 10px 12px; }
.pos-box-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pos-risk { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pos-risk input { width: 64px; height: 28px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg2); padding: 0 6px; outline: 0; }
.pos-box #posOut { font-size: 13px; color: var(--text); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.pos-lots { color: var(--accent); font-size: 15px; }
.pos-result { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line2); }
.pos-result:empty { display: none; }
.pos-result > .muted { grid-column: 1 / -1; }
.pos-big { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; text-align: center; min-width: 130px; font-variant-numeric: tabular-nums; }
.pos-big small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
@media (max-width: 900px) { .pos-result { grid-template-columns: 1fr; gap: 12px; } }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: rgba(255, 255, 255, .25); }
.chip svg { width: 14px; height: 14px; fill: var(--muted); }
.chip select { background: transparent; border: 0; outline: 0; font-weight: 600; cursor: pointer; padding-right: 2px; }
.chip select option { background: var(--bg2); }
.chip.on { border-color: var(--accent2); color: var(--accent); }

/* ---------- KPI row ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 12px 14px 14px; min-height: 92px; display: flex; flex-direction: column; }
.kpi .val { font-size: 22px; font-weight: 800; text-align: center; margin: auto 0; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.gauge { margin-top: 6px; }
.gauge .bar { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--red), var(--yellow) 50%, var(--green)); position: relative; }
.gauge .bar i { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 3px; background: #fff; transform: translateX(-50%); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }
.gauge .ticks { display: flex; justify-content: space-between; font-size: 9px; color: var(--dim); margin-top: 3px; }
.wlbar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.wlbar b { background: var(--green); }
.wlbar s { background: var(--red); }
.wlvals { display: flex; justify-content: space-between; font-size: 10px; font-weight: 600; margin-top: 3px; }

/* ---------- Insights ---------- */
.insights-meta { display: flex; justify-content: space-between; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.insights { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ins-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.ins-title svg { width: 14px; height: 14px; fill: var(--accent); }
.ins-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ins-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.ins-list li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; background: var(--accent); }
.ins-list li.good::before { background: var(--green); }
.ins-list li.bad::before { background: var(--red); }
.ins-list li.warn::before { background: var(--yellow); }
.notice { border: 1px solid rgba(242, 193, 78, .45); background: rgba(242, 193, 78, .08); color: #f5d68a; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 500; }
.collapsible[data-open="false"] .ins-body { display: none; }
.iconbtn { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); border-radius: 6px; }
.iconbtn:hover { color: var(--text); background: var(--line); }
.iconbtn svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Charts row ---------- */
.charts { display: grid; grid-template-columns: 0.9fr 1.25fr 1.25fr; gap: 12px; margin-bottom: 14px; }
.chart { width: 100%; height: 230px; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .grid { stroke: rgba(255, 255, 255, .07); }
.chart .axis-title { fill: var(--dim); font-size: 10px; font-weight: 600; }
.score-foot { display: flex; justify-content: space-between; align-items: end; margin-top: 4px; }
.score-foot b { font-size: 22px; font-weight: 800; }
.scorebar { height: 6px; border-radius: 6px; background: var(--bg2); overflow: hidden; margin-top: 6px; }
.scorebar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--red), var(--yellow), var(--green)); }

/* ---------- Bottom row ---------- */
.bottom { display: grid; grid-template-columns: 0.9fr 2.5fr; gap: 12px; }
.tabs { display: flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.tabs button { flex: 1; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: linear-gradient(180deg, #6cc6f0, #3b9bd0); color: #082032; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
th.r, td.r { text-align: right; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap.short { max-height: 380px; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.badge.long { background: var(--green-bg); color: var(--green); }
.badge.short { background: var(--red-bg); color: var(--red); }
.badge.tag { background: rgba(90, 184, 232, .12); color: var(--accent); font-weight: 600; margin-right: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- Calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-nav .month { font-weight: 700; min-width: 120px; text-align: center; }
.btn {
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2);
  background: var(--bg2); font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: rgba(255, 255, 255, .25); }
.btn.primary { background: linear-gradient(180deg, #6cc6f0, #3b9bd0); color: #062033; border-color: transparent; }
.btn.danger { color: var(--red); border-color: rgba(240, 86, 107, .4); }
.btn.wide { width: 100%; height: 38px; }
.btn.light { background: #e8edf5; color: #0d121c; border-color: transparent; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.1fr); gap: 6px; }
.cal .dow { font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 6px 8px; }
.day {
  min-height: 74px; border-radius: 9px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line);
  padding: 6px 8px; display: flex; flex-direction: column; cursor: pointer; min-width: 0;
}
.day.out { opacity: .3; }
.day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.day .d { font-weight: 700; font-size: 12px; }
.day .p { margin-top: auto; font-weight: 700; font-size: 12.5px; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.day .n { font-size: 10.5px; color: var(--muted); text-align: center; }
.day.win { background: var(--green-bg); border-color: rgba(49, 211, 154, .35); }
.day.loss { background: var(--red-bg); border-color: rgba(240, 86, 107, .35); }
.day.none .n { margin-top: auto; }
.week { border-radius: 9px; border: 1px solid var(--line); padding: 6px 8px; background: rgba(255, 255, 255, .04); display: flex; flex-direction: column; justify-content: center; font-size: 11px; min-width: 0; }
.week b { font-size: 12.5px; }

/* ---------- Pages ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: grid; gap: 12px; }
.statlist { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 13px; }
.statlist span:nth-child(odd) { color: var(--muted); }
.statlist span:nth-child(even) { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.search { height: 34px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); padding: 0 12px; min-width: 200px; outline: 0; }
.search:focus { border-color: var(--accent2); }
.hbar { display: grid; grid-template-columns: 90px 1fr 90px; gap: 10px; align-items: center; font-size: 12.5px; padding: 5px 0; }
.hbar .track { height: 8px; background: var(--bg2); border-radius: 4px; position: relative; overflow: hidden; }
.hbar .track i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.hbar .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Modal & Forms ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 8, 14, .7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { width: min(760px, 100%); max-height: 92vh; overflow: auto; background: var(--card2); border: 1px solid var(--line2); border-radius: 16px; padding: 20px; }
.modal-card h2 { margin: 0 0 14px; font-size: 18px; }
.form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.s2 { grid-column: span 2; }
.field.s4 { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  height: 38px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2);
  padding: 0 10px; outline: 0; width: 100%; min-width: 0;
}
.field textarea { height: 90px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent2); }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; height: 38px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); font-weight: 700; cursor: pointer; }
.seg button.on.long { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.seg button.on.short { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.seg button.on.neutral { background: rgba(90, 184, 232, .12); color: var(--accent); border-color: var(--accent2); }
.stars { display: flex; gap: 2px; }
.stars button { background: none; border: 0; font-size: 22px; color: var(--dim); cursor: pointer; padding: 0 2px; line-height: 1; }
.stars button.on { color: var(--yellow); }
.hint { font-size: 11.5px; color: var(--dim); }
.form-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 18px; flex-wrap: wrap; }
.form-actions > div { display: flex; gap: 8px; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; }
.shots .shot { position: relative; width: 110px; height: 70px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line2); }
.shots .shot img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.shots .shot button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.dropzone { border: 1px dashed var(--line2); border-radius: 8px; padding: 12px; text-align: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent2); color: var(--accent); }
.detail-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 14px; }
.detail-head .big { font-size: 26px; font-weight: 800; }
.detail-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; cursor: zoom-in; }
.notes { white-space: pre-wrap; background: var(--bg2); border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); font-size: 13px; }

.tooltip { position: fixed; z-index: 60; pointer-events: none; background: #0a0f18; border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #e8edf5; color: #0d121c; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 70; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); z-index: 80; display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr 1fr; }
  .charts > :first-child { grid-column: 1 / -1; }
  .bottom { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidenav { display: none; }
  main { padding: calc(12px + env(safe-area-inset-top)) 12px calc(96px + env(safe-area-inset-bottom)); }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(13, 18, 28, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center;
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--dim); padding: 4px 8px; min-width: 56px; }
  .bottomnav a svg { width: 22px; height: 22px; fill: currentColor; }
  .bottomnav a.active { color: var(--accent); }
  .fab { width: 52px; height: 52px; border-radius: 50%; border: 0; margin-top: -22px; font-size: 28px; font-weight: 400; background: linear-gradient(180deg, #6cc6f0, #3b9bd0); color: #062033; box-shadow: 0 8px 20px rgba(59, 155, 208, .4); cursor: pointer; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpis > :first-child { grid-column: 1 / -1; }
  .kpi { min-height: 84px; }
  .kpi .val { font-size: 20px; }
  .insights, .charts, .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar { padding: 12px; }
  .toolbar { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .cal .week, .cal .dow.wk { display: none; }
  .day { min-height: 54px; padding: 4px; border-radius: 7px; }
  .day .p { font-size: 10px; }
  .day .n { display: none; }
  .day.none .p { display: none; }
  .form { grid-template-columns: 1fr 1fr; }
  .field.s2 { grid-column: 1 / -1; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card { border-radius: 18px 18px 0 0; max-height: 94vh; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); }
  .search { min-width: 0; flex: 1; }
  .newsbar { padding: 12px; }
  .news-row { grid-template-columns: 10px 40px 34px minmax(0, 1fr); gap: 8px; padding: 7px 6px; }
  .news-row .fp { grid-column: 4; margin-top: -4px; }
  .news-row .n { white-space: normal; }
  .wl-layout { grid-template-columns: 1fr; }
  .wl-card { padding: 10px 4px; }
  .wl-head, .wl-row { grid-template-columns: 22px 30px minmax(0, 1fr) 76px 58px 50px; gap: 4px; }
  .wl-price .fut { display: none; }
  .wl-row { padding: 9px 6px; }
  .wl-flag { opacity: .6; }
  .wl-chg, .wl-pct { font-size: 11.5px; }
  .wl-sec-tools { opacity: 1; }
  .al-item { grid-template-columns: 70px 1fr auto; }
  .al-item .al-note { grid-column: 1 / -1; }
  .day .alflag { font-size: 9px; }
  .day .alflag svg { width: 9px; height: 9px; }
  .news-row .in { white-space: nowrap; }
  .news-list { max-height: 220px; }
  .hide-m { display: none; }
}
