/* File Name Fixer, /tools/file-name-fixer only. Colors and type come from
   tokens.css and svc-v2.css. Low confidence is never shown by color alone:
   it gets the word Check, a dashed border and a heavier weight. The review
   table stacks into labeled cards under 640px and scrolls sideways (with
   keyboard focus) between 640px and the width it needs. */

.page-fnf .fnf-lede { margin-top: var(--s4); max-width: 820px; }
.fnf { margin-top: var(--s8); max-width: 820px; }

.svc-v2 main .fnf-ready { margin-bottom: var(--s5); padding: var(--s3) var(--s4); background: var(--white); border-left: 4px solid var(--line-strong); font-weight: 600; color: var(--ink); }
.svc-v2 main .fnf-ready.is-ready { border-left-color: var(--teal); }
.svc-v2 main .fnf-ready.is-error { border-left-color: var(--navy); }

/* Office type */
.fnf-presets { margin: 0 0 var(--s5); padding: 0; border: 0; min-width: 0; }
.fnf-presets legend { padding: 0; margin-bottom: var(--s3); font-family: var(--font-serif); font-weight: 500; font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.fnf-presets__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s2); }
.fnf-preset { position: relative; }
.fnf-preset input { position: absolute; top: 18px; left: 16px; width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
.fnf-preset label { display: block; height: 100%; min-height: 44px; padding: 14px 14px 14px 48px; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r-control); cursor: pointer; }
.fnf-preset input:checked + label { border: 2px solid var(--navy); padding: 13px 13px 13px 47px; }
.fnf-preset input:focus-visible + label { outline: var(--focus); outline-offset: 2px; }
.fnf-preset__t { display: block; font-weight: 600; color: var(--ink); }
.fnf-preset__b { display: block; margin-top: 2px; font-size: .9375rem; color: var(--body); }
.svc-v2 main .fnf-example { margin-top: var(--s3); font-size: 1rem; color: var(--body); }
.fnf-example code, .fnf-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9375em; background: var(--mist); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

/* Drop zone: a real file input under a big label */
.fnf-zone { position: relative; background: var(--white); border: 2px dashed var(--navy); border-radius: var(--r-card); transition: background-color .15s ease; }
.fnf-zone.is-over { background: var(--teal-tint); border-style: solid; }
.fnf-zone:focus-within { outline: var(--focus); outline-offset: 3px; }
.fnf-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap; }
.fnf-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); min-height: 200px; padding: var(--s8) var(--s5); cursor: pointer; color: var(--navy); text-align: center; border-radius: var(--r-card); }
.fnf-pick:hover { background: rgba(20, 48, 73, .04); }
.fnf-pick__title { font-family: var(--font-serif); font-size: clamp(1.375rem, 1.2rem + .8vw, 1.75rem); font-weight: 500; line-height: 1.2; }
.fnf-pick__sub { font-size: 1rem; }
.fnf-pick__fine { margin-top: var(--s2); font-size: 1rem; color: var(--body); }
.svc-v2 main .fnf-privacy { margin-top: var(--s3); font-size: 1.0625rem; font-weight: 600; color: var(--navy); }

.fnf-samples { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line-strong); }
.svc-v2 main .fnf-samples p { margin-top: var(--s3); font-size: 1rem; }
.fnf-samples__list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .9375rem; color: var(--body); }
.fnf-samples__list a { display: inline-block; padding: 10px 0; color: var(--teal-text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-decoration: underline; text-underline-offset: 2px; }

.svc-v2 main .fnf-error { margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--white); border-left: 3px solid var(--navy); font-weight: 600; color: var(--ink); }

.fnf-check { margin-top: var(--s6); padding: var(--s4) var(--s5); background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--teal-on-navy); border-radius: var(--r-card); }
.fnf-check h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.fnf-check ul { margin: var(--s3) 0 0; padding-left: 1.2em; }
.fnf-check li { margin-top: var(--s2); font-size: 1rem; line-height: 1.55; color: var(--body); }

/* Review */
.fnf-review { padding: 56px 0 72px; background: var(--white); border-top: 1px solid var(--line); }
.fnf-review h2:focus { outline: none; }
.svc-v2 main .fnf-review__intro { margin-top: var(--s3); max-width: 760px; font-size: 1.0625rem; }
.fnf-toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.fnf-toolbar .v2-btn { min-height: 48px; }
.fnf-toolbar .v2-btn[disabled] { opacity: 1; cursor: not-allowed; background: var(--mist); border-color: var(--line-strong); color: var(--muted); }
.svc-v2 main .fnf-summary { margin-top: var(--s3); font-weight: 600; color: var(--ink); }
.svc-v2 main .fnf-done { margin-top: var(--s4); font-weight: 600; color: var(--navy); }

