@font-face {
  font-family: "Cedarville Cursive";
  src: url("/fonts/cedarville-cursive.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "La Belle Aurore";
  src: url("/fonts/la-belle-aurore.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Kalam";
  src: url("/fonts/kalam-light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/fonts/libre-baskerville-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color-scheme: light;
  color: var(--ink);
  background: #ffffff;
  --ink: #111111;
  --muted: #525252;
  --line: #e5e5e5;
  --paper: #ffffff;
  --ground: #ffffff;
  --panel: #ffffff;
  --subtle: #f6f6f6;
  /* Status palette: confirmed outcome / needs a decision / blocked by an error. */
  --success: #42664d;
  --warning: #806324;
  --danger: #a04141;
  --success-soft: #f1f6f2;
  --warning-soft: #faf7f0;
  --danger-soft: #fcf4f4;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-underline-offset: 3px; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.3; font-weight: 600; color: var(--ink); }
h1 { font-size: 24px; letter-spacing: -.025em; margin-bottom: 8px; }
h2 { font-size: 16px; letter-spacing: -.012em; margin-bottom: 10px; }
h3 { font-size: 15px; letter-spacing: -.01em; margin-bottom: 10px; }
p { margin-bottom: 16px; }
strong { font-weight: 600; }
small, .small { font-size: 12px; }
svg { flex: none; vertical-align: middle; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
::selection { background: #e5e5e5; }
.wordmark { font-family: "Libre Baskerville", Georgia, serif; font-size: 29px; font-weight: 400; letter-spacing: -.05em; line-height: 1.1; text-decoration: none; color: var(--ink); }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.nowrap { white-space: nowrap; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.count { color: var(--muted); font-size: 12px; font-weight: 400; }
.loading-screen { min-height: 100vh; display: grid; place-content: center; gap: 20px; text-align: center; background: #ffffff; }
.loading-screen p, .loading-inline { color: var(--muted); }
.loading-inline { padding-block: 60px; text-align: center; }
.noscript { padding: 24px; }
.skip-link { position: fixed; top: -90px; left: 16px; z-index: 99; padding: 10px 16px; background: #232323; color: #ffffff; border-radius: 7px; }
.skip-link:focus { top: 12px; }

/* Persistent app navigation and workspace identity. */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; display: flex; flex-direction: column; background: #fafafa; border-right: 1px solid #e5e5e5; padding: 0 12px 14px; z-index: 30; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; height: 56px; min-height: 56px; padding: 0 18px; margin: 0 -12px; border-bottom: 1px solid #e8e8e8; }
.sidebar-brand .wordmark { font-size: 24px; }
.sidebar > .wordmark { margin: 0 12px 29px; align-self: flex-start; }
.workspace-switch { display: flex; align-items: center; gap: 10px; min-width: 0; border: 1px solid var(--line); background: #ffffff; border-radius: 8px; padding: 11px 12px; margin: 0 0 27px; color: var(--ink); font-size: 13px; }
.workspace-switch > svg { color: var(--muted); }
.workspace-switch > div { min-width: 0; }
.workspace-switch strong { display: block; font-size: 13px; font-weight: 550; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-switch small { display: block; font-size: 11px; color: var(--muted); }
.workspace-avatar { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: #eeeeee; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.workspace-meta { display: flex; min-width: 0; flex-direction: column; }
.workspace-label { color: var(--muted); font-size: 11px; }
.workspace-name { font-size: 13px; color: var(--ink); font-weight: 550; }
.nav-list { display: grid; gap: 3px; margin-top: 20px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 10px; border: 0; border-radius: 6px; color: #414141; font-size: 14px; text-decoration: none; font-weight: 400; line-height: 1.5; }
.nav-item svg { width: 17px; height: 17px; color: #616161; }
.nav-item:hover { background: #f0f0f0; color: var(--ink); }
.nav-item.active { background: #eaeaea; color: var(--ink); font-weight: 500; }
.nav-item.active svg { color: var(--ink); }
.nav-item .count { margin-left: auto; }
.nav-section-label { color: var(--muted); font-size: 11px; font-weight: 500; padding: 0 13px; margin: 18px 0 8px; }
.sidebar-bottom { margin-top: auto; padding: 24px 6px 0; }
.sidebar-note { font-size: 12px; line-height: 1.7; color: var(--muted); padding: 15px 0; border-top: 1px solid var(--line); }
.sidebar-note strong { color: var(--muted); font-weight: 500; display: block; margin-bottom: 4px; }
.sidebar-note p:last-child { margin-bottom: 0; }
.dev-label { color: var(--muted); font-size: 11px; line-height: 1.6; display: inline-block; }
.main-shell { grid-column: 2; min-width: 0; }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; border-bottom: 1px solid #e8e8e8; background: #ffffff; position: sticky; top: 0; z-index: 20; }
.topbar-title { color: var(--ink); font-size: 14px; font-weight: 500; min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar-title a { text-decoration: none; color: var(--muted); font-weight: 400; }
.topbar-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 18px; flex: none; }
.topbar-actions > .pill { font-size: 11px; }
.topbar-trail { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.topbar-trail a { text-decoration: none; }
.account-menu { position: relative; min-width: 0; }
.account-menu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; border-radius: 7px; padding: 5px; color: var(--muted); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover { background: #f6f6f6; }
.account-name { font-size: 12px; max-width: 170px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #efefef; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.account-popover { position: absolute; right: 0; top: calc(100% + 12px); width: 270px; padding: 20px; background: #ffffff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 12px 32px #1c1c1c16; z-index: 50; overflow-wrap: anywhere; }
.account-popover > strong, .account-popover > span { display: block; }
.account-popover > span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.account-popover .operator-label { margin-top: 12px; color: var(--ink); }
.account-popover > .account-email { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-actions { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.account-item { display: block; width: calc(100% + 16px); margin: 0 -8px; padding: 8px; border: 0; border-radius: 6px; background: none; text-align: left; color: var(--ink); font-size: 13px; text-decoration: none; }
.account-item:hover { background: #f6f6f6; }
.account-menu[open] summary { background: #f6f6f6; }
.account-menu[open] summary:focus-visible { outline: none; }
.page { width: 100%; max-width: 1440px; padding: 32px 32px 56px; margin: 0 auto; min-width: 0; }
.page-head, .builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head > div, .builder-head > div { min-width: 0; }
.page-head h1, .builder-head h1 { overflow-wrap: anywhere; }
.page-head p, .builder-head p { margin: 0; font-size: 14px; color: var(--muted); max-width: 710px; }
.page-head > .button, .builder-head > .button { flex: none; }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-bottom: 18px; text-decoration: none; }
.back-link svg { transform: rotate(180deg); }
.back-link:hover { color: var(--ink); }

/* Shared controls. */
input, textarea, select { accent-color: var(--ink); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--ink); border-radius: 6px; padding: 7px 12px; min-height: 34px; color: var(--paper); background: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; text-decoration: none; transition: background .15s, border-color .15s; box-shadow: none; }
.button:hover:not(:disabled) { background: #3d3d3d; border-color: #3d3d3d; }
.button.secondary { color: #252525; background: #ffffff; border-color: #dedede; box-shadow: 0 1px 2px #00000005; }
.button.secondary:hover:not(:disabled) { background: #f7f7f7; border-color: #c4c4c4; }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.button.quiet:hover:not(:disabled) { border-color: transparent; background: #f2f2f2; color: var(--ink); }
.button.small { padding: 6px 10px; min-height: 32px; font-size: 13px; }
.button.danger { color: var(--danger); border-color: #d2d2d2; background: #ffffff; }
.button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.text-link { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-decoration-color: #c4c4c4; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.text-link:hover { text-decoration-color: currentColor; }
/* Links (7 October, Florian chose A, as in Attio and HubSpot): actions such as Change, Cancel or Edit letter are
   buttons and carry no underline until hovered; a link or action inside a sentence keeps a light underline. */
button.text-link { text-decoration: none; font-weight: 500; }
button.text-link:hover { text-decoration: underline; text-decoration-color: #9a9a9a; }
:is(p, li, .settings-note, .settings-value, .help-inline, .import-note) > button.text-link { text-decoration: underline; text-decoration-color: #c4c4c4; font-weight: inherit; }
:is(p, li, .settings-note, .settings-value, .help-inline, .import-note) > button.text-link:hover { text-decoration-color: currentColor; }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid #dedede; border-radius: 6px; background: #ffffff; color: var(--muted); }
.icon-button:hover { background: #f5f5f5; color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 7px; border-radius: 5px; background: #f3f3f3; font-size: 12px; color: #454545; white-space: nowrap; line-height: 1.5; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #9c9c9c; flex: none; }
.pill.attention { background: var(--warning-soft); color: var(--warning); }
.pill.attention::before { background: var(--warning); }
.pill.good { background: var(--success-soft); color: var(--success); }
.pill.good::before { background: var(--success); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.bad::before { background: var(--danger); }

/* Dashboard and campaign inventory. */
.dashboard-main, .dashboard-aside { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 18px; }
.section-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-heading a:not(.button) { font-size: 12px; color: var(--muted); text-decoration: none; }
.section-heading a:not(.button):hover { color: var(--ink); }
.progress-track { height: 5px; background: #efefef; border-radius: 5px; overflow: hidden; margin: 11px 0 14px; }
.progress-fill { height: 100%; background: #7d7d7d; border-radius: inherit; max-width: 100%; }
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0; padding: 14px 24px; border-bottom: 1px solid #e8e8e8; }
.list-search { display: flex; align-items: center; gap: 9px; min-width: 0; }
.view-select { position: relative; display: flex; align-items: center; }
.view-select select { appearance: none; border: 1px solid #dedede; border-radius: 6px; padding: 6px 30px 6px 11px; color: #262626; background: #ffffff; font-size: 13px; cursor: pointer; min-height: 32px; }
.view-select > svg { position: absolute; right: 10px; pointer-events: none; color: var(--muted); }
.search-control { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #ffffff; border: 1px solid #dedede; border-radius: 6px; color: var(--muted); min-width: 0; width: 230px; min-height: 32px; }
.search-control:focus-within { border-color: #acacac; box-shadow: 0 0 0 3px #4b4b4b10; }
.search-control input { min-width: 0; width: 100%; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 13px; min-height: 22px; }
.search-control input::placeholder { color: var(--muted); }
.campaign-views { display: flex; gap: 25px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.view-tab { display: flex; align-items: center; gap: 8px; border: 0; border-bottom: 2px solid transparent; padding: 0 0 12px; background: transparent; color: var(--muted); white-space: nowrap; font-size: 13px; }
.view-tab.active, .view-tab[aria-pressed="true"] { color: var(--ink); border-color: #363636; }
.view-tab > span { font-size: 11px; color: var(--muted); }
.table-wrap { overflow: auto; border: 1px solid #e5e5e5; border-radius: 6px; background: #ffffff; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
th { color: #5d5d5d; font-weight: 400; font-size: 12px; background: #fafafa; white-space: nowrap; padding: 10px 16px; border-bottom: 1px solid #e8e8e8; }
td { padding: 13px 16px; border-bottom: 1px solid #eeeeee; vertical-align: middle; color: #363636; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafafa; }
.campaign-title { display: block; font-size: 13px; font-weight: 500; line-height: 1.5; text-decoration: none; color: var(--ink); }
.campaign-title:hover { text-decoration: underline; }
.table-subtext { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.table-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { text-align: center; padding: 36px; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.empty-state { padding: 72px 24px; border: 0; border-radius: 0; text-align: center; background: #ffffff; }
.empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 0; color: #777777; background: transparent; margin-bottom: 17px; }
.empty-state h2 { font-size: 19px; }
.empty-state p { max-width: 430px; margin: 0 auto 23px; color: var(--muted); font-size: 14px; }

/* Guided campaign builder and letter templates. */
.builder-steps { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 0 0 28px; overflow-x: auto; }
.builder-step { display: flex; align-items: center; gap: 9px; border: 0; border-bottom: 2px solid transparent; background: none; padding: 0 1px 15px; color: var(--muted); font-size: 13px; white-space: nowrap; font-weight: 450; }
.builder-step.active { color: var(--ink); border-color: #393939; font-weight: 550; }
.step-number { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: #ffffff; color: var(--muted); border-radius: 50%; font-size: 11px; flex: none; }
.builder-step.active .step-number { color: #ffffff; background: #393939; border-color: #393939; }
.builder-layout { display: grid; grid-template-columns: minmax(340px, .95fr) minmax(370px, 1.05fr); gap: 27px; align-items: start; }
.builder-editor, .builder-preview { min-width: 0; }
.builder-editor { background: #ffffff; border: 0; border-radius: 0; padding: 0 26px 0 0; }
.builder-editor .panel { border: 0; padding: 0; margin-bottom: 28px; border-radius: 0; box-shadow: none; }
.builder-preview { position: sticky; top: 87px; }
.form-section { margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; padding-bottom: 0; }
.form-section > h3 { font-size: 14px; margin-bottom: 16px; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.template-card { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; text-align: left; cursor: pointer; color: var(--ink); box-shadow: 0 1px 2px #1b1b1b04; }
.template-card:hover { border-color: #b6b6b6; box-shadow: 0 3px 12px #32323214; }
.template-card.selected { border-color: #6a6a6a; box-shadow: 0 0 0 1px #6a6a6a; }
.template-info { display: block; padding: 15px; }
.template-name { display: block; font-size: 14px; font-weight: 550; color: var(--ink); margin-bottom: 4px; }
.template-description { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; }
.template-check { position: absolute; top: 11px; right: 11px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #3a3a3a; border: 2px solid #ffffff; color: #ffffff; box-shadow: 0 1px 5px #2a2a2a20; }
.template-check svg { width: 12px; height: 12px; }
.builder-editor .template-grid { gap: 11px; }
.builder-editor .template-info { padding: 11px 10px 13px; }
.builder-editor .template-name { font-size: 12px; margin-bottom: 3px; }
.builder-editor .template-description { font-size: 11px; }
.builder-editor .template-check { width: 19px; height: 19px; top: 7px; right: 7px; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 13px; font-size: 13px; color: var(--muted); }
.preview-toolbar strong, .preview-toolbar h3 { font-size: 13px; font-weight: 550; color: var(--muted); margin: 0; }
.preview-toolbar > span { font-size: 12px; }
.recipient-switcher { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; }
.recipient-switcher select { min-width: 0; max-width: 220px; border: 1px solid var(--line); background: #ffffff; padding: 7px 28px 7px 10px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.preview-stage { display: flex; flex-direction: column; align-items: center; background: #f2f2f2; border: 1px solid var(--line); border-radius: 10px; padding: 27px; }
.preview-caption { font-size: 12px; text-align: center; color: var(--muted); margin: 13px 0 0; line-height: 1.6; }
.preview-warning { background: #faf7ef; border: 1px solid #ece3cc; color: #867141; padding: 11px 14px; margin-top: 13px; border-radius: 7px; font-size: 12px; line-height: 1.6; }
.builder-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; border-top: 1px solid var(--line); margin-top: 26px; padding-top: 21px; }
.builder-actions > .button:last-child { margin-left: auto; }
.variable-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -5px 0 18px; }
.variable-chip { border: 1px solid var(--line); border-radius: 5px; background: #f8f8f8; color: var(--muted); font-size: 11px; padding: 4px 7px; line-height: 1.4; }
.variable-chip:hover { background: #efefef; border-color: #cacaca; color: var(--muted); }
.import-dropzone { border: 1px dashed #d5d5d5; background: #fcfcfc; border-radius: 8px; padding: 25px 20px; text-align: center; color: var(--muted); margin-bottom: 22px; }
.import-dropzone > svg { color: var(--muted); display: block; margin: 0 auto 12px; }
.import-dropzone strong { display: block; color: var(--muted); font-size: 14px; margin-bottom: 5px; }
.import-dropzone p { font-size: 12px; margin-bottom: 13px; }
.import-dropzone input[type="file"] { max-width: 100%; font-size: 12px; color: var(--muted); }
.match-table { width: 100%; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; font-size: 12px; }
.match-table th, .match-table td { padding: 11px 12px; font-size: 12px; }
.match-table select { width: 100%; min-width: 110px; border: 1px solid var(--line); background: #ffffff; padding: 7px 9px; color: var(--muted); border-radius: 6px; font-size: 12px; }
.match-badge { display: inline-flex; align-items: center; gap: 5px; background: #f0f7f3; color: #5d8168; border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; font-size: 11px; }
.mapping-sample { color: var(--muted); font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; max-width: 180px; }

/* Forms, approval, payments and operations retain their existing interactions. */
.tabbar { display: flex; gap: 28px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tab { white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 0 0 14px; color: var(--muted); font-size: 13px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--ink); font-weight: 550; }
.tab-index { font-size: 11px; color: var(--muted); margin-right: 5px; }
.detail-meta { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 13px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 27px; align-items: start; }
.panel { background: #ffffff; border: 0; border-bottom: 1px solid #e5e5e5; border-radius: 0; padding: 0 0 28px; margin-bottom: 28px; }
.panel:last-child { margin-bottom: 0; }
.panel-title { margin-bottom: 24px; }
.panel-title h2 { font-size: 17px; margin-bottom: 7px; }
.panel-title p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; max-width: 620px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 22px; min-width: 0; }
.field label, .field > span { color: #333333; font-size: 13px; font-weight: 500; }
.field input, .field textarea, .field select, .inline-select { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: #ffffff; color: var(--ink); font-size: 14px; line-height: 1.5; border-color: #dedede; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: #9e9e9e; box-shadow: 0 0 0 3px #6060600a; }
.field textarea { resize: vertical; min-height: 120px; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.field input[readonly], .field input:disabled, .field textarea:disabled, .field select:disabled { background: #f8f8f8; color: var(--muted); }
.field input[type="file"] { font-size: 12px; padding: 8px; }
.field input[type="file"]::file-selector-button { font: inherit; border: 0; border-radius: 5px; background: #f3f3f3; padding: 6px 10px; margin-right: 10px; color: var(--muted); cursor: pointer; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.fields.thirds { grid-template-columns: repeat(3, 1fr); }
.span-all { grid-column: 1 / -1; }
.radio-options { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 23px; }
.radio-card { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 175px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; background: #ffffff; }
.radio-card:has(input:checked) { border-color: #a3a3a3; background: #fafafa; }
.radio-card input { margin-top: 4px; accent-color: #3a3a3a; }
.radio-card strong { display: block; font-size: 13px; }
.radio-card small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.checkbox-line { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; margin: 23px 0; color: var(--muted); }
.checkbox-line input, td input[type="checkbox"], th input[type="checkbox"] { flex: none; accent-color: #3a3a3a; width: 16px; height: 16px; margin-top: 3px; }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 23px; border-top: 1px solid var(--line); }
.form-footer p { font-size: 12px; color: var(--muted); max-width: 430px; margin: 0; }
.form-footer .button { flex: none; }
.aside-note { color: var(--muted); font-size: 13px; border-left: 1px solid var(--line); padding: 2px 0 2px 22px; }
.aside-note h3 { font-size: 14px; color: var(--muted); }
.aside-note ul { padding-left: 16px; }
.aside-note li + li { margin-top: 12px; }
.aside-note p:last-child { margin-bottom: 0; }
.detail-list { margin: 0; }
.detail-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 22px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 0; }
.toolbar .field { max-width: 320px; width: 100%; margin: 0; }
.payment-state { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.payment-state strong { display: block; font-size: 15px; margin-bottom: 5px; }
.payment-state p { color: var(--muted); margin: 0; font-size: 13px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #838383; margin-top: 9px; flex: none; }
/* Errors are a plain line of text in the danger colour, not a boxed notice (Florian, 30 September). */
.error-box { margin: 14px 0; color: var(--danger); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.error-box:focus { outline: none; }
.error-box p:last-child, .error-box ul:last-child { margin-bottom: 0; }
.error-box ul { padding-left: 19px; }
.error-box li + li { margin-top: 5px; }
.feedback { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: min(600px, calc(100% - 32px)); padding: 14px 20px; border-radius: 8px; background: #2b2b2b; color: #ffffff; box-shadow: 0 6px 24px #20202020; z-index: 80; font-size: 13px; }
.feedback[data-kind="error"] { background: var(--paper); color: var(--danger); border: 1px solid var(--line); border-left: 2px solid var(--danger); }
.mapping-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 15px; margin-top: 21px; }
.mapping-grid .field { margin-bottom: 14px; }
.letter-preview { background: #ffffff; color: var(--ink); min-height: 445px; padding: 38px 32px; border: 1px solid var(--line); box-shadow: 0 3px 14px #00000008; font-size: 12px; line-height: 1.8; }
.letter-preview .sender-line { font-size: 12px; color: var(--muted); border-bottom: 1px solid #dfdfdf; padding-bottom: 6px; margin-bottom: 15px; }
.letter-preview .address { font-size: 12px; line-height: 1.6; margin-bottom: 40px; }
.letter-preview .letter-body { font-family: Georgia, serif; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.letter-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 390px); gap: 26px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 24px 25px; color: var(--muted); font-size: 13px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:not(:last-child):before { position: absolute; content: ""; width: 1px; background: #e8e8e8; left: 5px; top: 13px; bottom: 3px; }
.timeline li:after { position: absolute; content: ""; border: 1px solid #d2d2d2; background: #ffffff; width: 8px; height: 8px; left: 1px; top: 5px; border-radius: 50%; }
.timeline li.done { color: var(--muted); }
.timeline li.done:after { background: #7f7f7f; border-color: #7f7f7f; }
.timeline li strong { display: block; font-weight: 500; margin-bottom: 3px; }
.timeline li small { font-size: 12px; color: var(--muted); }
.dispatch-grid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 15px; }
.help-inline { font-size: 12px; color: var(--muted); margin: 12px 0; }
.upload-summary { font-size: 13px; display: flex; gap: 9px; align-items: center; color: var(--muted); }

/* Authentication stays intentionally quieter than the working app. */
.auth-page { max-width: 1100px; margin: 0 auto; padding: 35px 48px 60px; min-height: 100vh; background: #fff; }
.auth-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; padding: 9vh 0 20px; }
.auth-copy { max-width: 380px; }
.auth-copy h1 { font-family: "Libre Baskerville", Georgia, serif; font-weight: 400; font-size: 29px; letter-spacing: -.045em; margin-bottom: 28px; }
.auth-copy > .muted { margin: -14px 0 24px; font-size: 14px; }
.auth-switch { margin: 24px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-switch .text-link { color: var(--ink); }
.auth-mfa-steps { margin: 0 0 22px; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.auth-mfa-steps li { margin-bottom: 12px; }
.auth-qr { display: block; margin: 12px 0 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.auth-mfa-steps small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.auth-submit { width: 100%; margin-top: 6px; min-height: 41px; }
.auth-forgot { margin: -6px 0 16px; text-align: right; font-size: 13px; }
.auth-google { width: 100%; min-height: 41px; gap: 10px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.auth-paper { color: var(--ink); border: 1px solid var(--line); border-radius: 9px; max-width: 420px; padding: 34px 31px; }
.auth-paper .eyebrow { color: var(--muted); margin-bottom: 12px; }
.auth-paper h2 { font-family: "Libre Baskerville", Georgia, serif; font-size: 23px; font-weight: 400; max-width: 270px; line-height: 1.6; letter-spacing: -.035em; margin-bottom: 25px; }
.auth-paper ol { padding: 0; margin: 0; list-style: none; counter-reset: journey; }
.auth-paper li { position: relative; padding: 0 0 20px 29px; counter-increment: journey; font-size: 14px; line-height: 1.6; }
.auth-paper li:before { position: absolute; left: 0; top: 2px; content: counter(journey, decimal-leading-zero); color: var(--muted); font-size: 11px; font-weight: 500; }
.auth-paper strong { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 550; }
.auth-paper li span { color: var(--muted); font-size: 13px; }
.auth-paper .paper-footer { border-top: 1px solid var(--line); padding-top: 15px; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.dev-help { margin-top: 23px; padding: 12px 14px; border: 1px dashed #dfdfdf; border-radius: 7px; font-size: 13px; color: var(--muted); }
.dev-help summary { cursor: pointer; color: var(--muted); }
.dev-help p { margin: 12px 0 0; }
.dev-help code { color: var(--muted); overflow-wrap: anywhere; }


/* Exact markup refinements. */
.workspace-switch > span:not(.workspace-avatar) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .account-name { flex: 1; min-width: 0; font-size: 12px; }
.sidebar .account-menu summary { padding-inline: 0; }
.sidebar .account-popover { top: auto; bottom: calc(100% + 12px); left: 0; right: auto; width: 192px; padding: 16px; }
.section-heading > div > p { margin: 5px 0 0; }
.template-check:empty { display: none; }
.template-info > .template-description { margin: 0 0 8px; }
.template-info > .small { display: block; font-size: 12px; }
.sender-details > summary { cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 550; padding: 2px 0; }
.sender-details[open] > summary { margin-bottom: 15px; }
.import-dropzone { position: relative; }
.import-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.import-dropzone:focus-within label.button { outline: 2px solid #7b7b7b; outline-offset: 3px; }
.import-dropzone .text-link { display: block; margin: 15px auto 0; width: fit-content; font-size: 12px; }
.recipient-switcher { margin-bottom: 15px; }
.preview-toolbar h2 { font-size: 14px; margin: 0; font-weight: 550; }
.upload-summary { margin: 18px 0; }
.upload-summary > div { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.missing-variable { color: #866922; background: #fff3cf; border-radius: 2px; padding: 0 2px; font-style: normal; }

@media (min-width: 1650px) {
  .page { padding-inline: 42px; }
  .topbar { padding-inline: 42px; }
  .builder-layout { gap: 34px; }
}
@media (max-width: 1250px) {
  .page { padding: 28px; }
  .topbar { padding-inline: 28px; }
  .builder-layout { grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); gap: 22px; }
  .builder-editor { padding: 21px; }
  .preview-stage { padding: 20px; }
  .content-grid { grid-template-columns: minmax(0, 1fr) 225px; gap: 23px; }
  .letter-layout { grid-template-columns: 1fr; }
  .letter-preview { max-width: 450px; margin: auto; }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .builder-layout { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
  .builder-preview { position: static; }
  .content-grid { grid-template-columns: 1fr; }
  .aside-note { padding: 21px; border: 1px solid var(--line); background: #fafafa; border-radius: 8px; }
  .dispatch-grid { grid-template-columns: 1fr 1fr; }
  .dispatch-grid > .field:last-child { grid-column: 1/-1; }
  .mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .topbar-actions { gap: 10px; }
  .account-name { display: none; }
  .page { padding: 25px; }
  .topbar { padding-inline: 25px; }
  .page-head, .builder-head { gap: 18px; }
  .page-head h1, .builder-head h1 { font-size: 25px; }
  .page-head p, .builder-head p { font-size: 13px; }
  .template-grid { gap: 12px; }
  .template-info { padding: 12px; }
  .auth-page { padding: 30px; }
  .auth-layout { gap: 35px; }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .main-shell { display: block; }
  .topbar { height: 57px; padding: 0 20px; gap: 12px; position: static; }
  .topbar-title { font-size: 13px; }
  .topbar-actions > .pill { display: none; }
  .account-popover { width: 250px; }
  .page { padding: 25px 20px 44px; }
  .page-head, .builder-head { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 24px; }
  .page-head h1, .builder-head h1 { font-size: 25px; }
  .dashboard-section, .dashboard-aside .dashboard-section { padding: 18px; }
  .section-heading { gap: 12px; }
  .section-heading h2 { font-size: 15px; }
  .list-tools { gap: 12px; flex-wrap: wrap; }
  .list-search { flex: 1; }
  .search-control { width: 100%; min-width: 150px; }
  .view-select select { font-size: 12px; }
  .campaign-views { gap: 22px; }
  .view-tab { font-size: 12px; }
  th, td { padding: 12px; }
  .pagination { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .button { min-height: 40px; }
  .button.small { min-height: 35px; }
  .builder-steps { gap: 20px; margin-bottom: 23px; }
  .builder-step { font-size: 12px; gap: 7px; }
  .step-number { width: 23px; height: 23px; }
  .builder-editor { padding: 20px; }
  .builder-editor .template-grid { gap: 8px; }
  .builder-editor .template-info { padding: 10px 8px; }
  .builder-editor .template-name { font-size: 12px; }
  .builder-editor .template-description { font-size: 11px; }
  .preview-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .recipient-switcher { width: 100%; }
  .recipient-switcher select { max-width: none; flex: 1; }
  .preview-stage { padding: 18px; }
  .builder-actions { gap: 10px; flex-wrap: wrap; }
  .builder-actions .button { font-size: 12px; padding-inline: 12px; }
  .template-grid { grid-template-columns: 1fr; }
  .builder-editor .template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel { padding: 20px; }
  .fields, .fields.thirds { grid-template-columns: 1fr; }
  .field input, .field select, .field textarea { font-size: 14px; min-height: 43px; }
  .field textarea { min-height: 130px; }
  .field label { font-size: 13px; }
  .tabbar { gap: 24px; }
  .tab { font-size: 13px; }
  .tab-index { display: none; }
  .form-footer { align-items: flex-start; flex-direction: column; gap: 16px; }
  .form-footer .button { width: 100%; }
  .dispatch-grid { grid-template-columns: 1fr; }
  .dispatch-grid > .field:last-child { grid-column: auto; }
  .mapping-grid { gap: 0 12px; }
  .mapping-grid .field select { font-size: 12px; }
  .toolbar { align-items: flex-start; flex-wrap: wrap; }
  .toolbar .field { max-width: 100%; }
  .table-wrap { margin-left: -1px; margin-right: -1px; }
  .match-table th, .match-table td { padding: 9px; font-size: 11px; }
  .match-table select { min-width: 95px; font-size: 12px; }
  .empty-state { padding: 36px 20px; }
  .letter-preview { padding: 30px 25px; }
  .auth-page { padding: 27px 24px; }
  .auth-layout { display: block; padding: 40px 0 0; }
  .auth-copy { max-width: 400px; margin: auto; }
  .auth-paper { display: none; }
  .auth-copy h1 { font-size: 27px; }
  .auth-submit { min-height: 42px; }
}
@media (max-width: 380px) {
  .topbar { padding-inline: 17px; }
  .page { padding-inline: 16px; }
  .builder-editor { padding: 16px; }
  .builder-editor .template-description { font-size: 10px; }
  .mapping-grid { grid-template-columns: 1fr; }
  .preview-stage { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
.builder-step:disabled { opacity: .55; }
.builder-step.active:disabled { opacity: 1; }

/* Workspace composition: quiet navigation, an open summary, and direct list actions. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.mobile-environment { display: none; }
.workspace-context { margin: 22px 10px 12px; color: #616161; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-mode { margin-bottom: 14px; }
.sidebar-mode .dev-label { font-size: 10px; line-height: 1.5; }
.breadcrumb-separator { color: #b0b0b0; font-weight: 400; }
.page-overview { max-width: 1250px; padding: 32px 48px 56px; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.overview-heading h1 { margin: 0; font-size: 25px; font-weight: 600; }
.overview-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,220px)); margin: 0 0 32px; padding: 0 0 24px; border-bottom: 1px solid #e8e8e8; }
.overview-metrics > div { padding: 0 24px; border-left: 1px solid #e8e8e8; }
.overview-metrics > div:first-child { padding-left: 0; border-left: 0; }
.overview-metrics dt { margin-bottom: 9px; color: #525252; font-size: 13px; }
.overview-metrics dd { margin: 0; font-size: 29px; font-weight: 500; line-height: 1.2; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.overview-campaigns { margin-top: 0; }
.overview-table { border: 0; border-radius: 0; }
.overview-table table { min-width: 690px; }
.overview-table th { background: #ffffff; padding: 11px 10px; font-size: 12px; }
.overview-table td { padding: 14px 10px; }
.overview-table th:first-child, .overview-table td:first-child { padding-left: 0; }
.overview-table th:last-child, .overview-table td:last-child { padding-right: 0; }
.overview-table th:first-child { width: 43%; }
.overview-table .campaign-title { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.mobile-campaign-meta { display: none; }
.table-action { white-space: nowrap; text-align: right; }
.table-action a { display: inline-flex; align-items: center; gap: 7px; color: #424242; font-size: 12px; text-decoration: none; }
.table-action a:hover { color: #111111; text-decoration: underline; text-underline-offset: 3px; }
.subtle-link { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #525252; text-decoration: none; }
.subtle-link:hover { color: #111111; }
.page-records { max-width: none; padding: 0; }
.page-records .pagination { padding: 0 24px 24px; }
.page-records .list-notice { padding-inline: 24px; }
.page-records td:first-child, .page-records th:first-child { padding-left: 24px; }
.page-records td:last-child, .page-records th:last-child { padding-right: 24px; }
.page-records .table-subtext { font-size: 11px; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 208px minmax(0,1fr); }
  .sidebar { width: 208px; }
  .page-overview { padding-inline: 32px; }
  .overview-metrics > div { padding-inline: 16px; }
  .overview-metrics dt { font-size: 12px; }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .sidebar { position: relative; width: auto; display: grid; grid-template-columns: minmax(0,1fr) 32px; gap: 10px; padding: 0 18px 12px; border-right: 0; border-bottom: 1px solid #e5e5e5; overflow: visible; }
  .sidebar-brand { grid-column: 1/-1; height: 52px; min-height: 52px; margin: 0; padding: 0; border: 0; }
  .sidebar-brand .wordmark { font-size: 23px; }
  .workspace-context, .sidebar-mode { display: none; }
  .mobile-environment { display: block; }
  .mobile-environment .dev-label { font-size: 10px; }
  .nav-list { grid-column: 1; display: flex; gap: 3px; min-width: 0; }
  .nav-item { font-size: 12px; padding: 7px 8px; min-height: 34px; gap: 6px; white-space: nowrap; }
  .nav-item svg { width: 15px; height: 15px; }
  .sidebar-bottom { margin: 0; padding: 0; align-self: center; }
  .sidebar .account-menu summary { padding: 0; }
  .sidebar .account-menu summary > svg, .sidebar .account-name { display: none; }
  .sidebar .account-avatar { width: 30px; height: 30px; }
  .sidebar .account-popover { top: calc(100% + 12px); bottom: auto; left: auto; right: 0; width: min(270px, calc(100vw - 36px)); }
  .topbar { height: 52px; padding-inline: 20px; }
  .topbar-title { font-size: 13px; }
  .page-overview { padding: 30px 20px 44px; }
  .overview-heading { margin-bottom: 24px; }
  .overview-heading h1 { font-size: 24px; }
  .overview-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); row-gap: 25px; padding-bottom: 25px; }
  .overview-metrics > div { padding-inline: 20px; }
  .overview-metrics > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .overview-metrics dd { font-size: 27px; }
  .overview-table table { min-width: 0; }
  .overview-table th:first-child { width: auto; }
  .overview-table td { padding-block: 17px; }
  .overview-table th:nth-child(2), .overview-table th:nth-child(3), .overview-table th:nth-child(4),
  .overview-table td:nth-child(2), .overview-table td:nth-child(3), .overview-table td:nth-child(4) { display: none; }
  .mobile-campaign-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 7px; font-size: 11px; color: #616161; }
  .mobile-campaign-meta .pill { font-size: 10px; }
  .table-action a { font-size: 11px; }
  .table-action a svg { display: none; }
  .page-records { padding: 0; }
  .page-records .list-tools { padding: 12px 20px; gap: 12px; }
  .page-records .list-search { flex: 1; }
  .page-records .search-control { min-width: 100px; width: 100%; }
  .page-records .pagination { padding-inline: 20px; }
  .builder-editor { padding: 0; }
}
@media (max-width: 420px) {
  .nav-item svg { display: none; }
  .nav-item { font-size: 12px; padding-inline: 7px; }
}

@media (max-width: 700px) {
  .topbar .dev-label { display: none; }
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Writing workspace: one document, with quiet contextual feedback alongside. */
.page-editor { max-width: none; padding: 0; }
.page-editor > .builder-head { padding: 12px 28px; margin: 0; }
.page-editor > .builder-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.page-editor > .builder-steps { padding: 0 28px; margin: 0; border-bottom: 1px solid #e5e5e5; }
.page-editor .builder-step { padding-block: 13px; }
.writing-workspace { position: relative; }
.editor-toolbar { min-height: 57px; padding: 10px 24px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid #e8e8e8; }
.editor-views { display: flex; padding: 3px; gap: 2px; border-radius: 7px; background: #f3f3f3; }
.editor-views button { background: transparent; border: 0; padding: 4px 12px; font-size: 12px; color: #626262; border-radius: 5px; }
.editor-views button[aria-pressed="true"] { background: white; color: #111; box-shadow: 0 1px 3px #00000010; }
.editor-template { color: #424242; font-size: 12px; white-space: nowrap; }
.editor-template span { color: #737373; }
.editor-toolbar-end { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.editor-save-status { color: #616161; font-size: 11px; }
.editor-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: #525252; padding: 5px 0; font-size: 12px; white-space: nowrap; }
.editor-tool:hover { color: #111; }
.editor-columns { display: grid; grid-template-columns: minmax(0,1fr) 292px; min-height: calc(100vh - 242px); }
.editor-columns.preview-open { grid-template-columns: minmax(0,1fr) minmax(340px,44%); }
.editor-main { min-width: 0; padding: 20px 28px 24px; background: #f8f8f8; }
.editor-scope-row { display: flex; align-items: center; gap: 10px; max-width: 700px; margin: 0 auto 7px; }
.editor-mode-label select { border: 0; border-radius: 0; background: transparent; font-size: 12px; padding: 4px 18px 4px 0; color: #222; width: auto; min-height: 0; }
[data-editing-scope] { color: #676767; font-size: 11px; }
.editor-recipient-row { display: flex; align-items: center; gap: 9px; max-width: 700px; margin: 0 auto 17px; font-size: 11px; color: #737373; }
.editor-recipient-row select { border: 0; background: transparent; padding: 2px 20px 2px 0; color: #525252; font-size: 11px; min-width: 0; min-height: 0; max-width: 80%; width: auto; }
[data-recipient-position] { margin-left: auto; white-space: nowrap; }
.editor-writing-area { max-width: 700px; margin: auto; border: 1px solid #e2e2e2; border-radius: 3px; background: white; box-shadow: 0 2px 5px #00000003; }
.editor-document-tools { display: flex; align-items: center; gap: 13px; padding: 10px 17px; border-bottom: 1px solid #ededed; }
.editor-upload { position: relative; display: inline-flex; align-items: center; gap: 6px; color: #525252; font-size: 12px; cursor: pointer; white-space: nowrap; }
.editor-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.editor-upload:focus-within { outline: 2px solid #111; outline-offset: 4px; }
.editor-upload.is-disabled { opacity: .5; cursor: default; }
.editor-tool-divider { height: 15px; border-left: 1px solid #e3e3e3; }
.editor-insert-label select { width: 146px; min-height: 0; border: 0; padding: 3px 16px 3px 0; background-color: transparent; color: #525252; font-size: 12px; }
.editor-undo { margin-left: auto; }
.editor-paper { padding: 39px 45px 42px; }
.editor-paper-brand { font-family: Georgia,serif; color: #202020; font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.editor-paper-rule { border-top: 1px solid #ddd; margin: 17px 0 22px; }
.editor-paper-address { white-space: pre-line; font-size: 11px; line-height: 1.65; color: #525252; margin-bottom: 32px; }
.editor-paper textarea { display: block; resize: none; width: 100%; min-height: 330px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; font-family: inherit; font-size: 15px; line-height: 1.85; color: #111; outline: 0; overflow: hidden; }
.editor-paper textarea:focus { border: 0; box-shadow: none; }
.editor-paper textarea::placeholder { color: #939393; }
.editor-paper textarea:focus-visible { outline: 1px solid #d6d6d6; outline-offset: 12px; }
.editor-letter-preview { max-width: 700px; margin: 0 auto; }
.editor-letter-preview.is-measuring { position: absolute; left: -10000px; top: 0; width: 500px; visibility: hidden; pointer-events: none; }
.editor-letter-preview .preview-stage { padding: 22px; background: transparent; }
.editor-document-footer { display: flex; justify-content: space-between; gap: 10px; max-width: 700px; margin: 13px auto 0; font-size: 10px; color: #666; }
.editor-fit-warning { max-width: 700px; padding: 10px 13px; margin: 16px auto; color: var(--warning); background: var(--paper); border: 1px solid var(--line); border-left: 2px solid var(--warning); font-size: 12px; border-radius: 4px; }
.editor-bottom-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; max-width: 700px; margin: 24px auto 0; }
.editor-bottom-actions > span { font-size: 10px; color: #737373; max-width: 300px; }
.editor-bottom-actions button { font-size: 12px; white-space: nowrap; }
.editor-assistance { min-width: 0; padding: 24px 20px; border-left: 1px solid #e6e6e6; background: #fff; }
.editor-assistance-heading { margin-bottom: 20px; }
.editor-assistance-heading h2 { margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.editor-assistance-heading p { font-size: 12px; color: #737373; margin-bottom: 24px; }
.editor-section-label { color: #737373; font-size: 11px; margin-bottom: 12px; }
.editor-section-label > span { margin-left: 5px; }
.editor-suggestion { padding: 0 0 18px; margin: 0 0 18px; border-bottom: 1px solid #e9e9e9; }
.editor-suggestion-title { width: 100%; border: 0; background: transparent; padding: 0; text-align: left; font-size: 13px; font-weight: 500; color: #222; display: flex; justify-content: space-between; align-items: baseline; gap: 5px; }
.editor-suggestion-title > span { color: #8a8a8a; }
.editor-suggestion.is-selected .editor-suggestion-title { text-decoration: underline; text-underline-offset: 3px; }
.editor-suggestion p { font-size: 12px; line-height: 1.6; color: #616161; margin: 7px 0 10px; }
.editor-suggestion-change { font-size: 12px; display: flex; flex-wrap: wrap; gap: 5px 10px; overflow-wrap: anywhere; padding-left: 9px; border-left: 2px solid #e3e3e3; margin: 12px 0; }
.editor-original { color: #6f6f6f; }
.editor-suggestion-change:has(.editor-replacement) .editor-original { text-decoration: line-through; text-decoration-color: #a7a7a7; }
.editor-replacement { color: var(--ink); }
.editor-suggestion-actions { display: flex; gap: 15px; }
.editor-suggestion-actions button { padding: 3px 0; font-size: 11px; color: #666; background: transparent; border: 0; }
.editor-suggestion-actions button.editor-apply { color: #111; font-weight: 600; }
.editor-feedback-note { font-size: 10px; line-height: 1.7; color: #767676; padding: 0 0 22px; }
.editor-assistance details { border-top: 1px solid #e8e8e8; padding: 15px 0; }
.editor-assistance summary { font-size: 12px; color: #424242; cursor: pointer; }
.editor-assistance summary > span { float: right; font-size: 10px; color: #858585; }
.editor-assistance details p, .editor-assistance details small { display: block; color: #737373; font-size: 11px; margin: 11px 0; }
.editor-assistance details textarea { font-size: 12px; padding: 9px; width: 100%; min-height: 100px; line-height: 1.65; background: white; }
.editor-assistance details fieldset { padding-top: 12px; }
.editor-field { display: block; font-size: 11px; color: #666; margin-bottom: 11px; }
.editor-field input { display: block; width: 100%; min-width: 0; margin-top: 4px; font-size: 12px; min-height: 33px; padding: 5px 8px; }
.editor-address-fields { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 9px; }
.editor-recipient-context dl { font-size: 11px; margin: 12px 0 0; }
.editor-recipient-context dl > div { margin-bottom: 10px; }
.editor-recipient-context dt { color: #757575; margin-bottom: 3px; }
.editor-recipient-context dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #333; }
.editor-readiness:empty { display: none; }
.editor-readiness { margin-bottom: 24px; }
.editor-readiness button { width: 100%; text-align: left; background: #fff; border: 0; border-left: 2px solid var(--warning); padding: 0 0 0 10px; margin-bottom: 14px; font-size: 12px; color: var(--warning); }
.editor-readiness button span { display: block; font-size: 11px; color: #737373; margin-top: 4px; line-height: 1.6; }
.editor-guidance h3, .editor-clear h3 { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.editor-guidance p, .editor-clear p { font-size: 12px; color: #737373; line-height: 1.7; }
.editor-guidance ol { padding-left: 17px; margin: 17px 0 24px; font-size: 12px; line-height: 1.7; color: #616161; }
.editor-guidance li { margin-bottom: 8px; }
.editor-clear > svg { color: var(--muted); margin-bottom: 12px; }
.editor-clear { padding: 8px 0 21px; }
.editor-clear .text-link { font-size: 11px; }
.editor-error { padding: 12px 24px; font-size: 13px; color: var(--danger); background: var(--paper); border-bottom: 1px solid var(--line); border-left: 2px solid var(--danger); }
.editor-import-dialog { max-width: 410px; border: 1px solid #ddd; border-radius: 8px; padding: 26px; color: #111; box-shadow: 0 14px 60px #00000020; }
.editor-import-dialog::backdrop { background: #00000025; }
.editor-import-dialog h2 { font-size: 17px; }
.editor-import-dialog p { font-size: 13px; color: #616161; }
.editor-import-dialog .button-row { justify-content: flex-end; }
@media (min-width: 1500px) {
  .editor-columns { grid-template-columns: minmax(0,1fr) 320px; }
  .editor-assistance { padding-inline: 26px; }
  .editor-main { padding-top: 25px; }
}
@media (max-width: 1120px) {
  .editor-columns { grid-template-columns: minmax(0,1fr) 258px; }
  .editor-main { padding-inline: 18px; }
  .editor-paper { padding: 30px; }
  .editor-assistance { padding-inline: 17px; }
  .editor-save-status { display: none; }
  .editor-bottom-actions { justify-content: flex-end; align-items: flex-start; flex-direction: column; gap: 10px; }
  .editor-document-footer { flex-direction: column; gap: 4px; }
}
@media (max-width: 900px) {
  .editor-columns { grid-template-columns: minmax(0,1fr); }
  .editor-assistance { border-left: 0; border-top: 1px solid #e6e6e6; padding: 25px; }
  .editor-assistance-heading p { margin-bottom: 18px; }
  .editor-main { padding-inline: 24px; }
  .editor-save-status { display: inline; }
}
@media (max-width: 700px) {
  .page-editor { padding: 0; }
  .page-editor > .builder-head { padding: 18px 20px 12px; }
  .page-editor > .builder-head h1 { font-size: 17px; }
  .page-editor > .builder-head > a { display: none; }
  .page-editor > .builder-steps { padding-inline: 20px; }
  .editor-toolbar { padding-inline: 16px; gap: 10px; flex-wrap: wrap; }
  .editor-toolbar-end { gap: 12px; }
  .editor-template, .editor-save-status { display: none; }
  .editor-main { padding: 16px 12px 22px; }
  .editor-scope-row, .editor-recipient-row { padding-inline: 5px; }
  .editor-scope-row { flex-wrap: wrap; gap: 0 10px; }
  .editor-document-tools { gap: 9px; padding: 10px 12px; }
  .editor-document-tools select { width: 130px; font-size: 11px; }
  .editor-upload { font-size: 11px; }
  .editor-undo { font-size: 0; }
  .editor-undo svg { width: 15px; }
  .editor-paper { padding: 29px 24px; }
  .editor-paper textarea { font-size: 16px; line-height: 1.8; }
  .editor-paper-brand { font-size: 18px; }
  .editor-paper-address { margin-bottom: 25px; }
  .editor-document-footer, .editor-bottom-actions { padding-inline: 5px; }
  .editor-letter-preview .preview-stage { padding: 10px 0; }
  .editor-import-dialog { max-width: calc(100vw - 32px); }
}

/* One proportionate A4 composition for sample cards and recipient previews.
   The containing surface determines scale, including handwriting and spacing. */
.template-card { display: flex; flex-direction: column; justify-content: flex-start; }
.template-info { flex: 1; }
.template-thumbnail, #letter-preview .preview-stage { container-type: inline-size; }
.template-thumbnail {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: auto;
  padding: 20px;
  background: #f4f4f4;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.template-classic { --hand-font: "Cedarville Cursive", cursive; --hand-size: 4.15; --hand-weight: 400; --hand-leading: 1.5; }
.template-personal { --hand-font: "La Belle Aurore", cursive; --hand-size: 4.45; --hand-weight: 400; --hand-leading: 1.34; }
.template-modern { --hand-font: "Kalam", cursive; --hand-size: 3.9; --hand-weight: 300; --hand-leading: 1.58; }
.letter-sheet {
  --paper-unit: min(1cqi, 4.6px);
  flex: none;
  width: 100%;
  max-width: 460px;
  min-height: 0;
  aspect-ratio: 210 / 297;
  margin: auto;
  padding: calc(var(--paper-unit) * 8.5) calc(var(--paper-unit) * 9.1);
  background: #fff;
  border: calc(var(--paper-unit) * .2173913) solid #e4e4e4;
  box-shadow: 0 2px 4px #00000004, 0 8px 18px #00000006;
  color: #202329;
  overflow: hidden;
  text-align: left;
  font-weight: 400;
  letter-spacing: normal;
}
.letter-mini { pointer-events: none; }
.letter-sheet .letter-brand {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: calc(var(--paper-unit) * 3.25);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.03em;
  margin: 0;
}
.letter-sheet .letter-rule {
  border: 0;
  border-top: calc(var(--paper-unit) * .2173913) solid #dfdfdf;
  margin: calc(var(--paper-unit) * 2.5) 0 calc(var(--paper-unit) * 2.4);
}
.letter-sheet .sender-line {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: calc(var(--paper-unit) * 1.38);
  line-height: 1.5;
  color: #686868;
  margin-bottom: calc(var(--paper-unit) * 3.2);
}
.letter-sheet .address {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: calc(var(--paper-unit) * 1.95);
  line-height: 1.5;
  color: #444;
  margin-bottom: calc(var(--paper-unit) * 5.2);
}
.letter-sheet .letter-body {
  font-family: var(--hand-font);
  font-size: calc(var(--paper-unit) * var(--hand-size));
  font-weight: var(--hand-weight);
  font-style: normal;
  line-height: var(--hand-leading);
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
}
.letter-sheet .missing-variable { border-radius: calc(var(--paper-unit) * .44); padding-inline: calc(var(--paper-unit) * .44); }
.editor-paper textarea {
  font-family: var(--hand-font);
  font-weight: var(--hand-weight);
  font-size: calc(var(--hand-size) * 5.4px);
  line-height: var(--hand-leading);
  color: #202329;
}
.editor-paper textarea::placeholder { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.8; }
@media (max-width: 700px) {
  .template-thumbnail { padding: 18px; }
  .editor-paper textarea { font-size: calc(var(--hand-size) * 4.8px); }
}

/* Let the handwriting samples carry the style choice. */
.template-info { padding: 14px 16px; }
.template-name { margin: 0; font-size: 14px; }

/* Handwriting is a readable sample. */
.handwriting-picker { container-type: inline-size; }
.handwriting-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 28px; align-items: stretch; }
.handwriting-controls h2 { margin: 0 0 10px; font-size: 14px; font-weight: 550; }
.handwriting-options { display: grid; gap: 10px; }
.handwriting-option { padding: 10px 14px; border: 1px solid #e4e4e4; border-radius: 7px; background: #fff; color: #111; text-align: left; min-width: 0; }
.handwriting-option:hover:not(:disabled) { background: #fafafa; border-color: #bbb; }
.handwriting-option[aria-pressed="true"] { border-color: #333; box-shadow: 0 0 0 1px #333; }
.handwriting-option-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 8px; font-size: 13px; font-weight: 550; }
.handwriting-option-heading .muted { white-space: nowrap; }
.handwriting-tick { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: #fff; background: #222; visibility: hidden; }
.handwriting-option[aria-pressed="true"] .handwriting-tick { visibility: visible; }
.handwriting-swatch { display: block; margin-top: 4px; font: var(--hand-weight) 22px/1.25 var(--hand-font); white-space: pre-line; overflow-wrap: anywhere; }

.handwriting-preview { display: flex; flex-direction: column; height: clamp(350px, calc(100dvh - 290px), 650px); border: 1px solid #e5e5e5; border-radius: 8px; min-width: 0; overflow: hidden; }
.handwriting-preview-toolbar, .handwriting-dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #e8e8e8; }
.handwriting-views { display: flex; align-items: center; gap: 2px; }
.handwriting-views button { color: #666; background: transparent; border: 0; border-radius: 5px; padding: 6px 10px; font-size: 12px; }
.handwriting-views button[aria-pressed="true"] { background: #f0f0f0; color: #111; }
.handwriting-expand, .handwriting-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 5px; background: #fff; color: #555; }
.handwriting-expand:hover, .handwriting-close:hover { background: #f0f0f0; color: #111; }
.handwriting-preview-stage, .handwriting-dialog-stage { container-type: inline-size; padding: 24px; background: #f5f5f5; }
.handwriting-preview-stage { container-type: size; flex: 1; min-height: 0; display: grid; place-items: center; padding: 18px; }
.handwriting-preview-stage .letter-sheet { width: min(100cqi, calc(100cqb * 210 / 297)); --paper-unit: min(1cqi, calc(1cqb * 210 / 297), 4.6px); }
.handwriting-preview-stage.is-closeup { overflow-y: auto; display: block; }
.handwriting-preview-stage .handwriting-closeup { min-height: 100%; font-size: 28px; padding: 28px; }
.handwriting-closeup { background: #fff; padding: 38px; min-height: 330px; font: var(--hand-weight) 30px/1.6 var(--hand-font); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 2px 8px #00000005; color: #202329; }
.handwriting-dialog { padding: 0; width: min(760px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 40px); border: 1px solid #ddd; border-radius: 10px; box-shadow: 0 20px 80px #00000020; color: #111; }
.handwriting-dialog::backdrop { background: #00000035; }
.handwriting-dialog-toolbar { position: sticky; top: 0; z-index: 1; padding: 12px 18px; }
.handwriting-dialog-toolbar strong { font-size: 14px; font-weight: 500; }
.handwriting-close { font-size: 24px; line-height: 1; }
.handwriting-dialog-stage { padding: 32px; }
.handwriting-dialog-stage .letter-sheet { max-width: 595px; --paper-unit: min(1cqi, 5.95px); }
.handwriting-dialog-stage .handwriting-closeup { min-height: 400px; padding: 48px; font-size: 36px; }
.letter-sheet[data-stationery="plain"] { padding-top: calc(var(--paper-unit) * 14); }
.editor-paper[data-stationery="plain"] :is(.editor-paper-brand,.editor-paper-rule,.editor-paper-address) { display: none; }
.editor-template select { border: 0; border-radius: 5px; padding: 5px 26px 5px 8px; width: auto; font-size: 13px; color: #333; background-color: #fff; }
.editor-template select:hover { background-color: #f4f4f4; }
@container (max-width: 660px) {
  .handwriting-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); gap: 20px; }
  .handwriting-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
  .handwriting-option { padding: 12px; }
  .handwriting-swatch { font-size: 20px; }
}
@media (max-width: 700px) {
  .handwriting-preview-stage { padding: 18px; min-height: 0; }
  .handwriting-dialog-stage { padding: 14px; }
  .handwriting-closeup, .handwriting-dialog-stage .handwriting-closeup { padding: 28px; font-size: 26px; }
  .editor-template { display: block; }
}

@media (max-width: 700px) {
  .nav-list { margin-top: 0; }
  .handwriting-swatch { font-size: 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  .handwriting-option, .handwriting-views button { transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease; }
}


/* Shared selection control and recipient review. */
.search-select { position: relative; min-width: 0; }
.select-trigger { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 11px; background: #fff; color: #111; border: 1px solid #dedede; border-radius: 6px; text-align: left; font-size: 13px; }
.select-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger:hover { background: #fafafa; }
.select-chevron { display: grid; place-items: center; flex: none; color: var(--muted); }
.select-menu { position: absolute; z-index: 45; top: calc(100% + 5px); left: 0; width: 100%; min-width: 240px; padding: 5px; background: #fff; border: 1px solid #e3e3e3; border-radius: 8px; box-shadow: 0 8px 30px #00000014; }
.select-search { width: 100%; padding: 9px; border: 0; border-bottom: 1px solid #eee; outline-offset: -2px; font-size: 13px; }
.select-list { max-height: 225px; overflow-y: auto; padding-top: 4px; }
.select-list [role=option] { padding: 8px 9px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.select-list [role=option]:hover, .select-list .is-active { background: #f3f3f3; }
.select-list [aria-selected=true] > span::after { content: ' ✓'; }
.select-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #666; }
.select-empty { padding: 10px; color: #666; font-size: 13px; }
.has-import-preview .import-dropzone { display: none; }
.import-review-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.import-review-head h2 { margin: 0 0 3px; }
.import-filename { color: #525252; font-size: 12px; overflow-wrap: anywhere; }
.import-preview-table { max-height: clamp(180px, calc(100dvh - 490px), 440px); overflow: auto; border-radius: 0; border-inline: 0; }
.import-preview-table table { min-width: 0; }
.import-preview-table th, .import-preview-table td { padding: 10px 14px; font-size: 13px; }
.import-preview-table th:nth-child(4), .import-preview-table td:nth-child(4) { min-width: 180px; }
.import-preview-table th { position: sticky; top: 0; z-index: 1; background: #fff; min-width: 115px; color: #111; }
.import-source { display: block; margin-top: 4px; color: #737373; font-size: 11px; font-weight: 400; }
.import-preview-table td { max-width: 280px; min-width: 115px; vertical-align: top; overflow-wrap: anywhere; }
.import-row-issue, .import-row-issue:hover { background: var(--danger-soft); }
.import-issue-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; color: var(--danger); }
.import-issue-bar button { font-size: 13px; }
.import-issue-bar.is-choice { color: var(--warning); }
.import-matching { margin: 18px 0 24px; }
.import-matching summary { width: fit-content; cursor: pointer; color: #525252; font-size: 13px; }
.import-mapping-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 20px; padding: 20px 0; }
.import-mapping-label { font-size: 13px; margin-bottom: 6px; }
.import-mapping-label span { display: block; color: var(--warning); font-size: 12px; }
.import-confirm { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-top: 18px; border-top: 1px solid #eee; }
.import-confirm button { flex: none; }
@media (max-width: 1100px) { .import-mapping-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .import-confirm { align-items: flex-start; flex-direction: column; } }
@media (max-width: 700px) { .import-mapping-grid { grid-template-columns: minmax(0,1fr); } .select-menu { min-width: 0; } }

/* Context appears at the decision it explains. */
.context-details { margin-top: 20px; color: var(--muted); font-size: 13px; }
.context-details summary { cursor: pointer; width: fit-content; }
.context-details p { margin: 12px 0 0; overflow-wrap: anywhere; }
#saved-recipients .section-heading { flex-wrap: wrap; }

/* Usage analytics (5 October): before an answer, two choices of equal weight. */
.usage-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.usage-choices .button { min-width: 120px; }

/* Welcome (5 October): two screens, one question each, then the envelope is sent off into the app. */
.welcome { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); width: 100%; box-sizing: border-box; overflow-x: hidden; background: var(--paper); }
.welcome-head { display: flex; justify-content: space-between; align-items: center; padding: 28px 40px; }
.welcome-dots { display: flex; gap: 6px; }
.welcome-dots i { width: 6px; height: 6px; border-radius: 50%; background: #d6d6d6; }
.welcome-dots i.on { background: var(--ink); }
.welcome-body { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; text-align: center; width: 100%; box-sizing: border-box; padding: 0 20px 12vh; }
.welcome-body h1 { font-family: "Libre Baskerville", Georgia, serif; font-weight: 400; font-size: 30px; letter-spacing: -.04em; margin: 0 0 10px; }
.welcome-lead { color: var(--muted); font-size: 15px; margin: 0 0 30px; }
.welcome-error { color: var(--danger); font-size: 14px; margin: -14px 0 18px; }
.welcome-form { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; width: min(420px, 100%); text-align: left; }
.welcome-form .field { width: 100%; }
.welcome-pair { display: grid; grid-template-columns: 120px 1fr; gap: 12px; width: 100%; }
.welcome-envelope { position: relative; width: 380px; max-width: 100%; aspect-ratio: 8 / 5; margin: 0 auto 6px; background: #fff; border: 1px solid #d9d9d9; border-radius: 4px; box-shadow: 0 18px 40px #0000000f; }
.welcome-form .welcome-envelope { margin-bottom: 26px; }
.welcome-envelope svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.welcome-return { position: absolute; left: 50%; top: 8%; transform: translateX(-50%); width: 70%; text-align: center; font-family: "Kalam", cursive; font-size: 15px; line-height: 1.45; color: #1d2a44; }
.welcome-return .ph { display: block; height: 9px; margin: 9px auto; width: 70%; border-radius: 4px; background: #efefef; }
.welcome-return .ph.short { width: 45%; }
.welcome-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 28px; width: 100%; }
.welcome-actions .button { min-width: 220px; }
.welcome-goals .context-choices { width: min(460px, 100%); grid-template-columns: 1fr 1fr; }
.welcome-goals .context-choices span { min-height: 52px; }
.welcome-goals { width: min(460px, 100%); }
.welcome-other-link { margin: 14px 0 0; text-align: center; }
.welcome-other { width: 100%; margin-top: 14px; }
.welcome-other input { display: block; width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid #cfcfcf; border-radius: 0; padding: 8px 2px; font: inherit; font-size: 14px; text-align: center; background: none; }
.welcome-other input:focus { outline: none; border-color: var(--ink); }
@media (max-width: 600px) { .welcome-head { padding: 22px 20px; } .welcome-body h1 { font-size: 25px; } .welcome-goals .context-choices { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) {
  .welcome-body { transition: opacity 200ms ease, transform 200ms ease; }
  .welcome-body.leaving { opacity: 0; transform: translateX(-16px); }
  .welcome-body.entering { opacity: 0; transform: translateX(16px); }
  .welcome.sending .welcome-envelope { animation: welcome-send 720ms cubic-bezier(.4, 0, .2, 1) forwards; }
  @keyframes welcome-send { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(-30%, -40%) scale(.5) rotate(-3deg); } }
}

/* "Help shape Kant" (5 October): a personal note from Florian, never a gate. Both answers weigh the same. */
.help-card { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 352px; box-sizing: border-box; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px #0000001a; }
.help-card h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.help-card p { margin: 0 0 9px; font-size: 13.5px; line-height: 1.55; color: #444; }
.help-card .help-card-signature { font-family: "La Belle Aurore", cursive; font-size: 21px; color: #222; margin: 2px 0 14px; }
.help-card-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.help-card-close { position: absolute; top: 10px; right: 10px; }
@media (max-width: 600px) { .help-card { left: 12px; right: 12px; bottom: 12px; width: auto; } }
@media (prefers-reduced-motion: no-preference) { .help-card { animation: help-card-in 260ms ease-out; } @keyframes help-card-in { from { opacity: 0; transform: translateY(8px); } } }

/* Settings (7 October): Company, then Your account, as rows of label, value and Change. One row opens at a time,
   with Save and Cancel on the left. No boxes; rows are divided by a faint line. */
.settings-page { width: min(100%, 640px); }
.settings-section + .settings-section { margin-top: 16px; padding-top: 28px; border-top: 1px solid var(--line); }
.settings-section h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.settings-section-note { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.settings-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; column-gap: 24px; align-items: baseline; padding: 12px 0; }
.settings-row + .settings-row { border-top: 1px solid #f0f0f0; }
.settings-label { color: var(--muted); font-size: 13px; }
.settings-value { min-width: 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.settings-value:focus { outline: none; }
.settings-note { display: block; margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.settings-note .text-link, .settings-row > .text-link, .settings-actions .text-link { font-size: 13px; }
.settings-row > .text-link { justify-self: end; white-space: nowrap; }
.settings-row.open { align-items: start; }
.settings-row.open .settings-label { padding-top: 2px; }
.settings-form { grid-column: 2 / 4; min-width: 0; }
.settings-form .field { margin-bottom: 14px; }
.settings-address-fields { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0 14px; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 4px; }
.settings-form > .settings-note { margin-top: 10px; }
.settings-legal { display: flex; gap: 6px; margin: 24px 0 0; color: var(--muted); font-size: 12px; }
.settings-legal .text-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.settings-legal .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .settings-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .settings-label { grid-column: 1 / -1; }
  .settings-form { grid-column: 1 / -1; }
  .settings-address-fields { grid-template-columns: 110px minmax(0, 1fr); }
}
.account-summary-text { display: grid; min-width: 0; text-align: left; }
.account-summary-text strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary-text small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel { margin-top: 44px; }
/* Waitlist (6 October): on the operator Work queue; the company needs less room than a campaign name. */
.waitlist .overview-table th:first-child { width: 26%; }
.funnel h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.funnel h2 .muted { font-weight: 400; }
.funnel th.numeric, .funnel td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.funnel .help-inline { margin-top: 10px; }
.context-intro { margin: -6px 0 18px; color: var(--muted); font-size: 13.5px; }

/* Home and Campaigns share one table (7 October): name, status, letters, a date in the order page's words, the next step. */
.campaign-table { border: 0; border-radius: 0; }
.campaign-table table { min-width: 720px; }
.campaign-table th { background: #ffffff; padding: 11px 10px; font-size: 12px; }
.campaign-table td { padding: 15px 10px; }
.campaign-table th:first-child { width: 36%; }
.page-overview .campaign-table { margin-inline: -6px; padding-inline: 6px; }
.page-overview .campaign-table th:first-child, .page-overview .campaign-table td:first-child { padding-left: 0; }
.page-overview .campaign-table th:last-child, .page-overview .campaign-table td:last-child { padding-right: 0; }
.campaign-table a:focus-visible { outline-offset: 2px; }
.campaign-table .campaign-title { font-size: 14px; }
.campaign-date { white-space: nowrap; font-size: 13px; color: var(--ink); }
.campaign-date.muted { color: var(--muted); }
.campaign-table .table-action a { font-size: 13px; color: var(--ink); }
.page-overview .section-heading { margin-bottom: 8px; }
/* Before the first campaign: one left-aligned block on Home and Campaigns. */
.first-campaign { max-width: 560px; margin: 8px 0 0; }
.first-campaign h1 { margin: 0 0 10px; font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.first-campaign p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.campaigns-first { padding: 40px 24px; }
@media (max-width: 700px) {
  .campaign-table table { min-width: 0; }
  .campaign-table th:first-child { width: auto; }
  .campaign-table th:nth-child(n+2):not(:last-child), .campaign-table td:nth-child(n+2):not(:last-child) { display: none; }
  .campaign-table .mobile-campaign-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 7px; font-size: 11px; color: #616161; }
  .campaigns-first { padding: 24px 20px; }
}
/* Terms and data processing agreement (7 October): one plain line under Join the waitlist. */
.auth-terms { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
