/* Panel design system: Nightfall (dark, the default) and Frost Ink (light) tokens, base elements and
   components. Same-origin assets only; the CSP forbids inline styles, so layout lives here, never in markup.
   Brand accents come from html[data-brand]; the per-browser mode from html[data-theme] (panel-theme.js). */

/* ---- Fonts: self-hosted latin variable subsets; provenance and OFL texts in apps/panel/licenses/fonts.md ---- */
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/assets/manrope-latin-wght-normal.woff2) format("woff2");
}
@font-face {
  font-family: Quicksand;
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/assets/quicksand-latin-wght-normal.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(/assets/jetbrains-mono-latin-wght-normal.woff2) format("woff2");
}

/* ---- Tokens---------------------------------------------------------------------------------------- */
:root {
  color-scheme: dark;
  --font-body: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Quicksand, ui-rounded, "SF Pro Rounded", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* PlayPro purple */
  --acc: #7b4fa0;
  --acc-m: #9a6cc4;
  --acc-b: #c9a8ee;
  --acc-ink: #6c4290;
  --soft: rgba(155, 108, 206, 0.1);
  --soft2: rgba(155, 108, 206, 0.26);
  --ring: rgba(201, 168, 238, 0.34);
  --glow: rgba(155, 108, 206, 0.5);
  /* Nightfall page */
  --page: linear-gradient(160deg, #15233f 0%, #1a1e3c 45%, #231a3c 100%);
  --page-base: #1a1e3c;
  --g1: rgba(70, 150, 235, 0.38);
  --g2: rgba(156, 110, 226, 0.34);
  --g3: rgba(255, 255, 255, 0.05);
  --pane-bd: rgba(255, 255, 255, 0.14);
  --pane-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.05) 100%);
  --pane-sh:
    inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -3px 8px -4px rgba(255, 255, 255, 0.07),
    0 2px 4px rgba(0, 0, 0, 0.18), 0 22px 44px -26px rgba(0, 0, 0, 0.6);
  --scrim: rgba(4, 6, 14, 0.58);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --focus: var(--acc-b);
}
html[data-brand="hosthorde"] {
  /* HostHorde blue */
  --acc: #1478aa;
  --acc-m: #2a95cc;
  --acc-b: #6cc3ef;
  --acc-ink: #0e6590;
  --soft: rgba(30, 150, 210, 0.1);
  --soft2: rgba(30, 150, 210, 0.26);
  --ring: rgba(108, 195, 239, 0.36);
  --glow: rgba(30, 150, 210, 0.5);
}
/* Dark scheme (E9): the page in Nightfall, and the rail, menu and consoles in both modes. */
:root,
.ui-dark {
  --tx: #eceae6;
  --tx2: #9ca3ad;
  --tx3: #aab0b8;
  --line: rgba(255, 255, 255, 0.07);
  --chip: rgba(255, 255, 255, 0.07);
  --chip-tx: #d3d7dc;
  --well: rgba(0, 0, 0, 0.38);
  --well-sh: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.06);
  --btn: rgba(255, 255, 255, 0.06);
  --btn-hover: rgba(255, 255, 255, 0.11);
  --btn-bd: rgba(255, 255, 255, 0.1);
  --btn-sh: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --link: var(--acc-b);
  --ok: rgba(124, 201, 87, 0.14);
  --ok-tx: #a6e283;
  --ok-ring: rgba(124, 201, 87, 0.32);
  --ok-dot: #7cc957;
  --pw-tx: #d9dde2;
  --pw-off: #737a83;
  --amb: rgba(242, 179, 61, 0.13);
  --amb-tx: #ffd27a;
  --amb-sh: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(242, 179, 61, 0.32);
  --red: rgba(232, 96, 84, 0.13);
  --red-tx: #ffa59c;
  --red-sh: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(232, 96, 84, 0.34);
  --track: rgba(0, 0, 0, 0.42);
  --track-sh: inset 0 1px 2px rgba(0, 0, 0, 0.65), 0 1px 0 rgba(255, 255, 255, 0.05);
  --meter: linear-gradient(90deg, var(--acc), var(--acc-b));
  --spark: var(--acc-b);
  --nav: #c9ced5;
  --nav-rail: #b4bac3;
  --nav-hover: rgba(255, 255, 255, 0.06);
  --nav-on: rgba(255, 255, 255, 0.1);
  --nav-on-tx: #ffffff;
  --nav-on-sh: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --rail-ico: currentColor;
  --item-on: linear-gradient(180deg, var(--soft2), var(--soft));
  --item-on-sh: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px var(--ring);
  --item-ico: var(--acc-b);
  --rail: rgba(0, 0, 0, 0.28);
  --rail-line: rgba(255, 255, 255, 0.06);
  --tile: rgba(255, 255, 255, 0.05);
  --tile-bd: rgba(255, 255, 255, 0.08);
  --tile-hover: rgba(255, 255, 255, 0.08);
  --tile-sh: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --field: rgba(0, 0, 0, 0.3);
  --field-bd: rgba(255, 255, 255, 0.1);
  --field-sh: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  --ph: #8b929c;
  --chk-bd: rgba(255, 255, 255, 0.22);
  --kbd: rgba(255, 255, 255, 0.08);
  --kbd-sh: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --av-ring: 0 0 0 2px rgba(255, 255, 255, 0.08);
  --screen: rgba(0, 0, 0, 0.42);
}
/* Nightfall panes (the "nf" layer): brighter selection and translucent wells on the glass. Secondary text is
   lifted so it keeps 4.5:1 on a tile over a pane (tests/workflow/panel-design-contrast.cjs). */
