/* The free pages (plan 3I1, 3I2): the Sailor Brass look of DESIGN.md over the site's own sheet (/assets/site.css,
   lane N), which supplies the tokens, the fonts, the top bar and the foot. This file adds the tools: the mat that
   holds the work, the inspector beside it, the fields, buttons and the reading column. Operate mode: the work
   leads, the controls follow each other in one column, nothing sits over the stencil. The change colours
   (added, lost) are never used here. */

/* While Barlow loads, the text is set in Arial sized to Barlow's widths (measured 2026-11-18 on the pages' own
   copy: 95.2% at 400, 96.2% at 500, 90.4% at 600, 91.4% at 700), so lines wrap the same before and after the swap
   and nothing below them moves (CLS). Line heights are set in the CSS, so only the width needs matching. */
@font-face { font-family: "Barlow Fallback"; font-weight: 400 500; src: local("Arial"), local("ArialMT");
  size-adjust: 95.7%; ascent-override: 100%; descent-override: 20%; line-gap-override: 0%; }
@font-face { font-family: "Barlow Fallback"; font-weight: 600 700; src: local("Arial Bold"), local("Arial-BoldMT");
  size-adjust: 90.9%; ascent-override: 100%; descent-override: 20%; line-gap-override: 0%; }
body { font-family: "Barlow", "Barlow Fallback", system-ui, -apple-system, "Segoe UI", sans-serif; }

