:root {
  color-scheme: light;
  --ink: #20342d;
  --ink-soft: #365248;
  --muted: #5f7067;
  --muted-deep: #55665d;
  --paper: #f3eee5;
  --paper-deep: #e9dfd1;
  --surface: #fffdf8;
  --surface-warm: #fff8ec;
  --surface-green: #eef4ed;
  --line: #d8cfc1;
  --line-strong: #b8aa98;
  --forest: #1e4d3e;
  --forest-dark: #14372d;
  --clay: #b96545;
  --clay-dark: #934833;
  --green: #2e7652;
  --yellow: #9b661e;
  --red: #a9433a;
  --focus: #d77b4e;
  --shadow-sm: 0 1px 4px rgb(42 45 35 / 0.045);
  --shadow-md: 0 8px 22px rgb(42 45 35 / 0.075);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 "Segoe UI Variable", "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
}
body::before { display: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif; }

.app-shell { min-height: 100dvh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid rgb(184 170 152 / .68);
  background: rgb(255 253 248 / .88);
  box-shadow: 0 1px 0 rgb(255 255 255 / .8);
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
}
.brand-lockup, .topbar-actions, .queue-item-head, .queue-badges, .detail-status-line, .manual-result-heading { display: flex; align-items: center; }
.brand-lockup { gap: 13px; min-width: 0; }
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / .55);
  border-radius: 12px 12px 12px 4px;
  background: var(--forest);
  color: #fffaf0;
  box-shadow: 4px 4px 0 rgb(185 101 69 / .26);
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 800;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.2;
}
h1 { margin-bottom: 0; font-size: clamp(17px, 1.7vw, 20px); letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: clamp(20px, 2.3vw, 28px); line-height: 1.15; letter-spacing: -.025em; }
h3 { margin-bottom: 0; font-size: 17px; }
.topbar-actions { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.account-switcher { display: flex; align-items: center; gap: 9px; color: var(--muted-deep); font-size: 12px; font-weight: 700; }
.account-switcher select {
  min-width: 188px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background-color: var(--surface);
  color: var(--ink);
  font-size: 13px;
}
.account-switch-feedback { min-width: 0; max-width: 180px; color: var(--red); font-size: 11px; font-weight: 700; }
.circuit-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgb(155 102 30 / .32);
  border-radius: 999px;
  color: var(--yellow);
  background: rgb(255 244 218 / .76);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.circuit-state.is-off { border-color: rgb(46 118 82 / .28); color: var(--green); background: rgb(232 244 233 / .78); }
.status-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 3px rgb(155 102 30 / .10); }
.circuit-state.is-off .status-dot, .status-dot.green, .risk-green .status-dot { background: var(--green); box-shadow: 0 0 0 3px rgb(46 118 82 / .10); }
.status-dot.yellow, .risk-yellow .status-dot { background: var(--yellow); box-shadow: 0 0 0 3px rgb(155 102 30 / .10); }
.status-dot.red, .risk-red .status-dot { background: var(--red); box-shadow: 0 0 0 3px rgb(169 67 58 / .10); }
.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 18px;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.icon-button:hover { border-color: var(--clay); background: var(--surface-warm); transform: translateY(-1px); }

.workspace {
  display: grid;
  grid-template-columns: minmax(196px, 208px) minmax(280px, 320px) minmax(0, 1fr);
  min-height: calc(100dvh - 76px);
}
.sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  display: flex;
  min-height: calc(100dvh - 76px);
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  padding: 32px 18px 24px;
  border-right: 1px solid rgb(184 170 152 / .64);
  background: linear-gradient(180deg, rgb(234 226 214 / .66), rgb(243 238 229 / .32));
}
.sidebar-account { padding: 0 8px; }
.sidebar-account strong { display: block; margin: 0 0 8px; font-family: "Noto Serif SC", Georgia, serif; font-size: 17px; line-height: 1.2; }
.sidebar-account-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-deep); font-size: 12px; }
.sidebar-section-label { margin: 0 8px 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted-deep);
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.nav-link:hover, .nav-link.is-active { border-color: rgb(185 101 69 / .24); background: rgb(255 253 248 / .78); color: var(--ink); transform: translateX(2px); }
.nav-link.is-active { box-shadow: inset 3px 0 var(--clay), var(--shadow-sm); font-weight: 800; }
.sidebar-note { display: flex; align-items: flex-start; gap: 9px; padding: 12px 10px; border-top: 1px solid rgb(184 170 152 / .64); color: var(--muted-deep); font-size: 12px; }

