body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: #0a0807; }
.fbar { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-bottom: 1px solid var(--line); background: #0d0a09; }
.namebox { width: 90px; height: 26px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 6px; background: rgba(0,0,0,.4); font: 13px ui-monospace, monospace; outline: none; }
.fx { font: italic 600 13px Georgia, serif; color: var(--faint); padding: 0 4px; border-left: 1px solid var(--line2); border-right: 1px solid var(--line2); }
.formula { flex: 1; height: 28px; border: 0; background: none; outline: none; font: 13.5px ui-monospace, monospace; }
.gridwrap { position: relative; flex: 1; overflow: auto; outline: none; background: #0f0c0b; }
table.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; user-select: none; -webkit-user-select: none; }
.grid th { position: sticky; top: 0; z-index: 2; height: 24px; background: #17110f; color: var(--muted); font: 500 11.5px var(--sans); border-right: 1px solid #2a201d; border-bottom: 1px solid #2a201d; text-align: center; padding: 0; }
.grid th.rh { position: sticky; left: 0; z-index: 1; width: 46px; }
.grid th.corner { left: 0; z-index: 3; }
.grid th.hl { background: #2a1712; color: #ffb8a6; }
.grid th .rs { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 4; }
.grid td { height: 24px; padding: 0 6px; border-right: 1px solid #221a18; border-bottom: 1px solid #221a18; white-space: nowrap; overflow: hidden; text-overflow: clip; background: #0f0c0b; color: #efe6e2; }
.grid td.n { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.b { text-align: center; }
.grid td.err { color: #ff8b78; }
.selbox { position: absolute; pointer-events: none; background: rgba(255,122,26,.10); border: 1px solid rgba(255,122,26,.7); z-index: 1; display: none; }
.cur { position: absolute; pointer-events: none; border: 2px solid #ff7a1a; z-index: 1; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.cell-editor { position: absolute; z-index: 5; height: 24px; padding: 0 5px; border: 2px solid #ff7a1a; background: #1a1210; color: var(--text); font: 13px var(--sans); outline: none; box-shadow: 0 6px 20px rgba(0,0,0,.6); }
.sbar { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px; border-top: 1px solid var(--line); background: #0b0807; }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tabs button { height: 28px; padding: 0 14px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { background: rgba(255,236,228,.06); color: var(--text); }
.tabs button.on { background: rgba(226,54,31,.18); color: #ffd6cc; font-weight: 600; }
.sbar .grow { flex: 1; }
.stats { font-size: 12px; color: var(--muted); padding-right: 8px; }
.toolbar .tbtn { min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: none; cursor: pointer; display: inline-grid; place-items: center; font-weight: 600; }
.toolbar .tbtn:hover { background: rgba(255,236,228,.08); }
.toolbar .tbtn.on { background: rgba(226,54,31,.2); color: #ffc0b2; }
.toolbar .tbtn svg { width: 17px; height: 17px; }
.toolbar select.fmt { width: 112px; }
.chart svg { width: 100%; height: auto; display: block; background: #0f0b0a; border-radius: 10px; border: 1px solid var(--line); }
.chart .seg { display: flex; gap: 6px; margin: 10px 0; }
