/* AI Experience panel v2 (H15) — layout + design tokens over the AIPB CMS styles (admin.css).
   Mockup: static/cms/mockup/panel-v2.html. Selectors are prefixed with body.aix so they win over the AIPB
   `body.dark-mode …` rules; AIPB-specific components that are not restyled here keep their admin.css look. */

@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); }
/* Poppins (Google Fonts, OFL), latin only: the "AI experience" wordmark next to the logo */
@font-face { font-family: Poppins; font-style: normal; font-weight: 300; font-display: swap;
  src: url(../fonts/poppins-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/poppins-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+1E00-1EFF; }

:root {
  --bg: #f4f4f5; --surface: #ffffff; --surface-2: #fafafa; --surface-3: #f4f4f5;
  --border: #e4e4e7; --border-strong: #d4d4d8;
  --text: #18181b; --text-2: #3f3f46; --muted: #71717a; --dim: #a1a1aa;
  --accent: #7c3aed; --accent-2: #8b5cf6; --accent-soft: #f3efff; --accent-text: #6d28d9;
  --success: #16a34a; --success-soft: #ecfdf3; --warning: #d97706; --warning-soft: #fffbeb;
  --danger: #dc2626; --danger-soft: #fef2f2;
  /* categorical series (projects), fixed order, validated with the dataviz checks (light + dark) */
  --series-1: #7c3aed; --series-2: #1baf7a; --series-3: #eb6834; --series-4: #2a78d6; --series-5: #eda100; --series-other: #a1a1aa;
  --shadow: 0 1px 2px rgba(16,16,20,.04), 0 1px 3px rgba(16,16,20,.06);
  --shadow-lg: 0 20px 50px -12px rgba(16,16,20,.25);
  --radius: 10px; --radius-lg: 14px;
  --brand: linear-gradient(120deg, #ec4899 0%, #8b5cf6 55%, #3b82f6 100%);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --surface: #131313; --surface-2: #181818; --surface-3: #1f1f1f;
  --border: #262626; --border-strong: #333333;
  --text: #ededed; --text-2: #cfcfcf; --muted: #8a8a8a; --dim: #5c5c5c;
  --accent: #8b5cf6; --accent-2: #a78bfa; --accent-soft: rgba(139,92,246,.14); --accent-text: #c4b5fd;
  --success: #22c55e; --success-soft: rgba(34,197,94,.12); --warning: #f59e0b; --warning-soft: rgba(245,158,11,.12);
  --danger: #ef4444; --danger-soft: rgba(239,68,68,.12);
  --series-1: #8b5cf6; --series-2: #199e70; --series-3: #d95926; --series-4: #3987e5; --series-5: #c98500; --series-other: #5c5c5c;
  --shadow: 0 1px 2px rgba(0,0,0,.5); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}

body.aix *, body.aix *::before, body.aix *::after { box-sizing: border-box; }
body.aix, body.aix.dark-mode {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 400;
  font-size: 14px; line-height: 1.5; padding: 0; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
body.aix button, body.aix input, body.aix select, body.aix textarea { font-family: inherit; }
body.aix h1, body.aix h2, body.aix h3 { color: var(--text); font-weight: 650; letter-spacing: -.015em; }
body.aix a { color: var(--accent-text); }
body.aix svg.lucide { width: 18px; height: 18px; flex: none; }
body.aix .mono, body.aix code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; }

/* ── layout: sidebar on the canvas, content on a floating sheet ── */
body.aix .app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
body.aix .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px 14px 16px; }
body.aix .sheet { margin: 12px 12px 12px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }

body.aix .brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
/* brand mark: the AIX logo (gradient wordmark) in the square tile; the tile follows the theme */
/* a tint of the text colour: a hair darker than the page in the light theme, a hair lighter in the dark one */
body.aix .brand-mark { --mark-bg: color-mix(in srgb, var(--text) 4%, transparent); --mark-border: var(--border);
  width: 30px; height: 30px; border-radius: 9px; background: var(--mark-bg); border: 1px solid var(--mark-border);
  display: grid; place-items: center; flex: none; }
body.aix .brand-mark img { width: 80%; height: auto; display: block; }
body.aix .brand-mark.lg { width: 40px; height: 40px; border-radius: 11px; }
body.aix .brand-name { font-weight: 700; letter-spacing: -.01em; }
body.aix .brand-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }
body.aix .wordmark { font-family: Poppins, var(--font, Inter), system-ui, sans-serif; letter-spacing: 0; white-space: nowrap; }
body.aix .wordmark .wm-b { font-weight: 700; }
body.aix .wordmark .wm-l { font-weight: 300; }

body.aix .switcher { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; text-align: left; color: var(--text); }
body.aix .switcher:hover { border-color: var(--border-strong); }
body.aix .avatar { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); }
body.aix .switcher .meta { min-width: 0; flex: 1; }
body.aix .switcher .t1 { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.aix .switcher .t2 { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
body.aix .switcher > svg { color: var(--muted); }

body.aix .search { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: var(--radius); color: var(--muted); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 13.5px; }
body.aix .kbd { margin-left: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; background: var(--surface-2); }

/* nav: the AIPB `.tab[data-tab]` buttons, restyled as sidebar items */
body.aix .nav { flex: 1; overflow-y: auto; margin-right: -6px; padding-right: 6px; position: relative; display: block; border: 0; }
body.aix .nav-group { margin-bottom: 14px; }
body.aix .nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding: 0 10px 6px; display: flex; align-items: center; gap: 6px; }
body.aix .nav-label .pill { text-transform: none; letter-spacing: 0; }
body.aix .nav .nav-item, body.aix.dark-mode .nav .nav-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; margin: 0; border: 0; border-radius: 9px; background: none; color: var(--text-2);
  cursor: pointer; font-weight: 500; font-size: 14px; text-align: left; text-decoration: none;
}
body.aix .nav .nav-item:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 55%, transparent); }
body.aix .nav .nav-item.active, body.aix.dark-mode .nav .nav-item.active { color: var(--text); border: 0; }
body.aix .nav-item .count { margin-left: auto; font-size: 11.5px; color: var(--muted); }
body.aix .nav-indicator { position: absolute; left: 0; right: 6px; top: 0; height: 0; border-radius: 9px; z-index: 0; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); pointer-events: none; opacity: 0; }
body.aix .tabs-more { display: none !important; }

