:root {
  color-scheme: dark;
  --bg: #0d1512;
  --card: rgba(26, 39, 34, .88);
  --card-2: #1f2d27;
  --line: rgba(205, 233, 217, .1);
  --text: #f4f7f5;
  --muted: #91a29a;
  --lime: #b9f46d;
  --mint: #72dbad;
  --red: #ff8f87;
  --gold: #f1c86a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
.ambient { position: fixed; inset: -20% 0 auto; height: 420px; background: radial-gradient(circle at 80% 20%, rgba(85,168,115,.2), transparent 44%), radial-gradient(circle at 0 0, rgba(185,244,109,.12), transparent 38%); pointer-events: none; }
.shell { position: relative; max-width: 680px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.eyebrow { margin: 0 0 5px; color: var(--lime); font-size: 10px; letter-spacing: .15em; font-weight: 800; }
h1 { margin: 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; letter-spacing: -.02em; }
h1 span { color: var(--muted); }
.icon-button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 50%; width: 44px; height: 44px; font-size: 23px; cursor: pointer; }
.icon-button.loading { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card { background: linear-gradient(145deg, rgba(34,51,43,.96), rgba(21,33,28,.95)); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.hero { padding: 22px 20px 16px; overflow: hidden; }
.hero-head { display: flex; align-items: flex-start; justify-content: space-between; }
.muted { color: var(--muted); margin: 0 0 7px; font-size: 13px; }
.hero-value { font-family: Georgia, serif; font-size: 37px; letter-spacing: -.03em; }
.status-pill { padding: 6px 9px; border-radius: 8px; background: rgba(185,244,109,.12); color: var(--lime); font-weight: 800; font-size: 10px; letter-spacing: .08em; }
.delta { color: var(--muted); font-size: 12px; margin: 7px 0 5px; }
.delta.positive { color: var(--mint); } .delta.negative { color: var(--red); }
.data-warning { display: none; margin: 11px 0 3px; padding: 8px 10px; border: 1px solid rgba(255,143,135,.25); border-radius: 9px; color: var(--red); background: rgba(255,143,135,.08); font-size: 11px; }
.data-warning.show { display: block; }
.chart { width: calc(100% + 40px); height: 116px; margin: 4px -20px 0; display: block; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.summary-grid div { display: flex; flex-direction: column; gap: 5px; }
.summary-grid span, .forecast span { color: var(--muted); font-size: 11px; }
.summary-grid strong { font-size: 14px; }
.tabs { position: sticky; top: env(safe-area-inset-top); z-index: 5; display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 18px 0; padding: 5px; background: rgba(15,24,20,.9); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 14px; }
.tab { padding: 10px 4px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 700; }
.tab.active { background: var(--card-2); color: var(--text); }
.panel { display: none; }.panel.active { display: block; animation: rise .2s ease-out; }
@keyframes rise { from { opacity: .5; transform: translateY(4px); } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.section-title.lower { margin-top: 24px; }
.section-title h2 { margin: 0; font-size: 17px; }
.section-title span { color: var(--muted); font-size: 11px; }
.asset-filters { display: flex; gap: 7px; margin: 0 0 12px; padding: 1px 1px 5px; overflow-x: auto; scrollbar-width: none; }
.asset-filters::-webkit-scrollbar { display: none; }
.asset-filter { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(28,42,35,.52); color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.asset-filter span { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: rgba(255,255,255,.07); font-size: 9px; }
.asset-filter.active { border-color: rgba(185,244,109,.32); background: rgba(185,244,109,.12); color: var(--text); }
.asset-filter.all.active { background: var(--lime); color: #172018; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(28,42,35,.72); }
.row-head, .row-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-head strong { font-size: 14px; }.row-head .value { font-size: 14px; white-space: nowrap; }
.row-meta { margin-top: 7px; color: var(--muted); font-size: 11px; }
.positive { color: var(--mint); }.negative { color: var(--red); }.warning { color: var(--gold); }
.tag { padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,.06); text-transform: uppercase; font-size: 9px; }
.protection-range { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 14px; margin: 7px 0 2px; padding: 0; border: 0; background: transparent; pointer-events: none; opacity: 1; }
.protection-range::-webkit-slider-runnable-track { height: 4px; border: 0; border-radius: 3px; background: linear-gradient(90deg, var(--red), var(--gold) 48%, var(--mint)); opacity: .85; }
.protection-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 0; border-radius: 50%; background: #e7edeb; box-shadow: 0 0 0 4px rgba(231,237,235,.14); }
.protection-range::-moz-range-track { height: 4px; border: 0; border-radius: 3px; background: linear-gradient(90deg, var(--red), var(--gold) 48%, var(--mint)); opacity: .85; }
.protection-range::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #e7edeb; box-shadow: 0 0 0 4px rgba(231,237,235,.14); }
.compact { padding: 16px; margin-bottom: 10px; }
.forecast { display: flex; justify-content: space-between; align-items: center; }.forecast strong { font-family: Georgia, serif; font-size: 22px; }
.health { display: flex; gap: 11px; align-items: center; }.health p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.health-dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(241,200,106,.1); }.health-dot.ok { background: var(--mint); box-shadow: 0 0 0 5px rgba(114,219,173,.1); }
.decision-card { padding: 15px; }
.decision-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.decision-head > div { min-width: 0; }
.decision-kind { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.decision-head strong { display: block; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.decision-head time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.decision-status { display: inline-flex; margin-top: 10px; padding: 4px 7px; border-radius: 7px; background: rgba(114,219,173,.1); color: var(--mint); font-size: 10px; font-weight: 700; }
.decision-status.attention { background: rgba(255,143,135,.1); color: var(--red); }
.decision-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-top: 11px; }
.decision-metric { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.08); }
.decision-metric span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.decision-metric strong { font-size: 12px; }
.decision-summary { margin: 11px 0 0; color: #bec9c3; font-size: 11px; line-height: 1.45; }
.decision-reasons { margin-top: 10px; color: var(--muted); font-size: 10px; }
.decision-reasons summary { cursor: pointer; color: #b8c4be; font-weight: 700; }
.decision-reasons ul { margin: 8px 0 0; padding-left: 17px; }
.decision-reasons li { margin: 0 0 6px; line-height: 1.4; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; font-size: 13px; }
.error-toast { display: none; position: fixed; z-index: 10; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: 648px; margin: auto; padding: 13px 15px; border-radius: 13px; color: #25100f; background: #ffb3ad; font-size: 13px; box-shadow: 0 12px 35px rgba(0,0,0,.35); }
.error-toast.show { display: block; }
footer { text-align: center; color: #65746d; font-size: 10px; line-height: 1.5; margin: 30px 20px 0; }
@media (min-width: 600px) { .shell { padding-left: 24px; padding-right: 24px; } }