:root {
  --tx2: #b0b6bf;
  --nav-on: rgba(255, 255, 255, 0.14);
  --nav-on-sh: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  --rail-ico: var(--acc-b);
  --item-on: rgba(255, 255, 255, 0.14);
  --item-on-sh: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  --rail: rgba(255, 255, 255, 0.04);
  --rail-line: rgba(255, 255, 255, 0.1);
  --tile: rgba(255, 255, 255, 0.07);
  --tile-bd: rgba(255, 255, 255, 0.14);
  --tile-hover: rgba(255, 255, 255, 0.12);
  --well: rgba(0, 0, 0, 0.26);
  --field: rgba(0, 0, 0, 0.22);
  --field-bd: rgba(255, 255, 255, 0.14);
  --screen: rgba(6, 8, 16, 0.55);
}
/* Frost Ink (E11): light frost panes; the rail, menu and consoles keep the dark scheme via .ui-dark. */
html[data-theme="light"] {
  color-scheme: light;
  --page: linear-gradient(160deg, #d6e5f7 0%, #e6edf8 45%, #ebe5f6 100%);
  --page-base: #e3eaf7;
  --g1: rgba(118, 172, 240, 0.45);
  --g2: rgba(172, 138, 234, 0.34);
  --g3: rgba(255, 255, 255, 0.75);
  --pane-bd: rgba(255, 255, 255, 0.95);
  --pane-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(246, 249, 253, 0.62) 100%);
  --pane-sh:
    inset 0 1px 0 #ffffff, inset 0 -3px 8px -4px rgba(255, 255, 255, 0.9), 0 2px 4px rgba(40, 60, 110, 0.05),
    0 22px 44px -26px rgba(50, 70, 140, 0.38);
  --scrim: rgba(20, 26, 44, 0.42);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a606c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --focus: var(--acc-ink);
  --tx: #161922;
  --tx2: #5a606c;
  --tx3: #5a606c;
  --line: rgba(20, 24, 40, 0.08);
  --chip: rgba(20, 24, 40, 0.06);
  --chip-tx: #363b47;
  --well: rgba(20, 24, 40, 0.07);
  --well-sh: inset 0 1px 3px rgba(20, 24, 40, 0.16), 0 1px 0 rgba(255, 255, 255, 0.9);
  --btn: rgba(255, 255, 255, 0.78);
  --btn-hover: #ffffff;
  --btn-bd: rgba(20, 24, 40, 0.1);
  --btn-sh: inset 0 1px 0 #ffffff, 0 1px 2px rgba(20, 24, 40, 0.08);
  --link: var(--acc-ink);
  --ok: rgba(61, 138, 31, 0.12);
  --ok-tx: #2c6417;
  --ok-ring: rgba(61, 138, 31, 0.3);
  --ok-dot: #3d8a1f;
  --pw-tx: #2b2f38;
  --pw-off: #8a90a0;
  --amb: linear-gradient(180deg, #fff4da, #ffe3a6);
  --amb-tx: #6a4500;
  --amb-sh: inset 0 1px 0 #ffffff, 0 0 0 1px rgba(176, 118, 8, 0.32), 0 6px 14px -8px rgba(176, 118, 8, 0.5);
  --red: linear-gradient(180deg, #ffeae7, #fdd0ca);
  --red-tx: #9a2318;
  --red-sh: inset 0 1px 0 #ffffff, 0 0 0 1px rgba(180, 35, 24, 0.3), 0 6px 14px -8px rgba(180, 35, 24, 0.5);
  --track: rgba(20, 24, 40, 0.08);
  --track-sh: inset 0 1px 2px rgba(20, 24, 40, 0.16), 0 1px 0 rgba(255, 255, 255, 0.9);
  --meter: linear-gradient(90deg, var(--acc), var(--acc-m));
  --spark: var(--acc);
  --nav: #3a3f4b;
  --nav-rail: #4a505c;
  --nav-hover: rgba(255, 255, 255, 0.55);
  --nav-on: #ffffff;
  --nav-on-tx: #161922;
  --nav-on-sh: 0 1px 2px rgba(20, 24, 40, 0.08), 0 8px 18px -10px rgba(20, 24, 40, 0.3);
  --rail-ico: var(--acc);
  --item-on: #ffffff;
  --item-on-sh: 0 1px 2px rgba(20, 24, 40, 0.08), 0 8px 18px -10px rgba(20, 24, 40, 0.3);
  --item-ico: var(--acc);
  --rail: rgba(214, 224, 242, 0.4);
  --rail-line: rgba(255, 255, 255, 0.8);
  --tile: rgba(255, 255, 255, 0.62);
  --tile-bd: rgba(255, 255, 255, 0.9);
  --tile-hover: rgba(255, 255, 255, 0.88);
  --tile-sh: 0 1px 2px rgba(20, 24, 40, 0.06);
  --field: rgba(255, 255, 255, 0.72);
  --field-bd: rgba(20, 24, 40, 0.12);
  --field-sh: inset 0 1px 2px rgba(20, 24, 40, 0.08);
  --ph: #6f7581;
  --chk-bd: rgba(20, 24, 40, 0.32);
  --kbd: #ffffff;
  --kbd-sh: 0 1px 0 rgba(20, 24, 40, 0.12);
  --av-ring: 0 0 0 3px rgba(255, 255, 255, 0.9);
  --screen: rgba(16, 18, 26, 0.9);
}
.ui-dark {
  color-scheme: dark;
  color: var(--tx);
  --focus: var(--acc-b);
  --link: var(--acc-b);
}

/* ---- Base ------------------------------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  background: var(--page-base);
  color: var(--tx);
  font: 500 14px / 1.55 var(--font-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* The page gradient and its two glows, behind everything and fixed while the content scrolls. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side, var(--g1), transparent) left -260px top -380px / 1100px 1100px no-repeat,
    radial-gradient(closest-side, var(--g2), transparent) right -280px bottom -460px / 1200px 1200px no-repeat,
    radial-gradient(closest-side, var(--g3), transparent) right 22% top 18% / 620px 620px no-repeat,
    var(--page);
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
h1 {
  font-size: 26px;
}
h2 {
  font-size: 18px;
}
h3 {
  font-size: 15px;
}
p,
dl,
dd,
figure,
blockquote {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding-left: 20px;
}
a {
  color: var(--link);
  text-decoration: none;
  font-weight: 700;
}
a:hover {
  color: var(--tx);
}
img,
svg {
  flex-shrink: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
summary,
label[for],
select {
  cursor: pointer;
}
button {
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
::selection {
  background: var(--soft2);
}
code,
kbd,
samp,
pre,
.mono {
  font-family: var(--font-mono);
}
code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--chip-tx);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.sr-only,
.sw-sr,
.panel-conversion-tag {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 14px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--acc);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 10px 24px -12px var(--glow);
}
.skip-link:focus {
  top: 14px;
  color: #ffffff;
}

/* ---- Icons ----------------------------------------------------------------------------------------- */
.ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico--sm {
  width: 16px;
  height: 16px;
}
.ico--fill {
  fill: currentColor;
  stroke: none;
}

/* ---- Surfaces -------------------------------------------------------------------------------------- */
.pane,
.aa-card,
.wf-main > div.wf-heading {
  position: relative;
  min-width: 0;
  border: 1.5px solid var(--pane-bd);
  border-radius: 28px;
  background: var(--pane-bg);
  box-shadow: var(--pane-sh);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
}
.s-coal {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(22, 23, 30, 0.92) 0%, rgba(12, 13, 18, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(20, 20, 60, 0.12),
    0 30px 60px -28px rgba(30, 30, 90, 0.6);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
}
.aa-card,
.card {
  padding: 22px;
}
.tile {
  border: 1px solid var(--tile-bd);
  border-radius: 18px;
  background: var(--tile);
  box-shadow: var(--tile-sh);
}

/* Vertical rhythm inside cards: headings, copy, forms and controls without per-template spacing. */
.aa-card > * + *,
.card > * + * {
  margin-top: 14px;
}
.aa-card > :is(h2, h3) + p,
.aa-card > .wf-eyebrow + h2,
.card > :is(h2, h3) + p {
  margin-top: 6px;
}
.aa-card > :is(.wf-button, button):not([hidden]) + :is(.wf-button, button) {
  margin-left: 6px;
}
.aa-card p,
.card p {
  color: var(--tx2);
  font-size: 13.5px;
  line-height: 1.6;
}
.aa-card :is(h2, h3) {
  color: var(--tx);
}
.aa-card h3 {
  margin-top: 22px;
}
.aa-card > h3:first-child,
.aa-card form > h3:first-child {
  margin-top: 0;
}
.aa-card .aa-card {
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--tile);
  border: 1px solid var(--tile-bd);
  border-radius: 20px;
}

/* ---- Typography helpers ---------------------------------------------------------------------------- */
.wf-eyebrow,
.lbl,
.caption {
  margin: 0;
  color: var(--tx2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.sub,
.panel-page-description {
  margin: 4px 0 0;
  color: var(--tx2);
  font-size: 13.5px;
}
.aa-help,
.help,
.aa-card small {
  color: var(--tx2);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}
.wf-optional {
  color: var(--tx2);
  font-weight: 500;
}
.num {
  font-variant-numeric: tabular-nums;
}

/* ---- Buttons --------------------------------------------------------------------------------------- */
.wf-button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn);
  box-shadow: var(--btn-sh);
  color: var(--tx);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    filter 0.15s;
}
.wf-button:not(:disabled):hover,
.btn:not(:disabled):hover {
  background: var(--btn-hover);
  color: var(--tx);
}
.wf-primary,
.btn--primary {
  border-color: transparent;
  background: var(--acc);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 24px -12px var(--glow);
}
.wf-primary:not(:disabled):hover,
.btn--primary:not(:disabled):hover {
  background: var(--acc);
  color: #ffffff;
  filter: brightness(1.12);
}
.aa-danger,
.btn--danger {
  border-color: transparent;
  background: var(--red);
  color: var(--red-tx);
  box-shadow: var(--red-sh);
}
.aa-danger:not(:disabled):hover,
.btn--danger:not(:disabled):hover {
  background: var(--red);
  color: var(--red-tx);
  filter: brightness(1.08);
}
.btn--ghost,
.wf-quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.wf-button:disabled,
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn--sm,
table .wf-button,
.sa-item .wf-button {
  min-height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
}
.ibtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 1px solid var(--btn-bd);
  border-radius: 12px;
  background: var(--btn);
  box-shadow: var(--btn-sh);
  color: var(--tx);
  cursor: pointer;
}
.ibtn:hover {
  background: var(--btn-hover);
}
.acts,
.sw-toolbar,
.sw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.aa-card > .sw-toolbar,
.aa-card > .sw-actions {
  margin-top: 16px;
}

/* ---- Form fields ----------------------------------------------------------------------------------- */
:where(
  input:not(
    [type="checkbox"],
    [type="radio"],
    [type="hidden"],
    [type="file"],
    [type="range"],
    [type="color"],
    [type="submit"],
    [type="button"]
  ),
  select,
  textarea
) {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--field-bd);
  border-radius: 12px;
  background-color: var(--field);
  box-shadow: var(--field-sh);
  color: var(--tx);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
:where(input, textarea)::placeholder {
  color: var(--ph);
  opacity: 1;
}
:where(select) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 13px center;
}
:where(select) option,
:where(select) optgroup {
  background: #1d2033;
  color: #eceae6;
}
html[data-theme="light"] :where(select) option,
html[data-theme="light"] :where(select) optgroup {
  background: #ffffff;
  color: #161922;
}
:where(textarea) {
  min-height: 120px;
  padding: 11px 14px;
  line-height: 1.6;
  resize: vertical;
}
:where(input, select, textarea):disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
:where(input, textarea)[readonly] {
  background-color: var(--well);
  box-shadow: none;
}
:where(input:not([type="checkbox"], [type="radio"]), select, textarea):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
input[type="search"]::-webkit-search-cancel-button {
  filter: grayscale(1);
}
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
  vertical-align: middle;
  border: 1.5px solid var(--chk-bd);
  border-radius: 6px;
  background: var(--field);
  cursor: pointer;
}
input[type="radio"] {
  border-radius: 50%;
}
input[type="checkbox"]:checked {
  border-color: transparent;
  background: var(--acc)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E")
    center no-repeat;
}
input[type="radio"]:checked {
  border: 5px solid var(--acc);
  background: #ffffff;
}
input[type="file"] {
  max-width: 100%;
  color: var(--tx2);
  font-size: 13px;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
legend {
  padding: 0;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

/* Labels: stacked above their field; checkbox labels sit on one row. */
.aa-card label,
.flabel {
  display: grid;
  gap: 6px;
  color: var(--tx);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
/* Check and radio labels keep their text in one flow (links included); the box hangs in the left gutter. */
.aa-card label:has(> input[type="checkbox"], > input[type="radio"]),
.aa-checkbox,
.sw-check {
  display: block;
  position: relative;
  padding-left: 28px;
  font-weight: 600;
  line-height: 1.5;
}
.aa-card label:has(> input[type="checkbox"], > input[type="radio"]) > input:is([type="checkbox"], [type="radio"]),
:is(.aa-checkbox, .sw-check) > input:is([type="checkbox"], [type="radio"]) {
  position: absolute;
  top: 1px;
  left: 0;
}
.aa-card label > small {
  font-weight: 500;
}
.aa-card form {
  display: grid;
  gap: 12px;
  max-width: 680px;
}
.aa-card form > h3 {
  margin: 6px 0 0;
}
.aa-card form > p {
  margin: 0;
}
.aa-card form > :is(.wf-button, button) {
  justify-self: start;
}
.aa-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.fgrp {
  margin-top: 14px;
}
.fgrp:first-child {
  margin-top: 0;
}
.fpair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.fpair > .fgrp {
  margin-top: 14px;
}
.sw-inline,
.aa-card form.sw-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sw-inline > :is(input, select) {
  flex: 1 1 auto;
}
.sw-inline > :is(button, .wf-button) {
  flex: none;
}
.sw-upload {
  position: relative;
  overflow: hidden;
}
.sw-upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ---- Status, notes and pills ----------------------------------------------------------------------- */
.aa-feedback,
.wf-notice,
.note {
  display: block;
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--ring);
  color: var(--tx);
  font-size: 13.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.aa-feedback:empty {
  display: none;
}
.aa-feedback[data-state="error"],
.wf-error,
.note--danger {
  background: var(--red);
  box-shadow: var(--red-sh);
  color: var(--red-tx);
}
.aa-feedback[data-state="success"] {
  background: var(--ok);
  box-shadow: inset 0 0 0 1px var(--ok-ring);
  color: var(--ok-tx);
}
.aa-feedback[data-state="uncertain"],
.note--warn {
  background: var(--amb);
  box-shadow: var(--amb-sh);
  color: var(--amb-tx);
}
.wf-error {
  display: block;
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 13.5px;
}
.sw-held,
.aa-card.sw-held {
  border-color: transparent;
  background: var(--amb);
  box-shadow: var(--amb-sh);
  color: var(--amb-tx);
}
.sw-held :is(h2, p) {
  color: var(--amb-tx);
}
.badge,
.panel-service-state,
.aa-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-tx);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge--acc {
  background: var(--soft2);
  color: var(--link);
}
.badge--ok,
.aa-badge[data-enabled="true"] {
  background: var(--ok);
  color: var(--ok-tx);
}
.badge--warn {
  background: var(--amb);
  color: var(--amb-tx);
}
.badge--red,
.panel-service-state[data-suspended="true"] {
  background: var(--red);
  color: var(--red-tx);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-tx);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.pill[data-tone="ok"] {
  background: var(--ok);
  color: var(--ok-tx);
  box-shadow: inset 0 0 0 1px var(--ok-ring);
}
.pill[data-tone="warn"] {
  background: var(--amb);
  color: var(--amb-tx);
  box-shadow: var(--amb-sh);
}
.pill[data-tone="red"] {
  background: var(--red);
  color: var(--red-tx);
  box-shadow: var(--red-sh);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-tx);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--pw-off);
}
[data-tone="ok"] .dot,
.dot[data-tone="ok"] {
  background: var(--ok-dot);
}
[data-tone="warn"] .dot,
.dot[data-tone="warn"] {
  background: var(--amb-tx);
}
[data-tone="red"] .dot,
.dot[data-tone="red"] {
  background: var(--red-tx);
}
[data-tone="ok"] .dot.pulse {
  animation: panel-pulse 1.8s ease-in-out infinite;
}
@keyframes panel-pulse {
  50% {
    opacity: 0.35;
  }
}