body.aix .sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
body.aix .me { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: none; }
body.aix .me-meta { flex: 1; min-width: 0; font-size: 12px; line-height: 1.3; }
body.aix .me-meta b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.aix .me-meta span { color: var(--muted); }
body.aix .icon-btn-plain { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; flex: none; }
body.aix .icon-btn-plain:hover { background: var(--surface-3); color: var(--text); }
body.aix .icon-btn-plain.bordered { border-color: var(--border); background: var(--surface); }
body.aix .seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border); flex: none; }
body.aix .seg button { border: 0; background: none; padding: 4px 6px; border-radius: 7px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
body.aix .seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
body.aix .seg svg.lucide { width: 15px; height: 15px; }

/* context bar */
body.aix .context { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); min-height: 50px; }
body.aix .context.as-platform { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); border-radius: 18px 18px 0 0; }
body.aix .crumbs { display: flex; align-items: center; gap: 6px; }
body.aix .crumbs b { color: var(--text); font-weight: 600; }
body.aix .crumbs svg.lucide { width: 14px; height: 14px; color: var(--dim); }
body.aix .context .sp { flex: 1; }
body.aix .pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
body.aix .pill svg.lucide { width: 13px; height: 13px; }
body.aix .pill.ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
body.aix .pill.warn { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
body.aix .pill.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
body.aix .pill.ac { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
body.aix .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
body.aix .dot.live { animation: aix-pulse 2s infinite; }
@keyframes aix-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* content area (AIPB renders into #content.section) */
body.aix #content.section, body.aix.dark-mode #content.section { background: none; box-shadow: none; border: 0; border-radius: 0; padding: 24px; margin: 0; overflow: visible; }
body.aix .section-header { margin-bottom: 18px; gap: 12px; }
body.aix .section-header h2, body.aix #content > h2 { font-size: 20px; }
body.aix #content h3 { font-size: 15px; }
body.aix #content p { color: var(--text-2); }
body.aix .loading { color: var(--muted); }
body.aix .error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius); }

/* buttons */
body.aix .btn, body.aix.dark-mode .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; margin-right: 6px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow); white-space: nowrap; text-decoration: none; line-height: 1;
}
body.aix .btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
body.aix .btn:disabled { opacity: .5; cursor: default; }
body.aix .btn svg { width: 16px; height: 16px; fill: currentColor; }
body.aix .btn svg.lucide { fill: none; }
body.aix .btn-add, body.aix .btn-primary, body.aix .modal-content button[type=submit].btn, body.aix form > button[type=submit].btn,
body.aix.dark-mode .btn-add, body.aix.dark-mode .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
body.aix .btn-add:hover, body.aix .btn-primary:hover { filter: brightness(1.08); background: var(--accent); }
body.aix .btn-secondary, body.aix.dark-mode .btn-secondary { background: var(--surface); color: var(--text); }
body.aix .btn-danger, body.aix.dark-mode .btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
body.aix .btn-success, body.aix.dark-mode .btn-success { background: var(--success); border-color: var(--success); color: #fff; }
body.aix .btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
body.aix .icon-btn, body.aix.dark-mode .icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; box-shadow: none; vertical-align: middle; }
body.aix .icon-btn:hover { background: var(--surface-3); color: var(--text); }
body.aix .icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
body.aix .icon-btn.btn-delete:hover { color: var(--danger); background: var(--danger-soft); }

/* tables */
body.aix .table-wrapper { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; background: var(--surface); }
body.aix table { font-size: 13.5px; min-width: 0; }
body.aix th, body.aix td { padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
body.aix th, body.aix.dark-mode table th, body.aix table th:first-child, body.aix.dark-mode table th:first-child { background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: 12px; }
body.aix table td:first-child, body.aix.dark-mode table td:first-child { background: var(--surface); }
body.aix.dark-mode table td { border-bottom-color: var(--border); }
body.aix tbody tr:last-child td { border-bottom: 0; }
body.aix tbody tr:hover td { background: var(--surface-2); }

/* forms */
body.aix .form-group label { color: var(--text-2); font-weight: 500; font-size: 12.5px; margin-bottom: 6px; display: block; }
body.aix .form-group input, body.aix .form-group textarea, body.aix .form-group select,
body.aix.dark-mode .form-group input, body.aix.dark-mode .form-group textarea, body.aix.dark-mode .form-group select,
body.aix #content select, body.aix #content input[type=text], body.aix #content input[type=number], body.aix #content input[type=email] {
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); padding: 8px 10px; font-size: 13.5px; outline: 0;
}
body.aix .form-group input:focus, body.aix .form-group textarea:focus, body.aix .form-group select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
body.aix .form-group small { color: var(--muted); font-size: 12px; display: block; margin-top: 5px; }
/* a row of fields side by side: the fields line up at the bottom even when a label wraps to two lines,
   and inputs and selects share one height (Safari draws a styled select lower than an input) */
body.aix .aix-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--aix-field-min, 200px), 1fr)); gap: 12px; align-items: end; }
body.aix .aix-form-grid .form-group input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),
body.aix .aix-form-grid .form-group select:not([multiple]):not([size]) { box-sizing: border-box; height: 38px; }
body.aix input[type=checkbox], body.aix input[type=radio] { accent-color: var(--accent); }

/* modal → drawer from the right */
body.aix .modal { background: rgba(10,10,12,.38); backdrop-filter: blur(2px); }
body.aix .modal-content, body.aix.dark-mode .modal-content {
  position: fixed; top: 10px; right: 10px; bottom: 10px; margin: 0; width: min(560px, calc(100vw - 20px)); max-width: none; max-height: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 0; overflow-y: auto;
}
body.aix .modal-header { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 14px 20px; margin: 0; border-bottom: 1px solid var(--border); }
body.aix .modal-header h2 { font-size: 16px; }
body.aix .close, body.aix.dark-mode .close { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; font-size: 22px; font-weight: 400; color: var(--muted); }
body.aix .close:hover { background: var(--surface-3); color: var(--text); }
body.aix #modal-body { padding: 20px; }
body.aix #modal-body > form > button[type=submit], body.aix #modal-body > form > .btn:last-child { margin-top: 6px; }

/* confirm + toasts */
body.aix .confirm-overlay { background: rgba(10,10,12,.38); backdrop-filter: blur(2px); }
body.aix .confirm-box, body.aix.dark-mode .confirm-box { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); }
body.aix .confirm-box p { color: var(--text-2); }
body.aix .toast-container { right: 16px; bottom: 16px; top: auto; }
body.aix .toast { background: var(--text); color: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px; border-left: 0; }
body.aix .toast-success { background: var(--success); color: #fff; }
body.aix .toast-error { background: var(--danger); color: #fff; }

/* AIPB components inside content */
body.aix .draggable-item, body.aix.dark-mode .draggable-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
body.aix .draggable-item:hover, body.aix.dark-mode .draggable-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
body.aix .prompt-policy, body.aix.dark-mode .prompt-policy, body.aix .ref-manager, body.aix.dark-mode .ref-manager { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); }
body.aix .stat-card, body.aix.dark-mode .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; }

/* view switch (tiles / list), remembered per view */
body.aix .view-switch { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border); }
body.aix .view-switch button { border: 0; background: none; height: 28px; padding: 0 8px; border-radius: 7px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
body.aix .view-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
body.aix .view-switch svg.lucide { width: 15px; height: 15px; }
body.aix .toolbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
body.aix .toolbar-row .sp { flex: 1; }
body.aix .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
body.aix .tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
body.aix .tile .top { display: flex; align-items: center; gap: 10px; }
body.aix .tile .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
body.aix .tile .name { font-weight: 600; }
body.aix .tile .sub, body.aix .cell-sub { font-size: 12px; color: var(--muted); }
body.aix .tile .kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; }
body.aix .tile .kv span { color: var(--muted); }
body.aix .tile .actions { display: flex; gap: 6px; margin-top: auto; }
body.aix .meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
body.aix .meter i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
body.aix .meter.warn i { background: var(--warning); }
body.aix .cell-title { font-weight: 600; }
body.aix .muted { color: var(--muted); }

/* ⌘K palette */
body.aix .palette-scrim { position: fixed; inset: 0; z-index: 1090; background: rgba(10,10,12,.38); backdrop-filter: blur(2px); display: none; }
body.aix .palette { position: fixed; top: 14vh; left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); z-index: 1100; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; display: none; }
body.aix .palette.on, body.aix .palette-scrim.on { display: block; }
body.aix .palette .in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
body.aix .palette .in input { flex: 1; border: 0; outline: 0; background: none; font-size: 15px; color: var(--text); }
body.aix .palette .list { max-height: 52vh; overflow-y: auto; padding: 6px 8px 8px; }
body.aix .palette small { display: block; padding: 8px 10px 4px; color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
body.aix .palette .it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: var(--text-2); }
body.aix .palette .it.sel { background: var(--surface-3); color: var(--text); }
body.aix .palette .it .r { margin-left: auto; color: var(--muted); font-size: 12px; }
body.aix .palette .it .avatar { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; }
body.aix .palette .empty { padding: 18px; color: var(--muted); text-align: center; }

