:root {
  color-scheme: light;
  --ink: #142033;
  --muted: #4d5c70;
  --edge: #d7dfe8;
  --paper: #ffffff;
  --bg: #edf2f6;
  --dark: #101c2c;
  --accent: #08586a;
  --signal: #075649;
  --block: #8e2b24;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.52;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(calc(100% - 2.5rem), 70rem); margin-inline: auto; }
.top { color: #e8f4fb; background: var(--dark); }
.nav, .nav-links, .section-head, .actions { display: flex; align-items: center; }
.nav, .section-head { justify-content: space-between; gap: 1rem; }
.nav { min-height: 3.75rem; }
.nav-links { gap: 1.35rem; }
.nav a { color: #e8f4fb; text-underline-offset: .25em; }
.brand { font-size: 1.22rem; font-weight: 760; letter-spacing: -.035em; text-decoration: none; }
.brand span { color: #89dddc; }
.quiet { color: #e8f4fb; background: transparent; border: 1px solid #687c92; }
main { padding: 2.5rem 0 3.5rem; }
.intro { max-width: 54rem; }
.subject { font-size: .89rem; font-weight: 700; letter-spacing: .035em; color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -.045em; margin: .45rem 0 .8rem; }
h2 { font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.22; }
h3 { font-size: 1.02rem; margin: .95rem 0 .4rem; }
p { color: var(--muted); }
.intro p { font-size: 1.08rem; max-width: 44rem; }
.topology {
  display: grid;
  grid-template-columns: minmax(0, 1fr) .8fr minmax(0, 1fr) .8fr minmax(0, 1fr);
  align-items: center;
  background: #dfe8ee;
  border-radius: .7rem;
  margin: 1.55rem 0;
  padding: 1.12rem 1.3rem;
}
.connector { height: 1px; background: #8095a6; }
.node {
  text-align: center;
  min-height: 4rem;
  display: grid;
  align-content: center;
  padding: .45rem;
  border: 1px solid #9babba;
  border-radius: .4rem;
  background: #f8fbfd;
}
.node > :nth-child(2) { font-size: .89rem; color: var(--muted); }
.node.gateway { color: white; background: var(--accent); border-color: var(--accent); }
.node.gateway span { color: #ecf9fb; }
.panel { background: var(--paper); border: 1px solid var(--edge); border-radius: .7rem; padding: 1.35rem; margin-top: 1.15rem; }
.access { max-width: 34rem; }
.access p { margin-top: .5rem; }
.access form { display: grid; gap: .55rem; margin-top: 1.2rem; }
.access button { justify-self: start; margin-top: .2rem; }
.seat { color: var(--accent); font-size: .93rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.policy-head { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem 2rem; margin-top: 1.15rem; }
.control { display: grid; gap: .28rem; }
.checkbox { display: flex; align-items: center; gap: .55rem; min-height: 2.55rem; }
input[type="checkbox"] { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
label, th { font-weight: 650; }
input, select, button { font: inherit; }
input:not([type="checkbox"]), select {
  color: var(--ink);
  background: white;
  border: 1px solid #aab8c7;
  border-radius: .35rem;
  padding: .44rem .65rem;
  min-height: 2.48rem;
}
button { cursor: pointer; background: #f2f7fa; color: var(--accent); border: 1px solid #a6bac5; font-weight: 700; border-radius: .35rem; padding: .51rem .82rem; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { cursor: default; opacity: .63; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover:not(:disabled) { background: #064755; }
:focus-visible { outline: 3px solid #13a39c; outline-offset: 2px; }
.hint, .status { min-height: 1.2em; margin: .52rem 0; }
.hint { font-size: .94rem; }
.status { font-size: .93rem; }
.status.error { color: var(--block); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: middle; padding: .62rem .65rem; border-bottom: 1px solid var(--edge); }
thead { background: #f0f4f7; }
th { font-size: .91rem; color: #38495e; white-space: nowrap; }
td { font-size: .94rem; }
td button { padding: .34rem .62rem; }
td code { white-space: nowrap; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.policy-table input { width: 100%; min-width: 11rem; }
.rule-sid { display: block; color: var(--muted); font-size: .79rem; font-variant-numeric: tabular-nums; }
.actions { flex-wrap: wrap; gap: .4rem .8rem; margin-top: 1rem; }
#history-empty { margin-top: .68rem; }
#history > details { border-top: 1px solid var(--edge); padding: .75rem 0 .35rem; }
#history > details:first-child { border-top: 0; }
summary { cursor: pointer; font-weight: 660; }
.pass { font-weight: 700; color: var(--signal); }
.drop { font-weight: 700; color: var(--block); }
.preview { color: var(--muted); font-size: .9rem; margin: .5rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 43rem) {
  .wrap { width: min(calc(100% - 1.25rem), 70rem); }
  main { padding-top: 1.5rem; }
  .panel { padding: .95rem; }
  .topology { grid-template-columns: minmax(0, 1fr) .2fr minmax(0, 1fr) .2fr minmax(0, 1fr); padding: .65rem; }
  .node strong { font-size: .93rem; }
  .node > :nth-child(2) { font-size: .77rem; }
  td, th { padding: .5rem; }
  .nav-links { gap: .8rem; }
}