/* ---- Definition lists: facts shown as small tiles ---------------------------------------------------- */
.aa-identity {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin: 0;
}
.aa-identity > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--tile-bd);
  border-radius: 16px;
  background: var(--tile);
  box-shadow: var(--tile-sh);
}
.aa-identity dt {
  color: var(--tx2);
  font-size: 12px;
  font-weight: 700;
}
.aa-identity dd {
  margin: 3px 0 0;
  color: var(--tx);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.kv {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.kv:first-of-type {
  border-top: 0;
}
.kv dt {
  width: 150px;
  flex: none;
  color: var(--tx2);
  font-size: 13px;
  font-weight: 700;
}
.kv dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---- Disclosure ------------------------------------------------------------------------------------ */
details {
  min-width: 0;
}
.aa-card details {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--tx);
  font-weight: 700;
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary:not(.wf-button)::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: var(--chevron) center / 16px no-repeat;
  transform: rotate(-90deg);
  transition: transform 0.15s;
}
details[open] > summary:not(.wf-button)::before {
  transform: none;
}
details > summary.wf-button {
  display: inline-flex;
  width: max-content;
}
details[open] > summary {
  margin-bottom: 12px;
}

/* ---- Tables ---------------------------------------------------------------------------------------- */
.sw-table-wrap,
.aa-table-scroll,
.tbl-wrap {
  /* Contains visually hidden headings: without a positioned wrapper they sit at the table's far edge and widen the page on phones. */
  position: relative;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
:is(.aa-card, .card) table,
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  text-align: left;
}
:is(.aa-card, .card) th,
.tbl th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--tx2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: left;
}
:is(.aa-card, .card) td,
.tbl td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
:is(.aa-card, .card) tbody tr:last-child td,
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
:is(.aa-card, .card) tbody tr:hover td {
  background: var(--nav-hover);
}
.num-c {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- Consoles and code ------------------------------------------------------------------------------ */
pre {
  margin: 0;
  font-size: 12.5px;
}
.console,
#sw-output,
#chat-output,
#sm-output,
.aa-card pre {
  margin: 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--screen);
  color: #d8dee4;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(255, 255, 255, 0.05);
  font: 500 12.5px / 1.85 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
  overflow: auto;
}
#sw-output,
#chat-output {
  height: 400px;
  min-height: 220px;
  max-height: 65dvh;
}
.aa-card pre:empty {
  display: none;
}
#sw-output:empty,
#chat-output:empty {
  display: block;
}
.aa-card textarea[spellcheck="false"],
#sw-editor-text,
#configuration-text {
  min-height: 320px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--screen);
  color: #d8dee4;
  font: 500 12.5px / 1.75 var(--font-mono);
  white-space: pre;
  overflow: auto;
}
.code {
  margin: 0;
  padding: 14px 0;
  border-radius: 16px;
  background: var(--screen);
  color: #d8dee4;
  font: 500 12.5px / 1.85 var(--font-mono);
  white-space: pre;
  overflow: auto;
  counter-reset: ln;
}
.code .l {
  display: block;
  padding-right: 16px;
}
.code .l.chg {
  background: rgba(242, 179, 61, 0.1);
  box-shadow: inset 3px 0 0 #f2b33d;
}
.code .l::before {
  counter-increment: ln;
  content: counter(ln);
  display: inline-block;
  width: 46px;
  margin-right: 16px;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  color: #5d6570;
  text-align: right;
}

