:root {
    --paper: #f6f6f3;
    --surface: #fff;
    --ink: #1e1f21;
    --soft: #65676b;
    --muted: #8a8c90;
    --line: #d9d9d7;
    --line-soft: #e9e9e7;
    --rail: #f1f0ef;
    --rail-hover: rgba(0,0,0,.045);
    --field: rgba(255,255,255,.78);
    --blue: #3478f6;
    --blue-soft: #dce8fb;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    --nav-width: 244px;
    --sources-width: min(33vw, 470px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #131314; --surface: #171718; --ink: #f3f3f4; --soft: #b2b3b7;
        --muted: #8d8f94; --line: #323235; --line-soft: #28282b; --rail: #202022;
        --rail-hover: rgba(255,255,255,.065); --field: rgba(45,45,48,.84); --blue-soft: #1e355c;
    }
}

html[data-theme="light"] {
    --paper: #f6f6f3; --surface: #fff; --ink: #1e1f21; --soft: #65676b;
    --muted: #8a8c90; --line: #d9d9d7; --line-soft: #e9e9e7; --rail: #f1f0ef;
    --rail-hover: rgba(0,0,0,.045); --field: rgba(255,255,255,.78); --blue-soft: #dce8fb;
    color-scheme: light;
}
html[data-theme="dark"] {
    --paper: #131314; --surface: #171718; --ink: #f3f3f4; --soft: #b2b3b7;
    --muted: #8d8f94; --line: #323235; --line-soft: #28282b; --rail: #202022;
    --rail-hover: rgba(255,255,255,.065); --field: rgba(45,45,48,.84); --blue-soft: #1e355c;
    color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
[hidden] { display: none !important; }
.sr-only { clip: rect(0,0,0,0); height: 1px; overflow: hidden; position: absolute; width: 1px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.library-app { height: 100%; min-height: 520px; padding-top: 48px; }
.library-app.studio-active { padding-top: 0; }
.studio-active .library-nav { display: none; }
.library-nav { align-items: center; backdrop-filter: blur(14px); background: color-mix(in srgb,var(--rail) 92%,transparent); border-bottom: 1px solid var(--line); display: flex; height: 48px; justify-content: space-between; left: 0; padding: 0 16px; position: fixed; right: 0; top: 0; z-index: 20; }
.nav-logo { align-items: center; color: var(--ink); display: flex; font-size: 14px; font-weight: 650; gap: 9px; text-decoration: none; }
.nav-logo > img { border-radius: 4px; display: block; height: 23px; object-fit: cover; width: 23px; }
.nav-actions { align-items: center; display: flex; gap: 18px; }
.nav-actions a, .nav-actions button { background: none; border: 0; color: var(--soft); cursor: pointer; font-size: 12px; text-decoration: none; }
#apple-sign-out-button { display: none !important; }

.state-view { align-items: center; display: flex; flex-direction: column; height: calc(100vh - 48px); justify-content: center; padding: 32px; text-align: center; }
.loading-view { color: var(--soft); gap: 14px; }
.loading-mark { animation: pulse 1.2s ease-in-out infinite; background: #48675f; border-radius: 50%; height: 8px; width: 8px; }
.state-card h1 { font-size: 32px; font-weight: 620; letter-spacing: -.045em; line-height: 1.1; }
.cloudkit-auth-host { height: 60px; left: -10000px; opacity: 0; overflow: hidden; pointer-events: none; position: fixed; top: 0; width: 240px; }
.cloudkit-button { display: flex; min-height: 44px; min-width: 218px; }
.state-card { align-items: center; display: flex; flex-direction: column; gap: 18px; max-width: 620px; }
.state-card p:not(.eyebrow) { color: var(--soft); font-size: 14px; }
.primary-button, .primary-link { background: var(--ink); border: 0; border-radius: 7px; color: var(--surface); cursor: pointer; font-weight: 600; padding: 10px 16px; text-decoration: none; }

/* Studio window */
.library-view { display: grid; grid-template-columns: var(--nav-width) minmax(360px,1fr) var(--sources-width); height: 100vh; min-width: 0; }
.library-app.navigation-hidden .library-view { grid-template-columns: minmax(360px,1fr) var(--sources-width); }
.library-app.navigation-hidden .navigation-rail { display: none; }
.library-app.sources-hidden .library-view { grid-template-columns: var(--nav-width) minmax(360px,1fr); }
.library-app.sources-hidden .sources-rail { display: none; }
.library-app.navigation-hidden.sources-hidden .library-view { grid-template-columns: minmax(360px,1fr); }
.navigation-rail, .sources-rail { background: var(--rail); color: var(--ink); display: flex; flex-direction: column; min-height: 0; position: relative; }
.navigation-rail { border-right: 1px solid var(--line); padding-top: 26px; }
.sources-rail { border-left: 1px solid var(--line); }
.sources-rail.file-drop::after { align-items: center; background: color-mix(in srgb,var(--blue) 12%,var(--surface)); border: 2px dashed var(--blue); border-radius: 10px; color: var(--blue); content: "Drop files to import"; display: flex; font-size: 12px; font-weight: 650; inset: 10px; justify-content: center; pointer-events: none; position: absolute; z-index: 20; }
.resize-handle { bottom: 0; cursor: col-resize; position: absolute; right: -4px; top: 0; width: 8px; z-index: 4; }
.resize-handle.left { left: -4px; right: auto; }

.navigation-primary { display: grid; gap: 2px; margin: 0 8px 8px; }
.rail-destination-row, .rail-section-destination { align-items: center; display: flex; min-width: 0; }
.rail-destination-row .rail-destination, .rail-section-destination .rail-section-button { flex: 1; min-width: 0; }
.rail-destination { align-items: center; background: transparent; border: 0; border-radius: 6px; cursor: pointer; display: flex; font-size: 12px; gap: 8px; padding: 7px 9px; text-align: left; width: 100%; }
.rail-destination.selected, .rail-destination:hover { background: var(--blue-soft); }
.rail-destination span { color: var(--muted); font-size: 14px; width: 14px; }
.rail-destination.new-chat span { color: var(--blue); }
.rail-destination strong { font-weight: 580; }
.navigation-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 18px; }
.rail-section + .rail-section { margin-top: 14px; }
.rail-section-button, .rail-section-title { align-items: center; background: transparent; border: 0; color: var(--muted); display: flex; font-size: 10px; justify-content: space-between; padding: 5px 7px; text-align: left; width: 100%; }
.rail-section-button { cursor: pointer; }
.rail-section-button:hover, .rail-section-button.selected { color: var(--ink); }
.rail-section-button.selected { background: var(--blue-soft); border-radius: 5px; }
.rail-open-beside { background: transparent; border: 0; border-radius: 5px; color: var(--muted); cursor: pointer; flex: 0 0 24px; font-size: 12px; height: 24px; opacity: 0; }
.rail-destination-row:hover .rail-open-beside, .rail-destination-row:focus-within .rail-open-beside, .rail-section-destination:hover .rail-open-beside, .rail-section-destination:focus-within .rail-open-beside { opacity: 1; }
.rail-open-beside:hover { background: var(--rail-hover); color: var(--ink); }
.rail-section-title button { background: transparent; border: 0; border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 18px; width: 20px; }
.rail-section-title button:hover { background: var(--rail-hover); color: var(--ink); }
.project-row, .chat-row { align-items: center; background: transparent; border: 0; border-radius: 5px; cursor: pointer; display: grid; font-size: 11px; gap: 6px; grid-template-columns: 13px minmax(0,1fr); min-height: 26px; padding: 5px 7px; text-align: left; width: 100%; }
.project-row { grid-template-columns: 10px 13px minmax(0,1fr) 18px; }
.project-row:hover, .chat-row:hover, .project-row.selected, .chat-row.selected { background: var(--rail-hover); }
.project-row.selected, .chat-row.selected { background: var(--blue-soft); }
.project-row .folder, .chat-row .chat-icon { color: var(--muted); font-size: 10px; }
.chat-row .chat-icon svg { display: block; height: 12px; width: 12px; }
.project-row.active .folder { color: var(--blue); }
.project-row.active > span:nth-child(3) { font-weight: 600; }
.project-row .project-chevron { color: var(--muted); font-size: 10px; transition: transform .14s ease; }
.project-row.expanded .project-chevron { transform: rotate(90deg); }
.project-row .project-add { color: var(--muted); font-size: 14px; opacity: 0; text-align: center; }
.project-row:hover .project-add, .project-row:focus-visible .project-add { opacity: 1; }
.project-row.drop-target, .project-card.drop-target, .project-detail.drop-target { background: color-mix(in srgb,var(--blue) 12%,var(--rail)); outline: 1px solid var(--blue); outline-offset: -1px; }
.project-row span:last-child, .chat-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-chat-list { margin-left: 12px; }
.rail-placeholder { color: var(--muted); font-size: 10px; padding: 5px 20px; }
.account-row { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 4px; padding: 7px 10px; }
.account-menu, .voice-nav { align-items: center; background: transparent; border: 0; border-radius: 7px; cursor: pointer; display: flex; min-height: 32px; }
.account-menu { flex: 1; gap: 8px; min-width: 0; padding: 3px 6px; text-align: left; }
.voice-nav { color: var(--soft); flex: 0 0 auto; font-size: 11px; gap: 6px; padding: 0 7px; }
.account-menu:hover, .voice-nav:hover, .voice-nav.selected { background: var(--rail-hover); }
.voice-nav.selected { color: var(--blue); }
.voice-nav span { font-size: 15px; }
.voice-nav strong { font-size: 11px; font-weight: 580; }
.account-avatar { align-items: center; background: #bcb8b1; border-radius: 50%; color: white; display: flex; font-size: 10px; font-weight: 650; height: 25px; justify-content: center; width: 25px; }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name-line { align-items: center; display: flex; gap: 4px; min-width: 0; }
.account-name-line strong { min-width: 0; }
.account-comp-badge { flex: 0 0 auto; font-size: 10px; line-height: 1; }
.account-copy strong { font-size: 10px; font-weight: 580; }
.account-copy small { color: var(--muted); font-size: 9px; margin-top: 1px; }

.center-workspace { background: var(--surface); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.workspace-toolbar { align-items: center; background: color-mix(in srgb,var(--surface) 95%,var(--rail)); border-bottom: 1px solid var(--line-soft); display: flex; height: 36px; min-width: 0; padding: 0 8px; position:relative; }
.rail-toggle { align-self: center; background: transparent; border: 0; border-radius: 5px; color: var(--muted); cursor: pointer; flex: 0 0 27px; font-size: 12px; height: 27px; }
.rail-toggle:hover { background: var(--rail-hover); color: var(--ink); }
.sources-toggle { margin-left: auto; }
.workspace-body { display: grid; flex: 1; grid-template-columns: minmax(0,1fr); min-height: 0; min-width: 0; overflow-x: auto; overflow-y: hidden; position: relative; }
.workspace-body.split { grid-template-columns: minmax(0,1fr) 7px minmax(0,1fr); }
.workspace-pane { display: none; min-height: 0; min-width: 0; position: relative; }
.workspace-pane.active { display: flex; }
.workspace-pane.focused { box-shadow: inset 0 2px 0 color-mix(in srgb,var(--blue) 62%,transparent); }
.workspace-pane-pin { align-items:center; background:transparent; border:0; border-radius:5px; color:var(--muted); cursor:pointer; display:flex; height:26px; justify-content:center; padding:0; position:absolute; right:10px; top:10px; width:26px; z-index:8; }
.workspace-pane-pin:hover,.workspace-pane-pin:focus-visible { background:var(--rail-hover); color:var(--ink); }
.workspace-pane-pin.selected { color:var(--blue); }
.workspace-pane-pin svg { fill:none; height:14px; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.45; width:14px; }
.workspace-pane > .pane-toolbar { padding-right:48px; }
.workspace-pane > .reader-header { padding-right:48px; }
.voice-pane > .pane-close { right:42px; }
.workspace-view-row { align-items:center; display:flex; gap:4px; }
.workspace-view-row > button { background:transparent; border:0; border-radius:6px; color:var(--ink); cursor:pointer; min-height:34px; padding:6px 9px; text-align:left; }
.workspace-view-row > button:first-child { flex:1; }
.workspace-view-row > button:hover,.workspace-view-row > button:focus-visible { background:var(--rail-hover); }
.workspace-view-row > .workspace-view-delete { color:var(--muted); flex:0 0 34px; font-size:16px; text-align:center; }
.workspace-divider { background: var(--surface); cursor: col-resize; display: none; grid-row: 1; position: relative; z-index: 5; }
.workspace-divider::after { background: var(--line); content: ""; inset: 0 3px; position: absolute; }
.workspace-body.split .workspace-divider { display: block; }
.workspace-divider:hover::after, .workspace-divider.dragging::after { background: var(--blue); }
.workspace-pane-swap { align-items:center; background:var(--surface); border:1px solid var(--line); border-radius:5px; color:var(--soft); cursor:pointer; display:flex; height:24px; justify-content:center; padding:0; position:absolute; top:50%; transform:translate(-50%,-50%); width:24px; z-index:2; }
.workspace-pane-swap:hover,.workspace-pane-swap:focus-visible { background:var(--rail-hover); color:var(--ink); }
.workspace-pane-swap svg { fill:none; height:13px; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.5; width:13px; }
.workspace-edge-drop-preview { background: color-mix(in srgb,var(--blue) 9%,transparent); border: 2px solid color-mix(in srgb,var(--blue) 78%,transparent); bottom: 6px; display: none; pointer-events: none; position: absolute; top: 6px; width: min(48%,720px); z-index: 12; }
.workspace-edge-drop-preview.visible { display: block; }
.workspace-edge-drop-preview[data-side="left"] { left: 6px; }
.workspace-edge-drop-preview[data-side="right"] { right: 6px; }
.audiobook-player { align-items: center; background: color-mix(in srgb,var(--surface) 92%,var(--rail)); border-top: 1px solid var(--line); display: grid; gap: 7px 12px; grid-template-columns: minmax(100px,240px) auto minmax(100px,1fr) auto; min-height: 65px; padding: 9px 13px; }
.audiobook-title { background: transparent; border: 0; cursor: pointer; font-size: 11px; font-weight: 620; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.audiobook-controls { align-items: center; display: flex; gap: 3px; }
.audiobook-controls button { background: transparent; border: 0; border-radius: 5px; color: var(--soft); cursor: pointer; font-size: 11px; height: 27px; min-width: 27px; padding: 0 5px; }
.audiobook-controls button:hover { background: var(--rail-hover); color: var(--ink); }
.audiobook-controls button:disabled { cursor: default; opacity: .35; }
.audiobook-controls .audiobook-play { color: var(--ink); font-size: 13px; }
.audiobook-progress { accent-color: var(--blue); min-width: 80px; width: 100%; }
.audiobook-time { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pane-toolbar { align-items: center; border-bottom: 1px solid var(--line-soft); display: flex; gap: 10px; justify-content: space-between; min-height: 46px; padding: 7px 14px; }
.pane-toolbar > :first-child { min-width: 0; }
.pane-toolbar h2 { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-toolbar p { color: var(--muted); font-size: 9px; margin-top: 2px; }
.pane-toolbar-actions { align-items: center; display: flex; gap: 5px; min-width: 0; }
.pane-action, .pane-close { background: transparent; border: 0; border-radius: 5px; color: var(--muted); cursor: pointer; }
.pane-action { font-size: 10px; padding: 6px 8px; }
.model-select { max-width: min(210px,48cqw); }
.pane-action:hover, .pane-close:hover { background: var(--rail-hover); color: var(--ink); }
.pane-close { font-size: 17px; height: 26px; width: 26px; }

.chat-pane { container-type: inline-size; flex-direction: column; }
.chat-pane.source-drop-target { outline: 2px dashed var(--blue); outline-offset: -7px; }
.comparison-chat-pane .pane-toolbar { padding-right: 10px; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 28px clamp(20px,6vw,76px) 18px; }
.chat-welcome { align-items: center; display: grid; gap: clamp(18px,3vw,34px); grid-template-columns: minmax(210px,1fr) minmax(220px,1fr); height: 100%; margin: 0 auto; max-width: 760px; width: 100%; }
.chat-welcome.without-recents { display: flex; justify-content: center; }
.chat-greeting { text-align: center; }
.chat-greeting h3 { color: var(--ink); font-family: Georgia,"Times New Roman",serif; font-size: clamp(19px,1.9vw,24px); font-weight: 600; letter-spacing: -.025em; }
.chat-greeting > p { color: var(--muted); font-size: 11px; margin-top: 5px; }
.first-source-welcome { max-width: 680px; }
.first-source-guide { max-width: 540px; width: 100%; }
.first-source-guide > p { line-height: 1.5; margin-left: auto; margin-right: auto; max-width: 430px; }
.first-source-browsers { display: grid; gap: 8px; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 22px; text-align: left; }
.first-source-browser { background: var(--rail); border: 1px solid var(--line-soft); border-radius: 9px; min-height: 72px; padding: 11px 12px; }
.first-source-browser strong, .first-source-browser span, .first-source-browser small { display: block; }
.first-source-browser strong { color: var(--ink); font-size: 11px; margin-bottom: 5px; }
.first-source-browser span { color: var(--soft); font-size: 10px; line-height: 1.4; }
.first-source-browser small { color: var(--muted); font-size: 9px; margin-top: 5px; }
.first-source-last-step { margin-top: 12px !important; }
.first-source-actions { display: flex; gap: 7px; justify-content: center; margin-top: 16px; }
.first-source-actions a, .first-source-actions button { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; color: var(--soft); cursor: pointer; font: inherit; font-size: 10px; font-weight: 600; padding: 8px 10px; text-decoration: none; }
.first-source-actions button { background: var(--blue); border-color: var(--blue); color: #fff; }
.first-source-actions a:hover, .first-source-actions button:hover { filter: brightness(1.06); }
.home-suggestions { border: 1px solid var(--line-soft); border-radius: 9px; margin-top: 20px; overflow: hidden; }
.home-suggestion { align-items: center; background: var(--surface); border: 0; cursor: pointer; display: grid; gap: 8px; grid-template-columns: 16px minmax(0,1fr) 10px; min-height: 33px; padding: 7px 9px; text-align: left; width: 100%; }
.home-suggestion + .home-suggestion { border-top: 1px solid var(--line-soft); }
.home-suggestion:hover { background: var(--rail-hover); }
.home-suggestion span { color: var(--muted); font-size: 11px; }
.home-suggestion strong { font-size: 10px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-reading h4 { color: var(--soft); font-size: 10px; font-weight: 600; margin: 0 0 7px 7px; }
.continue-list { display: flex; flex-direction: column; gap: 3px; }
.continue-row { align-items: center; background: var(--rail); border: 0; border-radius: 7px; cursor: pointer; display: grid; gap: 8px; grid-template-columns: 31px minmax(0,1fr) 10px; min-height: 38px; padding: 4px 7px; text-align: left; width: 100%; }
.continue-row:hover { background: color-mix(in srgb,var(--rail) 78%,var(--line)); }
.continue-row > span:nth-child(2) { min-width: 0; }
.continue-row strong, .continue-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-row strong { font-size: 10px; font-weight: 580; }
.continue-row small { color: var(--muted); font-size: 8px; margin-top: 1px; }
.continue-chevron { color: var(--muted); font-size: 13px; }
.chat-pane.home .composer { margin-left: clamp(20px,4vw,48px); margin-right: auto; max-width: 410px; min-width: 240px; width: calc(50% - 38px); }
.message { font-size: 13px; line-height: 1.55; margin: 0 auto 22px; max-width: 720px; white-space: pre-wrap; }
.message.user { background: color-mix(in srgb,var(--rail) 74%,transparent); border-radius: 14px; margin-left: auto; max-width: min(78%,620px); padding: 10px 13px; width: fit-content; }
.message.assistant strong { display: block; font-size: 10px; margin-bottom: 5px; }
.message.evaluation { border-left: 2px solid var(--line); color: var(--soft); padding-left: 12px; }
.message-citations { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; white-space: normal; }
.message-citations a { color: var(--soft); font-size: 11px; text-decoration: none; }
.message-citations a:hover { color: var(--text); text-decoration: underline; }
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.06); margin: 0 clamp(16px,5vw,70px) 18px; padding: 9px 10px 8px; }
.composer-context { align-items:center; color:var(--muted); display:flex; font-size:10px; gap:6px; margin:0 2px 6px; min-width:0; }
.composer-context[hidden] { display:none; }
.composer-context span:nth-child(2) { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.composer-context button { background:transparent; border:0; color:var(--muted); cursor:pointer; font-size:13px; padding:0 2px; }
.composer textarea { background: transparent; border: 0; max-height: 130px; min-height: 24px; outline: 0; resize: none; width: 100%; }
.composer-actions { align-items: center; display: flex; justify-content: space-between; margin-top: 5px; }
.composer-trailing { align-items: center; display: flex; gap: 4px; }
.composer-actions button { background: transparent; border: 0; border-radius: 6px; color: var(--soft); cursor: pointer; font-size: 10px; padding: 5px 7px; }
.composer-actions #chat-dictate.listening { background: var(--blue-soft); color: var(--blue); }
.composer-actions .send-button { background: var(--ink); border-radius: 50%; color: var(--surface); font-size: 14px; height: 27px; padding: 0; width: 27px; }
.composer-actions .send-button.stopping { background: #a73531; font-size: 10px; }
.composer-error { align-items: center; color: #b33b35; display: flex; font-size: 10px; gap: 8px; margin: 6px 2px 0; }
.composer-error span { flex: 1; min-width: 0; }
.composer-error button { background: transparent; border: 1px solid color-mix(in srgb,#b33b35 35%,var(--line)); border-radius: 7px; color: inherit; flex: 0 0 auto; font: inherit; font-weight: 650; padding: 4px 8px; }
.composer-error button:hover { background: color-mix(in srgb,#b33b35 9%,transparent); }

.voice-pane { align-items: center; justify-content: center; }
.voice-pane > .pane-close { position: absolute; top: 10px; }
.voice-center { align-items: center; display: flex; flex-direction: column; gap: 13px; text-align: center; }
.voice-orb { align-items: center; background: radial-gradient(circle at 35% 30%,#54d5ff,#5579f6 44%,#954bea 73%,#d655cd); border: 0; border-radius: 50%; box-shadow: 0 0 28px rgba(74,118,246,.38); color: white; cursor: pointer; display: flex; font-size: 22px; height: 108px; justify-content: center; transition: transform .2s,box-shadow .2s; width: 108px; }
.voice-orb:hover { transform: scale(1.03); }
.voice-orb.listening { animation: breathe 1.4s ease-in-out infinite; }
.voice-center strong { font-size: 12px; }
.voice-model { background: transparent; border: 0; color: var(--soft); cursor: pointer; font-size: 10px; }
#voice-status { color: var(--muted); font-size: 10px; min-height: 14px; }
.voice-transcript { display: flex; flex-direction: column; gap: 7px; max-height: 180px; max-width: min(78vw,520px); overflow-y: auto; width: 420px; }
.voice-turn { font-size: 10px; line-height: 1.4; text-align: left; }
.voice-turn.user { align-self: flex-end; background: var(--rail); border-radius: 9px; padding: 6px 8px; }
.voice-turn.assistant { align-self: flex-start; }

.reader { background: var(--surface); container-type: inline-size; flex-direction: column; }
.reader-header { align-items: center; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: auto minmax(0,1fr) auto; min-height: 46px; padding: 6px 12px; }
.reader-back { background: transparent; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; display: block; font-size: 20px; height: 28px; margin-right: 10px; width: 28px; }
.reader-back:hover:not(:disabled) { background: var(--rail); color: var(--ink); }
.reader-back:disabled { cursor: default; opacity: .34; }
.reader-heading { grid-column: 2; min-width: 0; }
.reader-heading h2 { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-heading p { color: var(--muted); display: flex; font-size: 9px; gap: 8px; margin-top: 2px; overflow: hidden; }
.reader-heading p span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-heading p span:last-child { flex: 0 0 auto; }
.reader-actions { align-items: center; display: flex; gap: 10px; grid-column: 3; margin-left: 10px; min-width: 0; }
.reader-primary-actions { align-items: center; display: flex; gap: 10px; min-width: 0; }
.reader-actions a, .reader-actions button { background: transparent; border: 0; color: var(--blue); cursor: pointer; font-size: 9px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.reader-actions button.preparing { align-items: center; display: inline-flex; gap: 5px; }
.reader-actions button.preparing::before { animation: spin .8s linear infinite; border: 1.5px solid color-mix(in srgb,var(--blue) 25%,transparent); border-radius: 50%; border-top-color: var(--blue); content: ""; height: 9px; width: 9px; }
.reader-actions button.listening { color: #b33b35; }
.reader-overflow { position: relative; }
.reader-overflow summary { align-items: center; border-radius: 6px; color: var(--muted); cursor: pointer; display: flex; font-size: 15px; height: 26px; justify-content: center; list-style: none; width: 26px; }
.reader-overflow summary::-webkit-details-marker { display: none; }
.reader-overflow summary:hover, .reader-overflow[open] summary { background: var(--rail); color: var(--ink); }
.reader-overflow-menu { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.16); display: flex; flex-direction: column; min-width: 148px; padding: 5px; position: absolute; right: 0; top: calc(100% + 5px); z-index: 20; }
.reader-overflow-menu a, .reader-overflow-menu button { border-radius: 5px; color: var(--ink); display: block; font-size: 10px; font-weight: 500; padding: 7px 9px; text-align: left; width: 100%; }
.reader-overflow-menu a:hover, .reader-overflow-menu button:hover { background: var(--rail); }
.reader-header[data-density="standard"] .reader-heading p,
.reader-header[data-density="compact"] .reader-heading p { display: none; }
.reader-header[data-density="compact"] { padding-left: 8px; padding-right: 8px; }
.reader-header[data-density="compact"] .reader-actions,
.reader-header[data-density="compact"] .reader-primary-actions { gap: 6px; }
.reader-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 34px clamp(20px,10cqw,84px) 90px; }
.reader-media { margin: 0 auto 24px; max-width: 920px; width: 100%; }
.reader-media iframe { background: #111; border: 0; border-radius: 8px; display: block; width: 100%; }
.reader-media iframe.video-frame { aspect-ratio: 16 / 9; }
.reader-media iframe.pdf-frame { height: min(74vh,920px); }
.reader-media iframe.external-source-frame { height: min(78vh,980px); }
.reader-status { color: var(--muted); font-size: 10px; margin: 0 auto 22px; max-width: 720px; }
.reader-body { color: var(--ink); font-family: Georgia,"Times New Roman",serif; font-size: clamp(15px,1.25vw,17px); line-height: 1.75; margin: 0 auto; max-width: 720px; overflow-wrap: anywhere; white-space: pre-wrap; }
.reader-body.rich-reader-body { white-space: normal; }
.reader-body.rich-reader-body img, .reader-body.rich-reader-body svg { height: auto; max-width: 100%; }
.reader-body.rich-reader-body figure { margin: 1.5em 0; }
.reader-body.rich-reader-body figcaption { color: var(--muted); font-size: .85em; }
::highlight(feynman-yellow) { background: rgba(255,217,77,.48); }
::highlight(feynman-green) { background: rgba(140,224,140,.48); }
::highlight(feynman-blue) { background: rgba(140,201,255,.48); }
::highlight(feynman-pink) { background: rgba(255,168,199,.48); }
::highlight(feynman-purple) { background: rgba(199,176,255,.48); }
.highlight-quote { border-left: 3px solid rgba(255,217,77,.7); color: var(--muted); font-family: Georgia,"Times New Roman",serif; margin: 0; padding-left: 12px; }
.loading-lines { background: repeating-linear-gradient(to bottom,var(--line) 0 10px,transparent 10px 28px); height: 260px; opacity: .5; }
.reader-placeholder { align-items: center; color: var(--muted); display: flex; flex-direction: column; font-size: 11px; gap: 13px; inset: 46px 0 0; justify-content: center; position: absolute; }
.placeholder-mark { border: 1px solid var(--line); border-radius: 10px; display: block; height: 46px; object-fit: cover; width: 46px; }

.schedule-pane, .tasks-pane, .notepad-pane, .projects-pane { flex-direction: column; }
.schedule-scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px 18px 50px; }
.schedule-day { border-bottom: 1px solid var(--line-soft); display: grid; gap: 13px; grid-template-columns: 66px minmax(0,1fr); min-height: 74px; padding: 11px 0; }
.schedule-day.today .day-label strong { color: var(--blue); }
.schedule-day.drag-over { background: color-mix(in srgb,var(--blue) 8%,transparent); outline: 1px solid color-mix(in srgb,var(--blue) 38%,transparent); outline-offset: -1px; }
.day-label strong, .day-label small { display: block; }
.day-label strong { font-size: 11px; font-weight: 600; }
.day-label small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.day-items { display: flex; flex-direction: column; gap: 4px; }
.schedule-source { align-items: center; background: var(--rail); border: 0; border-radius: 6px; cursor: pointer; display: flex; font-size: 10px; gap: 7px; padding: 7px 9px; text-align: left; }
.schedule-source.done { color: var(--muted); text-decoration: line-through; }
.schedule-empty { color: var(--muted); font-size: 10px; padding: 7px 2px; }

.tasks-scroll { display: flex; flex: 1; flex-direction: column; gap: 7px; min-height: 0; overflow: auto; padding: 12px 18px 50px; }
.task-card { background: var(--rail); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 11px; }
.task-card.paused { opacity: 0.62; }
.task-head { align-items: center; display: flex; gap: 9px; }
.task-head > div { min-width: 0; }
.task-title { display: block; font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-schedule { color: var(--muted); display: block; font-size: 9px; margin-top: 2px; }
.task-actions { display: flex; gap: 4px; margin-left: auto; }
.task-runs { border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 3px; margin-top: 9px; padding-top: 8px; }
.task-run { align-items: baseline; color: var(--muted); display: flex; font-size: 9px; gap: 7px; }
.task-run.failed { color: var(--danger, #c0392b); }
.task-run button { background: none; border: 0; color: var(--blue); cursor: pointer; font-size: 9px; margin-left: auto; padding: 0; }
.tasks-empty { color: var(--muted); font-size: 10px; padding: 7px 2px; }

.notepad-pane { container-type: inline-size; }
.notepad-body { display: grid; flex: 1; grid-template-columns: minmax(150px,230px) minmax(0,1fr); min-height: 0; position:relative; }
.notepad-body.list-collapsed { grid-template-columns: minmax(0,1fr); }
.notepad-body.list-collapsed .notepad-list { display: none; }
.notepad-list { background: color-mix(in srgb,var(--rail) 46%,var(--surface)); border-right: 1px solid var(--line-soft); display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.notepad-heading { align-items: center; display: flex; gap: 7px; }
.notepad-heading > div { min-width: 0; }
.notepad-list-toggle { font-size: 13px; height: 26px; padding: 0; width: 26px; }
.notepad-list-toggle[aria-pressed="true"] { color: var(--blue); }
/* Formatting sits beside the pane title, where it holds still, rather than in a
   bubble that follows the selection across the sentence being written. */
.notepad-format { align-items: center; display: flex; gap: 1px; }
.notepad-format[hidden] { display: none; }
.notepad-format-button { font-size: 12px; height: 26px; padding: 0; width: 26px; }
.notepad-format-button[aria-pressed="true"] { color: var(--blue); }
.notepad-format-button[data-format="bold"] { font-weight: 700; }
.notepad-format-button[data-format="italic"] { font-style: italic; }
.notepad-format-button[data-format="strikethrough"] { text-decoration: line-through; }
.notepad-format-divider { background: var(--rail-hover); height: 14px; margin: 0 4px; width: 1px; }
.notepad-more { font-size:10px; letter-spacing:1px; min-width:30px; }
.notepad-search { align-items:center; border-bottom:1px solid var(--line-soft); color:var(--muted); display:flex; flex:0 0 auto; gap:6px; height:36px; padding:0 10px; }
.notepad-search input { background:transparent; border:0; color:var(--ink); font:inherit; font-size:10px; min-width:0; outline:0; width:100%; }
.notepad-search input::placeholder { color:var(--muted); }
.notepad-list-items { min-height:0; overflow-y:auto; padding:7px; }
.notepad-row { background: transparent; border: 0; border-radius: 7px; cursor: pointer; display: block; padding: 9px 10px; text-align: left; width: 100%; }
.notepad-row:hover { background: var(--rail-hover); }
.notepad-row.selected { background: var(--blue-soft); }
.notepad-row strong, .notepad-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notepad-row-title { align-items: baseline; display: flex; gap: 5px; min-width: 0; }
.notepad-row-title strong { min-width: 0; }
.notepad-draft-capsule { background: var(--rail-hover); border-radius: 999px; color: var(--muted); flex: 0 0 auto; font-size: 7px; font-weight: 650; line-height: 1; padding: 3px 5px; }
.notepad-row strong { font-size: 10px; font-weight: 620; }
.notepad-row small { color: var(--muted); font-size: 8px; margin-top: 3px; }
.notepad-empty { color: var(--muted); font-size: 10px; padding: 10px 8px; }
.notepad-document { display: flex; flex-direction: column; min-height: 0; position: relative; }
.notepad-document-tabs { display: none; left: 10px; max-height: calc(100% - 30px); overflow: hidden; position: absolute; top: 18px; width: 142px; z-index: 10; }
.notepad-document-tabs header { align-items: center; display: flex; font-size: 11px; height: 28px; justify-content: space-between; padding: 0 6px 0 8px; }
.notepad-document-tabs header strong { font-weight: 650; }
.notepad-document-tab-add { align-items: center; background: transparent; border: 0; border-radius: 6px; color: var(--ink); cursor: pointer; display: flex; font: 400 19px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif; height: 25px; justify-content: center; padding: 0; width: 25px; }
.notepad-document-tab-add:hover,.notepad-document-tab-add:focus-visible { background: var(--rail-hover); outline: 0; }
.notepad-document-tab-list { max-height: calc(100% - 30px); overflow-y: auto; padding: 3px 0; }
.notepad-document-tab { align-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--ink); cursor: pointer; display: flex; font: 500 10px/1.25 -apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif; gap: 8px; min-width: 0; padding: 8px; text-align: left; width: 100%; }
.notepad-document-tab:hover { background: var(--rail-hover); }
.notepad-document-tab.active { background: var(--blue-soft); color: var(--blue); }
.notepad-document-tab > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notepad-document-tab-icon { border: 1.4px solid currentColor; border-radius: 2px; box-sizing: border-box; flex: 0 0 auto; height: 14px; width: 12px; }
.notepad-document-tab-icon::after { background: currentColor; box-shadow: 0 3px 0 currentColor; content: ""; display: block; height: 1px; margin: 4px 2px; width: 6px; }
.slash-menu { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.16); display: flex; flex-direction: column; overflow: hidden; position: absolute; width: min(280px,88vw); z-index: 15; }
.slash-menu-list { max-height: 220px; overflow-y: auto; padding: 4px; }
.slash-menu-item { align-items: baseline; background: transparent; border: 0; border-radius: 7px; cursor: pointer; display: flex; font: inherit; gap: 10px; justify-content: space-between; padding: 7px 10px; text-align: left; width: 100%; }
.slash-menu-item strong, .slash-menu-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slash-menu-item strong { font-size: 13px; font-weight: 500; }
.slash-menu-item small { color: var(--muted); flex-shrink: 0; font-size: 10px; }
.slash-menu-item:hover, .slash-menu-item.active { background: var(--rail-hover); }
.slash-menu-empty { color: var(--muted); font-size: 11px; padding: 10px 12px; }
.slash-menu-filter { align-items: baseline; border-top: 1px solid var(--line-soft); display: flex; font-size: 12px; gap: 4px; padding: 9px 14px; }
.slash-menu-filter span { color: var(--soft); }
.slash-menu-filter em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slash-menu-filter em.placeholder { color: var(--muted); }
.notepad-title { background: var(--surface); border: 0; color: var(--ink); font-size: 18px; font-weight: 600; margin: 0 auto; max-width: 760px; outline: 0; padding: 22px 42px 7px; width: 100%; }
.notepad-source-shelf { align-items:center; border-top:1px solid var(--line-soft); display:flex; flex:0 0 auto; gap:5px; margin:0 auto; max-width:760px; min-height:38px; overflow-x:auto; padding:5px 42px; scrollbar-width:none; width:100%; }
.notepad-source-shelf[hidden] { display:none; }
.notepad-source-shelf::-webkit-scrollbar { display:none; }
.notepad-source-shelf-icon { color:var(--muted); flex:0 0 auto; font-size:10px; margin-right:2px; }
.notepad-source-chip { align-items:center; background:color-mix(in srgb,var(--blue) 7%,transparent); border:1px solid color-mix(in srgb,var(--blue) 20%,transparent); border-radius:5px; display:flex; flex:0 0 auto; max-width:190px; opacity:1; overflow:hidden; }
.notepad-source-chip.inherited { background:color-mix(in srgb,var(--ink) 4%,transparent); border-color:color-mix(in srgb,var(--ink) 12%,transparent); }
.notepad-source-chip.muted { opacity:.45; }
.notepad-source-chip-number { color:var(--blue); flex:0 0 auto; font-size:9px; font-variant-numeric:tabular-nums; font-weight:650; padding-left:7px; }
.notepad-source-chip button,.notepad-source-add { background:transparent; border:0; color:var(--ink); cursor:pointer; font:inherit; }
.notepad-source-chip-open { align-items:center; display:flex; font-size:9px; font-weight:540; gap:5px; max-width:160px; overflow:hidden; padding:5px 3px 5px 7px; text-overflow:ellipsis; white-space:nowrap; }
.notepad-source-chip-thumbnail { align-items:center; border-radius:4px; display:flex; flex:0 0 auto; height:20px; justify-content:center; overflow:hidden; position:relative; width:20px; }
.notepad-source-chip-thumbnail .thumbnail-fallback { height:14px; width:14px; }
.notepad-source-chip-thumbnail .thumbnail-fallback.tab-glyph { height:12px; width:12px; }
.notepad-source-chip-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notepad-source-chip.inherited .notepad-source-chip-open::before { content:"·"; flex:0 0 auto; font-size:11px; }
.notepad-source-chip-toggle { color:var(--blue) !important; font-size:8px !important; padding:5px 7px 5px 3px; }
.notepad-source-add { color:var(--muted); font-size:16px; height:24px; line-height:1; padding:0 5px; }
.notepad-source-chip button:hover,.notepad-source-add:hover { color:var(--blue); }
.notepad-editor { background: var(--surface); border: 0; color: var(--ink); flex: 1; font-family: var(--font); font-size: 14px; line-height: 1.7; margin: 0 auto; max-width: 760px; min-height: 0; outline: 0; padding: 10px 42px 100px; resize: none; width: 100%; }
.notepad-editor-state { display:none; }
.notepad-rich-editor { background:var(--surface); border:0; flex:1; min-height:0; width:100%; }
.notepad-selection-ask { background: var(--surface); border: 1px solid color-mix(in srgb,var(--blue) 28%,var(--line)); border-radius: 999px; box-shadow: 0 8px 22px rgba(0,0,0,.18); color: var(--blue); cursor: pointer; font: inherit; font-size: 10px; font-weight: 620; padding: 6px 9px; position: absolute; z-index: 12; }
.notepad-fold-controls { inset: 0; overflow: hidden; pointer-events: none; position: absolute; z-index: 11; }
.notepad-fold-toggle { align-items: center; background: transparent; border: 0; border-radius: 5px; color: var(--muted); cursor: pointer; display: flex; height: 20px; justify-content: center; opacity: 0; padding: 0; pointer-events: auto; position: absolute; transition: opacity 100ms ease,background 100ms ease,color 100ms ease; width: 20px; }
.notepad-fold-toggle.is-heading-hovered,.notepad-fold-toggle:hover,.notepad-fold-toggle:focus-visible { opacity: 1; }
.notepad-fold-toggle:hover,.notepad-fold-toggle:focus-visible { background: var(--rail-hover); color: var(--ink); outline: 0; }
.notepad-fold-toggle > svg { fill: none; height: 12px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; transition: transform 140ms ease; width: 12px; }
.notepad-fold-toggle.is-collapsed > svg { transform: rotate(-90deg); }
.notepad-editor:disabled { color: var(--muted); }
.notepad-editor.drag-over { background: color-mix(in srgb,var(--blue) 5%,var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--blue) 60%,transparent); }

@container (max-width: 800px) {
  .notepad-body, .notepad-body:not(.list-collapsed) { grid-template-columns: minmax(0,1fr); }
  .notepad-list { display: none; }
  .notepad-body:not(.list-collapsed) .notepad-list { bottom:0; box-shadow:10px 0 28px rgba(0,0,0,.13); display:flex; left:0; position:absolute; top:0; width:min(300px,88%); z-index:20; }
  .notepad-title,.notepad-editor,.notepad-source-shelf { padding-left:24px; padding-right:24px; }
}
@container (min-width: 820px) {
  .notepad-document-tabs:not(:empty) { display: block; }
  .notepad-document .notepad-title,.notepad-document .notepad-editor,.notepad-document .notepad-source-shelf { transform: translateX(72px); width: calc(100% - 144px); }
}
@container (max-width: 520px) {
  .notepad-editor { padding:18px 18px 70px; }
  .notepad-title { padding:18px 18px 6px; }
  .notepad-source-shelf { padding-left:18px; padding-right:18px; }
}
@media(max-width:680px){.audiobook-player{grid-template-columns:minmax(80px,1fr) auto auto}.audiobook-progress{display:none}.audiobook-time{display:none}}
.projects-grid { display: grid; flex: 1; gap: 12px; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); min-height: 0; overflow-y: auto; padding: 18px; }
.project-toolbar-actions { min-width: 0; }
.project-search { background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; }
.project-search:focus-within { border-color: var(--blue); }
.project-search input { background: transparent; border: 0; font-size: 10px; outline: 0; width: min(18vw,180px); }
.project-icon-action,.project-icon-select { align-items:center; background:transparent; border:0; border-radius:5px; color:var(--soft); cursor:pointer; display:inline-flex; flex:0 0 26px; height:26px; justify-content:center; padding:0; position:relative; width:26px; }
.project-icon-action:hover,.project-icon-select:hover,.project-icon-select:focus-within { background:var(--rail-hover); color:var(--ink); }
.project-icon-action:focus-visible,.project-icon-select:focus-within { outline:2px solid color-mix(in srgb,var(--blue) 65%,transparent); outline-offset:1px; }
.project-icon-action svg,.project-icon-select svg { fill:none; height:14px; pointer-events:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.5; width:14px; }
.project-icon-select select { cursor:pointer; height:100%; inset:0; opacity:0; position:absolute; width:100%; }
.project-card { background: var(--rail); border: 1px solid var(--line-soft); border-radius: 10px; cursor: pointer; min-height: 130px; padding: 14px; text-align: left; }
.project-card:hover { border-color: var(--line); transform: translateY(-1px); }
.project-card h3 { font-size: 13px; font-weight: 600; line-height: 1.25; }
.project-card p { color: var(--soft); display: -webkit-box; font-size: 10px; line-height: 1.45; margin-top: 8px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.project-card small { color: var(--muted); display: block; font-size: 9px; margin-top: 12px; }
.project-detail { grid-column: 1 / -1; margin: 0 auto; max-width: 760px; padding: 8px 4px 40px; width: 100%; }
.project-detail > h3 { font-size: 21px; margin-top: 24px; }
.project-detail > p { color: var(--soft); font-size: 11px; line-height: 1.5; margin-top: 7px; }
.project-detail-actions { display: flex; gap: 7px; margin: 17px 0 22px; }
.project-inspector-section { border-top: 1px solid var(--line-soft); padding: 16px 0; }
.project-inspector-section > header { align-items: center; display: flex; justify-content: space-between; margin-bottom: 10px; }
.project-inspector-section h4 { font-size: 12px; font-weight: 650; }
.project-inspector-section > header small { color: var(--muted); font-size: 9px; }
.project-question-list { color: var(--soft); display: grid; font-size: 11px; gap: 7px; line-height: 1.45; padding-left: 20px; }
.project-goal-row { align-items: center; display: grid; gap: 8px; grid-template-columns: 18px minmax(0,1fr) auto; min-height: 38px; }
.goal-completion { background: transparent; border: 1px solid var(--muted); border-radius: 50%; color: white; cursor: pointer; font-size: 9px; height: 16px; width: 16px; }
.goal-completion.done { background: var(--blue); border-color: var(--blue); }
.goal-copy { background: transparent; border: 0; cursor: pointer; min-width: 0; text-align: left; }
.goal-copy strong, .goal-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-copy strong { font-size: 11px; font-weight: 580; }
.goal-copy small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.question-editor-list { display: grid; gap: 7px; margin-bottom: 9px; }
.question-editor-row { display: grid; gap: 6px; grid-template-columns: minmax(0,1fr) auto; }
.question-editor-row input { width: 100%; }
.project-sources { min-width: 0; }
.project-book-source { border-bottom: 1px solid var(--line-soft); padding: 4px 0; }
.project-book-source:last-child { border-bottom: 0; }
.project-book-source-header { align-items: center; display: grid; gap: 9px; grid-template-columns: 31px minmax(0,1fr); padding: 3px 1px 5px; }
.project-book-source-header strong, .project-book-source-header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-book-source-header strong { font-size: 10px; }
.project-book-source-header small { color: var(--muted); font-size: 8px; margin-top: 2px; }
.project-book-chapters { border-left: 1px solid var(--line-soft); margin-left: 15px; padding-left: 15px; }
.source-picker-row.project-book-chapter { grid-template-columns: minmax(0,1fr) auto; }

.studio-dialog { background: transparent; border: 0; color: var(--ink); padding: 0; width: min(92vw,520px); }
.studio-dialog::backdrop { background: rgba(20,21,23,.36); backdrop-filter: blur(2px); }
.dialog-card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 22px 70px rgba(0,0,0,.24); max-height: min(78vh,680px); overflow: hidden; }
.dialog-card > header { align-items: center; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; padding: 13px 15px; }
.dialog-card > header h2 { font-size: 13px; }
.dialog-card > header button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; }
.dialog-body { display: flex; flex-direction: column; gap: 10px; max-height: calc(78vh - 110px); overflow: auto; padding: 15px; }
.dialog-body label { color: var(--soft); display: flex; flex-direction: column; font-size: 9px; gap: 5px; }
.dialog-body input, .dialog-body textarea, .dialog-body select { background: var(--field); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font: inherit; font-size: 11px; padding: 8px 9px; }
.dialog-body textarea { min-height: 82px; resize: vertical; }
.dialog-body .dialog-checkbox-row { align-items: center; color: var(--ink); flex-direction: row; font-size: 11px; gap: 8px; }
.dialog-body .dialog-checkbox-row input { accent-color: var(--blue); margin: 0; padding: 0; }
.dialog-card > footer { align-items: center; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; min-height: 49px; padding: 9px 15px; }
.dialog-button { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); cursor: pointer; font-size: 10px; padding: 7px 11px; }
.dialog-button.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.dialog-button.danger { color: #b33b35; }
.studio-dialog.settings-dialog { width: min(94vw,860px); }
.settings-dialog .dialog-card { display: flex; flex-direction: column; height: min(80vh,650px); }
.settings-dialog .dialog-body { flex: 1; max-height: none; overflow: hidden; padding: 0; }
/* The Mac settings window draws at the system 13pt body size, not the
   compact scale the rest of Studio uses, so the shell sets its own base. */
.settings-shell { display: grid; flex: 1; font-size: 13px; grid-template-columns: 232px minmax(0,1fr); min-height: 0; }
.settings-sidebar { background: var(--rail); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; padding-top: 12px; }
.settings-search { background: var(--surface); border: 1px solid color-mix(in srgb,var(--ink) 12%,transparent); border-radius: 8px; color: var(--ink); font-size: 13px; margin: 0 10px; padding: 6px 8px; }
.settings-navigation { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; }
.settings-nav-group { display: grid; gap: 1px; }
.settings-nav-group h4 { color: var(--soft); font-size: 11px; font-weight: 600; padding: 16px 7px 4px; }
.settings-nav-row { align-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--ink); cursor: pointer; display: flex; font-size: 13px; gap: 9px; padding: 5px 7px; text-align: left; width: 100%; }
.settings-nav-row:hover { background: var(--rail-hover); }
.settings-nav-row.selected { background: color-mix(in srgb,var(--ink) 8%,transparent); font-weight: 500; }
.settings-nav-icon { align-items: center; background: #777; border-radius: 5.5px; color: white; display: flex; flex: 0 0 auto; height: 20px; justify-content: center; width: 20px; }
.settings-nav-icon svg { fill: none; height: 13px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; width: 13px; }
.settings-nav-icon.purple { background: linear-gradient(145deg,#a06be8,#7141bd); }
.settings-nav-icon.gray { background: linear-gradient(145deg,#9b9da1,#6f7277); }
.settings-nav-icon.teal { background: linear-gradient(145deg,#4bbcac,#238e83); }
.settings-nav-icon.blue { background: linear-gradient(145deg,#5b9cff,#2874df); }
.settings-nav-icon.indigo { background: linear-gradient(145deg,#7e7de9,#514ec0); }
.settings-nav-icon.orange { background: linear-gradient(145deg,#f0a23c,#d1741a); }
.settings-sidebar-footer { align-items: center; border-top: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: 24px minmax(0,1fr); padding: 10px 12px; }
.settings-sidebar-footer .settings-account-avatar { font-size: 10px; height: 25px; width: 25px; }
.settings-app-mark { border-radius: 6px; display: block; height: 24px; object-fit: cover; width: 24px; }
.settings-sidebar-footer > span:last-child { min-width: 0; }
.settings-sidebar-footer strong, .settings-sidebar-footer small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-sidebar-footer strong { font-size: 11px; font-weight: 500; }
.settings-sidebar-footer small { color: var(--muted); font-size: 10px; }
.settings-panels { background: var(--paper); min-height: 0; overflow-y: auto; padding: 24px; }
.settings-panel { max-width: 760px; }
.settings-panel[hidden] { display: none; }

.settings-section + .settings-section { margin-top: 24px; }
.settings-section > h4 { color: var(--ink); font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.settings-section > p { color: var(--soft); font-size: 11px; margin: -7px 0 10px; }
.settings-card { background: var(--surface); border: 1px solid color-mix(in srgb,var(--ink) 6%,transparent); border-radius: 18px; overflow: hidden; padding: 0 18px; }
.dialog-body .settings-control-row { align-items: center; color: var(--ink); display: grid; flex-direction: initial; font-size: inherit; gap: 14px; grid-template-columns: minmax(0,1fr) minmax(140px,240px); min-height: 44px; padding: 8px 1px; }
/* A hairline mixed from the ink, so it stays visible on the card in both
   themes the way an AppKit Divider does. `--line-soft` is darker than the
   card in dark mode, which made the rows read as one block. */
.settings-control-row + .settings-control-row { border-top: 1px solid color-mix(in srgb,var(--ink) 11%,transparent); }
/* Pin rows carry their own icon column, so they override the two-column grid
   the value-bearing rows use. */
.dialog-body .settings-control-row.source-pin-row { grid-template-columns: 22px minmax(0,1fr) auto; min-height: 44px; }
.source-pin-row .settings-tab-icon { height: 22px; width: 22px; }
.source-pin-row .settings-control-copy { font-size: 13px; }
.source-pin-row .settings-switch:disabled { cursor: default; opacity: .45; }
.settings-control-copy { min-width: 0; }
.settings-control-copy strong, .settings-control-copy small { display: block; }
.settings-control-copy strong { color: var(--ink); font-size: 13px; font-weight: 500; }
.settings-control-copy small { color: var(--muted); font-size: 11px; margin-top: 1px; }
.settings-control-row select, .settings-control-row input[type="text"] { min-width: 0; width: 100%; }
.automatic-audio-section { border: 1px solid color-mix(in srgb, #b4540a 34%, transparent); border-radius: 10px; margin: 6px 0; padding: 8px 10px; }
.automatic-audio-section > summary { color: #b4540a; cursor: pointer; font-size: 13px; font-weight: 500; }
.automatic-audio-section[open] > summary { margin-bottom: 6px; }
.automatic-audio-caution { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
@media (prefers-color-scheme: dark) {
  .automatic-audio-section { border-color: color-mix(in srgb, #f0a26a 38%, transparent); }
  .automatic-audio-section > summary { color: #f0a26a; }
}
.automatic-audio-filter { display: grid; gap: 7px; grid-column: 1 / -1; grid-template-columns: minmax(0,1fr) auto; padding: 0 0 8px; }
.automatic-audio-check { min-width: 72px; }
.automatic-audio-preview { color: var(--muted); font-size: 13px; grid-column: 1 / -1; }
.automatic-audio-preview summary { cursor: pointer; }
.automatic-audio-preview ul { margin: 7px 0 0; max-height: 180px; overflow: auto; padding-left: 20px; }
.settings-route-control { display: grid; gap: 5px; grid-template-columns: minmax(0,.9fr) minmax(0,1.25fr) minmax(0,.8fr); }
.settings-task-route-control { display: grid; gap: 5px; }
.settings-task-route-control > .settings-route-control[hidden] { display: none; }
.settings-control-row .settings-switch { appearance: none; background: radial-gradient(circle at 7px 50%,#fff 0 5px,transparent 5.5px),#9b9da1; border: 0; border-radius: 10px; cursor: pointer; height: 16px; justify-self: end; padding: 0; transition: background .14s; width: 28px; }
.settings-control-row .settings-switch:checked { background: radial-gradient(circle at 21px 50%,#fff 0 5px,transparent 5.5px),var(--blue); }
.settings-range-control { align-items: center; display: grid; gap: 8px; grid-template-columns: minmax(90px,1fr) 38px; }
.settings-voice-rating { align-items: center; display: grid; gap: 5px; grid-template-columns: minmax(0,1fr) 30px 30px; }
.settings-voice-rating-button { align-items: center; background: transparent; border: 1px solid color-mix(in srgb,var(--ink) 14%,transparent); border-radius: 7px; cursor: pointer; display: inline-flex; height: 30px; justify-content: center; padding: 0; }
.settings-voice-rating-button.is-selected { background: color-mix(in srgb,var(--blue) 16%,transparent); border-color: var(--blue); }
.settings-range { accent-color: var(--blue); min-width: 0; padding: 0 !important; width: 100%; }
.settings-range-value { color: var(--muted); font-size: 11px; text-align: right; }
.settings-account-control { grid-template-columns: 32px minmax(0,1fr) auto; }
.settings-account-avatar { align-items: center; background: #bcb8b1; border-radius: 50%; color: white; display: flex; font-size: 11px; font-weight: 650; height: 30px; justify-content: center; width: 30px; }
/* Scoped to the settings shell so the other dialogs keep their own scale. */
.settings-shell .dialog-button { font-size: 12px; padding: 5px 11px; }
.settings-inline-button { justify-self: end; }
.source-picker-row { align-items: center; border-bottom: 1px solid var(--line-soft); display: grid; gap: 9px; grid-template-columns: 31px minmax(0,1fr) auto; padding: 7px 1px; }
.source-picker-row:last-child { border-bottom: 0; }
.source-picker-row strong, .source-picker-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-picker-row strong { font-size: 10px; }
.source-picker-row small { color: var(--muted); font-size: 8px; margin-top: 2px; }
.source-picker-choice { background: transparent; border-left: 0; border-right: 0; border-top: 0; color: inherit; cursor: pointer; text-align: left; width: 100%; }
.source-picker-choice:hover { background: var(--rail-hover); }
.notepad-source-picker-controls { display: grid; gap: 8px; grid-template-columns: minmax(0,1fr) auto; }
.notepad-source-picker-list { max-height: min(54vh,470px); overflow-y: auto; }
.notepad-source-picker-mark { color: var(--muted); font-size: 13px; text-align: center; width: 18px; }
.source-picker-choice[aria-pressed="true"] .notepad-source-picker-mark,
.source-picker-choice[aria-pressed="mixed"] .notepad-source-picker-mark { color: var(--blue); }
.dialog-selection-count { color: var(--muted); font-size: 10px; margin-right: auto; }
.hidden-item-icon { align-items: center; background: var(--rail); border-radius: 6px; color: var(--muted); display: flex; height: 29px; justify-content: center; width: 29px; }
.dialog-empty, .dialog-separator { color: var(--muted); font-size: 10px; text-align: center; }
.dialog-note { color: var(--muted); font-size: 9px; line-height: 1.45; }
.add-menu { display: flex; flex-direction: column; gap: 4px; }
.add-menu-item { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); cursor: pointer; font: inherit; font-size: 11px; padding: 9px 11px; text-align: left; }
.add-menu-item:hover { background: var(--rail-hover); }
.dialog-separator { align-items: center; display: flex; gap: 9px; }
.dialog-separator::before, .dialog-separator::after { background: var(--line-soft); content: ""; flex: 1; height: 1px; }
.studio-toast { background: var(--ink); border-radius: 8px; bottom: 18px; color: var(--surface); font-size: 10px; left: 50%; max-width: min(90vw,440px); padding: 9px 13px; position: fixed; transform: translateX(-50%); z-index: 40; }
.schedule-source-row { align-items: stretch; display: grid; gap: 3px; grid-template-columns: minmax(0,1fr) 25px 25px; }
.schedule-more { background: transparent; border: 0; border-radius: 5px; color: var(--muted); cursor: pointer; }
.schedule-more:hover { background: var(--rail-hover); }
.schedule-completion { color: var(--blue); font-size: 12px; }

/* Sources: the far-right Mac rail. */
.tab-strip { border-bottom: 1px solid var(--line); display: flex; gap: 1px; overflow: hidden; padding: 5px 7px; }
.tab-strip::-webkit-scrollbar { display: none; }
.tab { align-items: center; background: transparent; border: 0; border-radius: 5px; color: var(--soft); cursor: pointer; display: flex; flex: 1 1 38px; flex-direction: column; gap: 2px; min-width: 32px; padding: 5px 3px 4px; }
.tab:hover { background: var(--rail-hover); }
.tab.selected { background: color-mix(in srgb,var(--tab-accent) 14%,transparent); color: var(--tab-accent); }
.tab-icon { height: 18px; width: 18px; }
.tab:not(.selected) .tab-icon { opacity: .72; }
/* The bare X glyph fills its whole frame while the brand badges carry built-in
   padding, so at an equal box it reads heavier. Match the Mac and shrink it. */
.tab-glyph { color: var(--ink); }
.tab-icon.tab-glyph { height: 15px; width: 15px; }
.tab-label { font-size: 8px; font-weight: 550; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-strip.icons-only .tab-label { display: none; }
.source-tab-more { appearance: none; background: transparent; border: 0; border-radius: 5px; color: var(--muted); cursor: pointer; flex: 0 0 32px; font: inherit; font-size: 12px; min-width: 32px; padding: 0; text-align: center; }
.source-tab-more:hover { background: var(--rail-hover); color: var(--ink); }
.search-row { align-items: center; display: flex; gap: 5px; padding: 7px 9px; }
.search-field { align-items: center; background: var(--field); border: 1px solid var(--line); border-radius: 6px; display: flex; flex: 1; gap: 5px; min-width: 0; padding: 4px 7px; }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb,var(--blue) 20%,transparent); }
.search-field svg { fill: none; height: 13px; stroke: var(--muted); stroke-width: 1.8; width: 13px; }
.search-field input { background: transparent; border: 0; font-size: 10px; min-width: 0; outline: 0; width: 100%; }
#refresh, #source-add, #source-filter, #source-select { align-items: center; background: transparent; border: 0; border-radius: 5px; color: var(--soft); cursor: pointer; display: flex; flex: 0 0 auto; height: 25px; justify-content: center; position: relative; width: 25px; }
#refresh:hover, #source-add:hover, #source-filter:hover, #source-select:hover, #source-select.selected { background: var(--rail-hover); color: var(--ink); }
#source-filter.active { background: color-mix(in srgb,var(--blue) 14%,transparent); color: var(--blue); }
#refresh svg, #source-filter svg { fill: none; height: 14px; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; width: 14px; }
.filter-count { align-items: center; background: var(--blue); border-radius: 7px; color: #fff; display: flex; font-size: 8px; font-weight: 700; height: 11px; justify-content: center; min-width: 11px; padding: 0 2px; position: absolute; right: 0; top: 0; }
.filter-group { display: flex; flex-direction: column; gap: 7px; }
.filter-group h4 { color: var(--muted); font-size: 10px; font-weight: 600; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip { background: var(--field); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; font-size: 11px; padding: 4px 11px; }
.filter-chip:hover { border-color: var(--blue); }
.filter-chip.selected { background: var(--blue); border-color: var(--blue); color: #fff; }
#refresh.spinning svg { animation: spin .8s linear infinite; }
.source-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 5px 10px; }
.source-list { display: flex; flex-direction: column; }
.group-header { align-items: center; background: transparent; border: 0; border-radius: 5px; cursor: pointer; display: grid; gap: 6px; grid-template-columns: 12px 30px minmax(0,1fr) auto 20px; padding: 6px 7px; text-align: left; width: 100%; }
.group-header:hover { background: var(--rail-hover); }
.group-chevron { color: var(--muted); font-size: 12px; transition: transform .12s; }
.group-header.expanded .group-chevron { transform: rotate(90deg); }
.group-copy { min-width: 0; }
.group-copy strong, .group-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-copy strong { font-size: 10px; font-weight: 620; }
.group-copy small, .group-count { color: var(--muted); font-size: 8px; }
.group-more { border-radius: 4px; color: var(--muted); font-size: 8px; opacity: 0; padding: 4px 1px; text-align: center; }
.group-header:hover .group-more, .group-more:focus-visible { opacity: 1; }
.source-row { align-items: center; background: transparent; border: 0; border-radius: 5px; cursor: pointer; display: grid; gap: 7px; grid-template-columns: 30px minmax(0,1fr) auto 20px; min-height: 39px; padding: 4px 7px; text-align: left; width: 100%; }
.source-row.selection-mode { grid-template-columns: 16px 30px minmax(0,1fr) auto 20px; }
.source-row.without-row-badges { grid-template-columns: 30px minmax(0,1fr) 20px; }
.source-row.selection-mode.without-row-badges { grid-template-columns: 16px 30px minmax(0,1fr) 20px; }
.source-check { align-items: center; border: 1px solid var(--muted); border-radius: 4px; display: flex; font-size: 8px; height: 13px; justify-content: center; width: 13px; }
.source-check.selected { background: var(--blue); border-color: var(--blue); color: white; }
.source-row.nested { padding-left: 23px; }
.source-row:hover { background: var(--rail-hover); }
.source-row.selected { background: var(--blue-soft); }
.source-thumb, .group-thumb, .continue-thumb { align-items: center; background: transparent; border-radius: 5px; display: flex; flex: 0 0 auto; height: 29px; justify-content: center; overflow: hidden; position: relative; width: 29px; }
.continue-thumb { height: 31px; width: 31px; }
.thumbnail-fallback { height: 24px; object-fit: contain; width: 24px; }
.thumbnail-fallback.tab-glyph { height: 20px; width: 20px; }
.thumbnail-artwork { height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; }
.cloud-asset { background: var(--rail); }
.source-copy { min-width: 0; }
.source-title-line { align-items: center; display: flex; gap: 4px; min-width: 0; }
.source-copy strong, .source-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-copy strong { font-size: 10px; font-weight: 550; line-height: 1.25; }
.source-copy small { color: var(--muted); font-size: 8px; margin-top: 1px; }
.source-row-badges { align-items: center; display: flex; gap: 5px; min-width: 12px; }
.audio-ready-mark { align-items: center; color: var(--blue); display: flex; height: 13px; justify-content: center; width: 13px; }
.audio-ready-mark svg { fill: none; height: 13px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 13px; }
.source-status { align-items: center; border-radius: 50%; color: var(--muted); display: flex; height: 16px; justify-content: center; width: 16px; }
.source-status svg { fill: none; height: 13px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 13px; }
.source-status[role="button"] { cursor: pointer; }
.source-status[role="button"]:hover,.source-status[role="button"]:focus-visible { background: var(--rail-hover); }
.source-status.listened { color: var(--blue); }
.source-status.read { color: #299d50; }
.source-status.reviewed { color: #8b5fc7; }
.source-more { background: transparent; border: 0; border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 8px; opacity: 0; padding: 4px 1px; }
.source-row:hover .source-more, .source-more:focus-visible { opacity: 1; }
.empty-view { color: var(--muted); font-size: 10px; padding: 48px 20px; text-align: center; }
.connector-empty-view { align-items: center; display: flex; flex-direction: column; gap: 8px; }
.connector-empty-icon { height: 34px; margin-bottom: 2px; width: 34px; }
.connector-empty-view strong { color: var(--ink); font-size: 12px; font-weight: 620; }
.connector-empty-view span { line-height: 1.4; max-width: 240px; }
.connector-empty-action { background: var(--blue); border: 0; border-radius: 6px; color: #fff; cursor: pointer; font: inherit; font-size: 10px; font-weight: 600; margin-top: 4px; padding: 7px 10px; text-decoration: none; }
.connector-empty-action:hover { filter: brightness(1.08); }
/* The Mac sidebar's per-tab ingestion button: prominent, tinted per tab, and
   the first thing in the list rather than a toolbar affordance. */
.tab-add-action { padding: 8px 2px 2px; }
.tab-add-button { background: var(--add-accent); border: 0; border-radius: 7px; color: #fff; cursor: pointer; display: block; font: inherit; font-size: 10px; font-weight: 600; padding: 8px 10px; width: 100%; }
.tab-add-button:hover { filter: brightness(1.08); }
.tab-add-button.file-drop { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--add-accent); filter: brightness(1.08); }
.load-more { background: transparent; border: 1px solid var(--line); border-radius: 6px; color: var(--soft); cursor: pointer; display: block; font-size: 9px; margin: 10px auto; padding: 5px 10px; }
.selection-tray { background: color-mix(in srgb,var(--rail) 94%,var(--surface)); border-top: 1px solid var(--line); padding: 8px 9px; }
.selection-tray > strong { display: block; font-size: 9px; margin-bottom: 7px; }
.selection-tray > div { display: flex; gap: 4px; }
.selection-tray button { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; color: var(--soft); cursor: pointer; font-size: 8px; padding: 5px 7px; }
.selection-tray button:hover { color: var(--ink); }
#selection-remove { color: #b33b35; }
#selection-clear { margin-left: auto; }
.rail-footer { align-items: center; border-top: 1px solid var(--line); color: var(--muted); display: flex; font-size: 8px; gap: 8px; justify-content: space-between; padding: 7px 10px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .3; transform: scale(.75); } }
@keyframes breathe { 50% { box-shadow: 0 0 45px rgba(87,103,255,.62); transform: scale(1.05); } }

@media (max-width: 1100px) {
    :root { --nav-width: 210px; --sources-width: 330px; }
    .tab-label { display: none; }
}
@media (max-width: 820px) {
    .library-view { grid-template-columns: 210px minmax(0,1fr); }
    .sources-rail { bottom: 0; box-shadow: -8px 0 24px rgba(0,0,0,.12); display: none; position: fixed; right: 0; top: 0; width: min(88vw,380px); z-index: 10; }
    .library-app.sources-open .sources-rail { display: flex; }
    .library-app.sources-hidden .library-view { grid-template-columns: 210px minmax(0,1fr); }
}
@media (max-width: 600px) {
    .library-view { display: block; }
    .navigation-rail { display: none; }
    .library-app.navigation-open .navigation-rail { bottom: 0; box-shadow: 8px 0 24px rgba(0,0,0,.15); display: flex; left: 0; position: fixed; top: 0; width: min(86vw,300px); z-index: 12; }
    .center-workspace { height: 100vh; }
    .workspace-toolbar { padding-left: 2px; }
    .composer { margin: 0 10px 10px; }
    .chat-welcome { display: flex; justify-content: center; }
    .continue-reading { display: none; }
    .chat-pane.home .composer { margin: 0 10px 10px; max-width: none; min-width: 0; width: auto; }
    .reader-scroll { padding: 26px 18px 60px; }
    .reader-back { display: block; }
    .project-search { display: none; }
    .workspace-pane-pin { display:none; }
    .workspace-pane > .pane-toolbar,.workspace-pane > .reader-header { padding-right:14px; }
    .voice-pane > .pane-close { right:12px; }
}
@container (max-width: 840px) {
    .chat-scroll { padding-left: clamp(18px,7cqw,42px); padding-right: clamp(18px,7cqw,42px); }
    .chat-welcome { align-content: center; grid-template-columns: minmax(0,1fr); height: auto; min-height: 100%; max-width: 430px; }
    .continue-reading { min-width: 0; width: 100%; }
    .continue-list { max-height: 280px; overflow-y: auto; }
    .chat-pane.home .composer { margin-left: auto; margin-right: auto; max-width: 410px; min-width: 0; width: calc(100% - 32px); }
}
@container (max-width: 520px) {
    .chat-welcome { display: flex; justify-content: center; }
    .continue-reading { display: none; }
    .first-source-browsers { grid-template-columns: minmax(0,1fr); }
    .first-source-actions { align-items: stretch; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .loading-mark, #refresh.spinning svg, .group-chevron, .voice-orb.listening, .reader-actions button.preparing::before { animation: none; transition: none; }
}
@media (max-width: 700px) {
    .settings-shell { grid-template-columns: 168px minmax(0,1fr); }
    .settings-panels { padding: 20px 16px 30px; }
    .dialog-body .settings-control-row { align-items: stretch; grid-template-columns: 1fr; gap: 6px; }
    .settings-route-control { grid-template-columns: 1fr; }
    .settings-control-row .settings-switch { justify-self: start; }
    .settings-account-control { align-items: center; grid-template-columns: 32px minmax(0,1fr); }
    .settings-account-control .settings-inline-button { grid-column: 1 / -1; justify-self: stretch; }
}