body.aix .mob-top { display: none; }

/* responsive: icons-only sidebar < 1180 px, off-canvas < 820 px */
@media (max-width: 1180px) {
  body.aix .app { grid-template-columns: 72px minmax(0, 1fr); }
  body.aix .sidebar { padding: 16px 8px; align-items: center; }
  body.aix .brand-text, body.aix .switcher .meta, body.aix .switcher > svg, body.aix .search span, body.aix .nav-label,
  body.aix .nav-item span, body.aix .me-meta, body.aix .sidebar-foot .seg { display: none; }
  body.aix .switcher, body.aix .search { width: 44px; justify-content: center; padding: 8px; }
  body.aix .nav { margin-right: 0; padding-right: 0; width: 100%; }
  body.aix .nav .nav-item { justify-content: center; padding: 8px; }
  body.aix .nav-indicator { right: 0; }
  body.aix .sidebar-foot { flex-direction: column; border-top: 0; }
}
@media (max-width: 820px) {
  body.aix .app { grid-template-columns: minmax(0, 1fr); }
  body.aix .sidebar { position: fixed; z-index: 1050; left: 0; top: 0; bottom: 0; width: 280px; background: var(--bg); transform: translateX(-105%); align-items: stretch; padding: 16px; transition: transform .25s; }
  body.aix .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  body.aix .sidebar .brand-text, body.aix .sidebar .switcher .meta, body.aix .sidebar .search span, body.aix .sidebar .nav-label,
  body.aix .sidebar .nav-item span, body.aix .sidebar .me-meta { display: block; }
  body.aix .sidebar .nav-label { display: flex; }
  body.aix .sidebar .switcher, body.aix .sidebar .search { width: 100%; justify-content: flex-start; }
  body.aix .sidebar .nav .nav-item { justify-content: flex-start; padding: 7px 10px; }
  body.aix .sidebar .sidebar-foot { flex-direction: row; }
  body.aix .sheet { margin: 0; border-radius: 0; border: 0; }
  body.aix .mob-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
  body.aix .context { padding: 10px 14px; }
  body.aix #content.section { padding: 16px 14px; }
  body.aix .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { body.aix * { animation: none !important; transition: none !important; } }

/* AIPB buttons use !important colours; v2 equivalents */
body.aix .btn-add, body.aix.dark-mode .btn-add { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; height: 34px; border-radius: 9px; padding: 0 13px; }
body.aix .btn-add svg *, body.aix.dark-mode .btn-add svg * { fill: #fff; }
body.aix .btn-edit, body.aix.dark-mode .btn-edit, body.aix .btn-delete, body.aix.dark-mode .btn-delete {
  background: transparent !important; border-color: transparent !important; color: var(--muted) !important; }
body.aix .btn-edit svg *, body.aix.dark-mode .btn-edit svg *, body.aix .btn-delete svg *, body.aix.dark-mode .btn-delete svg * { fill: currentColor; }
body.aix .btn-edit:hover { background: var(--surface-3) !important; color: var(--text) !important; opacity: 1; }
body.aix .btn-delete:hover { background: var(--danger-soft) !important; color: var(--danger) !important; opacity: 1; }
body.aix .icon-btn-only { min-width: 32px; min-height: 32px; padding: 0; }
/* checkbox / radio rows inside forms */
body.aix .form-group label:has(> input[type=checkbox]), body.aix .form-group label:has(> input[type=radio]) {
  display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); margin: 4px 0; }
body.aix .form-group label > input[type=checkbox], body.aix .form-group label > input[type=radio] { width: auto; margin: 0; }
body.aix .me-meta span { white-space: nowrap; }
body.aix .btn-edit svg.lucide *, body.aix .btn-delete svg.lucide *, body.aix .icon-btn svg.lucide * { fill: none !important; }

/* AIPB UI Texts: collapsible sections (inline colours in admin.js) */
body.aix .ui-section-group { margin-top: 10px !important; }
body.aix .ui-section-header { background: var(--surface-2) !important; color: var(--text) !important; border: 1px solid var(--border); border-radius: 10px !important;
  padding: 10px 14px !important; margin: 0 0 8px !important; font-size: 14px; font-weight: 600; }
body.aix .ui-section-header.ui-section-expanded { background: var(--accent-soft) !important; color: var(--accent-text) !important; border-color: transparent; }
body.aix .ui-section-content { margin-bottom: 8px; }
body.aix .form-group input[type=checkbox], body.aix .form-group input[type=radio] { width: auto !important; height: auto; display: inline-block; margin: 4px 0; }
body.aix .section-header { justify-content: flex-start; }
body.aix .section-header > h2 { margin-right: auto; }
body.aix .sales-hub-toggle { background: var(--surface-2) !important; border: 1px solid var(--border); border-radius: var(--radius-lg) !important; }

/* project devices (H16) */
body.aix .slots { display: flex; gap: 6px; flex-wrap: wrap; }
body.aix .slots i { width: 26px; height: 8px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border); }
body.aix .slots i.u { background: var(--accent); border-color: var(--accent); }
body.aix .slots i.p { background: var(--accent-soft); border-color: var(--accent-2); border-style: dashed; }
body.aix .dstate { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
body.aix .dstate .si { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); flex: none; }
body.aix .dstate .si svg.lucide { width: 16px; height: 16px; }
body.aix .dstate b { display: block; font-weight: 600; font-size: 13px; }
body.aix .dstate small { color: var(--muted); font-size: 12px; }
body.aix .dstate.busy .si { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
body.aix .dstate.down { background: var(--warning-soft); border-color: transparent; }
body.aix .dstate.down .si { color: var(--warning); }
/* last screenshot behind the state (H51): a veil in the surface colour keeps the text readable, the state
   tint (offline = warning) stays on top; without color-mix the declaration is dropped and nothing changes */
body.aix .dstate.has-shot {
  --dstate-veil: color-mix(in srgb, var(--surface-2) 70%, transparent);
  --dstate-tint: transparent;
  background-image: linear-gradient(var(--dstate-tint), var(--dstate-tint)), linear-gradient(var(--dstate-veil), var(--dstate-veil)), var(--shot);
  /* per layer: tint and veil fill the block, the screenshot 33% wide in the middle */
  background-size: 100% 100%, 100% 100%, 33%;
  background-position: center center;
  background-repeat: no-repeat;
}
/* errors in the last hour: red tint when online (offline keeps its warning tint), label in the corner */
body.aix .dstate { position: relative; }
body.aix .dstate.err:not(.down) { background-color: var(--danger-soft); border-color: transparent; }
body.aix .dstate.err:not(.down) .si { color: var(--danger); }
body.aix .dstate.has-shot.err:not(.down) { --dstate-tint: color-mix(in srgb, var(--danger) 20%, transparent); }
body.aix .dstate-err { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; border: 0;
  background: var(--danger); color: #fff; font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.4; cursor: pointer; white-space: nowrap; }
body.aix .dstate-err svg.lucide { width: 12px; height: 12px; }
body.aix .dstate .dstate-err { position: absolute; top: 10px; right: 10px; }
body.aix td .dstate-err { margin-top: 4px; }
/* device tiles: one height with or without a screenshot, text at the bottom (the top of the screen shows) */
body.aix .tile .dstate { min-height: 168px; align-items: flex-end; }
body.aix .dstate.has-shot.down { --dstate-tint: color-mix(in srgb, var(--warning) 20%, transparent); }
body.aix .dstate.has-shot.busy { --dstate-tint: color-mix(in srgb, var(--accent) 10%, transparent); }
body.aix .counters { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; border: 1px solid var(--border); border-radius: 10px; }
body.aix .counters div { padding: 7px 4px; }
body.aix .counters div + div { border-left: 1px solid var(--border); }
body.aix .counters b { display: block; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
body.aix .counters span { font-size: 11px; color: var(--muted); }
body.aix .counters .err b { color: var(--danger); }
body.aix .health { display: flex; gap: 6px; flex-wrap: wrap; }
body.aix .hw { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 8px; font-size: 11.5px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); }
body.aix .hw.warn { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
body.aix .lasterr { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
body.aix .lasterr svg.lucide { width: 15px; height: 15px; color: var(--warning); }
body.aix .callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text-2); margin-bottom: 14px; }
body.aix .callout.warn { background: var(--warning-soft); }
body.aix .callout.warn svg.lucide { color: var(--warning); }
body.aix .code-input { font-family: "JetBrains Mono", monospace; font-size: 20px !important; letter-spacing: .2em; text-transform: uppercase; }
body.aix .code-big { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
body.aix .code-big span { width: 34px; height: 46px; border-radius: 9px; border: 1px solid var(--border); display: grid; place-items: center; font: 600 22px "JetBrains Mono", monospace; background: var(--surface-2); }
body.aix .code-big .sep { align-self: center; color: var(--dim); }

/* AIPB dashboard */
body.aix .stats-grid { gap: 14px; }
body.aix .stat-card, body.aix.dark-mode .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; padding: 16px 18px; gap: 4px; }
body.aix .stat-card svg { width: 26px; height: 26px; color: var(--muted); }
body.aix .stat-card-value, body.aix.dark-mode .stat-card-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
body.aix .stat-card-cost .stat-card-value { color: var(--accent-text); }
body.aix .stat-card-success .stat-card-value { color: var(--success); }
body.aix .stat-card-failed .stat-card-value { color: var(--danger); }
body.aix .stat-card-label { color: var(--muted); font-size: 12.5px; }
body.aix .btn-print, body.aix .btn-print:hover { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
body.aix .btn-print svg, body.aix .btn-print svg * { width: 16px; height: 16px; stroke: currentColor; }
body.aix .btn-reset-stats { display: none !important; }  /* costs are kept for invoicing; no reset in AI Experience */
body.aix #dashboard-device-filter { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; border-radius: 9px !important; }
body.aix #content label[style*="color: #ddd"] { color: var(--muted) !important; font-weight: 500 !important; font-size: 12.5px; }
body.aix .chart-container, body.aix.dark-mode .chart-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; }

/* Overview dashboard v2 */
body.aix .aix-select { height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13.5px; }
body.aix .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
body.aix .kpi { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; }
body.aix .kpi-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
body.aix .kpi-ico svg.lucide { width: 20px; height: 20px; }
body.aix .kpi-body { min-width: 0; flex: 1; }
body.aix .kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
body.aix .kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
body.aix .kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.aix .kpi .meter { margin-top: 8px; height: 6px; }
body.aix .kpis-sm .kpi { padding: 12px 14px; align-items: center; }
body.aix .kpis-sm .kpi-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); }
body.aix .kpis-sm .kpi-ico svg.lucide { width: 16px; height: 16px; }
body.aix .kpis-sm .kpi-value { font-size: 18px; }
body.aix .kpis-sm .kpi-body { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 8px; }
body.aix .kpis-sm .kpi-sub { grid-column: 1 / -1; margin-top: 0; }
body.aix .dgrid { display: grid; gap: 14px; margin-bottom: 14px; }
body.aix .dgrid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
body.aix .dgrid-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.aix .dcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; display: flex; flex-direction: column; }
body.aix .dcard > header { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
body.aix .dcard > header h3 { font-size: 14.5px; font-weight: 600; margin: 0; }
body.aix .dcard > header .muted { font-size: 12px; margin-left: auto; }
body.aix .dcard-body { padding: 16px 18px; flex: 1; }
body.aix .dcard-table .dcard-body { padding: 0; }
body.aix .table-wrapper.flat { border: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
body.aix .chart-box { position: relative; height: 240px; }
body.aix .donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; height: 100%; }
body.aix .donut { position: relative; width: 168px; height: 168px; flex: none; }
body.aix .donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
body.aix .donut-center b { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
body.aix .donut-center span { font-size: 12px; color: var(--muted); }
body.aix .donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 150px; }
body.aix .donut-legend li { display: grid; grid-template-columns: 10px 16px 1fr auto auto; align-items: center; gap: 8px; font-size: 13px; }
body.aix .donut-legend i { width: 10px; height: 10px; border-radius: 50%; }
body.aix .donut-legend svg.lucide { width: 15px; height: 15px; color: var(--muted); }
body.aix .donut-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
body.aix .donut-legend .muted { font-size: 12px; min-width: 42px; text-align: right; }
body.aix .barlist { display: grid; gap: 14px; }
body.aix .barlist-top { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; font-size: 13px; }
body.aix .barlist-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.aix .barlist-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.aix .barlist-value .muted { font-weight: 400; font-size: 12px; }
body.aix .barlist-track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
body.aix .barlist-track i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
body.aix .barlist.danger .barlist-track i { background: var(--danger); }
body.aix .empty-note { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }
body.aix .pill svg.lucide { width: 13px; height: 13px; }
@media (max-width: 1180px) { body.aix .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.aix .dgrid-2-1, body.aix .dgrid-1-1 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { body.aix .kpis { grid-template-columns: minmax(0, 1fr); } body.aix .kpis-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { body.aix .sidebar, body.aix .context, body.aix .section-header .btn, body.aix .aix-select { display: none !important; } body.aix .app { display: block; } body.aix .sheet { margin: 0; border: 0; } }

/* public access */
body.aix .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
body.aix .plain-list li { display: flex; align-items: center; gap: 8px; }
body.aix .plain-list svg.lucide { width: 15px; height: 15px; color: var(--muted); }
body.aix .kv-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; font-size: 13px; margin-bottom: 6px; }
body.aix .kv-row b { font-variant-numeric: tabular-nums; }
body.aix .snippet { white-space: pre-wrap; word-break: break-all; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 12px; margin: 0 0 8px; color: var(--text); }
body.aix .chan { display: inline-flex; gap: 4px; }
body.aix .chan .pill { padding: 1px 7px; }

/* Overview filters (client-wide view, H18) */
body.aix .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 18px; }
body.aix .filters .aix-select, body.aix .filters input[type=date] { width: auto; min-width: 0; height: 34px; padding: 0 10px; font-size: 13px; margin: 0; }
body.aix .filters .lbl { font-size: 12px; color: var(--muted); margin-right: -2px; }
body.aix .filters .sep { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }
body.aix .multi { position: relative; }
body.aix .multi > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; cursor: pointer; color: var(--text); }
body.aix .multi > summary::-webkit-details-marker { display: none; }
body.aix .multi > summary svg { width: 15px; height: 15px; color: var(--muted); }
body.aix .multi[open] > summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body.aix .multi .menu { position: absolute; z-index: 30; top: 40px; left: 0; min-width: 260px; max-height: 320px; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
body.aix .multi .menu label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; margin: 0; font-weight: 400; }
body.aix .multi .menu label:hover { background: var(--surface-3); }
body.aix .multi .menu input { width: auto; margin: 0; accent-color: var(--accent); }
body.aix .multi .menu .menu-actions { display: flex; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--border); margin-top: 4px; }
body.aix .multi .menu .menu-actions button { font-size: 12px; padding: 4px 8px; }
body.aix .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
body.aix .scope-note { font-size: 12.5px; color: var(--muted); margin: -10px 0 16px; }
@media (max-width: 640px) { body.aix .filters .sep { display: none; } body.aix .multi .menu { min-width: 220px; } }
body.aix .btn.btn-link { background: none; border: 0; box-shadow: none; color: var(--accent-text); padding: 0 6px; height: 34px; }
body.aix .btn.btn-link:hover { text-decoration: underline; }
body.aix .multi .menu { min-width: 340px; }
body.aix .multi .menu label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.aix .filters .aix-select { max-width: 240px; }
/* "When AI keys fail" card (H23) */
body.aix .fallback label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 0; cursor: pointer; }
body.aix .fallback label.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
body.aix .fallback label.check + label.check { margin-top: 12px; }
body.aix .fallback select { max-width: 360px; }
/* AI output (H24/H25) */
body.aix .output .opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
body.aix .output label.opt { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-weight: 400; margin: 0; position: relative; }
body.aix .output label.opt input { position: absolute; top: 12px; right: 12px; accent-color: var(--accent); width: auto; margin: 0; }
/* the number field of "Other amount" (H65) is part of the card's text, not its radio button */
body.aix .output label.opt input[type="number"] { position: static; width: 6.5rem; padding: 4px 8px; margin-right: 6px; }
body.aix .output label.opt .aix-custom-amount { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
body.aix .output label.opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body.aix .output label.opt.off { opacity: .55; cursor: default; }
body.aix .output label.opt span { font-size: 12.5px; }
body.aix .output .fmt-group { margin-bottom: 10px; }
body.aix .output .fmt-group > .muted { font-size: 12px; margin-bottom: 6px; }
body.aix .output .fmt-row { display: flex; flex-wrap: wrap; gap: 8px; }
body.aix .output label.fmt { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 66px; padding: 10px 8px 8px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-weight: 400; margin: 0; font-size: 12.5px; }
body.aix .output label.fmt input { display: none; }
body.aix .output label.fmt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
body.aix .output label.fmt em { font-style: normal; font-size: 10.5px; color: var(--muted); }
body.aix .output .shape { display: block; border: 2px solid currentColor; border-radius: 3px; opacity: .7; }
body.aix .output label.chipcheck { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-weight: 400; margin: 0; font-size: 12.5px; cursor: pointer; }
body.aix .output label.chipcheck input { width: auto; margin: 0; accent-color: var(--accent); }
body.aix .output select { max-width: 520px; }
body.aix .output label.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 40px 12px 14px; }
body.aix .output label.opt > span, body.aix .output label.opt > b { display: block; white-space: nowrap; }
body.aix .output label.opt { text-align: left; align-items: flex-start; }

