/* Name Documents: page-specific styles. Shared look comes from brand.css and app-shell.css. */
.app-title { font-size: var(--step-3); margin-bottom: 0.3em; }
.intro { color: var(--muted); max-width: 70ch; margin-bottom: 20px; }
#drop { min-height: 220px; }
#drop .progress { width: min(360px, 100%); }
.setup-note { max-width: 70ch; }
.small { font-size: var(--step--1); margin: 6px 0; }

.results-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.results-head h2 { font-size: var(--step-2); margin: 0 0 4px; }
.results-head h2:focus { outline: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.problems { border-left: 4px solid var(--danger); background: var(--surface); border-radius: var(--radius-s); padding: 10px 14px; margin: 0 0 16px; }
.problems h3 { font-size: var(--step-0); margin: 0 0 6px; }
.problems ul { margin: 0; padding-left: 1.2em; font-size: var(--step--1); display: grid; gap: 4px; overflow-wrap: anywhere; }

.split-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; min-width: 0; }
.panel h3 { font-size: var(--step-1); margin: 0 0 4px; }
mark { background: var(--highlight); color: var(--highlight-ink); padding: 0 3px; border-radius: 3px; }

/* The page to click on */
.pager { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.pager .btn { padding: 0.2em 0.8em; font-size: 1.2rem; line-height: 1; flex: none; }
#doc-label { font-size: var(--step--1); font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.page-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.page-tabs:empty { display: none; }
.page-text { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); padding: 10px; max-height: 560px; overflow: auto; display: grid; gap: 4px; }
.page-line { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cell { font: inherit; font-size: var(--step--1); text-align: left; padding: 3px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.cell:hover { border-color: var(--line); color: var(--fg); }
.cell.varies { background: var(--highlight); color: var(--highlight-ink); font-weight: 600; }
.cell.found { box-shadow: 0 0 0 2px var(--accent); }
.cell[aria-pressed="true"] { outline: 3px solid var(--primary); outline-offset: 1px; }
.cell:not(.varies)[aria-pressed="true"] { color: var(--fg); }
.cell:focus-visible { outline: 3px solid var(--primary); }

/* Values and the pattern */
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 10px 0 12px; }
.quick-label { font-size: var(--step--1); color: var(--muted); margin-right: 2px; }
.chip { font: inherit; font-size: 0.8rem; padding: 2px 9px; margin: 2px 2px 2px 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--hero); color: var(--on-hero); border-color: var(--hero); }
.fields { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.fields .empty { color: var(--muted); font-size: var(--step--1); }
.field-row { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 10px 8px; background: var(--bg); min-width: 0; }
.field-main { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.fname { font: inherit; font-weight: 700; flex: 0 1 11em; width: 11em; min-width: 0; padding: 2px 6px; border: 2px solid transparent; border-radius: 6px; background: transparent; color: var(--fg); }
.fname:hover { border-color: var(--line); }
.fname:focus { border-color: var(--primary); outline: none; background: var(--surface); }
.remove { font: inherit; font-size: 1.2rem; line-height: 1; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 8px; border-radius: 6px; flex: none; margin-left: auto; }
.remove:hover { color: var(--danger); }
.from { font-size: 0.8rem; flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.field-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--step--1); margin: 4px 0 0 8px; }
.field-opts label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.field-opts select, .field-opts input { font: inherit; padding: 2px 6px; border: 2px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); min-width: 0; }
.field-opts input { width: 10em; }
.field-opts select:focus, .field-opts input:focus { border-color: var(--primary); outline: none; }
.field input#pattern { width: 100%; }
.date-order { margin-top: 12px; }
.date-order select { max-width: 100%; }
.example { color: var(--muted); overflow-wrap: anywhere; margin-top: 8px; }
.example span { color: var(--fg); font-weight: 600; }

/* The list of new names */
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin: 28px 0 0; }
.list-title { font-size: var(--step-1); margin: 0; }
.table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin-top: 6px; }
#list { border-collapse: collapse; width: 100%; min-width: 860px; font-size: var(--step--1); }
#list th, #list td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
#list thead th { position: sticky; top: 0; z-index: 1; background: var(--hero); color: var(--on-hero); white-space: nowrap; }
#list tbody tr:last-child td { border-bottom: 0; }
#list .old { min-width: 8em; max-width: 14em; color: var(--muted); }
#list .new { width: 38%; min-width: 22em; }
.new-wrap { display: flex; gap: 4px; align-items: center; }
.name-input { font: inherit; width: 100%; min-width: 0; padding: 3px 6px; border: 2px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font-weight: 600; }
.name-input:focus { border-color: var(--primary); outline: none; }
.reset { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); cursor: pointer; padding: 2px 8px; flex: none; }
#list .val { min-width: 6em; }
#list .val.short { white-space: nowrap; }
#list .val.none { color: var(--danger); font-style: italic; }
#list .notes { min-width: 12em; }
.note { display: block; }
.note.missing, .note.duplicate, .note.scanned, .note.nothing, .note.long { color: var(--danger); }
.note.check { color: var(--fg); }
.note.check::before { content: ""; display: inline-block; width: 0.6em; height: 0.6em; border-radius: 0.15em; background: var(--pop); margin-right: 6px; }
.note.same { color: var(--muted); }
#list tr.warn td.old { box-shadow: inset 4px 0 0 var(--danger); }
#list tr.check td.old { box-shadow: inset 4px 0 0 var(--pop); }
#list tr.refused td { color: var(--muted); }

/* Saving */
.save-panel { margin-top: 24px; }
#save-progress { margin-top: 14px; max-width: 420px; }
.done { border: 2px solid var(--ok); border-radius: var(--radius-m); background: var(--surface); padding: 14px 18px; margin: 14px 0 0; }
.done:focus { outline: none; }
.done h3 { margin: 0 0 6px; }
.done p { margin: 0 0 6px; }
.done-list { margin: 0 0 6px; padding-left: 1.2em; font-size: var(--step--1); overflow-wrap: anywhere; }
.how { margin-top: 20px; font-size: var(--step--1); max-width: 80ch; }

.confirm { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); color: var(--fg); padding: 22px 24px; width: min(480px, calc(100vw - 32px)); }
.confirm::backdrop { background: rgb(16 24 26 / 0.55); }
.confirm h2 { font-size: var(--step-2); }

@media (max-width: 860px) { .split-grid { grid-template-columns: minmax(0, 1fr); } }
