/* Bounded notebook spreadsheets retain source cells and exact scientific references. */
.ws-notebook-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 8px}
.ws-notebook-sheet-heading input{min-width:0;flex:1;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--pv-ink,var(--ui-text));padding:6px 8px;font-size:14px;font-weight:600}
.ws-notebook-sheet-heading input:hover:not([readonly]),.ws-notebook-sheet-heading input:focus{border-color:var(--pv-line,var(--ui-border));background:var(--pv-surface-2)}
.ws-notebook-copy-tsv{flex:none;border:1px solid var(--pv-line,var(--ui-border));background:var(--pv-surface);color:var(--pv-ink-2);border-radius:6px;padding:5px 9px;font-size:11px;cursor:pointer}
.ws-notebook-formula-bar{display:flex;align-items:center;gap:8px;background:var(--pv-surface-2,#f5f6f8);border:1px solid var(--pv-line,#ddd);border-bottom:0;border-radius:7px 7px 0 0;min-height:34px;padding:0 10px;font-size:12px;color:var(--pv-muted,#677)}
.ws-notebook-formula-bar>span:first-child{min-width:27px;color:var(--pv-ink-2);font-variant-numeric:tabular-nums;font-size:11px}
.ws-notebook-formula-bar input{flex:1;min-width:0;width:0;border:0!important;background:transparent!important;color:var(--pv-ink);font-family:var(--mono,monospace)!important;font-size:12px;padding:7px 0;box-shadow:none}
.ws-notebook-formula-status{font-size:11px;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pv-accent-ink)}
.ws-notebook-table-row .ws-notebook-table-scroll{border-top-left-radius:0;border-top-right-radius:0}
.ws-notebook-table .ws-notebook-row-number{width:34px;min-width:34px;padding:6px;text-align:center;color:var(--pv-muted,#677);font-size:11px;font-weight:400;background:var(--pv-surface-2,#f6f7f8);font-variant-numeric:tabular-nums;position:sticky;left:0;z-index:1}
.ws-notebook-column-letter{display:block;color:var(--pv-muted);font-size:10px;font-weight:400;text-align:center;border-bottom:1px solid var(--pv-line-2);padding:4px;margin-bottom:3px}
.ws-notebook-table th>input{font-size:11px;font-weight:500;padding:6px 8px;min-height:0}
.ws-notebook-table td{position:relative}
.ws-notebook-table td textarea{min-height:34px!important;height:34px;padding:8px!important;resize:vertical;font-size:12px;line-height:1.5;font-variant-numeric:tabular-nums}
.ws-notebook-table td.has-formula:after{content:'ƒ';position:absolute;right:3px;top:1px;font-size:9px;color:var(--pv-accent-ink);pointer-events:none}
.ws-notebook-table td.has-formula textarea{color:var(--pv-accent-ink)!important}
.ws-notebook-table td.formula-error textarea{color:var(--pv-warn,#a66316)!important;background:var(--pv-warn-tint,#fff5e9)}
.ws-notebook-table td:focus-within{outline:2px solid var(--pv-accent,#4488bb);outline-offset:-2px}
.ws-notebook-table-controls{flex-wrap:wrap}.ws-notebook-table-controls small{font-size:10px;line-height:1.5}
@media(max-width:600px){.ws-notebook-sheet-heading{gap:6px}.ws-notebook-sheet-heading input{font-size:13px;padding-inline:2px}.ws-notebook-copy-tsv{font-size:10px;padding:5px 7px}.ws-notebook-formula-status{max-width:85px}.ws-notebook-table-controls small{width:100%}}
/* The preview's compact, connected sheet surface and inline block insertion. */
body.preview-ui .ws-notebook-table-row{display:block;padding:0;border:1px solid var(--pv-line);border-radius:10px;overflow:hidden;background:var(--pv-surface);margin:12px 0}
body.preview-ui .ws-notebook-sheet-heading{margin:0;gap:8px;padding:8px 10px;background:var(--pv-surface-2);border-bottom:1px solid var(--pv-line)}
body.preview-ui .ws-notebook-sheet-heading input{padding:3px 5px;font-size:13px}
.ws-notebook-sheet-kind{padding:3px 7px;border-radius:5px;background:var(--pv-bg);color:var(--pv-muted);font-size:10px;font-weight:600}
.ws-notebook-sheet-size{white-space:nowrap;color:var(--pv-muted);font-size:11px;font-variant-numeric:tabular-nums}
body.preview-ui .ws-notebook-table-row .ws-notebook-formula-bar{border:0;border-bottom:1px solid var(--pv-line-2);border-radius:0;background:var(--pv-surface)}
body.preview-ui .ws-notebook-table-row .ws-notebook-table-scroll{border:0;border-radius:0}
body.preview-ui .ws-notebook-table-row .ws-notebook-table-controls{padding:7px 10px;border-top:1px solid var(--pv-line-2);margin:0}
body.preview-ui .ws-notebook-table-row .ws-notebook-column-letter{display:inline-block;vertical-align:middle;width:24px;padding:5px 0;margin:0;border:0}
body.preview-ui .ws-notebook-table-row .ws-notebook-table th>input{display:inline-block;width:calc(100% - 26px);min-width:65px}
.ws-notebook-row{position:relative}
.ws-notebook-insert-menu{position:absolute;z-index:5;left:20px;top:calc(100% - 2px);display:flex;flex-wrap:wrap;gap:4px;padding:7px;max-width:calc(100% - 24px);border:1px solid var(--pv-line,var(--ui-border));border-radius:10px;background:var(--pv-surface,var(--ui-surface));box-shadow:0 8px 25px #00000012}
.ws-notebook-insert-menu button{border:0;border-radius:6px;padding:7px 10px;background:transparent;color:var(--pv-ink,var(--ui-text));font:500 12px var(--sans);cursor:pointer}
.ws-notebook-insert-menu button:hover,.ws-notebook-insert-menu button:focus-visible{background:var(--pv-accent-tint,#e9f0ff);color:var(--pv-accent-ink,#3565c8);outline:2px solid transparent}
@media(max-width:600px){.ws-notebook-sheet-kind,.ws-notebook-sheet-size{display:none}}
/* Typed results tables and the hover insert bar. */
.ws-notebook-sheet-kind.is-results{background:var(--pv-accent-tint);color:var(--pv-accent-ink)}
.ws-notebook-column-type{display:block;margin-top:2px;font-size:10px;color:var(--pv-muted);border:0;background:transparent;font-family:inherit}
.ws-notebook-table td[data-column-type=number] textarea{text-align:right;font-variant-numeric:tabular-nums}
.ws-notebook-table td.type-invalid textarea{color:var(--pv-red,#a83232);text-decoration:underline dotted}
.ws-notebook-ins{position:absolute;left:0;right:0;bottom:-11px;height:22px;display:flex;align-items:center;justify-content:center;gap:6px;opacity:0;transition:opacity .12s;z-index:2;pointer-events:none}
.ws-notebook-ins::before{content:'';position:absolute;left:0;right:0;top:50%;height:1px;background:var(--pv-line,#e3e1db)}
.ws-notebook-row:hover>.ws-notebook-ins,.ws-notebook-row:focus-within>.ws-notebook-ins,.ws-notebook-ins:hover{opacity:1;pointer-events:auto}
.ws-notebook-ins button{position:relative;height:22px;padding:0 8px;border:1px solid var(--pv-line,#e3e1db);border-radius:6px;background:var(--pv-surface,#fff);color:var(--pv-muted,#6b7079);font:inherit;font-size:12px;cursor:pointer}
.ws-notebook-ins button:hover{color:var(--pv-ink);border-color:var(--pv-muted)}
.ws-notebook-row{padding-bottom:6px}
