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

.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-job-title {
  font-size: 1.55rem;
  margin: 0 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-wrap: wrap;
  gap: 0.45rem;
  flex-shrink: 0;
}

.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: flex-start;
  flex-shrink: 0;
  margin: 0;
  position: static;
}

.queue-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

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

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

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

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

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