:root {
  color-scheme: light;
  --paper: #f2eee6;
  --paper-deep: #e9e3d8;
  --surface: #fbf9f4;
  --surface-strong: #ffffff;
  --ink: #20231f;
  --ink-soft: #555950;
  --muted: #7b7d75;
  --line: #d7d1c6;
  --line-strong: #bdb6aa;
  --accent: #e85f42;
  --accent-deep: #bd3f29;
  --accent-soft: #f8ded5;
  --focus: #bd3f29;
  --focus-soft: #f5d8d1;
  --success: #4f765c;
  --danger: #a54032;
  --shadow: 0 24px 70px rgba(61, 50, 36, 0.13);
  --shadow-soft: 0 10px 35px rgba(61, 50, 36, 0.08);
  --reader-word-size: 76px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161a1b;
  --paper-deep: #111415;
  --surface: #1d2223;
  --surface-strong: #242a2b;
  --ink: #f1eee7;
  --ink-soft: #c1c3bd;
  --muted: #929891;
  --line: #353c3c;
  --line-strong: #4d5554;
  --accent: #f17a5d;
  --accent-deep: #ff9a80;
  --accent-soft: #402923;
  --focus: #ff6b55;
  --focus-soft: #4a2a25;
  --success: #8db89a;
  --danger: #ff9b8c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 35px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 86% 2%, color-mix(in srgb, var(--accent) 7%, transparent) 0, transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
label,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
label:has(input:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.app-header {
  width: min(1240px, calc(100% - 48px));
  height: calc(94px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark,
.empty-mark,
.processing-visual {
  display: grid;
  grid-template-columns: 1fr 3px 1fr;
  align-items: center;
  gap: 4px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  padding: 7px;
}

.brand-mark span,
.empty-mark span,
.processing-visual span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.brand-mark i,
.empty-mark i,
.processing-visual i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.brand-copy {
  display: grid;
  line-height: 1.12;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions,
.reader-top-actions,
.hero-actions,
.format-notes,
.control-cluster {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 10px;
}

.account-sync-button {
  min-height: 46px;
  padding: 5px 13px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.account-sync-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.account-sync-button:active {
  transform: scale(0.98);
}

.account-sync-icon {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.account-sync-icon svg {
  width: 19px;
  height: 19px;
}

.account-sync-icon i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface-strong);
  border-radius: 50%;
  background: var(--muted);
}

.account-sync-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
  line-height: 1.05;
}

.account-sync-copy strong {
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.account-sync-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.account-sync-copy small[data-state="unlocked"] {
  color: var(--success);
}

.account-sync-button:has(.account-sync-copy small[data-state="unlocked"]) .account-sync-icon i {
  background: var(--success);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.privacy-pill svg,
.local-note svg {
  width: 15px;
  height: 15px;
}

.button,
.icon-button,
.control-button,
.play-button,
.back-button,
.stepper button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.button:active,
.icon-button:active,
.control-button:active,
.play-button:active,
.back-button:active,
.stepper button:active {
  transform: scale(0.97);
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
}

.header-import {
  white-space: nowrap;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--ink) 16%, transparent);
}

.button-primary:hover {
  background: color-mix(in srgb, var(--ink) 86%, var(--accent));
  transform: translateY(-1px);
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--ink-soft);
  background: var(--surface);
}

.button-quiet {
  background: transparent;
  color: var(--muted);
}

.button-quiet:hover {
  color: var(--ink);
}

.button-large {
  min-height: 52px;
  padding-inline: 23px;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--ink-soft);
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.moon-icon,
[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

.library-view {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.library-hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 0.9fr);
  align-items: center;
  gap: clamp(48px, 8vw, 114px);
  padding: 42px 0 76px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-copy > .eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-deep);
}

.hero-copy > .eyebrow span {
  width: 24px;
  height: 1px;
  background: var(--accent);
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  margin: 0;
}

.hero-copy h1 {
  max-width: 710px;
  font-family: var(--serif);
  font-size: clamp(50px, 5.2vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 500;
}

.hero-description {
  max-width: 620px;
  margin: 28px 0 30px;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.65;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.pace-hero-button {
  margin: 14px 0 0 4px;
  padding: 4px 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--accent-deep);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.pace-hero-button:hover {
  color: var(--ink);
}

.pace-hero-button svg {
  width: 16px;
  height: 16px;
}

.local-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.hero-reader {
  position: relative;
  min-height: 380px;
  padding: 25px 28px 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 94%, transparent), var(--surface));
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1deg);
}

.hero-reader::after {
  content: "";
  position: absolute;
  inset: auto -80px -110px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  filter: blur(2px);
}

.preview-topline,
.preview-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.preview-topline span:last-child {
  color: var(--accent-deep);
}

.preview-stage {
  position: relative;
  height: 250px;
  display: grid;
  place-items: center;
}

.preview-stage::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--accent) 30%, transparent) 30%, color-mix(in srgb, var(--accent) 30%, transparent) 70%, transparent);
}

