:root {
  color-scheme: light;
  --navy: #0d2545;
  --navy-mid: #1a3a6b;
  --navy-tint: #edf1f8;
  --gold: #c6a75a;
  --off-white: #f8f7f4;
  --white: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #17253a;
  --muted: #526274;
  --success: #176b45;
  --success-bg: #eaf6ef;
  --error: #a5222d;
  --error-bg: #fff0f1;
  --warning: #8a5a00;
  --warning-bg: #fff8e6;
  --info: #1a5b91;
  --info-bg: #eef6fc;
  --focus: #8b5cf6;
  --shadow: 0 16px 40px rgba(13, 37, 69, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--off-white);
  color: var(--text);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  min-width: 280px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-wrap: anywhere;
}

a {
  color: var(--navy-mid);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--navy);
}

button,
input,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 0 0 0.4rem 0.4rem;
  color: var(--navy);
  left: 1rem;
  padding: 0.65rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.environment-banner {
  align-items: center;
  display: flex;
  font-size: 0.875rem;
  gap: 0.65rem 1rem;
  justify-content: center;
  letter-spacing: 0.01em;
  padding: 0.55rem 1rem;
  text-align: center;
}

.environment-banner strong {
  letter-spacing: 0.08em;
}

.environment-banner--staging {
  background: #9f1d2d;
  color: var(--white);
}

.environment-banner--preprod {
  background: #f2cf71;
  color: #3f2b00;
}

.site-header {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
}

.site-header__inner {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  margin: 0 auto;
  max-width: 960px;
  min-height: 84px;
  padding: 1rem 1.5rem;
}

.brand {
  display: inline-flex;
  line-height: 0;
}

.brand img {
  display: block;
  height: 48px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  width: auto;
}

.product-name {
  border-left: 1px solid rgba(255, 255, 255, 0.38);
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  padding-left: 1rem;
}

.product-name strong {
  color: var(--white);
  font-size: 1rem;
}

.product-name span {
  color: var(--navy-tint);
  font-size: 0.8rem;
}

.logout-form {
  margin: 0;
}

.site-header .button--quiet {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}

.site-header .button--quiet:hover {
  background: var(--white);
  color: var(--navy);
}

.page-shell {
  margin: 0 auto;
  max-width: 900px;
  padding: clamp(1.25rem, 4vw, 3rem) 1.5rem;
}

