:root {
  color-scheme: light;
  --canvas: #e9eef4;
  --canvas-deep: #dce4ed;
  --paper: #f8fafc;
  --paper-strong: #ffffff;
  --ink: #101820;
  --ink-soft: #33404d;
  --muted: #667586;
  --faint: #8c98a5;
  --rule: #cbd4de;
  --rule-strong: #aab7c5;
  --action: #165dff;
  --action-dark: #0d48cb;
  --action-soft: #e6edff;
  --signal: #b97300;
  --signal-strong: #e6a11f;
  --signal-soft: #fff2d7;
  --success: #16795e;
  --success-soft: #e4f4ee;
  --danger: #b84040;
  --danger-soft: #fae9e9;
  --shadow-soft: 0 12px 36px rgba(38, 54, 69, .09);
  --shadow-float: 0 22px 60px rgba(30, 45, 59, .17);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --display: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: auto;
  scroll-padding-top: 96px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(89, 105, 121, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 105, 121, .04) 1px, transparent 1px),
    var(--canvas);
  background-size: 40px 40px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(22, 93, 255, .19);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid rgba(22, 93, 255, .38);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: white;
  font-weight: 700;
  text-decoration: none;
  transition: transform .16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.boot-screen {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: var(--canvas);
  color: var(--muted);
  font-family: var(--utility);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 13px;
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.brand-mark i {
  position: absolute;
  display: block;
}

.brand-mark i:first-child {
  width: 20px;
  height: 14px;
  border-top: 2px solid #6c8cff;
  border-left: 2px solid #6c8cff;
  transform: translate(-2px, -1px);
}

.brand-mark i:nth-child(2) {
  width: 8px;
  height: 8px;
  transform: translate(7px, -6px);
  border-radius: 50%;
  background: var(--signal-strong);
}

.brand-mark i:last-child {
  width: 20px;
  height: 14px;
  transform: translate(2px, 3px);
  border-right: 2px solid rgba(255, 255, 255, .68);
  border-bottom: 2px solid rgba(255, 255, 255, .68);
}

.brand-mark--boot {
  animation: bootPulse 1.35s ease-in-out infinite;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--action-dark);
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 11px;
  background: var(--paper-strong);
  color: var(--ink);
  cursor: pointer;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.button:hover:not(:disabled) {
  border-color: var(--ink-soft);
  box-shadow: 0 5px 14px rgba(30, 45, 59, .09);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .46;
}

.button--primary {
  border-color: var(--action);
  background: var(--action);
  box-shadow: 0 8px 22px rgba(22, 93, 255, .2);
  color: white;
}

.button--primary:hover:not(:disabled) {
  border-color: var(--action-dark);
  background: var(--action-dark);
  box-shadow: 0 10px 26px rgba(22, 93, 255, .28);
}

.button--quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--ink-soft);
}

.button--quiet:hover:not(:disabled) {
  border-color: var(--rule);
  background: rgba(255, 255, 255, .55);
  box-shadow: none;
}

.button--wide {
  width: 100%;
}

.auth-shell {
  position: relative;
  display: grid;
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 40px);
  grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr);
  margin: 20px auto;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow-float);
}

.auth-card {
  display: grid;
  align-content: center;
  padding: clamp(38px, 8vw, 104px);
}

.auth-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 7px;
  background: var(--action);
  content: "";
}

.auth-card__mark {
  margin-bottom: 36px;
}

.auth-card h1 {
  max-width: 660px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: .91;
}