.preview-tick {
  position: absolute;
  left: calc(50% - 9px);
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.preview-tick-top {
  top: 27px;
}

.preview-tick-bottom {
  bottom: 27px;
}

.preview-word {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  font-size: clamp(42px, 4.7vw, 65px);
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
}

.preview-word span:first-child {
  text-align: right;
}

.preview-word strong {
  color: var(--focus);
  font-weight: inherit;
}

.preview-progress {
  position: relative;
  z-index: 1;
  height: 3px;
  margin-bottom: 18px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.preview-progress span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.preview-footer button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
}

.preview-footer button svg {
  width: 17px;
  height: 17px;
}

.install-callout {
  position: relative;
  margin: 0 0 56px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  background: linear-gradient(105deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 48%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.install-callout::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -90px;
  bottom: -105px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 20px color-mix(in srgb, var(--accent) 3%, transparent);
  pointer-events: none;
}

.install-app-icon {
  width: 64px;
  height: 64px;
  padding: 17px 14px;
  border-radius: 15px;
  display: grid;
  grid-template-columns: 1fr 4px 1fr;
  align-items: center;
  gap: 4px;
  background: #20231f;
  box-shadow: 0 8px 20px rgba(32, 35, 31, 0.18);
}

.install-app-icon span {
  height: 4px;
  border-radius: 4px;
  background: #f8f4ec;
}

.install-app-icon i {
  width: 4px;
  height: 100%;
  border-radius: 4px;
  background: #ed684c;
}

.install-callout-copy {
  min-width: 0;
}

.install-callout-copy .eyebrow {
  margin-bottom: 3px;
  color: var(--accent-deep);
}

.install-callout-copy h2 {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.install-callout-copy > p:last-child {
  max-width: 690px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.install-callout-button {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.library-section {
  padding-top: 56px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
}

.section-heading h2,
.panel-heading h2,
.modal-header h2 {
  font-family: var(--serif);
  font-size: 35px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.book-count {
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.continue-slot:not(:empty) {
  margin-bottom: 24px;
}

.review-inbox-slot:not(:empty) {
  margin-bottom: 18px;
}

.review-inbox-card {
  min-height: 88px;
  padding: 17px 19px;
  border: 1px solid color-mix(in srgb, var(--focus) 24%, var(--line));
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  background:
    radial-gradient(circle at 0 50%, color-mix(in srgb, var(--focus) 8%, transparent), transparent 34%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.review-inbox-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--focus-soft);
  color: var(--focus);
}

.review-inbox-mark svg {
  width: 23px;
  height: 23px;
}

.review-inbox-copy {
  min-width: 0;
}

.review-inbox-copy .eyebrow {
  margin-bottom: 3px;
  color: var(--focus);
}

.review-inbox-copy h3 {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 540;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-inbox-copy p:last-child {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.continue-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.continue-cover,
.book-cover {
  position: relative;
  border-radius: 8px 13px 13px 8px;
  overflow: hidden;
  color: #fffaf2;
  isolation: isolate;
}

.continue-cover {
  height: 116px;
}

.cover-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface-strong);
}

.continue-cover .cover-image {
  object-fit: cover;
}

.has-cover-image::before,
.has-cover-image::after {
  visibility: hidden;
}

.continue-cover::before,
.book-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 8px;
  width: 1px;
  background: rgba(255,255,255,0.25);
  z-index: -1;
}

.continue-cover::after,
.book-cover::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -40px;
  bottom: -42px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  box-shadow: 0 0 0 14px rgba(255,255,255,0.07), 0 0 0 28px rgba(255,255,255,0.05);
  z-index: -1;
}

.cover-tone-0 { background: #3e5b51; }
.cover-tone-1 { background: #9b4d3a; }
.cover-tone-2 { background: #3f516b; }
.cover-tone-3 { background: #745a7e; }
.cover-tone-4 { background: #86683e; }
.cover-tone-5 { background: #53676b; }

.continue-cover span,
.book-cover .cover-format {
  position: absolute;
  left: 17px;
  top: 15px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.continue-copy .eyebrow {
  margin-bottom: 5px;
  color: var(--accent-deep);
}

.continue-copy h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.continue-copy > p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.mini-progress {
  display: grid;
  grid-template-columns: minmax(80px, 230px) auto;
  align-items: center;
  gap: 11px;
}

.mini-progress > span:first-child {
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.mini-progress > span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.book-card {
  min-width: 0;
}

.book-open {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.book-open:hover .book-cover {
  transform: translateY(-5px) rotate(-0.5deg);
  box-shadow: 0 18px 35px rgba(38, 34, 28, 0.18);
}

.book-cover {
  aspect-ratio: 0.74;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 8px 20px rgba(38, 34, 28, 0.14);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.book-cover strong {
  max-width: 12ch;
  font-family: var(--serif);
  font-size: clamp(21px, 2.1vw, 28px);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.book-cover small {
  margin-top: 9px;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.72;
}

.book-card-meta {
  position: relative;
  padding: 14px 42px 4px 2px;
}

.book-card-meta h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
}

.book-card-meta p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.book-progress-line {
  height: 2px;
  margin-top: 11px;
  background: var(--line);
}

.book-progress-line span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.remove-book {
  position: absolute;
  top: 8px;
  right: -4px;
  width: 36px;
  height: 36px;
}

.remove-book svg {
  width: 17px;
  height: 17px;
}

.empty-library {
  min-height: 132px;
  margin-top: 20px;
  padding: 25px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.empty-mark {
  width: 58px;
  height: 58px;
  padding: 15px;
  border-radius: 50%;
  background: var(--surface);
}

.empty-library h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.empty-library p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Reader */
.reader-view {
  min-height: calc(100vh - 94px - env(safe-area-inset-top));
  min-height: calc(100dvh - 94px - env(safe-area-inset-top));
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 8px 0 28px;
  display: grid;
  grid-template-rows: auto minmax(370px, 1fr) auto;
  gap: 18px;
}

.reader-topbar {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 1.4fr) minmax(100px, 1fr);
  align-items: center;
}

.back-button {
  justify-self: start;
  min-height: 44px;
  padding: 0 12px 0 7px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.back-button:hover {
  background: var(--surface);
  color: var(--ink);
}

.reader-book-meta {
  min-width: 0;
  display: grid;
  justify-items: center;
  text-align: center;
}

.reader-book-meta > strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.reader-book-meta > span {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reader-book-meta > span i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.reader-top-actions {
  justify-self: end;
  gap: 2px;
}

.mobile-reader-actions {
  display: none;
  align-items: center;
  justify-self: end;
  gap: 2px;
}

.narration-button {
  color: var(--accent);
}

.narration-button:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.question-icon {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}

.collapse-icon,
.focus-mode .expand-icon {
  display: none;
}

.focus-mode .collapse-icon {
  display: block;
}

.reader-main {
  min-height: 0;
  position: relative;
  display: grid;
  gap: 14px;
}

.reader-stage {
  min-height: 370px;
  padding: clamp(18px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-rows: auto minmax(200px, 1fr) auto auto auto;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 3.5%, transparent), transparent 34%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.stage-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stage-context-label,
.live-page-heading,
.live-page-header,
.following-label {
  display: flex;
  align-items: center;
}

.stage-context-label {
  min-width: 0;
  gap: 9px;
}

.stage-context-label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-context-label > i {
  flex: 0 0 auto;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.semantic-chip {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--focus) 34%, var(--line));
  border-radius: 999px;
  background: var(--focus-soft);
  color: var(--focus);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.word-stage {
  position: relative;
  width: 100%;
  min-height: 210px;
  padding: 35px 18px;
  border: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  touch-action: pan-y;
  -webkit-touch-callout: none;
}

.sentence-context,
.live-page-paper,
.context-page {
  -webkit-touch-callout: none;
}

.word-stage .focus-rail,
.word-stage .focus-notch {
  transition: opacity 180ms ease;
}

.word-stage.is-semantic-transition .focus-rail,
.word-stage.is-semantic-transition .focus-notch {
  opacity: 0;
}

.semantic-transition {
  position: relative;
  width: min(820px, 90%);
  min-inline-size: 0;
  max-inline-size: 100%;
  display: grid;
  justify-items: center;
  gap: 14px;
  color: var(--ink);
  text-align: center;
  animation: semantic-card-in 260ms ease both;
}

.semantic-transition small,
.semantic-transition > span {
  color: var(--focus);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.semantic-transition strong {
  max-width: 100%;
  min-inline-size: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: clamp(38px, calc(var(--reader-word-size) * 0.78), 74px);
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}

.scientific-source-page {
  width: min(720px, 92%);
  max-height: min(34vh, 310px);
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 12px 32px color-mix(in srgb, #000 14%, transparent);
}

.semantic-transition:has(.scientific-source-page:not([hidden])) {
  width: min(900px, 98%);
  gap: 9px;
}

.semantic-transition:has(.scientific-source-page:not([hidden])) strong {
  font-size: clamp(22px, calc(var(--reader-word-size) * 0.42), 38px);
  line-height: 1.15;
}

.semantic-transition.is-long strong {
  font-size: clamp(30px, calc(var(--reader-word-size) * 0.58), 54px);
  line-height: 1.1;
}

.semantic-transition.is-very-long strong {
  font-size: clamp(25px, calc(var(--reader-word-size) * 0.48), 44px);
}

.semantic-transition[data-type="table"] strong,
.semantic-transition[data-type="equation"] strong {
  max-height: min(42vh, 360px);
  padding: 14px 18px;
  overflow: auto;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: clamp(18px, calc(var(--reader-word-size) * 0.38), 34px);
  line-height: 1.35;
  white-space: pre-line;
}

.semantic-transition[data-type="caption"] strong,
.semantic-transition[data-type="figure"] strong {
  font-size: clamp(24px, calc(var(--reader-word-size) * 0.5), 44px);
}

.semantic-transition > span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.semantic-transition.is-parenthetical {
  width: min(690px, 88%);
  padding: clamp(22px, 4vw, 38px) clamp(20px, 5vw, 48px);
  border: 1px solid color-mix(in srgb, var(--focus) 24%, var(--line));
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--focus-soft) 46%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface-strong) 88%, transparent);
  box-shadow: 0 18px 48px color-mix(in srgb, var(--focus) 9%, transparent);
}

.semantic-transition.is-parenthetical strong {
  max-width: 580px;
  font-size: clamp(28px, calc(var(--reader-word-size) * 0.52), 48px);
  font-style: italic;
  font-weight: 520;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.semantic-transition.is-parenthetical .parenthetical-mark {
  color: var(--focus);
  font-family: var(--sans);
  font-style: normal;
  font-weight: 720;
  text-shadow: 0 0 18px color-mix(in srgb, var(--focus) 16%, transparent);
}

.semantic-transition.is-parenthetical.is-note {
  border-radius: 18px;
}

.semantic-transition.is-parenthetical.is-reference strong {
  font-family: var(--sans);
  font-size: clamp(23px, calc(var(--reader-word-size) * 0.42), 38px);
  font-style: normal;
  font-weight: 590;
  letter-spacing: -0.015em;
}

.reader-stage[data-semantic="heading"] .semantic-transition strong {
  font-size: clamp(32px, calc(var(--reader-word-size) * 0.66), 60px);
}

.reader-stage[data-semantic="heading"] .semantic-transition.is-long strong {
  font-size: clamp(28px, calc(var(--reader-word-size) * 0.54), 50px);
}

.reader-stage[data-semantic="heading"] .semantic-transition.is-very-long strong {
  font-size: clamp(24px, calc(var(--reader-word-size) * 0.46), 42px);
}

@keyframes semantic-card-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.focus-rail {
  position: absolute;
  top: 17%;
  bottom: 17%;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--focus) 35%, transparent) 28%, color-mix(in srgb, var(--focus) 35%, transparent) 72%, transparent);
  pointer-events: none;
}

.focus-notch {
  position: absolute;
  left: calc(50% - 12px);
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--focus);
  pointer-events: none;
}

.focus-notch-top { top: 17%; }
.focus-notch-bottom { bottom: 17%; }

.orp-word {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  font-family: var(--sans);
  font-size: clamp(44px, var(--reader-word-size), 106px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: pre;
}

.orp-word.is-semantic-phrase {
  font-family: var(--serif);
  font-size: clamp(29px, calc(var(--reader-word-size) * 0.62), 62px);
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.orp-word.is-semantic-phrase .orp-focus::after {
  bottom: -6px;
}

.semantic-transition.is-semantic-sentence {
  width: min(860px, 94%);
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid color-mix(in srgb, var(--focus) 19%, var(--line));
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

.semantic-transition.is-semantic-sentence strong {
  max-width: 760px;
  font-size: clamp(25px, calc(var(--reader-word-size) * 0.48), 46px);
  line-height: 1.22;
}

.orp-before {
  overflow: hidden;
  text-align: right;
}

.orp-focus {
  position: relative;
  display: inline-block;
  color: var(--focus);
  font-weight: 800;
  text-shadow: 0 0 18px color-mix(in srgb, var(--focus) 22%, transparent);
  transform: scale(1.035);
  transform-origin: 50% 72%;
}

.orp-focus::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: -8px;
  height: 2px;
  border-radius: 2px;
  background: var(--focus);
}

.reader-stage[data-semantic="title"] .orp-word,
.reader-stage[data-semantic="heading"] .orp-word {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.reader-stage[data-semantic="title"] {
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--focus) 7%, transparent), transparent 38%),
    var(--surface);
}

.reader-stage[data-semantic="intro"] .orp-word,
.reader-stage[data-semantic="quote"] .orp-word {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: -0.025em;
}

.reader-stage[data-range-role="aside"] .orp-word,
.reader-stage[data-range-role="note"] .orp-word {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 560;
  letter-spacing: -0.025em;
}

.reader-stage[data-range-role="reference"] .orp-word {
  color: var(--ink-soft);
  font-size: clamp(38px, calc(var(--reader-word-size) * 0.82), 86px);
  font-weight: 600;
}

.reader-stage[data-range-role="technical"] .orp-word {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(34px, calc(var(--reader-word-size) * 0.76), 78px);
  letter-spacing: -0.035em;
}

.orp-after {
  overflow: hidden;
  text-align: left;
}

.sentence-context {
  min-height: 3.4em;
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  text-align: center;
  transition: opacity 180ms ease;
  touch-action: pan-y;
}

body:has(.reader-view.is-playing) {
  overflow: hidden;
  overscroll-behavior: none;
}

.context-panel mark {
  padding: 1px 3px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--ink);
}

.sentence-context .sentence-word {
  border-radius: 4px;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: background-color 120ms ease, color 120ms ease;
}

.sentence-context .sentence-word.is-parenthetical {
  background: color-mix(in srgb, var(--focus-soft) 42%, transparent);
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
}

.sentence-context .sentence-word.is-reference {
  background: color-mix(in srgb, var(--line) 48%, transparent);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.88em;
}

.sentence-context .sentence-word:hover,
.page-word:hover {
  background: var(--focus-soft);
  color: var(--ink);
}

.recovery-row {
  min-height: 38px;
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.replay-sentence-button,
.lost-me-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.replay-sentence-button:hover,
.lost-me-button:hover {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.replay-sentence-button svg,
.lost-me-button svg {
  width: 16px;
  height: 16px;
}

.lost-me-button {
  border-color: color-mix(in srgb, var(--focus) 34%, var(--line));
  color: var(--focus);
}

.reader-view.is-hold-slow .word-stage::after {
  content: "Slower while held";
  position: absolute;
  right: 16px;
  bottom: 10px;
  color: var(--focus);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recovery-row > span {
  color: var(--focus);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.stage-hint {
  min-height: 24px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* Semantic live page */
.live-page {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.live-page-header {
  min-height: 66px;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.live-page-heading {
  min-width: 0;
  gap: 12px;
}

.live-page-heading > div {
  min-width: 0;
  display: grid;
}

.live-page-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.live-page-heading > div > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.following-label {
  flex: 0 0 auto;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.following-label i {
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}

.live-page-viewport {
  max-height: 270px;
  padding: 18px clamp(14px, 4vw, 48px) 22px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.live-page-paper {
  width: min(820px, 100%);
  min-height: 220px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 42px) clamp(24px, 5vw, 58px);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 6px;
  background: var(--surface-strong);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink-soft);
  font-family: var(--serif);
}

.page-block {
  position: relative;
  margin: 0;
  color: color-mix(in srgb, var(--ink-soft) 74%, transparent);
  transition: color 160ms ease, background-color 160ms ease;
}

.page-block + .page-block {
  margin-top: 17px;
}

.page-block.is-current-block {
  color: var(--ink);
}

.page-title,
.page-heading {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.page-title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

.page-heading {
  font-size: clamp(21px, 2.7vw, 30px);
  line-height: 1.18;
}

.page-intro {
  padding-left: 18px;
  border-left: 3px solid var(--focus);
  color: var(--ink-soft);
  font-size: 19px;
  font-style: italic;
  line-height: 1.7;
}

.page-paragraph,
.page-list,
.page-quote {
  font-size: 17px;
  line-height: 1.72;
}

.page-quote {
  padding: 4px 0 4px 20px;
  border-left: 1px solid var(--line-strong);
  font-style: italic;
}

.page-list {
  padding-left: 23px;
}

.page-list::before {
  content: "•";
  position: absolute;
  left: 5px;
  color: var(--focus);
}

.page-word {
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.page-word.is-current-word {
  background: var(--focus-soft);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--focus);
}

.page-continuation {
  color: var(--muted);
}

kbd {
  min-width: 24px;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
}

.context-panel {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: clamp(24px, 5vw, 68px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: auto;
}

.panel-heading,
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.context-page {
  max-width: 850px;
  margin: clamp(28px, 5vw, 64px) auto 0;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  font-family: var(--serif);
}

.reader-dock {
  padding: 0 24px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.progress-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-row span:last-child {
  text-align: right;
}

.progress-button {
  --range-progress: 0%;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.progress-track {
  width: 100%;
  height: 3px;
  border-radius: 3px;
  display: block;
  overflow: hidden;
  background: var(--line);
}

.progress-track i {
  width: var(--range-progress);
  height: 100%;
  border-radius: inherit;
  display: block;
  background: var(--accent);
  transition: width 180ms ease-out;
}

.progress-button:focus-visible {
  outline: none;
}

.progress-button:focus-visible .progress-track {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 32%, transparent);
}

.progress-button:active .progress-track {
  background: color-mix(in srgb, var(--line) 76%, var(--focus-soft));
}

.range {
  --range-progress: 0%;
  width: 100%;
  height: 24px;
  margin: 0;
  border: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0 var(--range-progress), var(--line) var(--range-progress) 100%);
}

.range::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: var(--line);
}

.range::-moz-range-progress {
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.range::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  margin-top: -6px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  appearance: none;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.control-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 0 17px;
  border-bottom: 1px solid var(--line);
}

.control-cluster {
  gap: 6px;
}

.control-cluster-left { justify-self: end; }
.control-cluster-right { justify-self: start; }

.control-button {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink-soft);
}

.control-button:hover {
  background: var(--paper);
  color: var(--ink);
}

.control-button svg {
  width: 21px;
  height: 21px;
}

.control-number {
  position: absolute;
  font-size: 8px;
  font-weight: 800;
}

.control-cluster-left .control-button:nth-child(2) .control-number { right: 7px; top: 19px; }
.control-cluster-right .control-button:first-child .control-number { left: 7px; top: 19px; }

.play-button {
  width: 66px;
  height: 66px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 9px 24px color-mix(in srgb, var(--ink) 18%, transparent);
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 28px color-mix(in srgb, var(--ink) 23%, transparent);
}

.play-button svg {
  width: 27px;
  height: 27px;
}

.pause-icon,
.is-playing .play-icon {
  display: none;
}

.is-playing .pause-icon {
  display: block;
}

.reader-settings {
  display: grid;
  grid-template-columns: minmax(230px, 1.35fr) repeat(6, minmax(140px, 1fr));
  align-items: stretch;
  padding-top: 18px;
}

.reader-settings > * {
  min-width: 0;
  padding: 0 22px;
}

.reader-settings > * + * {
  border-left: 1px solid var(--line);
}

.setting-copy,
.context-setting,
.switch-setting,
.size-setting,
.content-type-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.context-setting {
  gap: 10px;
}

.setting-copy > span,
.context-setting strong,
.switch-setting strong,
.size-setting strong,
.content-type-setting strong {
  font-size: 12px;
  font-weight: 750;
}

.setting-copy > span {
  display: grid;
}

.setting-copy > span small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 550;
}

.setting-copy output {
  font-size: 16px;
  font-weight: 800;
}

.setting-copy output small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.wpm-setting .range {
  height: 18px;
}

.range-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pace-inline-button {
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pace-inline-button:hover {
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
}

.switch-setting,
.size-setting,
.content-type-setting {
  cursor: pointer;
}

.switch-setting > span:first-child,
.context-setting > span:first-child,
.size-setting > span:first-child,
.content-type-setting > span:first-child {
  display: grid;
}

.switch-setting small,
.context-setting small,
.size-setting small,
.content-type-setting small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.content-type-setting select,
.sheet-select select {
  min-width: 112px;
  min-height: 38px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.adaptive-setting:has(input:checked) {
  background: linear-gradient(90deg, color-mix(in srgb, var(--focus-soft) 45%, transparent), transparent);
}

.review-setting {
  display: flex;
}

/* Compact iPhone reader controls */
.reader-settings-modal {
  width: min(560px, calc(100% - 24px));
}

.sheet-handle {
  display: none;
}

.reader-sheet-actions {
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.reader-sheet-actions button {
  min-height: 68px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.reader-sheet-settings {
  border-top: 1px solid var(--line);
  display: grid;
}

.reader-sheet-settings > * {
  min-height: 58px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.sheet-switch,
.sheet-select,
.sheet-segment-setting,
.sheet-stepper-setting,
.sheet-theme-button,
.reader-sheet-range > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sheet-switch > span:first-child,
.sheet-select > span:first-child,
.sheet-segment-setting > span:first-child,
.sheet-stepper-setting > span:first-child,
.sheet-theme-button > span {
  display: grid;
  text-align: left;
}

.reader-sheet-settings strong {
  font-size: 13px;
}

.reader-sheet-settings small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.reader-sheet-range output {
  color: var(--focus);
  font-size: 12px;
  font-weight: 800;
}

.reader-sheet-range .range {
  height: 28px;
}

.sheet-theme-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.context-segment {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.context-segment button {
  min-width: 60px;
  min-height: 36px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.context-segment button + button {
  border-left: 1px solid var(--line);
}

.context-segment button:hover {
  background: var(--paper);
  color: var(--ink);
}

.context-segment button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.switch {
  flex: 0 0 auto;
  position: relative;
  width: 44px;
  height: 25px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 160ms ease;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: 0 1px 5px rgba(0,0,0,0.18);
  transition: transform 180ms ease;
}

.switch input:checked + i {
  background: var(--accent);
}

.switch input:checked + i::after {
  transform: translateX(19px);
}

.stepper {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.stepper button {
  min-width: 40px;
  min-height: 34px;
  padding: 0 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.stepper button + button {
  border-left: 1px solid var(--line);
}

.stepper button:hover {
  background: var(--paper);
  color: var(--ink);
}

.focus-mode .app-header {
  display: none;
}

.focus-mode .reader-view {
  min-height: 100vh;
  min-height: 100dvh;
  width: min(1500px, calc(100% - 28px));
  padding: max(14px, env(safe-area-inset-top)) 0 max(14px, env(safe-area-inset-bottom));
  grid-template-rows: auto minmax(390px, 1fr) auto;
}

.focus-mode .reader-topbar {
  grid-template-columns: 1fr auto;
}

.focus-mode .back-button,
.focus-mode .reader-book-meta,
.focus-mode #contextButton,
.focus-mode #shortcutsButton,
.focus-mode .reader-settings {
  display: none;
}

.focus-mode .reader-top-actions {
  grid-column: 2;
}

.focus-mode .reader-stage {
  min-height: 440px;
}

.focus-mode .live-page {
  display: none;
}

.focus-mode .reader-dock {
  max-width: 920px;
  width: 100%;
  justify-self: center;
  padding-bottom: 0;
}

.focus-mode .control-row {
  border-bottom: 0;
}

/* Modals */
.modal {
  width: min(600px, calc(100% - 30px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: min(760px, calc(100vh - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-height: min(760px, calc(100dvh - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  margin: auto;
  padding: 28px calc(28px + env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) calc(28px + env(safe-area-inset-left));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
}

.modal::backdrop {
  background: rgba(18, 21, 20, 0.56);
  backdrop-filter: blur(7px);
}

/* Reader navigator */
.navigator-dialog {
  width: min(720px, calc(100% - 30px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  height: min(760px, calc(100dvh - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  padding: 0;
  overflow: hidden;
}

.navigator-dialog[open] {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.navigator-sheet-handle {
  display: none;
}

.navigator-header {
  padding: 24px 26px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.navigator-header h2 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 520;
  letter-spacing: -0.025em;
}

.navigator-header #navigatorPosition {
  max-width: 520px;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigator-return {
  min-height: 58px;
  margin: 0 24px 12px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--focus) 28%, var(--line));
  border-radius: 14px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  background: var(--focus-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.navigator-return[hidden] {
  display: none;
}

.navigator-return > svg:first-child {
  width: 22px;
  height: 22px;
  color: var(--focus);
}

.navigator-return > svg:last-child {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.navigator-return span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.navigator-return strong {
  font-size: 13px;
}

.navigator-return small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigator-quick-actions {
  margin: 0 24px 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.navigator-quick-actions button {
  min-width: 0;
  min-height: 64px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.navigator-quick-actions button:hover,
.navigator-quick-actions button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--focus) 38%, var(--line));
  background: var(--focus-soft);
  color: var(--focus);
}

.navigator-quick-actions button svg {
  width: 19px;
  height: 19px;
}

.navigator-tabs {
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.navigator-tabs button {
  min-height: 46px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.navigator-tabs button[aria-selected="true"] {
  border-bottom-color: var(--focus);
  color: var(--ink);
}

.navigator-panels {
  min-height: 0;
  overflow: hidden;
}

.navigator-panel {
  height: 100%;
  padding: 20px 24px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notes-export-button {
  width: 100%;
  margin: 0 0 12px;
}

.notes-list {
  display: grid;
  gap: 9px;
}

.note-row {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--note-color, var(--focus));
  border-radius: 13px;
  display: grid;
  gap: 5px;
  background: var(--surface-strong);
  color: var(--ink);
  text-align: left;
}

.note-row strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-row span,
.note-row small {
  color: var(--muted);
  font-size: 10px;
}

.note-modal {
  width: min(620px, calc(100% - 24px));
}

.note-quote {
  max-height: 170px;
  margin: 20px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--focus);
  border-radius: 0 12px 12px 0;
  overflow-y: auto;
  background: color-mix(in srgb, var(--focus-soft) 42%, var(--surface));
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
}

.note-field {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.note-field textarea,
.note-field input,
.review-recall-field textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.note-colors {
  margin: 17px 0 0;
  padding: 0;
  border: 0;
}

.note-colors legend {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.note-colors > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-colors label input {
  position: absolute;
  opacity: 0;
}

.note-color {
  min-height: 34px;
  padding: 0 11px;
  border: 2px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 750;
}

.note-colors input:checked + .note-color { border-color: var(--ink); }
.note-color-coral { background: var(--accent-soft); color: var(--accent-deep); }
.note-color-gold { background: #f2dfad; color: #725514; }
.note-color-blue { background: #d9e7f5; color: #28567d; }
.note-color-green { background: #dbeadd; color: #32603d; }
[data-theme="dark"] .note-color-gold { background: #574824; color: #f5d987; }
[data-theme="dark"] .note-color-blue { background: #243f58; color: #add5f5; }
[data-theme="dark"] .note-color-green { background: #274531; color: #b8e0c2; }

.note-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
}

.page-jump {
  margin-bottom: 22px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px auto;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--paper) 58%, transparent);
}

.page-jump label {
  display: grid;
  font-size: 12px;
  font-weight: 800;
}

.page-jump label small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-jump input {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-strong);
  color: var(--ink);
  text-align: center;
}

.page-jump .button {
  min-height: 42px;
  padding-inline: 16px;
}

.navigator-section-heading {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.navigator-list {
  display: grid;
  gap: 7px;
}

.navigator-row {
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.navigator-row:hover {
  border-color: var(--line);
  background: var(--surface-strong);
}

.navigator-row.is-current {
  border-color: color-mix(in srgb, var(--focus) 28%, var(--line));
  background: var(--focus-soft);
}

.navigator-row-number {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.navigator-row.is-current .navigator-row-number {
  color: var(--focus);
}

.navigator-row-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.navigator-row-copy strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigator-row-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.navigator-row > svg {
  width: 17px;
  color: var(--muted);
}

.book-search-field {
  min-height: 52px;
  padding: 0 8px 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  background: var(--surface-strong);
}

.book-search-field > svg {
  width: 18px;
  color: var(--muted);
}

.book-search-field input {
  width: 100%;
  min-height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.book-search-field button,
.bookmark-remove {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.book-search-field button:hover,
.bookmark-remove:hover {
  background: var(--paper);
  color: var(--ink);
}

.navigator-status {
  min-height: 28px;
  margin: 13px 4px 8px;
  color: var(--muted);
  font-size: 11px;
}

.search-result {
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: start;
}

.search-result .navigator-row-copy > span,
.bookmark-jump .navigator-row-copy > span {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
}

.search-result mark {
  padding: 1px 2px;
  border-radius: 3px;
  background: var(--focus-soft);
  color: var(--ink);
  font-weight: 700;
}

.bookmark-row {
  position: relative;
}

.bookmark-jump {
  padding-right: 48px;
}

.bookmark-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
}

.bookmark-remove svg {
  width: 16px;
  height: 16px;
}

.navigator-empty {
  min-height: 250px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.navigator-empty svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: var(--line-strong);
}

.navigator-empty strong {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 560;
}

.navigator-empty span {
  max-width: 310px;
  margin-top: 5px;
  font-size: 12px;
}

.modal-header {
  margin-bottom: 25px;
}

.modal-header .eyebrow {
  margin-bottom: 5px;
}

.modal-close {
  flex: 0 0 auto;
}

.drop-zone {
  min-height: 270px;
  padding: 35px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--paper) 65%, transparent);
  text-align: center;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone.is-dragging {
  transform: scale(1.01);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-icon,
.error-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: var(--shadow-soft);
}

.drop-zone strong,
.import-working h3,
.import-error h3 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
}

.drop-zone > span:not(.drop-icon) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.drop-zone small {
  margin-top: 17px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.format-notes {
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.format-notes span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.format-notes svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

.import-working,
.import-error {
  min-height: 350px;
  padding: 30px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.processing-visual {
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
  padding: 20px;
  border-radius: 50%;
  background: var(--paper);
}

.processing-visual i {
  animation: focus-pulse 1s ease-in-out infinite alternate;
}

@keyframes focus-pulse {
  to { transform: scaleY(1.45); }
}

.import-filename {
  max-width: 90%;
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.import-working h3,
.import-error h3 {
  margin-bottom: 8px;
}

.import-working > p:not(.import-filename),
.import-error > p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.import-working progress {
  width: min(360px, 88%);
  height: 5px;
  margin: 28px 0 14px;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  appearance: none;
}

.import-working progress::-webkit-progress-bar { background: var(--line); }
.import-working progress::-webkit-progress-value { background: var(--accent); transition: width 180ms ease; }
.import-working progress::-moz-progress-bar { background: var(--accent); }

.import-order-preview {
  max-height: min(72vh, 680px);
  padding: 8px 2px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.order-preview-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.order-preview-heading h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 540;
}

.order-preview-icon {
  width: 44px;
  height: 44px;
  padding: 10px 9px;
  border-radius: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  background: var(--accent-soft);
}

.order-preview-icon i {
  border-radius: 2px;
  background: var(--accent);
}

#importOrderSummary,
.order-preview-note {
  margin: 14px 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.order-preview-pages {
  display: grid;
  gap: 10px;
}

.order-preview-page {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}

.order-preview-page.needs-review {
  border-color: color-mix(in srgb, var(--focus) 44%, var(--line));
}

.order-preview-page header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.order-preview-page header span,
.order-preview-page > p,
.order-preview-more {
  color: var(--muted);
  font-size: 9px;
}

.order-preview-ocr-status {
  margin: 8px 0 0;
  line-height: 1.45;
}

.order-preview-source-page {
  display: block;
  width: min(100%, 420px);
  max-height: 330px;
  margin: 12px auto 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
}

.order-preview-page ol {
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
  list-style: none;
}

.order-preview-page li {
  min-width: 0;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 10px;
}

.order-preview-page li small {
  color: var(--focus);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.order-preview-page li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-preview-actions {
  position: sticky;
  bottom: -2px;
  padding: 12px 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: linear-gradient(transparent, var(--surface) 28%);
}

.repair-toolbar {
  margin: 14px 0 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.repair-toolbar .button {
  min-height: 38px;
}

.repair-toolbar > span {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.repair-block {
  padding: 10px !important;
  display: grid;
  gap: 8px;
  cursor: grab;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.repair-block:active {
  cursor: grabbing;
}

.repair-block.is-selected {
  border-color: var(--focus) !important;
  background: var(--focus-soft) !important;
}

.repair-block-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px 18px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
}

.repair-select {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.repair-select input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--focus);
}

.repair-drag {
  color: var(--muted);
  font-size: 16px;
  line-height: 22px;
}

.repair-block-text {
  min-width: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.repair-block-controls {
  padding-left: 47px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.repair-block-controls select,
.repair-block-controls button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
}

.repair-block-controls select {
  min-width: 116px;
  padding: 0 28px 0 9px;
}

.repair-block-controls button {
  min-width: 34px;
  padding: 0 8px;
}

.repair-block > small {
  padding-left: 47px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.omitted-lines-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.omitted-lines-panel > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.omitted-lines-panel > div:first-child span,
.omitted-lines-panel > p {
  color: var(--muted);
  font-size: 9px;
}

.omitted-lines-panel > p {
  margin: 5px 0 10px;
}

#omittedLinesList {
  max-height: 190px;
  display: grid;
  gap: 5px;
  overflow-y: auto;
}

#omittedLinesList button {
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  text-align: left;
}

#omittedLinesList button span {
  color: var(--focus);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

#omittedLinesList button strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-icon {
  color: var(--danger);
}

.import-error details {
  max-width: 430px;
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 11px;
}

.import-error summary {
  cursor: pointer;
}

.import-error code {
  display: block;
  margin-top: 8px;
  text-align: left;
  white-space: normal;
}

.install-modal {
  width: min(640px, calc(100% - 30px - env(safe-area-inset-left) - env(safe-area-inset-right)));
}

.install-intro {
  margin: -7px 0 22px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.install-steps {
  margin: 0;
  padding: 0;
  display: grid;
  list-style: none;
}

.install-steps li {
  min-width: 0;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
}

.install-steps li > span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.install-steps strong {
  font-size: 14px;
}

.install-steps p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.install-steps em {
  color: var(--ink-soft);
  font-style: normal;
  font-weight: 700;
}

.install-steps b {
  letter-spacing: 0.08em;
}

.install-hosting-note {
  margin-top: 5px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  color: var(--ink-soft);
}

.install-hosting-note svg,
.install-storage-note svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--accent-deep);
}

.install-hosting-note p {
  margin: 0;
  font-size: 12px;
}

.install-hosting-note a {
  color: var(--accent-deep);
  font-weight: 750;
  text-underline-offset: 2px;
}

.install-storage-note {
  margin: 16px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.install-storage-note svg {
  color: var(--success);
}

.install-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.shortcuts-modal {
  width: min(520px, calc(100% - 30px));
}

.shortcut-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 30px;
}

.shortcut-grid > * {
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}

.shortcut-grid > *:nth-last-child(-n+2) {
  border-bottom: 0;
}

.shortcut-grid > *:nth-child(even) {
  justify-content: flex-end;
}

/* On-device neural narration */
.narration-modal {
  width: min(660px, calc(100% - 30px - env(safe-area-inset-left) - env(safe-area-inset-right)));
}

.narration-header .eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
}

.neural-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 13%, transparent);
}

.narration-intro {
  margin: -7px 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.narration-passage {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 36%),
    color-mix(in srgb, var(--paper) 62%, transparent);
}

.narration-passage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.narration-passage blockquote {
  min-height: 112px;
  margin: 19px 0 0;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(21px, 4vw, 29px);
  font-weight: 520;
  line-height: 1.42;
  letter-spacing: -0.012em;
}

.narration-timeline {
  margin-top: 18px;
  padding: 2px 2px 0;
}

.narration-timeline-heading,
.narration-time-labels {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.narration-timeline-heading {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.narration-timeline-heading strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.narration-timeline input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 2px 0 0;
  appearance: none;
  background: transparent;
  touch-action: pan-y;
}

.narration-timeline input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--range-progress, 0%),
    color-mix(in srgb, var(--ink) 16%, transparent) var(--range-progress, 0%) 100%
  );
}

.narration-timeline input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: 0 1px 7px color-mix(in srgb, var(--ink) 25%, transparent), 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}

.narration-time-labels {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.narration-settings {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.narration-settings label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.narration-settings select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-strong);
  color: var(--ink);
  font: 650 13px/1 var(--sans);
  letter-spacing: 0;
  text-transform: none;
}

.narration-status {
  min-height: 64px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.narration-status-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.narration-status-mark i {
  width: 2px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

.narration-status-mark i:nth-child(2) {
  height: 15px;
}

.narration-status[data-state="working"] .narration-status-mark i {
  animation: narration-pulse 750ms ease-in-out infinite alternate;
}

.narration-status[data-state="working"] .narration-status-mark i:nth-child(2) {
  animation-delay: 140ms;
}

.narration-status[data-state="working"] .narration-status-mark i:nth-child(3) {
  animation-delay: 280ms;
}

@keyframes narration-pulse {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

.narration-status > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.narration-status strong {
  font-size: 13px;
}

.narration-status span:last-child {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.narration-transport {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.narration-play-button .narration-pause-icon,
.narration-play-button.is-playing .narration-play-icon {
  display: none;
}

.narration-play-button.is-playing .narration-pause-icon {
  display: block;
}

.narration-auto-advance {
  min-height: 58px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.narration-auto-advance > span:first-child {
  display: grid;
  gap: 2px;
}

.narration-auto-advance strong {
  font-size: 13px;
}

.narration-auto-advance small {
  color: var(--muted);
  font-size: 11px;
}

.narration-model-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.narration-modal[data-native="false"] .narration-play-button {
  opacity: 0.48;
}

/* Data, storage, and pace calibration */
.data-modal,
.calibration-modal,
.review-modal,
.ten2-sign-in-modal,
.narration-modal {
  width: min(680px, calc(100% - 30px - env(safe-area-inset-left) - env(safe-area-inset-right)));
}

.data-intro,
.calibration-intro-view > p {
  margin: -8px 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.ten2-sign-in-modal {
  width: min(470px, calc(100% - 30px - env(safe-area-inset-left) - env(safe-area-inset-right)));
}

.ten2-sign-in-intro {
  margin: -7px 0 18px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.ten2-sign-in-form {
  display: grid;
  gap: 13px;
}

.ten2-sign-in-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.ten2-sign-in-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.ten2-sign-in-form input:focus-visible {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.ten2-sign-in-form .button {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
}

.ten2-account-note {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.ten2-account-note a {
  color: var(--accent-deep);
  font-weight: 750;
}

.storage-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--paper) 64%, transparent);
}

.storage-status-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.storage-status-line > div {
  min-width: 0;
  display: grid;
}

.storage-status-line strong {
  font-size: 14px;
}

.storage-status-line span:not(.storage-status-icon) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.storage-status-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
}

.storage-status-icon i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent);
}

.storage-card[data-health="protected"] .storage-status-icon,
.storage-card[data-health="healthy"] .storage-status-icon {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
}

.storage-card[data-health="protected"] .storage-status-icon i,
.storage-card[data-health="healthy"] .storage-status-icon i {
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 15%, transparent);
}

.storage-card[data-health="warning"] .storage-status-icon,
.storage-card[data-health="critical"] .storage-status-icon {
  background: color-mix(in srgb, var(--danger) 13%, var(--surface));
}

.storage-card[data-health="warning"] .storage-status-icon i,
.storage-card[data-health="critical"] .storage-status-icon i {
  background: var(--danger);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 14%, transparent);
}

.storage-meter,
.calibration-reading-view progress {
  width: 100%;
  height: 6px;
  margin: 17px 0 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
}

.storage-meter::-webkit-progress-bar,
.calibration-reading-view progress::-webkit-progress-bar { background: var(--line); }
.storage-meter::-webkit-progress-value,
.calibration-reading-view progress::-webkit-progress-value { background: var(--accent); transition: width 180ms ease; }
.storage-meter::-moz-progress-bar,
.calibration-reading-view progress::-moz-progress-bar { background: var(--accent); }

.storage-numbers {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.storage-card > p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 10px;
}

.storage-card .button {
  min-height: 38px;
  padding-inline: 13px;
  font-size: 11px;
}

.focusline-sync-card {
  width: 100%;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface-strong));
}

.focusline-sync-card + .storage-card {
  margin-top: 14px;
}

.focusline-sync-heading {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.focusline-sync-lock {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.focusline-sync-lock svg {
  width: 19px;
  height: 19px;
}

.focusline-sync-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.focusline-sync-title-line > h3 {
  margin: 0;
  font-size: 14px;
}

.focusline-sync-badge {
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.focusline-sync-card[data-sync-state="unlocked"] .focusline-sync-badge {
  border-color: color-mix(in srgb, var(--success) 30%, var(--line));
  background: color-mix(in srgb, var(--success) 11%, var(--surface));
  color: var(--success);
}

.focusline-sync-heading p,
.focusline-sync-auth p,
.focusline-sync-confirm p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.focusline-sync-auth,
.focusline-sync-unlock,
.focusline-sync-controls {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.focusline-sync-auth {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.focusline-sync-auth > div {
  min-width: 0;
}

.focusline-sync-auth strong,
.focusline-sync-confirm h4 {
  margin: 0;
  font-size: 12px;
}

.focusline-sync-card .button {
  min-height: 40px;
  padding-inline: 14px;
  font-size: 11px;
}

.focusline-sync-unlock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px 12px;
}

.focusline-sync-unlock label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.focusline-sync-unlock label > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.focusline-sync-unlock input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 0 12px;
  background: var(--surface-strong);
  color: var(--ink);
}

.focusline-sync-unlock input:focus-visible,
.focusline-sync-books .switch input:focus-visible + i {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.focusline-sync-unlock > p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.focusline-sync-unlock > .button {
  grid-column: 2;
  grid-row: 1;
}

.focusline-keychain-options {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.focusline-keychain-options[hidden] {
  display: none;
}

.focusline-keychain-options > label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.focusline-keychain-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.focusline-keychain-options label > span {
  display: grid;
  gap: 2px;
}

.focusline-keychain-options strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.focusline-keychain-options small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.35;
}

.focusline-sync-controls {
  display: grid;
  gap: 14px;
}

.focusline-sync-sign-out {
  margin-top: 12px;
}

.focusline-sync-session,
.focusline-sync-books,
.focusline-sync-actions,
.focusline-sync-progress > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.focusline-sync-session > span,
.focusline-sync-session > span > span,
.focusline-sync-books > span:first-child {
  min-width: 0;
  display: grid;
}

.focusline-sync-session > span {
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.focusline-sync-session i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 13%, transparent);
}

.focusline-sync-session strong,
.focusline-sync-books strong {
  font-size: 11px;
}

.focusline-sync-session small,
.focusline-sync-books small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.focusline-sync-books {
  cursor: pointer;
}

.focusline-sync-books .switch {
  min-width: 44px;
}

.focusline-sync-books-hint {
  margin: -8px 56px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.focusline-companion-sync-status {
  margin: -7px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
}

.focusline-companion-delete-row {
  display: flex;
  justify-content: flex-start;
}

.focusline-companion-delete-row .button {
  min-height: 44px;
  padding-inline: 0;
  color: var(--danger);
}

.focusline-sync-delete-confirm {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

.focusline-sync-confirm {
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.focusline-sync-confirm > div {
  margin-top: 11px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.focusline-sync-actions {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.focusline-sync-actions > span {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.focusline-sync-progress {
  display: grid;
  gap: 7px;
}

.focusline-sync-progress strong,
.focusline-sync-progress span {
  font-size: 9px;
}

.focusline-sync-progress span {
  color: var(--muted);
}

.focusline-sync-progress progress {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
}

.focusline-sync-progress progress::-webkit-progress-bar { background: var(--line); }
.focusline-sync-progress progress::-webkit-progress-value { background: var(--accent); transition: width 180ms ease; }
.focusline-sync-progress progress::-moz-progress-bar { background: var(--accent); }

.focusline-sync-conflicts,
.focusline-sync-message,
.focusline-sync-error {
  margin: 0;
  font-size: 9px;
  line-height: 1.5;
}

.focusline-sync-conflicts {
  color: var(--muted);
}

.focusline-sync-conflicts[data-state="resolved"] {
  color: var(--success);
}

.focusline-sync-conflicts[data-state="attention"] {
  color: var(--danger);
}

.focusline-sync-message {
  min-height: 14px;
  margin-top: 13px;
  color: var(--ink-soft);
}

.focusline-sync-error {
  margin-top: 9px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--danger) 26%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: var(--danger);
}

.data-action-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.data-action-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: var(--surface-strong);
}

.data-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.data-action-icon svg {
  width: 18px;
  height: 18px;
}

.data-action-card > div {
  min-width: 0;
  display: grid;
}

.data-action-card strong {
  font-size: 13px;
}

.data-action-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.data-action-card small {
  margin-top: 4px;
  color: var(--accent-deep);
  font-size: 9px;
}

.data-action-card .button {
  min-height: 39px;
  padding-inline: 14px;
  font-size: 11px;
}

.backup-security-card {
  margin-top: 10px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--success) 24%, var(--line));
  border-radius: 15px;
  display: grid;
  gap: 13px;
  background: color-mix(in srgb, var(--success) 5%, var(--surface-strong));
}

.backup-encryption-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.backup-encryption-option > span:first-child,
.backup-password-field {
  min-width: 0;
  display: grid;
}

.backup-encryption-option strong,
.backup-password-field > span {
  font-size: 12px;
  font-weight: 680;
}

.backup-encryption-option small,
.backup-password-field small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.backup-password-field {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.backup-password-field input {
  width: 100%;
  min-height: 42px;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.backup-password-field input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.restore-preview {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--success) 34%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--success) 7%, var(--surface));
}

.restore-preview .eyebrow {
  margin-bottom: 4px;
  color: var(--success);
}

.restore-preview h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 540;
}

.restore-preview > p:not(.eyebrow) {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.restore-settings-option {
  padding-top: 13px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.restore-settings-option > span:first-child {
  display: grid;
}

.restore-settings-option strong {
  font-size: 12px;
}

.restore-settings-option small {
  color: var(--muted);
  font-size: 10px;
}

.restore-preview-actions,
.calibration-result-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.data-error,
.data-status {
  margin: 12px 2px 0;
  font-size: 11px;
}

.data-error { color: var(--danger); }
.data-status { min-height: 1.4em; color: var(--success); }

.backup-privacy-note {
  margin: 14px 2px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.backup-privacy-note svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--success);
}

.calibration-promise-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.calibration-promise-grid span {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
}

.calibration-promise-grid strong {
  font-size: 11px;
}

.calibration-promise-grid small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.calibration-intro-view > .button {
  width: 100%;
}

.calibration-round-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calibration-round-line strong {
  color: var(--accent-deep);
}

.calibration-word-stage {
  position: relative;
  width: 100%;
  min-height: 280px;
  margin: 10px 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--paper) 78%, var(--surface));
  cursor: pointer;
  overflow: hidden;
}

.calibration-word-stage::before {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 50%;
  width: 1px;
  background: color-mix(in srgb, var(--focus) 18%, transparent);
}

.calibration-notch {
  position: absolute;
  left: 50%;
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: translateX(-50%);
}

.calibration-notch-top { top: 38px; }
.calibration-notch-bottom { bottom: 38px; }

.calibration-word {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  font-family: var(--serif);
  font-size: clamp(44px, 8vw, 72px);
  line-height: 1;
  white-space: nowrap;
}

.calibration-word > span:first-child { text-align: right; }
.calibration-word > span:last-child { text-align: left; }
.calibration-word strong { color: var(--focus); font-weight: inherit; }

.calibration-reading-view > .button {
  margin: 0 auto;
  display: block;
}

.calibration-question-view fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.calibration-question-view fieldset + fieldset {
  margin-top: 20px;
}

.calibration-question-view legend {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 540;
}

.calibration-answer-list {
  display: grid;
  gap: 7px;
}

.calibration-answer-list label,
.clarity-options label {
  position: relative;
  cursor: pointer;
}

.calibration-answer-list input,
.clarity-options input {
  position: absolute;
  opacity: 0;
}

.calibration-answer-list span,
.clarity-options span {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  align-items: center;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 12px;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.calibration-answer-list input:checked + span,
.clarity-options input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.calibration-answer-list input:focus-visible + span,
.clarity-options input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

.clarity-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.clarity-options span {
  justify-content: center;
  text-align: center;
}

.calibration-form-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.calibration-question-view > .button {
  width: 100%;
  margin-top: 18px;
}

.calibration-result-view {
  padding: 12px 0 4px;
  text-align: center;
}

.result-ring {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 6%, transparent);
}

.result-ring i {
  width: 4px;
  height: 34px;
  border-radius: 4px;
  background: var(--accent);
}

.calibration-result-view .eyebrow {
  margin-bottom: 4px;
}

.calibration-result-view h3 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.calibration-result-view h3 strong {
  color: var(--accent-deep);
  font-size: 54px;
  font-weight: 520;
}

.calibration-result-view > p:not(.eyebrow) {
  max-width: 470px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 13px;
}

.calibration-result-actions {
  justify-content: center;
}

/* Section comprehension reviews */
.review-recall-view {
  padding: 9px 10px 24px;
  display: grid;
  justify-items: center;
  text-align: center;
}

.review-pause-mark {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 2px 0 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 5%, transparent);
}

.review-pause-mark::before,
.review-pause-mark::after {
  content: "";
  width: 4px;
  height: 27px;
  border-radius: 4px;
  background: var(--accent);
}

.review-pause-mark::before {
  transform: translateX(-4px);
}

.review-pause-mark::after {
  position: absolute;
  transform: translateX(4px);
}

.review-pause-mark i {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 34px;
  height: 1px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translate(-50%, -50%);
}

#reviewPrompt {
  max-width: 520px;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(21px, 3.5vw, 27px);
  font-weight: 520;
  line-height: 1.32;
}

#reviewPrompt:focus-visible,
#reviewRecapHeading:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
  border-radius: 5px;
}

.review-word-count {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-boundary-context {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-wrap: balance;
}

.review-recall-field {
  width: min(520px, 100%);
  margin-top: 18px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-align: left;
}

.review-recall-field textarea {
  min-height: 88px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
}

.review-reveal-button {
  min-height: 44px;
  margin-top: 20px;
}

.review-modal .button-quiet {
  color: var(--ink-soft);
}

.review-modal button:focus-visible,
.review-modal .clarity-options input:focus-visible + span {
  outline-color: var(--focus);
}

.review-recap-view {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-strong));
}

.review-recap-view[hidden] {
  display: none;
}

.review-recap-heading .eyebrow {
  margin-bottom: 3px;
  color: var(--accent-deep);
}

.review-recap-heading h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 540;
}

.review-key-lines {
  margin: 13px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
  counter-reset: review-line;
}

.review-key-lines li {
  position: relative;
  padding: 11px 12px 11px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
  counter-increment: review-line;
}

.review-line-role {
  display: block;
  margin-bottom: 5px;
  color: var(--focus);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.review-line p {
  margin: 0;
}

.review-line-empty {
  font-family: var(--sans) !important;
  font-style: italic;
}

.review-line-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.review-line-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 750;
}

.review-feedback-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.review-key-lines li::before {
  content: counter(review-line);
  position: absolute;
  top: 11px;
  left: 12px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 850;
}

.review-form {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.review-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.review-form legend {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 540;
}

.review-clarity-options span {
  min-height: 58px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}

.review-clarity-options strong {
  color: inherit;
  font-size: 12px;
}

.review-clarity-options small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
}

.review-replay-actions,
.review-primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-replay-actions {
  margin-top: 18px;
}

.review-replay-actions .button {
  flex: 1 1 0;
  min-height: 44px;
}

.review-primary-actions {
  margin-top: 10px;
  justify-content: space-between;
}

.focusline-sync-session-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.review-primary-actions .button {
  min-height: 44px;
}

.review-skip-button {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

/* Spaced retrieval inbox */
.spaced-review-modal {
  width: min(680px, calc(100% - 32px));
  max-height: min(880px, calc(100dvh - 32px));
  overflow-y: auto;
}

.spaced-review-recall,
.spaced-review-result {
  display: grid;
  justify-items: center;
}

.spaced-review-result[hidden],
.spaced-review-recall[hidden] {
  display: none;
}

.spaced-review-milestone {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--focus) 32%, var(--line));
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: var(--focus-soft);
  color: var(--focus);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#spacedReviewPrompt {
  max-width: 570px;
  margin: 20px auto 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(22px, 3.2vw, 29px);
  line-height: 1.35;
  text-align: center;
}

.spaced-review-check {
  min-height: 46px;
  margin-top: 20px;
}

.spaced-review-score {
  width: 100%;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--focus) 22%, var(--line));
  border-radius: 14px;
  background: var(--focus-soft);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
}

.spaced-review-lines {
  width: 100%;
  margin-top: 14px;
}

.spaced-review-line.is-missing {
  border-color: color-mix(in srgb, var(--focus) 30%, var(--line));
}

.spaced-review-line.is-matched {
  opacity: 0.78;
}

.spaced-review-concepts {
  display: block;
  margin-top: 6px;
  color: var(--focus);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 720;
}

.confidence-field {
  width: 100%;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.confidence-field legend {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
}

.confidence-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.confidence-scale input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.confidence-scale span {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 800;
}

.confidence-scale small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
}

.confidence-scale input:checked + span {
  border-color: var(--focus);
  background: var(--focus-soft);
  color: var(--focus);
}

.confidence-scale input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 2px;
}

.spaced-review-actions {
  width: 100%;
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.spaced-review-actions .button {
  min-height: 46px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 32px));
  min-height: 54px;
  padding: 8px 8px 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transform: translateX(-50%);
}

.toast > span {
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}

.toast-action {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--focus);
  color: var(--paper);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}

.toast-action[hidden] {
  display: none;
}

@media (max-width: 1020px) {
  .library-hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
    gap: 44px;
  }

  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader-settings {
    grid-template-columns: 1.3fr 1fr;
    row-gap: 18px;
  }

  .reader-settings > :nth-child(n + 3) {
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .reader-settings > :nth-child(odd) {
    border-left: 0 !important;
  }
}

@media (max-width: 800px) {
  .app-header,
  .library-view {
    width: min(100% - 30px, 680px);
  }

  .app-header {
    height: calc(78px + env(safe-area-inset-top));
  }

  .privacy-pill {
    display: none;
  }

  .library-view {
    padding-top: 10px;
  }

  .library-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 45px 0 70px;
  }

  .install-callout {
    grid-template-columns: auto minmax(0, 1fr);
    margin-bottom: 48px;
  }

  .install-callout-button {
    grid-column: 2;
    justify-self: start;
  }

  .hero-reader {
    width: min(540px, 100%);
    justify-self: center;
    transform: none;
  }

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .continue-card {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 16px;
  }

  .continue-cover {
    height: 98px;
  }

  .reader-view {
    min-height: calc(100vh - 78px - env(safe-area-inset-top));
    min-height: calc(100dvh - 78px - env(safe-area-inset-top));
    width: min(100% - 20px, 760px);
    grid-template-rows: auto minmax(350px, 1fr) auto;
    padding-top: 0;
  }

  .reader-stage {
    min-height: 350px;
  }

  .live-page-viewport {
    max-height: 245px;
  }

  .reader-dock {
    padding-inline: 16px;
  }

  .reader-settings {
    grid-template-columns: 1fr;
  }

  .reader-settings > * {
    padding: 0 8px;
  }

  .reader-settings > * + * {
    padding-top: 16px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .size-setting {
    grid-column: auto;
  }
}

@media (max-width: 560px), (pointer: coarse) and (max-width: 1024px) {
  :root {
    --reader-word-size: 54px;
  }

  .app-header {
    width: calc(100% - 22px);
  }

  .app-shell.reader-active .app-header {
    display: none;
  }

  .brand-copy small,
  .reader-top-actions #shortcutsButton {
    display: none;
  }

  .brand-copy strong {
    font-size: 20px;
  }

  .header-import {
    width: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 0;
  }

  .header-import svg {
    display: block;
  }

  .header-actions {
    gap: 4px;
  }

  .account-sync-button {
    min-height: 44px;
    padding: 5px 8px;
    border-radius: 14px;
  }

  .account-sync-copy strong {
    font-size: 11px;
  }

  .library-view {
    width: calc(100% - 28px);
  }

  .hero-copy h1 {
    font-size: clamp(43px, 14vw, 60px);
  }

  .hero-description {
    font-size: 16px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-reader {
    min-height: 310px;
    padding: 20px;
  }

  .preview-stage {
    height: 190px;
  }

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 13px;
  }

  .book-cover {
    padding: 16px;
  }

  .book-cover strong {
    font-size: clamp(18px, 5.5vw, 24px);
  }

  .continue-card {
    grid-template-columns: 65px minmax(0, 1fr);
    padding: 15px;
  }

  .continue-cover {
    height: 85px;
  }

  .continue-card > .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .review-inbox-card {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 15px;
  }

  .review-inbox-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .review-inbox-card > .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .repair-toolbar {
    align-items: stretch;
  }

  .repair-toolbar .button {
    flex: 1 1 0;
    min-height: 44px;
  }

  .repair-toolbar > span {
    flex-basis: 100%;
  }

  .repair-block-controls {
    padding-left: 0;
  }

  .repair-block-controls select,
  .repair-block-controls button {
    min-height: 44px;
  }

  .repair-block-controls select {
    flex: 1 1 150px;
    font-size: 16px;
  }

  .repair-block > small {
    padding-left: 0;
  }

  .continue-copy h3 {
    font-size: 20px;
  }

  .empty-library {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 20px;
  }

  .empty-mark {
    width: 46px;
    height: 46px;
    padding: 12px;
  }

  .empty-library .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .install-callout {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .install-app-icon {
    width: 50px;
    height: 50px;
    padding: 13px 11px;
    border-radius: 12px;
  }

  .install-callout-copy h2 {
    font-size: 23px;
  }

  .install-callout-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .reader-view {
    width: calc(100% - 12px);
    min-height: calc(100vh - 78px - env(safe-area-inset-top));
    min-height: calc(100dvh - 78px - env(safe-area-inset-top));
    gap: 9px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .app-shell.reader-active .reader-view {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .reader-topbar {
    min-height: 48px;
    grid-template-columns: 92px minmax(0, 1fr) 92px;
  }

  .back-button {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .back-button span,
  .reader-book-meta > span,
  .stage-labels,
  .stage-hint {
    display: none;
  }

  .reader-book-meta > strong {
    font-size: 15px;
  }

  .reader-book-meta {
    width: 100%;
    justify-self: center;
  }

  .reader-top-actions {
    display: none;
  }

  .mobile-reader-actions {
    display: flex;
  }

  .mobile-reader-actions .icon-button {
    width: 44px;
    height: 44px;
  }

  .reader-view[data-context-mode="sentence"] .reader-stage {
    min-height: 300px;
    padding: 12px;
    grid-template-rows: minmax(220px, 1fr) 90px 44px;
    border-radius: 20px;
  }

  .reader-view[data-context-mode="page"] .reader-stage {
    min-height: 300px;
    padding: 12px;
    grid-template-rows: minmax(220px, 1fr) 44px;
    border-radius: 20px;
  }

  .live-page {
    border-radius: 20px;
  }

  .live-page-header {
    min-height: 56px;
    padding: 10px 14px;
  }

  .live-page-heading {
    gap: 8px;
  }

  .live-page-heading strong {
    max-width: 175px;
    font-size: 14px;
  }

  .following-label {
    width: 8px;
    overflow: hidden;
    color: transparent;
    gap: 0;
  }

  .live-page-viewport {
    max-height: 205px;
    padding: 10px 10px 14px;
  }

  .live-page-paper {
    min-height: 185px;
    padding: 22px 18px;
  }

  .page-block + .page-block {
    margin-top: 13px;
  }

  .page-title {
    font-size: 27px;
  }

  .page-heading {
    font-size: 22px;
  }

  .page-intro {
    padding-left: 12px;
    font-size: 16px;
  }

  .page-paragraph,
  .page-list,
  .page-quote {
    font-size: 15px;
    line-height: 1.65;
  }

  .word-stage {
    min-height: 220px;
    padding-inline: 0;
  }

  .orp-word {
    font-size: clamp(37px, var(--reader-word-size), 72px);
  }

  .orp-word.is-semantic-phrase {
    font-size: clamp(26px, calc(var(--reader-word-size) * 0.57), 43px);
  }

  .semantic-transition {
    width: 94%;
    gap: 11px;
  }

  .semantic-transition strong {
    font-size: clamp(32px, 10vw, 48px);
  }

  .semantic-transition.is-long strong {
    font-size: clamp(26px, 7.8vw, 38px);
  }

  .semantic-transition.is-very-long strong {
    font-size: clamp(22px, 6.6vw, 32px);
  }

  .scientific-source-page {
    width: 96%;
    max-height: 145px;
    border-radius: 9px;
  }

  .semantic-transition.is-parenthetical {
    width: 96%;
    padding: 22px 30px;
    border-radius: 20px;
  }

  .semantic-transition.is-parenthetical strong {
    font-size: clamp(25px, 7.4vw, 35px);
  }

  .semantic-transition.is-parenthetical.is-reference strong {
    font-size: clamp(21px, 6.2vw, 30px);
  }

  .semantic-transition.is-semantic-sentence {
    width: 98%;
    padding: 18px 16px;
    border-radius: 18px;
  }

  .semantic-transition.is-semantic-sentence strong {
    font-size: clamp(22px, 6.6vw, 31px);
    line-height: 1.25;
  }

  .reader-stage[data-semantic="heading"] .semantic-transition strong {
    font-size: clamp(27px, 8.5vw, 40px);
  }

  .reader-stage[data-semantic="heading"] .semantic-transition.is-long strong {
    font-size: clamp(24px, 7.2vw, 35px);
  }

  .reader-stage[data-semantic="heading"] .semantic-transition.is-very-long strong {
    font-size: clamp(21px, 6.2vw, 30px);
  }

  .sentence-context {
    min-height: 0;
    max-height: none;
    height: 90px;
    padding-inline: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    font-size: 14px;
  }

  .recovery-row {
    min-height: 44px;
    margin-top: 3px;
  }

  .replay-sentence-button,
  .lost-me-button {
    min-height: 44px;
    padding-inline: 13px;
  }

  .replay-sentence-button {
    display: none;
  }

  .recovery-row > span {
    display: none;
  }

  .reader-dock {
    display: none;
  }

  .progress-row {
    min-height: 42px;
    grid-template-columns: 38px minmax(0, 1fr) 58px;
    gap: 8px;
    font-size: 8px;
  }

  .control-row {
    gap: 6px;
    padding-bottom: 12px;
  }

  .control-button {
    width: 40px;
    height: 40px;
  }

  #previousSectionButton,
  #nextSectionButton {
    display: none;
  }

  .play-button {
    width: 58px;
    height: 58px;
  }

  .reader-settings {
    display: none;
  }

  .context-segment button {
    min-height: 44px;
  }

  .reader-settings-modal,
  .note-modal {
    width: 100%;
    max-width: none;
    max-inline-size: none;
    inline-size: 100%;
    inset-inline: 0;
    max-height: calc(92dvh - env(safe-area-inset-top));
    margin: auto 0 0;
    padding: 28px calc(18px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
  }

  .reader-settings-modal .sheet-handle {
    position: absolute;
    top: 9px;
    left: 50%;
    width: 38px;
    height: 4px;
    border-radius: 4px;
    display: block;
    background: var(--line-strong);
    transform: translateX(-50%);
  }

  .reader-sheet-actions {
    margin: 17px 0 10px;
    gap: 6px;
  }

  .reader-sheet-actions button {
    min-height: 62px;
    border-radius: 12px;
    font-size: 11px;
  }

  .reader-sheet-settings > * {
    min-height: 56px;
  }

  .reader-sheet-settings .stepper button,
  .reader-sheet-settings select,
  .review-line-actions button {
    min-width: 44px;
    min-height: 44px;
  }

  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
    font-size: 16px;
  }

  .range,
  .book-search-field button,
  .bookmark-remove,
  .page-jump input,
  .page-jump .button,
  .note-color {
    min-width: 44px;
    min-height: 44px;
  }

  .modal-header {
    position: sticky;
    z-index: 3;
    top: -1px;
    padding-block: 4px 10px;
    background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
    backdrop-filter: blur(18px);
  }

  .modal {
    width: calc(100% - 18px);
    padding: 22px calc(18px + env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
    border-radius: 22px;
  }

  .modal.reader-settings-modal,
  .modal.note-modal {
    width: 100%;
    max-width: none;
    max-inline-size: none;
    inline-size: 100%;
    inset-inline: 0;
    max-height: calc(92dvh - env(safe-area-inset-top));
    margin: auto 0 0;
    padding: 28px calc(18px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
    border-radius: 24px 24px 0 0;
  }

  .data-modal,
  .calibration-modal,
  .review-modal,
  .ten2-sign-in-modal,
  .spaced-review-modal,
  .narration-modal {
    width: 100%;
    max-width: none;
    max-inline-size: none;
    inline-size: 100%;
    inset-inline: 0;
    max-height: calc(100dvh - env(safe-area-inset-top));
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }

  .narration-passage {
    padding: 18px;
  }

  .narration-passage blockquote {
    min-height: 92px;
    font-size: 21px;
  }

  .narration-timeline {
    margin-top: 14px;
  }

  .narration-settings {
    grid-template-columns: 1fr;
  }

  .data-action-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .data-action-card > .button {
    grid-column: 2;
    justify-self: start;
  }

  .focusline-sync-card {
    padding: 16px;
  }

  .focusline-sync-heading {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
  }

  .focusline-sync-lock {
    width: 38px;
    height: 38px;
  }

  .focusline-sync-title-line {
    align-items: flex-start;
  }

  .focusline-sync-auth,
  .focusline-sync-session,
  .focusline-sync-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .focusline-sync-auth .button,
  .focusline-sync-actions .button {
    width: 100%;
  }

  .focusline-sync-unlock {
    grid-template-columns: 1fr;
  }

  .focusline-sync-unlock > .button {
    width: 100%;
    grid-column: 1;
    grid-row: auto;
  }

  .focusline-sync-unlock > p {
    grid-column: 1;
  }

  .focusline-sync-session > .button {
    align-self: flex-start;
  }

  .focusline-sync-books {
    align-items: center;
  }

  .focusline-sync-books-hint {
    margin-right: 0;
  }

  .focusline-sync-confirm > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .focusline-sync-confirm .button {
    width: 100%;
  }

  .focusline-sync-actions > span {
    text-align: center;
  }

  .calibration-promise-grid {
    grid-template-columns: 1fr;
  }

  .calibration-promise-grid span {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
  }

  .calibration-promise-grid small {
    margin: 0;
  }

  .calibration-word-stage {
    min-height: 245px;
  }

  .calibration-word {
    font-size: clamp(38px, 13vw, 58px);
  }

  .clarity-options {
    grid-template-columns: 1fr;
  }

  .clarity-options span {
    justify-content: flex-start;
  }

  .review-recall-view {
    padding-inline: 0;
  }

  .review-recap-view {
    padding: 14px;
  }

  .review-replay-actions,
  .review-primary-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .review-replay-actions .button,
  .review-primary-actions .button {
    width: 100%;
  }

  .review-primary-actions {
    flex-direction: column;
  }

  .spaced-review-recall,
  .spaced-review-result {
    justify-items: stretch;
  }

  #spacedReviewPrompt {
    font-size: 23px;
  }

  .spaced-review-milestone {
    justify-self: center;
  }

  .confidence-scale {
    gap: 5px;
  }

  .confidence-scale span {
    min-height: 50px;
    border-radius: 10px;
  }

  .spaced-review-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .spaced-review-actions .button {
    width: 100%;
  }

  .navigator-dialog {
    width: 100%;
    max-width: none;
    max-inline-size: none;
    inline-size: 100%;
    inset-inline: 0;
    height: min(86dvh, 760px);
    max-height: calc(100dvh - env(safe-area-inset-top));
    margin: auto 0 0;
    padding: 0;
    border-radius: 24px 24px 0 0;
  }

  .navigator-dialog[open] {
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
  }

  .navigator-sheet-handle {
    position: absolute;
    z-index: 2;
    top: 8px;
    left: 50%;
    width: 38px;
    height: 4px;
    border-radius: 4px;
    display: block;
    background: var(--line-strong);
    transform: translateX(-50%);
  }

  .navigator-header {
    padding: 23px calc(18px + env(safe-area-inset-right)) 13px calc(18px + env(safe-area-inset-left));
  }

  .navigator-quick-actions,
  .navigator-tabs,
  .navigator-panel {
    padding-left: calc(14px + env(safe-area-inset-left));
    padding-right: calc(14px + env(safe-area-inset-right));
  }

  .focus-mode .mobile-reader-actions {
    grid-column: 2;
  }

  .navigator-header h2 {
    font-size: 26px;
  }

  .navigator-header #navigatorPosition {
    max-width: 270px;
  }

  .navigator-quick-actions {
    margin: 0 14px 12px;
    gap: 6px;
  }

  .navigator-return {
    margin: 0 calc(14px + env(safe-area-inset-right)) 10px calc(14px + env(safe-area-inset-left));
  }

  .navigator-quick-actions button {
    min-height: 58px;
    padding-inline: 2px;
    border-radius: 12px;
    font-size: 8px;
  }

  .navigator-tabs {
    padding-inline: 14px;
  }

  .navigator-tabs button {
    min-height: 44px;
    padding-inline: 4px;
    font-size: 9px;
  }

  .note-actions {
    grid-template-columns: 1fr 1fr;
  }

  .note-actions > span {
    display: none;
  }

  .note-actions .button-primary {
    grid-column: 2;
  }

  .navigator-panel {
    padding: 15px 14px calc(20px + env(safe-area-inset-bottom));
  }

  .page-jump {
    grid-template-columns: minmax(0, 1fr) 68px 58px;
    margin-bottom: 15px;
    padding: 11px;
  }

  .navigator-row {
    min-height: 58px;
    padding-inline: 9px;
  }

  .install-modal {
    width: 100%;
    max-width: none;
    max-inline-size: none;
    inline-size: 100%;
    inset-inline: 0;
    max-height: calc(100dvh - env(safe-area-inset-top));
    margin: auto 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }

  .install-modal .modal-header h2 {
    font-size: 30px;
  }

  .drop-zone {
    min-height: 245px;
    padding-inline: 15px;
  }

  .format-notes {
    gap: 10px;
  }

  .format-notes span:nth-child(2) {
    display: flex;
    flex-basis: 100%;
    justify-content: center;
  }

  .focus-mode .reader-view {
    width: calc(100% - 12px);
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }

  html[data-platform="ios-native"] .library-view {
    padding-top: 0;
    padding-bottom: max(36px, env(safe-area-inset-bottom));
  }

  html[data-platform="ios-native"] .library-hero {
    display: none;
  }

  html[data-platform="ios-native"] .library-section {
    padding-top: 14px;
    border-top: 0;
  }

  html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .header-import {
    display: none;
  }

  html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-library {
    min-height: min(440px, calc(100dvh - 190px - env(safe-area-inset-top)));
    margin-top: 0;
    padding: 46px 28px;
    border-style: solid;
    border-radius: 28px;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 18px;
    background: var(--surface);
    text-align: center;
    box-shadow: var(--shadow-soft);
  }

  html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-mark {
    width: 64px;
    height: 64px;
    margin-bottom: 4px;
    padding: 17px;
    background: var(--paper);
  }

  html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-library h3 {
    font-size: 28px;
  }

  html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-library p {
    max-width: 290px;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.55;
  }

  html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-library .button {
    width: min(100%, 290px);
    margin-top: 8px;
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
  }

  html[data-platform="ios-native"] .app-shell.reader-active .reader-view {
    width: 100%;
    gap: 4px;
  }

  html[data-platform="ios-native"] .reader-topbar {
    padding-inline: 8px;
  }

  html[data-platform="ios-native"] .reader-stage,
  html[data-platform="ios-native"] .reader-view[data-context-mode="sentence"] .reader-stage,
  html[data-platform="ios-native"] .reader-view[data-context-mode="page"] .reader-stage {
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }

  html[data-platform="ios-native"] .mobile-play-button {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 20%, transparent);
  }

  html[data-platform="ios-native"] #readerMoreButton {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
  }
}

html[data-platform="ios-native"] .install-callout {
  display: none !important;
}

html[data-platform="ios-native"] #protectStorageButton {
  display: none;
}

html[data-platform="ios-native"] :is(
  button,
  .app-header,
  .section-heading,
  .modal-header,
  .reader-sheet-actions,
  .reader-sheet-settings > *
) {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

@media (display-mode: standalone) {
  .install-callout {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .button:active,
  .icon-button:active,
  .control-button:active,
  .play-button:active,
  .back-button:active,
  .stepper button:active {
    transform: none;
  }
}

/* On-device Reading Partner --------------------------------------------- */
.library-companion-slot {
  margin: 0 0 24px;
}

.library-companion-button {
  width: 100%;
  min-height: 74px;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  background: color-mix(in srgb, var(--surface-strong) 78%, var(--accent-soft));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.library-companion-button > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.library-companion-button strong { font-size: 15px; }
.library-companion-button small { color: var(--muted); font-size: 12px; }
.library-companion-button > svg { width: 18px; color: var(--muted); }

.ask-partner-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: color-mix(in srgb, var(--accent-soft) 34%, transparent);
  color: var(--accent-deep);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.ask-partner-button:hover {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 64%, transparent);
  color: var(--ink);
}

.ask-partner-button svg {
  width: 16px;
  height: 16px;
}

.reading-partner-modal {
  width: min(680px, calc(100% - 30px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: min(820px, calc(100dvh - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  padding: 0;
  overflow-x: hidden;
}

.reading-partner-modal[open] {
  display: block;
}

.reading-partner-sheet-handle {
  display: none;
}

.reading-partner-header {
  position: sticky;
  z-index: 4;
  top: 0;
  margin: 0;
  padding: 24px 26px 15px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.reading-partner-header .eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
}

.reading-partner-header h2 {
  font-family: var(--sans);
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.reading-partner-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.reading-partner-header-button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  color: var(--muted);
  font: 700 12px/1 var(--sans);
  cursor: pointer;
}

.reading-partner-transcript {
  display: grid;
  gap: 12px;
  max-height: min(42dvh, 390px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.reading-partner-transcript::-webkit-scrollbar { display: none; }

.companion-message {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: 18px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.companion-message[data-role="user"] {
  justify-self: end;
  border-bottom-right-radius: 6px;
  background: var(--ink);
  color: var(--surface);
}

.companion-message[data-role="assistant"] {
  justify-self: start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--ink);
}

.companion-message-meta,
.companion-message-sources {
  color: var(--muted);
  font-size: 11px;
}

.companion-message-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.companion-message-sources button,
.companion-message-sources span {
  max-width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent-deep);
  font: 700 10px/1.2 var(--sans);
  text-align: left;
}

.companion-message-sources button { cursor: pointer; }

.reading-partner-empty {
  padding: 18px;
  border: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 18px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.reading-partner-empty strong { color: var(--ink); font-size: 14px; }

.reading-partner-recommendations,
.companion-recommendation-list {
  display: grid;
  gap: 9px;
}

.companion-recommendation-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.companion-recommendation-card strong,
.companion-recommendation-card span,
.companion-recommendation-card small { grid-column: 1; }
.companion-recommendation-card small { color: var(--muted); line-height: 1.4; }
.companion-recommendation-card button { grid-column: 2; grid-row: 1 / span 3; align-self: center; }

.companion-profile-panel {
  padding: 0 26px calc(28px + env(safe-area-inset-bottom));
  display: grid;
  gap: 18px;
}

.companion-profile-panel[hidden] { display: none; }

.companion-profile-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.companion-profile-heading,
.companion-section-heading,
.companion-profile-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.companion-profile-heading h3,
.companion-section-heading h4 { margin: 2px 0 0; }

.companion-profile-toggle {
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 75%, transparent);
}

.companion-profile-toggle > span:first-child { display: grid; gap: 3px; }
.companion-profile-toggle small { color: var(--muted); }

.companion-cloud-sync-row {
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: color-mix(in srgb, var(--surface-strong) 75%, transparent);
}

.companion-cloud-sync-row > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.companion-cloud-sync-row small {
  color: var(--muted);
  line-height: 1.4;
}

.companion-memory-form { display: grid; gap: 8px; }
.companion-memory-form > label { color: var(--muted); font-size: 12px; font-weight: 700; }
.companion-memory-form > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.companion-memory-form input {
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.companion-record-list { display: grid; gap: 8px; margin-top: 9px; }
.companion-record-empty { color: var(--muted); font-size: 12px; }
.companion-record {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
}
.companion-record > span { color: var(--muted); font-size: 11px; }
.companion-record > input {
  min-width: 0;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.companion-record-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 5px; }
.companion-record-actions button {
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
  color: var(--ink);
  font: 700 11px/1 var(--sans);
}
.companion-forget-button { justify-self: start; }

.reading-partner-local-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #36a964;
  box-shadow: 0 0 0 4px color-mix(in srgb, #36a964 14%, transparent);
}

.reading-partner-intro {
  margin: 0;
  padding: 0 26px 19px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.reading-partner-model,
.reading-partner-workspace,
.reading-partner-unavailable {
  margin: 0 18px 18px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-strong) 86%, var(--paper));
}

.reading-partner-model {
  padding: 18px;
}

.reading-partner-model-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.reading-partner-model-heading > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reading-partner-model-heading strong {
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.012em;
}

.reading-partner-model-heading span:not(.reading-partner-status-pill) {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.reading-partner-orb {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.82), transparent 25%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 74%, #8b78ff), color-mix(in srgb, var(--focus) 65%, #ffb563));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32), 0 7px 18px color-mix(in srgb, var(--accent) 15%, transparent);
}

.reading-partner-orb span {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
}

.reading-partner-orb i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: -11px 8px 0 -1px rgba(255, 255, 255, 0.66), 10px -9px 0 -1px rgba(255, 255, 255, 0.74);
}

.reading-partner-status-pill {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--line) 54%, transparent);
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.reading-partner-status-pill[data-state="ready"],
.reading-partner-status-pill[data-state="loaded"] {
  background: color-mix(in srgb, #36a964 14%, transparent);
  color: color-mix(in srgb, #168142 86%, var(--ink));
}

.reading-partner-status-pill[data-state="downloading"],
.reading-partner-status-pill[data-state="installing"],
.reading-partner-status-pill[data-state="thinking"] {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent-deep);
}

.reading-partner-status-pill[data-state="error"] {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.reading-partner-model-detail {
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.reading-partner-progress {
  margin-top: 15px;
}

.reading-partner-progress > div {
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.reading-partner-progress progress {
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  appearance: none;
}

.reading-partner-progress progress::-webkit-progress-bar {
  border-radius: 99px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.reading-partner-progress progress::-webkit-progress-value {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--focus));
}

.reading-partner-terms {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.reading-partner-terms .switch {
  flex: 0 0 auto;
  transform: scale(0.82);
  transform-origin: left top;
}

.reading-partner-terms a {
  color: var(--accent-deep);
  font-weight: 700;
}

.reading-partner-model-actions {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reading-partner-model-actions .button {
  min-height: 44px;
}

.reading-partner-workspace {
  padding: 14px;
}

.reading-partner-policy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.reading-partner-policy-row > label,
.reading-partner-web-off {
  min-height: 54px;
  padding: 8px 11px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}

.reading-partner-policy-row > label {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.reading-partner-policy-row select {
  min-height: 36px;
  padding: 0 30px 0 10px;
  border: 0;
  border-radius: 10px;
  background-color: color-mix(in srgb, var(--ink) 6%, var(--surface-strong));
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 720;
}

.reading-partner-web-off {
  min-width: 116px;
  gap: 8px;
  color: #25804a;
}

.reading-partner-web-off svg {
  width: 20px;
  height: 20px;
}

.reading-partner-web-off > span {
  display: grid;
}

.reading-partner-web-off strong {
  font-size: 11px;
}

.reading-partner-web-off small {
  color: var(--muted);
  font-size: 9px;
}

.reading-partner-starters {
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.reading-partner-starters button {
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
}

.reading-partner-starters button:hover,
.reading-partner-starters button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.reading-partner-form {
  padding: 13px;
  border-radius: 17px;
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
}

.reading-partner-form > label {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.reading-partner-form textarea {
  width: 100%;
  min-height: 74px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
}

.reading-partner-form-actions {
  padding-top: 9px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.reading-partner-form-actions > span {
  min-width: 0;
  margin-right: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reading-partner-form-actions .button {
  min-height: 40px;
  padding-inline: 14px;
}

.reading-partner-response {
  margin-top: 13px;
  padding: 16px;
  border-radius: 17px;
  background: color-mix(in srgb, var(--accent-soft) 24%, var(--surface-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}

.reading-partner-response > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reading-partner-response > div strong {
  font-size: 12px;
}

.reading-partner-response > div span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: capitalize;
}

.reading-partner-response > p {
  margin: 12px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.reading-partner-response[data-busy="true"] > p {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}

.reading-partner-response[data-busy="true"] > p::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 5px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent);
  box-shadow: 8px 0 0 color-mix(in srgb, var(--accent) 62%, transparent), 16px 0 0 color-mix(in srgb, var(--accent) 30%, transparent);
  animation: reading-partner-thinking 900ms ease-in-out infinite alternate;
}

.reading-partner-response ul {
  margin: 13px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.reading-partner-response li {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  color: var(--muted);
  font-size: 9px;
}

.reading-partner-unavailable {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.reading-partner-unavailable[hidden] {
  display: none;
}

.reading-partner-unavailable > div:last-child {
  min-width: 0;
}

.reading-partner-unavailable strong {
  font-size: 15px;
}

.reading-partner-unavailable p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@keyframes reading-partner-thinking {
  from { opacity: 0.45; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 560px) {
  .library-companion-slot { margin-bottom: 18px; }
  .library-companion-button { min-height: 68px; border-radius: 19px; }
  .reading-partner-header-button { padding-inline: 8px; }
  .reading-partner-transcript { max-height: 36dvh; }
  .companion-message { max-width: 94%; }
  .companion-profile-panel { padding-inline: 14px; }
  .companion-recommendation-card { grid-template-columns: 1fr; }
  .companion-recommendation-card button { grid-column: 1; grid-row: auto; justify-self: start; }
  .recovery-row {
    gap: 7px;
  }

  .ask-partner-button,
  .lost-me-button,
  .replay-sentence-button {
    min-width: 0;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 11px;
    letter-spacing: 0;
  }

  .reader-sheet-actions {
    grid-template-columns: repeat(5, 1fr);
  }

  .reader-sheet-actions button {
    min-width: 0;
    font-size: 10px;
  }

  .modal.reading-partner-modal {
    width: 100%;
    max-width: none;
    max-inline-size: none;
    inline-size: 100%;
    max-height: calc(94dvh - env(safe-area-inset-top));
    margin: auto 0 0;
    border: 0;
    border-radius: 28px 28px 0 0;
  }

  .reading-partner-modal[open] {
    animation: focusline-sheet-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .reading-partner-sheet-handle {
    position: sticky;
    z-index: 6;
    top: 8px;
    width: 36px;
    height: 5px;
    margin: 8px auto 0;
    border-radius: 99px;
    display: block;
    background: color-mix(in srgb, var(--muted) 42%, transparent);
  }

  .reading-partner-header {
    padding: 15px 18px 12px;
  }

  .reading-partner-header h2 {
    font-size: 23px;
  }

  .reading-partner-intro {
    padding: 0 18px 16px;
    font-size: 13px;
  }

  .reading-partner-model,
  .reading-partner-workspace,
  .reading-partner-unavailable {
    margin-inline: 12px;
  }

  .reading-partner-model {
    padding: 15px;
  }

  .reading-partner-model-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .reading-partner-status-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .reading-partner-policy-row {
    grid-template-columns: 1fr;
  }

  .reading-partner-web-off {
    min-width: 0;
  }

  .reading-partner-starters {
    grid-template-columns: repeat(2, 1fr);
  }

  .reading-partner-form-actions {
    flex-wrap: wrap;
  }

  .reading-partner-form-actions > span {
    width: 100%;
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reading-partner-modal[open],
  .reading-partner-response[data-busy="true"] > p::after {
    animation: none !important;
  }
}

/* iPhone product pass ----------------------------------------------------- */
.reader-settings-done {
  min-width: 56px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  cursor: pointer;
  font-size: 16px;
  font-weight: 750;
}

.sheet-section-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.remove-book-modal {
  width: min(430px, calc(100% - 32px));
}

.remove-book-modal .modal-header h2 {
  font-family: var(--sans);
  font-size: 23px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.remove-book-modal > p {
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.remove-book-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.remove-book-actions .button {
  min-height: 48px;
}

.button-danger {
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
  font-weight: 750;
}

.button-danger:hover {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
}

.play-button,
.mobile-play-button {
  position: relative;
}

.play-button .play-icon,
.play-button .pause-icon,
.mobile-play-button .play-icon,
.mobile-play-button .pause-icon,
.is-playing .play-button .play-icon,
.is-playing .play-button .pause-icon,
.is-playing .mobile-play-button .play-icon,
.is-playing .mobile-play-button .pause-icon {
  position: absolute;
  display: block;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.play-button .pause-icon,
.mobile-play-button .pause-icon,
.is-playing .play-button .play-icon,
.is-playing .mobile-play-button .play-icon {
  opacity: 0;
  transform: scale(0.72);
}

.play-button .play-icon,
.mobile-play-button .play-icon,
.is-playing .play-button .pause-icon,
.is-playing .mobile-play-button .pause-icon {
  opacity: 1;
  transform: scale(1);
}

@keyframes focusline-view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes focusline-sheet-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes focusline-modal-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.library-view:not([hidden]),
.reader-view:not([hidden]) {
  animation: focusline-view-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal[open] {
  animation: focusline-modal-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.orp-word,
.semantic-transition {
  will-change: opacity;
}

@media (hover: none), (pointer: coarse) {
  .sentence-context .sentence-word:not(.is-parenthetical):hover,
  .page-word:not(.is-current-word):hover {
    background: transparent;
    color: inherit;
  }

  .book-open:hover .book-cover {
    transform: none;
    box-shadow: 0 8px 20px rgba(38, 34, 28, 0.14);
  }

  .book-open:active .book-cover {
    transform: scale(0.985);
  }

  .play-button:hover {
    transform: none;
  }
}

/* The signed iPhone bundle uses its own compact, native-feeling library. */
html[data-platform="ios-native"] body {
  background: var(--paper);
}

html[data-platform="ios-native"] .app-header {
  width: 100%;
  height: auto;
  min-height: calc(56px + env(safe-area-inset-top));
  padding: calc(env(safe-area-inset-top) + 6px) 16px 6px;
  margin: 0;
  justify-content: flex-end;
}

html[data-platform="ios-native"] .app-header .brand,
html[data-platform="ios-native"] .app-header .privacy-pill,
html[data-platform="ios-native"] .app-header #themeButton {
  display: none;
}

html[data-platform="ios-native"] .app-header .header-actions {
  gap: 8px;
}

html[data-platform="ios-native"] .app-header .header-import {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
}

html[data-platform="ios-native"] .app-header #dataButton {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink-soft);
}

html[data-platform="ios-native"] .app-header #accountSyncButton {
  min-width: 0;
  height: 44px;
  padding: 4px 10px 4px 5px;
  border: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  box-shadow: none;
}

html[data-platform="ios-native"] .app-header #accountSyncButton .account-sync-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

html[data-platform="ios-native"] .app-header #accountSyncButton .account-sync-copy strong {
  font-size: 11px;
}

html[data-platform="ios-native"] .app-header #accountSyncButton .account-sync-copy small {
  font-size: 9px;
}

html[data-platform="ios-native"] .app-header .header-import {
  background: var(--accent-soft);
  color: var(--accent-deep);
  box-shadow: none;
}

html[data-platform="ios-native"] .library-view {
  width: 100%;
  padding: 0 16px max(42px, env(safe-area-inset-bottom));
}

html[data-platform="ios-native"] .library-section {
  padding-top: 4px;
}

html[data-platform="ios-native"] .section-heading {
  align-items: end;
  margin-bottom: 24px;
}

html[data-platform="ios-native"] .section-heading .eyebrow {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.09em;
}

html[data-platform="ios-native"] .section-heading h2 {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

html[data-platform="ios-native"] .book-count {
  padding: 0 0 3px;
  font-size: 13px;
  font-weight: 560;
}

html[data-platform="ios-native"] .continue-slot:not(:empty) {
  margin-bottom: 26px;
}

html[data-platform="ios-native"] .continue-card {
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 0;
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 8%, transparent);
}

html[data-platform="ios-native"] .continue-cover {
  height: 94px;
  border-radius: 7px 11px 11px 7px;
}

html[data-platform="ios-native"] .continue-copy h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

html[data-platform="ios-native"] .continue-copy > p {
  margin: 3px 0 10px;
  font-size: 11px;
}

html[data-platform="ios-native"] .continue-card > .button {
  grid-column: auto;
  width: auto;
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
}

html[data-platform="ios-native"] .review-inbox-card {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  border: 0;
  border-radius: 22px;
  background: color-mix(in srgb, var(--focus-soft) 42%, var(--surface));
  box-shadow: none;
}

html[data-platform="ios-native"] .review-inbox-card > .button {
  grid-column: auto;
  width: auto;
}

html[data-platform="ios-native"] .book-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 14px;
}

html[data-platform="ios-native"] .book-cover {
  padding: 17px;
  border-radius: 7px 13px 13px 7px;
  box-shadow: 0 9px 24px rgba(38, 34, 28, 0.15);
}

html[data-platform="ios-native"] .book-cover strong {
  font-size: clamp(19px, 5.6vw, 25px);
}

html[data-platform="ios-native"] .book-card-meta {
  min-height: 86px;
  padding: 13px 44px 4px 1px;
}

html[data-platform="ios-native"] .book-card-meta h3 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

html[data-platform="ios-native"] .book-card-meta p {
  margin-top: 5px;
  font-size: 12px;
}

html[data-platform="ios-native"] .book-progress-line {
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
}

html[data-platform="ios-native"] .remove-book {
  top: 7px;
  right: -3px;
  width: 44px;
  height: 44px;
  color: var(--muted);
}

html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-library {
  min-height: min(500px, calc(100dvh - 160px - env(safe-area-inset-top)));
  padding: 48px 24px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-mark {
  width: 72px;
  height: 72px;
  padding: 19px;
  border: 1px solid var(--line);
  background: var(--surface);
}

html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-library h3 {
  font-family: var(--sans);
  font-size: 25px;
  font-weight: 730;
  letter-spacing: -0.03em;
}

@media (max-width: 560px) {
  .app-shell.reader-active {
    background: var(--paper);
  }

  .app-shell.reader-active .reader-view,
  html[data-platform="ios-native"] .app-shell.reader-active .reader-view {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    overflow: hidden;
  }

  .reader-topbar,
  html[data-platform="ios-native"] .reader-topbar {
    min-height: calc(62px + env(safe-area-inset-top));
    padding: calc(env(safe-area-inset-top) + 7px) 12px 7px;
    grid-template-columns: 50px minmax(0, 1fr) 50px;
    transition: opacity 220ms ease;
  }

  .back-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  }

  .back-button svg {
    width: 23px;
    height: 23px;
  }

  .reader-book-meta {
    gap: 1px;
  }

  .reader-book-meta > strong {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.015em;
  }

  .reader-book-meta > span {
    display: flex;
    gap: 5px;
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .mobile-reader-actions {
    display: flex;
    justify-self: end;
  }

  .mobile-reader-actions .mobile-play-button {
    display: none;
  }

  #readerMoreButton,
  html[data-platform="ios-native"] #readerMoreButton {
    width: 44px;
    height: 44px;
    border: 0;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
    color: var(--ink);
    box-shadow: none;
  }

  #readerMoreButton svg {
    stroke-width: 3;
  }

  .reader-main {
    min-height: 0;
    padding-inline: 0;
    overflow: hidden;
  }

  .reader-stage,
  .reader-view[data-context-mode="sentence"] .reader-stage,
  html[data-platform="ios-native"] .reader-stage,
  html[data-platform="ios-native"] .reader-view[data-context-mode="sentence"] .reader-stage {
    min-height: 0;
    height: 100%;
    padding: 0 18px 2px;
    border: 0;
    border-radius: 0;
    grid-template-rows: minmax(218px, 1fr) minmax(66px, auto) 52px;
    background:
      radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--focus) 4%, transparent), transparent 38%),
      var(--paper);
    box-shadow: none;
  }

  .reader-view[data-context-mode="page"] .reader-stage,
  html[data-platform="ios-native"] .reader-view[data-context-mode="page"] .reader-stage {
    min-height: 280px;
    height: auto;
    padding: 0 18px 2px;
    grid-template-rows: minmax(218px, 1fr) 52px;
  }

  .reader-view[data-context-mode="page"] .reader-main {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .word-stage {
    min-height: 218px;
    padding: 20px 0;
  }

  .focus-rail {
    top: 25%;
    bottom: 25%;
    opacity: 0.72;
  }

  .focus-notch-top { top: 25%; }
  .focus-notch-bottom { bottom: 25%; }

  .focus-notch {
    left: calc(50% - 10px);
    width: 20px;
  }

  .orp-word {
    font-size: clamp(40px, var(--reader-word-size), 70px);
    font-weight: 620;
    letter-spacing: -0.04em;
  }

  .orp-focus {
    text-shadow: 0 0 14px color-mix(in srgb, var(--focus) 14%, transparent);
    transform: none;
  }

  .orp-focus::after {
    bottom: -7px;
    height: 2px;
  }

  .semantic-transition {
    width: min(92%, 440px);
    gap: 8px;
  }

  .semantic-transition strong {
    font-family: var(--sans);
    font-size: clamp(29px, 8.8vw, 42px);
    font-weight: 680;
    line-height: 1.08;
  }

  .semantic-transition small,
  .semantic-transition > span {
    font-size: 9px;
    letter-spacing: 0.09em;
  }

  .sentence-context {
    width: min(100%, 520px);
    height: auto;
    min-height: 66px;
    max-height: 112px;
    padding: 6px 8px 2px;
    overflow-y: auto;
    color: color-mix(in srgb, var(--muted) 86%, transparent);
    font-size: 15px;
    line-height: 1.55;
    scrollbar-width: none;
  }

  .sentence-context::-webkit-scrollbar {
    display: none;
  }

  .reader-stage.is-structural-transition .sentence-context {
    visibility: hidden;
  }

  .recovery-row {
    min-height: 52px;
    margin: 0;
    transition: opacity 220ms ease;
  }

  .ask-partner-button,
  .lost-me-button {
    min-width: 106px;
    min-height: 44px;
    padding-inline: 15px;
    border-color: color-mix(in srgb, var(--focus) 24%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 48%, transparent);
    font-size: 12px;
    letter-spacing: 0;
  }

  .reader-dock,
  html[data-platform="ios-native"] .reader-dock {
    position: relative;
    z-index: 5;
    display: grid;
    margin: 4px 12px max(8px, env(safe-area-inset-bottom));
    padding: 5px 12px 8px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 27px;
    background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
    box-shadow: 0 12px 34px color-mix(in srgb, var(--ink) 13%, transparent);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    transition: opacity 220ms ease, transform 220ms ease;
  }

  body.is-reading .toast {
    bottom: calc(max(24px, env(safe-area-inset-bottom)) + 112px);
  }

  .reader-dock .progress-row {
    min-height: 40px;
    grid-template-columns: 32px minmax(0, 1fr) 58px;
    gap: 8px;
    font-size: 8px;
  }

  .reader-dock .progress-row .progress-button {
    min-height: 44px;
  }

  .reader-dock .control-row {
    min-height: 64px;
    gap: 10px;
    padding: 0;
    border: 0;
  }

  .reader-dock .control-button {
    width: 46px;
    height: 46px;
    background: color-mix(in srgb, var(--ink) 5%, transparent);
  }

  .reader-dock .play-button {
    width: 58px;
    height: 58px;
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--ink) 18%, transparent);
  }

  .reader-dock .reader-settings {
    display: none;
  }

  .reader-view.is-playing .reader-topbar,
  .reader-view.is-playing .reader-dock,
  .reader-view.is-playing .recovery-row {
    opacity: 0;
    pointer-events: none;
    transition-delay: 1.35s;
  }

  .reader-view.is-playing .reader-dock {
    transform: translateY(8px);
  }

  .reader-view:not(.is-playing) .reader-topbar,
  .reader-view:not(.is-playing) .reader-dock,
  .reader-view:not(.is-playing) .recovery-row {
    transition-delay: 0s;
  }

  .reader-settings-modal,
  .modal.reader-settings-modal {
    max-height: calc(90dvh - env(safe-area-inset-top));
    padding: 26px 14px calc(18px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 28px 28px 0 0;
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.18);
  }

  .reader-settings-modal[open] {
    animation: focusline-sheet-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .reader-settings-modal .sheet-handle {
    top: 8px;
    width: 36px;
    height: 5px;
    background: color-mix(in srgb, var(--muted) 42%, transparent);
  }

  .reader-settings-modal .modal-header {
    top: -2px;
    margin: 0 -2px;
    padding: 4px 4px 13px;
    align-items: center;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
  }

  .reader-settings-modal .modal-header .eyebrow {
    display: none;
  }

  .reader-settings-modal .modal-header h2 {
    font-family: var(--sans);
    font-size: 22px;
    font-weight: 740;
    letter-spacing: -0.025em;
  }

  .reader-sheet-actions {
    margin: 4px 0 18px;
    gap: 10px;
  }

  .reader-sheet-actions button {
    min-height: 72px;
    padding: 9px 4px;
    border: 0;
    border-radius: 18px;
    background: var(--surface-strong);
    color: var(--ink-soft);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent);
    font-size: 11px;
  }

  .reader-sheet-actions button svg {
    width: 22px;
    height: 22px;
    color: var(--accent-deep);
  }

  .reader-sheet-settings {
    gap: 0;
    border: 0;
  }

  .reader-sheet-settings > .sheet-section-label {
    min-height: 0;
    margin: 15px 4px 7px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .reader-sheet-settings > :not(.sheet-section-label) {
    min-height: 58px;
    padding: 8px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    background: var(--surface-strong);
  }

  .reader-sheet-settings > .sheet-section-label + * {
    border-radius: 16px 16px 0 0;
  }

  .reader-sheet-settings > :not(.sheet-section-label):has(+ .sheet-section-label),
  .reader-sheet-settings > :last-child {
    border-bottom: 0;
    border-radius: 0 0 16px 16px;
  }

  .reader-sheet-settings strong {
    font-size: 15px;
    font-weight: 650;
  }

  .reader-sheet-settings small {
    margin-top: 1px;
    font-size: 11px;
    line-height: 1.3;
  }

  .reader-sheet-range {
    padding-top: 12px !important;
    padding-bottom: 10px !important;
  }

  .reader-sheet-range output {
    color: var(--accent-deep);
    font-size: 13px;
  }

  .reader-settings-modal .switch {
    width: 51px;
    height: 31px;
  }

  .reader-settings-modal .switch i::after {
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
  }

  .reader-settings-modal .switch input:checked + i::after {
    transform: translateX(20px);
  }

  .reader-settings-modal .context-segment {
    padding: 2px;
    border: 0;
    border-radius: 9px;
    background: color-mix(in srgb, var(--ink) 7%, transparent);
  }

  .reader-settings-modal .context-segment button {
    min-height: 32px;
    border: 0;
    border-radius: 7px;
    font-size: 11px;
  }

  .reader-settings-modal .context-segment button[aria-pressed="true"] {
    background: var(--surface-strong);
    color: var(--ink);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--ink) 14%, transparent);
  }

  .reader-settings-modal .stepper {
    padding: 2px;
    border: 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--ink) 7%, transparent);
  }

  .reader-settings-modal .stepper button {
    min-width: 46px;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
  }

  .reader-settings-modal .stepper button + button {
    border-left: 0;
  }

  .reader-settings-modal select {
    min-width: 118px;
    min-height: 40px;
    border: 0;
    background-color: color-mix(in srgb, var(--ink) 6%, var(--surface-strong));
  }

  .remove-book-modal {
    width: calc(100% - 24px);
    margin: auto 12px max(12px, env(safe-area-inset-bottom));
    padding: 24px 20px 18px;
    border: 0;
    border-radius: 24px;
  }

  .remove-book-modal[open] {
    animation: focusline-sheet-in 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .library-view:not([hidden]),
  .reader-view:not([hidden]),
  .modal[open],
  .reader-settings-modal[open],
  .remove-book-modal[open] {
    animation: none !important;
  }

  .reader-view.is-playing .reader-topbar,
  .reader-view.is-playing .reader-dock,
  .reader-view.is-playing .recovery-row {
    transition-delay: 0s;
  }
}

/* Shared Ten2 visual language ------------------------------------------- */
:root {
  --paper: #f4f7fc;
  --paper-deep: #eaf0f8;
  --surface: #f9fbff;
  --surface-strong: #ffffff;
  --ink: #171a21;
  --ink-soft: #4f5868;
  --muted: #748093;
  --line: rgba(71, 84, 112, 0.14);
  --line-strong: rgba(71, 84, 112, 0.24);
  --accent: #0a84ff;
  --accent-deep: #006edc;
  --accent-soft: #e4f2ff;
  --focus: #ff6658;
  --focus-soft: #ffe5e0;
  --success: #248a5a;
  --danger: #d84a4a;
  --glass: rgba(255, 255, 255, 0.76);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(71, 84, 112, 0.14);
  --shadow: 0 22px 58px rgba(55, 68, 104, 0.14);
  --shadow-soft: 0 10px 28px rgba(55, 68, 104, 0.1);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, ui-sans-serif, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, ui-sans-serif, sans-serif;
  --serif: "New York", "Iowan Old Style", Iowan Old Style, Baskerville, serif;
}

[data-theme="dark"] {
  --paper: #050505;
  --paper-deep: #000000;
  --surface: #111111;
  --surface-strong: #181818;
  --ink: #f7f9fd;
  --ink-soft: #c6cfdc;
  --muted: #9aa7b9;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #4ea1ff;
  --accent-deep: #75b6ff;
  --accent-soft: #10253d;
  --focus: #ff7769;
  --focus-soft: #3a2427;
  --success: #63c58e;
  --danger: #ff8176;
  --glass: rgba(18, 18, 18, 0.8);
  --glass-strong: rgba(24, 24, 24, 0.95);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.28);
}

html,
body,
html[data-platform="ios-native"] body {
  background: var(--paper);
}

.hero-copy h1,
.section-heading h2,
.panel-heading h2,
.modal-header h2,
.navigator-header h2,
.install-callout-copy h2,
.empty-library h3,
.continue-copy h3 {
  font-family: var(--display);
  font-weight: 740;
}

.eyebrow {
  letter-spacing: 0.045em;
}

.button-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}

.button-primary:hover {
  background: var(--accent-deep);
}

.button-secondary,
.icon-button,
.account-sync-button,
.back-button {
  border-color: var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.14);
  -webkit-backdrop-filter: blur(22px) saturate(1.14);
}

.button-secondary:hover,
.icon-button:hover,
.account-sync-button:hover,
.back-button:hover {
  border-color: var(--line-strong);
  background: var(--glass-strong);
}

.account-sync-icon,
.data-action-icon,
.focusline-sync-lock,
.storage-status-icon,
.reading-partner-form-actions .button svg,
.reader-sheet-actions button svg {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.switch input:checked + i,
.focusline-keychain-options input[type="checkbox"] {
  accent-color: var(--accent);
}

.switch input:checked + i {
  background: var(--accent);
}

.install-callout,
.continue-card,
.review-inbox-card,
.library-companion-button,
.empty-library,
.reader-dock,
.modal,
.storage-card,
.focusline-sync-card,
.data-action-card,
.reading-partner-model,
.reading-partner-workspace,
.reading-partner-unavailable,
.companion-profile-toggle,
.companion-cloud-sync-row,
.companion-record,
.companion-recommendation-card {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
}

.review-inbox-card,
.library-companion-button,
.focusline-sync-card {
  background: var(--glass);
}

.library-companion-button {
  min-height: 78px;
  border-radius: 22px;
}

.library-companion-button > svg {
  color: var(--accent-deep);
}

.reading-partner-orb {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--glass-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 72%, transparent);
}

.reading-partner-orb img {
  width: 72px;
  height: 72px;
  max-width: none;
  display: block;
  object-fit: contain;
}

.reading-partner-orb > span,
.reading-partner-orb > i {
  display: none;
}

.modal::backdrop {
  background: rgba(2, 6, 23, 0.5);
}

.reading-partner-header {
  background: color-mix(in srgb, var(--glass-strong) 94%, transparent);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
}

.companion-message[data-role="user"] {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: var(--accent);
  color: #ffffff;
}

.companion-message[data-role="user"] :is(p, small, span, strong) {
  color: inherit;
}

.reading-partner-starters button,
.reading-partner-form,
.reading-partner-response {
  border-color: var(--glass-border);
  background: var(--glass);
}

.ask-partner-button {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  color: var(--accent-deep);
}

.ask-partner-button:hover {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: var(--accent-soft);
}

.lost-me-button {
  border-color: var(--glass-border);
  background: var(--glass);
  color: var(--ink-soft);
}

.lost-me-button:hover {
  border-color: var(--line-strong);
  background: var(--glass-strong);
  color: var(--ink);
}

.reader-stage,
.reader-view[data-context-mode="sentence"] .reader-stage,
.reader-view[data-context-mode="page"] .reader-stage {
  background: var(--paper);
}

.reader-dock {
  border-color: var(--glass-border);
  background: var(--glass);
}

.reader-dock .play-button,
.mobile-play-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}

.progress-track::-webkit-slider-thumb,
.speed-range::-webkit-slider-thumb {
  background: var(--accent);
}

html[data-platform="ios-native"] .app-header #accountSyncButton,
html[data-platform="ios-native"] .app-header #dataButton {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: 0 5px 16px color-mix(in srgb, var(--ink) 6%, transparent);
}

html[data-platform="ios-native"] .app-header .header-import {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

html[data-platform="ios-native"] .section-heading {
  margin: 6px 3px 20px;
}

html[data-platform="ios-native"] .section-heading h2 {
  font-size: 34px;
  font-weight: 760;
}

html[data-platform="ios-native"] .continue-card,
html[data-platform="ios-native"] .review-inbox-card,
html[data-platform="ios-native"] .library-companion-button {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--shadow-soft);
}

html[data-platform="ios-native"] .continue-card > .button,
html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-library .button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

html[data-platform="ios-native"] .book-progress-line span {
  background: var(--accent);
}

html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-library {
  min-height: 316px;
  margin-top: 12px;
  padding: 34px 22px;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
}

html[data-platform="ios-native"] .app-shell[data-library-state="empty"] .empty-mark {
  border-color: var(--glass-border);
  background: var(--glass-strong);
}

@media (max-width: 560px) {
  html:not([data-platform="ios-native"]) .app-header {
    width: 100%;
    padding-inline: 14px;
    justify-content: space-between;
  }

  html:not([data-platform="ios-native"]) .app-header #dataButton,
  html:not([data-platform="ios-native"]) .app-header #themeButton {
    display: none;
  }

  html:not([data-platform="ios-native"]) .brand,
  html:not([data-platform="ios-native"]) .header-actions {
    min-width: 0;
  }

  .reader-stage,
  .reader-view[data-context-mode="sentence"] .reader-stage,
  html[data-platform="ios-native"] .reader-stage,
  html[data-platform="ios-native"] .reader-view[data-context-mode="sentence"] .reader-stage,
  .reader-view[data-context-mode="page"] .reader-stage,
  html[data-platform="ios-native"] .reader-view[data-context-mode="page"] .reader-stage {
    background: var(--paper);
  }

  .reader-dock,
  html[data-platform="ios-native"] .reader-dock,
  #readerMoreButton,
  html[data-platform="ios-native"] #readerMoreButton,
  .back-button {
    border-color: var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(1.15);
    -webkit-backdrop-filter: blur(24px) saturate(1.15);
  }

  .reader-dock .play-button,
  html[data-platform="ios-native"] .reader-dock .play-button,
  html[data-platform="ios-native"] .mobile-play-button {
    background: var(--accent);
    color: #ffffff;
  }

  .reader-settings-modal,
  .modal.reader-settings-modal,
  .modal.reading-partner-modal,
  .navigator-dialog {
    border: 1px solid var(--glass-border);
    border-bottom: 0;
    background: var(--glass-strong);
    backdrop-filter: blur(28px) saturate(1.15);
    -webkit-backdrop-filter: blur(28px) saturate(1.15);
  }

  .reader-settings-modal .modal-header,
  .reading-partner-header {
    background: color-mix(in srgb, var(--glass-strong) 96%, transparent);
  }

  .reader-sheet-actions button,
  .reader-sheet-settings > :not(.sheet-section-label) {
    border-color: var(--glass-border);
    background: var(--glass);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reading-partner-orb img {
    transform: none !important;
  }
}

:is(.brand-mark, .install-app-icon, .empty-mark, .processing-visual, .order-preview-icon) img {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: contain;
}

:is(.brand-mark, .install-app-icon, .empty-mark, .processing-visual, .order-preview-icon) {
  display: block !important;
}

:is(.brand-mark, .install-app-icon, .empty-mark, .processing-visual, .order-preview-icon) > :not(img) {
  display: none;
}

.empty-mark,
.processing-visual,
.order-preview-icon {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 18px !important;
  overflow: hidden;
  background: transparent !important;
}

.brand-mark {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  overflow: hidden;
  background: transparent !important;
}

:is(.account-sync-icon, .data-action-icon, .focusline-sync-lock) {
  background: transparent;
  box-shadow: none;
  color: var(--accent-deep);
}

:is(.reading-partner-form-actions .button svg, .reader-sheet-actions button svg) {
  background: transparent;
  color: var(--accent-deep);
}

.install-app-icon {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 17px !important;
  overflow: hidden;
  background: transparent !important;
}