.surface {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.surface::before {
  background: var(--gold);
  border-radius: 0.85rem 0.85rem 0 0;
  content: "";
  display: block;
  height: 0.3rem;
  margin: calc(clamp(1.25rem, 4vw, 2.5rem) * -1) calc(clamp(1.25rem, 4vw, 2.5rem) * -1) 1.8rem;
}

.page-heading {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
}

.eyebrow {
  color: var(--navy-mid);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  letter-spacing: -0.025em;
  margin-bottom: 0;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1rem;
}

.intro {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 65ch;
}

.workflow-form {
  margin-top: 1.5rem;
}

.field {
  margin: 1.35rem 0;
}

.field label {
  color: var(--navy);
  display: block;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.required,
.field-error {
  color: var(--error);
}

.field input,
.field select {
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 0.45rem;
  color: var(--text);
  min-height: 2.9rem;
  padding: 0.7rem 0.8rem;
  width: 100%;
}

.field input:hover,
.field select:hover {
  border-color: var(--navy-mid);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

.field-help,
.field-error,
.supporting,
.approval-note {
  font-size: 0.875rem;
  margin: 0.45rem 0 0;
}

.field-help,
.supporting {
  color: var(--muted);
}

.field-error {
  font-weight: 650;
}

.approval-note {
  background: var(--navy-tint);
  border-radius: 0.45rem;
  color: var(--navy);
  padding: 0.8rem;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button {
  align-items: center;
  border: 2px solid transparent;
  border-radius: 0.45rem;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  line-height: 1.2;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  text-align: center;
  text-decoration: none;
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button--primary {
  background: var(--navy);
  color: var(--white);
}

.button--primary:hover {
  background: var(--navy-mid);
  color: var(--white);
}

.button--quiet {
  background: var(--white);
  border-color: var(--border-strong);
  color: var(--navy);
}

.button--danger {
  background: var(--white);
  border-color: var(--error);
  color: var(--error);
}

.button--danger:hover {
  background: var(--error-bg);
}

.status-panel {
  align-items: flex-start;
  border: 1px solid;
  border-left-width: 0.35rem;
  border-radius: 0.5rem;
  display: flex;
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 1rem;
}

.status-panel strong {
  color: inherit;
  display: block;
  margin-bottom: 0.2rem;
}

.status-panel p,
.status-panel ul {
  margin-bottom: 0;
}

.status-panel--success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.status-panel--error {
  background: var(--error-bg);
  border-color: var(--error);
  color: #7d1822;
}

.status-panel--warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: #674400;
}

.status-panel--info {
  background: var(--info-bg);
  border-color: var(--info);
  color: #154a76;
}

.context-card,
.workflow-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1rem;
}

.context-card {
  background: var(--navy-tint);
  border-color: #d8e0ed;
  margin-bottom: 1.25rem;
}

.context-card__heading,
.workflow-card__heading {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.context-card__heading h2,
.workflow-card__heading h3 {
  margin-bottom: 0.75rem;
}

.context-grid {
  display: grid;
  gap: 0.8rem 1.5rem;
  grid-template-columns: minmax(0, 2fr) minmax(9rem, 1fr);
  margin: 0;
}

.context-grid div {
  min-width: 0;
}

.context-grid dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

.context-grid dd {
  margin: 0;
}

.context-grid dd span,
.context-grid dd code,
.property-line span,
.property-line code {
  display: block;
}

code {
  color: var(--navy-mid);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.status-badge {
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.2;
  padding: 0.28rem 0.55rem;
}

.status-badge--accepted {
  color: var(--success);
}

.status-badge--rejected,
.status-badge--failed {
  color: var(--error);
}

.status-badge--possible_duplicate,
.status-badge--retry,
.status-badge--submission_uncertain {
  color: var(--warning);
}

.status-badge--queued,
.status-badge--processing,
.status-badge--review,
.status-badge--submitting,
.status-badge--cancelled,
.status-badge--expired,
.status-badge--unknown {
  color: var(--navy-mid);
}

.recent {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.workflow-list {
  display: grid;
  gap: 0.75rem;
}

.workflow-card__heading a {
  color: var(--navy);
}

.property-line {
  color: var(--muted);
  margin-bottom: 0;
}

.cancel-form {
  border-top: 1px solid var(--border);
  margin-top: 1.75rem;
  padding-top: 0.35rem;
}

.back-link {
  margin-top: 1.5rem;
}

.site-footer {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 auto;
  max-width: 900px;
  padding: 0 1.5rem 2rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 720px) {
  .site-header__inner {
    grid-template-columns: 1fr auto;
    padding: 0.85rem 1rem;
  }

  .brand img {
    height: 48px;
  }

  .product-name {
    border-left: 0;
    grid-column: 1 / -1;
    grid-row: 2;
    padding-left: 0;
  }

  .page-shell {
    padding: 1.25rem 1rem;
  }

  .surface {
    border-radius: 0.65rem;
  }

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

@media (max-width: 480px) {
  .environment-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 0.1rem;
  }

  .site-header__inner {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .brand img {
    height: 48px;
  }

  .logout-form {
    grid-row: 3;
    width: 100%;
  }

  .logout-form .button,
  .actions .button {
    width: 100%;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .context-card__heading,
  .workflow-card__heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 1024px) {
  .surface--entry {
    margin-left: auto;
    margin-right: auto;
    max-width: 680px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .surface::before {
    background: CanvasText;
  }

  .status-panel,
  .button,
  .status-badge {
    border: 2px solid ButtonText;
  }
}
