*{box-sizing:border-box}body{margin:0;background:#f1f5f9;color:#142536;font:16px system-ui,sans-serif}main{max-width:1150px;margin:32px auto;padding:0 16px}header{background:#16334c;color:white;padding:24px;border-radius:12px;margin-bottom:16px}h1{margin:4px 0}.eyebrow{color:#a9d8dc;font-size:13px}form,section{background:white;border-radius:12px;padding:16px}.controls{display:flex;gap:12px;flex-wrap:wrap;margin:10px 0}input,select,button{font:inherit;padding:8px;border:1px solid #a5b6c5;border-radius:6px}button{background:#174767;color:white}.scroll{overflow:auto}table{border-collapse:collapse;width:100%}td,th{border:1px solid #dae3ea;padding:8px;white-space:pre-wrap;text-align:left}th{background:#e8f1f5}tbody tr:nth-child(even){background:#f7fafc}
.worksheet{table-layout:fixed}.worksheet td,.worksheet th{padding:2px 4px;border:0;background:white;font-weight:normal;overflow:hidden}
#viewer .scroll{max-height:70vh;border:1px solid #c8cecc;background:#f8f9f8}
.worksheet thead th,.worksheet .row-number{position:sticky;background:#f0f2f1;color:#4b5550;text-align:center;font:12px system-ui,sans-serif;border:1px solid #ccd2cf}
.worksheet thead th{top:0;z-index:2;height:24px}
.worksheet .row-number{left:0;z-index:1}
.worksheet thead th:first-child{left:0;z-index:3}
#sheet-tabs{display:flex;gap:2px;overflow-x:auto;background:#eef0ef;border:1px solid #c8cecc;border-top:0}
#sheet-tabs button{flex:none;border:0;border-radius:0;border-bottom:3px solid transparent;background:transparent;color:#3d4842;padding:6px 12px;font-size:14px}
#sheet-tabs button[aria-pressed="true"]{background:white;border-bottom-color:#188854;color:#12683f;font-weight:600}
body.viewing-sheet:not([data-admin]) main{max-width:none;margin:8px auto;padding:0 8px}
body.viewing-sheet:not([data-admin]) header{padding:8px 16px;margin-bottom:6px;border-radius:6px}
body.viewing-sheet:not([data-admin]) header h1{font-size:20px}
body.viewing-sheet:not([data-admin]) header p{display:none}
body.viewing-sheet:not([data-admin]) #viewer{padding:8px;border-radius:6px}
body.viewing-sheet:not([data-admin]) #viewer .scroll{height:calc(100dvh - 190px);max-height:none;min-height:260px}
.zoom-controls{margin:0 0 0 auto;align-items:center;gap:4px}
.zoom-controls button{padding:5px 10px}
.zoom-controls output{min-width:48px;text-align:center}
body[data-admin] main{max-width:none}
.wide-viewer .scroll{height:75dvh}
.column-filter-button{padding:0 2px;margin-left:4px;border:0;background:transparent;color:#168351;font-size:10px}
#column-filter-dialog{width:min(460px,90vw);border:1px solid #a5b6c5;border-radius:8px}
#column-filter-dialog::backdrop{background:#0005}
.filter-choices{max-height:45vh;overflow:auto}.filter-choices label{display:block;padding:4px}.filter-choices label[hidden]{display:none}
body.viewing-sheet:not([data-admin]){height:100dvh;overflow:hidden}
body.viewing-sheet:not([data-admin]) main{height:100%;margin:0;padding:4px 6px;display:flex;flex-direction:column;gap:4px}
body.viewing-sheet:not([data-admin]) header{flex:none;margin:0}
body.viewing-sheet:not([data-admin]) #viewer:not([hidden]){flex:1;min-height:0;display:flex;flex-direction:column;padding:4px}
body.viewing-sheet:not([data-admin]) #viewer>.controls{flex:none;margin:3px 0}
body.viewing-sheet:not([data-admin]) #viewer>.scroll{flex:1;height:auto;min-height:0;max-height:none}
body.viewing-sheet:not([data-admin]) #sheet-tabs{flex:none;min-height:40px}
body.viewing-sheet:not([data-admin]) #status{flex:none;margin:0;font-size:12px}
body.viewing-sheet:not([data-admin]) #sheet-charts{flex:none;max-height:28dvh;overflow:auto;padding:4px}
body.viewing-sheet:not([data-admin]) #sheet-charts h3{margin:0;font-size:14px}
.sheet-footer{display:flex;flex:none;align-items:center;min-height:42px;background:#eef0ef;border:1px solid #c8cecc;gap:6px}
.sheet-footer #sheet-tabs{flex:1;min-width:0;border:0}
.sheet-footer .zoom-controls{flex:none;margin:0;padding:3px}
@media(max-width:720px){.sheet-footer{flex-wrap:wrap}.sheet-footer #sheet-tabs{flex-basis:100%}.sheet-footer .zoom-controls{margin-left:auto}}
.sheet-workspace{display:flex;flex:1;min-height:0;min-width:0;gap:8px;overflow:hidden}
.sheet-workspace>.scroll{flex:1;min-width:0;min-height:0}
.mobile-sheet-picker{display:none}
@media(max-width:720px){
  .sheet-footer{width:100%;min-width:0;gap:2px}
  .sheet-footer #sheet-tabs{flex:0 0 100%;max-width:100%;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;overscroll-behavior-x:contain}
  .mobile-sheet-picker{display:flex;align-items:center;gap:4px;flex:1 1 120px;min-width:0;padding:3px;font-size:12px}
  .mobile-sheet-picker select{flex:1;min-width:0;width:0;padding:4px}
  .sheet-footer .zoom-controls{gap:2px;font-size:12px}
  .sheet-footer .zoom-controls button{padding:4px 5px}
  .sheet-footer .zoom-controls output{min-width:32px}
}
body.viewing-sheet:not([data-admin]) .sheet-workspace>#sheet-charts{flex:0 0 48%;max-height:none;min-width:0;overflow:auto;border:1px solid #c8cecc}
.sheet-workspace.has-chart>.scroll{flex:1 1 52%}
body[data-admin] .sheet-workspace{height:70dvh}
body[data-admin] .sheet-workspace>#sheet-charts{flex:0 0 48%;min-width:0;overflow:auto}
@media(max-width:720px){body.viewing-sheet:not([data-admin]) .sheet-workspace>#sheet-charts{flex-basis:48%}}
.sheet-footer{max-width:100%}
body:not([data-admin]):not(.viewing-sheet) main{max-width:580px;margin:clamp(24px,9vh,84px) auto;padding:0 16px}
body:not([data-admin]):not(.viewing-sheet) header{position:relative;padding:28px 22px;background:#fff;color:#142536;border:1px solid #dce5ed;border-radius:16px;box-shadow:0 8px 24px #16334c0d}
body:not([data-admin]):not(.viewing-sheet) header h1{font-size:clamp(24px,5.5vw,34px)}
body:not([data-admin]):not(.viewing-sheet) header .eyebrow{color:#27665b;margin:0 0 18px}
body:not([data-admin]):not(.viewing-sheet) header select{position:absolute;top:17px;right:18px;padding:4px 8px;font-size:14px}
body:not([data-admin]):not(.viewing-sheet) #status{color:#465d70;text-align:center}