:root {
  --act-strong: #1E3354;
  --field-h: 52px;
  --button-h: 56px;
  --radius: 10px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  /* The web's night act-strong is the brass action, not the app's mustard: the check's accent-color and the slider
     thumb are fills, and DESIGN.md keeps the mustard off fills and checks. */
  :root { --act-strong: #E2C27A; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* The breadcrumbs: a guide word above the page's title. */
.crumbs { max-width: 1120px; margin: 0 auto; padding: 12px var(--gutter) 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.crumbs li { display: inline-flex; align-items: center; color: var(--ink-2); }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 4px; color: var(--edge); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }

/* The page's head: title and one line of what it does. */
.tool-head { max-width: 1120px; margin: 0 auto; padding: 8px var(--gutter) 24px; }
.tool-head h1 {
  margin: 0 0 12px; font-size: clamp(32px, 4.6vw, 48px); line-height: 1.08; font-weight: 700;
  letter-spacing: -0.01em; text-wrap: balance; max-width: 22ch;
}
.tool-head .lede { margin: 0; max-width: var(--read); font-size: 19px; line-height: 1.45; color: var(--ink-2); }
.tool-head .lede strong { color: var(--ink); font-weight: 600; }

/* The tool: the mat on the left (the work), the inspector on the right; stacked on a phone. */
.tool {
  max-width: 1120px; margin: 0 auto 8px; padding: 0 var(--gutter);
  display: grid; gap: 0; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .tool { grid-template-columns: minmax(0, 1fr) 360px; }
}
.tool-mat {
  padding: 20px 16px; border-radius: var(--radius) var(--radius) 0 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
@media (min-width: 900px) { .tool-mat { border-radius: var(--radius) 0 0 var(--radius); padding: 40px; } }

/* The sheet on the mat: fixed proportion before and after the image, so nothing moves when it arrives. */
.tool-sheet {
  position: relative; width: min(100%, 460px, calc(66vh * 17 / 22)); aspect-ratio: 17 / 22;
  display: grid; place-items: center; padding: 16px;
}
/* A redraw of the sheet stays on its own layer: the mat's grid under it is not repainted (INP). */
.tool-sheet { contain: layout paint; will-change: transform; }
.tool-sheet canvas {
  display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto;
}
.tool-sheet canvas[hidden], .drop[hidden], .button[hidden] { display: none; }
.drop {
  display: grid; place-items: center; gap: 12px; width: 100%; height: 100%; padding: 24px; text-align: center;
  border: 2px dashed #768196; border-radius: 6px; color: #141A24;
}
.drop.over { border-color: #1E3354; background: #F1E7CC; }
/* The status line's words of a wait or a failure, repeated under the sample button where a phone shows them
   (desk L-SEO-build-1, 7.1); aria-hidden, so #status stays the one voice. */
.drop .drop-status { margin: 0; max-width: 28ch; font-size: 15px; line-height: 1.4; color: #4C5666; }
.drop .drop-status[data-tone="problem"] { color: #141A24; font-weight: 600; }
.drop p { margin: 0; max-width: 24ch; font-size: 16px; line-height: 1.4; color: #4C5666; }
.drop svg { width: 44px; height: 44px; stroke: #1E3354; }
/* The sample button: secondary, 8 px under the hint (the drop's 12 px gap, less 4), on the sheet's own paper. */
.drop .button.sample { margin-top: -4px; min-height: 44px; background: #FFFFFF; color: #141A24; border-color: #768196; }
.drop .button.sample:hover { background: #F1E7CC; }
.drop .button.sample[aria-busy="true"] { cursor: progress; }
.sheet-label {
  margin: 0; min-height: 1.4em; font-family: var(--measure); font-weight: 600; font-size: 16px;
  letter-spacing: .04em; color: var(--mat-num); font-variant-numeric: tabular-nums; text-align: center;
}

/* The inspector: the controls, in the order the work goes. */
.inspector {
  background: var(--paper); border: 1px solid var(--rule); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius); padding: 20px; display: grid; gap: 18px; align-content: start;
}
@media (prefers-color-scheme: dark) { .inspector { background: var(--chrome-2); } }
@media (min-width: 900px) {
  .inspector { border-top: 1px solid var(--rule); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
}
.inspector fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.inspector legend, .field > label, .field-label {
  padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 15px; letter-spacing: .01em; color: var(--ink);
}
.field { display: grid; gap: 0; }
.hint { margin: 6px 0 0; font-size: 15px; line-height: 1.4; color: var(--ink-2); }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; min-height: var(--field-h); padding: 0 14px; border: 1.5px solid var(--edge); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font-weight: 400; font-size: 19px; line-height: 1.2;
  font-family: "Barlow", "Barlow Fallback", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  input[type="text"], input[type="number"], select, textarea { background: var(--chrome); }
}
textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .button:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
}
input[aria-invalid="true"] { border-width: 2px; border-color: var(--ink); }
/* The sheet is paper in both themes: a focus ring on it is the stencil's own black. */
.sheet :focus-visible { outline-color: #111111; }
/* The file input is hidden; its label carries the focus ring. */
.drop input:focus-visible + .button { outline: 3px solid #111111; outline-offset: 2px; }
.button[aria-disabled="true"] { cursor: progress; opacity: .7; }
.measure-field { position: relative; }
.measure-field input { padding-right: 48px; font-family: var(--measure); font-weight: 600; }
.measure-field .unit {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: 17px;
  pointer-events: none;
}

/* Choices: a segmented track (DESIGN.md "Levels"), one raised segment. */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px;
  background: var(--chrome-2); border-radius: var(--radius); }
@media (prefers-color-scheme: dark) { .segmented { background: var(--chrome); } }
.segmented label {
  position: relative; display: grid; place-items: center; min-height: 48px; padding: 6px 10px; border-radius: 7px;
  text-align: center; font-weight: 500; font-size: 16px; line-height: 1.2; cursor: pointer; color: var(--ink);
}
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented input:checked + span { font-weight: 600; }
.segmented label { border: 1.5px solid transparent; }
/* The chosen segment is raised in paper and outlined in `edge` (3:1 or more on the track, both themes), so it
   reads by its edge as well as its fill and weight. */
.segmented label:has(input:checked) {
  background: var(--paper); border-color: var(--edge);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .16), 0 1px 6px rgba(0, 0, 0, .06);
}
@media (prefers-color-scheme: dark) { .segmented label:has(input:checked) { background: var(--chrome-2); } }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 1px; }

/* A switch-like checkbox row, 48 tall, the whole row clickable. */
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-size: 17px; }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--act-strong); flex: none; }

/* Buttons: one primary per tool (DESIGN.md), secondaries outlined. */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--button-h);
  padding: 0 20px; border-radius: var(--radius); border: 1.5px solid var(--edge); background: var(--paper);
  color: var(--ink); font-weight: 600; font-size: 18px; line-height: 1;
  font-family: "Barlow", "Barlow Fallback", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  transition: background-color .15s cubic-bezier(.2, .8, .2, 1), transform .1s cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) { .button, button.button { background: var(--chrome-2); } }
.button.primary, button.button.primary { background: var(--act); color: var(--on-act); border-color: var(--act); }
.button:hover { background: var(--chrome-2); }
.button.primary:hover { background: var(--act); filter: brightness(1.08); }
@media (prefers-color-scheme: dark) {
  .button:hover { background: color-mix(in srgb, var(--ink) 8%, var(--chrome-2)); }
}
.button:active { transform: translateY(1px); }
.button[disabled], button.button[disabled] { cursor: not-allowed; opacity: .45; transform: none; filter: none; }
.button svg { width: 22px; height: 22px; flex: none; stroke: currentColor; }
.actions { display: grid; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .button, button.button { transition: none; } }

/* The status line: what the tool just did, in words; read out by screen readers. */
.status {
  max-width: 1120px; margin: 0 auto; padding: 8px var(--gutter) 0; min-height: 2.6em;
  font-size: 16px; line-height: 1.4; color: var(--ink-2);
}
.status[data-tone="problem"] { color: var(--ink); font-weight: 600; }
.status[data-tone="problem"]::before {
  content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.note { margin: 0; font-size: 15px; line-height: 1.4; color: var(--ink); min-height: 1.4em; }

/* The reading column under the tool. */
.prose { max-width: 1120px; margin: 0 auto; padding: 24px var(--gutter) 48px; }
.prose > * { max-width: var(--read); }
.prose h2 { margin: 40px 0 12px; font-size: 26px; line-height: 1.2; font-weight: 700; text-wrap: balance; }
.prose h3 { margin: 28px 0 8px; font-size: 19px; line-height: 1.3; font-weight: 600; }
.prose p, .prose li { font-size: 17px; line-height: 1.55; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose .measure { font-family: var(--measure); font-weight: 600; font-variant-numeric: tabular-nums; }
.prose table { border-collapse: collapse; width: 100%; max-width: var(--read); font-variant-numeric: tabular-nums; }
.prose caption { text-align: left; font-weight: 600; padding-bottom: 8px; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; }
.prose th { font-weight: 600; }

/* The sheet pages: the sheet on the mat beside its downloads; stacked on a phone. */
.sheet-row {
  max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; gap: 8px 32px; grid-template-columns: minmax(0, 1fr); align-items: start;
}
@media (min-width: 900px) { .sheet-row { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); } }
.sheet-row .prose { padding: 8px 0 0; margin: 0; }
.sheet-preview { padding: 24px; border-radius: var(--radius); }
.sheet-preview .sheet { max-width: 360px; margin: 0 auto; padding: 10px 10px 8px; }
.sheet-preview img { aspect-ratio: 695 / 900; }
.prose > h2:first-child { margin-top: 8px; }

/* Downloads on the sheet pages: one row a file. */
.prose .downloads, .downloads { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; max-width: 560px; }
.downloads li + li { margin-top: 0; }
.downloads a { justify-content: space-between; width: 100%; text-align: left; }
.downloads a { gap: 12px; }
/* The tag never breaks ("PDF," / "Letter" at 390 px): only the label wraps (desk L-SEO-build-1, 5.1). */
.downloads .size { font-family: var(--measure); font-weight: 600; color: var(--ink-2); font-size: 15px;
  white-space: nowrap; flex: none; }
/* The chart's widths table keeps each row on one line on a phone (desk L-SEO-build-1, 5.2). */
@media (max-width: 559px) {
  .widths th, .widths td { padding: 10px 8px; }
  .widths td { white-space: nowrap; font-size: 15px; }
}
.downloads .primary .size { color: var(--on-act); }

/* The hub's list of tools. */
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 760px; border-top: 1px solid var(--rule); }
.tool-list li { border-bottom: 1px solid var(--rule); }
.tool-list a { display: grid; gap: 4px; padding: 18px 0; text-decoration: none; color: var(--ink); }
.tool-list a strong { font-size: 21px; font-weight: 600; color: var(--act); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tool-list a span { color: var(--ink-2); font-size: 17px; }

/* The app section and the links between tools, above the foot. */
.get-app { background: var(--chrome-2); border-top: 1px solid var(--rule); }
.get-app-inner { max-width: 1120px; margin: 0 auto; padding: 36px var(--gutter); }
.get-app h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.2; }
.get-app p, .get-app li { max-width: var(--read); font-size: 17px; line-height: 1.55; }
.store-links { padding-left: 1.2em; }
.store-name { font-weight: 600; }
.more-tools { max-width: 1120px; margin: 0 auto; padding: 32px var(--gutter) 40px; }
.more-tools h2 { margin: 0 0 12px; font-size: 20px; }
.more-tools ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.more-tools li { display: grid; padding: 8px 0; }
.more-tools a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.more-tools span { font-size: 15px; color: var(--ink-2); }

/* "Updated <date>" under a tool's or sheet's title: the reading pages' dated line (plan T9). */
.tool-head .dated {
  margin: 0 0 10px; color: var(--ink-2);
  font-family: var(--measure); font-weight: 600; letter-spacing: .02em;
}

/* The free pages pad inside their 1120 px and the site pads outside it: the foot lines up with the blocks above. */
.foot-inner { max-width: 1088px; }
.bar { padding-inline: max(var(--gutter), calc((100% - 1088px) / 2)); }
