/* Writing tools. Builds on the AEO tool shell (aeo-checker.css) and the theme tokens in style.css.
   Text colours meet WCAG 2.2 AA on white and cream: #C2410C on white is 5.2:1, #9A3808 is 7.6:1. */
.wt-page { --wt-accent: #c2410c; --wt-accent-text: #9a3808; --wt-ink: var(--ink, #181410); --wt-muted: #5a5048; --wt-line: rgba(24, 20, 16, .16); --wt-surface: #fff; --wt-soft: var(--cream, #f4efe6); --wt-ok: #1f6b3a; --wt-warn: #8a4b00; --wt-bad: #a3262a; }
.wt-hero .aeo-hero__sub { max-width: 780px; }
.wt-container { padding-bottom: 64px; }
.wt-app, .wt-disclosure, .wt-privacy, .wt-guide, .wt-faq, .wt-page .aeo-related-cards { max-width: 1180px; margin-left: auto; margin-right: auto; }
.wt-app { margin-top: 28px; padding: 24px; border: 1px solid var(--wt-line); border-radius: var(--radius, 10px); background: var(--wt-surface); box-shadow: 0 6px 24px rgba(24, 20, 16, .04); color: var(--wt-ink); }
.wt-app__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.wt-app__head h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; }

.wt-credits { font-size: 14px; color: var(--wt-muted); }
.wt-credits__list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; }
.wt-credits__item strong { color: var(--wt-ink); }
.wt-credits__item.is-empty strong { color: var(--wt-bad); }
.wt-credits__reset, .wt-credits__line { margin: 4px 0 0; }

.wt-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; border: 0; }
.wt-label-text { display: block; margin-bottom: 8px; font-weight: 650; font-size: 14px; }
.wt-modes > .wt-label-text { grid-column: 1 / -1; padding: 0; }
.wt-mode { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--wt-line); border-radius: 10px; background: var(--wt-soft); cursor: pointer; }
.wt-mode input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--wt-accent); flex: 0 0 auto; }
.wt-mode:has(input:checked) { border-color: var(--wt-accent); box-shadow: inset 0 0 0 1px var(--wt-accent); background: #fff; }
.wt-mode:has(input:focus-visible) { outline: 3px solid rgba(194, 65, 12, .45); outline-offset: 2px; }
.wt-mode.is-unavailable { opacity: .75; }
.wt-mode__title { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-weight: 700; }
.wt-mode__credits { font: 600 12px/1.3 var(--ff-m, monospace); color: var(--wt-muted); }
.wt-mode__desc { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--wt-muted); }

.wt-style { margin: 0 0 16px; }
.wt-style select, .wt-option select, .wt-inline-field select { min-height: 44px; padding: 8px 12px; border: 1px solid rgba(24, 20, 16, .35); border-radius: 8px; background: #fff; color: var(--wt-ink); font: inherit; font-size: 15px; }
.wt-hint { display: block; margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--wt-muted); }