.fnf-table-wrap { margin-top: var(--s4); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); }
.fnf-table-wrap:focus-visible { outline: var(--focus); outline-offset: 2px; }
.fnf-table { width: 100%; min-width: 1060px; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; }
.fnf-table caption { padding: var(--s3) var(--s4); text-align: left; font-weight: 600; color: var(--ink); }
.fnf-table th, .fnf-table td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.fnf-table thead th { background: var(--navy); color: var(--white); font-weight: 600; border-top: 0; }
.fnf-table thead th:nth-child(1) { width: 14%; }
.fnf-table thead th:nth-child(2) { width: 34%; }
.fnf-table thead th:nth-child(3) { width: 19%; }
.fnf-table thead th:nth-child(4) { width: 14%; }
.fnf-table thead th:nth-child(5) { width: 10%; }
.fnf-table tbody th { font-weight: 400; }
.fnf-row.is-low > * { background: #fbf6ec; }
.fnf-row.is-approved > * { background: var(--teal-tint); }
.fnf-orig { display: block; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.fnf-meta, .fnf-status { display: block; font-size: .875rem; color: var(--muted); }
.fnf-row[data-state="error"] .fnf-status { color: var(--ink); font-weight: 600; }
.fnf-table progress { display: block; width: 100%; height: 8px; margin-top: 6px; accent-color: var(--teal); }
.fnf-table progress[hidden] { display: none; }
.fnf-more, .fnf-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; padding: 0; background: none; border: 0; font: inherit; font-weight: 600; color: var(--teal-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.fnf-more[hidden], .fnf-link[hidden] { display: none; }
.fnf-more:focus-visible, .fnf-link:focus-visible { outline: var(--focus); outline-offset: 2px; }

.fnf-in { width: 100%; min-height: 44px; padding: 8px 10px; background: var(--white); border: 1px solid var(--honest-border); border-radius: 6px; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875rem; color: var(--ink); }
select.fnf-in { font-family: var(--font-sans); font-size: .9375rem; }
textarea.fnf-in { display: block; resize: vertical; line-height: 1.4; overflow-wrap: anywhere; word-break: break-all; }
.fnf-in:focus-visible { outline: var(--focus); outline-offset: 1px; }
.fnf-in[disabled] { background: var(--mist); color: var(--muted); }
.fnf-in[aria-invalid="true"] { border: 2px solid var(--navy); }

.fnf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fnf-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; min-height: 36px; padding: 4px 10px; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r-pill); font: inherit; font-size: .8125rem; color: var(--ink); text-align: left; cursor: pointer; }
.fnf-chip:hover { border-color: var(--navy); }
.fnf-chip:focus-visible { outline: var(--focus); outline-offset: 2px; }
.fnf-chip[aria-expanded="true"] { border: 2px solid var(--navy); padding: 3px 9px; }
.fnf-chip__k { font-weight: 600; color: var(--muted); }
.fnf-chip__v { overflow-wrap: anywhere; }
.fnf-chip.is-low { border: 2px dashed var(--ochre-text); padding: 3px 9px; background: var(--ochre-tint); }
.fnf-chip.is-edited .fnf-chip__k::after { content: " (yours)"; font-weight: 400; }
.fnf-chip__flag { padding: 0 6px; border-radius: 4px; background: var(--ochre-text); color: var(--white); font-weight: 700; }

.fnf-conf { display: inline-block; padding: 2px 8px; border-radius: 4px; font-weight: 700; }
.fnf-conf--high { background: var(--teal-tint); color: var(--teal-text); }
.fnf-conf--medium { background: var(--mist); color: var(--ink); }
.fnf-conf--low { background: var(--ochre-tint); color: var(--ochre-text); border: 1px dashed var(--ochre-text); }
.fnf-conf__why { display: block; margin-top: 4px; font-size: .875rem; color: var(--body); }

.fnf-approve { display: inline-flex; align-items: center; justify-content: center; min-width: 108px; min-height: 44px; padding: 0 14px; background: var(--white); border: 1.5px solid var(--navy); border-radius: 6px; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.fnf-approve[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.fnf-approve[aria-pressed="true"] .fnf-approve__t::before { content: "\2713\00a0"; }
.fnf-approve:focus-visible { outline: var(--focus); outline-offset: 2px; }
.fnf-approve[disabled] { border-color: var(--line-strong); color: var(--muted); cursor: not-allowed; }

.fnf-ev-row > td { padding: 0 14px 16px; border-top: 0; }
.fnf-ev { padding: var(--s4); background: var(--paper); border: 1px solid var(--line-strong); border-left: 4px solid var(--navy); border-radius: var(--r-control); }
.fnf-ev__h { font-family: var(--font-serif); font-weight: 500; font-size: 1.25rem; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.fnf-ev__edit { margin-top: var(--s3); max-width: 520px; }
.fnf-ev__edit label { display: block; margin-bottom: 4px; font-weight: 600; color: var(--ink); }
.svc-v2 main .fnf-ev__hint, .svc-v2 main .fnf-ev__src, .svc-v2 main .fnf-ev__mask { margin-top: 6px; font-size: .875rem; color: var(--body); }
.svc-v2 main .fnf-ev__conf { margin-top: var(--s3); font-size: .9375rem; }
.fnf-snip { margin-top: var(--s2); padding: var(--s3); background: var(--white); border: 1px solid var(--line); border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.fnf-snip__line { display: block; }
.fnf-snip mark { background: #fde9a8; color: var(--ink); outline: 2px solid var(--ochre-text); outline-offset: 0; font-weight: 700; }

.fnf-how .fnf-rules { margin-top: 32px; }
.svc-v2 main .fnf-how__note { margin-top: var(--s5); max-width: 760px; }
.fnf-closing p + p { margin-top: var(--s3); }
.svc-v2 main .fnf-closing a.fnf-on-navy { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.fnf-foot-note { color: inherit; }

.fnf-print-only { display: none; }

/* Under 640px: one labeled card per file, nothing sideways */
@media (max-width: 639px) {
  .fnf-review { padding: 40px 0 56px; }
  .fnf-toolbar .v2-btn { flex: 1 1 100%; }
  .fnf-table-wrap { overflow-x: visible; border: 0; }
  .fnf-table { min-width: 0; }
  .fnf-table, .fnf-table tbody, .fnf-table tr, .fnf-table th, .fnf-table td { display: block; width: 100%; }
  .fnf-table caption { display: block; padding: 0 0 var(--s2); }
  .fnf-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .fnf-row { margin-top: var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-control); overflow: hidden; }
  .fnf-table tbody th, .fnf-table td { border-top: 1px solid var(--line); padding: 10px 14px; }
  .fnf-table tbody th { border-top: 0; }
  .fnf-row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: .8125rem; font-weight: 700; color: var(--muted); }
  .fnf-ev-row { border: 0; }
  .fnf-ev-row > td { padding: 8px 0 0; }
  .fnf-approve { width: 100%; }
}

/* Printed list: the review table only, with the logo and the site. */
@media print {
  .site-header, .site-footer, .dock, .dock-sheet, .skip-link, .fnf-hero, .fnf-how, .fnf-closing,
  .fnf-toolbar, .fnf-review__intro, .fnf-chips, .fnf-more, .fnf-link, .fnf-ev-row, .fnf-done, .fnf-table progress { display: none !important; }
  .fnf-print-only { display: block; }
  .fnf-print-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #999; }
  .fnf-print-head p { margin: 0; font-size: 10pt; }
  .fnf-print-foot { position: fixed; bottom: 0; left: 0; right: 0; text-align: center; font-size: 9pt; color: #333; }
  .fnf-review { padding: 0; border: 0; }
  .fnf-review[hidden] { display: none; }
  .fnf-table-wrap { overflow: visible; border: 0; }
  .fnf-table { min-width: 0; font-size: 9pt; }
  .fnf-table, .fnf-table tbody, .fnf-table tr { display: revert; }
  .fnf-table th, .fnf-table td { display: table-cell; padding: 4px 6px; border: 1px solid #999; }
  .fnf-table thead { position: static; width: auto; height: auto; clip: auto; clip-path: none; display: table-header-group; }
  .fnf-table thead th { background: none; color: #000; }
  .fnf-row > [data-label]::before { content: none; }
  .fnf-row > * { background: none !important; }
  .fnf-in { border: 0; padding: 0; min-height: 0; background: none; font-size: 9pt; appearance: none; resize: none; }
  .fnf-approve { border: 0; min-width: 0; min-height: 0; padding: 0; background: none !important; color: #000 !important; }
  .fnf-row { break-inside: avoid; }
}
