@font-face {
  font-family: "Aino";
  src: url("/static/brand/fonts/AinoRegular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Aino";
  src: url("/static/brand/fonts/AinoBold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Aino Headline";
  src: url("/static/brand/fonts/AinoHeadline.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

:root {
  --ee-blue: #0030de;
  --ee-blue-dark: #000087;
  --ee-blue-bright: #0062f5;
  --ee-blue-soft: #cee2fd;
  --ee-cyan: #00c3ff;
  --ee-warm: #fceec8;
  --stone-0: #ffffff;
  --stone-1: #f1f5f9;
  --stone-2: #e2e8f0;
  --stone-3: #cbd5e1;
  --stone-5: #64748b;
  --stone-7: #3d4b5e;
  --stone-9: #0f172a;
  --danger: #b42318;
  --success: #137333;
  --radius: 8px;
  --content: 1180px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--stone-1);
  color: var(--stone-9);
  font-family: "Aino", "Noto Sans", Verdana, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 14px max(24px, calc((100vw - var(--content)) / 2));
  background: var(--stone-0);
  border-bottom: 1px solid var(--stone-3);
}

.nav-drawer {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-title {
  color: var(--ee-blue-dark);
  font-family: "Aino Headline", "Aino", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.topnav {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.topnav a,
.lang-switch a,
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.topnav a,
.lang-switch a {
  color: var(--stone-7);
}

.topnav a[aria-current="page"],
.lang-switch a[aria-current="true"] {
  color: var(--ee-blue);
  background: var(--ee-blue-soft);
}

.lang-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.lang-switch a {
  min-width: 42px;
  color: var(--stone-7);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  background: var(--stone-0);
  color: var(--stone-9);
  cursor: pointer;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
}

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

main {
  max-width: var(--content);
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 3px solid var(--ee-blue);
}

.page-head.compact {
  align-items: center;
}

.brand-head {
  position: relative;
  overflow: hidden;
}

.brand-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.page-illustration {
  flex: 0 0 auto;
  width: clamp(180px, 24vw, 280px);
  max-height: 174px;
  object-fit: contain;
  opacity: 0.88;
}

.page-illustration.small {
  width: clamp(150px, 20vw, 220px);
  max-height: 144px;
  opacity: 0.78;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--ee-blue);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Aino Headline", "Aino", sans-serif;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  font-size: 42px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-family: "Aino", "Noto Sans", Verdana, system-ui, sans-serif;
  font-size: 17px;
}

.lede {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--stone-7);
}

.button {
  font: inherit;
  font-weight: 700;
}

.button.primary {
  background: var(--ee-blue);
  color: var(--stone-0);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--ee-blue-dark);
}

.button.ghost {
  background: var(--stone-0);
  border-color: var(--stone-3);
  color: var(--ee-blue);
}

.button.danger {
  background: var(--stone-0);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--stone-3));
  color: var(--danger);
}

.button.danger:hover,
.button.danger:focus-visible {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--stone-0);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.button-row form {
  margin: 0;
}

.panel {
  margin: 0 0 22px;
  padding: 24px 0;
  border-top: 1px solid var(--stone-3);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head.inline {
  margin-top: 18px;
}

.panel-description {
  max-width: 780px;
  margin: 6px 0 0;
  color: var(--stone-6);
  font-size: 15px;
  line-height: 1.45;
}

.count,
.privacy-note,
.required-note,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.count,
.privacy-note {
  color: var(--ee-blue-dark);
  background: var(--ee-blue-soft);
}

.required-note {
  background: var(--ee-warm);
  color: var(--stone-9);
}

.status {
  color: var(--stone-0);
  background: var(--stone-7);
}

.status-draft,
.status-pending {
  background: var(--ee-blue-bright);
}

.status-running {
  background: var(--ee-blue);
}

.status-submitted,
.status-done {
  background: var(--success);
}

.status-failed,
.status-error {
  background: var(--danger);
}

.error-text {
  color: var(--danger);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  background: var(--stone-0);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--stone-2);
}

th {
  color: var(--stone-7);
  font-size: 13px;
  font-weight: 700;
}

td small {
  display: block;
  color: var(--stone-5);
  margin-top: 2px;
}

tr:last-child td {
  border-bottom: 0;
}

.actions {
  text-align: right;
}

.empty,
.alert {
  background: var(--stone-0);
  border: 1px solid var(--stone-3);
  border-left: 6px solid var(--ee-blue);
  border-radius: var(--radius);
  padding: 22px;
}

.alert {
  border-left-color: var(--danger);
  margin-bottom: 22px;
}

.alert ul {
  margin-bottom: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 22px;
}

.welcome-card {
  min-height: 190px;
  padding: 18px;
  background: var(--stone-0);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
}

.welcome-card span {
  display: inline-flex;
  min-width: 34px;
  margin-bottom: 14px;
  padding: 3px 6px;
  justify-content: center;
  color: var(--ee-blue);
  background: var(--ee-blue-soft);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
}

.welcome-card h2 {
  margin-bottom: 10px;
}

.welcome-card p {
  margin: 0;
  color: var(--stone-7);
}

.use-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
}

.use-list h3 {
  margin-bottom: 6px;
}

.use-list p {
  margin: 0;
  color: var(--stone-7);
}

.compact-lede {
  max-width: 860px;
}

.start-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.metric {
  background: var(--stone-0);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  padding: 16px;
}

.metric span,
.hint {
  color: var(--stone-5);
  font-size: 14px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--ee-blue);
  font-size: 28px;
}

.intake-form {
  display: block;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 4px;
  border-bottom: 1px solid var(--stone-3);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--stone-5);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--ee-blue);
}

.tab.active {
  color: var(--ee-blue);
  border-bottom-color: var(--ee-blue);
}

