/* /tools/pattern-tester - page-specific rules ONLY. Shared primitives (tokens,
   buttons, cards, notices, form controls) come from tokens.css / site.css and
   tools.css. No new colors: every value here is a site token. Mono is for
   patterns and test strings only. */

/* ---------- Full-width tool: inputs left, results right ---------- */
.pt-tool { padding: 32px 0 clamp(48px, 6vw, 72px); }
.pt-wide { padding: 0 clamp(16px, 2vw, 32px); }
.pt-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 960px) {
    .pt-panes { grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.25fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
}
.pt-pane { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- Inputs ---------- */
.pt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pt-field label { font-size: .86rem; font-weight: 600; color: var(--heading); }
.pt-optional { font-weight: 400; color: var(--muted); }
.pt-field input, .pt-field select { width: 100%; padding: 10px 12px; font-size: .95rem; min-width: 0; }
.pt-field input { font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace; font-variant-ligatures: none; }
.pt-field textarea {
    width: 100%; min-height: 170px; resize: vertical; padding: 10px 12px; font-size: .92rem;
    font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace; font-variant-ligatures: none; line-height: 1.55;
}
.pt-engine select { max-width: 280px; }
.pt-field input[aria-invalid="true"] { border-color: var(--pink-strong); }

.pt-group { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pt-group legend { padding: 0 6px; font-family: "JetBrains Mono", monospace; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pt-like-row { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem; gap: 12px; }
.pt-escape input { text-align: center; }
.pt-hint { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.5; max-width: 62ch; }
.pt-field-error { margin: 0; font-size: .88rem; color: var(--pink-strong); line-height: 1.5; }
.pt-learn { margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); line-height: 1.6; max-width: 62ch; }
.pt-learn a { color: var(--link); font-weight: 600; text-underline-offset: 3px; }

.pt-check { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 44px; }
.pt-check input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--blue-bright); }
.pt-check input:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.pt-check label { font-size: .92rem; font-weight: 500; color: var(--ink); cursor: pointer; }

.pt-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Results ---------- */
.pt-pane-h { font-size: 1.15rem; margin: 6px 0 0; text-wrap: balance; }
.pt-pane-h:first-child { margin-top: 0; }
.pt-status { font-size: .92rem; color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }
.pt-status.is-error { color: var(--pink-strong); }
.pt-banner { margin: 0; padding: 10px 14px; border: 1px solid var(--amber-line); border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: .9rem; line-height: 1.55; }
.pt-banner code { font-family: "JetBrains Mono", monospace; font-size: .9em; }

.pt-table-wrap { min-width: 0; }
.pt-results { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: .95rem; line-height: 1.5; overflow: hidden; }
.pt-results th { text-align: left; font-family: "JetBrains Mono", monospace; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pt-results td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pt-results tbody tr:last-child td { border-bottom: none; }
.pt-results th:not(:first-child), .pt-results td:not(:first-child) { width: 1%; white-space: nowrap; }
.pt-results code { font-family: "JetBrains Mono", monospace; font-size: .9em; overflow-wrap: anywhere; word-break: break-word; }
.pt-results mark { background: var(--amber-soft); color: var(--amber-ink); box-shadow: inset 0 -2px 0 var(--amber-line); padding: 0 2px; border-radius: 3px; }

.pt-tag { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pt-hit { color: var(--green-on-soft); background: var(--green-soft); border-color: transparent; }
.pt-miss { color: var(--muted); }
.pt-unset { color: var(--muted); border-style: dashed; }
.pt-error { color: var(--pink-strong); border-color: currentColor; }
.pt-why { display: block; margin-top: 4px; font-size: .78rem; color: var(--muted); white-space: normal; }

.pt-where-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.pt-where-head .pt-pane-h { margin: 0; }
.pt-where { white-space: pre; overflow-x: auto; word-break: normal; }

.pt-notes { display: grid; gap: 8px; }
.pt-note { margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: .92rem; color: var(--muted); line-height: 1.55; max-width: 62ch; }
.pt-note strong { color: var(--heading); }

.pt-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Reading width for the prose below the tool ---------- */
.page-head h1, .tools-sec h2, .tools-cta h2 { text-wrap: balance; }
/* Inter runs narrower than the ch unit (the width of a 0), so ~60ch lands near 75 characters. */
.page-head .lede { max-width: 60ch; }
.tools-sec .tools-intro, .tools-sec .tools-points, .tools-faq { max-width: 60ch; }
.tools-sec p, .tools-sec li, .pt-note, .pt-learn { text-wrap: pretty; }

@media (max-width: 640px) {
    .pt-results th, .pt-results td { padding: 8px 10px; }
}
@media (max-width: 380px) {
    .pt-like-row { grid-template-columns: minmax(0, 1fr) 5.5rem; }
}
