* { box-sizing: border-box; }
:root {
  --surface: #ffffff;
  --ground: #f2f5f9;
  --ink: #19283b;
  --muted: #546477;
  --accent: #204b8f;
  --accent-hover: #163c78;
  --rail: #193f7a;
  --rail-muted: #c4d5ef;
  --selected: #e7eef9;
  --line: #d3dce7;
  --error: #a12d32;
  --success: #256445;
  --warning: #79501d;
  --radius: 6px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 var(--font); }
[hidden] { display: none !important; }
::selection { background: #c8daf6; color: var(--ink); }
a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: var(--accent-hover); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 9px 15px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--surface); font: 600 14px/1.4 var(--font); text-decoration: none; cursor: pointer; transition: background-color 160ms ease-out, border-color 160ms ease-out; }
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--surface); }
button:active, .button:active { background: #102d5c; }
button.quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
button.quiet:hover { background: var(--selected); border-color: #a7bbd7; }
button.quiet:active { background: #d7e4f6; }
button:disabled { opacity: .5; cursor: not-allowed; }
.button[aria-disabled="true"] { background: var(--ground); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
button.danger { color: var(--error); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1:focus { outline: none; }
h1, h2, h3, p { margin: 0 0 12px; }
h1, h2, h3 { line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
h1 { font-size: 28px; letter-spacing: -.02em; }
h2 { font-size: 20px; letter-spacing: -.01em; }
h3 { font-size: 16px; }
p { max-width: 72ch; }
.small, .muted { color: var(--muted); }
.small { font-size: 13px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-button { width: 44px; padding: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 10; background: white; padding: 12px; border-radius: var(--radius); }
.skip-link:focus { top: 8px; }
.admin-header { min-height: 72px; padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--rail); color: white; }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; color: white; font-size: 18px; font-weight: 600; text-decoration: none; }
.wordmark:hover { color: white; }
.header-label { color: var(--rail-muted); font-size: 14px; }
.login-panel { width: min(100% - 32px, 440px); margin: 64px auto; background: var(--surface); padding: 32px; border-radius: 12px; border: 1px solid var(--line); }
.login-panel > p { color: var(--muted); }
.login-panel > .button { width: 100%; margin: 12px 0 20px; }
.login-panel details { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
#token-login { padding-top: 16px; }
#token-login .small { margin-top: 12px; }
#login-feedback:empty { display: none; }
.signed-in > .admin-header { display: none; }
#workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.app-rail { background: var(--rail); color: white; padding: 28px 16px; display: flex; flex-direction: column; gap: 28px; }
#secondary-menu > summary { display: none; }
.rail-brand { display: flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 19px; font-weight: 600; line-height: 1.3; color: white; text-decoration: none; }
.rail-brand:hover { color: white; }
.tabs { display: flex; flex-direction: column; gap: 6px; }
.tabs button { width: 100%; justify-content: flex-start; background: transparent; border-color: transparent; color: var(--rail-muted); padding: 11px 12px; font-size: 14px; font-weight: 500; }
.tabs button[aria-selected="true"] { background: white; color: var(--rail); font-weight: 600; }
.tabs button:hover:not([aria-selected="true"]) { background: #28528f; color: white; }
.app-rail :focus-visible { outline-color: #c4d5ef; }
.rail-tools { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.rail-tools a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--rail-muted); font-size: 14px; text-decoration: none; }
.rail-tools a:hover { color: white; text-decoration: underline; }
.rail-tools .quiet { justify-content: flex-start; background: transparent; color: var(--rail-muted); border-color: #6e8db9; margin: 8px 12px 0; }
.rail-tools .quiet:hover { background: white; color: var(--rail); border-color: white; }
.setup-notice { margin-top: auto; font-size: 13px; color: var(--rail-muted); }
.setup-notice summary { color: white; }
.setup-notice p { margin: 8px 0 16px; }
.setup-notice .small { color: var(--rail-muted); overflow-wrap: anywhere; }
.setup-notice button { width: 100%; font-size: 13px; }
.work-content { min-width: 0; padding: 36px 40px 64px; max-width: 1400px; width: 100%; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin: 0; }
.page-heading:has(.sr-only) { margin: 0; }
.page-description { color: var(--muted); margin-bottom: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2, .section-heading p { margin: 0; }
#issue-count { font-size: 14px; }
.list-toolbar { display: flex; gap: 16px; align-items: flex-end; margin: 24px 0 20px; }
.list-toolbar label { margin: 0; }
.search-label { flex: 1; max-width: 420px; }
.filter-label { width: 180px; }
.list-toolbar button { margin-left: auto; }
.issue-table { border-collapse: collapse; width: 100%; background: white; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); table-layout: fixed; }
.issue-table th { background: #eaf0f7; color: var(--muted); font-size: 13px; font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.issue-table th:first-child { width: 66%; }
.issue-table th:nth-child(2) { width: 22%; }
.issue-table th:last-child { width: 12%; }
.issue-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.issue-table tbody tr:hover { background: #f7faff; }
.issue-item { display: block; width: 100%; text-align: left; color: var(--ink); background: transparent; border: 0; padding: 0; font-size: 16px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; border-radius: 2px; }
.issue-item:hover { color: var(--accent); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.revision-cell { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.empty { padding: 40px 24px; text-align: center; background: white; border: 1px solid var(--line); border-top: 0; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 18px; }
.empty p { margin: 0 auto; max-width: 52ch; }
.status { display: inline-flex; align-items: center; width: fit-content; padding: 3px 8px; border-radius: 4px; color: var(--muted); background: #ecf0f5; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.status[data-state="draft"] { color: var(--accent); background: var(--selected); }
.status[data-state="sent"], .status[data-state="subscribed"], .status[data-state="active"] { color: var(--success); background: #e6f2eb; }
.status[data-state="failed"], .status[data-state="uncertain"] { color: var(--error); background: #f9e9e9; }
.status[data-state="pending"], .status[data-state="awaiting_verification"] { color: var(--warning); background: #f7efdf; }
#editor { max-width: 1040px; }
.editor-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.editor-top > button { background: transparent; border-color: transparent; padding-left: 0; color: var(--accent); }
.editor-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
#save-state { font-size: 13px; color: var(--muted); }
.editor-commandbar { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 12px 0; position: sticky; top: 0; background: var(--ground); z-index: 1; }
.editor-commandbar h2 { margin: 0; min-width: 0; font-size: 20px; max-width: 60ch; }
.editor-actions, .story-buttons, .row-actions, .preview-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-commandbar .editor-actions { flex-shrink: 0; }
.issue-details { background: white; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.issue-details label { margin-bottom: 16px; }
.issue-details details summary { color: var(--muted); }
.issue-details textarea { width: 100%; margin-top: 12px; }
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 20px; }
label > input, label > textarea, label > select { display: block; width: 100%; margin-top: 7px; }
input, textarea, select { min-width: 0; max-width: 100%; border: 1px solid #b5c2d3; border-radius: var(--radius); padding: 10px 12px; background: white; color: var(--ink); font: 16px/1.5 var(--font); caret-color: var(--accent); }
input, select { min-height: 44px; }
input::placeholder, textarea::placeholder { color: #637187; opacity: 1; }
textarea { resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: #839bbc; }
input:disabled, textarea:disabled { background: #f4f6fa; color: var(--ink); opacity: 1; }
#draft-form [name=subject] { font-size: 18px; font-weight: 500; }
.story-heading { margin-top: 28px; }
#story-count { font-size: 16px; font-weight: 400; }
#stories { display: grid; gap: 20px; }
.story { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.story-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.story-header h3 { margin: 0; }
.story-content > summary { font-weight: 600; color: var(--ink); }
.story-content[open] > summary { margin-bottom: 20px; }
.story-content [data-field="summary"] { overflow-y: hidden; }
.story-references { border-top: 1px solid var(--line); padding-top: 8px; }
.story-references summary { color: var(--muted); font-size: 14px; }
.story-references summary span { margin-left: 12px; font-weight: 400; }
.story-references[open] summary { margin-bottom: 12px; }
.story-references label:last-child { margin-bottom: 0; }
.issue-delivery { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.issue-delivery .section-heading { align-items: flex-start; }
.issue-delivery h2 { margin-bottom: 6px; }
.history { margin: 20px 0; font-size: 14px; color: var(--muted); }
.history p, .history ul { margin-top: 12px; overflow-wrap: anywhere; }
.notice { background: #f7efdf; border: 1px solid #dac7a3; color: var(--warning); padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 20px; overflow-wrap: anywhere; }
#feedback { margin-top: 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow-wrap: anywhere; }
#feedback:empty { display: none; }
.field-error { display: block; color: var(--error); margin-top: 6px; font-size: 14px; }
[aria-invalid="true"] { border-color: var(--error); }
.brand-form { max-width: 880px; }
.brand-section { margin: 0 0 28px; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.brand-section legend { padding: 0 8px; font-size: 20px; font-weight: 600; }
.brand-section > p { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.wide-field { grid-column: 1 / -1; }
.form-grid label:last-child { margin-bottom: 0; }
input[type="color"] { width: 100%; height: 44px; padding: 5px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; position: sticky; top: 0; padding: 16px 0; margin-bottom: 24px; background: var(--ground); z-index: 1; border-bottom: 1px solid var(--line); }
#brand-fields label { scroll-margin-top: 120px; }
#brand-fields input, #brand-fields textarea, #brand-fields select { scroll-margin-top: 148px; scroll-margin-bottom: 32px; }
.form-actions > span { margin-right: auto; }
.key-form { display: flex; align-items: flex-end; gap: 12px; margin: 28px 0; max-width: 640px; }
.key-form label { flex: 1; min-width: 0; margin: 0; }
.rows { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.rows > p { padding: 24px; margin: 0; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row strong { display: block; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.row small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
#key-secret { margin: 24px 0; }
#secret-output { display: block; padding: 16px; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; margin: 12px 0; user-select: all; }
details > summary { cursor: pointer; overflow-wrap: anywhere; min-height: 44px; padding: 10px 0; }
pre, code { font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { max-width: calc(100% - 48px); max-height: calc(100dvh - 48px); border: 0; border-radius: 12px; padding: 24px; background: white; color: var(--ink); box-shadow: 0 16px 60px rgb(0 0 0 / 25%); }
dialog::backdrop { background: rgb(14 31 56 / 48%); }
dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
dialog header h2 { margin: 0; }
dialog header p { margin: 4px 0 0; }
#preview-dialog { width: 1100px; height: calc(100dvh - 48px); }
#preview-dialog[open] { display: flex; flex-direction: column; }
.preview-tabs { margin-bottom: 16px; }
.preview-tabs [aria-pressed="true"] { background: var(--selected); color: var(--accent); border-color: #9cb4d9; }
#preview-frame { display: block; width: 100%; flex: 1; min-height: 0; border: 0; background: white; }
#preview-text { margin: 0; flex: 1; min-height: 0; overflow-y: auto; border: 1px solid var(--line); padding: 20px; background: #f7f9fc; }
#send-dialog { width: 520px; }
#send-subject { font-weight: 600; overflow-wrap: anywhere; }
#send-dialog .editor-actions { margin-top: 24px; }
.reader-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; background: var(--rail); color: white; padding: 16px max(24px, calc((100vw - 1040px) / 2)); }
.reader-header a { color: white; text-decoration: none; display: flex; align-items: center; min-height: 44px; }
.reader-header .reader-identity { font-size: 18px; font-weight: 600; gap: 12px; }
.reader-header nav { display: flex; gap: 24px; font-size: 14px; }
.reader-header nav a:hover { text-decoration: underline; }
.logo { width: 40px; max-height: 40px; object-fit: contain; }
.public { max-width: 1040px; margin: 48px auto; padding: 0 24px; }
.reader-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; align-items: start; }
.invitation { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.invitation h1 { font-size: 24px; margin-bottom: 16px; }
.standfirst { color: var(--muted); margin-bottom: 20px; }
.signup-row { display: flex; flex-direction: column; gap: 12px; }
#signup label { margin-bottom: 8px; }
#signup .small { margin-top: 12px; margin-bottom: 0; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.archive h2 { font-size: 24px; margin-bottom: 24px; }
.archive-link { display: block; border-top: 1px solid var(--line); padding: 20px 0; text-decoration: none; font-weight: 500; font-size: 18px; overflow-wrap: anywhere; }
.archive-link:last-child { border-bottom: 1px solid var(--line); }
.archive-link:hover { text-decoration: underline; }
.public footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.public footer a { display: block; min-height: 44px; padding: 10px 0; }
.confirmation-page { max-width: 560px; background: white; padding: 32px; border: 1px solid var(--line); border-radius: 12px; }
.confirmation-page form { margin: 24px 0; }
.confirmation-page > a { display: inline-flex; min-height: 44px; align-items: center; }
.docs { max-width: 1040px; }
.docs-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; }
.docs-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.docs-nav a { min-height: 44px; display: flex; align-items: center; }
.docs-content { min-width: 0; }
.docs h2 { margin-top: 32px; }
.docs details { background: white; border-bottom: 1px solid var(--line); padding: 8px 16px; }
.docs details:first-of-type { border-top: 1px solid var(--line); }
.docs summary { font-size: 14px; }
.docs code { overflow-wrap: anywhere; }
.docs pre { padding: 16px 0; margin: 0; }
@media (max-width: 1000px) {
  .work-content { padding: 28px 24px 48px; }
  .row { gap: 12px; }
  .row-actions { grid-column: 1 / -1; }
  .reader-layout { gap: 32px; grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 700px) {
  h1 { font-size: 24px; }
  .admin-header { padding: 12px 16px; min-height: 64px; }
  .header-label { display: none; }
  .signed-in > .admin-header { display: none; }
  .login-panel { margin: 32px auto; padding: 24px; }
  #workspace { display: block; min-height: auto; }
  .app-rail { position: relative; padding: 8px 12px; gap: 4px; }
  .rail-brand { display: flex; padding: 0 4px; max-width: calc(100% - 88px); font-size: 16px; }
  #secondary-menu { order: 3; }
  #secondary-menu > summary { display: list-item; position: absolute; right: 16px; top: 8px; padding: 10px 8px; min-width: 76px; }
  .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .tabs button { justify-content: center; padding: 8px 2px; min-height: 44px; font-size: 12px; }
  .tabs .icon { display: none; }
  .rail-tools { flex-direction: row; flex-wrap: wrap; gap: 0 14px; margin: 4px 4px 0; }
  .rail-tools a { padding: 0; font-size: 12px; }
  .rail-tools .quiet { margin: 0 0 0 auto; padding: 4px 8px; font-size: 12px; border-color: transparent; }
  .setup-notice { margin: 0 4px; }
  .setup-notice summary { padding: 10px 0; }
  .setup-notice button { width: auto; }
  .work-content { padding: 24px 16px 40px; }
  .page-heading { margin-bottom: 20px; }
  .section-heading { gap: 12px; }
  button, .button { min-height: 44px; min-width: 44px; }
  .list-toolbar { flex-wrap: wrap; gap: 12px; margin-top: 20px; }
  .search-label { flex-basis: 100%; max-width: none; }
  .filter-label { flex: 1; width: auto; }
  .issue-table, .issue-table tbody, .issue-table tr, .issue-table td { display: block; }
  .issue-table { border: 0; background: transparent; }
  .issue-table thead { display: none; }
  .issue-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; background: white; padding: 16px; border: 1px solid var(--line); border-bottom: 0; }
  .issue-table tr:last-child { border-bottom: 1px solid var(--line); }
  .issue-table td { padding: 0; border: 0; }
  .issue-table td:first-child { grid-column: 1 / -1; }
  .issue-item { min-height: 44px; font-size: 16px; }
  .revision-cell { align-self: center; }
  .revision-cell::before { content: attr(data-label) " "; }
  .empty { border-top: 1px solid var(--line); padding: 28px 16px; }
  .editor-top { flex-wrap: wrap; gap: 4px; padding-bottom: 8px; }
  .editor-top > button { margin: 0; }
  .editor-commandbar { padding: 12px 0; }
  .editor-commandbar .editor-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .issue-details, .story { padding: 16px; }
  .story-header { flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .story-buttons { gap: 4px; }
  .story-references summary span { display: block; margin: 2px 0 0 18px; }
  .issue-delivery .section-heading { flex-direction: column; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .brand-section { padding: 16px; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .form-actions > span { grid-column: 1 / -1; }
  .key-form { flex-direction: column; align-items: stretch; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px; }
  .row-identity { grid-column: 1 / -1; }
  .row-actions { grid-column: 1 / -1; }
  dialog { padding: 16px; max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  #preview-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 16px 12px; border-radius: 0; }
  #preview-dialog header { align-items: flex-start; gap: 12px; }
  #preview-dialog header > div { min-width: 0; }
  #preview-dialog header > button { flex-shrink: 0; }
  #preview-text { padding: 12px; }
  .reader-header { padding: 12px 16px; flex-wrap: wrap; gap: 4px 16px; }
  .reader-header .reader-identity { font-size: 16px; }
  .reader-header nav { gap: 16px; }
  .public { margin: 28px auto; padding: 0 16px; }
  .reader-layout { display: flex; flex-direction: column; gap: 32px; }
  .invitation { order: -1; padding: 20px; width: 100%; }
  .archive { width: 100%; }
  .archive h2 { font-size: 22px; margin-bottom: 16px; }
  .archive-link { min-height: 44px; padding: 16px 0; font-size: 16px; }
  .confirmation-page { width: calc(100% - 32px); padding: 24px; }
  .docs-layout { display: block; }
  .docs-nav { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { button, .button { transition: none; } }

/* Distributor chrome: the authored email owns the loaded viewport. */
.distributor #workspace { display: flex; flex-direction: column; height: 100dvh; min-height: 0; }
.distributor-header { display: flex; align-items: center; gap: 16px; padding: 8px 20px; border-bottom: 1px solid var(--line); background: white; }
.distributor-brand { font-weight: 600; text-decoration: none; color: var(--ink); }
.distributor #secondary-menu { margin-left: auto; position: relative; }
.distributor #secondary-menu > summary { display: list-item; position: static; font-size: 14px; }
.distributor #secondary-menu nav { position: absolute; z-index: 5; right: 0; top: 48px; width: 230px; background: white; border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.distributor #secondary-menu nav a { padding: 10px; font-size: 14px; }
.distributor-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 12px 20px 0; }
.email-picker { display: flex; gap: 8px; }
#email-selector { flex: 1; width: 0; }
.email-identity { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; }
.email-identity h1 { margin: 0; font-size: 18px; letter-spacing: 0; min-width: 0; }
.email-metadata { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#issue-history { position: relative; font-size: 13px; }
#issue-history[open] { position: absolute; top: 128px; right: 20px; z-index: 3; background: white; padding: 12px 20px; border: 1px solid var(--line); max-width: min(480px, calc(100vw - 32px)); max-height: 65dvh; overflow: auto; overflow-wrap: anywhere; }
.canvas-toolbar { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 8px; }
.canvas-toolbar > div { display: flex; gap: 4px; }
.canvas-toolbar button { padding: 8px 12px; }
.canvas-toolbar [aria-pressed="true"] { color: var(--accent); background: var(--selected); border-color: #9cb4d9; }
#email-canvas { display: flex; align-items: stretch; flex: 1; min-height: 160px; overflow: auto; background: #dfe5ed; border: 1px solid var(--line); }
.distributor #preview-frame { width: 800px; flex: 0 0 auto; height: 100%; min-height: 160px; margin: 0 auto; background: white; border: 0; max-width: none; }
.distributor #preview-text, .distributor #preview-source { min-width: 0; width: 100%; margin: 0; padding: 20px; background: white; overflow: auto; border: 0; }
.email-empty { background: white; width: 100%; padding: 48px 24px; text-align: center; }
.email-empty p { margin: 0 auto 16px; max-width: 54ch; }
.preview-note { margin: 6px 0; font-size: 12px; }
.distributor #feedback { margin: 0; border-radius: 0; padding: 8px 20px; }
.distributor-secondary { padding: 32px max(20px, calc((100vw - 900px) / 2)); overflow: auto; flex: 1; }
#delivery-form { max-width: 520px; }
#delivery-save-state { display: block; margin-top: 12px; font-size: 14px; }
.distributor #send-dialog { width: 640px; }
#segment-selector { width: 100%; margin-bottom: 12px; }
#audience-status { margin-top: 12px; }
#recipient-details { margin-bottom: 16px; }
#recipient-list { padding-left: 24px; max-height: 200px; overflow: auto; overflow-wrap: anywhere; }
#send-feedback { color: var(--error); }
@media (max-width: 700px) {
  .distributor-header { gap: 8px; padding: 4px 12px; }
  .distributor-header > button { font-size: 13px; padding: 8px; }
  .distributor-brand { font-size: 15px; }
  .distributor-panel { padding: 8px 8px 0; }
  .email-picker { flex-wrap: wrap; gap: 4px; }
  #email-selector { flex-basis: calc(100% - 88px); }
  #review-send { margin-left: auto; font-size: 13px; padding: 8px 12px; }
  .email-identity { display: block; padding: 8px 4px; }
  .email-identity h1 { font-size: 16px; }
  .email-metadata { gap: 8px; height: 32px; }
  #issue-history > summary { min-height: 32px; padding: 4px 0; }
  #issue-history[open] { top: 164px; right: 12px; }
  .canvas-toolbar { flex-wrap: wrap; padding-bottom: 8px; gap: 4px; }
  .canvas-toolbar button { padding: 8px 10px; font-size: 13px; }
  .canvas-toolbar > div:last-child { margin-left: auto; }
  .canvas-toolbar select { font-size: 13px; padding: 4px; }
  .preview-note { font-size: 11px; }
  .distributor-secondary { padding: 24px 16px; }
}