.queue-panel {
  position: sticky;
  top: 76px;
  align-self: start;
  height: calc(100dvh - 76px);
  overflow: auto;
  padding: 32px 18px 26px;
  border-right: 1px solid rgb(184 170 152 / .64);
  background: rgb(255 253 248 / .58);
  scrollbar-color: var(--line-strong) transparent;
}
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { font-size: 23px; }
.queue-heading-meta { display: grid; justify-items: end; gap: 4px; }
.queue-count { display: grid; min-width: 32px; height: 32px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--forest); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; font-weight: 800; }
.queue-heading-note { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.queue-list { display: grid; gap: 10px; }
.queue-empty { padding: 20px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--muted); background: rgb(255 253 248 / .72); }
.queue-empty strong, .queue-empty span { display: block; }
.queue-empty strong { margin-bottom: 5px; color: var(--ink); font-family: "Noto Serif SC", Georgia, serif; font-size: 15px; }
.queue-empty span { font-size: 12px; }
.queue-item {
  position: relative;
  width: 100%;
  padding: 15px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(255 253 248 / .86);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 0 rgb(255 255 255 / .86);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}
.queue-item::before { position: absolute; inset: 12px auto 12px 0; width: 3px; border-radius: 0 3px 3px 0; background: transparent; content: ""; }
.queue-item:hover { border-color: rgb(185 101 69 / .52); background: var(--surface); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.queue-item.is-selected { border-color: var(--forest); background: var(--surface); box-shadow: 0 0 0 2px rgb(30 77 62 / .10), var(--shadow-sm); }
.queue-item.is-selected::before { background: var(--clay); }
.queue-item-head { justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.queue-badges { justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.queue-item strong { display: block; margin-bottom: 7px; font-family: "Noto Serif SC", Georgia, serif; font-size: 15px; line-height: 1.35; }
.queue-kind, .queue-meta { color: var(--muted); font-size: 11px; }
.queue-meta { display: block; letter-spacing: .01em; }

.risk-pill, .state-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}
.risk-pill { letter-spacing: .01em; }
.risk-green { border-color: rgb(46 118 82 / .24); color: var(--green); background: #e7f2e7; }
.risk-yellow { border-color: rgb(155 102 30 / .27); color: var(--yellow); background: #fff2d6; }
.risk-red { border-color: rgb(169 67 58 / .25); color: var(--red); background: #fbe8e4; }
.state-pill { border-color: var(--line); color: var(--muted-deep); background: #f5f0e7; }
.state-pill.state-review { border-color: rgb(155 102 30 / .26); color: var(--yellow); background: #fff6df; }
.state-pill.state-ready { border-color: rgb(46 118 82 / .26); color: var(--green); background: #eaf4ea; }
.state-pill.state-blocked { border-color: rgb(169 67 58 / .26); color: var(--red); background: #fcebe8; }
.state-pill.state-pending { border-color: rgb(111 126 117 / .25); color: var(--muted-deep); background: #f4f0e9; }
.state-pill.state-current { min-height: 28px; padding-inline: 10px; border-color: rgb(30 77 62 / .22); color: var(--forest); background: var(--surface-green); }

.detail-panel { min-width: 0; padding: 34px clamp(22px, 5vw, 78px) 64px; }
.dashboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; max-width: 980px; margin: 0 0 24px; }
.dashboard-heading h2 { max-width: 640px; }
.dashboard-heading p:not(.eyebrow) { max-width: 620px; margin: 10px 0 0; color: var(--muted-deep); font-size: 14px; }
.dashboard-heading-actions { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 9px; flex-direction: column; }
.dashboard-review-link { text-decoration: none; }
.scope-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgb(46 118 82 / .24); border-radius: 999px; background: rgb(234 244 234 / .82); color: var(--forest); font-size: 12px; font-weight: 800; }
.summary-grid { display: grid; max-width: 980px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 30px; }
.summary-card { position: relative; display: grid; gap: 4px; min-height: 96px; padding: 15px 16px 14px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgb(255 253 248 / .86); box-shadow: var(--shadow-sm); }
.summary-card::after { display: none; }
.summary-card > span { color: var(--muted-deep); font-size: 12px; font-weight: 800; }
.summary-card > strong { color: var(--forest); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 28px; line-height: 1; }
.summary-card > small { color: var(--muted); font-size: 11px; }
.summary-card-alert { border-color: rgb(169 67 58 / .30); background: #fff8f2; }
.summary-card-alert::after { background: rgb(169 67 58 / .09); }
.summary-card-alert > strong { color: var(--red); }
.summary-card-success { border-color: rgb(46 118 82 / .28); background: #f4fbf3; }
.summary-card-success::after { background: rgb(46 118 82 / .08); }
.summary-card-success > strong { color: var(--green); }

.outcome-report {
  max-width: 980px;
  padding: 18px 20px 16px;
  margin: 0 0 22px;
  border: 1px solid rgb(30 77 62 / .18);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgb(238 244 237 / .78), rgb(255 253 248 / .92));
  box-shadow: var(--shadow-sm);
}
.outcome-report-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.outcome-report-heading h3 { font-size: 19px; }
.outcome-report-actions { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.report-refresh { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.report-state, .outcome-status { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-deep); background: #f5f0e7; font-size: 11px; font-weight: 800; white-space: nowrap; }
.report-state-pending, .outcome-status-pending { border-color: rgb(155 102 30 / .24); color: var(--yellow); background: #fff4db; }
.report-state-ready, .outcome-status-recorded { border-color: rgb(46 118 82 / .24); color: var(--green); background: #e7f2e7; }
.report-state-error, .outcome-status-error { border-color: rgb(169 67 58 / .25); color: var(--red); background: #fbe8e4; }
.outcome-report-note, .outcome-panel-note { margin: 0; color: var(--muted-deep); font-size: 12px; }
.outcome-history { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; margin: 10px 0 0; border: 1px solid rgb(185 101 69 / .20); border-radius: 999px; color: var(--clay-dark); background: rgb(255 253 248 / .70); font-size: 11px; font-weight: 800; }
.outcome-report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.outcome-metric { position: relative; display: grid; gap: 4px; min-height: 76px; padding: 11px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgb(255 253 248 / .84); }
.outcome-metric::after { display: none; }
.outcome-metric > span { color: var(--muted-deep); font-size: 11px; font-weight: 800; }
.outcome-metric > strong { color: var(--forest); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 25px; line-height: 1; }
.outcome-metric > small { color: var(--muted); font-size: 10px; }
.outcome-metric-primary { border-color: rgb(30 77 62 / .28); background: var(--surface-green); }
.outcome-metric-primary > strong { color: var(--forest); }
.outcome-metric-order { border-color: rgb(185 101 69 / .26); background: #fff8ec; }
.outcome-metric-order > strong { color: var(--clay-dark); }
.outcome-metric-inquiry { border-color: rgb(46 118 82 / .26); background: #f4fbf3; }
.outcome-metric-inquiry > strong { color: var(--green); }
.outcome-breakdown { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 12px; margin-top: 12px; border-top: 1px solid rgb(30 77 62 / .12); }
.outcome-chip { display: inline-flex; min-height: 26px; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-deep); background: rgb(255 255 255 / .62); font-size: 11px; }
.outcome-chip strong { min-width: 14px; color: var(--forest); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; }
.outcome-send-summary { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.outcome-send-summary span { color: var(--muted-deep); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 800; }

.queue-filter-bar {
  display: flex;
  max-width: 980px;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(255 253 248 / .72);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 96px;
}
.queue-filter-label { margin-right: 3px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.queue-filter-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted-deep);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease;
}
.queue-filter-link:hover { border-color: rgb(185 101 69 / .30); background: var(--surface-warm); color: var(--clay-dark); transform: translateY(-1px); }
.queue-filter-link.is-active, .queue-filter-link[aria-pressed="true"] { border-color: rgb(30 77 62 / .24); background: var(--surface-green); color: var(--forest); }
.queue-filter-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding-inline: 4px; border-radius: 999px; background: rgb(30 77 62 / .10); color: inherit; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }

.review-panel { max-width: 980px; scroll-margin-top: 96px; }
.review-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 0 2px 12px; }
.review-panel-heading h3 { font-size: 20px; }
.review-filter-empty { padding: 18px 16px; margin: 0 0 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--muted-deep); background: rgb(255 253 248 / .72); }

.manual-entry-panel, .account-access-panel { max-width: 980px; padding: 22px 24px 24px; margin: 0 0 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg, rgb(255 253 248 / .95), rgb(255 248 236 / .82)); box-shadow: var(--shadow-sm); }
.candidate-entry-panel { border-color: rgb(155 102 30 / .22); background: rgb(255 253 248 / .94); }
.manual-entry-header, .account-access-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 11px; }
.manual-entry-header h2, .account-access-header h2 { font-size: 21px; }
.manual-entry-note { margin: 0 0 18px; color: var(--muted-deep); font-size: 13px; }
.manual-entry-note strong { color: var(--ink); }
.manual-entry-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; align-items: end; }
.manual-entry-form label { display: grid; gap: 6px; color: var(--muted-deep); font-size: 12px; font-weight: 800; }
.manual-entry-form input[type="text"], .manual-entry-form select, .manual-entry-form textarea, .official-item-form input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.manual-entry-form textarea { min-height: 86px; resize: vertical; line-height: 1.5; }
.manual-entry-form input:hover, .manual-entry-form select:hover, .manual-entry-form textarea:hover, .official-item-form input[type="text"]:hover { border-color: var(--clay); }
.manual-entry-wide { grid-column: 1 / -1; }
.manual-attestation { align-self: center; }
.manual-entry-form > button { justify-self: start; }
.manual-entry-feedback, .draft-feedback { min-height: 21px; margin: 13px 0 0; color: var(--muted-deep); font-size: 13px; }
.manual-entry-feedback[data-state="success"], .draft-feedback[data-state="success"] { color: var(--green); }
.manual-entry-feedback[data-state="error"], .draft-feedback[data-state="error"] { color: var(--red); }
.manual-entry-result { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.manual-result-heading { justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.manual-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; margin: 0; }
.manual-result-grid div { min-width: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: rgb(255 255 255 / .55); }
.manual-result-grid dd { overflow-wrap: anywhere; }
.manual-result-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 13px; }

.account-access-panel { background: linear-gradient(135deg, rgb(239 246 238 / .92), rgb(255 253 248 / .92)); }
.account-access-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 14px; }
.account-access-context div { min-width: 0; padding: 10px 12px; border: 1px solid rgb(46 118 82 / .20); border-radius: var(--radius-sm); background: rgb(255 255 255 / .58); }
.account-access-message { margin: 0 0 14px; color: var(--muted-deep); font-size: 13px; }
.account-access-message[data-state="success"] { color: var(--green); }
.account-access-message[data-state="error"] { color: var(--red); }
.account-access-actions { display: flex; gap: 9px; margin-bottom: 14px; }
.official-item-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.official-item-form > label:first-child { grid-column: 1 / -1; color: var(--muted-deep); font-size: 12px; font-weight: 800; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-deep); font-size: 12px; white-space: nowrap; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--forest); }
.official-access-collapsed { max-width: 980px; margin: 0 0 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--muted-deep); background: rgb(255 253 248 / .55); font-size: 13px; }
.official-access-collapsed summary { padding: 12px 14px; cursor: pointer; font-weight: 700; }

.detail-card { max-width: 980px; padding: 24px 26px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgb(255 253 248 / .94); box-shadow: var(--shadow-md); }
.detail-card.is-hidden { display: none; }
.detail-card[hidden], .queue-item[hidden] { display: none; }
.detail-card, .reply-composer { scroll-margin-top: 96px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.detail-header h2 { font-size: clamp(22px, 2.5vw, 30px); }
.detail-status-line { gap: 8px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.status-context { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-deep); background: #f7f3eb; font-size: 11px; }
.source-comment { padding: 0 0 19px; margin-bottom: 19px; border-bottom: 1px solid var(--line); }
.source-comment-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--muted-deep); font-size: 12px; font-weight: 800; }
.source-comment-text { margin: 0 0 13px; padding: 13px 14px; border: 1px solid rgb(30 77 62 / .18); border-left: 4px solid var(--forest); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-green); overflow-wrap: anywhere; white-space: pre-wrap; }
.candidate-detail-card .source-comment-text { border-color: rgb(155 102 30 / .22); border-left-color: var(--yellow); background: #fffaf0; }
.source-comment-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.source-comment-meta div { min-width: 0; }
.context-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 0 0 18px; }
.context-grid div { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgb(255 255 255 / .58); }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 3px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.risk-reason { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; margin-bottom: 19px; border: 1px solid rgb(155 102 30 / .22); border-left: 4px solid var(--yellow); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #fff8e8; }
.risk-reason p { margin: 0; color: #70551e; }
.reply-composer { padding: 17px; border: 1px solid rgb(30 77 62 / .22); border-radius: var(--radius-md); background: linear-gradient(135deg, rgb(238 244 237 / .82), rgb(255 253 248 / .94)); }
.reply-composer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.reply-composer-caption { display: block; color: var(--muted); font-size: 12px; }
.draft-label { display: block; margin-bottom: 7px; color: var(--muted-deep); font-size: 12px; font-weight: 800; }
.draft-editor { width: 100%; min-height: 118px; padding: 13px 14px; resize: vertical; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: 0; background: var(--surface); color: var(--ink); line-height: 1.55; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.draft-editor:hover { border-color: var(--clay); }
.draft-editor:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgb(30 77 62 / .12); }
.draft-editor[readonly] { cursor: not-allowed; background: #f2eee6; color: var(--muted-deep); }
.reply-composer-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: end; margin-top: 13px; }
.send-evidence { margin: 0; color: var(--muted-deep); font-size: 12px; }
.channel-picker { display: flex; grid-column: 1 / -1; gap: 8px; padding: 0; margin: 0; border: 0; flex-wrap: wrap; }
.channel-picker legend { width: 100%; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 800; }
.channel-option { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / .62); color: var(--muted-deep); font-size: 12px; font-weight: 700; }
.channel-option:has(input:checked) { border-color: rgb(30 77 62 / .44); color: var(--forest); background: var(--surface-green); }
.channel-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--forest); }
.send-state { display: inline-flex; min-height: 24px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: #f5f0e7; color: var(--muted-deep); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: .04em; }
.send-state-ready { border-color: rgb(30 77 62 / .24); background: #eaf4ea; color: var(--forest); }
.send-state-sending { border-color: rgb(155 102 30 / .28); background: #fff4db; color: var(--yellow); }
.send-state-sent { border-color: rgb(46 118 82 / .28); background: #e5f4e8; color: var(--green); }
.send-state-failed { border-color: rgb(169 67 58 / .27); background: #fcebe7; color: var(--red); }
.send-state-unknown { border-color: rgb(155 102 30 / .28); background: #fff4db; color: var(--yellow); }
.send-reply-action { justify-self: end; white-space: nowrap; }
.outcome-panel { padding: 17px; margin-top: 18px; border: 1px solid rgb(185 101 69 / .24); border-radius: var(--radius-md); background: linear-gradient(135deg, rgb(255 248 236 / .82), rgb(255 253 248 / .94)); }
.outcome-panel-disabled { opacity: .82; }
.outcome-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.outcome-panel-heading h3 { font-size: 19px; }
.outcome-form { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr); gap: 10px 12px; align-items: end; margin-top: 13px; }
.outcome-form label { display: grid; gap: 6px; color: var(--muted-deep); font-size: 12px; font-weight: 800; }
.outcome-form-wide { grid-column: 1 / -1; }
.outcome-form select, .outcome-form input[type="text"], .outcome-form textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: 0; background: var(--surface); color: var(--ink); transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.outcome-form textarea { min-height: 62px; resize: vertical; line-height: 1.45; }
.outcome-form select:hover, .outcome-form input:hover, .outcome-form textarea:hover { border-color: var(--clay); }
.outcome-form select:focus, .outcome-form input:focus, .outcome-form textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgb(30 77 62 / .12); }
.outcome-form input:disabled, .outcome-form select:disabled, .outcome-form textarea:disabled { cursor: not-allowed; background: #f2eee6; color: var(--muted-deep); }
.outcome-submit { justify-self: start; min-height: 38px; }
.outcome-feedback { min-height: 20px; margin: 11px 0 0; color: var(--muted-deep); font-size: 12px; }
.outcome-feedback[data-state="success"] { color: var(--green); }
.outcome-feedback[data-state="error"] { color: var(--red); }
.outcome-result { padding-top: 10px; margin-top: 9px; border-top: 1px solid rgb(185 101 69 / .16); color: var(--muted-deep); font-size: 11px; }
.outcome-result strong { color: var(--ink); }
.outcome-recorded-label { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-weight: 800; }
.primary-action, .secondary-action { min-height: 40px; padding: 9px 15px; border-radius: 10px; font-weight: 800; line-height: 1.2; transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease; }
.primary-action { border: 1px solid var(--forest); background: var(--forest); color: #fffdf8; box-shadow: 0 3px 0 var(--forest-dark); }
.primary-action:hover { border-color: var(--forest-dark); background: var(--forest-dark); transform: translateY(-1px); }
.secondary-action { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.secondary-action:hover { border-color: var(--clay); background: var(--surface-warm); color: var(--clay-dark); transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .56; box-shadow: none; transform: none; }
.blocked-state { padding: 18px; border: 1px solid rgb(169 67 58 / .25); border-radius: var(--radius-md); background: #fff7f4; }
.blocked-state strong { color: var(--red); font-family: "Noto Serif SC", Georgia, serif; }
.blocked-state p { color: var(--muted-deep); }
.pending-state { border-color: rgb(155 102 30 / .24); background: #fffaf0; }
.audit-drawer { margin-top: 26px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted-deep); }
.audit-drawer summary { cursor: pointer; font-size: 13px; font-weight: 800; }
.audit-drawer ol { padding-left: 20px; margin-bottom: 0; font-size: 12px; }
.audit-drawer li { padding: 3px 0; }
.audit-drawer time, .audit-request-id { color: var(--muted); overflow-wrap: anywhere; }
.dashboard-announcer, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 390px); padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.login-panel h1 { margin: 0 0 22px; font-size: 26px; }
.login-form { display: grid; gap: 8px; }
.login-form label { color: var(--muted-deep); font-size: 13px; font-weight: 700; }
.login-form input { width: 100%; padding: 10px 11px; margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }

:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Promotion draft surface */
.promotion-draft-panel {
  padding: 16px 17px 15px;
  margin: 0 0 19px;
  border: 1px solid rgb(155 102 30 / .24);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgb(255 248 236 / .94), rgb(255 253 248 / .96));
  box-shadow: var(--shadow-sm);
}
.promotion-draft-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.promotion-draft-heading h3 { margin-bottom: 0; font-size: 18px; line-height: 1.2; }
.promotion-status {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}
.promotion-status-draft,
.promotion-status-policy_screened,
.promotion-status-awaiting_review {
  border-color: rgb(155 102 30 / .28);
  color: var(--yellow);
  background: #fff4da;
}
.promotion-status-approved_for_manual_post,
.promotion-status-approved_for_copy {
  border-color: rgb(46 118 82 / .28);
  color: var(--green);
  background: #eaf4ea;
}
.promotion-status-copied_for_post,
.promotion-status-copied_for_manual_post {
  border-color: rgb(185 101 69 / .28);
  color: var(--clay-dark);
  background: #fff0e6;
}
.promotion-status-manually_posted,
.promotion-status-outcome_recorded {
  border-color: rgb(30 77 62 / .26);
  color: var(--forest);
  background: var(--surface-green);
}
.promotion-status-rejected,
.promotion-status-blocked_by_policy,
.promotion-status-expired {
  border-color: rgb(169 67 58 / .27);
  color: var(--red);
  background: #fcebe7;
}
.promotion-draft-note {
  margin: 0 0 13px;
  color: var(--muted-deep);
  font-size: 12px;
  line-height: 1.45;
}
.promotion-gates {
  padding: 11px 12px 12px;
  margin-bottom: 13px;
  border: 1px solid rgb(155 102 30 / .19);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / .52);
}
.promotion-gates-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.promotion-gates-heading strong { color: var(--ink); font-size: 12px; }
.promotion-gates-state { color: var(--muted); font-size: 11px; font-weight: 800; }
.promotion-gate-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.promotion-gate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 7px;
  min-width: 0;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted-deep);
  background: rgb(255 253 248 / .72);
  font-size: 11px;
  line-height: 1.25;
}
.promotion-gate .status-dot { grid-row: 1 / span 2; align-self: start; margin-top: 2px; }
.promotion-gate span:not(.status-dot) { min-width: 0; overflow-wrap: anywhere; }
.promotion-gate small { grid-column: 2; color: var(--muted); font-size: 10px; line-height: 1.2; }
.promotion-gate-passed { border-color: rgb(46 118 82 / .24); background: #f2f8f1; }
.promotion-gate-failed { border-color: rgb(169 67 58 / .24); background: #fff3f0; }
.promotion-gate-pending { border-color: rgb(155 102 30 / .20); background: #fffaf0; }
.promotion-gate-blocked { border-color: rgb(169 67 58 / .20); background: #fff7f4; }
.promotion-entry-panel { border-color: rgb(30 77 62 / .24); background: linear-gradient(135deg, rgb(238 244 237 / .94), rgb(255 253 248 / .97)); }
.promotion-entry-guidance { margin: 0 0 12px; color: var(--muted-deep); font-size: 12px; line-height: 1.5; }
.promotion-create-note { grid-column: 1 / -1; margin: -1px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.promotion-gate { grid-template-columns: auto auto minmax(0, 1fr); align-items: start; }
.promotion-gate-index { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--forest); background: var(--surface); font-size: 10px; font-weight: 800; }
.promotion-gate-body { min-width: 0; }
.promotion-gate-title-row { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-width: 0; }
.promotion-gate-label { min-width: 0; color: var(--ink); font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.promotion-gate-result { flex: 0 0 auto; color: var(--muted-deep); font-size: 10px; font-weight: 800; white-space: nowrap; }
.promotion-gate-passed .promotion-gate-result { color: var(--green); }
.promotion-gate-failed .promotion-gate-result, .promotion-gate-blocked .promotion-gate-result { color: var(--red); }
.promotion-gate-next { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.promotion-gate-recorded-reason { margin: 5px 0 0; color: var(--muted-deep); font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.promotion-gate-form { display: grid; gap: 7px; margin-top: 8px; }
.promotion-gate-reason { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.promotion-gate-reason textarea { width: 100%; min-height: 48px; padding: 7px 8px; resize: vertical; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: 0; background: var(--surface); color: var(--ink); font-size: 11px; line-height: 1.4; }
.promotion-gate-reason textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgb(30 77 62 / .12); }
.promotion-gate-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.promotion-gate-action { min-height: 30px; padding: 5px 10px; font-size: 11px; box-shadow: none; }
.promotion-gate-action-pass { border-color: rgb(46 118 82 / .35); color: var(--green); background: #f2f8f1; }
.promotion-gate-action-pass:hover { border-color: var(--green); background: #eaf4ea; }
.promotion-gate-action-fail { border-color: rgb(169 67 58 / .30); color: var(--red); background: #fff7f4; }
.promotion-gate-action-fail:hover { border-color: var(--red); background: #fcebe7; }
.promotion-draft-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 11px;
  align-items: end;
}
.promotion-editor-label {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  color: var(--muted-deep);
  font-size: 12px;
  font-weight: 800;
}
.promotion-editor {
  width: 100%;
  min-height: 104px;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.promotion-editor:hover,
.promotion-outcome-field select:hover,
.promotion-outcome-field input:hover,
.promotion-outcome-field textarea:hover { border-color: var(--clay); }
.promotion-editor:focus,
.promotion-outcome-field select:focus,
.promotion-outcome-field input:focus,
.promotion-outcome-field textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgb(30 77 62 / .12);
}
.promotion-editor[readonly] { cursor: text; background: #f2eee6; color: var(--muted-deep); }
.promotion-outcome-field {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted-deep);
  font-size: 12px;
  font-weight: 800;
}
.promotion-outcome-field select,
.promotion-outcome-field input,
.promotion-outcome-field textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.promotion-outcome-field textarea { min-height: 62px; resize: vertical; line-height: 1.45; }
.promotion-outcome-field input:disabled,
.promotion-outcome-field select:disabled,
.promotion-outcome-field textarea:disabled { cursor: not-allowed; background: #f2eee6; color: var(--muted-deep); }
.promotion-action { justify-self: start; min-height: 38px; white-space: nowrap; }
.promotion-feedback {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--muted-deep);
  font-size: 12px;
}
.promotion-feedback[data-state="success"] { color: var(--green); }
.promotion-feedback[data-state="error"] { color: var(--red); }
.promotion-terminal-state { grid-column: 1 / -1; padding: 12px 13px; }
.promotion-terminal-state strong { display: block; font-family: "Noto Serif SC", Georgia, serif; }
.promotion-terminal-state p { margin: 4px 0 0; color: var(--muted-deep); font-size: 12px; }

@media (max-width: 900px) {
  .promotion-gate-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .promotion-draft-panel { padding: 14px 13px 13px; }
  .promotion-gate-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promotion-draft-editor { grid-template-columns: 1fr; }
  .promotion-editor-label, .promotion-feedback, .promotion-terminal-state { grid-column: 1; }
  .promotion-action { width: 100%; }
}

@media (max-width: 420px) {
  .promotion-draft-heading { display: grid; gap: 8px; }
  .promotion-status { justify-self: start; }
  .promotion-gate-list { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 190px minmax(280px, 320px) minmax(0, 1fr); }
  .detail-panel { padding-inline: clamp(18px, 3vw, 42px); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outcome-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The three-column desktop layout needs the full review width. At laptop
   widths, stack the navigation and queue before the review surface so the
   composer never becomes a clipped fourth column. */
@media (max-width: 1100px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .account-switch-feedback { max-width: none; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar, .queue-panel { position: static; height: auto; min-height: 0; }
  .sidebar { display: block; padding: 14px 16px 12px; border-right: 0; border-bottom: 1px solid rgb(184 170 152 / .64); }
  .sidebar-account { display: inline-flex; align-items: center; gap: 12px; padding: 0; }
  .sidebar-account .eyebrow { margin-bottom: 0; }
  .sidebar-account strong { margin-bottom: 0; }
  .sidebar-account-status { display: none; }
  .sidebar-section-label { display: none; }
  .sidebar nav { display: flex; gap: 5px; margin-top: 12px; overflow-x: auto; }
  .nav-link { min-height: 38px; flex: 0 0 auto; white-space: nowrap; }
  .nav-link.is-active { box-shadow: inset 0 -3px var(--clay), var(--shadow-sm); }
  .sidebar-note { display: none; }
  .queue-panel { padding: 22px 16px; border-right: 0; border-bottom: 1px solid rgb(184 170 152 / .64); }
  .queue-list { grid-template-columns: repeat(3, minmax(210px, 1fr)); overflow-x: auto; padding: 2px 2px 8px; }
  .detail-panel { padding: 26px 16px 44px; }
}

@media (max-width: 640px) {
  .topbar { padding: 13px 15px; }
  .brand-mark { width: 36px; height: 36px; }
  .topbar-actions { gap: 8px; }
  .account-switcher { width: 100%; justify-content: space-between; }
  .account-switcher select { flex: 1; min-width: 0; }
  .dashboard-heading { display: grid; gap: 14px; }
  .dashboard-heading-actions { align-items: flex-start; }
  .scope-chip { justify-self: start; }
  .queue-filter-bar { align-items: stretch; flex-wrap: wrap; }
  .queue-list { grid-template-columns: 1fr; overflow: visible; }
  .queue-filter-label { width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 22px; }
  .summary-card { min-height: 86px; padding: 12px; }
  .outcome-report { padding: 16px; }
  .outcome-form { grid-template-columns: 1fr; }
  .outcome-form-wide { grid-column: auto; }
  .manual-entry-panel, .account-access-panel, .detail-card { padding: 18px 16px 19px; border-radius: var(--radius-md); }
  .manual-entry-form { grid-template-columns: 1fr; }
  .manual-entry-wide { grid-column: auto; }
  .manual-entry-form > button { width: 100%; }
  .account-access-context, .source-comment-meta, .manual-result-grid { grid-template-columns: 1fr; }
  .official-item-form { grid-template-columns: 1fr; }
  .official-item-form > label:first-child { grid-column: auto; }
  .checkbox-label { white-space: normal; }
  .context-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reply-composer-footer { grid-template-columns: 1fr; }
  .send-reply-action, .manual-result-actions > * { width: 100%; }
  .outcome-submit { width: 100%; }
}

@media (max-width: 420px) {
  .queue-list { grid-template-columns: minmax(245px, 1fr); }
  .context-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .detail-header, .manual-entry-header, .account-access-header { display: grid; gap: 9px; }
  .detail-header > .risk-pill, .manual-entry-header > .risk-pill, .account-access-header > .risk-pill { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Human-review composer emphasis */
.reply-composer-hint {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  margin: 0 0 10px;
  border: 1px solid rgb(30 77 62 / .18);
  border-left: 3px solid var(--forest);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgb(255 253 248 / .76);
  color: var(--muted-deep);
}
.reply-composer-hint-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--forest);
  color: #fffdf8;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
}
.reply-composer-hint p { display: grid; gap: 2px; margin: 0; font-size: 12px; line-height: 1.4; }
.reply-composer-hint strong { color: var(--ink); }
.send-action-stack { display: grid; justify-items: end; gap: 5px; }
.send-action-note { color: var(--forest); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.send-reply-action { min-width: 142px; min-height: 44px; padding-inline: 18px; box-shadow: 0 4px 0 var(--forest-dark), 0 7px 14px rgb(30 77 62 / .13); }
.send-reply-action:hover { box-shadow: 0 5px 0 var(--forest-dark), 0 9px 18px rgb(30 77 62 / .16); }
.send-reply-action:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--forest-dark), 0 4px 10px rgb(30 77 62 / .11); }
.channel-picker { gap: 7px; align-items: center; }
.channel-option { min-height: 40px; padding: 7px 12px; cursor: pointer; transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease; }
.channel-option:hover { border-color: var(--clay); background: var(--surface-warm); color: var(--ink); }
.channel-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.channel-option:has(input:checked) { box-shadow: inset 0 0 0 1px rgb(30 77 62 / .10); }

/* Promotion gate sequence */
.promotion-gates-heading { padding-bottom: 2px; }
.promotion-gates-heading strong { display: inline-flex; align-items: center; gap: 7px; }
.promotion-gates-heading strong::before { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); content: ""; box-shadow: 0 0 0 3px rgb(155 102 30 / .10); }
.promotion-gates-state[data-gates-state="approved"], .promotion-gates-state[data-gates-state="ready_for_draft"] { color: var(--green); }
.promotion-gates-state[data-gates-state="blocked"] { color: var(--red); }
.promotion-gate { position: relative; min-height: 92px; padding: 9px 9px 9px 8px; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.promotion-gate:hover { border-color: rgb(185 101 69 / .42); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.promotion-gate::after { position: absolute; top: 50%; right: -8px; width: 7px; height: 1px; background: var(--line-strong); content: ""; }
.promotion-gate:last-child::after { display: none; }
.promotion-gate-index { width: 22px; height: 22px; font-size: 10px; }
.promotion-gate-passed .promotion-gate-index { border-color: rgb(46 118 82 / .35); color: var(--green); background: #eaf4ea; }
.promotion-gate-failed .promotion-gate-index, .promotion-gate-blocked .promotion-gate-index { border-color: rgb(169 67 58 / .30); color: var(--red); background: #fff0ed; }
.promotion-gate-title-row { align-items: flex-start; }
.promotion-gate-label { font-weight: 800; }
.promotion-gate-result { padding: 2px 5px; border-radius: 999px; background: rgb(255 255 255 / .56); }
.promotion-gate-passed .promotion-gate-result { background: #eaf4ea; }
.promotion-gate-failed .promotion-gate-result, .promotion-gate-blocked .promotion-gate-result { background: #fcebe7; }
.promotion-gate-form { padding-top: 2px; border-top: 1px dashed rgb(155 102 30 / .22); }
.promotion-gate-actions .promotion-gate-action { min-width: 62px; min-height: 36px; }

@media (max-width: 900px) {
  .reply-composer-footer { grid-template-columns: minmax(0, 1fr) auto; }
  .promotion-gate::after { display: none; }
}
@media (max-width: 640px) {
  .reply-composer { padding: 14px; }
  .reply-composer-heading { align-items: center; }
  .reply-composer-hint { margin-bottom: 9px; }
  .reply-composer-footer { gap: 10px; }
  .send-action-stack { justify-items: stretch; }
  .send-action-note { text-align: left; }
  .send-reply-action { min-width: 0; }
  .channel-picker { align-items: stretch; }
  .channel-option { flex: 1 1 150px; justify-content: center; }
  .promotion-gate { min-height: 0; }
  .promotion-gate-actions .promotion-gate-action { flex: 1 1 120px; }
}
@media (max-width: 420px) {
  .reply-composer-heading { display: grid; gap: 8px; }
  .reply-composer-heading .send-state { justify-self: start; }
  .reply-composer-hint-mark { width: 22px; height: 22px; }
  .channel-option { flex-basis: 100%; justify-content: flex-start; }
  .promotion-gates { padding-inline: 9px; }
  .promotion-gate { grid-template-columns: auto auto minmax(0, 1fr); }
  .promotion-gate-title-row { display: grid; gap: 4px; }
  .promotion-gate-result { justify-self: start; }
}
