.sheetlite-shell { gap: 10px; }
.sheetlite-topbar {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(280px, 1fr);
    gap: 10px;
    align-items: end;
}
.sheetlite-formula {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sheetlite-formula span, .sheetlite-color span {
    font-size: .72rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
}
.sheetlite-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.sheetlite-toolbar .ghost-btn { padding-inline: 12px; }
.sheetlite-toolbar .ghost-btn.active {
    background: rgba(96, 165, 250, .16);
    border-color: rgba(96, 165, 250, .5);
    color: #dbeafe;
}
.sheetlite-divider {
    width: 1px;
    height: 34px;
    background: rgba(255,255,255,.12);
    margin-inline: 2px;
}
.sheetlite-color {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(8, 12, 20, .42);
}
.sheetlite-color input[type="color"] {
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    background: transparent;
}
.sheetlite-grid-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(8, 12, 20, .62);
    max-height: 560px;
    overscroll-behavior: contain;
}
.sheetlite-grid {
    width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
}
.sheetlite-grid th,
.sheetlite-grid td {
    border-right: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-width: 116px;
    height: 38px;
    padding: 6px 10px;
    white-space: nowrap;
    position: relative;
}
.sheetlite-grid th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(12, 18, 30, .96);
    color: #cdd8ff;
    text-align: center;
}
.sheetlite-grid .sheet-rowhead {
    position: sticky;
    left: 0;
    z-index: 2;
    background: rgba(12, 18, 30, .96);
    min-width: 52px;
}
.sheetlite-grid td {
    background: rgba(255,255,255,.03);
    font-variant-numeric: tabular-nums;
    cursor: default;
    user-select: none;
}
.sheetlite-grid td.selected {
    background: rgba(59, 130, 246, .12);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .18);
}
.sheetlite-grid td.focus {
    outline: 2px solid rgba(125, 211, 252, .95);
    outline-offset: -2px;
}
.sheetlite-grid td.error { color: #ff8d8d; }
.sheetlite-inline-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 6px 10px;
    border: none;
    outline: 2px solid rgba(125, 211, 252, .95);
    background: #0f172a;
    color: #fff;
    font: inherit;
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .sheetlite-topbar { grid-template-columns: 1fr; }
}
