:root {
  --paper: #f5f1e9;
  --paper-deep: #ece6da;
  --surface: #fffdf8;
  --ink: #17313a;
  --ink-soft: #52656a;
  --ink-faint: #8a9798;
  --line: rgba(23, 49, 58, 0.12);
  --line-strong: rgba(23, 49, 58, 0.2);
  --coral: #e3693f;
  --coral-dark: #bd4d2a;
  --gold: #dda94f;
  --sage: #739184;
  --player: #17313a;
  --player-soft: #24434c;
  --white: #fffdf8;
  --shadow: 0 24px 70px rgba(29, 45, 47, 0.12);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: 188px;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 0%, rgba(221, 169, 79, 0.12), transparent 31rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.38), transparent 42%),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(227, 105, 63, 0.36);
  outline-offset: 3px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.reading-progress {
  position: fixed;
  z-index: 120;
  inset: 0 auto auto 0;
  width: 0;
  height: 3px;
  background: var(--coral);
  box-shadow: 0 0 14px rgba(227, 105, 63, 0.4);
  transition: width 160ms linear;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 241, 233, 0.88);
  backdrop-filter: blur(18px);
}

.brand,
.brand-mark,
.topbar-actions,
.outline-button,
.mode-button,
.transport-button,
.tool-button,
.next-passage-button {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--white);
  border-radius: 50%;
  background: var(--ink);
}

.brand-mark-icon svg {
  width: 25px;
}

.brand-mark strong,
.brand-mark small {
  display: block;
}

.brand-mark strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-mark small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.topbar-actions {
  gap: 18px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.status-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5b9677;
  box-shadow: 0 0 0 4px rgba(91, 150, 119, 0.12);
}

.outline-button {
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.54);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: 160ms ease;
}

.outline-button:hover {
  border-color: var(--ink);
  background: var(--white);
  transform: translateY(-1px);
}

.outline-button svg {
  width: 17px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(23, 49, 58, 0.07);
}

.icon-button svg {
  width: 21px;
}

.menu-button,
.close-library {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  width: min(1480px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 76px);
}

.library {
  position: sticky;
  top: 76px;
  align-self: start;
  height: calc(100vh - 76px - 168px);
  padding: 33px 24px 28px clamp(20px, 3vw, 42px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 49, 58, 0.18) transparent;
}

.library-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.library h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  margin: 21px 0 13px;
  padding: 0 13px;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.62);
  transition: 160ms ease;
}

.search-box:focus-within {
  color: var(--coral);
  border-color: rgba(227, 105, 63, 0.5);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(227, 105, 63, 0.07);
}

.search-box svg {
  flex: 0 0 18px;
  width: 18px;
}

.search-box input {
  min-width: 0;
  width: 100%;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.search-box input::placeholder {
  color: #a1a9a5;
}

.library-summary {
  margin: 0 2px 15px;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.library-summary strong {
  color: var(--ink-soft);
}

.article-groups {
  display: grid;
  gap: 21px;
}

.article-group[hidden] {
  display: none;
}

.group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 4px 8px;
}

.group-title span:first-child {
  font-size: 12px;
  font-weight: 700;
}

.group-title span:last-child {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.group-articles {
  display: grid;
  gap: 5px;
}

.article-card {
  position: relative;
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 8px 9px 8px 8px;
  overflow: hidden;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.article-card::after {
  position: absolute;
  inset: auto 0 0 auto;
  width: var(--progress, 0%);
  height: 2px;
  content: "";
  background: var(--coral);
  transition: width 300ms ease;
}

.article-card:hover {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.58);
  transform: translateX(2px);
}

.article-card.active {
  border-color: rgba(227, 105, 63, 0.25);
  background: var(--white);
  box-shadow: 0 8px 22px rgba(33, 52, 55, 0.06);
}

.article-card-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink-soft);
  border-radius: 50%;
  background: var(--paper-deep);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
}

.article-card.active .article-card-number {
  color: var(--white);
  background: var(--coral);
}

.article-card-copy {
  min-width: 0;
}

.article-card-copy strong,
.article-card-copy small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.article-card-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.article-card-copy small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.article-card-time {
  color: var(--ink-faint);
  font-size: 9px;
  text-align: right;
}

.empty-search {
  margin: 30px 0;
  color: var(--ink-faint);
  font-size: 12px;
  text-align: center;
}

.library-tip {
  margin-top: 28px;
  padding: 15px 16px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.4);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.7;
}

