.sheets-page { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; }
.sheets-heading { flex-shrink:0; align-items:center; padding:18px 24px; }
.sheets-heading h1 { font-size:1.45rem; }
.sheet-title-button { padding:0; min-width:0; max-width:60%; text-align:left; }
.sheet-title-button h1 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sheets-heading .heading-buttons { gap:10px; }
.sheet-import { display:inline-flex; align-items:center; gap:8px; cursor:pointer; }
.sheet-import input { position:absolute; width:1px; height:1px; padding:0; opacity:0; }
.sheet-import:focus-within { outline:2px solid var(--accent); outline-offset:3px; }
.sheet-workspace { display:flex; flex-direction:column; flex:1; min-height:0; margin:0 20px 16px; background:var(--panel); border:1px solid var(--line); border-radius:8px; overflow:hidden; isolation:isolate; }
.sheet-tabs { order:4; display:flex; flex-shrink:0; gap:3px; overflow-x:auto; padding:0 8px; background:var(--panel); border-top:1px solid var(--line); }
.sheet-tab { display:flex; align-items:center; gap:8px; padding:10px 16px; flex-shrink:0; max-width:260px; font-size:.86rem; color:var(--muted); border-radius:0; border-bottom:2px solid transparent; }
.sheet-tab span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sheet-tab.active { color:var(--accent); border-bottom-color:var(--accent); background:rgba(var(--accent-rgb),.08); }
.sheet-tab .icon { width:16px; height:16px; }
.sheet-tools { display:flex; align-items:center; flex-shrink:0; gap:5px; padding:8px 10px; min-height:52px; overflow-x:auto; border-bottom:1px solid var(--line); }
.sheet-tools>* { flex-shrink:0; }
.sheet-tools .icon-button { width:34px; height:34px; border-radius:7px; }
.sheet-tools .icon-button.active { background:rgba(var(--accent-rgb),.2); color:var(--accent); }
.sheet-tools select { font-size:.78rem; border-radius:7px; padding:8px; width:auto; max-width:140px; }
.sheet-name { display:flex; align-items:center; gap:8px; max-width:170px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:.82rem; padding:6px; }
.sheet-name .icon { width:12px; height:12px; }
.sheet-divider { height:22px; width:1px; background:var(--line); margin:0 4px; }
.sheet-fill { display:flex; align-items:center; gap:7px; font-size:.78rem; color:var(--muted); cursor:pointer; }
.sheet-fill input { width:25px; height:27px; padding:2px; border-radius:5px; cursor:pointer; }
.sheet-value-bar { display:flex; align-items:center; gap:8px; padding:6px 10px; border-bottom:1px solid var(--line); flex-shrink:0; }
.sheet-value-bar input { font-size:.86rem; padding:7px 10px; border-radius:4px; height:32px; }
#sheet-address { width:90px; text-align:center; font-family:Consolas,monospace; flex-shrink:0; color:var(--accent); }
#sheet-value { flex:1; min-width:0; background:transparent; }
.sheet-value-bar>.icon-button { flex-shrink:0; }
.sheet-command { padding:8px 10px; font-size:.8rem; border-radius:5px; white-space:nowrap; }
.sheet-command:hover { background:rgba(var(--accent-rgb),.1); }
.sheet-col-resize { position:absolute; top:0; right:-3px; width:10px; height:100%; cursor:col-resize; touch-action:none; z-index:4; }
.sheet-col-resize:hover { background:rgba(var(--accent-rgb),.25); }
.sheet-grid-wrap { flex:1; min-height:100px; overflow:auto; position:relative; outline:none; overscroll-behavior:contain; background:var(--bg); scrollbar-color:color-mix(in srgb,var(--muted) 35%,transparent) transparent; }
.sheet-grid-wrap:focus-visible { box-shadow:inset 0 0 0 1px rgba(var(--accent-rgb),.4); }
.sheet-grid { border-spacing:0; border-collapse:separate; table-layout:fixed; width:max-content; color:var(--text); font-size:.86rem; }
.sheet-grid th,.sheet-grid td { height:36px; min-height:36px; padding:0; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.sheet-grid th { font-size:.75rem; font-weight:500; text-align:center; color:var(--muted); background:var(--panel2); user-select:none; }
.sheet-grid th button { display:block; width:100%; height:35px; padding:0; }
.sheet-grid thead th { position:sticky; top:0; z-index:3; }
.sheet-grid tbody th { position:sticky; left:0; z-index:2; }
.sheet-grid .sheet-corner { position:sticky; left:0; z-index:4; }
.sheet-grid th.selected-header { color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,var(--panel2)); }
.sheet-cell { position:relative; overflow:hidden; user-select:none; cursor:cell; white-space:nowrap; }
.sheet-cell-value { display:block; padding:0 10px; line-height:35px; height:35px; overflow:hidden; text-overflow:clip; max-width:100%; }
.sheet-cell.selected::after { content:""; position:absolute; inset:0; background:rgba(var(--accent-rgb),.1); pointer-events:none; }
.sheet-cell.anchor { box-shadow:inset 0 0 0 2px var(--accent); }
.sheet-cell.anchor::after { background:transparent; }
.sheet-cell-editor { position:absolute; inset:0; height:36px; width:100%; z-index:5; border:2px solid var(--accent); border-radius:0; padding:0 8px; background:var(--panel); color:var(--text); font-size:1rem; }
.sheet-grid .sheet-spacer td { border:0; padding:0; }
.sheet-status { order:5; display:flex; align-items:center; gap:16px; padding:6px 12px; min-height:28px; font-size:.72rem; color:var(--muted); border-top:1px solid var(--line); flex-shrink:0; }
#sheet-summary { flex:1; text-align:right; }
.sheet-status button { color:var(--accent); white-space:nowrap; }
.sheet-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; padding:30px 20px; text-align:center; }
.sheet-empty-symbol { display:grid; place-items:center; width:85px; height:85px; border-radius:24px; background:rgba(var(--accent-rgb),.08); color:var(--accent); box-shadow:0 0 55px rgba(var(--accent-rgb),.06); border:1px solid rgba(var(--accent-rgb),.16); }
.sheet-empty-symbol .icon { width:37px; height:37px; }
.sheet-empty h2 { font-size:1.2rem; font-weight:500; color:var(--muted); }
.sheet-empty p { color:var(--muted); font-size:.9rem; line-height:1.8; }
.sheet-empty-tags { display:flex; justify-content:center; flex-wrap:wrap; gap:9px; margin-top:10px; color:var(--muted); font-size:.75rem; }
.sheet-empty-tags span { padding:6px 10px; border:1px solid var(--line); border-radius:20px; }
.sheet-structure { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:20px 0; }
.sheet-help { display:grid; gap:16px; line-height:1.75; font-size:.92rem; color:var(--muted); }
.sheet-help b { color:var(--text); }
.sheet-help code { color:var(--accent); font-size:.85rem; }
.block-edge-row { display:flex; gap:14px; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid var(--line); font-size:.86rem; }
.block-edge-row span { overflow-wrap:anywhere; }
.disconnect-button { font-size:.8rem; padding:8px 10px; white-space:nowrap; flex-shrink:0; }
.edge-hit-layer { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.edge-hit-layer path { fill:none; stroke:transparent; stroke-width:22px; pointer-events:stroke; cursor:pointer; }
.edge-hit-layer path:hover,.edge-hit-layer path:focus-visible { stroke:rgba(var(--accent-rgb),.16); outline:none; }
@media(max-width:760px) {
  .sheets-heading { padding:14px 16px; gap:12px; }
  .sheets-heading h1 { font-size:1.35rem; }
  .sheet-title-button { max-width:100%; }
  .sheets-heading p { display:none; }
  .sheets-heading .heading-buttons { width:100%; display:flex; }
  .sheets-heading .heading-buttons>* { flex:1; justify-content:center; font-size:.85rem; min-height:42px; }
  .sheet-workspace { margin:0 10px 10px; border-radius:10px; }
  .sheet-tabs { padding:0 6px; }
  .sheet-tab { padding:11px 12px; font-size:.8rem; max-width:200px; }
  .sheet-tools { padding:5px 7px; min-height:46px; }
  .sheet-tools .icon-button { width:38px; height:38px; }
  .sheet-name { display:none; }
  .sheet-value-bar { padding:6px; gap:4px; }
  #sheet-address { width:64px; font-size:.8rem; padding:8px 4px; }
  #sheet-value { font-size:16px; }
  .sheet-cell-editor { font-size:16px; }
  .sheet-status { padding:6px 8px; gap:8px; flex-wrap:wrap; min-height:28px; font-size:.65rem; }
  .sheet-dimensions { display:none; }
  #sheet-summary { text-align:left; min-width:120px; }
  .sheet-empty { padding:20px 20px 40px; gap:16px; }
  .sheet-empty h2 { font-size:1.35rem; }
  .sheet-empty p { font-size:.82rem; }
  .sheet-structure { gap:8px; }
  .sheet-structure button { font-size:.8rem; padding:10px; }
  .mobile-nav { padding-left:5px; padding-right:5px; }
  .mobile-nav button { min-width:0; }
}
