:root {
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #172b3a;
  background: #edf3f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #172b3a;
  --muted: #536b79;
  --line: #d8e2e8;
  --teal: #096c73;
  --teal-pale: #e1f1f0;
  --error: #ae3434;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; min-height: 100vh; }

.page-shell { width: min(1120px, 100% - 64px); margin: 0 auto; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d9e4ea; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 650; letter-spacing: -.035em; }
.mark { display: inline-flex; align-items: center; gap: 2px; height: 23px; padding: 4px 5px; border-radius: 7px; background: var(--teal); }
.mark span { width: 2px; border-radius: 3px; background: #fff; }
.mark span:nth-child(1) { height: 6px; }.mark span:nth-child(2) { height: 12px; }.mark span:nth-child(3) { height: 8px; }
.trial-tag { display: inline-flex; align-items: center; gap: 8px; color: #46606d; font-size: 12px; font-weight: 600; }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; background: #428f83; }
.reader { max-width: 944px; margin: 68px auto 0; }
.reader-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 15px; color: var(--teal); font-size: 13px; font-weight: 700; letter-spacing: .015em; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 58px); line-height: 1.05; letter-spacing: -.055em; font-weight: 650; }
h1 span { color: var(--teal); }
.intro { max-width: 480px; margin: 17px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.language-pair { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; padding-bottom: 7px; color: #627987; font-size: 13px; }
.language-pair strong { color: var(--teal); font-weight: 700; }
.pair-arrow { color: #8da3ad; }
.sharing { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 88px; margin-top: 36px; padding: 17px 20px; border: 1px solid #d7e2e8; border-radius: 12px; background: rgba(255,255,255,.78); }
.sharing-copy { display: flex; align-items: flex-start; gap: 13px; }
.connection-indicator { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: #9aabb4; }
.connection-indicator.is-active { background: var(--teal); box-shadow: 0 0 0 4px #e1f1f0; }
.connection-indicator.is-error { background: var(--error); }
.sharing-copy strong { display: block; font-size: 14px; font-weight: 650; }
.sharing-copy p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.controls { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
button { min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #59aeb2; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .47; }
.start-button { background: var(--teal); color: white; }
.start-button:not(:disabled):hover { background: #075b62; }
.stop-button { border-color: #cbd9df; background: white; color: #344e5c; }
.stop-button:not(:disabled):hover { background: #f2f7f9; }
.setup-note { display: flex; align-items: flex-start; gap: 11px; margin-top: 13px; padding: 12px 15px; border: 1px solid #c5dcdf; border-radius: 8px; background: #eaf5f5; color: #315962; }
.setup-note[hidden] { display: none; }
.note-mark { display: grid; place-items: center; flex: 0 0 18px; height: 18px; border-radius: 50%; background: #cfe7e6; color: #195e64; font-size: 12px; font-weight: 700; }
.setup-note p { margin: 0; font-size: 12px; line-height: 1.5; }
.token-note { display: grid; gap: 6px; margin-top: 13px; padding: 12px 15px; border: 1px solid #c5dcdf; border-radius: 8px; background: #eaf5f5; }
.token-note[hidden] { display: none; }
.token-note label { font-size: 12px; font-weight: 700; color: #244d56; }
.token-note input { box-sizing: border-box; width: 100%; min-height: 36px; border: 1px solid #a7c4ca; border-radius: 6px; padding: 7px 10px; font: inherit; }
.token-note p { margin: 0; font-size: 11px; line-height: 1.4; color: #315962; }
code { padding: 1px 4px; border-radius: 3px; background: rgba(20,80,87,.08); font-size: .95em; }
.reader-columns { display: grid; grid-template-columns: .82fr 1.18fr; gap: 0; margin-top: 36px; border-top: 1px solid #cad8df; border-bottom: 1px solid #cad8df; background: #fff; }
.transcript { min-width: 0; min-height: 320px; padding: 22px 25px 28px; }
.transcript + .transcript { border-left: 1px solid #e1e9ed; }
.column-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid #e5ecef; }
.column-heading > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.column-heading h2 { margin: 0; color: #3e5967; font-size: 13px; font-weight: 650; }
.transcript-target .column-heading h2 { color: var(--teal); }
.live-label { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: #82949d; font-size: 10px; }
.live-label > span { width: 5px; height: 5px; border-radius: 50%; background: #a7b6bd; }
.live-label.is-live { color: #28766f; }.live-label.is-live > span { background: #32917f; }
.history-note { margin: 12px 0 -8px; color: #879aa3; font-size: 11px; line-height: 1.45; }
.history-note[hidden] { display: none; }
.transcript-body { max-height: 460px; overflow: auto; padding-top: 19px; color: #405965; font-size: 17px; line-height: 1.72; overflow-wrap: anywhere; white-space: pre-wrap; }
.source-body { font-size: 15px; line-height: 1.75; }
.target-body { color: #1d4148; font-size: 21px; line-height: 1.62; letter-spacing: -.012em; }
.empty-state { margin: 0; color: #99aab2; font-size: 14px; font-style: normal; }
.target-body .empty-state { font-size: 16px; }
.diagnostics { margin-top: 19px; color: #536b79; }
.diagnostics summary { display: inline-flex; align-items: center; gap: 8px; color: #506a78; font-size: 12px; cursor: pointer; }
.diagnostics summary::marker { color: #718994; }
.diagnostic-content { max-width: 740px; padding: 15px 0 3px 18px; }
.diagnostic-content dl { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 30px; margin: 0; }
.diagnostic-content dl > div { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; }
.diagnostic-content dt { color: #81949d; }.diagnostic-content dd { margin: 0; color: #405965; text-align: right; }
.diagnostic-content > p { margin: 14px 0 0; color: #81949d; font-size: 11px; line-height: 1.5; }
.diagnostic-content pre { max-height: 180px; overflow: auto; padding: 10px; border-radius: 6px; background: #e8eef1; color: #34505c; font-size: 11px; white-space: pre-wrap; }
.notice { display: flex; align-items: flex-start; gap: 11px; margin-top: 34px; padding-top: 17px; border-top: 1px solid #d6e1e7; }
.notice-icon { display: grid; place-items: center; flex: 0 0 19px; height: 19px; border-radius: 50%; background: #dce9ed; color: #56727f; font-size: 12px; }
.notice p { max-width: 740px; margin: 0; color: #687e89; font-size: 12px; line-height: 1.65; }
.notice strong { color: #3e5967; font-weight: 650; }
.page-footer { display: flex; justify-content: space-between; margin-top: 43px; padding: 16px 0 23px; border-top: 1px solid #d9e4ea; color: #8a9ca5; font-size: 11px; }

@media (max-width: 700px) {
  .page-shell { width: min(100% - 36px, 560px); }
  .reader { margin-top: 48px; }
  .reader-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
  .language-pair { padding-bottom: 0; }
  .sharing { align-items: stretch; flex-direction: column; gap: 17px; margin-top: 27px; }
  .controls { justify-content: flex-end; }
  .reader-columns { grid-template-columns: 1fr; margin-top: 27px; }
  .transcript { min-height: 220px; padding: 20px 19px 24px; }
  .transcript + .transcript { border-top: 1px solid #e1e9ed; border-left: 0; }
  .transcript-body { max-height: 340px; }
  .target-body { font-size: 19px; }
}

@media (max-width: 430px) {
  .page-shell { width: calc(100% - 28px); }
  .topbar { height: 65px; }
  .reader { margin-top: 38px; }
  h1 { font-size: 39px; }
  .intro { font-size: 14px; }
  .sharing { padding: 15px; }
  .controls button { flex: 1; }
  .diagnostic-content dl { grid-template-columns: 1fr; }
  .page-footer { gap: 12px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
