:root {
  --midnight: hsl(220 55% 11%);
  --paper: hsl(46 24% 97%);
  --surface: hsl(0 0% 100%);
  --surface-2: hsl(210 24% 98%);
  --ink: hsl(218 46% 13%);
  --muted: hsl(216 15% 39%);
  --soft: hsl(216 12% 55%);
  --line: hsl(216 18% 83%);
  --line-strong: hsl(216 18% 72%);
  --blue: hsl(201 82% 39%);
  --blue-dark: hsl(202 76% 31%);
  --blue-wash: hsl(202 82% 96%);
  --teal: hsl(171 55% 32%);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow-sm: 0 1px 2px hsl(218 44% 10% / .06), 0 8px 24px hsl(218 44% 10% / .06);
  --shadow-lg: 0 2px 4px hsl(218 44% 10% / .08), 0 24px 60px hsl(218 44% 10% / .12);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 30px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  font-family: var(--mono);
}

.hd {
  min-height: 72px;
  background: hsl(46 24% 97% / .96);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px hsl(218 44% 10% / .035);
  backdrop-filter: blur(14px);
}

.hd-in {
  width: min(1184px, calc(100% - 64px));
  max-width: none;
  min-height: 72px;
  padding: 0;
}

.portal-brand {
  gap: 10px;
  color: var(--ink);
}

.portal-brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  box-shadow: 0 1px 2px hsl(218 44% 10% / .12);
}

.portal-brand span {
  font-size: 18px;
  font-weight: 700;
}

.portal-brand small,
.hd small {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.hd-tools {
  gap: 12px;
  flex-wrap: nowrap;
}

.hd-tools a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--blue-dark);
  font-size: 14px;
  transition: color 150ms var(--ease), background 150ms var(--ease);
}

.hd-tools a:hover {
  color: var(--ink);
  background: var(--surface);
}

.pillx,
.hd .pillx {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--blue-wash);
  border: 1px solid hsl(202 42% 78%);
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.portal-entry {
  flex: 1;
  display: grid;
  place-items: start center;
  width: 100%;
  padding: 64px 24px 96px;
}

.entry-panel {
  width: min(100%, 720px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.entry-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--blue-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
}

.entry-kicker i {
  font-size: 18px;
}

.entry-panel h1 {
  max-width: 18ch;
  margin: 0;
  color: var(--ink);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.12;
}

.entry-intro {
  max-width: 60ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.entry-form {
  margin-top: 32px;
}

.portal-grid {
  gap: 16px;
}

label {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background 150ms var(--ease);
}

input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px hsl(201 82% 44% / .16);
}

.code-input {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.field-note {
  margin-top: 6px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
}

.entry-form .actions-row {
  margin-top: 24px;
}

button {
  min-height: 44px;
  margin: 0;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-size: 14px;
  transition: transform 150ms var(--ease), background 150ms var(--ease);
}

button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.entry-scope {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.entry-scope i {
  flex: none;
  margin-top: 2px;
  color: var(--teal);
  font-size: 18px;
}

.entry-scope b {
  color: var(--ink);
}

.code-help {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.code-help summary {
  padding: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.code-help summary::-webkit-details-marker {
  display: none;
}

.code-help summary::after {
  content: '+';
  font-family: var(--mono);
}

.code-help[open] summary::after {
  content: '-';
}

.code-help p {
  margin: 8px 0 0;
  font-size: 13px;
}

.entry-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 32px -32px -32px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.entry-trust span {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.entry-trust span:last-child {
  border-right: 0;
}

.entry-trust i {
  flex: none;
  color: var(--teal);
  font-size: 18px;
}

.wrap {
  width: min(1040px, calc(100% - 48px));
  max-width: none;
  padding: 48px 0 80px;
}

.card {
  padding: 24px;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.card h1 {
  font-size: 30px;
}

.card h2 {
  font-size: 24px;
}

.card p,
.card li {
  font-size: 14px;
}

.scope-note {
  border-color: hsl(202 42% 80%);
  background: var(--blue-wash);
  color: hsl(202 48% 27%);
}

.side-panel,
.option-card,
.receipt-cell {
  background: var(--surface-2);
}

.ghost {
  border-radius: 6px !important;
  transition: transform 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease);
}

.ghost:hover {
  transform: translateY(-1px);
}

.portal-footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  background: hsl(210 20% 94%);
}

.portal-footer .foot-in {
  width: min(1040px, calc(100% - 48px));
  max-width: none;
  margin: 0 auto;
}

.portal-footer a {
  margin-right: 16px;
  color: var(--blue-dark);
  font-size: 13px;
}

.fine {
  margin-top: 12px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .hd-in {
    width: min(100% - 32px, 1184px);
    min-height: 64px;
    padding: 0;
    flex-direction: row;
    align-items: center;
  }

  .portal-brand small {
    display: none;
  }

  .hd-tools a {
    width: 40px;
    padding: 8px;
    justify-content: center;
    font-size: 0;
  }

  .hd-tools a i {
    font-size: 20px;
  }

  .hd .pillx {
    display: none;
  }

  .portal-entry {
    padding: 40px 16px 64px;
  }

  .entry-panel {
    padding: 24px;
  }

  .entry-panel h1 {
    font-size: 30px;
  }

  .entry-trust {
    grid-template-columns: 1fr;
    margin: 24px -24px -24px;
  }

  .entry-trust span {
    min-height: 52px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .entry-trust span:last-child {
    border-bottom: 0;
  }

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

  .wrap {
    width: min(100% - 32px, 1040px);
    padding: 32px 0 56px;
  }

  .portal-footer {
    padding: 24px 16px;
  }

  .portal-footer .foot-in {
    width: min(100%, 1040px);
  }
}

@media (max-width: 420px) {
  .portal-brand span {
    font-size: 16px;
  }

  .portal-brand img {
    width: 28px;
    height: 28px;
  }
}

@media print {
  body::before,
  .hd,
  .portal-footer {
    display: none;
  }

  body {
    padding: 0;
    background: white;
  }

  .wrap {
    width: 100%;
    padding: 0;
  }

  .card {
    border: 0;
    box-shadow: none;
  }
}
