:root {
  color-scheme: light dark;
  --background: light-dark(rgb(245 246 249), rgb(20 22 28));
  --surface: light-dark(rgb(255 255 255), rgb(29 32 39));
  --text: light-dark(rgb(24 30 42), rgb(242 244 248));
  --secondary: light-dark(rgb(78 86 101), rgb(184 192 207));
  --border: light-dark(rgb(205 210 220), rgb(72 79 94));
  --accent: light-dark(rgb(22 72 172), rgb(169 194 255));
  --accent-text: light-dark(rgb(255 255 255), rgb(16 36 76));
  --danger: light-dark(rgb(157 25 38), rgb(255 174 177));
  --glass: light-dark(rgb(245 246 249 / 94%), rgb(20 22 28 / 94%));
  --ease-glass: cubic-bezier(0.42, 0.0, 0.58, 1.0);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--background); color: var(--text); line-height: 1.5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { position: sticky; top: 0; z-index: 2; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(16px); }
header a { color: var(--text); text-decoration: none; font-size: 20px; padding-block: 8px; }
main { max-width: 1200px; margin: auto; padding: 40px 24px; }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.03em; line-height: 1.15; margin: 12px 0 24px; }
h2 { font-size: 23px; line-height: 1.3; }
p { color: var(--secondary); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
.narrow { max-width: 580px; margin: 48px auto; }
form, .content { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
form { margin-block: 24px; }
label { display: block; font-weight: 600; margin: 16px 0; }
input, select, button, textarea { font: inherit; color: var(--text); min-height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px 14px; }
input, textarea { display: block; width: 100%; margin-top: 8px; }
button { cursor: pointer; font-weight: 600; transition: background 150ms var(--ease-glass); }
button:hover { border-color: var(--accent); }
button:disabled { cursor: wait; color: var(--secondary); }
button[type=submit], #login, button[aria-pressed=true] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.heading, .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actions { justify-content: flex-start; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--secondary); font-weight: 600; }
th, td { padding: 16px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
td small { display: block; color: var(--secondary); }
td button { margin: 4px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 ui-monospace, monospace; }
dialog { color: var(--text); background: var(--surface); max-width: min(640px, 92vw); border: 1px solid var(--border); border-radius: 24px; padding: 0; }
dialog form { margin: 0; border: 0; }
dialog::backdrop { background: rgb(0 0 0 / 50%); }
#message:not(:empty) { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 24px; }
.error { color: var(--danger); }
.footnote { text-align: center; font-size: 13px; margin-top: 48px; }
.gateway-section { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.gateway-section select { display: block; width: 100%; margin-top: 8px; }
.gateway-options, .gateway-service-row { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 20px 0; min-width: 0; }
.gateway-options legend, .gateway-service-row legend { font-weight: 600; padding-inline: 6px; }
.gateway-options label { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-block: 8px; overflow-wrap: anywhere; }
.gateway-options input[type=checkbox] { flex: 0 0 auto; width: 22px; height: 22px; min-height: 22px; margin: 0; accent-color: var(--accent); }
.gateway-service-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; }
.gateway-service-row label { margin: 0; }
.gateway-service-row button { justify-self: start; }
.gateway-section details { min-width: 200px; max-width: 360px; }
.gateway-section summary { cursor: pointer; color: var(--accent); min-height: 44px; padding-block: 10px; }
@media (max-width: 640px) { header { padding: 12px 16px; } main { padding: 24px 12px; } .content { padding: 16px; } }
@media (max-width: 640px) { .gateway-service-row { grid-template-columns: minmax(0, 1fr); } .gateway-section form { padding: 16px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (prefers-reduced-transparency: reduce) { header { backdrop-filter: none; background: var(--background); } }
@media (forced-colors: active) { button { border: 1px solid ButtonText; } }