/* ---- Meters and tiles ------------------------------------------------------------------------------- */
.meter {
  height: 10px;
  margin-top: 16px;
  border-radius: 999px;
  background: var(--track);
  box-shadow: var(--track-sh);
  overflow: hidden;
}
.meter > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--meter);
  box-shadow: 0 0 14px var(--glow);
  transition: width 0.4s;
}
.mini {
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--track);
  box-shadow: var(--track-sh);
  overflow: hidden;
}
.mini > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--meter);
}

/* ---- Segmented controls and tabs ------------------------------------------------------------------- */
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: var(--well-sh);
}
.seg > button,
.pw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--pw-tx);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.seg > button:not(:disabled):hover {
  background: var(--nav-hover);
}
.seg > button[aria-pressed="true"] {
  background: var(--item-on);
  box-shadow: var(--item-on-sh);
  color: var(--nav-on-tx);
}
.seg > button:disabled {
  opacity: 1;
  color: var(--pw-off);
}
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: var(--well-sh);
}

/* ---- Lists and rows --------------------------------------------------------------------------------- */
.sa-item,
.shared-person,
.row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
:is(.sa-item, .shared-person, .row):first-child {
  border-top: 0;
  padding-top: 4px;
}
.sa-item h3 {
  margin: 0 0 4px;
}
.sa-item p {
  margin: 4px 0 0;
}
.sa-item .sw-toolbar {
  margin-top: 10px;
  gap: 6px;
}
.shared-person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.shared-person > span {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}
.shared-person select {
  width: auto;
  max-width: 13rem;
}
.shared-pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 12px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
}
.opt small {
  display: block;
  color: var(--tx2);
  font-size: 12px;
  font-weight: 500;
}
.opt.on {
  background: var(--soft2);
  box-shadow: inset 0 0 0 1px var(--ring);
}
.face,
.av-initials {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  background: var(--soft2);
  color: var(--tx);
  font-size: 11px;
  font-weight: 800;
}

