/* AEA Partner Portal
   Concept: the navigation is a communications trunk. Every section taps off a
   single bus line like devices on an MS/TP segment; status uses indicator-LED
   dots the way a controller faceplate does. Everything else stays quiet. */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: italic; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url(/static/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url(/static/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url(/static/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-style: normal; font-display: swap; src: url(/static/fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-style: normal; font-display: swap; src: url(/static/fonts/space-grotesk-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-style: normal; font-display: swap; src: url(/static/fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); }

:root {
  --navy-950: #00081F; --navy-900: #000F3C; --navy-800: #0A1B4D; --navy-700: #152761;
  /* ae-a.com: header #000F3C, buttons 100deg teal-to-blue with navy text */
  --brand-grad: linear-gradient(100deg, #03D9C4, #2F8CFB);
  --teal: #03D9C4; --teal-ink: #037F74; --blue: #2F8CFB; --link: #1A64C7;
  --ink: #0B1220; --ink-soft: #3C4A63; --ink-faint: #67758E;
  --paper: #F5F7FB; --paper-alt: #EBEEF6; --white: #FFFFFF;
  --line: rgba(11, 18, 32, 0.12); --line-strong: rgba(11, 18, 32, 0.22); --line-dark: rgba(255, 255, 255, 0.14);
  --amber: #B7791F; --amber-bg: #FBF1DE; --red: #C9343B; --red-bg: #FCE9EA; --green-bg: #E2F7F4;
  --rail: 272px;
  --r-panel: 10px; --r-ctl: 6px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 var(--sans); color: var(--ink); background: var(--paper); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 var(--s3); }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--navy-800); }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
pre { background: var(--navy-950); color: #DCE6F7; padding: var(--s3) var(--s4); border-radius: var(--r-ctl); overflow-x: auto; line-height: 1.5; }
mark { background: #CFF6F1; color: inherit; padding: 0 2px; border-radius: 2px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.dim { color: var(--ink-faint); font-size: 13px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ rail (the trunk) */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); background: var(--navy-900); color: #C9D3E8;
  display: flex; flex-direction: column; z-index: 30; overflow-y: auto;
}
.rail-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 18px; }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; color: var(--white); }
.brand-mark { flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; gap: 2px; }
/* Wordmark as on ae-a.com: Space Grotesk 500, uppercase, AETHER in white, the rest in teal */
.wm { font-family: var(--display); font-weight: 500; font-size: 13.5px; letter-spacing: 0.02em; color: var(--teal); white-space: nowrap; }
.wm-a { color: var(--white); }
.brand-sub { font-size: 12px; color: #8C9AB8; }
.brand.dark { color: var(--ink); margin-bottom: var(--s6); }
.brand.dark .wm { font-size: 15px; color: var(--teal-ink); }
.brand.dark .wm-a { color: var(--navy-900); }
.brand.dark .brand-sub { color: var(--ink-faint); }
.rail-close { display: none; background: none; border: 0; color: #C9D3E8; font-size: 26px; cursor: pointer; }

.trunk { position: relative; padding: 6px 0 24px; flex: 1; }
.trunk::before { /* the bus line */
  content: ''; position: absolute; left: 30px; top: 0; bottom: 12px; width: 2px;
  background: linear-gradient(var(--teal), rgba(3, 217, 196, 0.25));
}
.tap {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 9px 18px 9px 24px;
  color: #C9D3E8; text-decoration: none; font-size: 14px; font-weight: 500;
}
.tap .node {
  width: 14px; height: 14px; border-radius: 50%; flex: none; position: relative; z-index: 1;
  background: var(--navy-900); border: 2px solid rgba(3, 217, 196, 0.55);
}
.tap:hover { color: var(--white); background: rgba(255, 255, 255, 0.04); }
.tap:hover .node { border-color: var(--teal); }
.tap.on { color: var(--white); }
.tap.on .node { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 4px rgba(3, 217, 196, 0.18); }
.tap.on::after { content: ''; position: absolute; right: 0; top: 8px; bottom: 8px; width: 3px; background: var(--teal); border-radius: 3px 0 0 3px; }
.tap-group { margin: 6px 0; }
.tap-label { display: block; padding: 10px 18px 4px 52px; font-size: 12px; color: #8C9AB8; }
.tap.sub { padding-left: 48px; font-weight: 400; font-size: 13.5px; }
.tap.sub::before { /* drop from the trunk to the device */
  content: ''; position: absolute; left: 31px; top: 50%; width: 22px; height: 2px; background: rgba(3, 217, 196, 0.35);
}
.tap.sub .node { width: 10px; height: 10px; border-width: 2px; border-radius: 2px; }
.rail-foot { border-top: 1px solid var(--line-dark); padding: 14px 18px 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.who { text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.who-name { color: var(--white); font-weight: 500; font-size: 14px; }
.who-org { color: #8C9AB8; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .linkish { color: #8C9AB8; white-space: nowrap; }
.rail .linkish:hover { color: var(--white); }

/* ------------------------------------------------------------------ stage */
.stage { margin-left: var(--rail); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); padding: 12px 40px; background: rgba(245, 247, 251, 0.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.rail-open { display: none; background: none; border: 0; padding: 8px; cursor: pointer; flex-direction: column; gap: 4px; }
.rail-open span { display: block; width: 20px; height: 2px; background: var(--ink); }
.find { position: relative; flex: 1; max-width: 640px; }
.find input { width: 100%; padding: 9px 40px 9px 14px; background: var(--white); }
.find-key { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.main { flex: 1; padding: 32px 40px 48px; max-width: 1240px; width: 100%; }
.main:focus { outline: none; }
.foot { display: flex; justify-content: space-between; padding: 16px 40px; color: var(--ink-faint); font-size: 12px; border-top: 1px solid var(--line); }
.scrim { display: none; }

.page-head { margin-bottom: var(--s5); max-width: 760px; }
.page-head h1 + .lede, .page-head h1 + .prose { margin-top: var(--s2); }
.page-head.with-action { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); max-width: none; }
.lede { color: var(--ink-soft); font-size: 16px; max-width: 68ch; }
.narrow { max-width: 720px; }
.section-h { margin: var(--s6) 0 var(--s3); }
.sub-h { margin: var(--s5) 0 var(--s2); font-size: 14px; }
.staff-note { font-size: 13px; color: var(--ink-faint); border-left: 3px solid var(--blue); padding-left: 10px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; margin-bottom: var(--s5); }
.split.even { grid-template-columns: 1fr 1fr; }
.side { display: flex; flex-direction: column; gap: var(--s5); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 22px; margin-bottom: var(--s5); }
.side > .panel, .split > .panel { margin-bottom: 0; }
.split > div > .panel:last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.panel-head a { font-size: 13px; }
.panel.staff { border-color: rgba(47, 140, 251, 0.4); }
.empty { color: var(--ink-soft); padding: var(--s3) 0; margin: 0; }

/* ------------------------------------------------------------------ point lists (tables) */
.points { width: 100%; border-collapse: collapse; font-size: 14px; }
.points th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-faint); padding: 0 10px 8px; border-bottom: 1px solid var(--line-strong); }
.points td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.points th:first-child, .points td:first-child { padding-left: 0; }
.points th:last-child, .points td:last-child { padding-right: 0; }
.points tbody tr:last-child td { border-bottom: 0; }
.points tbody tr:hover td { background: linear-gradient(90deg, transparent, var(--paper) 12px, var(--paper) calc(100% - 12px), transparent); }
.points.small td { padding: 8px 10px; font-size: 13px; }
.points tr.off td { opacity: 0.55; }
.points .actions { text-align: right; white-space: nowrap; }
.points td.detail { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); max-width: 320px; overflow-wrap: anywhere; }
.row-link { font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.row-link:hover { text-decoration: underline; }
.points td > a:not(.btn) { text-decoration: none; font-weight: 500; }
.points td > a:not(.btn):hover { text-decoration: underline; }
.count { display: inline-block; margin-left: 8px; font-size: 12px; color: var(--ink-faint); background: var(--paper-alt); border-radius: 99px; padding: 0 7px; line-height: 18px; vertical-align: 1px; }
.row-desc { color: var(--ink-soft); font-size: 13px; margin-top: 2px; padding-left: 24px; }
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; flex: none; color: var(--ink-faint); }
.k-folder .ico { color: var(--navy-700); }
.ver { font-family: var(--mono); font-size: 13px; font-weight: 500; }

/* indicator LEDs */
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--ink-faint); }
.led.current { background: var(--teal); box-shadow: 0 0 0 3px rgba(3, 217, 196, 0.2); }
.led.superseded { background: var(--amber); }
.led.withdrawn { background: transparent; border: 2px solid var(--red); }

/* provenance */
.src { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--ink-soft); white-space: nowrap; margin-left: 6px; vertical-align: 1px; }
td > .src:first-child { margin-left: 0; }
.src.aea_vetted { border-color: var(--teal-ink); color: var(--teal-ink); }
.src.aea_created { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }
.lock { font-size: 11.5px; color: var(--navy-700); background: var(--paper-alt); padding: 1px 6px; border-radius: 4px; margin-left: 6px; white-space: nowrap; }

.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--paper-alt); color: var(--ink-soft); white-space: nowrap; margin-left: 4px; }
td > .chip:first-child { margin-left: 0; }
.chip.st-received { background: var(--paper-alt); }
.chip.st-under_review { background: #E3EEFF; color: #1A4E99; }
.chip.st-planned { background: #E9E4FF; color: #4A3AA8; }
.chip.st-in_progress { background: var(--amber-bg); color: #7A5110; }
.chip.st-completed { background: var(--green-bg); color: var(--teal-ink); }
.chip.st-internal_testing { background: #FFF1DD; color: #8A4B08; }
.chip.st-pending_deployment { background: #E1F5F3; color: #0B6158; }
.chip.st-closed { background: var(--paper-alt); color: var(--ink-soft); }
.chip.st-declined { background: var(--red-bg); color: var(--red); }
.chip.st-merged { background: var(--paper-alt); color: var(--ink-faint); }

/* manufacturer drops on the home page */
.drops { list-style: none; margin: 0; padding: 0; position: relative; }
.drops::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--paper-alt); }
.drops li a { position: relative; display: flex; flex-direction: column; padding: 8px 0 8px 26px; text-decoration: none; }
.drops li a::before { content: ''; position: absolute; left: 0; top: 14px; width: 12px; height: 12px; border-radius: 3px; background: var(--white); border: 2px solid var(--navy-700); }
.drops li a:hover::before { background: var(--teal); border-color: var(--teal); }
.drop-name { font-weight: 500; color: var(--ink); }
.drops li a:hover .drop-name { text-decoration: underline; }
.drop-meta { font-size: 12.5px; color: var(--ink-faint); }
.drop-meta.warn { color: var(--amber); }
.drops.wide { max-width: 560px; }
.plain-list { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ item page */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 var(--s4); padding: 0; font-size: 13px; color: var(--ink-faint); }
.crumbs li + li::before { content: '/'; margin-right: 4px; color: var(--line-strong); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s5); margin-bottom: var(--s5); }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: var(--s2); color: var(--ink-soft); font-size: 14px; }
.item-meta .src { margin-left: 0; }
.versions { display: flex; flex-direction: column; gap: var(--s3); }
.ver-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px 20px; }
.ver-card.st-current { border-left: 3px solid var(--teal); }
.ver-card.st-withdrawn { background: #FFFBFB; }
.ver-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.ver-card header h3 { font-size: 16px; margin-right: 4px; }
.ver-card header .btn { margin-left: auto; }
.ver-card header select { width: auto; padding: 4px 8px; font-size: 13px; }
.ver-status { font-size: 13px; color: var(--ink-soft); }
.ver-card details { margin-top: var(--s3); }
.ver-card summary { cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); }
.compat { display: flex; gap: var(--s3); margin-top: var(--s3); font-size: 14px; }
.compat .k { flex: none; color: var(--ink-faint); font-size: 13px; padding-top: 2px; }
.compat .prose p:last-child { margin: 0; }
.filefacts { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, 3fr); gap: 4px 20px; margin: var(--s3) 0 0; padding-top: var(--s3); border-top: 1px dashed var(--line); font-size: 13px; }
.filefacts dt { color: var(--ink-faint); font-size: 12px; }
.filefacts dd { margin: 0; overflow-wrap: anywhere; }
.hash { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; color: var(--ink-soft); }
.sha dd { display: flex; gap: 8px; align-items: flex-start; }
.copy { flex: none; font: 500 12px var(--sans); color: var(--link); background: none; border: 1px solid var(--line); border-radius: 4px; padding: 1px 8px; cursor: pointer; }
.copy:hover { border-color: var(--link); }
.howto { margin-top: var(--s5); font-size: 14px; color: var(--ink-soft); }
.howto summary { cursor: pointer; font-weight: 500; }
.prose { max-width: 72ch; }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 var(--s3); }
.prose table { border-collapse: collapse; margin: var(--s3) 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }
.eula { max-height: 50vh; overflow: auto; }

