/* Auri tools extend the existing Guides palette, typography, navigation, and buttons. */
.typing-tool-page {
  --tool-wash: #e2e6e8;
  --tool-input: #f5f6f6;
  --tool-correct: #34634e;
  --tool-error-wash: #f5d8d4;
  --tool-radius: 16px;
  background: var(--page);
  scrollbar-color: var(--quiet) var(--page);
}

@media (prefers-color-scheme: dark) {
  .typing-tool-page {
    --tool-wash: #202529;
    --tool-input: #15191c;
    --tool-correct: #92c4ab;
    --tool-error-wash: #4b2928;
  }
}

.typing-tool-page [hidden] { display: none !important; }
.typing-tool-page ::selection { color: var(--accent-ink); background: var(--accent); }
.typing-tool-page :is(button, input, textarea, select) { font: inherit; }
.typing-tool-page :is(button, a) { -webkit-tap-highlight-color: transparent; }
.typing-tool-page :is(button, a, input, textarea, select):focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.typing-tool-page button { color: inherit; }
.typing-tool-page .button { gap: 10px; border-radius: 12px; color: var(--accent-ink); text-decoration: none; }
.typing-tool-page .button-secondary { color: var(--ink); }
.typing-tool-page .button:disabled { opacity: .5; cursor: default; transform: none; }
.typing-tool-page :is(h1, h2, h3) { text-wrap: balance; }
.typing-tool-page :is(p, li) { text-wrap: pretty; }
.typing-tool-page a { text-underline-offset: 4px; }
.typing-tool-page svg { flex-shrink: 0; }

.tools-shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.tool-hero { padding-block: 132px 34px; }
.tool-wayfinding { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.tool-wayfinding > a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; color: var(--muted); }
.tool-wayfinding > a:hover { text-decoration: underline; }
.tool-hero h1 { margin: 0; font-size: clamp(2.65rem, 5.3vw, 4.25rem); line-height: 1.08; letter-spacing: -.04em; font-weight: 680; }
.tool-hero h1 > span { color: var(--accent); }
.tool-lede { max-width: 660px; margin: 20px 0 0; color: var(--muted); font-size: 19px; line-height: 1.6; }
.device-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--shell); }
.device-switch a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 9px; font-size: 13px; font-weight: 590; color: var(--muted); white-space: nowrap; }
.device-switch a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 5px var(--shade); }
.device-switch a:not([aria-current]):hover { color: var(--ink); background: var(--page-soft); }
.device-label-short { display: none; }
.tool-nav-action { display: inline-flex; gap: 8px; }