/* ---- Two-column form grids used by automation, settings and editors -------------------------------- */
.sa-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  max-width: 860px;
}
.aa-card form.sa-form {
  max-width: 860px;
}
.sa-form > :is(h3, p, fieldset, .sw-toolbar, .sa-form, details, section, div:not(.aa-field)),
.sa-form > label:has(textarea) {
  grid-column: 1 / -1;
}
.sa-form > :is(.wf-button, button) {
  justify-self: start;
}
.sa-form label {
  display: grid;
  gap: 6px;
  align-content: start;
}
.sa-form small {
  display: block;
}

/* Cards made of several independent forms: each form or subsection becomes a tile in a two-column grid. */
.panel-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.panel-tiles > * {
  grid-column: 1 / -1;
  margin-top: 0 !important;
}
.panel-tiles > :is(form, section) {
  grid-column: auto;
  max-width: none;
  padding: 18px;
  border: 1px solid var(--tile-bd);
  border-radius: 20px;
  background: var(--tile);
  box-shadow: var(--tile-sh);
}
.panel-tiles > :is(form, section) > * + * {
  margin-top: 12px;
}
.panel-tiles > form {
  margin-top: 0;
}
.panel-tiles > :is(form, section) > h3:first-child {
  margin-top: 0;
  font-size: 16px;
}
.panel-tiles > :is(form, section) > p {
  color: var(--tx2);
  font-size: 13px;
}
.panel-tiles > .panel-tile-wide {
  grid-column: 1 / -1;
}
.panel-tiles .sa-form,
.panel-tiles form.sa-form {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
}
.cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.cfg-fields {
  display: grid;
  gap: 10px;
}
.cfg-fields details {
  padding: 12px 14px;
  border: 1px solid var(--tile-bd);
  border-radius: 16px;
  background: var(--tile);
}
.cfg-fields small {
  display: block;
  margin: 6px 0;
}
.cfg-fields label {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}
.cfg-typed-control {
  display: block;
  min-width: 160px;
}
.cfg-state {
  font-size: 12.5px;
  color: var(--tx2);
}

