:root {
  --ink: #10253f;
  --muted: #526477;
  --blue: #0b4f86;
  --blue-dark: #073b66;
  --pale: #eef5fb;
  --gold: #d6a329;
  --line: #cbd8e4;
  --danger: #a62929;
  --success: #26734d;
  --paper: #ffffff;
  --shadow: 0 14px 35px rgba(16, 37, 63, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, sans-serif;
  background: #f7f9fb;
  line-height: 1.55;
}
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, .button { touch-action: manipulation; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.75rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--blue);
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.9rem max(1.25rem, calc((100% - 78rem) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header > a { color: var(--ink); text-decoration: none; font-size: 1.08rem; }
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.site-header nav a { font-weight: 700; text-decoration: none; }
body > footer { padding: 2rem; text-align: center; color: #fff; background: var(--ink); }
.message-stack {
  position: fixed;
  top: 4.75rem;
  right: 1rem;
  z-index: 50;
  display: grid;
  gap: 0.5rem;
  width: min(26rem, calc(100% - 2rem));
}
.message { padding: 0.85rem 1rem; color: #fff; background: var(--blue-dark); border-radius: 0.5rem; box-shadow: var(--shadow); }
.message.error { background: var(--danger); }
.message.success { background: var(--success); }

.hero, .topic-header, .release-list, .timeline { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; }
.hero, .topic-header { padding: 4rem 0 2rem; }
.hero.narrow { max-width: 44rem; }
.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--blue);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.hero h1, .topic-header h1, .studio-heading h1 {
  margin: 0.35rem 0 1rem;
  font-family: Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.02;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.68rem 1rem;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 0.4rem;
  cursor: pointer;
}
.button:hover { background: var(--blue-dark); }
.button.secondary { color: var(--blue); background: #fff; }
.button.secondary:hover { background: var(--pale); }
.button.compact { min-height: 2.2rem; padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.text-button, .danger-link {
  padding: 0;
  color: var(--blue);
  font-weight: 700;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.danger-link { color: var(--danger); }
.danger-button {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  color: #fff;
  font-weight: 800;
  background: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 0.4rem;
  cursor: pointer;
}

.release-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; padding: 1rem 0 4rem; }
.release-list article, .release { padding: 1.35rem; background: #fff; border: 1px solid var(--line); border-radius: 0.55rem; }
.release-list h2, .release h2 { margin: 0.35rem 0; font-family: Georgia, serif; }
.release-list article > span, .release-list article > small { display: block; margin-top: 0.4rem; color: var(--muted); font-size: 0.82rem; }
.release-list .recalled-label { color: var(--danger); font-weight: 800; }
.public-search { display: flex; align-items: end; gap: 0.75rem; width: min(72rem, calc(100% - 2rem)); margin: 0 auto 1rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 0.55rem; }
.public-search label { display: grid; flex: 1; gap: 0.3rem; min-width: 10rem; font-weight: 800; }
.public-search input, .public-search select { width: 100%; min-height: 2.7rem; padding: 0.6rem; border: 1px solid #9caebe; border-radius: 0.35rem; }
.timeline { display: grid; gap: 1.25rem; padding: 1rem 0 4rem; }
.timeline-entry { border-left: 5px solid var(--blue); }
.timeline-entry.recalled { background: #fff7f7; border-left-color: var(--danger); }
.lede, .document-lede { font-size: 1.16rem; }
.published { color: var(--muted); font-size: 0.9rem; }
.release-body { font-family: Georgia, serif; font-size: 1.04rem; }
.release-body img { max-width: 100%; height: auto; }

.studio-body > .site-header, .studio-body > footer { display: none; }
.studio-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.studio-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 100vh;
  padding: 2rem 1.25rem;
  color: #fff;
  background: var(--ink);
}
.studio-sidebar .eyebrow { color: #9bc7ec; }
.studio-sidebar strong { display: block; font-family: Georgia, serif; font-size: 1.5rem; }
.studio-sidebar span { color: #c9d6e2; font-size: 0.88rem; }
.studio-sidebar nav { display: grid; gap: 0.35rem; }
.studio-sidebar nav a, .studio-sidebar .text-button { padding: 0.7rem 0.75rem; color: #fff; text-align: left; text-decoration: none; border-radius: 0.35rem; }
.studio-sidebar nav a:hover, .studio-sidebar .text-button:hover { background: rgba(255, 255, 255, 0.12); }
.studio-sidebar form { margin-top: auto; }
.studio-main { min-width: 0; padding: 2rem clamp(1rem, 3vw, 3rem) 4rem; }
.studio-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin: 0 auto 1.5rem;
  max-width: 88rem;
}
.studio-heading h1 { max-width: 58rem; font-size: clamp(2rem, 4vw, 3.5rem); }
.studio-heading p:not(.eyebrow) { max-width: 48rem; margin-bottom: 0; color: var(--muted); }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.65rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(8rem, 1fr)); gap: 0.8rem; max-width: 88rem; margin: 0 auto 1rem; }
.metric-grid article { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.15rem; background: #fff; border: 1px solid var(--line); border-radius: 0.55rem; }
.metric-grid span { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.metric-grid strong { font-family: Georgia, serif; font-size: 1.8rem; }

.studio-panel { max-width: 88rem; margin: 0 auto 1rem; padding: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; box-shadow: 0 5px 18px rgba(16, 37, 63, 0.04); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2 { margin: 0; font-family: Georgia, serif; }
.panel-heading > span { color: var(--muted); font-size: 0.84rem; font-weight: 700; }
.topic-table, .release-worklist { display: grid; }
.topic-row, .release-work-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto 1.5rem; align-items: center; gap: 1rem; padding: 1rem 0.25rem; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); }
.topic-row:first-child, .release-work-row:first-child { border-top: 0; }
.topic-row small, .release-work-row small, .release-work-row em { display: block; color: var(--muted); font-size: 0.82rem; font-style: normal; }
.topic-status { display: inline-flex; width: fit-content; padding: 0.28rem 0.55rem; color: var(--blue-dark); font-size: 0.74rem; font-weight: 800; background: var(--pale); border-radius: 999px; }
.status-published, .status-approved, .status-active { color: #175b3b; background: #e9f7ef; }
.status-changes_requested, .status-recalled, .status-failed { color: #8a2525; background: #fff0f0; }
.status-captured, .status-sent { color: #175b3b; background: #e9f7ef; }
.status-partial, .status-queued, .status-paused { color: #74510a; background: #fff7d9; }
.sequence { display: grid; width: 2.3rem; height: 2.3rem; place-items: center; color: #fff; font-weight: 800; background: var(--blue); border-radius: 50%; }
.notice { display: flex; gap: 0.6rem; max-width: 88rem; margin: 0 auto 1rem; padding: 0.85rem 1rem; color: #694c08; background: #fff8df; border: 1px solid #ecd690; border-radius: 0.5rem; }
.compact-notice { margin: 0 0 1rem; }
.empty-state { padding: 2.5rem 1rem; text-align: center; }
.empty-state h3 { margin-bottom: 0.35rem; font-family: Georgia, serif; font-size: 1.5rem; }
.empty-state p { color: var(--muted); }

.form-workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 0.8fr); gap: 1rem; max-width: 76rem; margin: 0 auto; }
.form-panel, .guidance-card { width: 100%; margin: 0; }
.guidance-card { align-self: start; }
.guidance-card h2 { margin-top: 0.3rem; font-family: Georgia, serif; }
.guidance-card li { margin-bottom: 0.5rem; font-weight: 700; }
.studio-form { display: grid; gap: 1rem; }
.compact-form { margin-top: 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; align-content: start; gap: 0.35rem; }
.field-wide { grid-column: 1 / -1; }
.field > span, fieldset legend { font-weight: 800; }
.field small, .field-help { color: var(--muted); font-size: 0.8rem; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { width: 100%; min-height: 2.7rem; padding: 0.65rem 0.7rem; color: var(--ink); background: #fff; border: 1px solid #9caebe; border-radius: 0.35rem; }
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .rich-text-editor:focus { outline: 3px solid rgba(11, 79, 134, 0.2); border-color: var(--blue); }
.field input:disabled, .field select:disabled, .field textarea:disabled { color: #596978; background: #edf1f4; }
.errorlist { margin: 0.2rem 0 0; padding-left: 1.15rem; color: var(--danger); font-size: 0.82rem; font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }
.release-builder { max-width: 88rem; }

.rich-text-shell { overflow: hidden; background: #fff; border: 1px solid #9caebe; border-radius: 0.45rem; }
.rich-text-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem; border-bottom: 1px solid var(--line); }
.rich-text-heading span { display: block; font-weight: 800; }
.rich-text-heading small { color: var(--muted); }
.rich-text-toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.55rem; background: #f4f7fa; border-bottom: 1px solid var(--line); }
.rich-text-toolbar button, .rich-text-toolbar select { min-height: 2.25rem; padding: 0.35rem 0.55rem; color: var(--ink); background: #fff; border: 1px solid #a8b7c5; border-radius: 0.3rem; cursor: pointer; }
.rich-text-editor { min-height: 25rem; padding: 1.25rem; font-family: Georgia, serif; font-size: 1.04rem; }
.rich-text-editor:empty::before { color: #718293; content: "Load a template outline or begin writing the release here."; }
.rich-text-status { margin: 0; padding: 0.5rem 0.75rem; color: var(--muted); font-size: 0.8rem; background: #f8fafc; border-top: 1px solid var(--line); }

.editor-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(19rem, 0.8fr); gap: 1rem; max-width: 88rem; margin: 0 auto; }
.editor-main, .editor-rail { min-width: 0; }
.editor-main .studio-panel, .editor-rail .studio-panel { width: 100%; margin-left: 0; margin-right: 0; }
.editor-rail { align-self: start; }
.review-summary, .message-envelope { display: grid; gap: 0.55rem; margin: 0 0 1rem; }
.review-summary div, .message-envelope div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.6rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.review-summary dt, .message-envelope dt { color: var(--muted); font-size: 0.76rem; font-weight: 800; text-transform: uppercase; }
.review-summary dd, .message-envelope dd { margin: 0; }
details { margin-top: 0.8rem; }
details > summary { color: var(--blue); font-weight: 800; cursor: pointer; }
.review-decision-form { display: grid; gap: 1rem; }
.review-decision-form fieldset, .audience-form fieldset { display: grid; gap: 0.55rem; margin: 0; padding: 0.8rem; border: 1px solid var(--line); border-radius: 0.4rem; }
.review-decision-form fieldset label { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; align-items: start; }
.review-decision-form fieldset .errorlist { grid-column: 2; }
.decision-list, .audit-list { display: grid; gap: 0.65rem; padding-left: 1.2rem; }
.decision-list li { padding-left: 0.25rem; }
.decision-list span, .decision-list small { display: block; color: var(--muted); font-size: 0.78rem; }
.publish-gate { padding: 0.8rem; background: var(--pale); border-left: 4px solid var(--blue); }
.recall-form { padding-top: 0.75rem; border-top: 1px solid var(--line); }
.audit-list { list-style: none; padding: 0; }
.audit-list li { display: grid; grid-template-columns: 10rem minmax(0, 1fr) auto; gap: 0.75rem; padding: 0.65rem 0; border-top: 1px solid var(--line); }
.audit-list span, .audit-list small { color: var(--muted); font-size: 0.8rem; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.8rem; }
.media-card { overflow: hidden; border: 1px solid var(--line); border-radius: 0.45rem; }
.media-card > div:not(.media-preview) { padding: 0.8rem; }
.media-card h3 { margin: 0.2rem 0; }
.media-card p { font-size: 0.88rem; }
.media-preview { display: grid; min-height: 10rem; place-items: center; background: var(--pale); }
.media-preview img, .media-preview video { width: 100%; max-height: 15rem; object-fit: cover; }
.media-preview audio { width: calc(100% - 1rem); }
.media-actions { display: flex; justify-content: space-between; gap: 0.7rem; border-top: 1px solid var(--line); }
.media-actions form { margin: 0; }

.distribution-list, .recipient-list { display: grid; gap: 0.8rem; }
.distribution-list > article, .recipient-list > article { padding: 1rem; border: 1px solid var(--line); border-radius: 0.45rem; }
.distribution-summary, .recipient-list > article { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.distribution-summary h3, .recipient-list h3 { margin: 0.4rem 0 0.1rem; font-family: Georgia, serif; }
.distribution-summary p, .recipient-list p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.distribution-summary dl { display: flex; gap: 1rem; margin: 0; text-align: center; }
.distribution-summary dl div { min-width: 4.5rem; }
.distribution-summary dt { color: var(--muted); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.distribution-summary dd { margin: 0; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 800; }
.distribution-list article > form { margin-top: 0.8rem; }
.attempt-table { display: grid; margin-top: 0.6rem; border-top: 1px solid var(--line); }
.attempt-table > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.8rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.attempt-table span { overflow-wrap: anywhere; }
.attempt-table small { color: var(--muted); }
.audience-metrics { grid-template-columns: repeat(2, minmax(10rem, 1fr)); }
.recipient-actions { display: flex; align-items: center; gap: 0.7rem; }
.recipient-actions form { margin: 0; }
.narrow-panel { max-width: 48rem; }

.preview-page { width: min(76rem, calc(100% - 2rem)); margin: 2rem auto 4rem; }
.preview-banner { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; padding: 0.8rem 1rem; color: #624b11; background: #fff7d9; border: 1px solid #e8ce78; border-radius: 0.45rem; }
.preview-banner .button { margin-left: auto; }
.release-document { width: min(100%, 8.5in); margin: 0 auto; padding: clamp(1.25rem, 5vw, 0.7in); background: var(--paper); box-shadow: var(--shadow); }
.release-document > header { padding-bottom: 1rem; border-bottom: 5px solid var(--blue); }
.release-document h1, .release-document > header h2 { margin: 0.2rem 0 0.7rem; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; }
.document-lede { margin: 0.4rem 0; color: var(--blue-dark); }
.document-summary { color: var(--muted); font-weight: 700; }
.release-document .release-body { padding: 1.25rem 0; }
.document-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.document-media figure { margin: 0; }
.document-media img, .document-media video { width: 100%; max-height: 26rem; object-fit: contain; background: #edf2f6; }
.document-media audio { width: 100%; }
.document-media figcaption { margin-top: 0.4rem; color: var(--muted); font-size: 0.88rem; }
.media-title { display: block; margin-top: 0.45rem; }
.media-link { display: grid; min-height: 7rem; padding: 1rem; place-items: center; text-align: center; background: var(--pale); border: 1px solid var(--line); }
.public-action { margin: 1.25rem 0; padding: 1rem; background: #fff8df; border-left: 5px solid var(--gold); }
.public-action p { margin-bottom: 0; }
.document-contact { display: flex; gap: 0.7rem; padding-top: 1rem; color: var(--ink); background: transparent; border-top: 1px solid var(--line); }
.timeline-entry .release-document { width: 100%; padding: 0; box-shadow: none; }
.timeline-entry .release-document > header { border-bottom-width: 3px; }
.timeline-entry .release-document h1, .timeline-entry .release-document > header h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.audience-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(17rem, 0.75fr); gap: 1rem; max-width: 88rem; margin: 0 auto; }
.audience-layout .studio-panel { width: 100%; margin: 0 0 1rem; }
.email-preview .release-document { width: 100%; padding: 1.5rem; box-shadow: none; border: 1px solid var(--line); }

@page { size: Letter; margin: 0.55in; }
@media print {
  .site-header, body > footer, .button, .preview-banner { display: none !important; }
  body { background: #fff; }
  .topic-header, .timeline, .preview-page { width: 100%; margin: 0; padding: 0; }
  .topic-header { margin-bottom: 0.25in; }
  .topic-header h1 { font-size: 26pt; }
  .timeline-entry { padding: 0; border: 0; break-before: page; }
  .timeline-entry:first-child { break-before: auto; }
  .release-document { width: 100%; padding: 0; box-shadow: none; }
  .release-document h1 { font-size: 22pt; }
  .release-body { font-size: 11pt; }
  .document-media figure { break-inside: avoid; }
  details { display: block; }
  details summary { display: none; }
}

@media (max-width: 68rem) {
  .studio-layout { grid-template-columns: 1fr; }
  .studio-sidebar { position: static; display: grid; grid-template-columns: 1fr auto; height: auto; padding: 1rem; }
  .studio-sidebar nav { grid-column: 1 / -1; display: flex; overflow-x: auto; }
  .studio-sidebar form { margin: 0; }
  .editor-layout, .audience-layout { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 44rem) {
  .site-header, .studio-heading, .preview-banner { align-items: flex-start; flex-direction: column; }
  .public-search { align-items: stretch; flex-direction: column; }
  .hero, .topic-header { padding-top: 2.5rem; }
  .studio-main { padding: 1.2rem 0.8rem 3rem; }
  .studio-heading { align-items: stretch; }
  .heading-actions { justify-content: flex-start; }
  .form-workspace, .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .topic-row, .release-work-row { grid-template-columns: 1fr auto; gap: 0.5rem; }
  .topic-row > :first-child, .release-work-row > :first-child { grid-column: 1; }
  .topic-row > :nth-child(3), .release-work-row > :nth-child(3) { grid-column: 1; }
  .topic-row > :last-child, .release-work-row > :last-child { grid-column: 2; grid-row: 1 / span 2; }
  .notice { flex-direction: column; }
  .rich-text-heading { align-items: flex-start; flex-direction: column; }
  .rich-text-editor { min-height: 20rem; }
  .audit-list li { grid-template-columns: 1fr; gap: 0.1rem; }
  .release-document { padding: 1rem; }
  .document-media { grid-template-columns: 1fr; }
  .preview-banner .button { margin-left: 0; }
  .distribution-summary, .recipient-list > article { align-items: flex-start; flex-direction: column; }
  .distribution-summary dl { width: 100%; justify-content: space-between; }
  .attempt-table > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .recipient-actions { align-items: flex-start; flex-direction: column; }
}
