:root {
  --ink: #1b232c;
  --muted: #66707a;
  --paper: #f1ece3;
  --card: #fffcf8;
  --line: #e0d6c8;
  --accent: #b5471d;
  --accent-dark: #8c3414;
  --ok: #2f5d50;
  --draft: #7a7064;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(920px 360px at 2% -8%, #d4b896 0%, transparent 58%),
    var(--paper);
  line-height: 1.45;
}

a { color: var(--accent-dark); }

.shell {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}

body.staff .shell {
  padding-top: 2rem;
}

.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.brand {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
}

nav {
  display: flex;
  gap: 0.15rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

nav a:hover { color: var(--ink); background: #efe6d8; }

nav a.on {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.who {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.who-name { color: var(--ink); font-weight: 500; }

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #e4eee8;
  color: var(--ok);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  letter-spacing: -0.03em;
  margin: 0;
}

.lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 38rem;
}

.layout {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 1.25rem;
  align-items: start;
}

.layout.one { grid-template-columns: 1fr; }

@media (max-width: 860px) {
  .top { grid-template-columns: 1fr auto; }
  nav { grid-column: 1 / -1; }
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem 1.25rem 1.35rem;
  box-shadow: 0 12px 32px rgba(28, 36, 48, 0.045);
  margin-bottom: 1.15rem;
}

.panel h2 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

form { display: grid; gap: 0.55rem; }

label {
  display: grid;
  gap: 0.28rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

textarea { resize: vertical; min-height: 5.5rem; }

input:focus, textarea:focus, select:focus {
  outline: 2px solid #d4b08a;
  outline-offset: 1px;
}

.names { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.names.tight { gap: 0.35rem; }

.job-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem 0.85rem;
  align-items: end;
}

.job-form .grow { grid-column: span 2; }
.job-form .full { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .job-form { grid-template-columns: 1fr 1fr; }
}

button, .btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.95rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  width: fit-content;
  text-decoration: none;
}

button:hover, .btn:hover { background: var(--accent-dark); }

button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.ghost:hover { background: #efe8dc; }

.inline {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.inline select { width: auto; min-width: 7rem; }

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
}

table.data th input,
table.data th select {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
}

table.data th > input { width: 100%; }

.name-typeahead { position: relative; }
.name-typeahead input { width: 100%; }
.name-suggest {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 36, 48, 0.08);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
}
.name-suggest li {
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}
.name-suggest li:hover { background: #faf6ef; }

table.data th input::placeholder {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.th-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
}

.th-row select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

button.sorter {
  flex: 0 0 2rem;
  width: 2rem;
  padding: 0.35rem 0;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

button.sorter:hover,
button.sorter.on {
  color: var(--ink);
  background: #efe8dc;
}

table.data td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid #efe7db;
  vertical-align: middle;
}

table.data tbody tr:hover td { background: #faf6ef; }

td.title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.02rem;
  font-weight: 560;
}

td.mono { font-size: 0.85rem; color: var(--muted); }

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  background: #efe8dc;
  color: var(--ink);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.pill.open { background: #e4eee8; color: var(--ok); }
.pill.closed { background: #f0e4dc; color: var(--accent-dark); }
.pill.draft { background: #ece9e3; color: var(--draft); }
.pill.internal { background: #e7f3ee; color: var(--ok); }
.pill.tone-rejected { background: #fde6e2; color: #a33b2a; }
.pill.tone-hired { background: #dceee4; color: var(--ok); }
.pill.tone-step {
  background: color-mix(in srgb, #fde8d4 calc((1 - var(--t, 0)) * 100%), #d7efe3 calc(var(--t, 0) * 100%));
  color: color-mix(in srgb, #b5471d calc((1 - var(--t, 0)) * 100%), #2f5d50 calc(var(--t, 0) * 100%));
}

.empty { color: var(--muted); margin: 0; }

.auth h2 { margin-top: 0; }
.rule { height: 1px; background: var(--line); margin: 0.4rem 0 0.2rem; }

.check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.82rem;
}

.check input { width: auto; }

.flags { display: flex; flex-wrap: wrap; gap: 0.45rem 0.7rem; }

.checks span { display: flex; flex-wrap: wrap; gap: 0.7rem; padding-top: 0.35rem; }

.toolbar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1.1rem;
}

.toolbar.fields { align-items: end; }

.toolbar .grow { flex: 1; min-width: 0; }

.toolbar input[type="search"] {
  flex: 1;
  padding: 0.65rem 0.8rem;
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.1rem;
  font-size: 0.92rem;
}

.pager a { font-weight: 600; }

.btn-text {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
}

.btn-text:hover { text-decoration: underline; }

.panel.narrow { max-width: 32rem; }

.apply-wrap { max-width: 52rem; }

.apply-form { margin-top: 0.4rem; }

.apply-id {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.apply-id span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.apply-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.2rem 1.25rem;
  margin-bottom: 1rem;
}

.apply-section h2 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.apply-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.1rem;
}

.apply-field.full { grid-column: 1 / -1; }

.field-label.is-req { font-weight: 600; }

.req {
  color: var(--accent);
  font-weight: 700;
}

.apply-field.is-invalid input,
.apply-field.is-invalid textarea,
.apply-field.is-invalid select {
  border-color: var(--accent);
  background: #fdf4ef;
}

.form-banner {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  background: #fdf4ef;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent-dark);
  font-weight: 600;
}

.form-banner.ok {
  background: #eef6f2;
  border-color: var(--ok);
  color: var(--ok);
}

@keyframes flash-row {
  0%, 100% { background: transparent; }
  25% { background: #efe4d2; }
}

tr.flash-row td {
  animation: flash-row 0.9s ease 3;
  background: #f7f1e8;
}

.apply-submit { margin: 0.4rem 0 2rem; }

.app-review {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.review-split {
  display: grid;
  grid-template-columns: minmax(16rem, 0.9fr) minmax(22rem, 1.2fr);
  gap: 1.25rem;
  align-items: start;
}

.review-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1rem;
  align-self: start;
  height: calc(100dvh - 8rem);
  max-height: calc(100dvh - 8rem);
  min-height: 0;
}

.review-left .review-jd {
  position: static;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.review-jd {
  position: sticky;
  top: 1rem;
}

.review-jd-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.review-jd-title-block {
  min-width: 0;
}

.review-jd-title-block .eyebrow {
  margin: 0;
}

.review-jd-top .review-all-applicants {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

.review-job-title {
  font-size: 1.55rem;
  margin: 0.15rem 0 1rem;
  line-height: 1.2;
}

.review-job-title a { color: inherit; }

.review-person h1 {
  font-size: 1.55rem;
  margin: 0 0 0.2rem;
}

.review-person-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin: 0 0 0.85rem;
}

.review-person-head .lede { margin: 0; }

.review-person-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.review-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.review-side-by-side {
  font-size: 0.88rem;
  text-align: center;
}

.applicant-status { margin: 0.35rem 0 0.25rem; }

.review-person .hero-actions,
.review-person .compare-actions { margin: 0.85rem 0 1.1rem; }

.job-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1rem;
  margin: 0 0 1.15rem;
}

.job-metrics dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.job-metrics dd {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 560;
}

.job-metrics .inline { margin: 0; }

@media (max-width: 800px) {
  .apply-grid, .app-review, .apply-id, .review-split { grid-template-columns: 1fr; }
  .review-jd { position: static; }
  .review-left { position: static; height: auto; }
}

.stage-ring {
  --p: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0);
  vertical-align: middle;
}

.stage-ring > span {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 600;
}

tr.job-row.open .stage-ring > span { background: #f7f1e8; }

tr.job-row { cursor: pointer; }
tr.job-row.open td { background: #f7f1e8; }

.pulse-row td {
  background: #f7f1e8;
  padding: 0.85rem 1rem 1rem;
}

.pulse {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.pulse span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 560;
}

.locked {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  background: #f4efe6;
  border-radius: 8px;
  font-size: 0.95rem;
}

.locked span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose {
  white-space: pre-wrap;
  max-width: 42rem;
}

.prose.md { white-space: normal; }

.prose.md p { margin: 0 0 0.85rem; }

.prose.md h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: clamp(1.85rem, 3.5vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
}

.prose.md h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 560;
  margin: 1.25rem 0 0.4rem;
}

.prose.md p:last-child { margin-bottom: 0; }

.careers-hero {
  margin: 0 auto 1.75rem;
  max-width: 48rem;
}

.careers-hero .prose.md {
  max-width: none;
  margin: 0 auto;
}

.careers-hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: clamp(1.85rem, 3.5vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
}

.job-page {
  max-width: 48rem;
  margin: 0 auto;
}

.job-page .hero { margin-bottom: 1rem; }

.job-page .lede { max-width: none; }

.job-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.85rem 1.1rem;
  margin: 0 0 1.15rem;
}

.job-facts dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.job-facts dd {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 560;
}

.jobs-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.md-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1rem;
}

.md-edit textarea {
  min-height: 16rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.md-preview {
  min-height: 16rem;
  padding: 1.15rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

@media (max-width: 800px) {
  .md-edit { grid-template-columns: 1fr; }
}

table.data td.title a {
  color: inherit;
  text-decoration: none;
}

table.data td.title a:hover { color: var(--accent-dark); }

body.staff {
  background: #e9e4db;
}

.staff-bar {
  background: #1b232c;
  color: #efe8dc;
}

.staff-bar-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
}

.staff-bar .brand { color: #fff; }

.staff-bar nav a {
  color: #b7b1a7;
}

.staff-bar nav a:hover {
  color: #fff;
  background: #2c3642;
}

.staff-bar nav a.on {
  color: #fff;
  background: #2c3642;
  box-shadow: none;
}

.staff-bar .who-name { color: #efe8dc; }

.staff-bar .ghost {
  background: transparent;
  color: #efe8dc;
  border-color: #3d4754;
}

.staff-bar .ghost:hover { background: #2c3642; }

.btn-text.light { color: #e2c2a8; }
.staff-bar .btn-text.light.on { color: #fff; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.dash-search { margin-bottom: 1.25rem; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dash-stats .panel { margin: 0; }

.dash-open { position: relative; }

.dash-open .btn {
  position: absolute;
  right: 1.25rem;
  bottom: 1.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.stat-link { color: inherit; text-decoration: none; }

.dash-stats span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.bars {
  width: 100%;
  height: 7.5rem;
  display: block;
}

.chart-foot {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  align-items: center;
}

.donut { width: 8.5rem; height: 8.5rem; }

.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.donut-legend i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.donut-legend strong { margin-left: auto; font-family: Fraunces, Georgia, serif; }

.funnel-stats {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
}

.funnel-stats span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.funnel-stats strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
}

.funnel-stats em {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--muted);
}

.sankey-wrap { min-height: 20rem; }

.reject-counts {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.reject-counts li {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.9rem;
}

.reject-counts span { color: var(--muted); min-width: 11rem; }

.reject-counts strong { font-family: Fraunces, Georgia, serif; }

@media (max-width: 800px) {
  .dash-stats, .dash-grid, .donut-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .staff-bar-inner { grid-template-columns: 1fr auto; }
  .staff-bar nav { grid-column: 1 / -1; }
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link:hover { border-color: #c9b79a; }

.stat {
  font-family: Fraunces, Georgia, serif;
  font-size: 2.2rem;
  margin: 0.2rem 0 0.15rem;
}

.block-title {
  font-size: 0.92rem;
  margin: 1rem 0 0.4rem;
}

.field-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.field-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #efe7db;
}

.kv {
  display: grid;
  grid-template-columns: minmax(7.5rem, 36%) 1fr;
  gap: 0.5rem 1.15rem;
  align-items: baseline;
  margin: 0;
}

.kv dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.kv dt.heading {
  grid-column: 1 / -1;
  font-family: Fraunces, Georgia, serif;
  font-size: 1rem;
  font-weight: 560;
  color: var(--ink);
  margin: 0.9rem 0 0.1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #efe7db;
}

.kv dt.heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.kv dd { margin: 0; font-size: 0.95rem; }

.repeat { margin-bottom: 1.2rem; }
.repeat-item {
  padding: 0.75rem 0 0.4rem;
  border-top: 1px solid var(--line);
}
.repeat-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.repeat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.repeat-head .js-remove-repeat {
  margin: 0;
  padding: 0.25rem 0.65rem;
}

.repeat-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0 0.75rem;
}

.hash {
  margin: 1.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.field-edit {
  display: grid;
  grid-template-columns: 1.4fr 8rem 1.2fr auto auto;
  gap: 0.65rem;
  align-items: end;
  padding: 0.75rem 0;
  border-bottom: 1px solid #efe7db;
}

.std-row {
  display: flex;
  gap: 1rem;
  align-items: end;
  padding: 0.55rem 0;
  border-bottom: 1px solid #efe7db;
}

.std-row .grow { flex: 1; }

.pipe-wrap { max-width: 40rem; }

.pipe-flow {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  color: var(--ink);
  margin: -0.4rem 0 1.4rem;
  line-height: 1.5;
}

.pipe-flow span {
  color: var(--muted);
  margin: 0 0.4rem;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.9rem;
}

.pipe-list { margin-bottom: 0.25rem; }

.pipe-row,
.pipe-add {
  display: grid;
  grid-template-columns: 2.25rem 1fr 5.5rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem 0;
}

.pipe-row { border-bottom: 1px solid #efe7db; }

.pipe-add { padding-top: 0.9rem; }

.pipe-num {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #1b232c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
}

.pipe-num.quiet {
  background: #efe8dc;
  color: var(--ink);
}

.pipe-num.ghost-num {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--line);
}

.pipe-row input,
.pipe-add input {
  margin: 0;
}

.pipe-locked {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.pipe-row .ghost,
.pipe-add .ghost {
  width: 100%;
  justify-self: stretch;
  text-align: center;
}

details.extras summary {
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

details.extras[open] summary { margin-bottom: 0.8rem; }

.hero-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.meta-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.meta-bar span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.meta-bar strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 560;
}

.jd-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.jd-head h2 { margin: 0; }

.jd-links { display: flex; gap: 1rem; }

.panel.jd .prose {
  font-size: 1.02rem;
  line-height: 1.65;
}

@media (max-width: 800px) {
  .meta-bar { grid-template-columns: 1fr 1fr; }
}

.view-switch {
  display: flex;
  gap: 0.35rem;
  margin: -0.6rem 0 1.1rem;
}

.view-switch span {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.view-switch .on {
  background: #1b232c;
  color: #fff;
}

.view-switch .off { color: var(--muted); }

.vs-chip {
  display: none;
  color: var(--muted);
  margin: 0 0 0.8rem;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  align-items: start;
}

.pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.15rem 1.2rem;
  min-height: 20rem;
}

.pane.focus {
  box-shadow: 0 14px 36px rgba(28, 36, 48, 0.08);
}

.pane-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pane-head h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  margin: 0 0 0.25rem;
}

.pane-head p { margin: 0 0 0.9rem; color: var(--muted); }

.pane-body { max-height: 62vh; overflow: auto; }

.kv.compact { grid-template-columns: 9rem 1fr; font-size: 0.9rem; }

.focus-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.flip { display: flex; gap: 0.35rem; }

.queue-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.1rem;
  margin: 0 0 1.15rem;
  padding: 0.6rem 0.95rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.review-left .queue-bar {
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
  gap: 0.85rem;
  margin: 0;
  padding: 0.9rem 1rem;
  position: static;
}

.queue-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0.45rem 0.75rem;
  width: 100%;
}

.queue-mode-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0;
}

.queue-config-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
}

.queue-config-row .wave-counters {
  padding: 0;
  border: none;
  margin: 0;
  width: 100%;
  justify-content: space-between;
}

.queue-config-row .email-mode {
  width: 100%;
}

.batch-pending-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.wave-counters {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.queue-section {
  width: 100%;
}

.queue-nav-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.queue-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.queue-nav.batch-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.queue-flip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wave-ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 2.25rem;
}

.wave-ctrl-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.wave-commit-btn.hidden {
  display: none;
}

.pill.hidden {
  display: none;
}

.review-person {
  border-radius: 12px;
  padding: 0.75rem;
  margin: -0.75rem;
  box-sizing: border-box;
}

.review-person.mark-flash-pass {
  animation: mark-flash-pass 0.42s ease;
}

.review-person.mark-flash-reject {
  animation: mark-flash-reject 0.42s ease;
}

@keyframes mark-flash-pass {
  0% { box-shadow: inset 0 0 0 0 rgba(46, 125, 50, 0); }
  35% { box-shadow: inset 0 0 0 3px rgba(46, 125, 50, 0.35); }
  100% { box-shadow: inset 0 0 0 0 rgba(46, 125, 50, 0); }
}

@keyframes mark-flash-reject {
  0% { box-shadow: inset 0 0 0 0 rgba(198, 40, 40, 0); }
  35% { box-shadow: inset 0 0 0 3px rgba(198, 40, 40, 0.35); }
  100% { box-shadow: inset 0 0 0 0 rgba(198, 40, 40, 0); }
}

.wave-commit-btn {
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
  margin-left: 0.15rem;
}

.queue-nav .ghost {
  min-width: 2.5rem;
  padding: 0.4rem 0.65rem;
}

.queue-pos {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  min-width: 5.5rem;
  text-align: center;
}

.queue-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.review-left .queue-bar .email-mode {
  margin: 0;
  padding: 0.7rem 0.75rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.review-left .queue-bar .email-mode-label {
  display: block;
  flex-shrink: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  margin: 0;
}

.review-left .queue-bar .email-mode-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-left: auto;
}

.queue-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  margin-left: auto;
}

.job-advance { margin: 0 0 1rem; }

.review-mode {
  margin: 0;
  width: auto;
  display: flex;
  justify-content: center;
}

.mode-pill-toggle {
  position: relative;
  width: 6.75rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ececec;
  padding: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

.mode-pill-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.mode-pill-text {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mode-pill-toggle.is-live .mode-pill-knob {
  transform: translateX(0);
  background: #e8f5e9;
  color: #2e7d32;
  animation: live-pulse 2s ease-in-out infinite;
}

.mode-pill-toggle.is-batch .mode-pill-knob {
  transform: translateX(100%);
  background: #eef3ff;
  color: #1a3d8f;
  box-shadow: 0 1px 3px rgba(26, 61, 143, 0.12);
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
}

.pill.batch {
  background: #eef3ff;
  color: #1a3d8f;
}

.pill.mark-advance,
.pill.mark-pass {
  background: #e8f5e9;
  color: #2e7d32;
}

.pill.mark-reject {
  background: #ffebee;
  color: #c62828;
}

.pill.deferred {
  background: #fff8e1;
  color: #f57f17;
}

.pill.committed {
  background: #f3f3f3;
  color: var(--muted);
  font-size: 0.75rem;
}

.wave-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.deferred-strip {
  margin: 0 0 1rem;
  padding: 0.75rem;
  background: #fffdf5;
  border: 1px solid #f0e6c8;
  border-radius: 6px;
}

.deferred-strip ul {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.deferred-strip li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.wave-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #f7f9ff;
  border: 1px solid #d8e2f8;
  border-radius: 6px;
}

.wave-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wave-commit-top {
  display: grid;
  grid-template-columns: auto auto;
  align-items: start;
  justify-content: start;
  gap: 1rem 1.25rem;
}

.wave-stats-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.wave-stats-spread-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.wave-stats-spread li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.1rem;
}

.wave-apply-panel {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 1rem;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.wave-apply-panel-exit-live {
  justify-content: space-between;
}

.wave-apply-panel-commit-only .wave-commit-group {
  width: 100%;
  justify-content: space-between;
}

.wave-apply-panel-commit-only .wave-commit-group-solo {
  justify-content: flex-end;
}

.wave-commit-group {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

.wave-apply-panel .wave-keep-pending-form {
  margin: 0;
  flex-shrink: 0;
}

.wave-apply-panel .choice-btn {
  width: auto;
  min-width: 6.5rem;
  padding: 0.55rem 1rem;
  text-align: center;
}

.wave-apply-panel .straggler-field {
  flex: 0 1 auto;
  min-width: 10rem;
}

.wave-apply-panel .straggler-field select {
  max-width: none;
  min-width: 10rem;
}

.wave-straggler-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.wave-straggler-left {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  flex: 1;
  min-width: 0;
}

.wave-keep-pending-form {
  margin: 0;
  flex-shrink: 0;
}

.wave-straggler-row-solo .wave-straggler-left {
  justify-content: flex-start;
}

.wave-straggler-row-solo {
  justify-content: flex-end;
}

.straggler-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  margin: 0;
}

.straggler-field select {
  width: 100%;
  max-width: 14rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
}

.wave-straggler-row .choice-btn-primary {
  flex-shrink: 0;
  min-width: 6.5rem;
  padding: 0.55rem 1.1rem;
  text-align: center;
}

.wave-commit.panel {
  padding: 1rem 1.1rem;
}

.wave-commit-form {
  margin: 0;
}

.hero-compact {
  margin-bottom: 0.85rem;
  align-items: flex-start;
}

.hero-compact h1 {
  margin-bottom: 0.15rem;
}

.hero-compact .lede {
  margin: 0;
}

.straggler-choices {
  margin: 0;
  min-width: 9.5rem;
}

.straggler-label {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.choice-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.choice-btn:hover {
  border-color: #c8c0b6;
  background: #fff;
}

.choice-btn:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
}

.choice-btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  text-align: center;
}

.choice-btn-primary:hover {
  background: #2a2622;
  border-color: #2a2622;
  color: #fff;
}

.wave-commit-note {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.wave-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.wave-stats strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  line-height: 1;
}

.wave-stats span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deferred-list {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.email-preview-panel {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.email-preview-meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.email-preview-card {
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.email-preview-subject {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.email-preview-subject span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.email-preview-body {
  margin: 0;
}

.bulk-recipient-list {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.25rem;
}

.bulk-email-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.posting-stage-panel .posting-stage-actions {
  margin: 0.75rem 0 1rem;
}

.posting-rollback,
.posting-stage-advanced {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.posting-rollback summary,
.posting-stage-advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}

.posting-rollback[open] summary {
  color: #a33;
  margin-bottom: 0.5rem;
}

.wave-commit-context {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.wave-commit-footer {
  display: none;
}

.batch-exit-modal {
  display: none !important;
}

.review-overlay {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.review-overlay.open {
  display: flex;
}

.review-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.42);
}

.review-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(38rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  margin: 0;
  padding: 1rem 1.1rem;
}

.review-overlay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.review-overlay-head h2 {
  margin: 0.15rem 0;
  font-size: 1.35rem;
}

.review-overlay-head .lede {
  margin: 0;
}

.review-overlay-head .eyebrow {
  margin: 0;
}

.review-overlay-close {
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.2rem 0.55rem;
  flex-shrink: 0;
}

.batch-exit-modal.hidden {
  display: none;
}

.batch-exit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.35);
}

.batch-exit-panel {
  position: relative;
  width: min(28rem, 100%);
  margin: 0;
  z-index: 1;
}

.batch-exit-panel h2 {
  margin-top: 0;
}

.batch-exit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
}

.batch-exit-actions form {
  margin: 0;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.compare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

button.danger { color: var(--accent-dark); }

.email-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 1rem 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #fffaf4;
}

.email-mode-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-right: 0.25rem;
}

.mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.86rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.mode-opt input { position: absolute; opacity: 0; pointer-events: none; }

.mode-opt.on {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink);
  font-weight: 500;
}

.email-compose label {
  display: block;
  margin-bottom: 0.85rem;
}

.email-compose input,
.email-compose textarea {
  width: 100%;
  margin-top: 0.35rem;
}

.email-preview {
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff;
  max-width: 42rem;
}

.correspondence .data { margin-top: 0.75rem; }

.correspondence details summary {
  cursor: pointer;
  color: var(--accent-dark);
}

.token-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  columns: 2;
  gap: 1.5rem;
}

.token-list code {
  font-size: 0.85rem;
}

.pipe-list-email .pipe-row {
  grid-template-columns: 2.5rem 1fr 1.2fr auto;
}

.pipe-list-email + .pipe-add {
  grid-template-columns: 2.5rem 1fr 1.2fr auto;
}

.pipe-list-email + .pipe-add .ghost {
  width: auto;
  min-width: 4.5rem;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

.pipe-row.pipe-head {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.35rem;
}

.pipe-row.pipe-head .pipe-num { visibility: hidden; }

.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;
}

/* —— Correspondence inbox —— */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
}

.inbox-shell { padding: 0; overflow: hidden; }

.inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fffaf4;
}

.inbox-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.inbox-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
}

.inbox-tab.on {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink);
  font-weight: 500;
}

.inbox-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}

.inbox-count.muted {
  background: #e8dfd4;
  color: var(--muted);
}

.inbox-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.inbox-filter input,
.inbox-filter select {
  min-width: 9rem;
}

.inbox-panels {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) 1fr;
  min-height: 28rem;
}

.inbox-list {
  border-right: 1px solid var(--line);
  max-height: 36rem;
  overflow-y: auto;
}

.inbox-row {
  display: block;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.inbox-row:hover { background: #fffaf4; }

.inbox-row.selected {
  background: #fff3e6;
  box-shadow: inset 3px 0 0 var(--accent);
}

.inbox-row.unread strong { font-weight: 600; }

.inbox-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.inbox-row-time {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.inbox-row-job {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.inbox-row-preview {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inbox-empty,
.inbox-placeholder {
  padding: 2rem 1.25rem;
  color: var(--muted);
}

.inbox-detail {
  display: flex;
  flex-direction: column;
  min-height: 28rem;
  max-height: 36rem;
}

.conversation-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 28rem;
}

.conversation-panel-embed {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  min-height: auto;
}

.conversation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.conversation-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.conversation-meta {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.conversation-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.conversation-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #faf7f2;
}

.conversation-empty { margin: 0; }

.message {
  max-width: 38rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}

.message-out {
  align-self: flex-end;
  background: #fff8f0;
  border-color: #e8d4bc;
}

.message-in {
  align-self: flex-start;
}

.message-system {
  align-self: center;
  max-width: 100%;
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 0.88rem;
}

.message-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
}

.message-author { font-weight: 600; }

.message-body { font-size: 0.92rem; }

.message-body.prose p { margin: 0 0 0.5rem; }
.message-body.prose p:last-child { margin-bottom: 0; }

.conversation-compose {
  padding: 0.85rem 1.1rem 1rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.conversation-form textarea {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
}

.conversation-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.conversation-resolve-form {
  margin-top: 0.5rem;
}

.conversation-email-log {
  padding: 0 1.1rem 1rem;
  font-size: 0.88rem;
}

.email-log-mini {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.applicant-messages .conversation-messages {
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  min-height: 10rem;
  max-height: 28rem;
}

.applicant-messages .conversation-form textarea {
  width: 100%;
  margin: 0.5rem 0 0.75rem;
}

@media (max-width: 900px) {
  .inbox-panels { grid-template-columns: 1fr; }
  .inbox-panels:not(.has-selection) .inbox-detail { display: none; }
  .inbox-panels.has-selection .inbox-list { display: none; }
  .inbox-list,
  .inbox-detail { max-height: none; }
}

.warn-panel {
  border-color: #e8c9a8;
  background: #fff8f0;
}

.warn-panel ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

@media (max-width: 960px) {
  .compare { grid-template-columns: 1fr; }
  .pane.ref { display: none; }
  .vs-chip { display: block; }
}

@media (max-width: 900px) {
  .field-edit { grid-template-columns: 1fr; }
}
