.recipient-intake { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,.7fr); gap: 36px; align-items: start; }
.recipient-intake > .panel { border: 0; margin: 0; padding: 0; }
.recipient-intake .import-dropzone { padding: 32px 20px; margin: 0; }
.recipient-intake .import-dropzone h2 { font-size: 16px; margin-bottom: 18px; }
.recipient-intake:has(.has-import-preview) { display: block; }
.page-recipients { padding: 20px 32px; }
.page-recipients > .builder-head { margin-bottom: 12px; }
.page-recipients > .builder-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.page-recipients .detail-meta { margin-top: 0; }
.page-recipients > .builder-steps { margin-bottom: 18px; flex: none; }
.page-recipients:has(#saved-recipients:not([hidden])) { min-height: calc(100dvh - 56px); display: flex; flex-direction: column; }
.page-recipients:has(#saved-recipients:not([hidden])) #campaign-content { display: flex; flex-direction: column; flex: 1; }
#saved-recipients { display: flex; flex-direction: column; flex: 1; padding: 0; margin: 0; border: 0; min-width: 0; }
.recipient-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.recipient-list-heading h2 { margin: 0; font-size: 15px; white-space: nowrap; }
.recipient-list-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }
.recipient-list-tools .search-control { width: 220px; }
.recipient-list-tools .button { flex: none; }
#saved-recipients td { padding: 8px 16px; font-size: 13px; }
.recipient-list-more { display: flex; justify-content: center; padding: 9px 0; background: linear-gradient(#fafafa, #fff); }
.recipient-list-more button { font-size: 12px; text-decoration: none; color: var(--muted); }
.recipient-list-more button:hover { color: var(--ink); }
.recipient-list-more button[aria-expanded="true"] svg { transform: rotate(180deg); }
.recipient-actions { position: sticky; bottom: 0; z-index: 10; margin-top: auto; padding: 12px 0 8px; border: 0; background: var(--paper); }
@media(max-width:700px) {
  .page-recipients { padding: 18px 20px 20px; }
  .recipient-list-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .recipient-list-tools { width: 100%; }
  .recipient-list-tools .search-control { flex: 1; width: 100%; }
  #saved-recipients td { padding: 8px 12px; }
}
/* Review & order fills the remaining viewport: letters on the left, the order beside them. */
.page-review { display: flex; flex-direction: column; height: calc(100dvh - 56px); min-height: 580px; }
.page-review #campaign-content { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 16px; }
.review-order-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 36px; min-height: 0; }
.page-review .review-order-layout { flex: 1; }
.page-review .letter-review { display: flex; flex-direction: column; min-height: 0; }
.page-review .letter-review-surface { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.page-review .letter-review-stage { flex: 1; height: auto; min-height: 0; }
.review-order-layout > .campaign-order-layout { min-width: 0; overflow-y: auto; padding-inline: 5px; margin-inline: -5px; } /* room for the standard focus ring, which scrolling would clip */
.campaign-order-layout .panel { padding: 0; border: 0; box-shadow: none; border-radius: 0; margin: 0 0 24px; }
.campaign-order-layout .order-summary { margin-bottom: 16px; }
.campaign-order-layout .order-summary .panel-title { margin-bottom: 4px; }
.order-lines .order-total { font-size: 15px; font-weight: 600; }
.order-lines .order-total dt { color: var(--ink); }
.order-consent { margin: 16px 0 12px; line-height: 1.55; }
.button.order-pay { width: 100%; justify-content: center; min-height: 44px; font-size: 15px; }
.order-pay + .help-inline { margin: 8px 0 0; text-align: center; }
.campaign-order-layout .detail-list { margin: 20px 0; }
.campaign-order-layout .order-lines { margin: 6px 0 0; }
.order-decision > .panel:first-child > .delivery-schedule { padding: 0; margin-top: 0; border: 0; }
.delivery-schedule { margin: 24px 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.delivery-schedule h3 { margin: 0; font-size: 14px; }
.delivery-schedule .delivery-dates { margin: 9px 0 12px; }
.delivery-schedule .detail-list > div { gap: 12px; }
.delivery-schedule .help-inline { margin: 10px 0; line-height: 1.55; }
.production-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); padding-bottom: 20px; }
.queue-heading { margin: 30px 0 10px; font-size: 15px; }
.queue-heading .count { color: var(--muted); font-weight: 400; }
.queue-footer { margin-top: 24px; }
.queue-overdue { color: var(--warning); }
@media(max-width:650px) { .production-metrics { grid-template-columns: 1fr; gap: 18px; } .production-metrics > div { padding: 0; border: 0; } }
@media(max-width:900px) {
  .page-review { height: auto; min-height: 0; }
  .review-order-layout { grid-template-columns: minmax(0,1fr); gap: 28px; }
  .review-order-layout > .campaign-order-layout { overflow: visible; }
  .page-review .letter-review-stage { flex: none; height: max(320px,calc(100dvh - 390px)); }
}

/* A single header geometry for every campaign step, including the editor. */
.page:has(> .campaign-header) { padding: 20px 32px; max-width: 1440px; }
.campaign-header { flex: none; min-width: 0; }
.campaign-header .builder-head { margin: 0 0 12px; padding: 0; align-items: center; }
.builder-delete { font-size: 12px; color: var(--muted); }
.campaign-header .builder-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.campaign-header .detail-meta { margin: 0; min-height: 24px; }
.campaign-header .builder-steps { display: grid; grid-template-columns: 124px 100px 150px; gap: 0; margin: 0 0 18px; padding: 0; }
.campaign-header .builder-step { padding: 0 1px 15px; font-size: 13px; }
.recipient-intake { display: block; }
.recipient-check { width: 40px; padding-inline: 12px !important; }
.recipient-check input { display: block; width: 15px; height: 15px; accent-color: var(--ink); margin: 0; }
.campaign-context-dialog,.recipient-removal-dialog,.delete-draft-dialog,.terms-dialog { width: min(540px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper); box-shadow: 0 18px 70px #0000001a; }
.campaign-context-dialog::backdrop,.recipient-removal-dialog::backdrop,.delete-draft-dialog::backdrop,.terms-dialog::backdrop { background: #00000030; }
.campaign-context-dialog h2,.recipient-removal-dialog h2,.delete-draft-dialog h2,.terms-dialog h2 { font-size: 20px; margin-bottom: 24px; }
.context-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.context-dialog-heading .letter-review-icon { margin: -2px -6px 0 0; }
.campaign-context-dialog fieldset { margin-bottom: 22px; }
.campaign-context-dialog legend { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.context-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.context-choices label { position: relative; cursor: pointer; }
.context-choices input { position: absolute; opacity: 0; }
.context-choices span { display: grid; place-items: center; min-height: 56px; height: 100%; text-align: center; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 13px; transition: background-color .12s, border-color .12s, color .12s; }
.context-choices label:hover input:not(:checked) + span { border-color: #bdbdbd; }
.context-choices input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.context-choices input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.context-dialog-actions { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.context-dialog-actions .muted { font-size: 12.5px; }
.context-choices.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.context-occasion { margin-bottom: 0; }
.context-hint { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.campaign-context-dialog { width: min(600px, calc(100vw - 32px)); }
.recipient-removal-dialog .button-row,.delete-draft-dialog .button-row,.terms-dialog .button-row { justify-content: flex-end; margin-top: 24px; }
.recipient-removal-dialog [role=alert],.delete-draft-dialog [role=alert] { color: var(--danger); margin: 16px 0 0; }
@media(max-width:700px) {
  .page:has(> .campaign-header) { padding: 18px 20px 20px; }
  .campaign-context-dialog,.recipient-removal-dialog,.delete-draft-dialog,.terms-dialog { padding: 22px; }
  .campaign-header .builder-head { flex-direction: row; align-items: center; }
  .context-choices { gap: 6px; }
  .context-choices span { padding: 8px; font-size: 12px; }
}

/* One focused import surface (7 October, option C): left-aligned like the other steps, a one-line upload area that
   also takes a dropped file, and the other ways as one row of buttons. It leaves room for the "Help shape" card. */
.recipient-intake { display: block; max-width: 680px; margin: clamp(28px,7vh,64px) 0 0; }
body:has(.help-card) .recipient-intake:not(:has(.has-import-preview)) { max-width: min(680px, calc(100% - 360px)); }
.recipient-intake .import-dropzone { min-height: 0; padding: 40px 44px; border: 1px solid var(--line); background: var(--paper); text-align: left; }
.recipient-intake .import-dropzone h2 { font-size: 22px; font-weight: 600; letter-spacing: -.025em; margin: 0 0 10px; }
.recipient-intake .upload-introduction { font-size: 14px; line-height: 1.6; margin: 4px 0 0; }
.intake-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.intake-badge { flex: none; padding: 5px 10px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; }
.intake-drop { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 28px 0 0; padding: 22px 24px; border: 1px dashed #bdbdbd; border-radius: 10px; transition: border-color 120ms ease, background-color 120ms ease; }
.intake-drop.is-dragging { border-color: var(--ink); background: var(--subtle); }
.intake-drop strong { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; font-weight: 600; }
.intake-drop p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.intake-drop p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #c4c4c4; }
.intake-drop p a:hover { text-decoration-color: currentColor; }
.intake-drop .button { flex: none; white-space: nowrap; }
.import-dropzone.intake:focus-within label.button { outline: none; }
.intake-drop:has(input:focus-visible) label.button { outline: 2px solid #7b7b7b; outline-offset: 3px; }
.intake-others { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.intake-others > span:first-child { margin-right: 4px; color: var(--muted); font-size: 13px; }
.intake-others .button { display: inline-flex; align-items: center; gap: 6px; }
.intake-others .is-soon { color: #a3a3a3; border-color: var(--line); background: #fafafa; cursor: default; }
.intake-others .is-soon:hover { color: #a3a3a3; border-color: var(--line); background: #fafafa; }
.intake-others .is-soon small { margin-left: 2px; font-size: 11px; }
.intake-limits { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.recipient-intake:has(.has-import-preview) { max-width: none; margin: 0; }
.recipient-intake .has-import-preview .import-dropzone { display: none; }
@media(max-width:700px) {
  .recipient-intake, body:has(.help-card) .recipient-intake:not(:has(.has-import-preview)) { max-width: none; margin-top: 24px; }
  .recipient-intake .import-dropzone { padding: 24px; }
  .recipient-intake .import-dropzone h2 { font-size: 20px; }
  .intake-drop { flex-wrap: wrap; gap: 16px; padding: 20px; }
}
/* Thank-you page after returning from Stripe. */
.order-confirmation { max-width: 560px; margin: 16px auto; }
.order-confirmation h1 { margin: 0 0 6px; font-size: 26px; }
.order-confirmation > .muted { margin: 0 0 22px; font-size: 14px; }
.order-confirmation .order-lines { margin: 0; }
.order-confirmation .order-included { margin-bottom: 26px; }
.order-confirmation h2 { margin: 0 0 16px; font-size: 16px; }
.order-confirmation .timeline { margin-bottom: 26px; }
.order-confirmation .timeline li { padding-bottom: 18px; }
.order-confirmation .timeline li:last-child { padding-bottom: 0; }
.order-confirmation .timeline li strong { color: var(--ink); }
.order-confirmation .button-row { display: flex; gap: 10px; flex-wrap: wrap; }
/* Order status after payment (reuses the thank-you column and timeline). */
.timeline li.current:after { background: var(--ink); border-color: var(--ink); }
.order-confirmation .order-follow-up { margin: -8px 0 26px; font-size: 13px; }
.order-issues { margin: 0 0 26px; padding: 0; list-style: none; font-size: 13px; }
.order-issues li + li { margin-top: 6px; }
.order-issues strong { font-weight: 500; }
.order-confirmation .order-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: -8px 0 26px; font-size: 13px; }
.page-review .paid-letters { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.paid-letters > .text-link { align-self: flex-start; font-size: 13px; }
.paid-letters #letter-review { flex: 1; }
.order-confirmation.order-status { max-width: 900px; }
.order-status-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 56px; align-items: start; }
.order-status-layout .order-links { margin: 16px 0 24px; }
@media (max-width: 900px) { .order-status-layout { grid-template-columns: minmax(0,1fr); gap: 8px; } }
.order-confirmation .order-cancelled { margin: 0 0 14px; font-size: 14px; line-height: 1.6; }
.order-confirmation .order-help { margin: 0 0 24px; font-size: 13px; color: var(--muted); }
/* Invoice address above Pay (30 September): label with Change, the address below (retail billing-address block). */
.order-invoice { margin: 16px 0 0; font-size: 13px; line-height: 1.5; }
.order-invoice-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.order-invoice-label { font-weight: 500; color: var(--ink); }
.order-invoice .text-link, .order-invoice-actions .text-link { font-size: 13px; }
.order-invoice p { margin: 2px 0 0; color: var(--muted); }
.order-invoice + .order-invoice { margin-top: 12px; }
.order-invoice-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.order-invoice-note .text-link { font-size: 12px; }
/* Envelope, postage and VAT in one small line under the total (7 October). */
.order-included { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.order-invoice-form { margin-top: 16px; }
.order-invoice-form .order-invoice-label { margin: 0 0 12px; font-size: 13px; }
.order-invoice-form .editor-field { font-size: 12px; color: var(--muted); }
.order-invoice-actions { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
/* Operator writing view (30 September): read from the screen while writing letter and envelope by hand. */
.page-writing { display: flex; flex-direction: column; height: calc(100dvh - 56px); min-height: 520px; }
.writing-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.writing-bar > .text-link { font-size: 13px; }
.writing-pager { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.writing-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 40px; flex: 1; min-height: 0; }
.writing-envelope h2 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.writing-address { margin: 0 0 28px; font-size: 17px; line-height: 1.55; }
.writing-return { margin: 0; font-size: 13px; line-height: 1.5; }
.writing-letter { overflow: auto; padding: 34px 40px; border: 1px solid var(--line); border-radius: 8px; font-size: 19px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .page-writing { height: auto; }
  .writing-layout { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .writing-letter { padding: 22px; font-size: 17px; }
}
/* Operator order page: stage actions under the timeline, the batch posting row and per-letter lists. */
.order-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 12px; }
.order-actions + .help-inline { margin: 0 0 26px; }
.order-post { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 8px; }
.order-post .field { margin: 0; width: 170px; }
.order-letter-list { margin: 10px 0 12px; padding: 0; list-style: none; font-size: 13px; }
.order-letter-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.order-letter-list li > span { flex: 1; min-width: 0; }
.order-letter-list .text-link { font-size: 13px; }
.order-confirmation details.order-more { margin: 0 0 24px; font-size: 13px; }
.order-confirmation details.order-more > summary { cursor: pointer; width: fit-content; text-decoration: underline; text-underline-offset: 3px; }
.order-more form { margin-top: 10px; }
.order-more .fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.order-customer { margin: 0 0 18px; font-size: 13px; line-height: 1.6; }
.order-status-layout .order-subheading { margin-top: 26px; }
.order-actions:has(+ h2) { margin-bottom: 28px; }
.writing-progress { margin-right: 10px; color: var(--muted); font-size: 13px; }
.writing-done { font-size: 13px; font-weight: 500; }
.writing-pager [data-writing-next] { display: flex; align-items: center; gap: 14px; }
/* Add by hand and paste rows (6 October): the same dialog look as the campaign questions. */
.entry-dialog { width: min(640px, calc(100vw - 32px)); }
.entry-dialog h2 { margin-bottom: 8px; }
.entry-dialog .context-intro { margin: 0 0 20px; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.entry-wide { grid-column: 1 / -1; }
.entry-pair { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.entry-error { color: var(--danger); font-size: 13px; margin: 4px 0 0; }
.entry-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.entry-actions > div { display: flex; gap: 10px; margin-left: auto; }
.entry-actions .muted { font-size: 13px; }
.entry-paste { display: block; width: 100%; box-sizing: border-box; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; resize: vertical; }
.entry-paste:focus { outline: 2px solid #7b7b7b; outline-offset: 1px; }
.entry-preview { margin-top: 12px; }
.entry-preview .table-wrap { max-height: 220px; overflow: auto; }
.entry-preview table { font-size: 12px; }
.entry-preview th, .entry-preview td { padding: 6px 8px; white-space: nowrap; }
.entry-preview p { margin: 10px 0 0; font-size: 13px; }
@media(max-width:600px) { .entry-grid { grid-template-columns: 1fr; } .context-choices.is-four { grid-template-columns: 1fr 1fr; } }
/* Review & order (6 October): what still stops an order, named and grouped, in place of Pay. */
.order-gate { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.55; }
.order-gate.is-issue { margin: 0 0 14px; padding-top: 0; border-top: 0; }
.order-gate.is-issue > p:first-child { color: var(--danger); margin: 0 0 6px; }
.order-gate ul { margin: 0 0 8px; padding-left: 18px; }
.order-gate p { margin: 0; }
/* Add recipients menu (6 October): lists add to the campaign; "Remove all" comes from selecting everyone. */
.add-menu { position: relative; }
.add-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.add-menu > summary::-webkit-details-marker { display: none; }
.add-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px #0000001f; }
.add-menu-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.add-menu-item:hover, .add-menu-item:focus-visible { background: var(--subtle); outline: none; }
.add-menu-item svg { margin-top: 2px; flex: none; }
.add-menu-item small { display: block; color: var(--muted); font-size: 12px; }
/* Check your list (7 October): problems in red under the person, and plain sentences beside Add, each with its fix. */
.import-confirm-notes { min-width: 0; }
.import-note { margin: 0 0 6px; font-size: 13.5px; line-height: 1.55; }
.import-note:last-child { margin-bottom: 0; }
.import-note .text-link { display: inline; padding: 0; font-size: 13.5px; }
.import-preview-table .import-row-issue, .import-preview-table .import-row-issue:hover { background: transparent; }
.import-preview-table .import-row-issue td { border-bottom: 0; }
.import-preview-table .import-issue-line td { max-width: none; padding-top: 0; color: var(--danger); font-size: 12.5px; }
.import-preview-table .import-issue-line .muted { margin-right: 4px; }
/* The list (7 October): room left beside the count, Edit at the end of each row, the list's own columns. */
.recipient-room { margin-left: 8px; color: var(--muted); font-size: 14px; font-weight: 400; }
.recipient-edit-cell { width: 1%; text-align: right; white-space: nowrap; }
.recipient-edit { font-size: 13px; color: var(--muted); opacity: 0; }
tr:hover .recipient-edit, .recipient-edit:focus-visible { opacity: 1; }
@media (hover: none) { .recipient-edit { opacity: 1; } }
.recipient-custom { color: var(--ink); }
.entry-remove { color: var(--muted); font-size: 13px; }