/* Diagnostics of a kiosk (H44) */
body.aix .modal-content.wide { width: min(980px, calc(100vw - 20px)); }
body.aix .diag-health { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 12px; background: var(--success-soft); }
body.aix .diag-health.warn { background: var(--warning-soft); }
body.aix .diag-health.error { background: var(--danger-soft); }
body.aix .diag-health > svg.lucide { width: 20px; height: 20px; flex: none; color: var(--success); }
body.aix .diag-health.warn > svg.lucide { color: var(--warning); }
body.aix .diag-health.error > svg.lucide { color: var(--danger); }
body.aix .diag-health ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
body.aix .diag-health small { display: block; color: var(--text-2); }
body.aix .diag-net { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
body.aix .diag-net > div:first-child { flex: 1 1 260px; min-width: 0; }
body.aix .diag-spark { color: var(--accent); flex: none; }
body.aix .diag-actions { display: flex; gap: 8px; flex-wrap: wrap; }
body.aix .diag-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
body.aix .diag-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
body.aix .diag-tabs button { border: 1px solid var(--border); background: none; color: var(--text-2); border-radius: 9px; padding: 6px 12px; cursor: pointer; font: inherit; }
body.aix .diag-tabs button.on { background: var(--surface-3); color: var(--text); font-weight: 600; }
body.aix .diag-bar select { width: auto; }
body.aix .diag-filter { margin-bottom: 10px; }
body.aix .diag-filter button { padding: 4px 10px; font-size: 12.5px; }
body.aix .diag-table td { vertical-align: top; font-size: 13px; }
body.aix .diag-table td.nowrap { white-space: nowrap; }
body.aix .diag-table tr.error td { background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }
body.aix .diag-table tr.warn td { background: color-mix(in srgb, var(--warning-soft) 50%, transparent); }
body.aix .diag-table tr.diag-detail td { background: var(--surface-2, var(--surface-3)); }
body.aix .lvl { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
body.aix .lvl.warn { background: var(--warning-soft); color: var(--warning); }
body.aix .lvl.error { background: var(--danger-soft); color: var(--danger); }
body.aix .diag-attempt { padding: 6px 0; border-bottom: 1px dashed var(--border); }
body.aix .diag-attempt:last-child { border-bottom: 0; }
body.aix .diag-attempt pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; max-height: 260px; overflow: auto; }

/* device actions: one row of icons with tooltips (look, management | move, rename, remove) */
body.aix .tile .dev-actions { flex-direction: column; align-items: stretch; gap: 8px; }
body.aix .dev-act-more { display: flex; align-items: center; gap: 6px; }
body.aix .dev-act-more .sp { flex: 1; }
body.aix .dev-act-more .icon-btn.is-set { color: var(--success, var(--accent)); }
body.aix td .dev-act-more { display: inline-flex; gap: 6px; vertical-align: middle; }
body.aix td .dev-act-more .sp { display: none; }

/* delete / archive / erase choice (H45) */
body.aix label.end-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; }
body.aix label.end-opt input { width: auto; margin-top: 3px; accent-color: var(--danger); }
body.aix label.end-opt span { display: flex; flex-direction: column; gap: 2px; }
body.aix label.end-opt small { color: var(--text-2); }