.library-tip span {
  display: block;
  margin-bottom: 4px;
  color: var(--coral);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.reader {
  position: relative;
  min-width: 0;
  padding: 62px clamp(34px, 7vw, 112px) 72px;
}

.reader > #articleContent,
.loading-state {
  width: min(760px, 100%);
  margin: 0 auto;
}

.loading-state {
  display: grid;
  min-height: 55vh;
  place-content: center;
  justify-items: center;
  color: var(--ink-faint);
  font-size: 12px;
}

.loading-rings {
  position: relative;
  width: 50px;
  height: 50px;
  margin-bottom: 16px;
}

.loading-rings span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--coral);
  border-radius: 50%;
  animation: ringPulse 1.8s ease-out infinite;
}

.loading-rings span:nth-child(2) {
  animation-delay: 0.45s;
}

.loading-rings span:nth-child(3) {
  animation-delay: 0.9s;
}

@keyframes ringPulse {
  0% {
    opacity: 0.9;
    transform: scale(0.2);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

.article-header {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.article-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.article-kicker span:first-child {
  color: var(--coral);
}

.kicker-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.article-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.article-number {
  margin: 0 0 6px;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
}

.article-header h1 {
  max-width: 580px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.listen-mode-panel {
  flex: none;
  text-align: right;
}

.listen-mode-panel > p {
  margin: 0 4px 7px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.listen-modes {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(236, 230, 218, 0.7);
}

.mode-button {
  flex-direction: column;
  justify-content: center;
  width: 82px;
  height: 48px;
  padding: 0 9px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  transition:
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.mode-button span,
.mode-button small {
  display: block;
}

.mode-button span {
  font-size: 11px;
  font-weight: 750;
}

.mode-button small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.mode-button:hover {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.7);
}

.mode-button.active {
  color: var(--white);
  background: var(--coral);
  box-shadow: 0 7px 16px rgba(227, 105, 63, 0.2);
}

.mode-button.active small {
  color: rgba(255, 253, 248, 0.7);
}

.article-deck {
  max-width: 670px;
  margin: 24px 0 18px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1.65;
}

.article-facts {
  display: flex;
  gap: 22px;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.article-facts span + span {
  position: relative;
}

.article-facts span + span::before {
  position: absolute;
  top: 50%;
  left: -12px;
  width: 2px;
  height: 2px;
  content: "";
  border-radius: 50%;
  background: var(--ink-faint);
}

.article-facts strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 30px;
}

.reader-toolbar p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(115, 145, 132, 0.12);
}

.text-button {
  padding: 5px 0;
  color: var(--ink-soft);
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.text-button:hover {
  color: var(--coral);
  border-color: var(--coral);
}

.article-body {
  font-family: var(--serif);
  font-size: clamp(18px, 1.65vw, 21px);
  line-height: 1.95;
}

.reading-paragraph {
  margin: 0 0 1.45em;
  border-radius: 8px;
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.article-body.mode-paragraph .reading-paragraph.current {
  background: linear-gradient(90deg, rgba(221, 169, 79, 0.12), rgba(221, 169, 79, 0.025));
  box-shadow: inset 3px 0 0 rgba(221, 169, 79, 0.72);
}

.sentence {
  padding: 0.08em 0.13em;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition:
    color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.sentence:hover {
  background: rgba(221, 169, 79, 0.14);
}

.sentence.current {
  color: #a84024;
  background: rgba(227, 105, 63, 0.11);
  box-shadow: inset 3px 0 0 var(--coral);
}

.sentence.past {
  color: #6e7a79;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.article-footer > span {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.next-passage-button {
  gap: 8px;
  padding: 0;
  color: var(--ink);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.next-passage-button svg {
  width: 19px;
  transition: transform 140ms ease;
}

.next-passage-button:hover svg {
  transform: translateX(4px);
}

.player {
  position: fixed;
  z-index: 70;
  right: clamp(12px, 2vw, 26px);
  bottom: 16px;
  left: clamp(12px, 2vw, 26px);
  width: min(1428px, calc(100% - 24px));
  margin: auto;
  padding: 15px 23px 12px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at 83% -20%, rgba(221, 169, 79, 0.17), transparent 28rem),
    var(--player);
  box-shadow: 0 24px 60px rgba(14, 31, 37, 0.28);
}

.player-progress-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
}

.player-progress-row > span {
  color: rgba(255, 253, 248, 0.45);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

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

.timeline {
  width: 100%;
  height: 14px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  background: transparent;
}

.timeline::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--coral) 0%,
    var(--coral) var(--seek, 0%),
    rgba(255, 255, 255, 0.16) var(--seek, 0%),
    rgba(255, 255, 255, 0.16) 100%
  );
}

.timeline::-moz-range-track {
  height: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
}

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

.timeline::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  margin-top: -4px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(227, 105, 63, 0.16);
  appearance: none;
}

.timeline::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--coral);
}

.player-main {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  gap: 22px;
  align-items: center;
  padding-top: 3px;
}

.now-playing {
  min-width: 0;
}

.now-playing p {
  margin: 0;
}

#nowPlayingKicker {
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.now-playing h3 {
  margin: 0;
  overflow: hidden;
  color: var(--white);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#nowPlayingSentence {
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255, 253, 248, 0.48);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.transport {
  display: flex;
  align-items: center;
  gap: 13px;
}

.transport-button {
  flex-direction: column;
  gap: 2px;
  min-width: 44px;
  padding: 0;
  color: rgba(255, 253, 248, 0.68);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 8px;
}

.transport-button svg {
  width: 22px;
  transition: transform 140ms ease;
}

.transport-button:hover {
  color: var(--white);
}

.transport-button:hover svg {
  transform: scale(1.08);
}

.play-button {
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  border: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: 140ms ease;
}

.play-button:hover {
  background: #fff6e9;
  transform: scale(1.04);
}

.play-button svg {
  width: 25px;
}

.play-button .play-icon {
  fill: currentColor;
  stroke: none;
}

.play-button .pause-icon {
  display: none;
  fill: currentColor;
  stroke: none;
}

.play-button.playing .play-icon {
  display: none;
}

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

.player-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 8px 0 12px;
  color: rgba(255, 253, 248, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  font-size: 9px;
}

.speed-control select {
  padding: 3px 14px 3px 2px;
  color: var(--white);
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.speed-control option {
  color: var(--ink);
  background: var(--white);
}

.tool-button {
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  color: rgba(255, 253, 248, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.tool-button svg {
  width: 15px;
}

.tool-button:hover {
  color: var(--white);
}

.tool-button.active {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--gold);
}

.sentence-status {
  position: absolute;
  right: 25px;
  bottom: -19px;
  left: 25px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 253, 248, 0.34);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
  pointer-events: none;
}

.phone-dialog {
  width: min(680px, calc(100% - 32px));
  padding: 38px;
  color: var(--ink);
  border: 0;
  border-radius: 25px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.phone-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 34px;
  align-items: center;
  animation: dialogIn 180ms ease-out;
}

.phone-dialog::backdrop {
  background: rgba(16, 34, 40, 0.46);
  backdrop-filter: blur(4px);
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.dialog-close {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  border: 0;
  border-radius: 50%;
  background: var(--paper-deep);
  cursor: pointer;
}

.dialog-close svg {
  width: 17px;
}

.phone-dialog h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.phone-dialog-copy > p:not(.eyebrow):not(.phone-hint) {
  margin: 0 0 17px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.phone-url {
  padding: 13px 14px;
  overflow: auto;
  color: var(--ink);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
  user-select: all;
}

.copy-button {
  margin-top: 11px;
  padding: 10px 17px;
  color: var(--white);
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.phone-hint {
  margin: 12px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.offline-box {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(221, 169, 79, 0.1), rgba(255, 253, 248, 0.68));
}

.offline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offline-heading strong {
  font-size: 12px;
}

.offline-heading span {
  color: var(--sage);
  font-size: 9px;
  font-weight: 700;
}

.offline-box > p {
  margin: 7px 0 10px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.offline-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 49, 58, 0.1);
}

.offline-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 180ms ease;
}

.offline-button {
  width: 100%;
  margin-top: 11px;
  padding: 9px 14px;
  color: var(--white);
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.offline-button:hover {
  background: var(--player-soft);
}

.offline-button:disabled {
  cursor: default;
  opacity: 0.68;
}

.offline-button.complete {
  color: var(--ink);
  background: var(--gold);
}

.install-tip {
  display: grid;
  gap: 3px;
  margin-top: 13px;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.55;
}

.install-tip strong {
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 9px;
}

.qr-wrap {
  display: grid;
  gap: 9px;
  justify-items: center;
  padding: 13px 13px 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.qr-wrap #qrImage {
  display: block;
  width: 164px;
  height: 164px;
  object-fit: contain;
}

.qr-wrap #qrImage img,
.qr-wrap #qrImage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.qr-wrap span {
  color: var(--ink-faint);
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 200;
  top: 92px;
  left: 50%;
  padding: 9px 15px;
  color: var(--white);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 8px 25px rgba(14, 31, 37, 0.2);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-scrim {
  display: none;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 276px minmax(0, 1fr);
  }

  .library {
    padding-right: 18px;
  }

  .reader {
    padding-right: clamp(28px, 5vw, 60px);
    padding-left: clamp(28px, 5vw, 60px);
  }

  .player-main {
    grid-template-columns: minmax(170px, 1fr) auto 210px;
  }

  .tool-button span,
  .speed-control > span {
    display: none;
  }
}

@media (max-width: 800px) {
  body {
    padding-bottom: 176px;
  }

  .topbar {
    min-height: 64px;
    padding: 9px 14px;
  }

  .brand-mark-icon {
    width: 37px;
    height: 37px;
  }

  .brand-mark-icon svg {
    width: 22px;
  }

  .brand-mark strong {
    font-size: 16px;
  }

  .brand-mark small,
  .status-chip {
    display: none;
  }

  .outline-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 11px;
  }

  .menu-button,
  .close-library {
    display: grid;
  }

  .menu-button {
    margin-left: -7px;
  }

  .app-shell {
    display: block;
    min-height: calc(100vh - 64px);
  }

  .library {
    position: fixed;
    z-index: 90;
    top: 0;
    left: 0;
    width: min(342px, 88vw);
    height: 100dvh;
    padding: 24px 18px 30px;
    border: 0;
    background: var(--paper);
    box-shadow: 24px 0 60px rgba(16, 34, 40, 0.18);
    transform: translateX(-105%);
    transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  body.library-open {
    overflow: hidden;
  }

  body.library-open .library {
    transform: translateX(0);
  }

  .mobile-scrim {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: block;
    background: rgba(16, 34, 40, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  body.library-open .mobile-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .reader {
    padding: 36px 20px 52px;
  }

  .article-header {
    padding-bottom: 24px;
  }

  .article-kicker {
    margin-bottom: 14px;
  }

  .article-title-row {
    display: block;
  }

  .article-header h1 {
    font-size: clamp(38px, 12vw, 50px);
  }

  .listen-mode-panel {
    width: 100%;
    margin-top: 20px;
    text-align: left;
  }

  .listen-mode-panel > p {
    margin-left: 2px;
  }

  .listen-modes {
    width: 100%;
  }

  .mode-button {
    flex: 1;
    width: auto;
    height: 46px;
    margin-top: 20px;
    padding: 0 8px;
  }

  .mode-button {
    margin-top: 0;
  }

  .article-deck {
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.6;
  }

  .article-body {
    font-size: clamp(18px, 4.8vw, 20px);
    line-height: 1.9;
  }

  .reader-toolbar {
    margin: 20px 0 24px;
  }

  .player {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 16px max(10px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .player-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding-top: 5px;
  }

  .now-playing {
    padding-left: 1px;
  }

  .now-playing h3 {
    font-size: 14px;
  }

  #nowPlayingSentence {
    max-width: 45vw;
  }

  .transport {
    gap: 4px;
  }

  .transport-button {
    min-width: 38px;
  }

  .transport-button svg {
    width: 20px;
  }

  .play-button {
    width: 48px;
    height: 48px;
  }

  .player-tools {
    grid-column: 1 / -1;
    justify-content: space-between;
    margin-top: -1px;
  }

  .speed-control {
    height: 30px;
  }

  .tool-button {
    height: 30px;
  }

  .tool-button span,
  .speed-control > span {
    display: inline;
  }

  .sentence-status {
    position: static;
    margin-top: 7px;
  }

  .phone-dialog[open] {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .phone-dialog {
    padding: 31px 24px 26px;
  }

  .qr-wrap {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }

  .qr-wrap #qrImage {
    width: 176px;
    height: 176px;
  }
}

@media (max-width: 430px) {
  .topbar-actions {
    gap: 7px;
  }

  .outline-button svg {
    display: none;
  }

  .outline-button {
    padding: 0 10px;
  }

  .brand {
    gap: 3px;
  }

  .brand-mark {
    gap: 7px;
  }

  .brand-mark strong {
    font-size: 15px;
  }

  .article-facts {
    gap: 18px;
  }

  .article-facts span + span::before {
    left: -10px;
  }

  .transport-button span {
    display: none;
  }

  .transport-button {
    min-width: 31px;
  }

  .now-playing h3 {
    max-width: 34vw;
  }
}

@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;
  }
}
