/* Plain CSS, no framework and no build step.
   Salespeople log follow-ups from phones (design §2), so every layout here
   collapses to one column at narrow widths rather than scrolling sideways. */

:root {
    --ink: #1c1c1c;
    --ink-soft: #52524e;
    --muted: #70706a;
    --rule: #dcdcd6;
    --page: #fbfbfa;
    --surface: #ffffff;
    --accent: #0b5c3f;
    --accent-soft: #e8f1ec;
    --warn-ink: #7a4a08;
    --warn-bg: #fdf3e3;
    --error-ink: #7a1a12;
    --error-bg: #fdeceb;
    --good-ink: #0b5c3f;
    --good-bg: #e8f1ec;
    --nav-width: 13rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 15px/1.55 "Noto Sans", "Noto Sans Devanagari", "Noto Sans Telugu", "Segoe UI", system-ui, sans-serif;
}

h1 { font-size: 1.4rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.4rem; }
a { color: var(--accent); }

/* ---------- shell ---------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
}

.brand { font-weight: 600; font-size: 1.1rem; color: var(--accent); text-decoration: none; }

.site-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.site-user-name { color: var(--ink-soft); }

.site-body { display: flex; align-items: flex-start; }

.site-nav {
    flex: 0 0 var(--nav-width);
    padding: 1rem 0.75rem;
    border-right: 1px solid var(--rule);
    background: var(--surface);
    min-height: calc(100vh - 7rem);
}

/* Each group is a <details>, so the heading is its <summary> and the caret is
   ours: the browser's own marker sits at a different place in every engine and
   cannot be aligned with the links underneath. */
.nav-group { margin-bottom: 0.15rem; }

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
}

/* Safari still draws the triangle from the pseudo-element. */
.nav-group-title::-webkit-details-marker { display: none; }

.nav-group-title::before {
    content: "";
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 4px solid currentColor;
    border-top: 3.5px solid transparent;
    border-bottom: 3.5px solid transparent;
    transition: transform 0.12s ease-out;
}

.nav-group[open] > .nav-group-title::before { transform: rotate(90deg); }
.nav-group-title:hover { background: var(--page); color: var(--ink); }
.nav-group[open] > .nav-group-title { color: var(--ink); }

/* The links inside a group line up under the caret, not with it. */
.nav-group > ul { margin: 0.1rem 0 0.5rem 0.55rem; }

/* A group holding one item is a plain link: a drop-down over one thing is a
   click that hides nothing. It sits where a group heading would. */
.site-nav > .nav-link {
    display: block;
    margin-bottom: 0.15rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-decoration: none;
}

.site-nav > .nav-link:hover { background: var(--page); color: var(--ink); }
.site-nav > .nav-link.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }

.site-nav a {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    color: var(--ink);
    text-decoration: none;
}

.site-nav a:hover { background: var(--page); }
.site-nav a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.site-main { flex: 1 1 auto; padding: 1.25rem; max-width: 76rem; min-width: 0; }

.site-footer {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ---------- the sign-in pages ---------- */

body.plain {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.card {
    width: 100%;
    max-width: 30rem;
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 8px;
}

.card-brand { margin: 0 0 1rem; font-weight: 600; color: var(--accent); }
.card-footer { margin-top: 1rem; color: var(--muted); font-size: 0.85rem; }

/* ---------- pages ---------- */

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; margin-top: 1rem; }

.card-tile, .panel, .callout {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
}

.panel { margin-top: 1.5rem; }
.callout { border-color: var(--accent); background: var(--accent-soft); margin: 1rem 0; }
.panel-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0; }
.panel-alert { border-color: var(--warn-ink); }
/* A dashboard tile that is asking for something, rather than reporting. It
   was named on the audit tile from WP18 and never defined, so a tile that
   meant to stand out looked like all the others. */
.card-tile-warn { border-color: var(--warn-ink); background: var(--warn-bg); }
.panel-good { border-color: var(--good-ink); }

/* An editor that opens inside a row's panel: the bank screens' explain form. */
.inline-editor { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); }

.steps { padding-left: 1.25rem; }
.steps > li { margin-bottom: 1rem; }
.qr { margin: 0.75rem 0; }
.qr img { border: 1px solid var(--rule); background: #fff; padding: 0.5rem; }

/* ---------- forms ---------- */

.form-narrow { max-width: 24rem; }
.form-two-column { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; align-items: start; }
.form-two-column fieldset { margin: 0; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

fieldset { border: 1px solid var(--rule); border-radius: 6px; padding: 0.9rem; background: var(--surface); }
legend { padding: 0 0.35rem; font-weight: 600; font-size: 0.9rem; }

.field { margin-bottom: 0.8rem; }
.field label { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.2rem; }

.field input, .field select, .field textarea {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    font: inherit;
    background: var(--surface);
    color: var(--ink);
}

.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.field-inline { margin-bottom: 0; }
.field-inline input, .field-inline select { width: auto; min-width: 9rem; }

.field-check { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.45rem; font-size: 0.92rem; }
.field-check input { width: auto; }

.field-hint { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--muted); }
.field-error { display: block; margin-top: 0.2rem; font-size: 0.82rem; color: var(--error-ink); }

.bulk-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 1rem 0 0.5rem;
}

