:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #182437;
  background: #f4f6fa;
  --nav: #14243b;
  --line: #dae2ec;
  --muted: #516178;
  --accent: #1b56a0;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
aside { display: flex; flex-direction: column; gap: 36px; padding: 28px 18px; background: var(--nav); color: #e1e8f3; }
.brand { display: inline-flex; gap: 10px; align-items: center; width: fit-content; font-size: 1.45rem; font-weight: 700; color: inherit; text-decoration: none; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #2864ac; color: white; font-size: 1.45rem; }
aside .brand { margin-left: 8px; }
nav { display: grid; gap: 4px; }
nav a { padding: 10px 12px; color: #e1e8f3; text-decoration: none; border-radius: 7px; }
nav a:hover, nav a[aria-current="page"] { background: #294567; color: white; }
.nav-label { padding: 18px 12px 4px; font-size: .875rem; color: #b4c9e5; }
.quiet { align-self: start; margin-top: auto; color: inherit; border-color: #496683; background: transparent; }
.quiet:hover { background: #243c59; }
main { width: min(100%, 1150px); padding: clamp(24px, 5vw, 64px); margin-inline: auto; }
main:focus { outline: none; }
header { margin: 0 0 28px; }
h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -.04em; }
h2 { margin: 0 0 12px; font-size: 1.25rem; letter-spacing: -.02em; }
p { line-height: 1.55; color: var(--muted); margin: 0 0 14px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { padding: clamp(18px, 3vw, 28px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 6px #0d234208; }
.card-head, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.card-head { justify-content: space-between; margin-bottom: 12px; }
.card-head :is(h1, h2) { margin: 0; }
.status { padding: 4px 10px; border-radius: 99px; background: #edf1f6; color: #304560; font-size: .875rem; white-space: nowrap; }
.status[data-tone="up"] { background: #e3f4eb; color: #155b3f; }
.status[data-tone="down"] { background: #fce8e7; color: #982c28; }
.status[data-tone="pending"] { background: #fff1d4; color: #74500e; }
.onboarding, .lookup, .result-card { margin-top: 18px; }
ol { padding-left: 22px; margin: 0; color: var(--muted); line-height: 1.55; }
li + li { margin-top: 8px; }
form { display: grid; gap: 16px; }
form h2 { margin-bottom: 0; }
form > button { justify-self: start; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }
label { display: grid; align-content: start; gap: 6px; min-width: 0; font-size: .9375rem; font-weight: 600; }
small, .hint { color: var(--muted); font-size: .875rem; font-weight: 400; }
input, textarea { width: 100%; min-width: 0; border: 1px solid #bac8d9; border-radius: 7px; background: #fbfcfe; color: #182437; padding: 10px 12px; font: inherit; font-weight: 400; }
textarea { resize: vertical; }
.code, pre { font-family: ui-monospace, "Cascadia Code", monospace; font-size: .9rem; line-height: 1.55; }
pre { background: #f3f6fb; border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 22rem; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; margin: 0; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 14px; min-height: 40px; border: 1px solid #bdcad8; border-radius: 7px; background: #fff; color: #243851; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #eef4fa; }
.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #154682; }
button:disabled { opacity: .55; cursor: default; }
.text-link { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #3684d8; outline-offset: 2px; }
.feedback { margin: 0; font-size: .9375rem; }
.feedback:empty, #login-error:empty { display: none; }
[data-error="true"], #login-error { color: #982c28; }
.result-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.result-card pre { margin-top: 12px; }
.result-card img { width: 185px; height: 185px; outline: 1px solid var(--line); border-radius: 8px; }
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login form { width: min(100%, 420px); gap: 18px; }
.login h1 { font-size: 1.85rem; }
.login button { justify-self: stretch; }

@media (max-width: 840px) {
  .shell { grid-template-columns: 185px minmax(0, 1fr); }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell, .fields, .result-card { grid-template-columns: 1fr; }
  aside { gap: 12px; padding: 14px; }
  nav { display: flex; flex-wrap: wrap; }
  nav a { padding: 7px 9px; }
  .nav-label { display: none; }
  .quiet { align-self: end; }
}
