:root {
  color-scheme: light;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  --ink: #17213a;
  --muted: #5e6678;
  --surface: #fff;
  --page: #f6f7fb;
  --line: #dde1ea;
  --green: #253b80;
  --green-dark: #16275b;
  --green-soft: #edf1fb;
  --red: #9c2424;
  --red-soft: #faeeee;
  --amber: #704a12;
  --amber-soft: #fff3df;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 15px; line-height: 1.6; }
h1, h2, p, dl { margin: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.25; letter-spacing: -.03em; }
h2 { font-size: 1.125rem; line-height: 1.4; }
bdi, small { overflow-wrap: anywhere; }
small, .muted { color: var(--muted); }
button, input, textarea { font: inherit; }
button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); cursor: pointer; padding: .5rem .75rem; min-height: 40px; }
button:hover:not(:disabled) { background: var(--green-soft); border-color: #9eb4d8; }
button:disabled { opacity: .55; cursor: default; }
button.primary { color: white; background: var(--green); border-color: var(--green); font-weight: 650; }
button.primary:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
button.danger { color: var(--red); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #667fc8; outline-offset: 2px; }
input, textarea { width: 100%; min-width: 0; padding: .5rem .625rem; border: 1px solid #bdc5d8; border-radius: 7px; background: white; color: var(--ink); }
textarea { resize: vertical; }
label { display: grid; gap: .25rem; font-weight: 600; }
.top { background: linear-gradient(120deg,#111f4d,#253b80); color: white; border-bottom: 3px solid #d9a441; }
.top-inner, .container { max-width: 1320px; margin: auto; padding: 0 2rem; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 70px; }
.brand, .session { display: flex; align-items: center; gap: .75rem; }
.brand div { display: grid; line-height: 1.3; }
.brand small { color: #dfe5f6; }
.mark { display: grid; place-items: center; width: 40px; height: 40px; }
.mark svg { width: 40px; height: 40px; display: block; filter: drop-shadow(0 5px 12px rgba(4,10,32,.25)); }
.session button { color: white; background: transparent; border-color: #7186c2; }
.session button:hover { background: #314e9f; }
.session bdi { font-size: .875rem; color: #e3e8f8; }
.container { padding-top: 2rem; padding-bottom: 3rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; min-width: 0; }
.login { max-width: 430px; margin: 3rem auto; padding: 1.75rem; }
.login form, #confirm-form { display: grid; gap: 1rem; }
.login form { margin-top: 1.5rem; }
.login h1, .page-heading h1 { margin-bottom: .375rem; }
.eyebrow { color: var(--green); font-size: .875rem; font-weight: 700; margin-bottom: .25rem; }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.layout { display: grid; grid-template-columns: minmax(245px, 290px) minmax(0, 1fr); align-items: start; gap: 1rem; margin-top: 1.25rem; }
.directory { display: grid; gap: .75rem; }
.search { display: grid; grid-template-columns: 1fr auto; gap: .375rem; }
.companies { list-style: none; padding: 0; margin: 0; display: grid; gap: .375rem; }
.companies button { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; text-align: start; gap: .5rem; }
.companies button[aria-current="true"] { background: var(--green-soft); border-color: #8297d0; }
.companies button strong { overflow-wrap: anywhere; }
.companies button small { display: block; margin-top: .125rem; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .25rem; }
.details { display: grid; gap: 1rem; min-width: 0; }
.details[aria-busy="true"] { opacity: .7; }
.company-heading h2 { font-size: 1.5rem; overflow-wrap: anywhere; }
.labels, .actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.labels { margin-top: .5rem; }
.badge { display: inline-block; border-radius: 999px; padding: .125rem .5rem; font-size: .8rem; font-weight: 650; white-space: nowrap; background: #edf1ee; color: var(--muted); }
.badge.good { background: var(--green-soft); color: var(--green-dark); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.wallet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: .875rem 0; }
.wallet div { background: #f4f6fb; border-radius: 7px; padding: .625rem .75rem; border-top: 2px solid #d9a441; }
.wallet dt { color: var(--muted); font-size: .8rem; }
.wallet dd { margin: 0; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .625rem; margin-top: .75rem; }
.inline-form label { width: min(130px, 44%); }
.records { display: grid; margin-top: .75rem; }
.record { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .625rem 0; border-top: 1px solid var(--line); }
.record small { display: block; }
.record > * { min-width: 0; }
.record .actions { flex: 0 0 auto; }
.record p { overflow-wrap: anywhere; }
.feedback { margin-top: .5rem; color: var(--green-dark); }
.feedback:empty { display: none; }
.feedback.error, [role="alert"].feedback { color: var(--red); }
.empty { color: var(--muted); padding-top: .625rem; }
dialog { border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 1.25rem; width: min(460px, calc(100% - 2rem)); }
dialog::backdrop { background: #111936c9; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 780px) {
  .top-inner, .container { padding-inline: 1rem; }
  .layout { grid-template-columns: 1fr; }
  .companies { max-height: 230px; overflow-y: auto; }
  .session bdi { display: none; }
}
@media (max-width: 440px) {
  .panel { padding: 1rem; }
  .wallet { grid-template-columns: repeat(2, 1fr); }
  .record { flex-wrap: wrap; }
  .record .actions { flex: 1 1 auto; }
}
