:root {
  color-scheme:light;
  --paper:#f2f3ef; --card:#fcfcfa; --surface:#f7f8f4; --text:#232a25; --muted:#59645b;
  --line:#d2ded6; --edge:#b5c9bd; --accent:#326347; --accent-button:#37654c; --accent-hover:#2d553f;
  --heading:#163e31; --nav:#11372c; --nav-text:#e2f0e7; --focus:#238267; --hover:#edf5ef;
  --hero:#e8f1ea; --thead:#e6eee9; --category:#d3e5d9; --subcat:#edf3ed; --rule:#c5d6cb;
  --ok-text:#14573d; --ok-bg:#e0f0e5; --ok-line:#a8ccb5; --no-text:#963033; --no-bg:#f7e7e7; --no-line:#e2bdbd;
  --inherit-text:#27516c; --inherit-bg:#e8f1f8; --inherit-line:#b7cede;
  --mask-text:#5a4678; --mask-bg:#eee8f6; --mask-line:#d3c5e1;
  --warn-text:#805018; --warn-bg:#fff0d8; --warn-line:#d9b17f; --override:#ad6718; --dirty:#36886a;
  --nav-line:#526d60; --nav-hover:#285040; --backdrop:#0d1b16b3;
  --disabled-text:#525a61; --disabled-bg:#e8ebed; --disabled-line:#929ba3;
  --removed-text:#785038; --removed-bg:#f5e7da; --removed-line:#b78b70;
  --radius:13px;
  --checkbox-size:18px; --checkbox-gap:9px; --checkbox-padding:8px;
  font:15px/1.52 Inter,"Segoe UI",system-ui,sans-serif;
}
:root[data-theme=dark] {
  color-scheme:dark;
  --paper:#151615; --card:#1d1f1d; --surface:#222522; --text:#e8e8e8; --muted:#ababab;
  --line:#303030; --edge:#484848; --accent:#a9c8af; --accent-button:#37674e; --accent-hover:#42785d;
  --heading:#f2f2f2; --nav:#101010; --nav-text:#d3d3d3; --focus:#8ed8b1; --hover:#272727;
  --nav-line:#484848; --nav-hover:#252525; --backdrop:#0b0b0bbd;
  --hero:#242424; --thead:#252525; --category:#2b2b2b; --subcat:#222222; --rule:#414141;
  --ok-text:#b8e9c9; --ok-bg:#1e3327; --ok-line:#3c684e; --no-text:#f4bcbd; --no-bg:#44282a; --no-line:#704044;
  --inherit-text:#b7dcf6; --inherit-bg:#243543; --inherit-line:#456174;
  --mask-text:#dbcbf2; --mask-bg:#342d43; --mask-line:#5d4b77;
  --warn-text:#f5ce8f; --warn-bg:#3b2f23; --warn-line:#755739; --override:#e7ae63; --dirty:#70d0a2;
  --disabled-text:#bfc3c7; --disabled-bg:#303236; --disabled-line:#767b83;
  --removed-text:#e1b89d; --removed-bg:#392d26; --removed-line:#ac8064;
}
*,*::before,*::after { box-sizing:border-box }
body { margin:0; background:var(--paper); color:var(--text) }
button,input,select,textarea { font:inherit }
button,select { cursor:pointer }
button { border:1px solid var(--edge); background:var(--card); color:var(--heading); border-radius:8px; padding:7px 12px; font-weight:650 }
button:hover { background:var(--hover) }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid var(--focus); outline-offset:2px }
button:disabled { cursor:default; opacity:.55 }
button.primary { color:#fff; background:var(--accent-button); border-color:var(--accent-button) }
button.primary:hover { background:var(--accent-hover) }
input:not([type=checkbox]),select,textarea { border:1px solid var(--edge); border-radius:8px; background:var(--card); padding:7px 10px; color:var(--text) }
input[type=checkbox] { accent-color:var(--accent-button) }
label:has(> input[type=checkbox]) {
  display:flex; align-items:center; gap:var(--checkbox-gap); min-height:36px; min-width:0;
  padding:5px var(--checkbox-padding); border-radius:7px; background:var(--surface);
  font-weight:620; line-height:1.4; cursor:pointer
}
label:has(> input[type=checkbox]:enabled):hover { background:var(--hover) }
label:has(> input[type=checkbox]:disabled) { cursor:default }
label > input[type=checkbox] {
  flex:none; order:-1; width:var(--checkbox-size); height:var(--checkbox-size); margin:0; cursor:inherit
}
label:has(> input[type=checkbox]) > span { min-width:0; overflow-wrap:anywhere }
a { color:var(--accent); text-underline-offset:2px }
code { font:.91em ui-monospace,Consolas,monospace; color:var(--accent); overflow-wrap:anywhere }
pre { margin:.6rem 0; padding:14px; background:var(--hero); border-radius:9px; overflow:auto; line-height:1.55 }
pre code { overflow-wrap:normal }
p { margin:.65em 0 }
h1,h2,h3 { line-height:1.18; letter-spacing:-.025em }
h1 { margin:.15em 0 .4em; font-size:clamp(2.1rem,4.1vw,3.7rem) }
h2 { margin:1.55em 0 .55em; font-size:clamp(1.38rem,2vw,1.85rem) }
h3 { margin:1.3em 0 .5em; font-size:1.1rem }
li+li { margin-top:.56rem }

[hidden] { display:none!important }
h1 { font-size:clamp(1.65rem,2.7vw,2.5rem); margin:0 0 .55em }
h2 { font-size:1.2rem }
.site-header { background:var(--card); border-bottom:1px solid var(--line) }
.site-backup-alert {
  padding:5px clamp(14px,2.3vw,34px); border-top:1px solid var(--warn-line);
  color:var(--warn-text); background:var(--warn-bg); text-align:center; font-weight:650
}
.site-backup-alert a { color:inherit }
.site-bar {
  width:min(100%,1860px); margin:auto; padding:10px clamp(14px,2.3vw,34px);
  min-height:67px; display:flex; align-items:center; gap:clamp(12px,1.8vw,26px);
}
.site-brand {
  color:var(--heading); text-decoration:none; font-weight:800; font-size:1.2rem;
  line-height:1.22; white-space:nowrap; display:flex; align-items:center; gap:9px; flex:none;
}
.site-brand img { display:block; width:40px; height:40px; object-fit:contain; flex:none }
.site-brand small { display:block; color:var(--muted); font-size:.72rem; font-weight:550; margin-top:2px }
.site-nav,.site-account { display:flex; align-items:center; gap:6px; flex-wrap:wrap }
.site-account { margin-left:auto }
.site-account form { margin:0 }
.site-health {
  display:flex; flex:1 1 150px; min-width:128px; flex-wrap:wrap; align-items:center; justify-content:center; gap:3px 5px;
}
.health-chip {
  padding:1px 6px; border-radius:6px; font-size:.76rem; line-height:1.35; white-space:nowrap;
  color:var(--warn-text); background:var(--warn-bg); border-color:var(--warn-line);
}
.health-chip[data-severity=error] { color:var(--no-text); background:var(--no-bg); border-color:var(--no-line) }
.health-chip[data-severity=info] { color:var(--text); background:var(--surface); border-color:var(--edge) }
.health-chip:hover { text-decoration:underline }
.health-dialog {
  color:var(--text); background:var(--card); border:1px solid var(--edge); border-radius:var(--radius);
  padding:18px; width:min(610px,calc(100% - 24px)); max-height:calc(100dvh - 30px); overflow:auto;
}
.health-dialog::backdrop { background:var(--backdrop) }
.health-dialog h2 { margin:0 0 10px }
.health-dialog ul { padding-left:1.25rem }
.health-dialog pre { white-space:pre-wrap; overflow-wrap:anywhere }
.health-dialog form { display:flex; justify-content:flex-end; margin-top:12px }
.site-nav a,.site-account a,.quiet-button {
  color:var(--text); text-decoration:none; font-size:.91rem; font-weight:650;
  display:block; padding:7px 11px; border-radius:8px; white-space:nowrap;
}
.site-nav a:hover,.site-account a:hover,.quiet-button:hover { background:var(--hover) }
.site-nav a[aria-current=page],.site-account a[aria-current=page] {
  color:var(--ok-text); background:var(--ok-bg); box-shadow:inset 0 0 0 1px var(--ok-line);
}
.quiet-button { background:transparent; border-color:transparent }
.content-wrap { width:min(100%,1860px); margin:auto; padding:clamp(14px,2.3vw,34px) }
.page-heading { display:flex; align-items:center; gap:15px; justify-content:space-between; margin-bottom:14px }
.page-heading h1 { margin:0 }
body.viewport-screen { height:100vh; height:100dvh; display:flex; flex-direction:column }
.viewport-screen .site-header, .viewport-screen .page-heading { flex:none }
.map-page,.log-page { display:flex; flex:1 1 auto; flex-direction:column; margin:0 auto }
.map-page iframe {
  display:block; width:100%; flex:1 0 0; min-height:180px;
  border:1px solid var(--edge); border-radius:12px; background:var(--surface);
}
.account-screen { min-height:calc(100dvh - 68px); display:grid; place-items:center; padding:24px 14px }
.account-card,.settings-card {
  background:var(--card); border:1px solid var(--line); border-radius:14px; padding:clamp(18px,3vw,30px);
}
.account-card { width:min(100%,430px) }
.account-card h1 { font-size:1.65rem }
.secondary-text { color:var(--muted) }
.stacked-form { display:grid; gap:13px; margin:14px 0 0 }
.stacked-form label:not(.check-label) { display:grid; gap:4px; font-weight:620; font-size:.94rem }
.stacked-form .check-label { font-size:.91rem }
.stacked-form button { justify-self:start }
.stacked-form input:not([type=checkbox]) { width:100%; min-width:0 }
.action-primary { color:#fff; background:var(--accent-button); border-color:var(--accent-button) }
.action-primary:hover { background:var(--accent-hover) }
.account-link { display:inline-block; margin-top:18px }
.registration-complete { border-top:1px solid var(--line); padding-top:15px }
.notice {
  background:var(--hero); border:1px solid var(--line); border-left:3px solid var(--ok-line);
  padding:9px 12px; border-radius:8px; margin:12px 0; max-width:75ch;
}
.form-errors:empty,.validation-summary-valid { display:none }
.form-errors { color:var(--no-text); font-size:.92rem }
.form-errors ul { padding-left:1.2rem; margin:0 }
.settings-page { max-width:880px }
.settings-card { margin:15px 0 }
.settings-card h2 { margin:0 0 10px }
.settings-line { display:flex; flex-wrap:wrap; align-items:end; gap:10px }
.settings-line label { display:grid; gap:5px }
.narrow-form { max-width:370px }
.recovery-codes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 15px; max-width:390px }
.provisioning-key { background:var(--hero); padding:6px 9px; border-radius:5px; letter-spacing:.07em }

@media (max-width:950px) {
  .site-bar { flex-wrap:wrap; gap:8px 12px }
  .site-health { order:3; flex:1 0 100%; min-width:0 }
}
@media (max-width:650px) {
  .site-bar { gap:8px 12px; flex-wrap:wrap; padding:8px 12px }
  .site-brand { flex:1 0 auto }
  .site-nav { order:2; width:100% }
  .site-nav a,.site-account a,.quiet-button { padding:5px 8px }
}

.config-editors-nav {
  display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; padding-bottom:9px; border-bottom:1px solid var(--line)
}
.config-editors-nav a { padding:5px 9px; border-radius:7px; font-size:.88rem; font-weight:650; text-decoration:none }
.config-editors-nav a[aria-current=page] { color:var(--ok-text); background:var(--ok-bg); box-shadow:inset 0 0 0 1px var(--ok-line) }
html.server-section { scrollbar-gutter:stable }
.server-nav-wrap { flex:none; margin:0 auto; padding-bottom:0 }
.server-nav-wrap .server-nav { margin-bottom:0 }
.server-nav-wrap + .content-wrap { padding-top:12px }
.settings-card details { margin-top:12px }
.settings-card details > summary { cursor:pointer; font-weight:650 }

.config-editor-page { width:100%; }
.config-editor-page .config-editors-nav { margin-bottom:16px; }
.config-editor-page .mob-heading { margin-bottom:11px; }
.config-editor-title { display:flex; align-items:center; gap:10px; min-width:0; }
.editor-version { position:relative; flex:none; }
.editor-version button {
  display:grid; place-items:center; padding:0; width:1.45rem; height:1.45rem;
  border-radius:5px; color:var(--muted); font-size:.82rem; font-weight:750;
}
.editor-version-tip {
  position:absolute; z-index:12; inset-block-start:calc(100% + 4px); inset-inline-start:50%;
  transform:translateX(-50%); width:max-content; max-width:min(190px,calc(100vw - 28px));
  padding:6px 9px; background:var(--surface); border:1px solid var(--line); border-radius:7px;
  color:var(--text); font-size:.84rem; visibility:hidden; overflow-wrap:anywhere;
}
.editor-version:hover .editor-version-tip,.editor-version:focus-within .editor-version-tip { visibility:visible; }
@media (max-width:580px) {
  .editor-version-tip { inset-inline-start:auto; inset-inline-end:0; transform:none; }
}