.auth-card__intro {
  max-width: 610px;
  margin: 28px 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

.auth-card .button {
  max-width: 360px;
}

.auth-card__privacy {
  max-width: 360px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth-principles {
  display: grid;
  align-content: center;
  padding: clamp(30px, 5vw, 68px);
  border-left: 1px solid var(--rule);
  background:
    linear-gradient(145deg, rgba(22, 93, 255, .06), transparent 58%),
    var(--canvas);
}

.auth-principles ol {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: contract;
}

.auth-principles li {
  position: relative;
  display: grid;
  min-height: 92px;
  align-content: center;
  padding: 19px 0 19px 54px;
  border-top: 1px solid var(--rule);
  counter-increment: contract;
}

.auth-principles li:last-child {
  border-bottom: 1px solid var(--rule);
}

.auth-principles li::before {
  position: absolute;
  top: 24px;
  left: 0;
  color: var(--action);
  content: "0" counter(contract);
  font-family: var(--utility);
  font-size: 13px;
  font-weight: 700;
}

.auth-principles strong,
.auth-principles span {
  display: block;
}

.auth-principles strong {
  font-family: var(--display);
  font-size: 18px;
}

.auth-principles span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 80;
  top: 0;
  display: grid;
  min-height: 74px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px max(22px, calc((100vw - 1520px) / 2));
  border-bottom: 1px solid rgba(170, 183, 197, .8);
  background: rgba(248, 250, 252, .92);
  backdrop-filter: blur(18px);
}

.app-brand {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.app-brand strong,
.app-brand small {
  display: block;
}

.app-brand strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.app-brand small {
  margin-top: 1px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--canvas);
}

.primary-nav a {
  display: inline-flex;
  min-width: 88px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-align: center;
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a[aria-current="location"] {
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(38, 54, 69, .07);
}

.account {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
}

.account__identity {
  display: grid;
  justify-items: end;
  padding-right: 7px;
}

.account__identity small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.account__identity strong {
  max-width: 220px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#main {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 68px;
}

.workbench-intro {
  display: flex;
  max-width: 1120px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin: 0 auto 25px;
}

.workbench-intro h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 4.5vw, 63px);
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: .98;
}

.sync-state {
  display: grid;
  min-width: 210px;
  grid-template-columns: 10px 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: rgba(248, 250, 252, .76);
}

.sync-state > span {
  width: 8px;
  height: 8px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.sync-state strong {
  font-size: 12px;
}

.sync-state small {
  color: var(--muted);
  font-size: 10px;
}

.sync-state.is-busy > span {
  background: var(--action);
  box-shadow: 0 0 0 4px var(--action-soft);
  animation: statusPulse 1.2s ease-in-out infinite;
}

.sync-state.is-error > span {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.proof-rail {
  position: relative;
  display: grid;
  max-width: 1120px;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 auto 14px;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.proof-rail__trace {
  position: absolute;
  z-index: 0;
  top: 29px;
  right: 10%;
  left: 10%;
  height: 2px;
  background: linear-gradient(90deg, var(--action) 0 48%, var(--signal-strong) 48% 53%, var(--rule-strong) 53%);
}

.proof-step {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 74px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 8px;
}

.proof-step + .proof-step {
  border-left: 1px solid var(--rule);
}

.proof-step__node {
  display: inline-grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border: 2px solid var(--action);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--action-dark);
  font-family: var(--utility);
  font-size: 11px;
  font-weight: 800;
}

.proof-step--signal .proof-step__node {
  border-color: var(--signal-strong);
  color: var(--signal);
}

.proof-step strong,
.proof-step small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-step strong {
  font-size: 11px;
  letter-spacing: .02em;
}

.proof-step small {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 10px;
}

.results-ledger {
  display: grid;
  max-width: 1120px;
  grid-template-columns: 180px minmax(0, 1fr);
  margin: 0 auto 18px;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--ink);
  box-shadow: var(--shadow-soft);
  color: white;
  scroll-margin-top: 100px;
}

.results-ledger > header {
  display: grid;
  align-content: center;
  padding: 13px 17px;
}

.results-ledger .eyebrow {
  color: #93adff;
}

.results-ledger h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: -.02em;
}

.results-ledger dl {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
}

.results-ledger dl > div {
  display: grid;
  min-width: 0;
  align-content: center;
  justify-items: center;
  min-height: 70px;
  border-left: 1px solid rgba(255, 255, 255, .13);
}

