/* Notebook surfaces inherit Nevla's shared light/dark design tokens. */
.study.notebook-dialog{width:min(1080px,calc(100vw - 40px));padding:28px;border-radius:24px;background:var(--bg-dark);color:var(--text-primary);box-shadow:var(--shadow-md);scrollbar-gutter:stable}
.study.notebook-dialog::backdrop{background:#100c16b8;backdrop-filter:blur(8px)}
.study.notebook-dialog .close{border-radius:50%;border:1px solid var(--border-color);background:var(--bg-card);top:0;float:right;margin:0 0 0 14px;color:var(--text-secondary)}
.notebook-header{display:flex;gap:16px;align-items:center;padding:4px 0 25px;border-bottom:1px solid var(--border-color);margin-bottom:22px}
.notebook-mark{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border:1px solid var(--border-color);border-radius:15px;background:var(--surface-active);color:var(--primary)}
.notebook-mark svg{width:25px;height:25px}.notebook-eyebrow{display:block;font:500 10px/1.5 var(--font-body,system-ui);letter-spacing:.16em;color:var(--text-muted);margin-bottom:6px}
.notebook-header h2{font:500 clamp(23px,3vw,30px)/1.15 var(--font-heading,system-ui);letter-spacing:-.035em;margin:0;max-width:780px}
.study.notebook-dialog .notebook-intro{color:var(--text-secondary);font-size:14px;line-height:1.8;max-width:690px;margin:0 0 24px}
.notebook-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-bottom:24px}
.notebook-actions button{display:inline-flex;align-items:center;gap:9px;background:var(--bg-card)}.notebook-actions svg{width:18px;height:18px;color:var(--primary)}
.notebook-count{margin-left:auto;color:var(--text-muted);font-size:12px}.notebook-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.study.notebook-dialog .notebook-card{display:flex;flex-direction:column;min-width:0;margin:0;padding:23px;background:var(--bg-card);border:1px solid var(--border-color);border-radius:18px;box-shadow:var(--shadow-sm)}
.notebook-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.notebook-tag{color:var(--text-secondary);font-size:11px;overflow-wrap:anywhere}.notebook-status{flex-shrink:0;display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 9px;background:var(--surface-active);color:var(--text-secondary);font-size:10px}.notebook-status:before{content:'';width:5px;height:5px;border-radius:50%;background:var(--primary)}.notebook-status.is-reviewed:before{background:var(--success)}
.study.notebook-dialog .notebook-card h3{font:500 21px/1.3 var(--font-heading,system-ui);letter-spacing:-.02em;margin-bottom:10px}.study.notebook-dialog .notebook-exercise{color:var(--text-secondary);font-size:13px;line-height:1.7;margin:0 0 20px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.study.notebook-dialog .notebook-card-meta{font-size:11px;color:var(--text-muted);margin-top:auto;margin-bottom:16px}.notebook-card-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:16px;border-top:1px solid var(--border-color)}
.study.notebook-dialog button{min-height:44px;border-radius:10px;transition:background .15s,border-color .15s;white-space:normal}.study.notebook-dialog button:not(:disabled):hover{background:var(--bg-surface);border-color:var(--border-strong)}
.study.notebook-dialog .primary{background:var(--app-action,#75528d);border-color:transparent;color:var(--app-on-action,#fff);font-weight:500}.study.notebook-dialog .primary:not(:disabled):hover{background:var(--app-action-hover,#654579)}
.study.notebook-dialog [data-delete-entry]{border-color:transparent;background:transparent;color:var(--text-muted);font-size:12px}.study.notebook-dialog [data-delete-entry]:hover{color:var(--danger)}
.notebook-empty{grid-column:1/-1;display:flex;flex-direction:column;align-items:center;text-align:center;border:1px dashed var(--border-strong);border-radius:18px;padding:48px 28px;background:var(--bg-card)}.notebook-empty>svg{width:38px;height:38px;color:var(--primary);margin-bottom:20px}.notebook-empty h3{font:500 24px/1.3 var(--font-heading,system-ui)}.notebook-empty p{max-width:440px;color:var(--text-secondary);font-size:13px;line-height:1.8}
.study.notebook-dialog .notebook-footnote{font-size:11px;color:var(--text-muted);line-height:1.7;margin:22px 0 0}
.notebook-workspace{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:24px;align-items:start}.notebook-document,.notebook-inspector{min-width:0}.notebook-document{border:1px solid var(--border-color);border-radius:18px;padding:18px;background:var(--bg-card)}
.study.notebook-dialog label{font-size:12px;font-weight:500;color:var(--text-secondary);line-height:1.6;gap:8px;margin:0 0 18px}.study.notebook-dialog textarea,.study.notebook-dialog input,.study.notebook-dialog select{font-size:14px;font-weight:400;line-height:1.65;border-radius:10px;background:var(--bg-card);color:var(--text-primary);padding:12px 14px;border-color:var(--border-color)}.study.notebook-dialog textarea{min-height:110px}.study.notebook-dialog [name=excerpt]{min-height:160px}.study.notebook-dialog input[type=file]{padding:12px;font-size:12px;background:var(--bg-dark)}.study.notebook-dialog input[type=file]::file-selector-button{background:var(--bg-surface);color:var(--text-primary);border:1px solid var(--border-color);border-radius:7px;padding:8px 10px;margin-right:10px;font:inherit;cursor:pointer}
.study.notebook-dialog :focus-visible{outline:2px solid var(--primary);outline-offset:3px}.notebook-inspector>button{margin:0 7px 12px 0}.notebook-inspector [data-source-save],.notebook-inspector [data-save-photo]{width:100%;margin:16px 0 0}.notebook-inspector [data-state]:not(:empty){padding:12px 14px;background:var(--surface-active);border:1px solid var(--border-color);border-radius:10px;color:var(--text-secondary);font-size:12px}.notebook-inspector [data-reply]:not(:empty),.notebook-inspector [data-explanation]:not(:empty),.study.notebook-dialog [data-practice]:not(:empty){margin:15px 0;padding:18px;background:var(--bg-card);border:1px solid var(--border-strong);border-radius:14px;font-size:13px;line-height:1.85;overflow-wrap:anywhere}
.notebook-document .actions{justify-content:space-between;align-items:center;gap:6px}.notebook-document [data-page]{font-size:12px;color:var(--text-secondary);font-variant-numeric:tabular-nums}.notebook-document [data-preview]{overflow:hidden;border-radius:10px}.notebook-document canvas{display:block;width:100%;height:auto;background:#fff;border-radius:8px}.notebook-document img{display:block;max-height:570px;object-fit:contain;margin:auto;border-radius:10px}.notebook-placeholder{min-height:290px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;text-align:center;color:var(--text-muted);background:var(--bg-dark);border:1px dashed var(--border-color);border-radius:12px}.notebook-placeholder svg{width:40px;height:40px;color:var(--primary);margin-bottom:6px}.notebook-placeholder strong{font:500 19px/1.4 var(--font-heading,system-ui);color:var(--text-secondary)}.notebook-placeholder span{font-size:12px;max-width:260px;line-height:1.7}
.notebook-detail{width:min(780px,calc(100vw - 40px))}.notebook-detail .notebook-body>h3{font:500 22px/1.5 var(--font-heading,system-ui);margin:26px 0 16px}.notebook-detail .notebook-body>h3:first-child{margin-top:0}.notebook-detail .notebook-body>button{margin:4px 8px 14px 0}.notebook-detail details{padding:4px 16px;border:1px solid var(--border-color);border-radius:12px;margin:18px 0;background:var(--bg-card)}.notebook-detail [data-history] .entry{background:var(--bg-card);font-size:13px}.study.notebook-dialog .error:empty{display:none}.study.notebook-dialog .error:not(:empty){padding:12px 15px;border:1px solid var(--danger);border-radius:10px;font-size:13px;margin-top:18px}
/* Existing compact toolbars retain icon-sized controls on small screens. */
.chat-study-tools .notebook-shortcut{display:inline-flex;align-items:center;justify-content:center;gap:8px}.notebook-shortcut svg{width:18px;height:18px;flex-shrink:0}
@media(max-width:760px){.study.notebook-dialog{width:calc(100vw - 20px);padding:20px 16px;border-radius:20px;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px)}.notebook-header{gap:12px;padding-bottom:20px;margin-bottom:20px}.notebook-mark{flex-basis:40px;width:40px;height:40px;border-radius:12px}.notebook-mark svg{width:21px;height:21px}.notebook-eyebrow{font-size:8px;letter-spacing:.12em}.notebook-header h2{font-size:23px}.notebook-grid,.notebook-workspace{grid-template-columns:minmax(0,1fr)}.notebook-workspace{gap:24px}.notebook-card-top{gap:8px}.study.notebook-dialog .notebook-card{padding:20px}.notebook-count{width:100%;margin:4px 0 0}.notebook-actions{gap:8px;padding-bottom:20px}.notebook-actions button{flex:1 1 170px;font-size:12px}.study.notebook-dialog label{font-size:12px}.study.notebook-dialog input:not([type=file]),.study.notebook-dialog select,.study.notebook-dialog textarea{font-size:16px}.study.notebook-dialog .close{min-width:40px;min-height:40px;margin-left:6px}.study.notebook-dialog .notebook-intro{font-size:13px;line-height:1.75}.notebook-placeholder{min-height:210px}.notebook-document{padding:14px}.chat-study-tools .notebook-shortcut>span{display:none}}
@media(prefers-reduced-motion:reduce){.study.notebook-dialog button{transition:none}.study.notebook-dialog::backdrop{backdrop-filter:none}}