/* No-JS fallback: show every panel. JS adds .active and hides the rest. */
.tab-panel {
  display: block;
}

[data-tabbed-form][data-js-tabs] .tab-panel {
  display: none;
}

[data-tabbed-form][data-js-tabs] .tab-panel.active {
  display: block;
}

.grid.phone {
  grid-template-columns: 140px minmax(0, 1fr);
}

.subhead {
  margin: 22px 0 12px;
  color: var(--stone-7);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
}

.detail-list dt {
  color: var(--stone-5);
  font-size: 14px;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  color: var(--stone-9);
}

.detail-prose {
  margin-top: 0;
  color: var(--stone-8);
}

.empty-state {
  margin: 0;
  padding: 18px 0;
  color: var(--stone-6);
  border-top: 1px solid var(--stone-2);
}

.prewrap {
  white-space: pre-wrap;
}

.detail-card {
  padding: 16px;
  margin-bottom: 14px;
  background: var(--stone-0);
  border: 1px solid var(--stone-2);
  border-radius: var(--radius);
}

.detail-card h3 {
  margin: 0 0 8px;
}

.detail-card h3 small {
  color: var(--stone-5);
  font-weight: 600;
}

.detail-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.detail-card-actions form {
  margin: 0;
}

@media (max-width: 720px) {
  .detail-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 180px 1fr auto auto;
  gap: 12px;
  align-items: end;
}

.user-role-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.user-role-form select {
  width: auto;
  min-width: 160px;
  margin-top: 0;
}

.account-form {
  display: grid;
  max-width: 560px;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.span-two {
  grid-column: 1 / -1;
}

.form-sections {
  display: grid;
  gap: 24px;
}

.form-section {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 28px;
  padding: 20px 0;
  border-top: 1px solid var(--stone-2);
}

.form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--stone-7);
}

.section-title span {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 3px 6px;
  color: var(--ee-blue);
  background: var(--ee-blue-soft);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.section-title h3 {
  margin-top: 2px;
  color: var(--stone-9);
}

.section-fields {
  align-items: start;
}

.evidence-grid textarea {
  min-height: 220px;
}

label,
fieldset {
  display: block;
  min-width: 0;
}

label {
  color: var(--stone-7);
  font-size: 14px;
  font-weight: 700;
}

.required-star {
  color: var(--danger);
}

.field-help {
  display: block;
  max-width: 760px;
  margin-top: 3px;
  color: var(--stone-5);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.character-counter {
  display: block;
  margin-top: 4px;
  color: var(--stone-5);
  font-size: 12px;
  font-weight: 400;
  text-align: right;
}

.character-counter.near-limit {
  color: var(--danger);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  color: var(--stone-9);
  background: var(--stone-0);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
.button:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid var(--ee-cyan);
  outline-offset: 2px;
}

.repeat {
  display: grid;
  gap: 0;
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.row-head.actions-only {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--ee-blue);
  background: var(--ee-blue);
  color: var(--stone-0);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.icon-button.subdued {
  border-color: var(--stone-3);
  background: var(--stone-0);
  color: var(--stone-7);
}

.range-label {
  margin: 16px 0;
}

.range-label span {
  margin-left: 8px;
  color: var(--ee-blue);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--ee-blue);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 18px;
}

.segmented label {
  min-height: 48px;
}

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

.segmented span {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  text-align: center;
  background: var(--stone-0);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  color: var(--stone-7);
}

.segmented input:checked + span {
  color: var(--stone-0);
  background: var(--ee-blue);
  border-color: var(--ee-blue);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 0;
}

.checks label,
.check-grid label,
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  color: var(--stone-9);
}

.checks input,
.check-grid input,
.checkbox-line input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--ee-blue);
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin: 16px 0;
}

.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.choice-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--stone-1);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  color: var(--stone-9);
  font-weight: 500;
}

.choice-list input {
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--ee-blue);
}

fieldset {
  margin: 0;
  padding: 14px;
  background: var(--stone-0);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
}

legend {
  color: var(--stone-7);
  font-weight: 700;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 0 0;
}

.code-block {
  max-height: 620px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  background: var(--stone-9);
  color: var(--stone-0);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .page-head,
  .page-head.compact {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    position: sticky;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 64px;
    padding: 10px 16px;
  }

  .brand {
    width: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-drawer {
    position: fixed;
    top: 64px;
    right: 12px;
    bottom: 12px;
    left: auto;
    z-index: 101;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    width: min(340px, calc(100vw - 24px));
    padding: 14px;
    overflow-y: auto;
    background: var(--stone-0);
    border: 1px solid var(--stone-3);
    border-radius: var(--radius);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  }

  .topbar[data-menu-open="true"] .nav-drawer {
    display: flex;
  }

  .topnav {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .topnav a {
    width: 100%;
    justify-content: flex-start;
  }

  .lang-switch {
    width: 100%;
  }

  .lang-switch a {
    flex: 1;
  }

  .page-illustration {
    position: absolute;
    right: 0;
    bottom: 18px;
    width: 170px;
    opacity: 0.22;
  }

  .grid.two,
  .grid.three,
  .summary-grid,
  .welcome-grid,
  .use-list,
  .segmented,
  .check-grid,
  .inline-form,
  .account-form,
  .form-section {
    grid-template-columns: 1fr;
  }

  .form-section {
    gap: 12px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .span-two {
    grid-column: auto;
  }

  h1 {
    font-size: 34px;
  }

  .button-row,
  .form-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  main {
    padding-inline: 16px;
  }

  .brand-title {
    font-size: 18px;
    line-height: 1.15;
  }

  .page-illustration {
    display: none;
  }

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

  .form-actions {
    flex-direction: column;
  }
}
