/* ---- Fonts (Source Sans Pro, SIL OFL; see fonts/OFL.txt) ---- */
@font-face {
  font-family: "Source Sans Pro";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/SourceSansPro-Regular.otf") format("opentype");
}
@font-face {
  font-family: "Source Sans Pro";
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
  src: url("fonts/SourceSansPro-Semibold.otf") format("opentype");
}

/* ---- Tokens: palette follows the OPNsense GUI ---- */
:root {
  color-scheme: light dark;
  --bg: #f5f5f5;
  --fg: #333333;
  --muted: #777777;
  --card: #ffffff;
  --card-head: #f5f5f5;
  --border: #e5e5e5;
  --input-border: #cccccc;
  --accent: #c03e14;
  --accent-hover: #a2340f;
  --accent-fg: #ffffff;
  --link: #c03e14;
  --danger: #f05050;
  --ok-bg: #e4f2d9;
  --ok-fg: #3d6a1d;
  --err-bg: #fbe3e3;
  --err-fg: #a02222;
  --warn: #f0ad4e;
  --warn-bg: #fdf3e0;
  --warn-fg: #5b3d06;
  --row-alt: #fafafa;
  --row-hover: #f1f1f1;
  --side-bg: #373736;
  --side-fg: #d6d6d5;
  --side-muted: #9a9a99;
  --side-hover: #454544;
  --side-sub: #2f2f2e;
  --header-bg: #ffffff;
  --sidebar-w: 15rem;
  --font: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1b;
    --fg: #e5e5e4;
    --muted: #9d9d9b;
    --card: #272726;
    --card-head: #2f2f2e;
    --border: #3d3d3c;
    --input-border: #555554;
    --accent: #e0643a;
    --accent-hover: #ee7a52;
    --accent-fg: #1c1c1b;
    --link: #f08560;
    --danger: #f27474;
    --ok-bg: #1f3318;
    --ok-fg: #a9dc86;
    --err-bg: #3d1e1e;
    --err-fg: #f5b0b0;
    --warn-bg: #3b2e12;
    --warn-fg: #f3d8a0;
    --row-alt: #2a2a29;
    --row-hover: #323231;
    --side-bg: #232322;
    --side-sub: #1c1c1b;
    --side-hover: #333332;
    --header-bg: #272726;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font);
}