.wt-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wt-pane { min-width: 0; }
.wt-pane__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.wt-pane__title { margin: 0; font-weight: 700; font-size: 16px; }
.wt-textarea { display: block; box-sizing: border-box; width: 100%; min-height: 320px; resize: vertical; padding: 14px; border: 1px solid rgba(24, 20, 16, .35); border-radius: 10px; background: var(--wt-soft); color: var(--wt-ink); font: 400 15px/1.6 var(--ff-s, Georgia, serif); unicode-bidi: plaintext; }
.wt-textarea:focus-visible { outline: 3px solid rgba(194, 65, 12, .45); outline-offset: 1px; border-color: var(--wt-accent); background: #fff; }
.wt-textarea[aria-invalid="true"] { border-color: var(--wt-bad); }
.wt-count { min-height: 20px; margin: 6px 0 0; font: 12px/1.5 var(--ff-m, monospace); color: var(--wt-muted); }
.wt-count.is-over { color: var(--wt-bad); font-weight: 700; }

.wt-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.wt-toolbar--end { justify-content: flex-end; margin-top: 6px; }
.wt-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid rgba(24, 20, 16, .35); border-radius: 8px; background: #fff; color: var(--wt-ink); font: 650 14px/1.2 var(--ff-sans, system-ui, sans-serif); text-decoration: none; cursor: pointer; }
.wt-btn--small { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.wt-btn:hover { border-color: var(--wt-accent); color: var(--wt-accent-text); }
.wt-btn:focus-visible { outline: 3px solid rgba(194, 65, 12, .45); outline-offset: 2px; }
.wt-btn--primary { background: var(--wt-accent); border-color: var(--wt-accent); color: #fff; }
.wt-btn--primary:hover { background: var(--wt-accent-text); border-color: var(--wt-accent-text); color: #fff; }
.wt-btn--secondary { border-color: var(--wt-accent); color: var(--wt-accent-text); }
.wt-btn[disabled] { cursor: not-allowed; background: #e9e4dc; border-color: #c9c1b6; color: #5a5048; }
@media (pointer: coarse) { .wt-btn--small { min-height: 44px; } }

.wt-turnstile { margin: 16px 0 0; min-height: 65px; }
.wt-access { margin: 12px 0 0; font-size: 14px; }
.wt-access summary { cursor: pointer; color: var(--wt-muted); }
.wt-access__row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wt-access__input { flex: 1 1 260px; min-width: 0; padding: 6px 10px; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wt-access__status { margin: 6px 0 12px; }
.wt-access__status:empty { display: none; }
.wt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 18px; }
.wt-actions__note { flex: 1 1 260px; margin: 0; font-size: 13px; line-height: 1.45; color: var(--wt-muted); }
.wt-status { min-height: 22px; margin: 12px 0 0; font-size: 14px; color: var(--wt-ink); }
.wt-error { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--wt-bad); }
.wt-error:empty, .wt-status:empty { min-height: 0; margin: 0; }
.wt-app[aria-busy="true"] .wt-status::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid var(--wt-accent); border-right-color: transparent; border-radius: 50%; animation: wt-spin .9s linear infinite; }
@keyframes wt-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wt-app[aria-busy="true"] .wt-status::before { animation: none; border-right-color: var(--wt-accent); } }

.wt-results { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--wt-line); }
.wt-results__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wt-results__title { margin: 0 0 12px; font-size: 22px; line-height: 1.2; }
.wt-results__title:focus { outline: none; }
.wt-results__title:focus-visible { outline: 3px solid rgba(194, 65, 12, .45); }
.wt-h3 { margin: 22px 0 10px; font-size: 17px; line-height: 1.3; }
.wt-labels { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.wt-label { padding: 6px 10px; border-radius: 99px; border: 1px solid var(--wt-line); background: var(--wt-soft); font: 650 12px/1.2 var(--ff-m, monospace); letter-spacing: .02em; }
.wt-label--artifacts_cleaned, .wt-label--rewrite_completed, .wt-label--unicode_inspected, .wt-label--no_artifacts { border-color: rgba(31, 107, 58, .35); color: var(--wt-ok); background: #eef7f0; }
.wt-label--manual_review { border-color: rgba(138, 75, 0, .4); color: var(--wt-warn); background: #fdf3e4; }
.wt-label--watermark_not_tested { border-color: rgba(24, 20, 16, .3); color: var(--wt-ink); background: #fff; }

.wt-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.wt-summary__item { padding: 10px 12px; border: 1px solid var(--wt-line); border-radius: 8px; background: var(--wt-soft); }
.wt-summary dt { font-size: 12px; color: var(--wt-muted); }
.wt-summary dd { margin: 4px 0 0; font: 700 18px/1.2 var(--ff-m, monospace); }
.wt-alert { margin: 12px 0; padding: 12px 14px; border-left: 4px solid var(--wt-warn); background: #fdf3e4; font-size: 14px; line-height: 1.5; }
.wt-alert--high { border-left-color: var(--wt-bad); background: #fbecec; }
.wt-code, .wt-context, .wt-cp, .wt-loc { font-family: var(--ff-m, monospace); font-size: 13px; }
.wt-code { display: inline-block; max-width: 100%; padding: 1px 6px; border-radius: 4px; background: rgba(24, 20, 16, .07); overflow-wrap: anywhere; white-space: pre-wrap; }
.wt-alert .wt-code { display: block; margin-top: 6px; }
.wt-cp { font-weight: 700; }
.wt-muted { color: var(--wt-muted); font-size: 14px; }
.wt-empty { padding: 12px 14px; border: 1px dashed var(--wt-line); border-radius: 8px; color: var(--wt-muted); }
.wt-inline-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; padding: 0; list-style: none; }
.wt-bullets { margin: 0; padding-left: 20px; line-height: 1.6; }

.wt-table-wrap { max-width: 100%; overflow-x: auto; }
.wt-table-wrap:focus-visible, .wt-visible:focus-visible, .wt-diff--side:focus-visible, .wt-diff--inline:focus-visible { outline: 3px solid rgba(194, 65, 12, .45); outline-offset: 2px; }
.wt-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.wt-table th, .wt-table td { padding: 10px; border-bottom: 1px solid var(--wt-line); text-align: left; vertical-align: top; line-height: 1.45; }
.wt-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--wt-muted); }
.wt-table tbody th { font-weight: 600; }
.wt-details summary { margin-top: 6px; cursor: pointer; color: var(--wt-accent-text); font-weight: 600; }
.wt-details summary:focus-visible { outline: 3px solid rgba(194, 65, 12, .45); }
.wt-locations { margin: 8px 0 0; padding-left: 20px; font-weight: 400; }
.wt-locations li { margin: 4px 0; overflow-wrap: anywhere; }
.wt-context { white-space: pre-wrap; background: rgba(24, 20, 16, .05); padding: 1px 4px; border-radius: 3px; }
.wt-badge, .wt-sev { display: inline-block; padding: 2px 7px; border-radius: 99px; font: 650 11px/1.4 var(--ff-m, monospace); white-space: nowrap; }
.wt-badge--remove, .wt-badge--space, .wt-badge--newline { background: #eef7f0; color: var(--wt-ok); }
.wt-badge--keep { background: #eef1f7; color: #2d4a7a; }
.wt-badge--review { background: #fdf3e4; color: var(--wt-warn); }
.wt-sev--info { background: #eef1f7; color: #2d4a7a; }
.wt-sev--low { background: #f1eee9; color: #4a4038; }
.wt-sev--medium { background: #fdf3e4; color: var(--wt-warn); }
.wt-sev--high { background: #fbecec; color: var(--wt-bad); }

.wt-visible { max-height: 360px; overflow: auto; padding: 14px; border: 1px solid var(--wt-line); border-radius: 8px; background: var(--wt-soft); font: 14px/1.7 var(--ff-s, Georgia, serif); white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.wt-mark { margin: 0 1px; padding: 0 3px; border-radius: 3px; font: 700 10px/1.4 var(--ff-m, monospace); vertical-align: 1px; background: #fbecec; color: var(--wt-bad); }
.wt-mark--keep { background: #eef1f7; color: #2d4a7a; }
.wt-mark--review { background: #fdf3e4; color: var(--wt-warn); }
.wt-mark--diff { background: rgba(24, 20, 16, .08); color: inherit; text-decoration: none; }

.wt-changes { max-height: 360px; overflow: auto; margin: 0; padding: 0; list-style: none; border: 1px solid var(--wt-line); border-radius: 8px; }
.wt-change { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-bottom: 1px solid var(--wt-line); font-size: 14px; }
.wt-change:last-child { border-bottom: 0; }
.wt-change input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--wt-accent); flex: 0 0 auto; }
.wt-change label { overflow-wrap: anywhere; cursor: pointer; }
.wt-change__rule { font-weight: 650; }
.wt-flags, .wt-suggestions { margin: 0; padding: 0; list-style: none; }
.wt-flag, .wt-suggestion { padding: 8px 0; border-bottom: 1px solid var(--wt-line); font-size: 14px; line-height: 1.5; }
.wt-excerpt { display: block; margin-top: 4px; color: var(--wt-muted); font-style: italic; }

.wt-diff-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wt-segmented { display: inline-flex; gap: 4px; margin: 0; padding: 4px; border: 1px solid var(--wt-line); border-radius: 99px; }
.wt-segmented label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 600; cursor: pointer; }
.wt-segmented input { accent-color: var(--wt-accent); }
.wt-segmented label:has(input:checked) { background: var(--wt-soft); }
.wt-segmented label:has(input:focus-visible) { outline: 3px solid rgba(194, 65, 12, .45); }
.wt-diff { font: 14px/1.7 var(--ff-s, Georgia, serif); }
/* The side-by-side view scrolls as one box (both columns together); the wheel moves on to the
   page at either end, and the box never takes more than 60% of the window. */
.wt-diff--side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; max-height: min(480px, 60vh); overflow: auto; padding: 0 0 2px; border: 1px solid var(--wt-line); border-radius: 8px; background: #fff; }
.wt-diff__col { padding: 0 14px 12px; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.wt-diff--inline { max-height: min(480px, 60vh); overflow: auto; padding: 12px 14px; border: 1px solid var(--wt-line); border-radius: 8px; background: #fff; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.wt-diff__head { margin: 0 0 8px; font: 700 12px/1.2 var(--ff-m, monospace); text-transform: uppercase; letter-spacing: .05em; color: var(--wt-muted); white-space: normal; }
.wt-diff--side .wt-diff__head { position: sticky; top: 0; z-index: 1; margin: 0 -14px 8px; padding: 12px 14px 8px; background: #fff; }
.wt-diff__insert { background: #dff3e5; color: #11461f; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.wt-diff__delete { background: #fbe1e1; color: #6e1414; text-decoration: line-through; }

.wt-options { margin: 0 0 18px; padding: 0; border: 0; }
.wt-options__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.wt-option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.wt-option input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--wt-accent); flex: 0 0 auto; }
.wt-option .wt-hint { font-weight: 400; }
.wt-option--select { flex-direction: column; gap: 6px; cursor: default; }
.wt-inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }

.wt-disclosure { margin-top: 24px; padding: 16px 18px; border: 1px solid rgba(138, 75, 0, .35); border-left: 4px solid var(--wt-warn); border-radius: 8px; background: #fdf8ef; color: var(--wt-ink); font-size: 15px; line-height: 1.6; }
.wt-disclosure p { margin: 0; }
.wt-disclosure__title { margin-bottom: 4px !important; font-weight: 700; }
.wt-privacy { margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--wt-line); color: var(--wt-muted); font-size: 14px; line-height: 1.6; }
.wt-privacy p { margin: 0; }
.wt-privacy a, .wt-guide a { color: var(--wt-accent-text); font-weight: 650; }
.wt-noscript { max-width: 1180px; margin: 18px auto; padding: 14px; border: 1px solid rgba(163, 38, 42, .3); color: var(--wt-bad); }

.wt-guide { margin-top: 54px; padding: 30px 0; border-top: 1px solid var(--wt-line); color: var(--wt-ink); line-height: 1.65; }
.wt-guide__eyebrow { margin: 0 0 8px; color: var(--wt-accent-text); font: 700 11px/1.2 var(--ff-m, monospace); letter-spacing: .08em; text-transform: uppercase; }
.wt-guide h2 { max-width: 760px; margin: 0 0 18px; font-size: clamp(25px, 3vw, 36px); line-height: 1.1; }
.wt-guide h3 { margin: 22px 0 8px; font-size: 18px; }
.wt-guide p, .wt-guide__list, .wt-guide__defs { max-width: 860px; }
.wt-guide__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 36px; }
.wt-guide__list { padding-left: 22px; }
.wt-guide__list li { margin: 6px 0; }
.wt-guide__defs dt { margin-top: 14px; font-weight: 700; }
.wt-guide__defs dd { margin: 4px 0 0; }
.wt-table--guide { min-width: 720px; }
.wt-faq, .wt-page .aeo-related-cards { margin-top: 48px; }
.wt-offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 860px) {
	.wt-editor, .wt-modes, .wt-guide__cols, .wt-diff--side { grid-template-columns: 1fr; }
	.wt-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wt-textarea { min-height: 220px; }
}
@media (max-width: 560px) {
	.wt-app { padding: 16px; margin-left: -4px; margin-right: -4px; }
	.wt-actions .wt-btn { width: 100%; }
	.wt-pane__head { align-items: flex-start; flex-direction: column; }
}
@media (forced-colors: active) {
	.wt-diff__insert, .wt-diff__delete, .wt-mark { border: 1px solid CanvasText; }
	.wt-mode:has(input:checked) { outline: 2px solid Highlight; }
}
