:root {
  color-scheme: light;
  --ink: #202823;
  --muted: #59635d;
  --green: #214f43;
  --line: #dce1dd;
  --reader-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --reader-font-size: 32px;
  --reader-font-weight: 400;
  --reader-line-height: 1.3;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
button, a { color: inherit; }
button:disabled { cursor: wait; opacity: .5; }
[hidden] { display: none !important; }
.shell { width: min(960px, calc(100% - 48px)); margin-inline: auto; }
.site-header { display: flex; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 4px; font-size: 26px; font-weight: 650; letter-spacing: -1px; text-decoration: none; }
.brand img { margin-left: -7px; object-fit: contain; }
.brand-dot { color: #7d9451; }
.intro { padding: 36px 0 24px; }
h1 { font-size: 30px; font-weight: 600; letter-spacing: -.7px; margin: 0; }
.compose-card { margin: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.panel-heading > label { font-weight: 500; }
.text-button { border: 0; background: transparent; padding: 10px 0; font-size: 15px; color: var(--green); }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.sample-button { border: 1px solid #aeb9b1; border-radius: 4px; background: #f0f5f2; color: var(--green); padding: 10px 16px; font-size: 15px; font-weight: 500; }
.sample-button:hover { border-color: var(--green); background: #e3ece6; }
textarea { display: block; width: 100%; height: 300px; resize: vertical; min-height: 180px; padding: 18px; border: 1px solid #aeb9b1; border-radius: 4px; color: var(--ink); background: #fff; line-height: 1.6; font-size: 18px; }
textarea::placeholder { color: #727b74; }
.input-meta { display: flex; justify-content: space-between; gap: 16px; margin: 12px 0 24px; color: var(--muted); font-size: 14px; }
.compose-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.compact-field { display: flex; align-items: center; gap: 12px; font-size: 15px; }
input[type=number] { width: 72px; border: 1px solid #aeb9b1; border-radius: 4px; background: #fff; padding: 10px; color: var(--ink); }
summary { font-size: 15px; color: var(--muted); padding: 12px 0; }
.timing-settings { position: relative; }
.timing-popover { position: absolute; z-index: 2; top: 44px; left: 0; min-width: 290px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 14px #00000012; display: grid; gap: 18px; }
.timing-popover label { font-size: 15px; display: grid; grid-template-columns: 1fr 80px; gap: 5px 12px; align-items: center; }
.timing-popover label > span { font-size: 13px; color: var(--muted); grid-column: 1; grid-row: 2; }
.timing-popover input { grid-column: 2; grid-row: 1 / 3; width: 80px; }
.primary-button, .play-button { border: 1px solid var(--green); border-radius: 4px; background: var(--green); color: #fff; padding: 12px 24px; font-weight: 500; }
.primary-button { margin-left: auto; }
.primary-button:hover, .play-button:hover { background: #306352; }
.about-tool { max-width: 760px; margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--line); }
.about-tool h2 { font-size: 22px; font-weight: 600; letter-spacing: -.3px; margin: 28px 0 12px; }
.about-tool h3 { font-size: 18px; font-weight: 600; margin: 24px 0 8px; }
.about-tool p, .about-tool li { font-size: 17px; line-height: 1.7; }
.about-tool p { margin: 0 0 18px; }
.about-tool ul { margin: 0 0 24px; padding-left: 24px; }
.about-tool li { padding-left: 4px; margin-bottom: 12px; }
.about-tool strong { font-weight: 600; }
.about-tool a { color: var(--green); text-underline-offset: 3px; }
.phrase-example { margin: 24px 0; padding: 20px 0; border-block: 1px solid var(--line); }
.phrase-example figcaption { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.phrase-example p { font-size: 20px; line-height: 1.6; text-align: center; margin: 0; }
.phrase-example span { display: block; }
.status-line { font-size: 15px; line-height: 1.5; color: var(--muted); margin: 16px 0; }
.status-line:empty { display: none; }
.status-line.error { color: #a13d2b; }
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0; font-size: 14px; color: var(--muted); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.reader-view { padding-top: 20px; }
.reader-topline { margin-bottom: 18px; }
.reader-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.reader-header h1 { font-size: 26px; }
.mode-selector { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.mode-selector legend { font-size: 15px; font-weight: 500; padding: 0; margin-bottom: 10px; }
.mode-toggle { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid #b7c2ba; border-radius: 6px; background: #edf0ed; }
.mode-toggle label { position: relative; cursor: pointer; }
.mode-toggle input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip: rect(0, 0, 0, 0); }
.mode-toggle span { display: block; text-align: center; padding: 12px 6px; border-radius: 3px; font-size: 15px; line-height: 1.3; }
.mode-toggle input:checked + span { background: var(--green); color: #fff; }
.mode-toggle input:focus-visible + span { outline: 2px solid #477e64; outline-offset: 2px; }
.mode-toggle label:hover span { box-shadow: inset 0 0 0 1px #a7b7ab; }
.mode-toggle input:disabled + span { opacity: .5; cursor: wait; }
.mode-description { font-size: 15px; line-height: 1.5; color: var(--muted); margin: 12px 0 0; }
.parse-summary { font-size: 14px; color: var(--muted); margin: 16px 0; }
.pace-context { font-size: 17px; line-height: 1.6; margin: 16px 0 20px; }
.pace-context a { color: var(--green); text-underline-offset: 3px; }
.appearance-settings { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.font-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding: 12px 0 24px; }
.font-controls label { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); }
.font-controls label > span { display: flex; justify-content: space-between; gap: 8px; }
.font-controls select { background: #fff; border: 1px solid #aeb9b1; border-radius: 4px; color: var(--ink); padding: 8px; max-width: 100%; }
.reading-surface { --surface-height: clamp(260px, 42vh, 440px); --dim: #c7cbc8; position: relative; height: var(--surface-height); overflow-y: auto; overscroll-behavior: contain; margin: 20px 0; border-bottom: 1px solid var(--line); }
.reading-surface[data-mode=focus], .reading-surface[data-mode=focal], .reading-surface[data-mode=line] { cursor: pointer; overflow: hidden; }
.phrase-stage { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 24px 16px; text-align: center; }
.phrase-stage output { display: block; width: max-content; white-space: nowrap; font-family: var(--reader-font-family); font-size: var(--reader-font-size); font-weight: var(--reader-font-weight); line-height: var(--reader-line-height); }
.reading-surface[data-mode=focal] .phrase-stage { position: relative; }
.reading-surface[data-mode=focal] .phrase-stage::before { content: ""; position: absolute; left: 50%; top: calc(50% - 64px); width: 1px; height: 128px; background: #afb9b2; pointer-events: none; }
.reading-surface[data-mode=focal] .phrase-stage output { position: absolute; top: 50%; left: 50%; text-align: left; background: #fff; }
.focal-letter { color: #c52d2d; }
.line-view { position: relative; min-height: 100%; white-space: nowrap; font-family: var(--reader-font-family); font-size: var(--reader-font-size); font-weight: var(--reader-font-weight); line-height: var(--reader-line-height); }
.line-track { position: absolute; top: 50%; left: 50%; width: max-content; color: var(--dim); }
.line-phrase.active { color: var(--ink); }
.list-view { padding: calc(var(--surface-height) / 2) 16px; }
.phrase-list { list-style: none; padding: 0; margin: 0; text-align: center; }
.phrase-list li { padding: .12em 0; color: var(--dim); overflow-wrap: anywhere; cursor: pointer; font-family: var(--reader-font-family); font-size: var(--reader-font-size); font-weight: var(--reader-font-weight); line-height: var(--reader-line-height); }
.phrase-list li.active { color: var(--ink); }
.paragraph-view { max-width: 720px; margin: 0 auto; padding: 12px 20px 30vh; font-family: var(--reader-font-family); font-size: var(--reader-font-size); font-weight: var(--reader-font-weight); line-height: var(--reader-line-height); overflow-wrap: anywhere; }
.paragraph-view p { margin: 0 0 1.25em; }
.paragraph-phrase { color: var(--dim); cursor: pointer; }
.reading-surface[data-mode=alternating] .paragraph-phrase.even { color: #333; }
.reading-surface[data-mode=alternating] .paragraph-phrase.odd { color: #8f8f8f; }
.reading-surface .paragraph-phrase.active { color: var(--ink); }
.reading-surface[data-mode=alternating] .paragraph-phrase.active { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.reader-progress { display: flex; align-items: center; gap: 20px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reader-progress > span { min-width: 56px; }
.reader-progress > span:last-child { text-align: right; }
.progress-track { height: 3px; flex: 1; background: #e9eeea; overflow: hidden; }
#progressFill { height: 100%; width: 0; background: var(--green); }
.reader-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 28px 0 20px; }
.icon-button { border: 0; background: transparent; min-width: 40px; height: 40px; border-radius: 4px; font-size: 26px; line-height: 1; }
.icon-button:hover { background: #f1f6f3; }
.secondary-control { font-size: 22px; color: var(--muted); }
.play-button { min-width: 110px; margin: 0 4px; }
.speed-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 auto; max-width: 400px; }
.speed-controls .text-button { font-size: 24px; min-width: 28px; }
input[type=range] { accent-color: var(--green); min-width: 0; }
.speed-controls input { width: 180px; }
.speed-controls > span { font-size: 15px; min-width: 100px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.keyboard-hint { text-align: center; font-size: 14px; color: var(--muted); margin: 16px 0 32px; }
.keyboard-hint span { margin: 0 10px; }
kbd { font-family: inherit; border: 1px solid var(--line); padding: 2px 5px; border-radius: 3px; }
.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; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 10; background: var(--green); color: white; padding: 12px; }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 2px solid #477e64; outline-offset: 4px; }
@media (max-width: 650px) {
  .shell { width: calc(100% - 32px); }
  .site-header { padding: 16px 0; }
  .brand { font-size: 24px; }
  .brand img { width: 42px; height: 42px; }
  .intro { padding: 28px 0 20px; }
  h1 { font-size: 27px; }
  textarea { height: 280px; padding: 14px; font-size: 17px; }
  .input-meta { font-size: 13px; }
  .compose-actions { gap: 12px 24px; }
  .compact-field { justify-content: space-between; width: 100%; }
  .primary-button { margin-left: auto; }
  .timing-popover { min-width: 280px; }
  .reader-header { align-items: flex-start; flex-direction: column; gap: 16px; }
  .mode-toggle { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mode-toggle span { font-size: 14px; }
  .reading-surface { --surface-height: clamp(220px, 34vh, 320px); }
  .paragraph-view { padding-inline: 6px; }
  .font-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .reader-controls { gap: 5px; }
  .reader-controls .icon-button { min-width: 32px; }
  .play-button { min-width: 92px; padding-inline: 18px; }
  .speed-controls { gap: 10px; }
  .keyboard-hint { font-size: 13px; }
}