.results-ledger dt {
  color: #9faab6;
  font-family: var(--utility);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.results-ledger dd {
  max-width: 100%;
  margin: 3px 0 0;
  overflow: hidden;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
  text-overflow: ellipsis;
}

.results-ledger__revenue dd {
  color: #f6bd56;
}

.app-alert {
  display: grid;
  max-width: 1120px;
  min-height: 48px;
  grid-template-columns: 28px 1fr 40px;
  align-items: center;
  gap: 10px;
  margin: 0 auto 16px;
  padding: 8px 8px 8px 12px;
  border: 1px solid #dea3a3;
  border-radius: 13px;
  background: var(--danger-soft);
  color: #7c2929;
}

.app-alert > span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-family: var(--utility);
  font-weight: 800;
}

.app-alert p {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.app-alert button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 23px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.brief-panel,
.review-panel {
  min-width: 0;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 92px;
}

.brief-panel {
  position: sticky;
  top: 90px;
  padding: 18px;
}

.review-panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.panel-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.08;
}

.panel-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.field {
  display: grid;
  min-width: 0;
  gap: 5px;
  margin-top: 10px;
}

.field > span,
.choice-group > legend,
.experiment-picker > span {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  background: var(--paper-strong);
  box-shadow: inset 0 1px 2px rgba(38, 54, 69, .04);
  color: var(--ink);
}

input,
select {
  padding: 0 11px;
}

select {
  cursor: pointer;
}

textarea {
  min-height: 82px;
  padding: 10px 11px;
  line-height: 1.5;
  resize: vertical;
}

#sourceText {
  min-height: 138px;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--action);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, .13);
}

.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.choice-group {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.choice-group > legend {
  margin-bottom: 5px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.segmented-control label {
  position: relative;
  display: grid;
  min-height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  background: var(--paper-strong);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.segmented-control label:has(input:checked) {
  border-color: var(--action);
  background: var(--action-soft);
  color: var(--action-dark);
}

.segmented-control label:has(input:focus-visible) {
  outline: 3px solid rgba(22, 93, 255, .38);
  outline-offset: 2px;
}

.source-boundary {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

#generateButton {
  margin-top: 15px;
}

.panel-heading--review {
  align-items: center;
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--rule);
}

.experiment-picker {
  display: grid;
  min-width: 190px;
  gap: 4px;
}

.experiment-picker select {
  min-height: 44px;
}

.queue {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.queue-loading,
.queue-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.queue-loading {
  grid-template-columns: repeat(3, 7px);
  gap: 5px;
}

.queue-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--action);
  animation: loadingDot 1.1s ease-in-out infinite;
}

.queue-loading span:nth-child(2) {
  animation-delay: .12s;
}

.queue-loading span:nth-child(3) {
  animation-delay: .24s;
}

.queue-loading p {
  grid-column: 1 / -1;
  margin: 7px 0 0;
  font-size: 12px;
}

.queue-empty {
  justify-items: start;
  text-align: left;
}

.queue-empty > span {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 16px;
  background: var(--paper-strong);
  color: var(--action);
  font-family: var(--utility);
  font-weight: 800;
}

.queue-empty h3 {
  margin: 17px 0 4px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -.035em;
}

.queue-empty p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.candidate {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper-strong);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.candidate::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--rule-strong);
  content: "";
}

.candidate.is-recommended {
  border-color: #d9b668;
  box-shadow: 0 5px 20px rgba(185, 115, 0, .08);
}

.candidate.is-recommended::before {
  background: var(--signal-strong);
}

.candidate.is-approved::before {
  background: var(--success);
}

.candidate.is-rejected {
  background: #f4f5f6;
}

.candidate.is-rejected::before {
  background: var(--danger);
}

.candidate.is-published::before {
  background: var(--action);
}

.candidate__header {
  display: grid;
  grid-template-columns: 34px auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid var(--rule);
}

.candidate__number {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  background: var(--canvas);
  color: var(--ink-soft);
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 800;
}