.filters {
    display: flex;
    gap: 0.9rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
}

.input-code { letter-spacing: 0.3em; font-size: 1.2rem; font-family: ui-monospace, monospace; }

/* ---------- buttons ---------- */

.button-primary, .button-quiet, .button-danger {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 4px;
    border: 1px solid transparent;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.button-primary { background: var(--accent); color: #fff; }
.button-quiet { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.button-danger { background: var(--error-bg); color: var(--error-ink); border-color: #f0bdb8; }
.button-primary:hover, .button-quiet:hover, .button-danger:hover { filter: brightness(0.97); }

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

.inline-form { display: inline; }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.92rem; }

table.list th, table.list td {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

table.list thead th {
    background: #f4f4f1;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    white-space: nowrap;
}

table.list tbody tr:hover { background: #fcfcfb; }
table.list tr.row-off { color: var(--muted); }
table.list tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn-ink); }
.row-actions { white-space: nowrap; }

.nowrap { white-space: nowrap; }
.truncate { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- pager ---------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.6rem 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.pager-buttons { display: flex; align-items: center; gap: 0.25rem; }
.pager-position { padding: 0 0.5rem; }

.pager-button {
    display: inline-block;
    min-width: 2rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--surface);
    font: inherit;
    color: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.pager-button:hover { background: var(--surface-alt, #f4f4f0); }

/* The ends: a link with nowhere to go is a dead look-alike, so the other
   controls do not move under the pointer. */
.pager-button-off { opacity: 0.4; cursor: default; }
.pager-button-off:hover { background: var(--surface); }

/* ---------- small pieces ---------- */

.messages:not(:empty) { margin-bottom: 1rem; }

.message { margin: 0 0 1rem; padding: 0.6rem 0.8rem; border-radius: 4px; }
.message-error { background: var(--error-bg); color: var(--error-ink); border: 1px solid #f0bdb8; }
.message-warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #efd8ab; }
.message-good { background: var(--good-bg); color: var(--good-ink); border: 1px solid #b8d8c7; }

.tag {
    display: inline-block;
    padding: 0.08rem 0.4rem;
    border-radius: 3px;
    font-size: 0.78rem;
    background: #eeeeea;
    color: var(--ink-soft);
    white-space: nowrap;
}

.tag-good { background: var(--good-bg); color: var(--good-ink); }
.tag-warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag-off { background: #ebebe7; color: var(--muted); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 0.15rem 0; }

.muted { color: var(--muted); }
.muted-small { display: block; color: var(--muted); font-size: 0.82rem; }
.empty { padding: 1.25rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--rule); border-radius: 6px; }

code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; }

pre.json {
    margin: 0.4rem 0 0;
    padding: 0.5rem;
    background: #f6f6f3;
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.secret { font-family: ui-monospace, monospace; letter-spacing: 0.08em; }
.secret-large { font-family: ui-monospace, monospace; font-size: 1.3rem; letter-spacing: 0.08em; margin: 0.4rem 0; }

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

/* htmx: dim a list while its replacement is on the way. */
.htmx-request table.list, .htmx-request .empty { opacity: 0.55; transition: opacity 120ms ease-in; }

/* ---------- narrow screens ---------- */

@media (max-width: 52rem) {
    .site-body { flex-direction: column; }

    .site-nav {
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--rule);
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        padding: 0.6rem 1rem;
    }

    .nav-group + .nav-group { margin-top: 0; }
    .site-nav ul { display: flex; gap: 0.25rem; flex-wrap: wrap; }
    .site-main { padding: 1rem; }
    .form-two-column { grid-template-columns: 1fr; }
    .filters { gap: 0.6rem; }
    .field-inline input, .field-inline select { width: 100%; }
    .field-inline { flex: 1 1 100%; }
}

/* ---------- settings screens ---------- */

/* A line under the heading saying what the page is for. Not a hint on a field:
   these pages hold rules somebody has to understand before changing them. */
.page-intro { margin: 0 0 1rem; max-width: 46rem; color: var(--ink-soft); }

.callout-warn { border-color: var(--warn-ink); background: var(--warn-bg); }
.callout-inline { padding: 0.6rem 0.75rem; margin: 0.75rem 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* A heading over one group of rows: a setting area, a tax category, a year. */
.group-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--rule);
}

/* Tabs, used where one page shows several lists (the lookups). Each is a real
   link with its own URL, so they are styled links and not buttons. */
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin: 0 0 1rem; border-bottom: 1px solid var(--rule); }

.tab {
    padding: 0.45rem 0.8rem;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
    text-decoration: none;
    color: var(--ink-soft);
    margin-bottom: -1px;
}

.tab:hover { background: var(--accent-soft); }
.tab.current { background: var(--surface); border-color: var(--rule); color: var(--ink); font-weight: 600; }

/* Counts across the whole system, not the page on screen: how many texts are
   missing a Hindi or a Telugu, and the like. */
.summary-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0 0 1rem; }

.summary-card {
    flex: 1 1 10rem;
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
}

.summary-label { display: block; font-size: 0.82rem; color: var(--muted); }
.summary-value { display: block; font-size: 1.1rem; font-weight: 600; }
.summary-good { color: var(--good-ink); }
.summary-warn { color: var(--warn-ink); }

/* A form that opens inside the table, under the row it belongs to. The existing
   .inline-form is display:inline for a form wrapped around a single button;
   this one lays its fields out, so it is a separate class rather than an
   override that would change the other one. */
.edit-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 0.75rem;
    background: var(--accent-soft);
    border: 1px solid var(--rule);
    border-radius: 6px;
    margin: 0.5rem 0;
}

/* Same, where the fields are better stacked than in a row. */
.edit-form-stacked { align-items: stretch; }
.edit-form .field-grow { flex: 1 1 14rem; }
.edit-form .field-hint, .edit-form .form-head { flex: 1 1 100%; margin: 0; }
.edit-form .form-head { font-weight: 600; }
.inline-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Two fields side by side on a form page, collapsing at narrow widths. */
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 12rem; }

/* A hint on a span rather than a p, which is how the field markup reads. */
span.field-hint { display: block; }

/* Codes and account numbers: monospaced, but not letter-spaced the way
   .input-code is for reading a six-digit authenticator code aloud. */
.input-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

.validation-summary:empty { display: none; }
.validation-summary ul { margin: 0; padding-left: 1.25rem; color: var(--error-ink); }

.page-actions-inline { margin: 0.75rem 0; }

/* The row whose form is open, and the row the form sits in. */
table.list tr.row-editing td { background: var(--accent-soft); }
table.list tr.row-form > td { background: var(--accent-soft); padding: 0; }
table.list tr.row-form .edit-form { margin: 0; border: 0; border-radius: 0; }

/* The one row in force today, in a list where most rows are history. */
table.list tr.row-current td:first-child { box-shadow: inset 3px 0 0 var(--good-ink); }

table.list td.numeric, table.list th.numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* A sub-segment under its parent. */
.cell-indented { padding-left: 1.75rem !important; }

/* The three-language text table: long sentences, so the columns share the width
   evenly and wrap rather than one of them squeezing the others out. */
table.table-text { table-layout: fixed; }
table.table-text .cell-text { white-space: normal; word-break: break-word; }
code.key { font-size: 0.85em; color: var(--ink-soft); }

/* Three stacked boxes, one per language, wide enough to read a sentence in. */
.field-text { flex: 1 1 100%; }
.field-text textarea { width: 100%; font: inherit; resize: vertical; }

@media (max-width: 860px) {
    .edit-form { gap: 0.6rem; }
    .edit-form .field-inline { flex: 1 1 100%; }
    table.table-text { table-layout: auto; }
}

/* ---------- ledger screens ---------- */

/* A heading is a total, not a place money sits, so it reads as a band rather
   than as another row of figures. */
table.list tr.row-heading { background: #f6f6f3; }
table.list tr.row-heading td { border-top: 1px solid var(--rule); }

/* Four accounts per partner, each with a balance: a card rather than a row,
   because a row would squeeze them into something unreadable. */
.card-tile h2 { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.card-tile .table-scroll { margin-top: 0.6rem; }
.card-tile .edit-form { margin-top: 0.75rem; }
.card-footer { margin-top: 0.75rem; }

table.list tfoot td { border-top: 2px solid var(--rule); background: var(--surface); }

/* A disabled field is one an account's history has fixed; it should look
   settled rather than broken. */
.field input:disabled, .field select:disabled {
    background: #f3f3f0;
    color: var(--ink-soft);
    cursor: not-allowed;
}

/* ---------- customer screens ---------- */

/* A tab's content, swapped as a whole so the counts in the tab strip and the
   message area can never disagree with what is below them. */
.tab-panel { padding-top: 0.25rem; }

/* The Details tab: boxes that reflow rather than one long column, because a
   customer has four unrelated groups of facts and no natural reading order. */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; align-items: start; }
.detail-grid section { border: 1px solid var(--rule); border-radius: 6px; padding: 0.9rem; background: var(--surface); }
.detail-grid h2 { margin: 0 0 0.6rem; font-size: 0.95rem; }
.detail-grid dl { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: 0.35rem 0.75rem; margin: 0; }
.detail-grid dt { color: var(--ink-soft); font-size: 0.85rem; }
.detail-grid dd { margin: 0; }

.address, .notes { margin: 0; white-space: pre-line; }
.mono { font-family: ui-monospace, monospace; text-transform: uppercase; }

/* Several small flags in one cell: they wrap rather than widening the column. */
td.flags { white-space: normal; }
td.flags .tag { margin: 0 0.2rem 0.2rem 0; }

/* Switching a customer off is reversible but not casual, so it is folded away
   behind a summary rather than sitting next to Edit. */
.danger-zone { margin-top: 0.9rem; }
.danger-zone summary { cursor: pointer; color: var(--error-ink); font-size: 0.9rem; }
.danger-zone form { margin-top: 0.6rem; }

/* The History tab: one block per version, newest first, each listing only what
   changed. */
.versions { list-style: none; margin: 0; padding: 0; }

.version {
    border-left: 3px solid var(--rule);
    padding: 0.5rem 0 0.5rem 0.8rem;
    margin-bottom: 0.6rem;
}

.version-current { border-left-color: var(--accent); }
.version-head { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.version-when { font-weight: 600; font-size: 0.9rem; }

.changes { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.92rem; }
.changes > li { margin-bottom: 0.2rem; }
.change-label { color: var(--ink-soft); }
.change-before { text-decoration: line-through; color: var(--muted); }
.change-arrow { color: var(--muted); }
.change-after { font-weight: 600; }

/* "Asked for by more than one customer": the count first, because that is what
   decides whether the firm does anything about it. */
.tally { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.tally > li { display: flex; gap: 0.6rem; align-items: baseline; margin-bottom: 0.3rem; }
.tally-count { min-width: 2rem; text-align: right; font-weight: 600; }

@media (max-width: 860px) {
    .detail-grid dl { grid-template-columns: 1fr; gap: 0.1rem; }
    .detail-grid dt { margin-top: 0.4rem; }
}

/* ---------- catalogue and purchases ---------- */

/* A code or a rate reads better in a fixed width, and small: these columns are
   scanned rather than read. */
.mono-small { font-family: ui-monospace, monospace; font-size: 0.85rem; white-space: normal; }

/* The row a price or a cost is actually being charged at today. There is
   usually a past one above it and sometimes a future one below, and which is
   which matters more than anything else on the line. */
table.list tr.row-current { background: var(--accent-soft); }

/* A margin under the threshold goes on the price review list before the
   estimate is sent (design section 6), so it should look like a number somebody
   has to do something about. */
.margin-thin { color: var(--warn-ink); font-weight: 600; }

/* The built invoice line, shown while the template is being typed. Quoted
   rather than styled as a field, because it is what the customer will read. */
.preview-line {
    display: block;
    margin-top: 0.2rem;
    padding: 0.35rem 0.5rem;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    font-size: 0.92rem;
}

/* ---------- the suspension review ---------- */

/* One block per service rather than a table row: the six figures behind a
   decision (what is owed, for how long, what it costs to carry, what the
   customer has been worth, who last spoke to them, what was decided last time)
   have no natural reading order, and cells would put them in one. */
.review-card {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
}

.review-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.review-head h2 { margin: 0; font-size: 1rem; }
.review-head .flags .tag { margin-left: 0.25rem; }
.review-card .facts dd { margin-bottom: 0.35rem; }
.review-card .edit-form { margin-top: 0.8rem; }

/* WP14: the statement link, shown once. Wide and monospace so the whole URL is
   visible and selectable — somebody who cannot see all of it will copy half. */
.link-box {
    width: 100%;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.9rem;
    padding: 0.4rem;
}

/* --------------------------------------------------- WP21, the survey builder */

/* Three languages side by side, stacking on a narrow screen: the point of the
   editor is seeing a translation against the English it came from. */
.language-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.language-column {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.5rem 0.75rem 0.75rem;
    margin: 0;
}

.language-column legend { font-weight: 600; padding: 0 0.3rem; }
.language-column label { display: block; margin-top: 0.5rem; }
.language-column input, .language-column textarea { width: 100%; }

/* A survey link, shown once and never again. Breaks anywhere, because a token
   is 43 characters of base64 and a row that scrolls sideways hides half of it. */
.token {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

/* What a customer typed, in their own script. Left as it was written. */
.customer-words {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: 24rem;
}

.field-wide { flex: 1 1 18rem; }
