:root {
  color-scheme: light;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #17293d;
  background: #eef3f6;
  line-height: 1.5;
  --ink: #17293d;
  --muted: #526578;
  --border: #d6e1e9;
  --accent: #1256a7;
  --accent-hover: #0b417f;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }

a, button, input, select { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, select):focus-visible {
  outline: 3px solid #236cca;
  outline-offset: 3px;
}

.shell {
  width: min(68rem, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-height: 3rem;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 720;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  flex: none;
  border-radius: .6rem;
  background: #163858;
}

.brand-mark::before {
  content: '';
  width: .68rem;
  height: .38rem;
  border: solid #ffffff;
  border-width: 0 0 2px 2px;
  transform: translateY(-.1rem) rotate(-45deg);
}

.test-label, .connection {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .3rem .65rem;
  border-radius: 100vw;
  font-size: .78rem;
  font-weight: 680;
  line-height: 1.3;
}

.test-label {
  color: #304d6c;
  background: #eaf1f8;
  white-space: nowrap;
}

.workspace { padding-block: clamp(2rem, 5vw, 4rem); }
.intro { margin-block-end: 1.75rem; }

h1 {
  font-size: clamp(2rem, 4.6vw, 3.15rem);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1.09;
}

.intro p {
  margin-block-start: .7rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(15rem, 1fr);
  align-items: start;
  gap: 1.35rem;
}

.main-column { display: grid; gap: 1.1rem; min-width: 0; }

.card {
  border: 1px solid var(--border);
  border-radius: .95rem;
  background: #ffffff;
  box-shadow: 0 .25rem .9rem #1d3d5a08;
}

.access-card, .flow-body, .results-card { padding: clamp(1.15rem, 3.3vw, 1.75rem); }

.access-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  margin-block-end: .75rem;
}

h2 { font-size: 1.2rem; line-height: 1.25; letter-spacing: -.018em; }

.connection { background: #edf2f6; color: #415467; }
.connection[data-state='connecting'] { background: #e6f0fc; color: #1b4a82; }
.connection[data-state='connected'] { background: #e1f5ed; color: #175a45; }
.connection::before {
  content: '';
  width: .44rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
}

.access-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: .65rem;
}

.token-field { flex: 1 1 15rem; }
.access-message { color: var(--muted); font-size: .9rem; margin-block-start: .65rem; }
.access-message[data-state='error'] { color: #9b2c31; }

.step-navigation { border-bottom: 1px solid var(--border); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0 clamp(1.15rem, 3.3vw, 1.75rem);
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding-block: .9rem .75rem;
  border-bottom: .18rem solid transparent;
  color: #526578;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.3;
}

.steps li[aria-current='step'] { color: var(--accent); border-color: var(--accent); }
.steps li.is-complete { color: #175a45; }

.step-number {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #edf2f6;
  font-size: .75rem;
}

.steps li[aria-current='step'] .step-number { color: #fff; background: var(--accent); }
.steps li.is-complete .step-number { background: #e1f5ed; }

.step-intro { margin-block-end: 1.3rem; }
.step-intro p, #result-description { margin-block-start: .4rem; color: var(--muted); }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.05rem 1rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field { display: grid; gap: .32rem; min-width: 0; }
.field label { font-size: .91rem; font-weight: 660; }

.field :is(input, select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: .55rem .75rem;
  border: 1px solid #8498aa;
  border-radius: .45rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: max(1rem, 1em);
}

.field :is(input, select):disabled { background: #f0f4f7; color: #586c7e; opacity: 1; border-color: #bdcbd7; }
.field :is(input, select):user-invalid { border-color: #a73239; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 680;
  line-height: 1.25;
  cursor: pointer;
}

.button:hover:not(:disabled) { background: var(--accent-hover); }
.button:disabled { background: #dfe8f1; color: #506579; cursor: not-allowed; }
.button-secondary { background: white; color: #284965; border-color: #a2b4c5; }
.button-secondary:hover:not(:disabled) { background: #edf4fb; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-block-start: 1.5rem;
}

.form-actions-end { justify-content: flex-end; }

.workflow-status:not(:empty) {
  margin-block-start: .9rem;
  padding: .55rem .75rem;
  border-inline-start: 3px solid #4a7eb8;
  border-radius: .2rem;
  color: #254768;
  background: #edf4fb;
}

.workflow-status[data-state='error']:not(:empty) {
  border-color: #af3e44;
  color: #852a31;
  background: #fff0f0;
}

#retry-catalogue:not([hidden]) { margin-block-start: .65rem; }

.summary-card {
  padding: 1.5rem;
  overflow-wrap: anywhere;
  border-radius: .95rem;
  background: #173650;
  color: #fff;
}

.summary-card dl { margin: .85rem 0 0; }
.summary-card dl > div { padding-block: .68rem; border-bottom: 1px solid #ffffff29; }
.summary-card dt { color: #c1d4e6; font-size: .81rem; }
.summary-card dd { margin: .24rem 0 0; font-size: .94rem; font-weight: 610; }
.summary-note { margin-block-start: 1.05rem; color: #cfdfed; font-size: .84rem; }

.offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: .65rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.offers:empty { margin: 0; }

.offer {
  display: grid;
  gap: .3rem;
  padding: .9rem;
  border: 1px solid #c9dbea;
  border-radius: .55rem;
  background: #f2f7fb;
}

.offer-name { color: #24435f; font-size: .94rem; font-weight: 720; }
.offer-amount { font-size: 1.35rem; font-weight: 760; letter-spacing: -.025em; }
.offer-label { color: #485f75; font-size: .82rem; }

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

@media (max-width: 48rem) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .shell { width: min(40rem, calc(100% - 2rem)); }
}

@media (max-width: 32rem) {
  .header-content { min-height: 3.75rem; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { gap: .35rem; }
  .steps li { flex-direction: column; align-items: flex-start; gap: .35rem; font-size: .77rem; }
  .token-field { flex-basis: 100%; }
}