.candidate__channel,
.candidate__recommendation,
.candidate__state {
  font-family: var(--utility);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.candidate__channel {
  color: var(--muted);
}

.candidate__recommendation {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--signal-soft);
  color: var(--signal);
}

.candidate__state {
  grid-column: 5;
  color: var(--muted);
}

.candidate.is-approved .candidate__state {
  color: var(--success);
}

.candidate.is-rejected .candidate__state {
  color: var(--danger);
}

.candidate.is-published .candidate__state {
  color: var(--action);
}

.candidate__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 9px;
  padding: 12px 12px 8px 16px;
}

.candidate__fields .field {
  margin: 0;
}

.candidate__copy {
  min-height: 126px;
  grid-column: 1 / -1;
}

.candidate__meta {
  display: flex;
  min-height: 25px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px 7px 16px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 9px;
}

.candidate__meta a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--action-dark);
  font-weight: 700;
}

.candidate__actions {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 9px 12px 12px 16px;
  border-top: 1px solid var(--rule);
}

.candidate__actions .button {
  min-width: 0;
  min-height: 44px;
  padding: 0 7px;
  font-size: 11px;
}

.candidate__actions .button--approve:not(:disabled) {
  border-color: #80bca9;
  background: var(--success-soft);
  color: var(--success);
}

.candidate__actions .button--reject:not(:disabled) {
  border-color: #dcb3b3;
  background: var(--danger-soft);
  color: var(--danger);
}

.publish-editor {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  padding: 10px 12px 12px 16px;
  border-top: 1px solid var(--rule);
  background: var(--action-soft);
}

.candidate__contract {
  margin: 0;
  padding: 0 13px 12px 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.candidate__contract strong {
  color: var(--ink-soft);
}

.app-footer {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, .7);
  color: var(--muted);
  font-size: 12px;
}

.app-footer > span {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
}

.app-footer p {
  margin: 0;
}

.app-footer .button {
  margin-left: auto;
}

.mobile-nav {
  display: none;
}

.toast {
  position: fixed;
  z-index: 400;
  right: 20px;
  bottom: 20px;
  display: grid;
  max-width: min(390px, calc(100% - 32px));
  min-height: 52px;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border: 1px solid #79b9a5;
  border-radius: 13px;
  background: #eff9f5;
  box-shadow: var(--shadow-float);
  color: #125e49;
}

.toast > span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 12px;
}