/* ------------------------------------------------------------------ forms and buttons */
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%; padding: 8px 11px; background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 140, 251, 0.18); }
input[disabled] { background: var(--paper); color: var(--ink-soft); }
input[type='checkbox'], input[type='radio'] { width: auto; accent-color: var(--navy-800); }
input[type='file'] { padding: 6px; background: var(--paper); }
textarea { resize: vertical; }
label { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); }
label > input, label > select, label > textarea { margin-top: 5px; font-weight: 400; }
.hint { display: block; font-size: 12.5px; color: var(--ink-faint); font-weight: 400; margin-top: 4px; }
.hint.ok { color: var(--teal-ink); }
.hint.warn { color: var(--amber); }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13.5px; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; padding: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--ink); }
.check input { margin-top: 4px; }
.radio-col { display: flex; flex-direction: column; gap: 6px; }
.radio-col label { display: flex; gap: 8px; font-weight: 400; color: var(--ink); }
.seg { display: flex; flex-wrap: wrap; gap: 0; }
.seg legend { width: 100%; }
.seg label { display: flex; gap: 8px; align-items: center; padding: 8px 14px; border: 1px solid var(--line-strong); font-weight: 500; color: var(--ink); cursor: pointer; background: var(--white); }
.seg label:first-of-type { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.seg label:last-of-type { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; margin-left: -1px; }
.seg label:has(input:checked) { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.form-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 24px; }
.form-status { margin: 0; color: var(--ink-soft); font-size: 14px; }
.code { font-family: var(--mono); font-size: 20px; letter-spacing: 0.2em; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 14px/1.2 var(--sans);
  padding: 9px 16px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--white);
  color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--navy-700); color: var(--ink); }
