:root{--bg:#f5f6f8;--surface:#fff;--surface-2:#eef0f3;--border:#e1e4e9;--grid:#eceef2;--text:#121620;--muted:#687080;--accent:#2f6bff;--accent-ink:#fff;--line-green:#06c755;--up:#12a36b;--down:#e0435a;--up-rgb:18 163 107;--down-rgb:224 67 90;--neutral-rgb:120 130 145;--warn-bg:#fff5e0;--warn-ink:#7a4b00;--err-bg:#ffe9ec;--err-ink:#9b1b30;--ok-bg:#e4f7ee;--ok-ink:#0d6b45;--shadow:0 1px 2px #1018280f, 0 1px 3px #1018280a;--radius:14px;--font:"IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;--mono:"IBM Plex Mono", ui-monospace, monospace;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--bg:#0b0f14;--surface:#131922;--surface-2:#1b2330;--border:#232d3b;--grid:#1a222d;--text:#e8ecf2;--muted:#8b95a5;--accent:#5b8cff;--up:#2fc48a;--down:#ff5c74;--up-rgb:47 196 138;--down-rgb:255 92 116;--neutral-rgb:120 132 150;--warn-bg:#2d2410;--warn-ink:#f3c46b;--err-bg:#331820;--err-ink:#ff9aa9;--ok-bg:#10291f;--ok-ink:#7be0b3;--shadow:none;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}:root[data-theme=dark]{--bg:#0b0f14;--surface:#131922;--surface-2:#1b2330;--border:#232d3b;--grid:#1a222d;--text:#e8ecf2;--muted:#8b95a5;--accent:#5b8cff;--up:#2fc48a;--down:#ff5c74;--up-rgb:47 196 138;--down-rgb:255 92 116;--neutral-rgb:120 132 150;--warn-bg:#2d2410;--warn-ink:#f3c46b;--err-bg:#331820;--err-ink:#ff9aa9;--ok-bg:#10291f;--ok-ink:#7be0b3;--shadow:none;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body{background:var(--bg);color:var(--text);font-family:var(--font);-webkit-text-size-adjust:100%;margin:0;font-size:15px;line-height:1.5}body{overflow-x:hidden}h1{margin:4px 0 12px;font-size:1.35rem;font-weight:600}h2{margin:0;font-size:1.05rem;font-weight:600}h3{margin:18px 0 8px;font-size:.95rem;font-weight:600}p{margin:6px 0}a{color:var(--accent)}button,input,select{font:inherit;color:inherit}.num{font-family:var(--mono);font-variant-numeric:tabular-nums;letter-spacing:-.01em}.muted{color:var(--muted)}.small{font-size:.82rem}.center{text-align:center}.pos{color:var(--up)}.neg{color:var(--down)}.pre{white-space:pre-line}.pad{padding:12px}hr{border:0;border-top:1px solid var(--border);margin:16px 0}.app{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));flex-direction:column;display:flex}.topbar{z-index:20;background:color-mix(in srgb, var(--bg) 88%, transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:10px 16px;display:flex;position:sticky;top:0}.brand{color:var(--text);align-items:center;gap:8px;font-weight:600;text-decoration:none;display:flex}.brand-mark{color:var(--line-green);font-size:1.2rem}main{flex:1;width:100%;max-width:760px;margin:0 auto}.page{flex-direction:column;gap:12px;padding:12px 16px 96px;display:flex}.tabbar{z-index:20;background:var(--surface);border-top:1px solid var(--border);padding-bottom:env(safe-area-inset-bottom);grid-template-columns:repeat(4,1fr);display:grid;position:fixed;bottom:0;left:0;right:0}.tabbar a{color:var(--muted);flex-direction:column;align-items:center;gap:2px;padding:8px 0 6px;font-size:.72rem;text-decoration:none;display:flex}.tabbar a.on{color:var(--accent)}.icon-btn{cursor:pointer;color:var(--muted);background:0 0;border:0;border-radius:10px;padding:6px;font-size:1.1rem;line-height:0}.icon-btn:hover,.icon-btn.on{color:var(--text);background:var(--surface-2)}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);flex-direction:column;gap:10px;min-width:0;padding:14px;display:flex}.section-head{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;display:flex}.btn{border:1px solid var(--border);background:var(--surface);cursor:pointer;border-radius:10px;min-height:40px;padding:9px 14px;font-weight:500}.btn:hover{background:var(--surface-2)}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.btn.primary:hover{filter:brightness(1.06)}.btn.danger{background:var(--down);border-color:var(--down);color:#fff}.btn.ghost{background:0 0;border-color:#0000}.btn.small{min-height:32px;padding:5px 10px;font-size:.85rem}.btn.wide{width:100%}.danger-text{color:var(--down)}.link{font-weight:500;text-decoration:none}.row-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:8px;display:flex}.banner{background:var(--surface-2);border-radius:10px;padding:9px 12px;font-size:.85rem}.banner.warn{background:var(--warn-bg);color:var(--warn-ink)}.banner.err{background:var(--err-bg);color:var(--err-ink)}.banner.ok{background:var(--ok-bg);color:var(--ok-ink)}.banner.demo{background:var(--warn-bg);color:var(--warn-ink);text-align:center;margin:8px 16px 0;font-weight:500}.source{color:var(--muted);margin:0;font-size:.74rem}.tag{background:var(--surface-2);color:var(--muted);border-radius:6px;margin-left:4px;padding:1px 6px;font-size:.68rem;font-style:normal}.segmented{background:var(--surface-2);border-radius:10px;gap:2px;max-width:100%;padding:3px;display:inline-flex;overflow-x:auto}.segmented button{cursor:pointer;white-space:nowrap;color:var(--muted);background:0 0;border:0;border-radius:8px;padding:5px 10px;font-size:.82rem}.segmented button.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow);font-weight:500}.chips{gap:6px;display:flex}.scroll-x{scrollbar-width:none;padding-bottom:2px;overflow-x:auto}.scroll-x::-webkit-scrollbar{display:none}.chip{border:1px solid var(--border);background:var(--surface);cursor:pointer;white-space:nowrap;color:var(--muted);border-radius:999px;padding:4px 10px;font-size:.8rem}.chip.on{background:var(--text);border-color:var(--text);color:var(--bg)}.search{border:1px solid var(--border);background:var(--surface);border-radius:10px;width:100%;padding:10px 12px}.search:focus,.field input:focus,.field select:focus{outline:2px solid color-mix(in srgb, var(--accent) 50%, transparent);outline-offset:0}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.state{text-align:center;color:var(--muted);flex-direction:column;align-items:center;gap:8px;padding:48px 16px;display:flex}.state-title{color:var(--text);font-weight:600}.empty-mark{color:var(--border);font-size:2.2rem}.spinner{border:3px solid var(--surface-2);border-top-color:var(--accent);border-radius:50%;width:28px;height:28px;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.skeleton{background:linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2));background-size:200% 100%;border-radius:8px;animation:1.2s infinite shimmer}@keyframes shimmer{to{background-position:-200% 0}}.form-grid{grid-template-columns:1fr 1fr;gap:10px;display:grid}.field{color:var(--muted);flex-direction:column;gap:4px;min-width:0;font-size:.8rem;display:flex}.field.span2{grid-column:span 2}.field input,.field select{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:9px;width:100%;min-width:0;padding:9px 10px;font-size:.95rem}.field.attn input,.field.attn select{border-color:var(--down);background:var(--err-bg)}.field.inline{flex-direction:row;align-items:center;gap:8px}.field.inline input,.field.inline select{width:auto;padding:6px 8px}.check{align-items:center;gap:6px;display:flex}.kv{grid-template-columns:1fr;margin:0;display:grid}.kv>div{border-bottom:1px dashed var(--border);justify-content:space-between;gap:12px;padding:7px 0;display:flex}.kv dt{color:var(--muted);font-size:.85rem}.kv dd{text-align:right;word-break:break-word;margin:0}.table-wrap{overflow-x:auto}.table{border-collapse:collapse;width:100%;font-size:.85rem}.table td,.table th{border-bottom:1px solid var(--border);text-align:left;padding:6px 4px}.table td.num{text-align:right}.table tr.bad td{background:var(--err-bg)}.sheet-backdrop{z-index:50;background:#00000073;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.sheet{background:var(--surface);border-radius:18px 18px 0 0;flex-direction:column;width:100%;max-width:640px;max-height:92dvh;animation:.18s ease-out up;display:flex}@keyframes up{0%{opacity:.6;transform:translateY(30px)}}.sheet-head{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:14px 16px 8px;display:flex}.sheet-body{padding:12px 16px calc(20px + env(safe-area-inset-bottom));overflow-y:auto}@media (min-width:700px){.sheet-backdrop{align-items:center}.sheet{border-radius:18px}}.connect{text-align:center;align-items:center;gap:8px;margin:16px;padding:28px 20px}.connect-icon{color:var(--accent)}.connect p{max-width:420px}.hero{flex-direction:column;align-items:flex-start;padding:4px 2px;display:flex}.hero-value{font-size:2rem;font-weight:500;line-height:1.15}.hero-value small{color:var(--muted);font-size:.9rem}.alloc{align-items:stretch}.alloc-head{justify-content:space-between;display:flex}.crumbs{flex-wrap:wrap;gap:4px;display:flex}.crumbs button{color:var(--muted);cursor:pointer;background:0 0;border:0;padding:2px 4px;font-size:.85rem}.crumbs button.on{color:var(--text);font-weight:600}.donut{aspect-ratio:1;width:100%;margin:4px auto;position:relative}.donut svg{width:100%;height:100%;display:block}.donut-seg{cursor:pointer;outline:none;transition:stroke-width .15s}.donut-center{pointer-events:none;text-align:center;flex-direction:column;justify-content:center;align-items:center;padding:0 22%;display:flex;position:absolute;inset:0}.donut-top{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;max-width:100%;font-size:.8rem;overflow:hidden}.donut-main{font-size:1.6rem;font-weight:500}.donut-sub{color:var(--muted);font-size:.8rem}.legend{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.legend button{border:0;border-bottom:1px solid var(--border);cursor:pointer;text-align:left;background:0 0;grid-template-columns:12px 1fr auto 64px;align-items:center;gap:10px;width:100%;padding:8px 2px;display:grid}.legend li:last-child button{border-bottom:0}.legend i{border-radius:4px;width:12px;height:12px}.legend-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.legend .num{text-align:right}.stats{grid-template-columns:1fr 1fr;gap:8px;display:grid}.stat{background:var(--surface);border:1px solid var(--border);border-radius:12px;flex-direction:column;min-width:0;padding:10px 12px;display:flex}.stat-label{color:var(--muted);font-size:.75rem}.stat-value{overflow-wrap:anywhere;font-size:1rem}.holdings{margin:0;padding:0;list-style:none}.holdings li>button,.holdings li.cash-row{border:0;border-bottom:1px solid var(--border);cursor:pointer;text-align:left;background:0 0;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:10px 2px;display:flex}.h-main{flex-direction:column;min-width:0;display:flex}.h-main span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.h-num{flex-direction:column;align-items:flex-end;display:flex}.fab{right:18px;bottom:calc(78px + env(safe-area-inset-bottom));background:var(--accent);color:#fff;cursor:pointer;z-index:15;border:0;border-radius:50%;width:52px;height:52px;font-size:1.6rem;position:fixed;box-shadow:0 6px 16px #00000040}.indices{grid-template-columns:repeat(2,1fr);gap:8px;display:grid}.index-card{border:1px solid var(--border);background:var(--surface);cursor:pointer;text-align:left;border-radius:12px;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;padding:10px 12px;display:flex}.index-changes{flex-wrap:wrap;gap:8px;display:flex}.heatmap{flex-direction:column;gap:3px;font-size:.82rem;display:flex}.hm-row{text-align:left;cursor:pointer;background:0 0;border:0;grid-template-columns:minmax(96px,1.6fr) repeat(5,minmax(44px,1fr));align-items:stretch;gap:3px;width:100%;padding:0;display:grid}.hm-head{cursor:default;color:var(--muted);font-size:.75rem}.hm-head button{cursor:pointer;color:var(--muted);background:0 0;border:0;padding:4px 0;font-size:.75rem}.hm-head button.on{color:var(--text);font-weight:600}.hm-name{align-items:center;gap:6px;min-width:0;padding:6px 4px 6px 0;line-height:1.2;display:flex;overflow:hidden}.hm-name>span:last-child{text-overflow:ellipsis;overflow:hidden}.rank{color:var(--muted);flex:none;width:16px;font-size:.72rem}.hm-cell{border-radius:6px;justify-content:center;align-items:center;padding:8px 2px;font-size:.78rem;display:flex}.hm-row:not(.hm-head):hover .hm-name{color:var(--accent)}.rotation{gap:3px;font-size:.78rem;display:grid;overflow-x:auto}.rot-head{text-align:center}.rot-label{white-space:nowrap;align-items:center;padding-right:4px;display:flex}.rot-cell{text-align:center;background:var(--surface-2);border-radius:5px;padding:4px 0}.search-box{position:relative}.search-results{z-index:30;background:var(--surface);border:1px solid var(--border);border-radius:12px;margin:0;padding:4px;list-style:none;position:absolute;top:calc(100% + 4px);left:0;right:0;box-shadow:0 8px 24px #00000026}.search-results button{text-align:left;cursor:pointer;background:0 0;border:0;border-radius:8px;width:100%;padding:8px}.search-results button:hover{background:var(--surface-2)}.chart-card{padding:12px 10px}.chart-card:fullscreen{background:var(--bg);padding:16px}.chart-head{justify-content:space-between;align-items:flex-start;padding:0 4px;display:flex}.chart{width:100%}.filters{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.filters select{border:1px solid var(--border);background:var(--surface);border-radius:9px;max-width:48%;padding:6px 8px}.tx-list{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin:0;padding:0;list-style:none;overflow:hidden}.tx-list li>button{border:0;border-bottom:1px solid var(--border);text-align:left;cursor:pointer;background:0 0;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;width:100%;padding:10px 12px;display:grid}.tx-list li:last-child>button{border-bottom:0}.tx-list li.inactive{opacity:.55}.tx-main{flex-direction:column;min-width:0;display:flex}.tx-main span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.tx-type{background:var(--surface-2);white-space:nowrap;border-radius:6px;padding:2px 7px;font-size:.7rem}.t-buy,.t-deposit,.t-dividend,.t-opening_position{color:var(--up);background:rgb(var(--up-rgb) / .12)}.t-sell,.t-withdrawal,.t-fee,.t-withholding_tax{color:var(--down);background:rgb(var(--down-rgb) / .12)}.tx-num{text-align:right;font-size:.85rem}.chain{color:var(--muted);margin:0;padding-left:18px;font-size:.85rem}.chain li.on{color:var(--text);font-weight:600}.service{border:1px solid var(--border);border-radius:12px;flex-direction:column;gap:4px;padding:12px;display:flex}.service.disabled{opacity:.55}.service-head{justify-content:space-between;align-items:center;gap:8px;display:flex}.status{background:var(--surface-2);color:var(--muted);white-space:nowrap;border-radius:999px;padding:2px 8px;font-size:.75rem}.s-connected{background:var(--ok-bg);color:var(--ok-ink)}.s-expired,.s-error{background:var(--err-bg);color:var(--err-ink)}.ownership summary{cursor:pointer;font-weight:500}@media (min-width:640px){.stats{grid-template-columns:repeat(3,1fr)}.indices{grid-template-columns:repeat(4,1fr)}.hero-value{font-size:2.4rem}.donut{max-width:340px!important}}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.spark{width:100%;height:36px;margin-top:4px;display:block}.bars{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.bars button{border:0;border-bottom:1px solid var(--border);cursor:pointer;text-align:left;background:0 0;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) 58px;align-items:center;gap:10px;width:100%;padding:7px 0;display:grid}.bars li:last-child button{border-bottom:0}.bars button:hover .bar-name{color:var(--accent)}.bar-name{text-overflow:ellipsis;white-space:nowrap;font-size:.9rem;overflow:hidden}.bar-track{height:16px;position:relative}.bar-zero{background:var(--border);width:1px;position:absolute;top:-3px;bottom:-3px;left:50%}.bar-fill{border-radius:3px;min-width:2px;position:absolute;top:0;bottom:0}.bar-val{text-align:right;font-size:.85rem}.movers{grid-template-columns:1fr;gap:4px;display:grid}.movers h3{color:var(--muted);margin:6px 0 2px;font-size:.85rem;font-weight:500}.mover-list{margin:0;padding:0;list-style:none}.mover-list button{border:0;border-bottom:1px solid var(--border);cursor:pointer;text-align:left;background:0 0;grid-template-columns:30px 1fr auto;align-items:center;gap:10px;width:100%;padding:8px 0;display:grid}.mover-list li:last-child button{border-bottom:0}.mover-rank{background:var(--surface-2);border-radius:8px;justify-content:center;align-items:center;width:28px;height:28px;font-size:.85rem;display:flex}.mover-name{flex-direction:column;min-width:0;line-height:1.3;display:flex}.mover-sub{margin-top:1px}.mover-delta{white-space:nowrap;font-size:.9rem}@media (min-width:640px){.movers{grid-template-columns:1fr 1fr;gap:16px}}