/* ---- Layout grid ------------------------------------------------------------------------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}
.c3 {
  grid-column: span 3;
}
.c4 {
  grid-column: span 4;
}
.c5 {
  grid-column: span 5;
}
.c6 {
  grid-column: span 6;
}
.c7 {
  grid-column: span 7;
}
.c8 {
  grid-column: span 8;
}
.c9 {
  grid-column: span 9;
}
.c12 {
  grid-column: span 12;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .c7,
  .c8,
  .c9,
  .c12 {
    grid-column: span 6;
  }
  .c5,
  .c6 {
    grid-column: span 6;
  }
  .c3,
  .c4 {
    grid-column: span 3;
  }
}
@media (max-width: 640px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid > * {
    grid-column: auto;
  }
  .sa-form,
  .fpair,
  .panel-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .sw-inline {
    flex-wrap: wrap;
  }
  .sw-inline > :is(input, select) {
    flex-basis: 60%;
  }
  :where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"]), select, textarea) {
    min-height: 44px;
    font-size: 16px;
  }
  .wf-button,
  .btn {
    min-height: 44px;
  }
  .aa-card,
  .card {
    padding: 18px 16px;
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .pane,
  .aa-card,
  .wf-button,
  .btn,
  .pill,
  .badge {
    border: 1px solid CanvasText;
  }
}
@media print {
  body::before {
    display: none;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .pane,
  .aa-card {
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    break-inside: avoid;
  }
}
