@font-face {
  font-family: DM Sans;
  src: url(fonts/dm-sans.woff2) format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: Atkinson;
  src: url(fonts/atkinson.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
}
:root {
  font-family: "DM Sans", Arial, sans-serif;
  color: #23392f;
  background: #f7f8f3;
  font-synthesis: none;
  --ink: #20392f;
  --green: #27523f;
  --rule: #dce1d7;
  --soft: #56675e;
  --gold: #f1d681;
  --coral: #ff9990;
  --mint: #b8e7c8;
  --white: #fff;
  --mark: var(--gold);
  --read-size: 3rem;
  --line-gap: 1.7rem;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #146da5;
  outline-offset: 3px;
}
.stage button:focus-visible,
.focused .transport button:focus-visible {
  outline-color: #a4dafd;
}
button {
  border: 0;
  background: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button .icon,
[data-i] {
  flex: none;
}
.icon,
[data-i] {
  width: 1.2rem;
  height: 1.2rem;
  vertical-align: middle;
  display: inline-flex;
}
[data-i] > .icon {
  width: 100%;
  height: 100%;
}
.mast {
  background: #fff;
  border-bottom: 1px solid var(--rule);
}
.mast-inner,
.desk {
  width: min(1216px, 91%);
  margin: auto;
}
.mast-inner {
  height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.48rem;
  font-weight: 800;
  letter-spacing: -0.065em;
}
.brand-light {
  font-weight: 550;
}
.brandmark {
  height: 37px;
  width: 37px;
}
.quiet,
.tool,
.primary,
.more,
.stage-edit,
.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
}
.quiet {
  min-height: 44px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.9rem;
}
.quiet:hover {
  background: #eff3ec;
}
.guide-button {
  padding: 0 0.65rem;
}
.guide-button [data-i] {
  width: 1.12rem;
  height: 1.12rem;
}
.desk {
  padding: clamp(28px, 3vw, 48px) 0 48px;
}
.intro {
  margin-bottom: 23px;
}
.intro h1 {
  font-size: clamp(2.4rem, 3.3vw, 3.05rem);
  line-height: 1.1;
  letter-spacing: -0.062em;
  font-weight: 650;
}
.intro p {
  margin-top: 8px;
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.5;
}
.sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 28px;
}
.source {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  text-align: start;
  align-items: center;
  min-height: 101px;
  padding: 1rem 1.35rem;
  border: 1px solid;
  box-shadow: 0 2px 2px #29382e05;
  border-radius: 15px;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.source:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 13px #20392f11;
}
.source > span {
  position: relative;
  z-index: 1;
}
.source strong {
  display: block;
  letter-spacing: -0.032em;
  font-weight: 700;
  font-size: 1.2rem;
}
.source small {
  display: block;
  font-size: 0.875rem;
  margin-top: 5px;
  color: #45554a;
}
.camera-card {
  background: #eaf0de;
  border-color: #d1dec6;
}
.image-card {
  background: #f6eedb;
  border-color: #e4d8b9;
}
.paste-card {
  background: #edeaf3;
  border-color: #dbd5e6;
}
.art {
  position: absolute;
  right: 4px;
  bottom: 1px;
  width: clamp(84px, 9.6vw, 132px);
  height: calc(100% - 3px);
  z-index: -1;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.98fr) minmax(300px, 1fr);
  gap: 21px;
  align-items: start;
}
.panel {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: 0 3px 6px #283b2a04;
  min-width: 0;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 21px 13px;
  min-height: 62px;
}
.panel-heading h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.15rem;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.panel-heading h2 [data-i] {
  color: #4e6a59;
  width: 1.25rem;
  height: 1.25rem;
}
.focus-button {
  border: 1px solid var(--rule);
  padding: 0 0.7rem;
  min-height: 34px;
  font-size: 0.825rem;
}
.focus-button [data-i] {
  width: 15px;
  height: 15px;
}
.stage {
  position: relative;
  margin: 0 13px;
  background: #1c2d26;
  color: #f9faf4;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 303px;
}
.stage-top,
.stage-foot {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.stage-top {
  padding: 19px 22px 0;
  justify-content: space-between;
}
.stage-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e5eadf;
  font-size: 0.83rem;
  font-weight: 550;
}
.lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b5d697;
}
.stage-count {
  font:
    500 0.84rem "DM Sans",
    sans-serif;
  color: #ced8cf;
  font-variant-numeric: tabular-nums;
}
.reading-surface {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: start;
  width: 100%;
  color: #f8faf4;
  padding: clamp(26px, 3.2vw, 43px) 23px clamp(22px, 2.7vw, 35px);
  font:
    500 var(--read-size)/1.24 Atkinson,
    "Arial",
    sans-serif;
  letter-spacing: -0.035em;
}
.reading-surface:focus-visible {
  outline-offset: -5px;
}
.current-row {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  column-gap: 15px;
  align-items: center;
}
.pointer {
  width: 5px;
  height: 0.72em;
  max-height: 46px;
  background: var(--mark);
  border-radius: 3px;
}
.text-line,
.next-row {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
  white-space: normal;
}
.text-line {
  line-height: 1.35;
}
.word.active,
.line-mark {
  background: var(--mark);
  color: #1b2a22;
  border-radius: 0.13em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.07em;
}
.next-row {
  color: #abb8ae;
  margin-inline-start: 22px;
  margin-top: var(--line-gap);
  line-height: 1.25;
}
.next-row.empty {
  visibility: hidden;
}
.stage-foot {
  padding: 0 21px 13px;
  color: #d8e1d9;
  min-height: 41px;
  font-size: 0.85rem;
}
.stage-foot [data-i] {
  width: 15px;
  height: 15px;
}
.stage-foot #passage-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sample-badge {
  font-size: 0.75rem;
  border: 1px solid #56685d;
  border-radius: 20px;
  padding: 3px 8px;
  white-space: nowrap;
}
.stage-edit {
  color: #dfebe1;
  margin-left: auto;
  min-width: 36px;
  min-height: 36px;
  border-radius: 6px;
}
.stage-edit:hover {
  background: #3c4d42;
}
.progress-track {
  height: 4px;
  background: #415448;
}
.progress-track > div {
  height: 100%;
  background: var(--mark);
  transition: width 0.15s;
}
.transport {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
}
.primary {
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  min-height: 46px;
  padding: 0 20px;
  font-size: 0.96rem;
  font-weight: 650;
}
.primary:hover {
  background: #193c2b;
}
.primary [data-i] {
  width: 16px;
  height: 16px;
}
.primary:disabled {
  opacity: 0.5;
}
.tool,
.stepper button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.tool:hover,
.stepper button:hover {
  background: #f1f4ed;
}
.tool:disabled,
.stepper button:disabled {
  opacity: 0.4;
}
.step-group {
  display: inline-flex;
  gap: 6px;
}
.restart {
  margin-inline-start: auto;
  padding: 0 0.35rem;
}
.reader-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 13px 21px 15px;
  font-size: 0.86rem;
  color: #51645a;
  border-top: 1px solid #e6eae2;
  line-height: 1.4;
}
.reader-note [data-i] {
  width: 16px;
  height: 16px;
}
.reader-note.warning {
  color: #7a401d;
  background: #fff5e8;
  border-radius: 0 0 18px 18px;
}
.settings .panel-heading {
  border-bottom: 1px solid #e5e9e0;
}
.settings-inner {
  padding: 18px 21px 10px;
  display: grid;
  gap: 17px;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
legend,
label {
  font-weight: 650;
  font-size: 0.93rem;
  letter-spacing: -0.013em;
}
legend {
  padding: 0;
  margin-bottom: 8px;
}
.seg {
  display: flex;
  border-radius: 10px;
  background: #f0f3ec;
  padding: 3px;
  gap: 3px;
  border: 1px solid #e1e6dc;
}
.seg button {
  flex: 1;
  border-radius: 7px;
  min-height: 37px;
  padding: 3px 5px;
  font-size: 0.855rem;
  font-weight: 550;
  color: #506057;
}
.seg button [data-i] {
  width: 16px;
  height: 16px;
}
.seg button[aria-pressed="true"] {
  background: #fff;
  color: #244936;
  box-shadow:
    0 1px 4px #33473224,
    inset 0 0 0 1px #c4d2c1;
}
.seg button:hover {
  background: #e5eadf;
}
.setting-divider {
  height: 1px;
  background: #e3e8de;
}
.size-row,
.spacing label,
#time-options label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.stepper button {
  height: 36px;
  width: 36px;
  border: 0;
  border-radius: 0;
}
.stepper button [data-i] {
  width: 15px;
  height: 15px;
}
.stepper output {
  min-width: 44px;
  text-align: center;
  font-size: 0.87rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.spacing output,
#time-options output {
  color: var(--soft);
  font-size: 0.84rem;
  font-weight: 500;
}
.spacing label {
  margin-bottom: 5px;
}
input[type="range"] {
  width: 100%;
  height: 23px;
  margin: 3px 0 0;
  accent-color: var(--green);
  cursor: pointer;
  appearance: none;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background: linear-gradient(
    to right,
    var(--green) var(--fill, 67%),
    #dce4d7 var(--fill, 67%)
  );
  border-radius: 9px;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  border: 2px solid white;
  background: var(--green);
  width: 19px;
  height: 19px;
  border-radius: 100%;
  box-shadow: 0 0 0 1px #9fb19f;
  margin-top: -7px;
}
input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 5px;
  background: #dce4d7;
}
input[type="range"]::-moz-range-progress {
  height: 5px;
  background: var(--green);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid white;
}
.more {
  min-height: 36px;
  text-align: start;
  justify-content: space-between;
  padding: 0;
  width: 100%;
  font-size: 0.88rem;
  font-weight: 620;
  margin-top: -6px;
}
.more[aria-expanded="true"] [data-i] {
  transform: rotate(180deg);
}
#extra,
#voice-options {
  display: grid;
  gap: 9px;
}
#extra {
  padding-bottom: 12px;
}
#extra fieldset {
  margin-top: 7px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  font-weight: 500;
}
.checkbox input {
  width: 1.14rem;
  height: 1.14rem;
  accent-color: var(--green);
}
#swatches {
  display: flex;
  gap: 7px;
}
.swatch {
  width: 44px;
  height: 40px;
  border-radius: 7px;
  border: 1px solid #acb5ad;
  position: relative;
}
.swatch[aria-pressed="true"]::after {
  content: "✓";
  font-weight: 750;
  color: var(--ink);
  font-size: 1.1rem;
}
.gold {
  background: var(--gold);
}
.coral {
  background: var(--coral);
}
.mint {
  background: var(--mint);
}
.white {
  background: var(--white);
}
.field-note {
  font-size: 0.85rem;
  color: var(--soft);
  line-height: 1.45;
}
select,
input[type="text"],
textarea {
  color: var(--ink);
  border: 1px solid #b9c7b9;
  background: white;
  border-radius: 8px;
  font-size: 1rem;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
}
select {
  appearance: none;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%233a5545' stroke-width='1.7'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
textarea {
  resize: vertical;
  line-height: 1.55;
  font-size: 1.125rem;
}
dialog {
  color: var(--ink);
  width: min(570px, calc(100% - 26px));
  max-height: 90dvh;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--rule);
  box-shadow: 0 20px 80px #112a2840;
}
dialog::backdrop {
  background: #13281fcc;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.modal-head h2 {
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}
.modal-head .tool {
  border: 0;
  flex: none;
}
#dialog-body {
  display: grid;
  gap: 15px;
}
#dialog-body p,
#dialog-body li {
  line-height: 1.55;
  color: #43574c;
}
#dialog-body h3 {
  font-size: 1.04rem;
  margin-bottom: 2px;
}
#dialog-body .guide-item {
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}
#dialog-body label {
  display: grid;
  gap: 6px;
}
#dialog-body .primary {
  justify-self: start;
}
.photo-preview {
  display: flex;
  gap: 15px;
  align-items: center;
}
.photo-preview img {
  max-width: 120px;
  max-height: 95px;
  border-radius: 6px;
}
.photo-preview label {
  flex: 1;
}
.edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.edit-actions button {
  min-height: 44px;
}
video {
  width: 100%;
  background: #20392f;
  border-radius: 10px;
  max-height: 48vh;
}
.scan-state {
  font-size: 0.92rem;
}
.scan-progress {
  width: 100%;
  accent-color: var(--green);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body.is-focused {
  overflow: hidden;
}
.reader.focused {
  position: fixed;
  inset: 0;
  z-index: 5;
  border: 0;
  border-radius: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  background: #1c2d26;
  color: white;
  padding: env(safe-area-inset-top) max(2vw, env(safe-area-inset-right))
    env(safe-area-inset-bottom) max(2vw, env(safe-area-inset-left));
}
.focused .panel-heading,
.focused .stage,
.focused .transport,
.focused .reader-note {
  width: min(1050px, 100%);
  margin: 0 auto;
}
.focused .panel-heading {
  padding-top: 16px;
}
.focused .panel-heading [data-i] {
  color: #e0e9dc;
}
.focused .focus-button,
.focused .restart {
  color: white;
  border-color: #819389;
}
.focused .quiet:hover {
  background: #344a3e;
}
.focused .stage {
  flex: 1;
  border-radius: 0;
  min-height: 220px;
}
.focused .reading-surface {
  justify-content: center;
}
.focused .reader-note {
  border-color: #46594c;
  color: #d2dfd3;
}
.focused .primary {
  background: #dcdfae;
  color: #233c2d;
}
.focused .tool {
  color: var(--ink);
}
.focused .reader-note.warning {
  color: #fff3da;
  background: #784c2a;
}
@media (min-width: 1450px) {
  .stage {
    min-height: 330px;
  }
  .source {
    min-height: 111px;
  }
}
@media (max-width: 1020px) {
  .mast-inner,
  .desk {
    width: 94%;
  }
  .workspace {
    gap: 14px;
    grid-template-columns: minmax(0, 1.7fr) minmax(286px, 1fr);
  }
  .source {
    padding: 15px;
    min-height: 91px;
  }
  .source .art {
    right: -10px;
    width: 90px;
  }
  .source strong {
    font-size: 1.08rem;
  }
  .source small {
    font-size: 0.8rem;
  }
  .reader .panel-heading,
  .settings .panel-heading {
    padding-left: 16px;
    padding-right: 16px;
  }
  .settings-inner {
    padding-left: 15px;
    padding-right: 15px;
  }
  .transport {
    padding-left: 15px;
    padding-right: 15px;
    gap: 9px;
  }
  .reader-note {
    padding-left: 16px;
    padding-right: 16px;
  }
  .stage {
    margin: 0 10px;
  }
}
@media (max-width: 760px) {
  .mast-inner,
  .desk {
    width: 93%;
  }
  .mast-inner {
    height: 60px;
  }
  .desk {
    padding-top: 23px;
  }
  .intro h1 {
    font-size: 2.4rem;
  }
  .intro {
    margin-bottom: 17px;
  }
  .sources {
    gap: 8px;
    margin-bottom: 17px;
  }
  .source {
    min-height: 103px;
    align-items: flex-end;
    padding: 8px 9px;
    border-radius: 11px;
  }
  .source .art {
    top: 1px;
    left: 8px;
    right: auto;
    width: 60px;
    height: 48px;
  }
  .source strong {
    font-size: 1rem;
    line-height: 1.18;
  }
  .source small {
    font-size: 0.76rem;
    line-height: 1.2;
    margin-top: 3px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .stage {
    min-height: 280px;
  }
  .settings-inner {
    padding: 16px 18px;
  }
  .panel-heading {
    min-height: 55px;
  }
  .reading-surface {
    padding-inline: 16px;
  }
  .current-row {
    column-gap: 10px;
  }
  .next-row {
    margin-inline-start: 17px;
  }
  .transport {
    flex-wrap: wrap;
  }
  .guide-button {
    font-size: 0.85rem;
  }
  .stage-top {
    padding: 16px 16px 0;
  }
  .field-note {
    font-size: 0.88rem;
  }
  .seg button,
  .stepper button,
  .focus-button,
  .more {
    min-height: 44px;
  }
  .settings {
    margin-top: 0;
  }
  .panel {
    border-radius: 15px;
  }
  .source:hover {
    transform: none;
  }
  .brand {
    font-size: 1.3rem;
  }
  .brandmark {
    width: 33px;
    height: 33px;
  }
}
@media (max-width: 420px) {
  .intro p {
    font-size: 0.93rem;
  }
  .source small {
    display: none;
  }
  .source {
    min-height: 84px;
  }
  .source .art {
    width: 61px;
    height: 50px;
  }
  .primary {
    padding-inline: 14px;
  }
  .transport {
    gap: 8px;
  }
  .restart {
    font-size: 0.82rem;
  }
  .restart [data-i] {
    width: 15px;
  }
  .stage-foot {
    gap: 6px;
    padding-inline: 13px;
  }
  .sample-badge {
    font-size: 0.72rem;
  }
  .stage-edit {
    min-width: 30px;
  }
  .reading-surface {
    padding-inline: 12px;
  }
  .stage {
    min-height: 245px;
  }
  .reader-note {
    font-size: 0.82rem;
  }
  .step-group {
    gap: 4px;
  }
  .stage-count {
    font-size: 0.8rem;
  }
}
@media (max-width: 360px) {
  .transport .restart span:last-child {
    display: none;
  }
  .source strong {
    font-size: 0.88rem;
  }
  .transport {
    padding-inline: 10px;
  }
  .stage-foot .sample-badge {
    display: none;
  }
  .panel-heading h2 {
    font-size: 1.05rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.source .narrow-label {
  display: none;
}
@media (max-width: 520px) {
  .source {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 86px;
    padding: 9px;
  }
  .source .art {
    top: 0;
    height: 47px;
  }
  .source small,
  .source .wide-label {
    display: none;
  }
  .source .narrow-label {
    display: block;
  }
  .source strong {
    font-size: 0.92rem;
  }
  .restart span:last-child {
    display: none;
  }
  .restart {
    min-width: 44px;
    min-height: 44px;
  }
  .transport {
    flex-wrap: nowrap;
  }
  .reader-note {
    min-height: 48px;
  }
}

.header-actions { display: flex; align-items: center; gap: .65rem; }
.install-button { padding: 0 .85rem; background: #edf2e7; color: #234936; border: 1px solid #d4dfce; }
.install-button:hover { background: #e0ead8; }
@media (max-width: 550px) {
  .header-actions { gap: .25rem; }
  .guide-button { width: 44px; }
  .guide-text { display:none; }
  .install-button { padding-inline: .6rem; }
}