a { color: var(--link); }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.75rem; }
h1 small, h2 small { font-size: 0.9rem; font-weight: 400; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.1em; height: 1.1em; fill: currentColor; vertical-align: -0.2em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3rem;
  padding: 0 1rem;
  background: var(--header-bg);
  border-bottom: 3px solid var(--accent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  flex: 1;
}
.brand .icon { width: 1.4em; height: 1.4em; }
.logout { display: flex; align-items: center; gap: 1rem; margin: 0; }
.whoami small { color: var(--muted); }
.menu-button { display: none; cursor: pointer; padding: 0.25rem; color: var(--fg); }
.menu-button .icon { width: 1.5em; height: 1.5em; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

/* ---- Layout ---- */
.layout { display: flex; min-height: calc(100vh - 3rem); }
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--side-bg);
  color: var(--side-fg);
  padding: 0.5rem 0 2rem;
}
.sidebar a, .sidebar summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--side-fg);
  text-decoration: none;
}
.sidebar .item, .sidebar summary {
  padding: 0.6rem 1rem;
  font-weight: 600;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.sidebar summary { list-style: none; user-select: none; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::after {
  content: "";
  margin-left: auto;
  border: solid var(--side-muted);
  border-width: 0 2px 2px 0;
  padding: 3px;
  transform: rotate(45deg);
}
.sidebar details[open] > summary::after { transform: rotate(-135deg); }
.sidebar .item:hover, .sidebar summary:hover { background: var(--side-hover); }
.sidebar .item.active, .sidebar details[open] > summary { color: #fff; }
.sidebar .item.active { border-left-color: var(--accent); background: var(--side-hover); }
.sidebar details { background: var(--side-sub); }
.sidebar details > summary { background: var(--side-bg); }
.sidebar .sub, .sidebar .subsub {
  padding: 0.4rem 1rem 0.4rem 2.4rem;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.sidebar .subsub { padding-left: 3.4rem; color: var(--side-muted); }
.sidebar .sub:hover, .sidebar .subsub:hover { background: var(--side-hover); color: #fff; }
.sidebar .sub.active, .sidebar .subsub.active { color: #fff; border-left-color: var(--accent); background: var(--side-hover); }
.sidebar .sub.current { color: #fff; font-weight: 600; }
.sidebar .subgroup { padding-bottom: 0.3rem; }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--side-muted); flex: none; }
.dot.status-online { background: #9bd275; }
.dot.status-unreachable, .dot.status-auth_failed, .dot.status-tls_error { background: var(--danger); }

.content { flex: 1; min-width: 0; padding: 1.5rem 2rem 3rem; max-width: 80rem; }
.scrim { display: none; }

/* ---- Login ---- */
body.login { background: var(--side-bg); }
main.narrow {
  max-width: 24rem;
  margin: 5rem auto 0;
  padding: 1.5rem 1.75rem 1.75rem;
  background: var(--card);
  border-top: 4px solid var(--accent);
  border-radius: 3px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.login-brand { display: flex; align-items: center; gap: 0.5rem; color: var(--accent); font-size: 1.3rem; font-weight: 600; margin-bottom: 1rem; }
.login-brand .icon { width: 1.5em; height: 1.5em; }
main.narrow h1 { font-size: 1.2rem; color: var(--muted); }

/* ---- Page head ---- */
.titlebar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.titlebar h1 { margin: 0; }
.buttons { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---- Panels ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.card > h2:first-child {
  margin: -1rem -1.25rem 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--card-head);
  border-bottom: 1px solid var(--border);
}

/* ---- Forms and buttons ---- */
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.stack label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; }
.stack label small, label small { font-weight: 400; color: var(--muted); }
.stack input[type="text"], .stack input[type="password"], .stack select, .stack textarea { max-width: 42rem; width: 100%; }

input, select, button, textarea {
  font: inherit;
  color: inherit;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--input-border);
  border-radius: 3px;
  background: var(--card);
}
textarea { font: 0.9rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button, a.button {
  display: inline-block;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
}
a.button { padding: 0.4rem 0.9rem; border: 1px solid var(--accent); border-radius: 3px; }
button:hover, a.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
a.button.secondary, td button:not(.danger) {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--input-border);
}
a.button.secondary:hover, td button:not(.danger):hover { background: var(--row-hover); border-color: var(--input-border); }
button.danger { background: var(--card); color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
button.link { background: none; border: none; color: var(--link); padding: 0; font-weight: 400; }
button.link:hover { background: none; text-decoration: underline; }
button[disabled], button.htmx-request { opacity: 0.6; cursor: progress; }

label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 400; margin-right: 1rem; }
fieldset { border: 1px solid var(--border); border-radius: 3px; padding: 0.5rem 0.75rem; }
fieldset legend { font-weight: 600; padding: 0 0.3rem; }
fieldset legend small { font-weight: 400; color: var(--muted); }
details { color: var(--muted); }
main details summary { cursor: pointer; }
dl.hints { grid-template-columns: max-content 1fr; margin-top: 0.5rem; }

/* ---- Alerts ---- */
.alert { padding: 0.65rem 0.9rem; border-radius: 3px; margin-bottom: 1rem; border-left: 4px solid; }
.alert.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: #9bd275; }
.alert.err { background: var(--err-bg); color: var(--err-fg); border-color: var(--danger); }
.alert.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn); }
.alert a { color: inherit; text-decoration: underline; }
meter { width: 12rem; max-width: 100%; height: 0.9rem; vertical-align: middle; }

/* ---- Tables ---- */
.scroll { overflow-x: auto; margin-bottom: 1.25rem; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-weight: 600; background: var(--card-head); color: var(--fg); border-bottom: 2px solid var(--border); white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: var(--row-hover); }
form.inline { display: inline-flex; gap: 0.4rem; align-items: center; margin: 0 0.4rem 0.2rem 0; }
td.actions { white-space: nowrap; }
td.actions input[type="password"] { width: 11rem; }
.entries { font-weight: 600; margin-right: 0.35rem; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Badges / status ---- */
.badge {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--border);
  color: var(--fg);
}
.badge.status-online, .badge.act-create { background: var(--ok-bg); color: var(--ok-fg); }
.badge.status-unreachable, .badge.status-auth_failed, .badge.status-tls_error, .badge.act-delete { background: var(--err-bg); color: var(--err-fg); }
.fwstatus .detail { color: var(--err-fg); }
.warn { color: var(--danger); }

/* ---- Review / diff ---- */
ul.changes, ul.fields { list-style: none; margin: 0; padding: 0; }
ul.changes > li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
ul.changes > li:last-child { border-bottom: none; }
ul.fields { margin: 0.35rem 0 0 1.5rem; font-size: 0.9rem; }
ul.fields li { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.fname { color: var(--muted); min-width: 7rem; }
.diff { display: flex; flex-direction: column; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.del { color: var(--err-fg); background: var(--err-bg); padding: 0 0.3rem; border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.add { color: var(--ok-fg); background: var(--ok-bg); padding: 0 0.3rem; border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Narrow screens: sidebar becomes a slide-in menu ---- */
@media (max-width: 52rem) {
  .menu-button { display: block; }
  .whoami { display: none; }
  .sidebar {
    position: fixed;
    top: 3rem;
    bottom: 0;
    left: 0;
    z-index: 20;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.15s ease-out;
  }
  .nav-toggle:checked ~ .layout .sidebar { transform: none; }
  .nav-toggle:checked ~ .layout .scrim {
    display: block;
    position: fixed;
    inset: 3rem 0 0 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.45);
  }
  .nav-toggle:focus-visible ~ .header .menu-button { outline: 2px solid var(--accent); }
  .content { padding: 1rem; }
  main.narrow { margin: 1rem; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

.badge.sync-in_sync { background: var(--ok-bg); color: var(--ok-fg); }
.badge.sync-pending { background: var(--border); color: var(--fg); }
.badge.sync-drift { background: #f0ad4e; color: #3b2a05; }
.badge.sync-error { background: var(--err-bg); color: var(--err-fg); }
.detail { color: var(--err-fg); }

/* ---- Script-only controls and expandable lists ---- */
.js-only { display: none; }
.js .js-only { display: revert; }
.listtools { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.listtools button { padding: 0.2rem 0.7rem; background: var(--card); color: var(--fg); border-color: var(--input-border); font-weight: 400; }

.rows { background: var(--card); border: 1px solid var(--border); border-radius: 3px; margin-bottom: 1.25rem; }
.rows-head, .row > summary {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.75rem 0.55rem 2rem;
}
.rows-head { background: var(--card-head); border-bottom: 2px solid var(--border); font-weight: 600; }
.cols-rule .rows-head, .cols-rule .row > summary { grid-template-columns: 3.2rem minmax(8rem, 2fr) 5.5rem 3.5rem minmax(5rem, 1fr) 5rem minmax(6rem, 1.5fr) minmax(6rem, 1.5fr); }
.cols-alias .rows-head, .cols-alias .row > summary { grid-template-columns: minmax(8rem, 2fr) 7rem minmax(8rem, 3fr) 6rem; }
.row { border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }
.row:nth-of-type(even) { background: var(--row-alt); }
.row > summary { cursor: pointer; list-style: none; position: relative; overflow-wrap: anywhere; }
.row > summary::-webkit-details-marker { display: none; }
.row > summary::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  margin-top: -0.35rem;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
  transition: transform 0.1s;
}
.row[open] > summary::before { transform: rotate(45deg); }
.row > summary:hover { background: var(--row-hover); }
.row[open] > summary { border-bottom: 1px dashed var(--border); }
.detail { padding: 0.75rem 1rem 1rem 2rem; background: var(--card); }
dl.facts { grid-template-columns: 11rem 1fr; }
.entries-list { margin: 0; padding-left: 1.1rem; max-height: 14rem; overflow-y: auto; }
.nested { margin: 0.4rem 0 0 0.5rem; padding-left: 0.75rem; border-left: 3px solid var(--border); }
.ref { margin-bottom: 0.4rem; }
.iface { margin-top: 0.4rem; padding: 0.35rem 0.6rem; background: var(--bg); border-radius: 3px; }
.detail-actions { margin-top: 0.75rem; display: flex; gap: 0.75rem; align-items: center; }

@media (max-width: 52rem) {
  .cols-rule .rows-head, .cols-rule .row > summary { grid-template-columns: 2.6rem 1fr 5rem 1fr; }
  .cols-alias .rows-head, .cols-alias .row > summary { grid-template-columns: 1fr 5rem 1fr; }
  .cols-alias .rows-head > :last-child, .cols-alias .row > summary > :last-child { display: none; }
  .hide-sm { display: none; }
  dl.facts { grid-template-columns: 1fr; }
}

.grey { color: var(--muted); }
.subdetails > summary { cursor: pointer; }
.subdetails[open] > summary { margin-bottom: 0.25rem; }
.cols-vlan .rows-head, .cols-vlan .row > summary { grid-template-columns: minmax(6rem, 1.5fr) 4rem 4rem 6rem minmax(6rem, 3fr); }
@media (max-width: 52rem) {
  .cols-vlan .rows-head, .cols-vlan .row > summary { grid-template-columns: 1fr 4rem 3rem 1fr; }
}
.cols-dns .rows-head, .cols-dns .row > summary { grid-template-columns: minmax(8rem, 2.5fr) 4.5rem minmax(8rem, 2.5fr) minmax(6rem, 2fr); }
@media (max-width: 52rem) {
  .cols-dns .rows-head, .cols-dns .row > summary { grid-template-columns: 1fr 4rem 1fr; }
}
.cols-subnet .rows-head, .cols-subnet .row > summary { grid-template-columns: minmax(8rem, 2fr) 4rem minmax(6rem, 2fr) minmax(6rem, 2fr); }
.cols-lease .rows-head, .cols-lease .row > summary { grid-template-columns: minmax(9rem, 2fr) minmax(6rem, 1.5fr) minmax(5rem, 1.5fr) minmax(7rem, 2fr); }
.titlebar h2 { margin: 0; }
@media (max-width: 52rem) {
  .cols-subnet .rows-head, .cols-subnet .row > summary { grid-template-columns: 1fr 3rem 1fr; }
  .cols-subnet .rows-head > :last-child, .cols-subnet .row > summary > :last-child { display: none; }
  .cols-lease .rows-head, .cols-lease .row > summary { grid-template-columns: 1fr 1fr 1fr; }
}

button.secondary { background: var(--card); color: var(--fg); border: 1px solid var(--input-border); }
button.secondary:hover { background: var(--row-hover); border-color: var(--input-border); color: var(--fg); }
form.picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin: 0 0 1rem; }
form.picker label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9em; }
.import-panel h3 { margin: 1rem 0 0.4rem; font-size: 1em; }
.cols-host .rows-head, .cols-host .row > summary { grid-template-columns: minmax(8rem, 2.5fr) minmax(8rem, 2.5fr) minmax(6rem, 2fr); }
.cols-range .rows-head, .cols-range .row > summary { grid-template-columns: minmax(7rem, 1.5fr) minmax(10rem, 3fr) minmax(5rem, 1.5fr) minmax(6rem, 2fr); }
@media (max-width: 52rem) {
  .cols-host .rows-head, .cols-host .row > summary { grid-template-columns: 1fr 1fr; }
  .cols-host .rows-head > :last-child, .cols-host .row > summary > :last-child { display: none; }
  .cols-range .rows-head, .cols-range .row > summary { grid-template-columns: 1fr 1fr; }
  .cols-range .rows-head > :nth-child(n+3), .cols-range .row > summary > :nth-child(n+3) { display: none; }
}
.cols-wgserver .rows-head, .cols-wgserver .row > summary { grid-template-columns: minmax(7rem, 2fr) 4.5rem minmax(9rem, 3fr) 4rem; }
.cols-wgpeer .rows-head, .cols-wgpeer .row > summary { grid-template-columns: minmax(7rem, 2fr) minmax(8rem, 2.5fr) minmax(6rem, 2fr) minmax(7rem, 2fr); }
@media (max-width: 52rem) {
  .cols-wgserver .rows-head, .cols-wgserver .row > summary { grid-template-columns: 1fr 4rem 1fr; }
  .cols-wgpeer .rows-head, .cols-wgpeer .row > summary { grid-template-columns: 1fr 1fr 1fr; }
}
.cols-ipsec .rows-head, .cols-ipsec .row > summary { grid-template-columns: minmax(7rem, 2fr) minmax(8rem, 2.5fr) 4.5rem minmax(6rem, 2fr); }
@media (max-width: 52rem) {
  .cols-ipsec .rows-head, .cols-ipsec .row > summary { grid-template-columns: 1fr 1fr 4rem; }
}
code.secret { font-size: 1.1em; word-break: break-all; user-select: all; }
.diff { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; overflow-x: auto; border: 1px solid var(--border); border-radius: 3px; background: var(--card); }
.diff .dl, .diff .hunk { white-space: pre; padding: 0 0.6rem; min-height: 1.2em; }
.diff .hunk { background: var(--row-hover); color: var(--muted); }
.diff-add { color: #1a7f37; }
.diff .diff-add { background: rgba(46, 160, 67, 0.15); }
.diff-del { color: var(--danger); }
.diff .diff-del { background: rgba(240, 80, 80, 0.15); }
form.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 1rem; margin: 0 0 1rem; }
form.filters label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9em; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }

/* ---- manual ---- */
.crumbs { font-size: 0.9em; color: var(--muted); margin-bottom: 0.8rem; }
.docs-layout { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 52rem) { .docs-layout { grid-template-columns: 1fr; } }
.docs-toc { font-size: 0.9em; position: sticky; top: 1rem; }
.docs-toc h2 { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 1rem 0 0.3rem; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-toc li { margin: 0.15rem 0; }
.docs-toc li.lvl3 { padding-left: 0.9rem; }
.docs-toc a[aria-current="page"] { font-weight: 600; }
.docs-search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.docs-search input[type="search"] { flex: 1; min-width: 0; }
.docs-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.docs-chapters .card ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.docs-results { padding-left: 1.2rem; }
.docs-results li { margin-bottom: 0.9rem; }
mark { background: rgba(240, 173, 78, 0.35); color: inherit; padding: 0 0.1em; }
.doc { max-width: 52rem; line-height: 1.55; }
.doc h1 { margin-top: 0; }
.doc h2 { margin-top: 2rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--border); }
.doc h3 { margin-top: 1.4rem; }
.doc pre { background: var(--row-hover); border: 1px solid var(--border); border-radius: 3px; padding: 0.7rem 0.9rem; overflow-x: auto; }
.doc code { font-size: 0.92em; }
.doc table { border-collapse: collapse; margin: 1rem 0; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--border); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
.doc blockquote { margin: 1rem 0; padding: 0.4rem 1rem; border-left: 4px solid var(--accent); background: var(--row-hover); }
.doc img { max-width: 100%; height: auto; }
.doc-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.doc-nav .next { margin-left: auto; }
@media print {
  .sidebar, .header, .scrim, .no-print, .docs-toc, .doc-nav, .crumbs { display: none !important; }
  .layout, .content { display: block !important; margin: 0 !important; padding: 0 !important; }
  .print-page { page-break-after: always; max-width: none; }
  .doc a { color: inherit; text-decoration: underline; }
}
.help-link { margin-right: 1rem; font-size: 0.9em; }

/* Tenants */
.tenant-name { margin-left: 1rem; padding: 0.1rem 0.6rem; border-radius: 3px; background: rgba(255, 255, 255, 0.12); font-weight: 600; }
.tenant-switch { margin-left: 0.6rem; }
.tenant-switch select { max-width: 12rem; }

/* ---- Public pages: landing and legal ---- */
body.landing { background: var(--bg); }
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.7rem 1.5rem; background: var(--side-bg); color: #fff;
}
.site-brand { display: flex; align-items: center; gap: 0.5rem; color: #fff; font-size: 1.15rem; font-weight: 600; text-decoration: none; }
.site-brand .icon { width: 1.4em; height: 1.4em; }
.site-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-nav a:not(.button) { color: #d6d6d5; text-decoration: none; }
.site-nav a:not(.button):hover { color: #fff; text-decoration: underline; }
.site-main { max-width: 68rem; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.site-main h2 { font-size: 1.5rem; margin: 3rem 0 1rem; }
.hero { text-align: center; padding: 3rem 0 1rem; }
.hero h1 { font-size: 2.4rem; line-height: 1.2; max-width: 40rem; margin: 0 auto 1rem; }
.hero .lead { font-size: 1.2rem; max-width: 42rem; margin: 0 auto 1.5rem; color: var(--fg); }
.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
a.button.big { padding: 0.65rem 1.4rem; font-size: 1.05rem; }
.steps ol { padding-left: 1.2rem; display: grid; gap: 0.8rem; max-width: 46rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.feature-grid .card { margin: 0; }
.feature-grid h3, .plan h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.shot { margin: 0 0 2.5rem; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18); background: var(--card); }
.shot figcaption { margin-top: 0.6rem; color: var(--muted); max-width: 52rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; align-items: start; }
.plan .price { font-size: 2.2rem; font-weight: 600; margin: 0 0 0.6rem; }
.plan table th { text-align: left; font-weight: 600; width: 45%; }
details { margin: 0.4rem 0; }
.legal { max-width: 46rem; }
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem; text-align: center; color: var(--muted); font-size: 0.95rem; }
.site-footer p { margin: 0.3rem 0; }

/* ---- Sign-up form ---- */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.stack label.check { flex-direction: row; align-items: flex-start; gap: 0.5rem; font-weight: 400; }
.stack label.check input { margin-top: 0.25rem; }