/* per-kiosk screensaver switch on the device tile */
body.aix .ss-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
body.aix .ss-switch input { width: auto; margin: 0; accent-color: var(--accent); }

/* reference images of a style prompt: badge with a count, thumbnails in a popover on hover / focus */
body.aix .aix-ref-badge { position: relative; display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; font-weight: 500; vertical-align: middle; cursor: default; }
body.aix .aix-ref-badge svg { width: 14px; height: 14px; }
body.aix .aix-ref-pop { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 50; padding: 10px; min-width: 180px; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }
body.aix .aix-ref-badge:hover .aix-ref-pop, body.aix .aix-ref-badge:focus .aix-ref-pop, body.aix .aix-ref-badge:focus-within .aix-ref-pop { display: block; }
body.aix .aix-ref-pop-title { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
body.aix .aix-ref-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
body.aix .aix-ref-thumbs figure { margin: 0; width: 72px; }
body.aix .aix-ref-thumbs img { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
body.aix .aix-ref-thumbs figcaption { margin-top: 3px; font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* price list editor (H58): five plans side by side without a horizontal page scroll */
body.aix #aix-price-table, body.aix #aix-price-preview table { table-layout: fixed; width: 100%; }
body.aix #aix-price-table th:first-child, body.aix #aix-price-table td:first-child { width: 230px; }
body.aix #aix-price-preview th:first-child, body.aix #aix-price-preview td:first-child { width: 170px; }
body.aix #aix-price-table td, body.aix #aix-price-table th, body.aix #aix-price-preview td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
body.aix #aix-price-table input.aix-price-in { box-sizing: border-box; width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; }
body.aix #aix-price-table input.aix-price-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
body.aix #aix-price-preview td b { white-space: nowrap; }

/* CMS → Try and Branding (H61) */
/* CMS → Try (H61): a three-step wizard like the photo booth */
body.aix .aix-try-lead { max-width: 760px; margin: -4px 0 18px; }
body.aix .aix-try { padding: 0; }  /* no overflow: hidden here: it breaks the sticky Generate bar */
body.aix .aix-try [hidden], body.aix .aix-brand [hidden] { display: none !important; }
body.aix .aix-try-steps { display: flex; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
body.aix .aix-try-steps li { flex: 1; position: relative; }
body.aix .aix-try-steps li + li::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 22px; transform: translateY(-50%); background: var(--border); }
body.aix .aix-try-steps button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 10px; border: 0; background: none; color: var(--muted); font-weight: 550; cursor: pointer; }
body.aix .aix-try-steps button:disabled { cursor: default; }
body.aix .aix-try-steps .n { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--border-strong); }
body.aix .aix-try-steps .n svg { width: 24px; height: 24px; }
body.aix .aix-try-steps li.current button { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
body.aix .aix-try-steps li.current .n { background: var(--accent); border-color: var(--accent); color: #fff; }
body.aix .aix-try-steps li.done button { color: var(--accent-text); }
body.aix .aix-try-steps li.done .n { border: 0; }
body.aix .aix-try-stage { padding: 24px; }
body.aix .aix-try-grid { display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: 28px; align-items: start; }
body.aix .aix-try-side h3 { margin: 0 0 6px; font-size: 15px; }
body.aix .aix-try-side h3 + * { margin-top: 0; }
body.aix .aix-try-side.wide h3:not(:first-child) { margin-top: 22px; }
body.aix .aix-try-frame { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-3); border: 1px dashed var(--border-strong); display: flex; align-items: center; justify-content: center; }
body.aix .aix-try-frame.live, body.aix .aix-try-frame.result, body.aix .aix-try-frame:has(> img) { border-style: solid; border-color: var(--border); }
body.aix .aix-try-frame.drop { border-color: var(--accent); background: var(--accent-soft); }
body.aix .aix-try-frame.small { width: 100%; max-width: 220px; }
body.aix .aix-try-frame > img, body.aix .aix-try-frame > video { width: 100%; height: 100%; object-fit: cover; display: block; }
body.aix .aix-try-frame img.loading { opacity: 0; }
body.aix .aix-try-frame img { transition: opacity .25s ease; }
body.aix .aix-try-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; text-align: center; color: var(--muted); }
body.aix .aix-try-empty > svg { width: 40px; height: 40px; color: var(--dim); margin-bottom: 4px; }
body.aix .aix-try-empty b { color: var(--text); font-size: 15px; }
body.aix .aix-try-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
body.aix .aix-try-empty-actions label.btn { cursor: pointer; }
body.aix .aix-try-empty.bad > svg { color: var(--danger); }
body.aix .aix-try-shutter { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.35); box-shadow: 0 2px 12px rgba(0,0,0,.35); cursor: pointer; }
body.aix .aix-try-shutter:hover { background: rgba(255,255,255,.6); }
body.aix .aix-try-shutter:active { transform: translateX(-50%) scale(.94); }
body.aix .aix-try-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
body.aix .aix-try-actions.column { flex-direction: column; align-items: stretch; max-width: 260px; }
body.aix .aix-try-actions label.btn { cursor: pointer; }
body.aix .aix-try-consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); margin: 6px 0 14px; cursor: pointer; }
body.aix .aix-try-consent input { margin-top: 3px; }
body.aix .aix-try-next svg { margin: 0 0 0 6px; }
body.aix .aix-try-side small { display: block; margin-top: 6px; }
body.aix .aix-try-summary { display: flex; flex-direction: column; gap: 10px; align-items: stretch; position: sticky; top: 16px; max-width: 260px; }
body.aix .aix-try-summary .btn-link { align-self: flex-start; }
body.aix .aix-try-picked { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 4px 0 0; font-size: 13px; }
body.aix .aix-try-picked dt { color: var(--muted); }
body.aix .aix-try-picked dd { margin: 0; font-weight: 550; }
body.aix .aix-try-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
body.aix .aix-try-style { padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; text-align: left; cursor: pointer; color: var(--text); transition: border-color .15s, box-shadow .15s; }
body.aix .aix-try-style:hover { border-color: var(--border-strong); }
body.aix .aix-try-style.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 1px var(--accent); }
/* a compact button: the style's colour (the kiosk gradient) or its thumbnail as a narrow strip on the left */
body.aix .aix-try-style { display: flex; align-items: stretch; min-height: 42px; }
body.aix .aix-try-style .thumb { display: block; width: 6px; flex: none; }
body.aix .aix-try-style .thumb.has-img { width: 40px; }
body.aix .aix-try-style .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.aix .aix-try-style .name { display: flex; align-items: center; padding: 7px 10px; font-size: 13px; font-weight: 550; line-height: 1.25; }
body.aix .aix-back-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); }
body.aix .aix-try-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
body.aix .aix-try-type { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-align: left; color: var(--text); cursor: pointer; }
body.aix .aix-try-type small { grid-column: 1 / -1; color: var(--muted); margin: 0; }
body.aix .aix-try-type .cost { color: var(--accent-text); font-weight: 600; font-size: 13px; }
body.aix .aix-try-type.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
body.aix .aix-try-type:disabled { opacity: .55; cursor: not-allowed; }
body.aix .aix-try-logo { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); max-width: 520px; }
body.aix .aix-try-logo small { margin: 0; }
body.aix .aix-try-logo-img { width: 72px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: repeating-conic-gradient(var(--surface-3) 0% 25%, transparent 0% 50%) 50% / 10px 10px; }
body.aix .aix-try-logo-img img { max-width: 64px; max-height: 38px; }
body.aix .aix-try-logo.empty svg { width: 28px; height: 28px; color: var(--dim); flex: none; }
body.aix .aix-try-admin { margin-top: 14px; max-width: 520px; }
body.aix .aix-try-admin summary { cursor: pointer; color: var(--muted); font-size: 13px; }
body.aix .aix-try-admin select { width: 100%; margin-top: 8px; }
body.aix .aix-try-go { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
body.aix .aix-try-go .btn { justify-content: center; }
body.aix .aix-try-go small { margin: 0; font-size: 12px; }
body.aix .aix-try-cost { display: flex; gap: 6px; align-items: center; color: var(--success); font-weight: 550; }
body.aix .aix-try-cost svg { width: 18px; height: 18px; }
/* waiting: the original photo dimmed behind a loader and the stage */
body.aix .aix-try-ghost { position: absolute; inset: 0; filter: blur(6px) saturate(.7); opacity: .45; transform: scale(1.05); }
body.aix .aix-try-wait { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; text-align: center; font-weight: 550; }
body.aix .aix-try-wait small { font-weight: 400; color: var(--muted); max-width: 240px; }
body.aix .aix-try-wait svg { width: 30px; height: 30px; color: var(--accent); }
body.aix .aix-try-wait.overlay { position: absolute; inset: 0; justify-content: center; z-index: 0; }
body.aix svg.spin { animation: aix-spin 1s linear infinite; }
@keyframes aix-spin { to { transform: rotate(360deg); } }
body.aix .aix-try-bar { width: 200px; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
body.aix .aix-try-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
body.aix .aix-try-bar.indeterminate i { width: 40% !important; animation: aix-indet 1.4s ease-in-out infinite; }
@keyframes aix-indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
/* before / after slider */
/* Try result (H78): the photo small, like a print laid on the table, the result large next to it */
body.aix .aix-try-done { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 28px; align-items: start; }
body.aix .aix-try-pair { display: grid; grid-template-columns: minmax(84px, 24%) auto minmax(0, 1fr); align-items: center; gap: 14px; }
body.aix .aix-try-pair.solo { grid-template-columns: minmax(0, 1fr); }
body.aix .aix-try-pair figure { margin: 0; }
body.aix .aix-try-orig { padding: 7px 7px 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); transform: rotate(-3deg); }
body.aix .aix-try-orig img { display: block; width: 100%; border-radius: 3px; }
body.aix .aix-try-orig figcaption { padding: 5px 0 1px; text-align: center; font-size: 11px; color: var(--muted); }
body.aix .aix-try-flow { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--accent); }
body.aix .aix-try-flow span { max-width: 90px; font-size: 11px; font-weight: 600; text-align: center; color: var(--text-2, var(--muted)); }
body.aix .aix-try-flow svg { width: 26px; height: 26px; }
body.aix .aix-try-out { position: relative; min-height: 120px; }
body.aix .aix-try-out img { display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--radius-lg); background: var(--surface-3); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); transition: opacity .25s ease; }
body.aix .aix-try-out img.loading { opacity: 0; }
body.aix .aix-try-out .aix-try-wait.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
body.aix .aix-try-out figcaption { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; }
body.aix .aix-try-tried { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 1.5; margin: 6px 0 10px; }
body.aix .aix-try-tried svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
@media (max-width: 760px) {
  body.aix .aix-try-done { grid-template-columns: 1fr; gap: 18px; }
  body.aix .aix-try-pair { grid-template-columns: 1fr; justify-items: center; }
  body.aix .aix-try-orig { width: 120px; }
  body.aix .aix-try-flow svg { transform: rotate(90deg); }
}
/* recent tests */
body.aix .aix-try-recent { margin-top: 24px; }
body.aix .aix-try-recent h3 { font-size: 15px; margin: 0 0 10px; }
body.aix .aix-try-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
body.aix .aix-try-shot { padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; text-align: left; cursor: pointer; color: var(--text); }
body.aix .aix-try-shot:hover { border-color: var(--accent-2); }
body.aix .aix-try-shot > img, body.aix .aix-try-shot .state { display: flex; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
body.aix .aix-try-shot .state { flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface-3); color: var(--muted); font-size: 12px; }
body.aix .aix-try-shot .state svg { width: 22px; height: 22px; }
body.aix .aix-try-shot .state.bad { color: var(--danger); }
body.aix .aix-try-shot .cap { display: block; padding: 7px 40px 7px 9px; }
body.aix .aix-try-shot .cap b { display: block; font-size: 13px; }
body.aix .aix-try-shot .cap small { color: var(--muted); font-size: 11px; }
body.aix .aix-try-tile { position: relative; }
body.aix .aix-try-tile > .aix-try-shot { width: 100%; }
body.aix .aix-try-del { position: absolute; bottom: 8px; right: 6px; background: var(--surface); opacity: .8; }  /* in the caption: never over the photo or its AI label */
body.aix .aix-try-del:hover, body.aix .aix-try-del:focus-visible { opacity: 1; color: var(--danger); }
body.aix .aix-try-recent-tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; }
@media (max-width: 860px) {
  body.aix .aix-try-stage { padding: 16px; }
  body.aix .aix-try-grid { grid-template-columns: 1fr; gap: 18px; }
  /* the photo frame leaves room on screen for the steps and the actions */
  body.aix .aix-try-frame:not(.small) { width: min(100%, 52vh * .8); margin: 0 auto; }
  body.aix .aix-try-drop-hint { display: none; }
  body.aix .aix-try-lead { font-size: 13px; margin-bottom: 12px; }
  /* the summary's pieces flow around the styles; Generate becomes a bar pinned to the bottom of the screen */
  body.aix .aix-try-grid:has(.aix-try-summary) { display: flex; flex-direction: column; }
  body.aix .aix-try-summary { display: contents; }
  body.aix .aix-try-frame.small { max-width: 96px; margin: 0; }
  body.aix .aix-try-picked { display: none; }
  body.aix .aix-try-go { order: 99; align-self: stretch; position: sticky; bottom: 0; z-index: 5; margin: 0 -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: 0 -6px 16px -8px rgba(0,0,0,.2); }
  body.aix .aix-try-go .btn { width: 100%; min-height: 44px; }
  body.aix .aix-try-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  body.aix .aix-try-style .name { font-size: 12px; padding: 6px 8px; }
  body.aix .aix-try-types { grid-template-columns: 1fr; }
  body.aix .aix-try-steps button { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 12px; }
  body.aix .aix-try-actions.column { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { body.aix svg.spin, body.aix .aix-try-bar.indeterminate i { animation-duration: 3s; } }
body.aix .aix-brand { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
body.aix .aix-brand .card { padding: 16px; }
body.aix .aix-logo-box { min-height: 120px; border: 1px dashed var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 12px; background: repeating-conic-gradient(var(--surface-3) 0% 25%, transparent 0% 50%) 50% / 16px 16px; }
body.aix .aix-logo-preview { max-width: 100%; max-height: 160px; }
body.aix .aix-ov-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, #6b8fb5, #2f4a68); }
body.aix .aix-ov-photo img { position: absolute; max-height: 25%; object-fit: contain; }
body.aix .aix-ov-badge { position: absolute; top: 2.4%; right: 2.4%; font-size: 10px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); padding: 3px 6px; border-radius: 4px; }

/* H62: the credit pools (CMS → Credits, console → client credits) */
body.aix .aix-pools { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; align-items: baseline; }
body.aix .aix-pools dt { color: var(--muted); }
body.aix .aix-pools dd { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
body.aix .aix-pools dd small { font-size: 12px; }
body.aix .modal .aix-pools { margin-bottom: 12px; }

/* H67: a reference image without a name (the shared prompt context goes by the names) */
body.aix .ref-item { flex-wrap: wrap; }
body.aix .ref-item .ref-label-warn { flex-basis: 100%; display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--warning); margin-top: 4px; }
body.aix .ref-item .ref-label-warn[hidden] { display: none; }
body.aix .ref-item .ref-label-warn svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
body.aix .aix-ref-badge.warn { color: var(--warning); border-color: currentColor; }

/* Start screen of a user without a project yet (aixNoProjectScreen) */
body.aix .aix-empty-start { max-width: 520px; margin: 12vh auto 0; text-align: center; }
body.aix .aix-empty-start .aix-empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft, rgba(124, 58, 237, .12)); color: var(--accent); margin-bottom: 1rem; }
body.aix .aix-empty-start .aix-empty-icon svg { width: 26px; height: 26px; }
body.aix .aix-empty-start h2 { margin: 0 0 .75rem; }
body.aix .aix-empty-start p { margin: 0 0 1rem; line-height: 1.55; }

