:root { --bg:#f5f8f6; --panel:#fff; --ink:#18352d; --muted:#677b73; --line:#e0e8e2; --green:#137a59; --mint:#ddf1e5; --red:#b7374c; --blue:#376fa3; --coral:#ed896f; }
* { box-sizing:border-box; min-width:0; letter-spacing:0; }
[hidden] { display:none !important; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; -webkit-font-smoothing:antialiased; }
button,input,select { font:inherit; }
button { display:inline-flex; justify-content:center; align-items:center; gap:9px; cursor:pointer; transition:background .18s,border-color .18s,transform .18s; }
button:active:not(:disabled) { transform:translateY(1px); }
button:disabled { opacity:.55; cursor:not-allowed; }
button,input,select,.import-button { min-height:46px; border:1px solid var(--line); border-radius:7px; padding:11px 15px; background:var(--panel); color:var(--ink); }
button:hover:not(:disabled) { border-color:#8eb2a1; background:#f0f7f2; }
input,select { width:100%; font-size:16px; font-weight:450; }
input[type=file] { padding:8px 0; border:0; }
input[type=range] { accent-color:var(--green); padding:4px 0; border:none; background:transparent; }
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible { outline:3px solid #549ab8; outline-offset:3px; }
svg.lucide { width:20px; height:20px; flex:0 0 20px; stroke-width:1.7; }
h1,h2,h3,p { margin:0; overflow-wrap:anywhere; }
h1 { font-size:27px; line-height:1.2; font-weight:730; }
h2 { font-size:21px; line-height:1.3; font-weight:650; }
h3 { font-size:17px; font-weight:650; }
.eyebrow { color:var(--muted); font-size:11px; font-weight:650; }
.status { color:var(--muted); font-size:13px; margin:12px 0; overflow-wrap:anywhere; }
.app-shell { width:min(1120px,calc(100% - 230px)); margin:0 auto 0 max(230px,calc((100vw - 890px)/2)); padding:24px 44px 40px; }
.topbar,.brand-lockup,.header-actions,.section-header,.page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.topbar { min-height:64px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.brand-lockup { justify-content:flex-start; gap:12px; }
.brand-mark { display:grid; place-items:center; flex:0 0 39px; width:39px; height:39px; border-radius:8px; background:#153e2e; color:#d2f3b7; font-size:25px; font-weight:750; }
.icon-button { width:42px; min-height:42px; flex:0 0 42px; padding:0; background:transparent; }
.status-pill { display:inline-flex; align-items:center; gap:7px; padding:7px 11px; border:1px solid #d4e4da; border-radius:6px; background:#e9f2ec; color:#3b6650; font-size:11px; white-space:nowrap; }
.status-pill::before { content:""; width:5px; height:5px; border-radius:50%; background:#308362; }
#connection-status { font-size:11px; text-align:right; margin:10px 0 20px; min-height:17px; }
.page-heading { margin:26px 0; align-items:flex-end; }
.page-heading h2 { font-size:30px; margin-top:6px; font-weight:620; }
.primary-button,.form-card button[type=submit] { background:var(--green); color:white; border-color:var(--green); font-weight:600; }
.primary-button:hover:not(:disabled),.form-card button[type=submit]:hover:not(:disabled) { background:#115c43; color:white; border-color:#115c43; }
.primary-button { white-space:nowrap; }
.hero-panel { padding:26px 0 24px; border-block:1px solid var(--line); }
.skim-spotlight { position:relative; }
.label-with-icon { display:flex; align-items:center; gap:10px; }
.label-with-icon .eyebrow { color:#3e6e56; font-size:13px; }
.label-with-icon .icon-tile { width:31px; height:31px; flex-basis:31px; }
.micro-label { font-size:10px; padding:3px 7px; border:1px solid var(--line); border-radius:4px; color:var(--muted); }
.hero-panel h2 { font-size:49px; line-height:1.14; font-weight:550; margin:11px 0; font-variant-numeric:tabular-nums; color:#145d42; }
#skim-caption { font-size:12px; max-width:590px; color:var(--muted); }
.text-button { border:none; color:var(--green); padding:9px 0 0; background:transparent; min-height:36px; font-size:12px; }
.text-button:hover { background:transparent !important; }
.hero-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:22px; margin-top:28px; }
.hero-grid > div { border-left:1px solid var(--line); padding-left:20px; }
.hero-grid > div:first-child { border-left:none; padding-left:0; }
.hero-grid span,.row-meta span { display:block; font-size:11px; color:var(--muted); }
.hero-grid strong { display:block; font-size:22px; font-weight:550; margin-top:7px; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.risk-note { font-size:10px; color:var(--muted); margin-top:20px; }
.allocation-section { padding:30px 0 20px; border-bottom:1px solid var(--line); }
.section-header { margin-bottom:14px; }
.section-header h2 { margin-top:4px; }
.scene-controls { display:flex; align-items:center; gap:6px; }
.segmented { display:flex; gap:2px; padding:3px; border:1px solid var(--line); border-radius:7px; }
.segmented button { background:transparent; border:0; padding:6px 12px; min-height:30px; font-size:12px; border-radius:4px; }
.segmented button.selected { background:#dcecdf; color:#255d43; }
.allocation-layout { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,.8fr); align-items:center; gap:22px; }
.scene-wrap { position:relative; }
#portfolio-scene { width:100%; height:310px; touch-action:pan-y; cursor:grab; }
#portfolio-scene:active { cursor:grabbing; }
#portfolio-scene canvas { width:100%; height:100%; display:block; outline:none; }
.scene-caption { text-align:center; margin:0 0 20px; position:relative; pointer-events:none; }
.scene-caption span { display:block; color:var(--muted); font-size:11px; }
.scene-caption strong { display:block; font-size:24px; font-weight:550; margin:2px 0; }
.allocation-legend { display:grid; gap:2px; }
.allocation-legend button { display:grid; grid-template-columns:31px minmax(0,1fr) auto; width:100%; border:none; border-bottom:1px solid var(--line); border-radius:0; padding:15px 7px; background:transparent; text-align:left; gap:11px; }
.allocation-legend button[aria-pressed=true] { background:#eaf2ec; border-radius:6px; }
.coin-mark { width:31px; height:31px; border-radius:50%; display:grid; place-items:center; font-size:10px; font-weight:700; color:var(--ink); background:#dceee6; }
.asset-color-0 { background:#d7f1e2; color:#157a58; }
.asset-color-1 { background:#e1effb; color:#316d99; }
.asset-color-2 { background:#fae8de; color:#a75436; }
.asset-color-3 { background:#eeeccf; color:#797230; }
.asset-color-4 { background:#e1e3f7; color:#505e9d; }
.asset-color-5 { background:#ddeceb; color:#3c7678; }
.allocation-legend strong { display:block; font-size:13px; font-weight:600; }
.allocation-legend small { display:block; color:var(--muted); font-size:10px; }
.allocation-legend .legend-value { text-align:right; }
.quick-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:26px 0; }
.quick-actions > button { justify-content:flex-start; text-align:left; padding:18px 12px; background:#fff; gap:10px; }
.quick-actions > button > svg:last-child { width:14px; flex-basis:14px; margin-left:auto; color:var(--muted); }
.quick-actions strong { display:block; font-size:12px; font-weight:600; }
.quick-actions small { display:block; color:var(--muted); font-size:10px; margin-top:3px; }
.icon-tile { display:inline-flex; justify-content:center; align-items:center; width:40px; height:40px; flex:0 0 40px; border-radius:8px; background:#e1eedf; color:#296b4a; }
.icon-tile.blue { background:#e4eef7; color:#427591; }
.icon-tile.coral { background:#f7e5dc; color:#af7155; }
.notice { display:flex; align-items:center; gap:14px; justify-content:space-between; padding:18px 0; margin:14px 0; border-block:1px solid var(--line); }
.notice > div { flex:1; }
.notice strong { font-size:13px; }
.notice p { color:var(--muted); font-size:12px; }
.notice button { flex-shrink:0; }
.tabs { position:fixed; top:0; bottom:0; left:0; width:214px; background:#eef3ee; border-right:1px solid var(--line); padding:32px 18px; display:flex; flex-direction:column; gap:6px; z-index:5; }
.nav-brand { display:flex; align-items:center; gap:10px; padding:0 10px 34px; font-size:20px; }
.tabs > button { border:none; background:transparent; justify-content:flex-start; gap:13px; padding:13px 17px; min-height:49px; font-size:13px; color:#738378; }
.tabs > button.active { background:#dce9dd; color:#235e40; font-weight:650; }
.nav-foot { margin-top:auto; border-top:1px solid var(--line); padding:20px 10px 0; color:#718879; font-size:10px; }
.nav-foot svg { margin-bottom:8px; }
.tab-panel { display:none; }
.tab-panel.active { display:block; animation:enter-panel .22s ease; }
@keyframes enter-panel { from { opacity:.45; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
.form-card { display:grid; gap:18px; border:1px solid var(--line); border-radius:8px; background:var(--panel); padding:26px; margin:20px 0; }
.form-card p { color:var(--muted); font-size:12px; }
label { display:grid; gap:7px; font-size:12px; font-weight:600; color:#5d7467; }
.field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:16px; }
.section-heading { margin:28px 0 17px; }
.section-heading p { font-size:12px; color:var(--muted); margin-top:7px; }
.list { display:grid; gap:12px; }
.list-row { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; border-bottom:1px solid var(--line); padding:22px 0; }
.list-row > div:first-child { flex:1; }
.list-row p { color:var(--muted); font-size:12px; margin-top:5px; }
.list-row h3 { margin-bottom:6px; }
.row-meta { text-align:right; flex:0 1 170px; }
.row-meta strong { display:block; font-size:23px; font-weight:550; margin-top:5px; overflow-wrap:anywhere; }
.row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:16px; }
.row-actions button { font-size:12px; min-height:40px; }
.metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; margin:24px 0; padding:24px 0; border-block:1px solid var(--line); }
.metric-grid dt { font-size:12px; color:var(--muted); }
.metric-grid dd { font-size:28px; font-weight:550; margin:7px 0 0; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.metric-grid dl { margin:0; }
output { display:block; overflow-wrap:anywhere; }
output p { margin:6px 0; }
details { margin:20px 0; }
summary { cursor:pointer; padding:12px 0; font-weight:600; }
.history-detail { white-space:pre-wrap; font-size:11px; overflow-wrap:anywhere; }
#cash-list,#asset-summary,#reconcile-list,#backup-list { margin:16px 0 24px; }
#health-details p { margin:8px 0; font-size:12px; }
.profit { color:var(--green); }
.loss { color:var(--red); }
.empty-state { padding:28px 18px; color:var(--muted); text-align:center; border:1px dashed #d1ded3; border-radius:6px; font-size:13px; }
.warning { color:#805028; background:#fff6e4; padding:16px; margin:16px 0; border-left:3px solid #cca14d; font-size:13px; }
.danger-zone { display:flex; align-items:center; flex-wrap:wrap; gap:14px; margin-top:20px; }
.import-button { display:grid; width:min(100%,300px); }
.toast { position:fixed; left:16px; right:16px; bottom:calc(22px + env(safe-area-inset-bottom)); max-width:620px; margin:auto; background:#203e32; color:white; padding:17px 20px; border-radius:8px; z-index:50; font-size:13px; overflow-wrap:anywhere; box-shadow:0 8px 35px #18352d1a; }
.entry-dialog { width:min(520px,calc(100% - 28px)); max-height:calc(100dvh - 36px); border:1px solid var(--line); border-radius:8px; padding:0; color:var(--ink); background:#fff; }
.entry-dialog::backdrop { background:#18352d70; backdrop-filter:blur(5px); }
.entry-dialog .form-card { border:0; margin:0; border-radius:0; padding-top:12px; }
.dialog-top { position:sticky; top:0; z-index:2; display:flex; justify-content:space-between; align-items:center; padding:16px 24px 6px; background:#fff; }
.settings-section { padding:25px 0; border-block:1px solid var(--line); margin:20px 0; }
.switch { display:inline-flex; flex:0 0 46px; align-items:center; cursor:pointer; position:relative; width:46px; height:28px; }
.switch input { position:absolute; opacity:0; width:46px; height:28px; margin:0; min-height:0; }
.switch span { display:block; width:46px; height:28px; background:#ccd7ce; border-radius:16px; transition:background .18s; }
.switch span::after { content:""; display:block; height:22px; width:22px; margin:3px; background:#fff; border-radius:50%; box-shadow:0 1px 3px #0002; transition:transform .18s; }
.switch input:checked + span { background:var(--green); }
.switch input:checked + span::after { transform:translateX(18px); }
.switch input:focus-visible + span { outline:3px solid #549ab8; outline-offset:3px; }
#practice-banner { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 16px; margin:14px 0; background:#e6eefb; border-left:3px solid #5486c7; color:#315a83; font-size:12px; }
#practice-banner button { min-height:36px; font-size:11px; padding:7px 10px; }
.practice-controls { padding:20px 0; border-bottom:1px solid var(--line); }
.practice-controls output { color:var(--blue); font-size:27px; }
.practice-controls p { margin-top:12px; font-size:11px; color:var(--muted); }
footer { margin:30px 0 10px; color:var(--muted); font-size:10px; }
a { color:var(--blue); }
@media(min-width:1400px) { .app-shell { margin-left:calc(230px + (100vw - 1350px)/2); } }
@media(max-width:1100px) { .app-shell { margin-left:200px; width:calc(100% - 200px); padding-inline:26px; } .tabs { width:185px; padding-inline:11px; } .quick-actions { grid-template-columns:1fr; } .quick-actions > button { padding:16px; } }
@media(max-width:760px) {
  .app-shell { margin:0 auto; width:100%; padding: max(14px,env(safe-area-inset-top)) 21px calc(100px + env(safe-area-inset-bottom)); }
  .topbar { min-height:62px; padding-bottom:14px; } h1 { font-size:24px; } .brand-lockup { gap:10px; } .brand-lockup .eyebrow { font-size:9px; } .header-actions { gap:7px; } .status-pill { font-size:9px; padding:6px 8px; } .brand-mark { width:34px; height:34px; flex-basis:34px; font-size:23px; }
  #connection-status { font-size:10px; margin-bottom:18px; text-align:left; }
  .page-heading { margin:21px 0; gap:10px; } .page-heading h2 { font-size:27px; } .page-heading .primary-button { padding:10px; min-height:43px; font-size:11px; gap:5px; } .page-heading .primary-button svg { width:15px; flex-basis:15px; }
  .hero-panel { padding:22px 0; } .hero-panel h2 { font-size:43px; } .hero-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px 16px; } .hero-grid > div { padding-left:0; border:0; } .hero-grid strong { font-size:24px; margin-top:4px; } .hero-grid span { font-size:10px; }
  .allocation-layout { grid-template-columns:1fr; gap:0; } .allocation-section { padding-top:24px; } #portfolio-scene { height:280px; } .scene-caption { margin-top:-12px; } .section-header h2 { font-size:19px; } .scene-controls { gap:2px; } .scene-controls .icon-button { width:33px; flex-basis:33px; min-height:34px; } .scene-controls .icon-button svg { width:17px; height:17px; } .segmented button { padding-inline:9px; }
  .allocation-legend { grid-template-columns:1fr; } .allocation-legend button { padding:13px 5px; } .quick-actions { grid-template-columns:1fr; gap:9px; } .quick-actions > button { padding:15px; } .quick-actions strong { font-size:13px; }
  .tabs { inset:auto 0 0; width:100%; padding:9px 7px calc(9px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:0; border:0; border-top:1px solid var(--line); background:#fbfdfcf2; backdrop-filter:blur(14px); }
  .tabs > button { flex-direction:column; gap:5px; padding:6px 0; min-height:49px; font-size:9px; border-radius:6px; justify-content:center; } .tabs > button svg { width:20px; height:20px; } .nav-brand,.nav-foot { display:none; }
  .field-grid { grid-template-columns:1fr; } .form-card { padding:21px; gap:17px; } .form-card h2 { font-size:20px; } .form-card p { font-size:12px; }
  .list-row { gap:12px; } .row-meta { flex-basis:116px; } .row-meta strong { font-size:21px; } .row-meta span { font-size:10px; }
  .notice { flex-wrap:wrap; gap:11px; } .notice .icon-tile { width:32px; height:32px; flex-basis:32px; } .notice > p { flex-basis:100%; }
  .metric-grid { gap:24px 18px; } .metric-grid dd { font-size:25px; } .metric-grid dt { font-size:11px; }
  .toast { bottom:calc(83px + env(safe-area-inset-bottom)); } .entry-dialog { max-height:calc(100dvh - 18px); width:calc(100% - 16px); } .dialog-top { padding-inline:21px; }
  #practice-banner { flex-wrap:wrap; } .settings-section > .section-header { align-items:flex-start; flex-wrap:wrap; } .settings-section .switch { margin-left:auto; }
}
@media(max-width:700px) { .header-actions .status-pill { display:none; } .header-actions { flex:0 0 auto; } .brand-lockup h1 { white-space:nowrap; } .scene-caption { margin-top:0; } }
@media(max-width:360px) { .app-shell { padding-inline:16px; } .header-actions .status-pill { display:none; } .page-heading h2 { font-size:24px; } .list-row { flex-direction:column; } .row-meta { flex-basis:auto; text-align:left; } .scene-controls .icon-button { width:29px; flex-basis:29px; } .allocation-section .section-header { gap:7px; } #portfolio-scene { height:255px; } .section-header h2 { font-size:17px; } .eyebrow { font-size:9px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; animation:none !important; scroll-behavior:auto !important; } }