.toast p {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.noscript {
  position: fixed;
  z-index: 1000;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 14px;
  border: 1px solid #d49b9b;
  border-radius: 12px;
  background: var(--danger-soft);
  color: #762525;
  text-align: center;
}

@keyframes bootPulse {
  50% { transform: scale(.94); opacity: .72; }
}

@keyframes statusPulse {
  50% { opacity: .45; }
}

@keyframes loadingDot {
  0%, 100% { transform: translateY(0); opacity: .35; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 1040px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    display: none;
  }

  .workbench {
    grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
  }

  .candidate__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .candidate__actions .button:nth-child(4),
  .candidate__actions .button:nth-child(5) {
    grid-column: span 1;
  }
}

@media (max-width: 820px) {
  body {
    background-size: 32px 32px;
  }

  .auth-shell {
    width: min(650px, calc(100% - 24px));
    min-height: calc(100vh - 24px);
    grid-template-columns: 1fr;
    margin: 12px auto;
  }

  .auth-card {
    padding: 48px clamp(26px, 8vw, 58px);
  }

  .auth-card h1 {
    font-size: clamp(48px, 14vw, 74px);
  }

  .auth-principles {
    padding: 28px clamp(26px, 8vw, 58px) 40px;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .app-header {
    min-height: 68px;
    padding: 8px 16px;
  }

  .account__identity {
    display: none;
  }

  #main {
    width: min(100% - 22px, 720px);
    padding-top: 22px;
    padding-bottom: 104px;
  }

  .workbench-intro {
    align-items: flex-start;
  }

  .sync-state {
    min-width: 0;
  }

  .proof-rail {
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .proof-rail::-webkit-scrollbar {
    display: none;
  }

  .proof-step {
    scroll-snap-align: start;
  }

  .results-ledger {
    grid-template-columns: 1fr;
  }

  .results-ledger > header {
    min-height: 58px;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 9px;
  }

  .results-ledger .eyebrow {
    margin: 0;
  }

  .results-ledger dl > div:first-child {
    border-left: 0;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .brief-panel {
    position: static;
  }

  .mobile-nav {
    position: fixed;
    z-index: 90;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    min-height: 62px;
    grid-template-columns: repeat(3, 1fr);
    padding: 5px;
    border: 1px solid var(--rule-strong);
    border-radius: 18px;
    background: rgba(248, 250, 252, .94);
    box-shadow: var(--shadow-float);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a {
    display: grid;
    min-height: 50px;
    place-items: center;
    align-content: center;
    border-radius: 13px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 720;
    text-decoration: none;
  }

  .mobile-nav a span {
    color: var(--action);
    font-family: var(--utility);
    font-size: 9px;
  }

  .mobile-nav a[aria-current="location"] {
    background: var(--action-soft);
    color: var(--ink);
  }

  .toast {
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 590px) {
  body {
    font-size: 14px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .app-brand small {
    display: none;
  }

  .app-header .button {
    min-height: 44px;
    padding: 0 11px;
    font-size: 12px;
  }

  #main {
    width: 100%;
    padding: 18px 12px 104px;
  }

  .workbench-intro {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
  }

  .workbench-intro h1 {
    font-size: clamp(35px, 10vw, 48px);
  }

  .sync-state {
    width: 100%;
  }

  .proof-rail,
  .results-ledger,
  .brief-panel,
  .review-panel {
    border-radius: 15px;
  }

  .proof-rail {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 10px;
    overflow: hidden;
  }

  .proof-rail__trace {
    top: 20px;
    right: 8%;
    left: 8%;
  }

  .proof-step {
    min-height: 66px;
    flex-direction: column;
    gap: 3px;
    padding: 6px 1px;
    text-align: center;
  }

  .proof-step__node {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    font-size: 9px;
  }

  .proof-step strong {
    font-size: 8px;
  }

  .proof-step small {
    margin-top: 0;
    font-size: 9px;
  }

  .results-ledger {
    margin-bottom: 12px;
  }

  .results-ledger dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .results-ledger dl > div {
    min-height: 61px;
    border-top: 1px solid rgba(255, 255, 255, .13);
  }

  .results-ledger dl > div:nth-child(4) {
    border-left: 0;
  }

  .results-ledger dd {
    font-size: 17px;
  }

  .brief-panel {
    padding: 15px;
  }

  .panel-heading {
    display: grid;
  }

  .panel-heading h2 {
    font-size: 21px;
  }

  .panel-status {
    width: fit-content;
  }

  .field-pair {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .panel-heading--review {
    padding: 15px;
  }

  .experiment-picker {
    width: 100%;
    min-width: 0;
  }

  .queue {
    padding: 8px;
  }

  .candidate__header {
    grid-template-columns: 32px auto 1fr auto;
    gap: 6px;
    padding-left: 12px;
  }

  .candidate__recommendation {
    grid-row: 2;
    grid-column: 2 / 5;
    width: fit-content;
  }

  .candidate__state {
    grid-column: 4;
  }

  .candidate__fields {
    grid-template-columns: 1fr;
    padding-left: 12px;
  }

  .candidate__copy {
    min-height: 150px;
    grid-column: 1;
  }

  .candidate__meta,
  .candidate__actions,
  .candidate__contract,
  .publish-editor {
    padding-right: 9px;
    padding-left: 12px;
  }

  .candidate__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate__actions .button:first-child {
    grid-column: 1 / -1;
  }

  .publish-editor {
    grid-template-columns: 1fr;
  }

  .app-footer {
    display: grid;
    justify-items: start;
  }

  .app-footer .button {
    width: 100%;
    margin-left: 0;
  }
}

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