/* Shared surfaces, navigation and reading controls. */
:root {
  --studio-paper: #fbfaf7;
  --studio-ink: #2c263b;
  --studio-secondary: #615a70;
  --studio-rule: #e4dfea;
  --studio-violet: #594080;
  --studio-lilac: #f0eaf8;
  --studio-focus: #774bc2;
  --studio-teal: #286c74;
}
body, body.desk-page, body:has(.shelf) {background: var(--studio-paper); color: var(--studio-ink)}
body :is(button,a,summary,input,select,textarea):focus-visible {outline: 3px solid var(--studio-focus); outline-offset: 3px}
body:has(dialog:modal) {overflow: hidden}
body .desk-nav {
  width: min(calc(100% - 64px),1088px); min-height: 80px; padding: 0; margin: 0 auto;
  gap: 12px; border-bottom: 1px solid var(--studio-rule);
}
.desk-nav .desk-brand {display: inline-flex; align-items: center; min-height: 44px; flex-shrink: 0}
.desk-nav .desk-brand img {width: 118px}
.header-tools {display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0}
button.menu-trigger, button.dialog-close {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 17px;
  min-height: 44px; border: 1px solid #e4dbea; border-radius: 100px;
  background: var(--studio-lilac); color: var(--studio-violet); font-size: 14px; font-weight: 650;
}
.menu-glyph {display: inline-block; width: 16px; height: 12px; border-block: 2px solid currentColor; position: relative}
.menu-glyph::before {content: ""; position: absolute; inset: 3px 0 auto; border-top: 2px solid currentColor}
#install-badge {display: flex; align-items: center; background: #e8f3f1; border: 1px solid #cde4df; border-radius: 40px; color: #296761}
#install-badge button {border: 0; background: transparent; color: inherit; padding: 0 10px; font-size: 13px; font-weight: 650; border-radius: 24px}
#install-badge #badge-dismiss {padding: 0; width: 32px; min-width: 32px; justify-content: center}
#badge-dismiss::before {width: 15px; height: 15px; flex-basis: 15px}
#install-badge #badge-install {padding-right: 0}
#install-badge button:hover, button.menu-trigger:hover, button.dialog-close:hover {filter: brightness(.95)}
.studio-dialog {
  width: min(544px,calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; border: 1px solid #e5ddeb; border-radius: 24px; color: var(--studio-ink);
  background: var(--studio-paper); box-shadow: 0 24px 90px #271b3a35; overscroll-behavior: contain; overflow: auto;
}
.studio-dialog::backdrop, body .sheet::backdrop, body .cookie-notice::backdrop, body .site-dialog::backdrop {
  background: #29203668; backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
}
.dialog-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px;
  background: var(--studio-paper); border-bottom: 1px solid var(--studio-rule); position: sticky; top: 0; z-index: 1;
}
.dialog-bar h2, .site-extras .dialog-bar h2 {margin: 0; font-size: 20px; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere}
.dialog-bar form {flex-shrink: 0}
.dialog-bar .dialog-close {min-height: 44px; background: #eee8f4; border: 0; border-radius: 99px; color: #584570; font-size: 14px}
.desk-nav .site-menu-links, .language-grid {display: grid; align-items: stretch; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 18px 20px 20px}
.site-menu-links a {
  --tile: #f0eaf8; --tile-edge: #e3d9ee; --tile-ink: #5d4480;
}
.site-menu-links a:nth-child(2) {--tile: #e8f4f3; --tile-edge: #d2e8e6; --tile-ink: #296e75}
.site-menu-links a:nth-child(3) {--tile: #edf0fc; --tile-edge: #dce2f4; --tile-ink: #495f98}
.site-menu-links a:nth-child(4) {--tile: #f8efe7; --tile-edge: #ecdfd2; --tile-ink: #80593c}
.desk-nav .site-menu-links a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 11px;
  min-width: 0; padding: 18px 10px; min-height: 98px; max-width: none; border: 1px solid var(--tile-edge);
  background: var(--tile); color: var(--tile-ink); border-radius: 17px; font-size: 15px; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere; font-weight: 650;
}
.site-menu-links [data-ui-icon]::before {width: 25px; height: 25px; flex-basis: 25px}
.site-menu-links a:hover, .language-grid button:hover {filter: brightness(.97)}
.site-menu-links a[aria-current] {border-color: color-mix(in srgb,var(--tile-ink) 50%,var(--tile-edge))}
.menu-foot {border-top: 1px solid var(--studio-rule); padding: 4px 22px}
.menu-foot a {font-size: 14px; min-height: 44px; color: var(--studio-secondary)}
.site-extras #open-language {
  position: fixed; bottom: max(16px,env(safe-area-inset-bottom)); left: max(16px,env(safe-area-inset-left)); z-index: 3;
  display: grid; place-items: center; width: 48px; height: 48px; padding: 6px; border: 1px solid #e0dae6;
  border-radius: 50%; background: #fffefd; box-shadow: 0 3px 16px #32264424;
}
.flag-button img, .language-grid img {display: block; border-radius: 50%; box-shadow: 0 0 0 1px #32264422}
#open-language:hover {box-shadow: 0 4px 18px #32264440}
.site-extras #language-dialog {width: min(520px,calc(100% - 28px))}
.language-grid {gap: 6px; padding: 14px}
.site-extras .language-grid button[name] {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0;
  padding: 8px 12px; border: 1px solid transparent; background: transparent; border-radius: 12px;
  text-align: left; color: var(--studio-ink); font-size: 15px;
}
.site-extras .language-grid button[name][aria-current] {background: var(--studio-lilac); border-color: #d9cbea; color: var(--studio-violet); font-weight: 650}
body .site-links {justify-content: center; gap: 2px 20px; padding-bottom: 20px; text-align: center}
body .site-links :is(button,a) {color: var(--studio-secondary); background: none; border: 0; padding: 0; font-size: 12px; text-decoration: none}
body .site-links a {justify-content: center; max-width: 100%}
body .site-links :is(button,a):hover {text-decoration: underline}
body .cookie-notice,body .site-dialog {background: var(--studio-paper); color: var(--studio-ink); border: 1px solid var(--studio-rule); border-radius: 23px; box-shadow: 0 18px 64px #30214424}
body .cookie-notice #accept-notice {color: white; background: #61478b; border: 0; border-radius: 24px}
.cookie-notice a {color: var(--studio-violet)}

/* The reading stage stays legible in a dark room. Its tools live in the settings sheet. */
body .reader-intro {
  max-width: 1088px; width: calc(100% - 64px); padding: clamp(26px,4.2vh,54px) 0 26px;
  align-items: flex-end; gap: 24px; margin: auto;
}
body .reader-intro h1, body .desk-editor h1, .shelf h1 {
  color: var(--studio-ink); font-size: clamp(30px,3.3vw,50px); line-height: 1.07; font-weight: 700; letter-spacing: -.048em;
}
.reader-intro p {color: var(--studio-secondary); line-height: 1.55; font-size: 16px; max-width: 64ch}
.reader-links {gap: 4px 12px}
.reader-links a {color: var(--studio-violet); text-decoration: none; font-size: 14px}
.reader-links a:first-child {
  padding: 0 16px; background: var(--studio-lilac); border: 1px solid #e3daeb; border-radius: 40px;
}
.reader-links a:hover {text-decoration: underline}
body.desk-page[data-workspace=reader]:not(.session-live) #presenter:not(:fullscreen) {
  --stage: #282636; --glass: #393647; --glass-line: #ffffff26;
  width: min(calc(100% - 64px),1088px); max-width: none; border: 1px solid #393549; border-radius: 26px;
  height: clamp(360px,61dvh,720px); color: #fffcf6; background: linear-gradient(118deg,#282735,#292636 62%,#333044);
  box-shadow: 0 16px 42px -24px #30213b70;
}
.desk-page .presenter:not(.has-camera) {--glass: #393648; --glass-line: #ffffff26; --stage: #252432}
.desk-page .reader-heading {display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 14px}
.desk-page .reader-brand {font-weight: 650}
.desk-page .presenter:not(.has-camera) :is(#presenter-status,#presenter-position,.reader-feedback,.keyboard-help) {color: #d1cbd9}
.desk-page .presenter:not(.has-camera) .icon-button {color: #f4eefb; background: #ffffff0c; border-color: #ffffff24}
.desk-page .presenter-controls .icon-button {margin: 0}
.desk-page .reader-dock {width: fit-content; max-width: 100%; border-radius: 50px; padding: 5px 6px; background: var(--glass)}
.desk-page .presenter-controls {gap: 6px}
.desk-page .dock-divider {margin: 0 4px; height: 24px}
.desk-page .session-action {min-width: 0}
.desk-page .session-button[data-state=idle] {border: 0; color: #362448; background: #e1d2f2}
.desk-page .session-button[data-state=idle]:hover {background: #ece1f9}
.desk-page .session-action .dock-caption {display: none}
.desk-page .keyboard-help {margin: 6px 0 0}
.desk-page:not(.session-live) .reader-feedback:has(#record-status:empty):has(#follow-state:empty) #scribe-status[data-state=idle][data-error=false] {display: none}
.desk-page .reader-bottom {padding-bottom: 12px}
.desk-page .presenter:not(.has-camera) .pause-button {color: #332544; background: #e3d8f1}
.desk-page .presenter:not(.has-camera) .reader-word.reader-focus-target {text-decoration-color: #cbb6e0}
.desk-page:not(.session-live) #presenter-body {scrollbar-color: #cbc2d24d transparent}

/* The native modal occupies the viewport even when the presenter itself is fullscreen. */
#reader-settings {
  position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; border: 0; border-radius: 0; padding: max(20px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
  color-scheme: light; overflow: hidden; overscroll-behavior: contain;
}
body.desk-page #reader-settings {background: #e7e3ef32; color: var(--studio-ink)}
#reader-settings[open] {display: grid; place-items: center}
#reader-settings::backdrop {background: #211a355c; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px)}
.settings-surface {
  width: min(100%,860px); max-height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  background: #fffdf8ed; border: 1px solid #ffffffc9; border-radius: 26px; box-shadow: 0 24px 82px #28203330;
}
.settings-surface .dialog-bar {position: static; flex: none; background: transparent; padding: 19px 24px}
.settings-body {min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px; display: grid; align-items: start; grid-template-columns: minmax(0,1fr) minmax(0,1.12fr); gap: 14px}
.settings-card {min-width: 0; border-radius: 18px; border: 1px solid var(--card-line); padding: 18px; background: var(--card-fill); color: var(--card-ink)}
.view-card {--card-line: #e1d7ec; --card-fill: #f1ebf8; --card-ink: #543d75}
.tracking-card {--card-line: #cfe5e4; --card-fill: #eaf4f3; --card-ink: #286971}
.settings-card h3 {margin: 0 0 16px; font-size: 17px; line-height: 1.35; letter-spacing: -.02em}
.settings-card h4 {font-size: 14px; margin: 20px 0 6px}
.settings-card .view-switch {margin: 0; background: #e2d8ec; border-radius: 14px}
.settings-card .view-switch button {color: #524568; border-radius: 10px; font-weight: 600}
.settings-card .view-switch button[aria-pressed=true] {background: #fffcff; color: #44305d; box-shadow: 0 1px 4px #49326020}
.reader-mirror-control {margin: 14px 0 0; font-size: 15px; font-weight: 600; cursor: pointer}
.reader-mirror-control input {flex-shrink: 0}
.reader-mirror-help {margin: 0; font-size: 14px; line-height: 1.5}
.settings-card .live-font-control {border: 1px solid #ddd2e8; background: #fffcff; border-radius: 15px; padding: 0 4px}
.settings-card .live-font-control button,.settings-card #font-value {color: #5b4775}
.settings-card #font-size::-webkit-slider-runnable-track {background: linear-gradient(to right,#8565ab var(--font-progress,38%),#dad1e3 var(--font-progress,38%))}
.settings-card #font-size::-webkit-slider-thumb {background: #76569d}
.settings-card #font-size::-moz-range-thumb,.settings-card #font-size::-moz-range-progress {background: #76569d}
.settings-card #fullscreen {color: inherit; border: 0; background: transparent; padding: 0; margin: 12px 0 0; font-size: 14px; font-weight: 650}
.settings-card select {color: #244f54; width: 100%; min-height: 46px; padding: 8px; border-radius: 12px; border: 1px solid #bfd9d7; background: #fcfffe; font-size: 15px}
.settings-card .font-control {display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 0 8px; margin: 14px 0 0; font-size: 14px; font-weight: 600}
.settings-card .font-control input {grid-column: 1/-1; grid-row: 2; width: 100%; height: 30px; margin: 0; accent-color: #34797c}
.settings-card .font-control output {grid-row: 1; grid-column: 2; min-width: 36px; text-align: right; color: #28575d}
.settings-card .privacy-note {margin: 12px 0 0; color: #456367; font-size: 13px; line-height: 1.55}
.settings-help {grid-column: 1/-1; padding: 0 5px; color: var(--studio-secondary); font-size: 14px; line-height: 1.5}
.settings-help summary {cursor: pointer; min-height: 44px; color: var(--studio-violet); font-weight: 600}
.settings-help summary::after {content: "+"; margin-left: 3px}
.settings-help[open] summary::after {content: "−"}
.settings-help p {margin: 4px 0 12px}
.settings-help a {min-height: 44px; color: var(--studio-violet)}
.font-preview-label {font-size: 14px; margin: 16px 0 6px; font-weight: 650}
.font-preview {max-height: 230px; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; padding: 14px; border-radius: 14px; background: #fffaff; color: #33263e; line-height: 1.5; font-weight: 500}
.thought-cards-help, #thought-card-status {font-size: 14px; line-height: 1.5; margin: 12px 0 0}
#thought-card-status:empty {display: none}
#thought-card-status[data-error=true] {color: #902b43}
body .quick-settings {width: min(600px,calc(100% - 24px)); max-height: calc(100dvh - 24px); background: #fffdf8; color: #33263e; border: 1px solid #e0d4e8; border-radius: 24px; padding: 0; overflow: auto; color-scheme: light}
body .quick-settings[open] {display: flex; flex-direction: column; overflow: hidden}
.quick-settings .sheet-header {background: #fffdf8; color: inherit; padding: 16px 20px; flex: none}
.quick-settings .sheet-content {padding: 0 18px 10px; overflow: auto; min-height: 0}
.quick-settings .font-preview {max-height: 140px}
.quick-settings .thought-cards-help:not(#thought-card-cost) {display: none}
.quick-settings .sheet-header h2 {font-size: 20px; line-height: 1.3; min-width: 0; flex: 1; overflow-wrap: anywhere}
#quick-mode-label {font-size: 15px; font-weight: 650; margin: 4px 0 14px}
.quick-settings .view-card {--card-fill: #f8eaf1; --card-line: #ecd5e2; --card-ink: #65405c}
.quick-settings-info {font-size: 14px; line-height: 1.55; color: #61516a; margin: 16px 0}
.quick-settings-actions {display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; flex: none; padding: 10px 18px; border-top: 1px solid #e8dce9; background: #fffdf8}
.quick-settings-actions button {min-height: 46px; font-size: 15px}
.quick-settings-actions .primary-button {width: auto; padding: 10px 28px; background: #694886; color: #fff}

/* Writing and library pages use one reading column and one primary action. */
body .desk-editor, body .shelf {width: min(calc(100% - 64px),780px); max-width: none; padding: 34px 0 16px; text-align: left}
.desk-editor .library-crumb, .shelf .library-crumb {
  display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 10px; color: var(--studio-violet); font-size: 14px; text-decoration: none;
}
.desk-editor .library-crumb:hover, .shelf .library-crumb:hover {text-decoration: underline}
body .desk-editor>p, .shelf>p {color: var(--studio-secondary); line-height: 1.6}
body .desk-editor>label {color: var(--studio-ink); font-weight: 650; margin: 24px 0 8px; font-size: 15px}
.desk-editor input#project-title, body .desk-editor .writing-area #script-input {
  border: 1px solid #dcd5e5; border-radius: 14px; color: var(--studio-ink); background: #fffefd;
  padding: 14px 16px; font-size: 16px; line-height: 1.6;
}
body .desk-editor .writing-area .source-box {padding: 0; box-shadow: none; border: 0; background: none}
body .desk-editor .writing-area #script-input {display: block; min-height: 200px; height: clamp(200px,30vh,340px)}
body .desk-editor .source-footer {max-width: none; min-height: 32px; padding: 6px 2px; color: var(--studio-secondary); font-size: 12px}
.desk-editor-actions,.shelf-actions {gap: 8px; margin: 18px 0 12px}
.desk-editor-actions>:is(button,a), .shelf-actions>:is(button,a), .shelf-heading a.desk-action {
  justify-content: center; text-decoration: none; font-size: 14px; font-weight: 650; min-height: 46px;
  padding: 9px 16px; background: #f0eaf7; color: var(--studio-violet); border: 1px solid #e1d8ea; border-radius: 16px;
}
.desk-editor-actions #start-prompter,.shelf .desk-action {background: #60478b; color: #fff; border: 1px solid transparent; border-radius: 16px}
.shelf-actions a:nth-child(2) {background: #e9f4f3; border-color: #d4e7e5; color: var(--studio-teal)}
.shelf-actions #text-download {background: #edf0fc; color: #506299; border-color: #dce2f4}
.shelf-heading {align-items: center; margin-bottom: 28px}
.shelf-heading h1 {margin: 0}
.shelf .shelf-list {display: grid; gap: 8px; border: 0}
.shelf .shelf-row, .shelf .source-fold, .shelf .media-card {
  padding: 17px 20px; background: #fffefd; color: var(--studio-ink); border: 1px solid var(--studio-rule); border-radius: 17px;
}
.shelf .shelf-row {display: flex}
.shelf .shelf-row:hover {border-color: #b7a7ce}
.shelf-row span, .media-card p,.shelf .media-card a {color: var(--studio-secondary)}
.shelf .desk-remove {margin-top: 16px; font-size: 13px; text-decoration: none}
.shelf-actions {margin-bottom: 24px}
.shelf h2 {margin: 30px 0 8px; font-size: 22px; letter-spacing: -.02em}
.shelf #empty-library {background: #f2edf7; border-radius: 16px; padding: 20px; margin: 0}
.desk-editor #save-status {min-height: 20px; font-size: 13px}
body #start-session {color-scheme: light; background: var(--studio-paper); color: var(--studio-ink); border-color: var(--studio-rule)}
body #start-session .sheet-header {background: var(--studio-paper); color: var(--studio-ink); border-color: var(--studio-rule)}
body #start-session .text-button {color: var(--studio-violet); background: var(--studio-lilac)}
body #start-session .start-choice {background: #f0eaf8; color: #503b70; border-color: #dfd5ea; border-radius: 17px}
body #start-session .start-choice:nth-child(2) {background: #e9f4f3; color: #28676d; border-color: #d3e6e4}
body #start-session .start-choice:nth-child(3) {background: #edf0fc; color: #495e96; border-color: #dce2f4}
body #start-session .start-choice:nth-child(4) {background: #f8efe8; color: #77523c; border-color: #ecdfd5}
body #start-session .start-choice:disabled {background: #f1efef; color: #5d5861; border-color: #e4dfe5}
body #start-session .start-choice small {color: inherit}
body #start-session .choice-icon {color: inherit; background: #ffffff70; border-color: #0001}
body #start-session .choice-arrow {display: none}
body #start-session :is(.start-note,.start-guide) {color: var(--studio-secondary)}
body #start-session .capture-shape {color: var(--studio-secondary)}
body #start-session .capture-shape select {color: var(--studio-ink); background: #fffefa; border-color: #d9d1e3}
body .site-extras:has(.flag-button) {padding-bottom: 50px}
@media(max-width:700px) {
  body .desk-nav, body .reader-intro, body .desk-editor, body .shelf {width: calc(100% - 32px)}
  body .desk-nav {min-height: 62px}
  .desk-nav .desk-brand img {width: 97px}
  .header-tools {gap: 6px}
  button.menu-trigger {padding-inline: 13px}
  body .reader-intro {display: block; padding: 24px 0 16px}
  body .reader-intro h1 {font-size: clamp(29px,6vw,38px); margin: 0 0 7px}
  .reader-intro p {font-size: 14px; max-width: 52ch}
  .reader-links {gap: 3px 10px; margin-top: 11px}
  .reader-links a:first-child {min-height: 40px; padding: 6px 14px}
  body.desk-page[data-workspace=reader]:not(.session-live) #presenter:not(:fullscreen) {
    width: calc(100% - 24px); height: clamp(325px,calc(100svh - 302px),630px); border-radius: 20px;
  }
  .desk-page .reader-heading {display: block}
  .desk-page .presenter-header {align-items: flex-start}
  .desk-page .reader-dock {max-width: 100%}
  .desk-page .reader-meta {min-height: 26px}
  body .desk-editor,body .shelf {padding: 16px 0}
  .shelf .shelf-heading {align-items: flex-start; flex-direction: column; gap: 12px}
  .desk-editor-actions #start-prompter,.shelf-actions .desk-action {flex-basis: 100%}
  .desk-editor-actions,.shelf-actions {display: flex; align-items: stretch; gap: 8px}
  .desk-editor-actions>:not(.desk-action),.shelf-actions>:not(.desk-action) {flex: 1 1 120px; padding-inline: 9px; text-align: center}
  body .shelf-actions .desk-action {justify-content: center}
  .settings-surface {border-radius: 20px}
  .settings-body {grid-template-columns: minmax(0,1fr); padding: 12px; gap: 10px}
  .settings-card {padding: 15px}
  .settings-surface .dialog-bar,.dialog-bar {padding: 12px 16px}
  .settings-surface .dialog-bar h2,.dialog-bar h2 {font-size: 19px}
  .desk-nav .site-menu-links {padding: 14px; gap: 8px}
  .desk-nav .site-menu-links a {min-height: 92px; font-size: 14px}
  .site-extras #open-language {left: max(10px,env(safe-area-inset-left)); bottom: max(10px,env(safe-area-inset-bottom))}
  body .site-links {padding: 0 8px 10px; gap: 0 14px}
  body .site-extras {margin: 12px auto}
}
@media(max-width:360px) {
  .desk-nav .desk-brand img {width: 80px}
  .header-tools {gap: 4px}
  button.menu-trigger {padding-inline: 10px}
  #install-badge #badge-install {padding-left: 7px; gap: 4px}
  .language-grid {padding: 10px; gap: 4px}
  .language-grid button {font-size: 14px; padding-inline: 6px; gap: 7px}
}
@media(max-height:520px) and (min-width:600px) {
  .settings-body {grid-template-columns: minmax(0,1fr) minmax(0,1.12fr)}
  #reader-settings {padding-block: 8px}
}
@media(prefers-reduced-transparency:reduce) {
  body.desk-page #reader-settings {background: #eae6ee}
  .settings-surface {background: var(--studio-paper)}
}

.menu-foot {display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px}
.menu-foot [data-open-app], .menu-foot #menu-logout {background: transparent; border: 0; padding: 0; min-height: 44px; font-size: 14px; color: var(--studio-secondary)}
#menu-logout-error {margin: 8px 22px 18px; color: #943535; overflow-wrap: anywhere}
#install-badge #badge-dismiss {width: 40px; min-width: 40px}
.desk-page .presenter-header .reader-links {margin: 0}
.session-live .reader-links, #presenter:fullscreen .reader-links {display: none}
body .reader-intro p {max-width: 72ch}
body .reader-intro {padding-bottom: clamp(20px,3.3vh,38px)}
/* On entry the manuscript reads like a sheet of paper. Switching to recording or
   fullscreen engages the high-contrast stage without changing the manuscript. */
body.desk-page[data-workspace=reader]:not(.session-live) #presenter:not(:fullscreen) {
  --glass-line: #ded6e7; color-scheme: light; background: #fffefd; color: #302b3b;
  border-color: #ded7e6; padding-block: 0; box-shadow: 0 15px 46px -28px #4c365c70;
}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .presenter-header {
  padding: 16px 24px; border-bottom: 1px solid #e8e2ed; background: #f8f5fb;
}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-heading {padding: 0; display: grid; gap: 2px}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-brand {color: #3f334e}
.desk-page:not(.session-live) #presenter:not(:fullscreen) :is(#presenter-status,#presenter-position,.reader-feedback,.keyboard-help) {color: #665f72}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-meta {padding: 14px 24px 0}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .presenter-header .icon-button {background: #fffcff; border-color: #dbd3e5; color: #655079; flex-shrink: 0}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-dock {
  background: #f6f3f9; border-color: #dfd8e7; box-shadow: 0 3px 12px #44325310;
}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .presenter-controls>.icon-button {color: #5a496c; background: transparent; border-color: transparent}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .session-button {background: #64458e; color: #fff}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .dock-divider {background: #d8cfe3}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .reminder {color: #5a5366}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-focus-word {background: #e6deef; color: inherit}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-bottom {padding-top: 8px}
.desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-links a {color: #584575}
body .site-extras:has(.flag-button) {max-width: 1088px; width: calc(100% - 64px); padding-inline: 0}
@media (max-width:700px) {
  .desk-page:not(.session-live) #presenter:not(:fullscreen) .presenter-header {padding: 11px 14px; align-items: center; gap: 8px; flex-wrap: wrap}
  .desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-meta {padding: 10px 18px 0}
  .desk-page:not(.session-live) #presenter:not(:fullscreen) #presenter-status {line-height: 1.45; font-size: 12px}
  .desk-page:not(.session-live) #presenter:not(:fullscreen) .reader-links {order: 3; flex-basis: 100%; display: flex; gap: 2px 12px}
  .desk-page:not(.session-live) .reader-links a {min-height: 40px; font-size: 13px; white-space: normal}
  .desk-page:not(.session-live) .reader-links a:first-child {padding-inline: 13px}
  body.desk-page[data-workspace=reader]:not(.session-live) #presenter:not(:fullscreen) {height: clamp(370px,calc(100svh - 250px),690px)}
  body .site-extras:has(.flag-button) {width: calc(100% - 32px)}
}
@media(max-width:360px) {
  .site-extras .language-grid button[name] {padding-inline: 6px; font-size: 14px; gap: 7px}
}

/* Only the matching homepage video loads; its controls remain available. */
.home-demo {display: none}
body.desk-page[data-home-landing=true]:not(.home-preview) #exit-presenter {display: inline-flex}
body.desk-page.home-preview[data-workspace=reader]:not(.session-live) #presenter:not(:fullscreen) {
  height: auto; background: #f7f6f2; border: 0; box-shadow: none; overflow: visible;
}
body.home-preview #presenter .home-demo {display: block; order: 1; align-self: center; width: min(100%,800px,calc(54svh * 16 / 9))}
.home-demo video {display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 24px; background: #201d25}
@media (max-width:700px) {
  body.home-preview #presenter .home-demo {width: min(100%,320px,calc(52svh * 9 / 16))}
  .home-demo video {aspect-ratio: 9 / 16}
}
body.home-preview #presenter :is(.reader-panes,.presenter-body,.reader-meta,.reader-feedback,.keyboard-help,.reader-heading,#exit-presenter,#reader-recordings,#open-reader-settings,.presenter-controls>.icon-button,.dock-divider) {display: none}
body.desk-page.home-preview #presenter:not(:fullscreen) .reader-bottom {order: 2; padding: 8px 0 0}
body.desk-page.home-preview #presenter:not(:fullscreen) .reader-dock {padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none}
body.home-preview #presenter .session-button {min-width: 180px; min-height: 54px}
body.desk-page.home-preview #presenter:not(:fullscreen) .presenter-header {display: none}

/* Quiet, speech-bubble-shaped feature tags below the homepage video and CTA. */
.home-features {display: none}
body.home-preview #presenter .home-features {
  display: flex; order: 3; flex-wrap: wrap; justify-content: center; gap: 9px;
  align-self: center; width: min(100%,620px); margin: 20px 0 12px; padding: 0 8px; list-style: none;
}
.home-feature {
  --tag-fill: #e9f5ef; --tag-ink: #356554; --tag-edge: #d5e9dd;
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 8px 14px;
  border: 1px solid var(--tag-edge); border-radius: 100px; background: var(--tag-fill); color: var(--tag-ink);
  font-size: 14px; font-weight: 600; line-height: 1.45; text-align: left; overflow-wrap: anywhere;
  box-shadow: inset 0 1px 0 #ffffffa6,0 2px 4px #34254404;
}
.home-feature:nth-child(2n) {border-bottom-left-radius: 9px}
.home-feature:nth-child(2) {--tag-fill: #f0eafa; --tag-ink: #624583; --tag-edge: #e2d7f0}
.home-feature:nth-child(3) {--tag-fill: #eaf2fb; --tag-ink: #386287; --tag-edge: #d7e5f3}
.home-feature:nth-child(4) {--tag-fill: #fcf0e7; --tag-ink: #8c5740; --tag-edge: #efdfd1}
.home-feature:nth-child(5) {--tag-fill: #faedf2; --tag-ink: #88526d; --tag-edge: #eed9e3}
.home-feature:nth-child(6) {--tag-fill: #f8f3df; --tag-ink: #79602b; --tag-edge: #e9e1c3}
.home-feature .feature-icon {flex: none; opacity: .85}
.home-feature .feature-icon::before {width: 16px; height: 16px; flex-basis: 16px}
@media (max-width:700px) {
  body.home-preview #presenter .home-features {gap: 8px; margin-top: 16px; padding-inline: 4px}
  .home-feature {padding: 7px 11px; gap: 6px; font-size: 13px}
}

.usage-dialog {width: min(620px,calc(100vw - 28px)); max-height: calc(100dvh - 28px); color: #332c3e; background: #fffdfa; border: 1px solid #ded5e8; border-radius: 22px}
.usage-dialog .sheet-content {overflow-y: auto; padding: 12px 22px 24px}
.usage-dialog p:empty {display: none}
#usage-warning {padding: 12px; border-radius: 12px; background: #fff2d9; color: #6d461d}
.usage-actions {display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px}
.usage-actions>* {min-height: 44px}
.reader-playlist {display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px}
.reader-playlist[hidden] {display: none}
.reader-playlist select {width: auto; max-width: 100%; min-height: 44px; margin: 0}

.desk-page:not(.session-live) #presenter:not(:fullscreen) [data-mark-style="progress"] .reader-word.reader-spoken {background:#9675bc26;color:inherit}
.desk-page:not(.session-live) #presenter:not(:fullscreen) [data-mark-style="progress"] .reader-card.reader-discussed {background:#9675bc0d;box-shadow:0 0 0 7px #9675bc0d}
.desk-page:not(.session-live) #presenter:not(:fullscreen) [data-mark-style="progress"] .reader-card.reader-discussed h2::after {color:#687e64}
@media(max-width:599px) {
 .desk-page .presenter-controls {gap:3px}
 .desk-page .presenter-controls>.pause-button {width:44px;flex-basis:44px}
 .desk-page .reader-dock {padding-inline:4px}
 .desk-page .dock-divider {margin-inline:1px}
 .desk-page .session-button {padding-inline:12px}
}
/* Phone landscape uses the whole stage. Only the corner buttons and compact
   dock overlay it; source text continues underneath their translucent surfaces. */
@media(max-height:599px) and (orientation:landscape) {
 body.desk-page[data-workspace=reader]:not(.home-preview) #presenter.presenter {position:fixed;inset:0;width:100%;height:100dvh;max-width:none;margin:0;border:0;border-radius:0;z-index:80;padding:0;box-shadow:none}
 body.desk-page:not(.home-preview) #presenter.presenter {--corner-ink:#f4eefb;--corner-fill:#ffffff0c;--corner-line:#ffffff24;--corner-dock:#29263630}
 body.desk-page:not(.session-live):not(.home-preview) #presenter:not(:fullscreen) {--corner-ink:#5a496c;--corner-fill:#ffffff26;--corner-line:#78608d35;--corner-dock:#eee8f42b}
 body.desk-page:not(.home-preview) #presenter.presenter .presenter-header {position:absolute;inset:0 0 auto;height:0;min-height:0;margin:0;padding:0;border:0;background:none;pointer-events:none;z-index:3}
 body.desk-page:not(.home-preview) #presenter.presenter .presenter-header>:not(#exit-presenter):not(#open-reader-settings) {display:none}
 body.desk-page:not(.home-preview) #presenter.presenter :is(#exit-presenter,#open-reader-settings) {display:inline-flex;position:absolute;top:max(6px,env(safe-area-inset-top));width:44px;height:44px;pointer-events:auto;color:var(--corner-ink);background:var(--corner-fill);border:1px solid var(--corner-line);box-shadow:none;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
 body.desk-page:not(.home-preview) #presenter.presenter #exit-presenter {left:max(8px,env(safe-area-inset-left))}
 body.desk-page:not(.home-preview) #presenter.presenter #open-reader-settings {right:max(8px,env(safe-area-inset-right))}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-meta {position:absolute;inset:8px 64px auto;margin:0;padding:0;min-height:0;z-index:2;pointer-events:none;justify-content:center}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-meta>:not(.recording-indicator) {display:none}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-pane-label {display:none}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-panes {height:100%;flex:1;padding-inline:env(safe-area-inset-left) env(safe-area-inset-right)}
 body.desk-page:not(.home-preview) #presenter.presenter .presenter-body {padding:52px 18px 82px}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-bottom {position:absolute;left:auto;right:max(8px,env(safe-area-inset-right));bottom:max(6px,env(safe-area-inset-bottom));max-width:calc(100% - 16px);margin:0;padding:0;z-index:3;pointer-events:none}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-dock {margin:0 0 0 auto;background:var(--corner-dock);border:1px solid var(--corner-line);box-shadow:none;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);padding:4px 6px;pointer-events:auto}
 body.desk-page:not(.home-preview) #presenter.presenter .presenter-controls {gap:4px}
 body.desk-page:not(.home-preview) #presenter.presenter .presenter-controls>.icon-button {color:var(--corner-ink);background:transparent;border-color:transparent;margin:0}
 body.desk-page:not(.home-preview) #presenter.presenter .presenter-controls>.pause-button {height:44px;width:44px;flex-basis:44px;gap:0;box-shadow:none}
 body.desk-page:not(.home-preview) #presenter.presenter .pause-caption {font-size:9px}
 body.desk-page:not(.home-preview) #presenter.presenter .session-button {min-height:44px;height:44px;padding-inline:14px;background:var(--corner-fill);color:var(--corner-ink);border:1px solid var(--corner-line);box-shadow:none}
 body.desk-page:not(.home-preview) #presenter.presenter .session-action {gap:0}
 body.desk-page:not(.home-preview) #presenter.presenter :is(.dock-caption,.keyboard-help) {display:none}
 body.desk-page:not(.home-preview) #presenter.presenter .dock-divider {margin:0 2px;background:var(--corner-line)}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-feedback {max-width:min(380px,80vw);margin:0 4px 4px auto;text-align:right;color:var(--corner-ink);font-size:10px;max-height:100px}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-feedback .following-status {justify-content:flex-end;font-size:10px}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-feedback :is(a,button) {pointer-events:auto}
 body.desk-page:not(.home-preview) #presenter.presenter .reader-feedback:has(#scribe-status[data-error=true],.record-status.error,#microphone-help:not([hidden]),#record-permission-help:not([hidden])) {background:var(--stage,#282636);border-radius:12px;padding:8px 12px;pointer-events:auto;color:#fff}
 @media(prefers-reduced-transparency:reduce) {
  body.desk-page:not(.home-preview) #presenter.presenter {--corner-fill:var(--stage,#282636);--corner-dock:var(--stage,#282636);--corner-ink:#fff}
  body.desk-page:not(.home-preview) #presenter.presenter :is(.reader-dock,#exit-presenter,#open-reader-settings) {backdrop-filter:none;-webkit-backdrop-filter:none}
 }
}

@media(max-width:360px) {
 .desk-page .reader-bottom {padding-inline:4px}
 .desk-page .presenter-controls {gap:2px}
 .desk-page .presenter-controls .session-button {min-width:96px;padding-inline:8px;font-size:12px}
}
