:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5b6475;
  --surface: #ffffff;
  --surface-soft: #f3f6fa;
  --border: #d8dee9;
  --brand: #0b5cab;
  --brand-strong: #073f78;
  --warning-bg: #fff4cc;
  --warning-ink: #5c4300;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: var(--surface-soft);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-soft);
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brand-strong);
}

:focus-visible {
  outline: 3px solid #f4b400;
  outline-offset: 3px;
}

button,
input {
  font: inherit;
}

button,
input,
a {
  min-height: 44px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  top: 1rem;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #091426;
  color: white;
}

.topbar > div {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.environment-chip {
  border: 1px solid #8fb8e0;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
}

.session-summary {
  color: #d5dfec;
  font-size: 0.9rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  min-height: calc(100vh - 72px);
}

.sidebar {
  padding: 1.25rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sidebar ul {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar a,
.sidebar li > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
}

.sidebar a {
  background: #eaf3fc;
  font-weight: 700;
}

.sidebar li > span {
  color: var(--muted);
}

.sidebar small {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.policy-card,
.control-panel,
.summary-card,
.state-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 2px 10px rgb(23 32 51 / 5%);
}

.policy-card {
  margin-top: 2rem;
  padding: 1rem;
}

.policy-card h2 {
  font-size: 1rem;
}

main#main-content {
  width: min(1120px, 100%);
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.synthetic-banner {
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  border-left: 5px solid #d39b00;
  background: var(--warning-bg);
  color: var(--warning-ink);
  font-weight: 650;
}

.eyebrow {
  margin-bottom: 0.25rem;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}

.lede {
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.summary-card {
  padding: 1.1rem;
}

.summary-card h2 {
  margin-top: 0;
  font-size: 1rem;
}

.summary-card strong {
  display: block;
  font-size: 2rem;
}

.summary-card p {
  color: var(--muted);
}

.control-panel {
  padding: 1.25rem;
}

.control-panel li + li {
  margin-top: 0.5rem;
}

.state-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.25rem;
}

.state-card {
  width: min(600px, 100%);
  padding: clamp(1.25rem, 5vw, 2.5rem);
}

.state-card form {
  display: grid;
  gap: 0.7rem;
  margin: 1.25rem 0;
}

.state-card input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #8d96a6;
  border-radius: 0.45rem;
}

.state-card button {
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0.45rem;
  background: #bbc2cc;
  color: #313947;
  font-weight: 700;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

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