/* New project (H72): one kind per row, the description wraps */
body.aix .output .opts.aix-kind-opts { grid-template-columns: 1fr; }
body.aix .output .aix-kind-opts label.opt > span, body.aix .output .aix-kind-opts label.opt > b { white-space: normal; }
body.aix .output .aix-kind-opts label.opt > b { display: flex; align-items: center; gap: 8px; }
body.aix .output .aix-kind-opts label.opt > b svg { width: 16px; height: 16px; flex: none; }

/* a short form in one row (label above each field): fields and buttons share one height and one baseline */
body.aix .aix-inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
body.aix .aix-inline-form .form-group { margin: 0; }
body.aix .aix-inline-form .form-group.grow { flex: 1 1 260px; max-width: 420px; }
body.aix .aix-inline-form .form-group label { display: block; margin-bottom: 6px; }
body.aix .aix-inline-form select, body.aix .aix-inline-form input, body.aix .aix-inline-form .btn { height: 40px; box-sizing: border-box; margin: 0; }
body.aix .aix-inline-form select { min-width: 170px; }

/* Console → Overview (H79) */
body.aix .ovw-alerts { display: grid; gap: 8px; margin-bottom: 14px; }
body.aix .ovw-alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 550; }
body.aix .ovw-alert span { flex: 1; }
body.aix .ovw-alert.bad { background: var(--danger-soft, var(--surface)); border-color: var(--danger); }
body.aix .ovw-alert.bad svg:first-child { color: var(--danger); }
body.aix .ovw-alert.warn { background: var(--warning-soft); border-color: transparent; }
body.aix .ovw-alert.warn svg:first-child { color: var(--warning); }
body.aix .ovw-alert.ok svg { color: var(--success); }
body.aix a.ovw-alert:hover { border-color: var(--accent-2); }
body.aix .ovw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
body.aix .ovw-grid .ovw-wide { grid-column: span 2; }
body.aix .ovw-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end; height: 170px; padding-top: 8px; position: relative; }
body.aix .ovw-chart-note { position: absolute; inset: 0 0 22px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; pointer-events: none; }
body.aix .ovw-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
body.aix .ovw-col i { display: block; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 0; }
body.aix .ovw-col:hover i { background: var(--accent-2); }
body.aix .ovw-col span { margin-top: 4px; font-size: 10px; color: var(--muted); text-align: center; }
body.aix .ovw-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
body.aix .ovw-facts b { color: var(--text); margin-left: 4px; }
body.aix .ovw-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
body.aix .ovw-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; }
body.aix .ovw-list li .muted { grid-column: 1; font-size: 12px; }
body.aix .ovw-list li > span:last-child { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 600; }
body.aix .bad { color: var(--danger); }
body.aix .warn { color: var(--warning); }
body.aix .ovw-plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; text-align: center; }
body.aix .ovw-plans b { display: block; font-size: 20px; }
body.aix .ovw-plans span { font-size: 11px; color: var(--muted); }
body.aix .ovw-money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.aix .ovw-money span { display: block; font-size: 12px; color: var(--muted); }
body.aix .ovw-money b { font-size: 18px; }
body.aix .ovw-money small { color: var(--muted); font-weight: 500; }
body.aix .ovw-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 13px; font-weight: 600; }
body.aix .ovw-more svg { width: 14px; height: 14px; }
body.aix .ovw-links { display: flex; gap: 16px; }
@media (max-width: 1100px) { body.aix .ovw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  body.aix .ovw-grid { grid-template-columns: 1fr; }
  body.aix .ovw-grid .ovw-wide { grid-column: auto; }
  body.aix .ovw-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Try → Test log (platform admins, H83): collapsed by default, like a device's diagnostics */
body.aix .aix-try-log { margin-top: 18px; padding: 0; }
body.aix .aix-try-log > summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 18px; cursor: pointer; list-style: none; }
body.aix .aix-try-log > summary::-webkit-details-marker { display: none; }
body.aix .aix-try-log > summary svg { width: 16px; height: 16px; }
body.aix .aix-try-log > summary .muted { font-size: 12px; }
body.aix .aix-try-log[open] > summary { border-bottom: 1px solid var(--border); }
body.aix #aix-try-log { padding: 12px 18px 16px; }
body.aix .aix-try-log .diag-detail details > summary { cursor: pointer; font-size: 12px; color: var(--muted); }