.typing-lab { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 32px; }
.lab-workspace { min-width: 0; overflow: clip; border-radius: var(--tool-radius); background: var(--surface); box-shadow: 0 10px 32px var(--shade); }
.lab-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 72px; padding: 12px 26px; border-bottom: 1px solid var(--hairline); }
.test-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 580; }
.test-steps li { display: inline-flex; align-items: center; gap: 9px; color: var(--quiet); }
.test-steps li > span { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--tool-wash); font-size: 12px; font-variant-numeric: tabular-nums; }
.test-steps li[aria-current] { color: var(--ink); }
.test-steps li[aria-current] > span { color: var(--accent-ink); background: var(--accent); }
.icon-button { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--tool-wash); color: var(--ink); }
.lab-content { padding: 26px 28px 22px; }
.passage-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.passage-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--quiet); font-size: 13px; }
.passage-picker select { min-height: 40px; max-width: 180px; padding: 8px 28px 8px 10px; border: 1px solid var(--hairline); border-radius: 8px; color: var(--ink); background-color: var(--surface); font-weight: 540; cursor: pointer; }
.passage-picker select:disabled { opacity: .65; cursor: default; }
.test-clock { min-width: 72px; color: var(--muted); font-size: 18px; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; }
.test-passage { margin: 0 0 26px; color: var(--ink); font-size: clamp(20px, 2.05vw, 25px); font-weight: 460; line-height: 1.58; letter-spacing: -.018em; overflow-wrap: anywhere; }
.test-passage, [data-result-title] { scroll-margin-top: 110px; }
.test-passage .word-done { color: var(--tool-correct); }
.test-passage .word-error { text-decoration: underline wavy var(--accent); text-underline-offset: 5px; }
.input-label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.test-input { display: block; width: 100%; min-height: 118px; max-height: 300px; resize: vertical; margin: 0; padding: 16px 18px; border: 1px solid var(--hairline); border-radius: 12px; outline: none; color: var(--ink); background: var(--tool-input); font-size: 17px; line-height: 1.6; caret-color: var(--accent); transition: border-color 180ms ease, background-color 180ms ease; }
.test-input:focus { border-color: var(--focus); }
.test-input::placeholder { color: var(--quiet); opacity: 1; }
.test-input:disabled { opacity: .7; }
.typing-controls { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 18px; }
.field-hint { margin: 0; color: var(--quiet); font-size: 13px; line-height: 1.6; }
.typing-controls .field-hint { max-width: 31ch; }
.test-finish { flex-shrink: 0; }
.test-notice { margin: 12px 0 0; color: var(--accent-dark); font-size: 13px; line-height: 1.6; }
.test-notice:empty { display: none; }
.tool-offer { padding: 14px 0 0; }
.offer-product { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; font-size: 15px; font-weight: 600; }
.offer-product img { width: 48px; height: 48px; border-radius: 12px; }
.tool-offer h2 { max-width: 12ch; margin: 0; font-size: 31px; font-weight: 650; line-height: 1.15; letter-spacing: -.03em; }
.tool-offer > p { margin: 16px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.tool-offer ul { display: grid; gap: 13px; padding: 0; margin: 24px 0 28px; list-style: none; font-size: 13px; line-height: 1.55; }
.tool-offer li { display: flex; gap: 9px; align-items: start; }
.tool-offer li svg { margin-top: 1px; color: var(--quiet); }
.tool-offer > .button { width: 100%; }
.tool-offer > .offer-availability { margin-top: 12px; text-align: center; font-size: 12px; color: var(--quiet); }
.offer-learn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.offer-learn:hover { color: var(--ink); text-decoration: underline; }
.tool-privacy { max-width: 760px; margin: 18px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.7; }

.comparison { border-top: 1px solid var(--hairline); padding-top: 24px; }
.comparison-heading { margin-bottom: 25px; }
.comparison-heading h2 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; }
.comparison-heading p { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.comparison-row + .comparison-row { margin-top: 22px; }
.comparison-row-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: 14px; }
.comparison-row-label > span { display: inline-flex; align-items: center; gap: 8px; }
.comparison-row-label > strong { font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; }
.comparison-row-label small { color: var(--quiet); font-size: 12px; font-weight: 450; }
.time-track { width: 100%; height: 10px; border-radius: 3px; overflow: clip; background: var(--tool-wash); }
.time-fill { display: block; height: 100%; width: 100%; border-radius: inherit; transform-origin: left center; transform: scaleX(var(--track-scale, 0)); transition: transform 600ms var(--ease-out); }
.typing-fill { background: var(--muted); }
.voice-fill { background: var(--accent); }
.track-note { margin: 8px 0 0; color: var(--quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.track-note > span[aria-hidden] { margin: 0 4px; }
.estimate-control { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; color: var(--quiet); font-size: 12px; }
.estimate-control input { width: 72px; min-height: 40px; padding: 6px 8px; border: 1px solid var(--hairline); border-radius: 8px; color: var(--ink); background: var(--tool-input); text-align: center; font-variant-numeric: tabular-nums; }
.result-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.result-offer p { flex: 1 1 190px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.result-offer .button { flex-shrink: 0; }
.voice-round { margin-top: 27px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.voice-round-heading h3 { margin: 0 0 15px; font-size: 17px; font-weight: 620; letter-spacing: -.015em; }
.voice-mode { display: inline-flex; gap: 4px; max-width: 100%; margin-bottom: 14px; padding: 4px; border-radius: 10px; background: var(--tool-wash); }
.voice-mode button { min-height: 40px; padding: 8px 14px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 560; cursor: pointer; }
.voice-mode button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 4px var(--shade); }
.voice-mode button:disabled { cursor: default; }
.voice-actions { display: flex; align-items: center; gap: 20px; margin-top: 18px; }
.voice-clock { color: var(--accent-dark); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
[data-dictation-field] { margin-top: 18px; }
.typing-lab[data-stage="voice"] :is(.comparison-heading, .comparison-row, .estimate-control, .result-offer, .time-saved, .estimate-note, .result-actions) { display: none; }
.typing-lab[data-stage="voice"] .comparison { padding-top: 0; border-top: 0; }
.typing-lab[data-stage="voice"] .voice-round { margin-top: 0; padding-top: 0; border-top: 0; }
.time-saved { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px; margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--hairline); }
.time-saved label { display: block; font-size: 13px; color: var(--muted); }
.time-saved label strong { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.time-saved input[type="range"] { display: block; width: 100%; min-height: 44px; margin: 8px 0 0; accent-color: var(--accent); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: var(--quiet); font-size: 11px; }
.saved-result { display: grid; gap: 3px; margin: 0; min-width: 145px; text-align: right; }
.saved-result strong { font-size: 32px; font-weight: 640; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--accent-dark); }
.saved-result span { font-size: 12px; color: var(--muted); }
.saved-result small { margin-top: 3px; font-size: 11px; color: var(--quiet); }
.estimate-note { margin: 20px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.6; }
.result-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; cursor: pointer; }
.text-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.share-dialog { position: fixed; width: min(540px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); box-sizing: border-box; margin: auto; padding: 24px; overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: var(--tool-radius); color: var(--ink); background: var(--surface); box-shadow: 0 20px 80px rgb(0 0 0 / 25%); scrollbar-color: var(--quiet) var(--surface); }
.share-dialog::backdrop { background: rgb(12 15 18 / 56%); }
.typing-tool-page:has(.share-dialog[open]) { overflow: hidden; }
.share-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.share-header h2 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.share-header .icon-button { flex-shrink: 0; margin-right: -8px; }
.share-description { margin: 8px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.share-preview { display: grid; place-items: center; min-height: 180px; background: var(--tool-wash); border-radius: 12px; overflow: hidden; }
.share-preview img { display: block; width: 100%; height: auto; max-height: 49dvh; object-fit: contain; }
.share-loading { margin: 32px 20px; color: var(--muted); font-size: 14px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.share-actions .button { flex: 1; padding-inline: 16px; font-weight: 680; }
.share-link-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.share-link-row p { margin: 0; max-width: 32ch; color: var(--quiet); font-size: 12px; line-height: 1.55; }
.share-link-row .text-button { flex-shrink: 0; }
.share-link-fallback { margin-top: 16px; }
.share-link-fallback input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--tool-input); color: var(--ink); font-size: 16px; }
.share-status { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.share-status:not(:empty) { margin-top: 12px; }
.tool-explainer { display: grid; grid-template-columns: 1fr 1.15fr; gap: 72px; padding: 92px 0 72px; }
.tool-explainer h2 { margin: 0; font-size: clamp(28px, 3.2vw, 38px); font-weight: 640; line-height: 1.17; letter-spacing: -.03em; }
.tool-explainer p { margin: 0 0 16px; color: var(--muted); line-height: 1.7; }
.inline-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--accent-dark); font-size: 14px; font-weight: 560; }
.inline-link:hover { text-decoration: underline; }
.tool-faq { display: grid; grid-template-columns: 1fr 1.7fr; gap: 64px; padding: 32px 0 80px; }
.tool-faq h2 { margin: 12px 0 0; font-size: 30px; font-weight: 630; line-height: 1.2; letter-spacing: -.025em; }
.tool-faq details { border-top: 1px solid var(--hairline); }
.tool-faq details:last-child { border-bottom: 1px solid var(--hairline); }
.tool-faq summary { position: relative; padding: 21px 32px 21px 0; list-style: none; font-size: 16px; font-weight: 570; line-height: 1.5; cursor: pointer; }
.tool-faq summary::-webkit-details-marker { display: none; }
.tool-faq summary::after { content: ""; position: absolute; right: 6px; top: 29px; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform 200ms var(--ease-out); }
.tool-faq details[open] summary::after { transform: rotate(225deg); }
.tool-faq details p { margin: 0; padding: 0 26px 24px 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.tool-closing { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 54px; padding: 44px 42px; border-radius: var(--tool-radius); background: var(--tool-wash); }
.tool-closing h2 { max-width: 23ch; margin: 0; font-size: clamp(27px, 3vw, 36px); font-weight: 650; line-height: 1.15; letter-spacing: -.03em; }
.tool-closing p { max-width: 59ch; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.closing-action { display: grid; justify-items: center; gap: 12px; }
.closing-action > p { margin: 0; font-size: 12px; }
.tool-related { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 30px; margin-top: 28px; }
.tool-related a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; color: var(--muted); }
.tool-related a:hover { color: var(--ink); text-decoration: underline; }
.tool-directory { margin-top: 12px; }
.tool-directory-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 24px; gap: 28px; align-items: center; padding: 34px 0; border-top: 1px solid var(--hairline); }
.tool-directory-row:last-child { border-bottom: 1px solid var(--hairline); }
.directory-icon { color: var(--accent-dark); }
.tool-directory-row h2 { margin: 0; font-size: 27px; font-weight: 620; letter-spacing: -.025em; line-height: 1.2; }
.tool-directory-row p { margin: 10px 0 12px; color: var(--muted); }
.tool-directory-row div > span { color: var(--quiet); font-size: 13px; }
.tool-directory-row:hover h2 { color: var(--accent-dark); }
.tool-directory ~ .tool-closing { margin-top: 80px; }

@media (max-width: 980px) {
  .typing-lab { grid-template-columns: minmax(0, 1fr) 260px; gap: 26px; }
  .tool-offer h2 { font-size: 28px; }
  .lab-content { padding: 22px; }
  .typing-controls { align-items: start; flex-direction: column; gap: 14px; }
  .typing-controls .field-hint { max-width: 100%; }
}

@media (max-width: 760px) {
  .typing-lab { grid-template-columns: 1fr; gap: 36px; }
  .tool-hero { padding-top: 116px; }
  .tool-offer { padding: 0; max-width: 550px; }
  .tool-offer h2 { max-width: 100%; }
  .offer-product { margin-bottom: 20px; }
  .tool-offer ul { gap: 11px; margin-block: 20px; }
  .tool-offer > .button { width: max-content; min-width: 230px; }
  .tool-offer > .offer-availability { text-align: left; }
  .offer-learn { justify-content: flex-start; width: max-content; }
  .tool-explainer { grid-template-columns: 1fr; gap: 24px; padding-block: 70px 48px; }
  .tool-faq { grid-template-columns: 1fr; gap: 24px; padding-block: 20px 56px; }
  .tool-closing { grid-template-columns: 1fr; gap: 28px; padding: 32px 28px; }
  .closing-action { justify-items: start; }
}

@media (max-width: 520px) {
  .tools-shell { width: calc(100% - 32px); }
  .tool-hero { padding-block: 106px 28px; }
  .tool-wayfinding { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 26px; }
  .tool-wayfinding > a { min-height: 28px; }
  .device-switch { width: 100%; }
  .device-switch a { flex: 1; min-width: 0; gap: 7px; padding-inline: 10px; }
  .device-switch svg { width: 18px; height: 18px; }
  .tool-hero h1 { max-width: 12ch; font-size: clamp(38px, 10.2vw, 49px); }
  .tool-lede { margin-top: 16px; font-size: 16px; line-height: 1.65; }
  .lab-toolbar { padding: 10px 14px; min-height: 62px; }
  .test-steps { gap: 16px; font-size: 13px; }
  .test-steps li { gap: 7px; }
  .lab-content { padding: 18px 18px 20px; }
  .passage-toolbar { gap: 8px; margin-bottom: 16px; }
  .passage-picker { gap: 6px; font-size: 12px; }
  .passage-picker select { max-width: 146px; font-size: 12px; }
  .test-clock { min-width: 62px; font-size: 16px; }
  .test-passage { margin-bottom: 20px; font-size: 20px; line-height: 1.5; }
  .test-input { min-height: 112px; padding: 13px 14px; font-size: 16px; }
  .typing-controls { gap: 14px; }
  .typing-controls .button { width: 100%; }
  .tool-offer > .button { width: 100%; }
  .tool-offer > .offer-availability { text-align: center; }
  .offer-learn { margin-inline: auto; }
  .tool-privacy { margin-top: 24px; }
  .comparison-heading h2 { font-size: 25px; }
  .comparison-row-label { font-size: 13px; }
  .comparison-row-label > strong { font-size: 19px; }
  .time-saved { grid-template-columns: 1fr; gap: 20px; }
  .saved-result { text-align: left; }
  .saved-result strong { font-size: 34px; }
  .voice-mode { display: flex; }
  .voice-mode button { flex: 1; }
  .voice-actions { flex-wrap: wrap; gap: 14px; }
  .result-offer { gap: 14px; }
  .result-offer .button { width: 100%; }
  .result-actions { flex-wrap: wrap; }
  .share-dialog { padding: 18px; }
  .share-header h2 { font-size: 22px; }
  .share-actions .button { flex-basis: 100%; }
  .tool-closing { padding: 30px 24px; }
  .tool-closing .button { width: 100%; }
  .closing-action { width: 100%; justify-items: center; }
  .tool-directory-row { grid-template-columns: 28px minmax(0, 1fr) 20px; gap: 16px; padding-block: 28px; }
  .tool-directory-row h2 { font-size: 22px; }
  .tool-directory-row p { font-size: 15px; }
  .tool-nav-action { font-size: 12px; padding-inline: 12px; min-height: 44px; }
  .tool-nav-action svg { display: none; }
  .typing-tool-page.is-entering .site-header { position: absolute; }
  .typing-tool-page.is-entering .test-passage { font-size: 18px; line-height: 1.45; }
  .typing-lab[data-stage="voice"] .voice-round-heading { display: none; }
}

@media (max-width: 360px) {
  .tool-hero { padding-block: 96px 22px; }
  .tool-wayfinding { gap: 8px; margin-bottom: 20px; }
  .tool-hero h1 { font-size: 36px; }
  .tool-lede { margin-top: 12px; font-size: 15px; line-height: 1.55; }
  .device-label-full { display: none; }
  .device-label-short { display: inline; }
  .device-switch a { padding-inline: 8px; }
  .lab-toolbar { min-height: 58px; padding-block: 8px; }
  .lab-content { padding: 16px; }
  .passage-toolbar { margin-bottom: 14px; }
  .test-passage { margin-bottom: 18px; font-size: 18px; line-height: 1.45; }
}

@media (prefers-reduced-motion: reduce) {
  .typing-tool-page { scroll-behavior: auto; }
  .typing-tool-page *, .typing-tool-page *::before, .typing-tool-page *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