.btn.primary { background: var(--brand-grad); border-color: transparent; color: var(--navy-950); font-weight: 600; }
.btn.primary:hover { background: var(--brand-grad); filter: brightness(1.06); border-color: transparent; color: var(--navy-950); }
.btn.primary .btn-sub { color: rgba(0, 8, 31, 0.65); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.wide { width: 100%; padding: 11px 16px; }
.btn.danger, .linkish.danger { color: var(--red); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-sub { font-weight: 400; color: #9FB0D0; font-size: 12.5px; }
.linkish { background: none; border: 0; padding: 0 4px; font: inherit; font-size: 13px; color: var(--link); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s4); }
form.inline { display: inline; }
.inline-form { display: flex; gap: var(--s3); max-width: 560px; margin-bottom: var(--s5); }

.alert { padding: 10px 14px; border-radius: var(--r-ctl); background: var(--amber-bg); color: #6B470E; font-size: 14px; border: 1px solid rgba(183, 121, 31, 0.25); }
.alert.bad { background: var(--red-bg); color: #8E2329; border-color: rgba(201, 52, 59, 0.25); }
.alert.good { background: var(--green-bg); color: #035E56; border-color: rgba(3, 127, 116, 0.25); }
.linkbox p { margin-bottom: 8px; }
.copyline { display: flex; gap: 8px; align-items: center; background: var(--white); padding: 8px 10px; border-radius: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; align-items: center; margin-bottom: var(--s4); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.filters input[type='search'] { width: 220px; }
.filters select { width: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink-soft); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--navy-950); }
.admin-tabs { margin-bottom: var(--s5); overflow-x: auto; }

/* votes */
.vote { font: 600 13px var(--mono); min-width: 40px; padding: 3px 8px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--white); cursor: pointer; color: var(--ink); }
.vote::before { content: '▲ '; font-size: 9px; color: var(--ink-faint); }
.vote.on { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.vote.on::before { color: var(--teal); }
.vote.big { display: flex; flex-direction: column; align-items: center; padding: 10px 16px; min-width: 120px; }
.vote.big::before { content: none; }
.vote-n { font: 700 24px var(--display); }
.vote-l { font: 500 12px var(--sans); }
.thread { list-style: none; margin: 0 0 var(--s4); padding: 0; }
.thread li { padding: 12px 0 12px 14px; border-left: 2px solid var(--line); margin-bottom: 8px; }
.thread li.aea { border-left-color: var(--teal); }
.thread li.internal { border-left-color: var(--blue); background: #F3F8FF; }
.who-line { font-size: 13.5px; margin-bottom: 4px; }
.attach { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.thumb { display: block; max-width: 280px; max-height: 180px; margin-top: 6px; border: 1px solid var(--line); border-radius: 4px; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; font-size: 14px; }
.facts dt { color: var(--ink-faint); font-size: 13px; }
.facts dd { margin: 0; }
.merge { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.imp-critical { color: var(--red); font-weight: 500; }
.imp-high { color: var(--amber); }

/* admin readouts — like a controller's front panel */
.readouts { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 var(--s5); background: var(--navy-900); border-radius: var(--r-panel); overflow: hidden; }
.readouts div { padding: 16px 20px; border-right: 1px solid var(--line-dark); }
.readouts div:last-child { border-right: 0; }
.readouts dt { font-size: 12.5px; color: #8C9AB8; }
.readouts dd { margin: 4px 0 0; font: 600 28px/1.1 var(--mono); color: var(--white); }
.readouts dd a { color: inherit; text-decoration: none; }
.readouts .sub { font-size: 12px; color: #8C9AB8; }
.readouts .attn dd { color: var(--teal); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 130px 1fr 32px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar { height: 8px; background: var(--paper-alt); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--navy-700); border-radius: 4px; }
.bar-n { text-align: right; font-family: var(--mono); font-size: 13px; }
tr.attn td { background: var(--amber-bg); }
.settings { max-width: 760px; }
.settings fieldset.panel { display: flex; flex-direction: column; gap: var(--s4); }
.settings legend { font: 600 16px var(--display); color: var(--ink); float: left; width: 100%; margin-bottom: 0; }
.log { max-height: 320px; font-size: 11.5px; white-space: pre-wrap; }

/* ------------------------------------------------------------------ library manager */
.fm { display: grid; grid-template-columns: var(--fm-tree-w, fit-content(55%)) 10px minmax(0, 1fr); column-gap: calc(var(--s5) - 10px); align-items: start; }
.fm > .fm-tree { min-width: 300px; }
.fm-resize { align-self: stretch; cursor: col-resize; position: relative; min-height: 120px; border-radius: 4px; touch-action: none; }
.fm-resize::after { content: ''; position: absolute; top: 12px; bottom: 12px; left: 4px; width: 2px; border-radius: 2px; background: var(--line); transition: background .15s; }
.fm-resize:hover::after, .fm-resize:focus-visible::after, .fm.resizing .fm-resize::after { background: var(--teal); }
.fm.resizing { user-select: none; cursor: col-resize; }
.fm-tree { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 14px 10px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.fm-tree-head { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 10px; font-weight: 600; font-family: var(--display); }
.fm-tree .hint { padding: 10px 6px 0; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 16px; border-left: 1px solid var(--paper-alt); margin-left: 10px; }
.tree-row { display: flex; align-items: center; gap: 2px; border-radius: 5px; padding: 2px 4px; }
.tree-row a { flex: 1; text-decoration: none; color: var(--ink); font-size: 14px; padding: 4px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row:hover { background: var(--paper); }
.tree-row.on { background: var(--navy-900); }
.tree-row.on a { color: var(--white); }
.tree-row.on .lock { background: var(--navy-800); color: #C9D3E8; }
.twisty { width: 20px; flex: none; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-faint); font-size: 12px; text-align: center; }
.tree-row.on .twisty { color: #C9D3E8; }
.drop-hot { outline: 2px dashed var(--teal) !important; outline-offset: -2px; background: var(--green-bg) !important; }
.fm-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); min-height: 34px; }
.fm-bar .crumbs ol { margin: 0; }
.fm-actions { display: flex; gap: var(--s2); }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fm-drop { border: 2px dashed var(--line-strong); border-radius: var(--r-panel); padding: 14px 18px; margin-bottom: var(--s4); display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; align-items: center; font-size: 14px; color: var(--ink-soft); }
.fm-drop p { margin: 0; max-width: 60ch; }
.fm-drop label { display: flex; align-items: center; gap: 8px; }
.fm-drop select { width: auto; margin: 0; }
.fm-drop.hot { border-color: var(--teal); background: var(--green-bg); }
.fm-uploads { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fm-uploads li { display: grid; grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 13px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fm-uploads li.done .up-st { color: var(--teal-ink); }
.fm-uploads li.failed .up-st { color: var(--red); }
progress { width: 100%; height: 8px; accent-color: var(--teal-ink); }
.fm-table tr[draggable] { cursor: grab; }
.fm-item { display: flex; flex-direction: column; }
.add-version { margin-top: var(--s4); }
.add-version summary { list-style: none; display: inline-flex; }
.add-version summary::-webkit-details-marker { display: none; }
.add-version[open] summary { margin-bottom: var(--s4); }
.dlg { border: 0; border-radius: var(--r-panel); padding: 24px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(0, 8, 31, 0.3); }
.dlg::backdrop { background: rgba(0, 8, 31, 0.5); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; background: var(--navy-900); color: var(--white); padding: 12px 16px; border-radius: var(--r-ctl); font-size: 14px; max-width: 420px; transition: opacity 0.4s, transform 0.4s; }
.toast.bad { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ------------------------------------------------------------------ assistant */
.chat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); display: flex; flex-direction: column; max-width: 880px; min-height: 60vh; }
.chat-log { list-style: none; margin: 0; padding: 20px 22px; flex: 1; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 64vh; }
.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.bubble { max-width: 78ch; padding: 10px 14px; border-radius: 10px; font-size: 14.5px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul { padding-left: 20px; margin: 0 0 8px; }
.msg.me .bubble { background: var(--navy-900); color: var(--white); border-bottom-right-radius: 3px; }
.msg.me .bubble a { color: var(--teal); }
.msg.bot .bubble { background: var(--paper); border-bottom-left-radius: 3px; }
.msg.err .bubble { background: var(--red-bg); color: #8E2329; }
.thinking::after { content: '…'; display: inline-block; animation: dots 1.2s steps(4) infinite; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
.trace { margin-top: 8px; font-size: 12.5px; color: var(--ink-faint); }
.trace summary { cursor: pointer; }
.trace ul { margin: 4px 0 0; }
.draft { margin-top: 10px; padding: 10px 12px; background: var(--white); border: 1px dashed var(--teal-ink); border-radius: var(--r-ctl); }
.draft p { margin-bottom: 8px; }
.chat-form { display: flex; gap: var(--s3); padding: 14px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; }

/* ------------------------------------------------------------------ search */
.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.results li:last-child { border-bottom: 0; }
.results a { font-weight: 500; }
.results p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.snippet { font-size: 13.5px; }

/* ------------------------------------------------------------------ sign-in */
.auth { background: var(--paper); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); }
.auth-side { background: var(--navy-900); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 40px; }
.riser { position: absolute; inset: 0; width: 100%; height: 100%; }
.riser .trunkline { stroke: var(--teal); stroke-width: 2; }
.riser .drops line { stroke: rgba(3, 217, 196, 0.35); stroke-width: 2; }
.riser .drops rect { fill: var(--navy-800); stroke: rgba(255, 255, 255, 0.18); }
.riser .taps circle { fill: var(--navy-900); stroke: var(--teal); stroke-width: 2; }
.auth-tag { position: relative; color: #C9D3E8; font: 500 20px/1.35 var(--display); max-width: 28ch; margin: 0; background: linear-gradient(transparent, var(--navy-900) 30%); padding-top: 40px; }
.auth-logo { position: absolute; top: 24px; left: 24px; width: 150px; height: 150px; z-index: 1; }
@media (max-width: 860px) { .auth-logo { display: none; } .riser { opacity: 0.35; } }
.auth-card { align-self: center; justify-self: center; width: min(420px, calc(100vw - 32px)); padding: 40px 0; }
.auth-card h1 { font-size: 26px; margin-bottom: var(--s3); }
.auth-card form { margin: var(--s5) 0; }
.steps { padding-left: 20px; margin: var(--s5) 0 0; display: flex; flex-direction: column; gap: var(--s5); }
.steps li { font-weight: 500; }
.steps form { margin: var(--s3) 0 0; }
.qr { display: block; margin: 12px 0 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--white); }
.key { letter-spacing: 0.08em; }

/* the one orchestrated moment: devices on the riser come online in order */
@media (prefers-reduced-motion: no-preference) {
  .riser .taps circle { animation: online 0.5s ease-out both; }
  .riser .taps circle:nth-child(1) { animation-delay: 0.3s; }
  .riser .taps circle:nth-child(2) { animation-delay: 0.45s; }
  .riser .taps circle:nth-child(3) { animation-delay: 0.7s; }
  .riser .taps circle:nth-child(4) { animation-delay: 0.95s; }
  .riser .taps circle:nth-child(5) { animation-delay: 1.2s; }
  @keyframes online { from { fill: var(--navy-900); } 60% { fill: var(--teal); } to { fill: var(--teal); } }
}
@media (prefers-reduced-motion: reduce) { .riser .taps circle { fill: var(--teal); } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .readouts { grid-template-columns: repeat(3, 1fr); }
  .readouts div { border-bottom: 1px solid var(--line-dark); }
  .fm { grid-template-columns: 1fr; }
  .fm-resize { display: none; }
  .fm-tree { position: static; max-height: 40vh; }
}
@media (max-width: 860px) {
  .rail { transform: translateX(-100%); transition: transform 0.2s; }
  .rail-close { display: block; }
  body.rail-shown .rail { transform: none; }
  body.rail-shown .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 8, 31, 0.5); z-index: 25; }
  .stage { margin-left: 0; }
  .rail-open { display: flex; }
  .topbar { padding: 10px 16px; }
  .main { padding: 24px 16px 40px; }
  .foot { padding: 14px 16px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { min-height: 160px; padding: 24px; }
  .auth-tag { font-size: 16px; }
}
@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .hide-sm { display: none; }
  .split.even, .two { grid-template-columns: 1fr; }
  .item-head, .page-head.with-action { flex-direction: column; align-items: stretch; }
  .readouts { grid-template-columns: repeat(2, 1fr); }
  .filefacts { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 100px 1fr; }
  .inline-form { flex-direction: column; }
  .filters input[type='search'] { width: 100%; }
  .fm-uploads li { grid-template-columns: 1fr; }
  .bars li { grid-template-columns: 90px 1fr 28px; }
  .find-key { display: none; }
}
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; z-index: 1; }

/* settings with group tabs */
.settings-wrap { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.side-tabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.side-tabs a { padding: 8px 12px; border-radius: var(--r-ctl); text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: 14px; }
.side-tabs a:hover { background: var(--paper-alt); color: var(--ink); }
.side-tabs a.on { background: var(--navy-900); color: var(--white); }
.test-result { margin: var(--s3) 0 0; font-size: 14px; }
.test-result.ok { color: var(--teal-ink); }
.test-result.bad { color: var(--red); }
.test-result ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-soft); }
@media (max-width: 860px) { .settings-wrap { grid-template-columns: 1fr; } .side-tabs { position: static; flex-direction: row; flex-wrap: wrap; } }
.op-box { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.op-box .sub-h { margin-top: 0; }
.op-box p { margin-bottom: 6px; font-size: 14px; }

/* ------------------------------------------------------------------ knowledge base editor */
.kbe { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.kbe-tree { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px 12px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.kbe-tree-head { padding: 0 6px 10px; }
.kbe-title { font-size: 18px; margin-bottom: 6px; }
.kbe-pub { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kbe-pub .chip { margin-left: 0; }
.row-actions.tight { margin: 0 6px 10px; gap: 6px; }
.kbe-list, .kbe-list ul { list-style: none; margin: 0; padding: 0; }
.kbe-list ul { padding-left: 14px; margin-left: 10px; border-left: 1px solid var(--paper-alt); }
.kbe-row { display: flex; align-items: center; border-radius: 5px; padding: 1px 4px; }
.kbe-row a { flex: 1; color: var(--ink); text-decoration: none; font-size: 14px; padding: 5px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kf > .kbe-row a { font-weight: 500; }
.kbe-row:hover { background: var(--paper); }
.kbe-row.on { background: var(--navy-900); }
.kbe-row.on a, .kbe-row.on .twisty { color: var(--white); }
.kbe-deleted { margin: 14px 6px 0; font-size: 13px; }
.kbe-deleted summary { cursor: pointer; color: var(--ink-soft); }
.kbe-deleted ul { list-style: none; padding: 6px 0 0; margin: 0; }
.kbe-main { min-width: 0; }
.kbe-form { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.kbe-form.panel { padding: 20px 22px; }
.kbe-bar { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); justify-content: space-between; align-items: flex-end; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.kbe-fields { display: flex; gap: var(--s3); flex: 1; min-width: 260px; }
.kbe-fields .grow { flex: 1; }
.kbe-fields .narrowf { width: 90px; }
.kbe-actions { display: flex; align-items: center; gap: var(--s2); }
.kbe-status { font-size: 13px; color: var(--ink-faint); min-width: 110px; text-align: right; }
.kbe-tools { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--paper); }
.kbe-tools > button, .kbe-img { font: 500 13px var(--sans); color: var(--ink-soft); background: none; border: 1px solid transparent; border-radius: 5px; padding: 4px 9px; cursor: pointer; position: relative; }
.kbe-tools > button:hover, .kbe-img:hover { background: var(--white); border-color: var(--line); color: var(--ink); }
.kbe-img input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.kbe-spacer { flex: 1; }
.seg.mini { display: inline-flex; }
.seg.mini button { font: 500 12.5px var(--sans); background: var(--white); border: 1px solid var(--line-strong); padding: 3px 10px; cursor: pointer; color: var(--ink-soft); margin-left: -1px; }
.seg.mini button:first-child { border-radius: 5px 0 0 5px; margin-left: 0; }
.seg.mini button:last-child { border-radius: 0 5px 5px 0; }
.seg.mini button.on { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }
.kbe-panes { display: grid; grid-template-columns: 1fr 1fr; min-height: 62vh; }
.kbe-panes[data-mode='write'] { grid-template-columns: 1fr; }
.kbe-panes[data-mode='write'] .kbe-preview { display: none; }
.kbe-panes[data-mode='preview'] { grid-template-columns: 1fr; }
.kbe-panes[data-mode='preview'] textarea { display: none; }
.kbe-panes textarea { border: 0; border-radius: 0; resize: none; font: 14px/1.6 var(--mono); padding: 18px; min-height: 62vh; border-right: 1px solid var(--line); }
.kbe-panes textarea:focus { box-shadow: none; }
.kbe-preview { padding: 18px 22px; max-width: none; overflow: auto; max-height: 75vh; }
.kbe-preview h1 { font-size: 26px; margin: 0 0 14px; }
.kbe-preview h2 { margin: 22px 0 10px; }
.kbe-preview h3 { margin: 18px 0 8px; }
.kbe-preview img { max-width: 100%; border: 1px solid var(--line); border-radius: 4px; }
.kbe-preview code { background: var(--paper-alt); padding: 1px 4px; border-radius: 3px; }
.kbe-preview pre code { background: none; padding: 0; }
.adm { border-left: 4px solid var(--blue); background: #EEF5FF; padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 0 0 14px; }
.adm-title { font-weight: 600; text-transform: capitalize; margin-bottom: 4px; }
.adm-tip { border-color: var(--teal-ink); background: var(--green-bg); }
.adm-warning, .adm-caution { border-color: var(--amber); background: var(--amber-bg); }
.adm-danger { border-color: var(--red); background: var(--red-bg); }
.kbe-foot { display: flex; gap: var(--s4); align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13px; }
.kbe-foot .dim { flex: 1; font-family: var(--mono); font-size: 12px; }
.hist { list-style: none; padding: 0; margin: 0; max-height: 40vh; overflow: auto; font-size: 13.5px; }
.hist li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.hist li span { flex: 1; }
.dlg pre.log { max-height: 30vh; }
@media (max-width: 1100px) { .kbe { grid-template-columns: 1fr; } .kbe-tree { position: static; max-height: 40vh; } }
@media (max-width: 760px) { .kbe-panes, .kbe-panes[data-mode] { grid-template-columns: 1fr; } .kbe-panes[data-mode='split'] .kbe-preview { border-top: 1px solid var(--line); } .kbe-panes textarea { border-right: 0; min-height: 45vh; } }
.steps-live { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.bubble .elapsed { margin: 4px 0 0; font-size: 12px; }