/* a call's request and answer (H85), in the device diagnostics and Try → Test log */
body.aix .diag-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 18px; margin: 8px 0; }
body.aix .diag-io h5 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
body.aix .diag-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 10px; margin: 0; font-size: 12px; }
body.aix .diag-kv dt { color: var(--muted); }
body.aix .diag-kv dd { margin: 0; overflow-wrap: anywhere; }
body.aix .diag-kv pre { margin: 0; white-space: pre-wrap; font-size: 12px; max-height: 220px; overflow: auto; }
body.aix .aix-try-log .diag-table { table-layout: fixed; width: 100%; }
body.aix .aix-try-log .diag-table th:nth-child(1) { width: 112px; }
body.aix .aix-try-log .diag-table th:nth-child(5) { width: 72px; }
body.aix .aix-try-log .diag-table td { overflow-wrap: anywhere; }
body.aix .aix-try-log .diag-table .cell-sub { white-space: normal; }

/* Try → waiting (H87): steps scroll up and tick off over the dimmed photo, after codepen.io/hoqqanen/pen/zvqGEG */
body.aix .aix-try-loader { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; width: 100%; }
body.aix .aix-try-loader::before { content: ""; position: absolute; inset: -40% -20%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 42%, transparent), transparent 75%); opacity: .55; }
body.aix .aix-try-loader-list { height: calc(44px * 4); width: min(300px, 100%); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%); }
body.aix .aix-try-loader-list ul { list-style: none; margin: 0; padding: calc(44px * 1.5) 0 0; will-change: transform; }
body.aix .aix-try-loader-list li { display: flex; align-items: center; gap: 12px; height: 44px; font-size: 15px; font-weight: 550; color: var(--text); opacity: .55; transition: opacity .4s ease; }
body.aix .aix-try-loader-list li.now, body.aix .aix-try-loader-list li.done { opacity: 1; }
body.aix .aix-try-loader-list svg { width: 26px; height: 26px; flex: none; }
body.aix .aix-try-loader-list .ring { fill: none; stroke: currentColor; stroke-width: 2; opacity: .6; }
body.aix .aix-try-loader-list .fill { fill: var(--accent); opacity: 0; transition: opacity .45s ease; }
body.aix .aix-try-loader-list .check { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .45s ease .1s; }
body.aix .aix-try-loader-list li.done .fill { opacity: 1; }
body.aix .aix-try-loader-list li.done .ring { opacity: 0; }
body.aix .aix-try-loader-list li.done .check { stroke-dashoffset: 0; }
body.aix .aix-try-loader-list li.now:not(.done) .ring { stroke: var(--accent); opacity: 1; stroke-dasharray: 70 25; transform-origin: 16px 16px; animation: aix-spin 1.6s linear infinite; }
body.aix .aix-try-loader small { color: var(--muted); max-width: 260px; text-align: center; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { body.aix .aix-try-loader-list li.now:not(.done) .ring { animation: none; } }
body.aix .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.aix .aix-try-loader-list li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { body.aix .aix-try-loader-list li { font-size: 14px; } }
