/*
 * ACE Core UI System - Stage 3B reference skin (docs/design/acpanel-reference-*.jpg).
 * Loaded after every other ACPanel stylesheet. Colors, radii and shadows come only from
 * the --acs-* tokens below, defined for the light and the dark theme; the older --ace-*
 * and short aliases are pointed at them so existing components follow the same palette.
 */

:root {
    --acs-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    /* (Stage 1.16e, round 6, Eduard: variant C: the font above is the system's, Segoe UI, SF, Roboto; Inter is no longer loaded.) */
    /* Stage 1.16e (round 5, Eduard: "totul pare cam mare"; he chose scale C of ace-design/previzualizare-spatii.html): the panels' sizes,
       here only, so the scale (A, B or C) changes in one place. The text sizes are these six (the columns' names 11, in capitals); every
       stylesheet of the panels names them. */
    --acs-fs-xs: 11px;
    --acs-fs-sm: 12px;
    --acs-fs: 13px;
    --acs-fs-title: 15px;
    --acs-fs-section: 18px;
    --acs-fs-page: 22px;
    --acs-row-h: 36px;
    /* (Stage 1.16e, round 6: a table's row with a picture or two lines.) */
    --acs-row-media-h: 48px;
    --acs-field-h: 32px;
    --acs-btn-h: 30px;
    /* (Stage 1.16e, round 6: a tab, a pill of the section's bar, the submenu's links, the filters' pills.) */
    --acs-tab-h: 30px;
    --acs-card-pad: 16px;
    --acs-card-gap: 12px;
    --acs-row-action-w: 96px;
    --acs-form-label-w: 200px;
    /* (Stage 1.16e, round 6, the theme chat: the fields were narrow; a field takes its row's room up to 640.) */
    --acs-form-field-w: 640px;
    --acs-number-w: 120px;
    --acs-form-card-max: 800px;
    --acs-content-max: 1600px;
    --acs-radius: 14px;
    --acs-radius-sm: 12px;
    --acs-radius-xs: 6px;
    --acs-radius-pill: 999px;
    --acs-space-1: 4px;
    --acs-space-2: 8px;
    --acs-space-3: 12px;
    --acs-space-4: 16px;
    --acs-space-5: 20px;
    --acs-space-6: 24px;
    --acs-white: #ffffff;
    --acs-active-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    --acs-on-active-soft: rgba(15, 23, 42, 0.35);
    --acs-tag-bg: rgba(245, 158, 11, 0.16);
    --acs-tag-text: #fbbf24;
    --acs-count-bg: #dc2626;
    --acs-sidebar-card: rgba(255, 255, 255, 0.04);
    --acs-primary-gradient: linear-gradient(90deg, #0369a1 0%, #2563eb 55%, #1d4ed8 100%);
    --acs-primary-shadow: 0 8px 22px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    /* A light veil on the main blue (the tile of the menu's open section). */
    --acs-on-primary-soft: rgba(255, 255, 255, 0.22);
    --acs-focus-color: #38bdf8;
    /* Stage 1.16b (C-Sidebar): the A icon's light, the site's card's initials. */
    --acs-logo-glow: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.45));
    --acs-firm-initials: linear-gradient(135deg, #0369a1, #1d4ed8);
    /* Stage 1.16b (C-Topbar): the number of the automations (amber, its figure dark for 4.5:1), the account's green dot. */
    --acs-count-amber: #f59e0b;
    --acs-count-amber-text: #1c1917;
    --acs-online: #22c55e;
    /* Stage 1.16b (P-Panou-Telefon): the phone's top bar, one dark row in both themes. */
    --acs-phonebar-bg: #0a1020;
    --acs-phonebar-text: #f1f5f9;
    --acs-phonebar-line: #1c2a44;
    /* Stage 1.16b (C-Culoare): the hue's slider. */
    --acs-hue-rainbow: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

:root[data-ace-theme="light"],
:root[data-ace-theme="light"] body {
    --acs-bg: #f3f6fb;
    --acs-surface: #ffffff;
    --acs-surface-2: #f8fafc;
    --acs-border: #e5eaf2;
    --acs-border-strong: #7c8ba1;
    --acs-text: #0f172a;
    --acs-muted: #475569;
    --acs-subtle: #5b6b84;
    --acs-primary: #2563eb;
    /* Stage 1.16b (P-Panou-Edit-Widget): the faint line of an element one may choose, and the chosen one's ring. */
    --acs-chosen-soft: #bfdbfe;
    --acs-chosen-ring: rgba(37, 99, 235, 0.18);
    --acs-primary-hover: #1d4ed8;
    --acs-primary-text: #1d4ed8;
    --acs-on-primary: #ffffff;
    --acs-primary-soft: #e8f0fe;
    --acs-tab-active-bg: #2563eb;
    --acs-tab-active-text: #ffffff;
    --acs-sidebar: #ffffff;
    --acs-sidebar-2: #ffffff;
    --acs-sidebar-text: #334155;
    --acs-sidebar-muted: #5b6b84;
    --acs-sidebar-hover: rgba(37, 99, 235, 0.06);
    --acs-sidebar-line: #e5eaf2;
    --acs-header: #ffffff;
    /* (Stage 1.16e, round 6, Eduard: the badge of an icon of the top bar, Apple's red; on the light theme its accessible red, b): the
       white number reaches 4.5:1 there.) */
    --acs-badge-bg: #d70015;
    --acs-success: #15803d;
    --acs-success-soft: #dcfce7;
    --acs-warning: #b45309;
    --acs-warning-soft: #fef3c7;
    --acs-danger: #b91c1c;
    --acs-danger-soft: #fee2e2;
    /* Stage 1.3 (E1.3-T2): the red a button or a badge is filled with, under white text (6.5:1). */
    --acs-danger-solid: #b91c1c;
    --acs-info: #1d4ed8;
    --acs-info-soft: #dbeafe;
    --acs-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06);
    --acs-shadow-strong: 0 12px 32px rgba(15, 23, 42, 0.12);
    --acs-focus: 0 0 0 3px rgba(37, 99, 235, 0.25);
    --acs-sidebar-card: #f3f6fb;
    --acs-sidebar-strong: #0f172a;
    /* Stage 1.16b (C-Topbar): the ground of a pill of choices (the theme, the language). */
    --acs-segment-bg: #f1f5f9;
    /* Stage 1.16b (C-Sidebar): the menu's icons (in use / waiting), an open group's ground, the chosen page's, the site's card, the
       Builder's tile. */
    --acs-sidebar-icon: #0369a1;
    --acs-sidebar-icon-muted: #64748b;
    --acs-sidebar-group-open: #f1f5f9;
    --acs-sidebar-sub-active: #eef2f7;
    --acs-sidebar-firm: #f8fafc;
    --acs-sidebar-tile: linear-gradient(135deg, #e0f2fe, #dbeafe);
    --acs-sidebar-tile-border: #bae6fd;
    /* Stage 1.16b (C-Topbar): the bar's ground (seen through), the search's border, an open list's button. */
    --acs-topbar-bg: rgba(255, 255, 255, 0.85);
    --acs-search-border: #cbd5e1;
    --acs-topbar-open: #e0f2fe;
    --acs-tag-text: #92400e;
    --acs-glow: radial-gradient(900px 420px at 85% -12%, rgba(37, 99, 235, 0.07), transparent 60%);
}

:root[data-ace-theme="dark"],
:root[data-ace-theme="dark"] body {
    --acs-bg: #070c18;
    --acs-surface: #0c1424;
    --acs-surface-2: #0f172a;
    --acs-border: #1c2a44;
    --acs-border-strong: #52648a;
    --acs-text: #f1f5f9;
    --acs-muted: #94a3b8;
    --acs-subtle: #8193ae;
    --acs-primary: #2563eb;
    /* Stage 1.16b (P-Panou-Edit-Widget): the faint line of an element one may choose, and the chosen one's ring. */
    --acs-chosen-soft: rgba(56, 189, 248, 0.28);
    --acs-chosen-ring: rgba(37, 99, 235, 0.18);
    --acs-primary-hover: #1d4ed8;
    --acs-primary-text: #7dd3fc;
    --acs-on-primary: #ffffff;
    --acs-primary-soft: rgba(56, 189, 248, 0.14);
    --acs-tab-active-bg: #2563eb;
    --acs-tab-active-text: #ffffff;
    --acs-sidebar: #071226;
    --acs-sidebar-2: #050a15;
    --acs-sidebar-text: #cbd5e1;
    --acs-sidebar-muted: #8193ae;
    --acs-sidebar-hover: rgba(255, 255, 255, 0.06);
    --acs-sidebar-line: #13203a;
    --acs-header: #0a1020;
    /* Stage 1.16i: the badge's white number keeps 4.5:1 on dark too (#ff3b30 gave 3.55, RenderedContrastTest with a notification unread). */
    --acs-badge-bg: #d70015;
    --acs-sidebar-strong: #ffffff;
    --acs-segment-bg: #0c1424;
    --acs-sidebar-icon: #7dd3fc;
    --acs-sidebar-icon-muted: #94a3b8;
    --acs-sidebar-group-open: rgba(255, 255, 255, 0.04);
    --acs-sidebar-sub-active: rgba(255, 255, 255, 0.07);
    --acs-sidebar-firm: rgba(255, 255, 255, 0.03);
    --acs-sidebar-tile: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(37, 99, 235, 0.18));
    --acs-sidebar-tile-border: rgba(56, 189, 248, 0.22);
    --acs-topbar-bg: rgba(7, 12, 24, 0.72);
    --acs-search-border: #22324f;
    --acs-topbar-open: rgba(56, 189, 248, 0.14);
    --acs-success: #4ade80;
    --acs-success-soft: rgba(34, 197, 94, 0.15);
    --acs-warning: #fbbf24;
    --acs-warning-soft: rgba(245, 158, 11, 0.15);
    --acs-danger: #fca5a5;
    --acs-danger-soft: rgba(239, 68, 68, 0.15);
    /* The light red is for text on the dark background; white text on it was 2.8:1. */
    --acs-danger-solid: #b91c1c;
    --acs-info: #60a5fa;
    --acs-info-soft: rgba(59, 130, 246, 0.15);
    --acs-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 32px rgba(0, 0, 0, 0.28);
    --acs-shadow-strong: 0 16px 40px rgba(0, 0, 0, 0.4);
    --acs-focus: 0 0 0 3px rgba(56, 189, 248, 0.45);
    --acs-sidebar-card: rgba(255, 255, 255, 0.04);
    --acs-tag-text: #fbbf24;
    --acs-glow: radial-gradient(900px 420px at 85% -12%, rgba(37, 99, 235, 0.16), transparent 60%);
}

/* Older tokens and aliases follow the skin, so components not restyled below match it. */
:root[data-ace-theme],
:root[data-ace-theme] body {
    --ace-bg-page: var(--acs-bg);
    --ace-surface-1: var(--acs-surface);
    --ace-surface-2: var(--acs-surface-2);
    --ace-surface-3: var(--acs-surface-2);
    --ace-card-bg: var(--acs-surface);
    --ace-card-border: var(--acs-border);
    --ace-text: var(--acs-text);
    --ace-text-muted: var(--acs-muted);
    --ace-text-subtle: var(--acs-subtle);
    --ace-border-color: var(--acs-border);
    --ace-border-color-strong: var(--acs-border-strong);
    --ace-primary: var(--acs-primary);
    --ace-primary-hover: var(--acs-primary-hover);
    --ace-accent: var(--acs-primary);
    --ace-focus-ring: var(--acs-focus);
    --ace-card-radius: var(--acs-radius);
    --ace-button-radius: var(--acs-radius-sm);
    --ace-form-control-radius: var(--acs-radius-sm);
    --bg: var(--acs-bg);
    --bg-soft: var(--acs-surface-2);
    --panel: var(--acs-surface);
    --panel-soft: var(--acs-surface-2);
    --card: var(--acs-surface);
    --card-soft: var(--acs-surface-2);
    --border: var(--acs-border);
    --text: var(--acs-text);
    --muted: var(--acs-muted);
    --blue: var(--acs-primary);
    --success: var(--acs-success);
    --warning: var(--acs-warning);
    --danger: var(--acs-danger);
}

/* Page */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] {
    background: var(--acs-bg);
    color: var(--acs-text);
    font-family: var(--acs-font);
}

/* Sidebar: dark navy in both themes, solid blue for the active entry. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar {
    background: linear-gradient(180deg, var(--acs-sidebar) 0%, var(--acs-sidebar-2) 100%);
    border-right: 1px solid var(--acs-sidebar-line);
    box-shadow: none;
    color: var(--acs-sidebar-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-brand {
    border-bottom: 1px solid var(--acs-sidebar-line);
    background: transparent;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-collapse-hint {
    border-color: var(--acs-sidebar-line);
    background: var(--acs-sidebar-card);
    color: var(--acs-sidebar-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-brand strong {
    color: var(--acs-sidebar-strong);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-brand span {
    color: var(--acs-sidebar-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-single,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-group-toggle,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-submenu a,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-empty {
    background: transparent;
    border: 0;
    border-radius: var(--acs-radius-sm);
    box-shadow: none;
    color: var(--acs-sidebar-text);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-single:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-group-toggle:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-submenu a:hover {
    background: var(--acs-sidebar-hover);
    color: var(--acs-sidebar-strong);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-single.active,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-submenu a.active {
    background: var(--acs-primary);
    box-shadow: var(--acs-active-shadow);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-group.active > .acp-nav-group-toggle {
    color: var(--acs-sidebar-strong);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-submenu a.active .acp-nav-tag {
    background: var(--acs-on-active-soft);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: var(--acs-sidebar-muted);
    transition: transform 0.15s ease;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-chevron svg,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-star svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-group.open > .acp-nav-group-toggle .acp-nav-chevron {
    transform: rotate(90deg);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-tag {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 1px 7px;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-tag-bg);
    color: var(--acs-tag-text);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-count {
    flex: 0 0 auto;
    min-width: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-count-bg);
    color: var(--acs-white);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-row {
    position: relative;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-star {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    opacity: 0;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: var(--acs-sidebar-2);
    color: var(--acs-sidebar-muted);
    cursor: pointer;
}
/* Stage 1.3 (E1.3-T13e, decision 35): the star takes focus from the keyboard (display: none never could), shows on a
   phone (no hover there) and stays on for a pinned entry; hidden, it cannot be clicked. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-row:hover .acp-nav-star,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-row:focus-within .acp-nav-star,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-star.is-on {
    opacity: 1;
    pointer-events: auto;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-row:has(.acp-nav-star.is-on) > a {
    padding-right: 36px;
}
@media (hover: none) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-star {
        opacity: 1;
        pointer-events: auto;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-row > a {
        padding-right: 36px;
    }
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-star.is-on {
    color: var(--acs-tag-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-star.is-on svg {
    fill: currentColor;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-heading {
    margin: var(--acs-space-1) var(--acs-space-3) 6px;
    color: var(--acs-sidebar-muted);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-favorites {
    margin-bottom: var(--acs-space-2);
    padding-bottom: var(--acs-space-2);
    border-bottom: 1px solid var(--acs-sidebar-line);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-collapse-hint {
    border: 1px solid var(--acs-sidebar-line);
    border-radius: 12px;
    background: var(--acs-sidebar-2);
    color: var(--acs-sidebar-text);
}

/* Header */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header {
    background: var(--acs-header);
    border-bottom: 1px solid var(--acs-border);
    box-shadow: none;
    backdrop-filter: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-search {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface-2);
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-search input {
    background: transparent;
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-search kbd {
    border: 1px solid var(--acs-border);
    border-radius: 6px;
    background: var(--acs-surface);
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-button,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-icon-button,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-bell-button,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-select,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-button {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    box-shadow: none;
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-button:hover:not(:disabled),
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-icon-button:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-button:hover {
    border-color: var(--acs-primary);
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-segmented {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 3px;
    border: 1px solid var(--acs-border);
    border-radius: 999px;
    background: var(--acs-segment-bg);
}
/* Stage 1.16b (C-Topbar; DE-FACUT.md 0.1): the theme's pill (Automat · Luminos · Întunecat) and the language's (RO · EN): 36 px
   choices, the one in use in the main blue. The theme's is lit by the root (data-ace-theme-mode) before any script runs. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-segmented button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--acs-muted);
    font: 600 var(--acs-fs)/1 var(--acs-font);
    letter-spacing: 0.02em;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-segmented button:hover {
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-segmented button:focus-visible {
    outline: 2px solid var(--acs-focus-color);
    outline-offset: 1px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-segmented svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-segmented button[aria-pressed="true"],
:root[data-ace-theme-mode="system"] body[data-ace-theme-scope="acpanel"] .acp-theme-toggle [data-theme-set="system"],
:root[data-ace-theme-mode="light"] body[data-ace-theme-scope="acpanel"] .acp-theme-toggle [data-theme-set="light"],
:root[data-ace-theme-mode="dark"] body[data-ace-theme-scope="acpanel"] .acp-theme-toggle [data-theme-set="dark"] {
    background: var(--acs-primary-gradient);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-avatar {
    background: var(--acs-primary);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-copy strong {
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-copy small {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-menu {
    border: 1px solid var(--acs-border);
    border-radius: 12px;
    background: var(--acs-surface);
    box-shadow: var(--acs-shadow-strong);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-menu a,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-menu button {
    color: var(--acs-text);
}

/* Page head */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-kicker {
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-muted {
    color: var(--acs-muted);
}

/* Cards */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-card,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-report-card,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-side-card {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    box-shadow: var(--acs-shadow);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-card h2,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-card h3,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card strong {
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card small,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card span {
    color: var(--acs-muted);
}

/* Status labels */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pill {
    padding: 3px 9px;
    border: 0;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-info-soft);
    color: var(--acs-info);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pill.is-ok,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pill.success {
    background: var(--acs-success-soft);
    color: var(--acs-success);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pill.is-warning,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pill.warning {
    background: var(--acs-warning-soft);
    color: var(--acs-warning);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pill.is-error,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pill.is-danger {
    background: var(--acs-danger-soft);
    color: var(--acs-danger);
}

/* Tables */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content table {
    color: var(--acs-text);
}
/* Stage 1.16b: the columns' heads; a row's first cell (th scope="row", Ui::table) reads like the other cells. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) table th[scope="row"] {
    border-bottom: 1px solid var(--acs-border);
}
/* (Stage 1.16e, round 6, the theme chat: only the head's cells; a row's first cell written as th, without scope, was in a band of the head's
   colour.) */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) table th:not([scope="row"]):not(tbody th) {
    border-bottom: 1px solid var(--acs-border);
    background: var(--acs-surface-2);
    color: var(--acs-muted);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) table td {
    border-bottom: 1px solid var(--acs-border);
}

/* Forms and buttons */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) select,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) textarea {
    border: 1px solid var(--acs-border-strong);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content input:focus,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content select:focus,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content textarea:focus {
    border-color: var(--acs-primary);
    box-shadow: var(--acs-focus);
    outline: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-primary-button,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-primary-link,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) form button[type="submit"]:not(.danger):not(.is-danger) {
    border: 1px solid var(--acs-primary);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-primary);
    color: var(--acs-on-primary);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-primary-button:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-primary-link:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) form button[type="submit"]:not(.danger):not(.is-danger):hover {
    border-color: var(--acs-primary-hover);
    background: var(--acs-primary-hover);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-secondary-link {
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-alert.success {
    border: 0;
    border-radius: 12px;
    background: var(--acs-success-soft);
    color: var(--acs-success);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-alert.error {
    border: 0;
    border-radius: 12px;
    background: var(--acs-danger-soft);
    color: var(--acs-danger);
}
/* Stage 1.3 (E1.3-T5c): a notice that asks for something (two-step sign-in required). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-alert.warning {
    border: 0;
    border-radius: 12px;
    background: var(--acs-warning-soft);
    color: var(--acs-warning);
}
/* Stage 1.3 (E1.3-T5c): the set-up of two-step sign-in: the QR code (dark on white in both themes),
   the key as text, and the recovery codes. */
.ace-ui-2fa-setup { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; margin: 16px 0; }
.ace-ui-2fa-qr { flex: 0 1 auto; box-sizing: border-box; max-width: 100%; padding: 8px; border-radius: 12px; background: var(--acs-white); line-height: 0; }
.ace-ui-2fa-qr svg { display: block; max-width: 100%; height: auto; }
.ace-ui-2fa-steps { flex: 1 1 240px; min-width: 0; }
.ace-ui-2fa-secret { display: inline-block; margin-top: 4px; font-size: var(--acs-fs-title); letter-spacing: 0.04em; word-break: break-all; }
.ace-ui-2fa-code-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin: 12px 0 0; padding-left: 1.6em; }
.ace-ui-2fa-code-list code { font-size: var(--acs-fs-title); letter-spacing: 0.04em; }
.ace-ui-2fa-restart { margin-top: 16px; }
/* Stage 1.3 (E1.3-T6c): the Owner's protected changes that wait. */
.ace-ui-owner-changes { display: grid; gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.ace-ui-owner-changes li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ace-ui-owner-changes form { margin-left: auto; }
/* Stage 1.3 (E1.3-T8a): an API token shown once, its scopes, and the scopes to choose from. */
.ace-ui-token-plain { display: block; margin-top: 8px; padding: 12px; border: 1px dashed var(--acs-border-strong); border-radius: 12px; background: var(--acs-surface-2); font-size: var(--acs-fs); word-break: break-all; user-select: all; }
.ace-ui-token-scope { display: inline-block; margin: 0 6px 4px 0; padding: 2px 8px; border-radius: 999px; background: var(--acs-surface-2); font-size: var(--acs-fs); }
.ace-ui-token-scopes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; grid-column: 1 / -1; margin: 0; padding: 12px; border: 1px solid var(--acs-border); border-radius: 12px; }
.ace-ui-token-scopes label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* Stage 1.3 (E1.3-T9a): Security → Cloudflare: what the platform sees, the trusted proxies, Cloudflare's addresses. */
.ace-ui-proxy-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin: 0; }
.ace-ui-proxy-facts dt { color: var(--acs-muted); font-size: var(--acs-fs); }
.ace-ui-proxy-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.ace-ui-proxy-list { grid-column: 1 / -1; }
.ace-ui-proxy-list textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; }
.ace-ui-proxy-ranges summary { cursor: pointer; font-weight: 600; }
.ace-ui-proxy-ranges ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; }
/* Stage 1.3 (E1.3-T9b): Security → Anti-bot: the service to choose and its settings. */
.ace-ui-anti-bot-choice, .ace-ui-anti-bot-fields { display: grid; grid-column: 1 / -1; gap: 8px 16px; margin: 0; padding: 12px; border: 1px solid var(--acs-border); border-radius: 12px; }
.ace-ui-anti-bot-fields { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ace-ui-anti-bot-choice label { display: flex; align-items: center; gap: 8px; }
/* Stage 1.3 (E1.3-T9c): Security → External sign-in (a block per method) and the linked accounts of the profile. */
.ace-ui-external-method { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; margin: 0; padding: 12px; border: 1px solid var(--acs-border); border-radius: 12px; }
.ace-ui-external-method > p, .ace-ui-external-method > .acp-toggle-row { grid-column: 1 / -1; margin: 0; }
.ace-ui-external-method code { overflow-wrap: anywhere; }
.ace-ui-linked { display: grid; gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.ace-ui-linked li { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--acs-border); border-radius: 12px; }
.ace-ui-linked form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.ace-ui-linked label { display: grid; gap: 4px; }
/* Stage 1.3 (E1.3-T10b): CPanel's Panel: the account at a glance and the cards that lead on. */
.ace-ui-cpanel-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin: 0; }
.ace-ui-cpanel-facts dt { color: var(--acs-muted); font-size: var(--acs-fs); }
.ace-ui-cpanel-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.ace-ui-cpanel-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.ace-ui-cpanel-cards h2 { margin: 0 0 8px; font-size: var(--acs-fs-title); }
.ace-ui-cpanel-links { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
/* Stage 1.3 (E1.3-T10d): CPanel's API documentation. */
.ace-ui-docs-notes { display: grid; gap: 6px; margin: 12px 0 0; padding-left: 18px; }
.ace-ui-docs-notes code, .acp-table code { overflow-wrap: anywhere; }
/* Stage 1.14 (E1.14-T5): an address of the API documentation: what it does, its details, an example (wrapped on a phone). */
.ace-ui-docs-summary { margin: 4px 0 6px; }
.ace-ui-docs-details { margin-top: 6px; }
.ace-ui-docs-details h3 { font-size: var(--acs-fs); margin: 10px 0 4px; }
.ace-ui-docs-details ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ace-ui-docs-code { margin: 6px 0; padding: 10px; border: 1px solid var(--acs-border); border-radius: 6px; background: var(--acs-surface-2); color: var(--acs-text); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; font-size: var(--acs-fs); }
/* Stage 1.3 (E1.3-T11b): Users & roles → Personal data (the search, the people found, the requests) and My data. */
.acp-filter-bar.ace-ui-privacy-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 12px 0 8px; }
.ace-ui-privacy-search label { flex: 1 1 260px; }
.ace-ui-privacy-results { display: grid; gap: 12px; margin: 8px 0 16px; padding: 0; list-style: none; }
.ace-ui-privacy-results > li { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--acs-border); border-radius: 12px; }
.ace-ui-privacy-results small { overflow-wrap: anywhere; }
.ace-ui-privacy-results p { margin: 6px 0 0; overflow-wrap: anywhere; }
.ace-ui-privacy-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.ace-ui-privacy-actions details { flex: 1 1 280px; }
.ace-ui-privacy-actions summary { cursor: pointer; font-weight: 600; }
.ace-ui-privacy-actions details[open] summary { margin-bottom: 8px; }
.ace-ui-privacy-apps { display: grid; gap: 8px; margin: 8px 0 12px; padding-left: 18px; }
.ace-ui-privacy-note { grid-column: 1 / -1; }
.ace-ui-privacy-note textarea { width: 100%; }
/* Stage 1.3 (E1.3-T12c): Users & roles → Prezentare (each figure leads to its page) and Jurnal de acces. */
.ace-ui-stat-link { justify-self: start; font-size: var(--acs-fs-sm); font-weight: 600; }
.ace-ui-access-rules { display: grid; gap: 6px; margin: 8px 0 12px; padding-left: 18px; }
.ace-ui-access-events { display: grid; gap: 0; margin: 8px 0 12px; padding: 0; list-style: none; }
.ace-ui-access-events li { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--acs-border); }
.ace-ui-access-events small { overflow-wrap: anywhere; }
/* Stage 1.3 (E1.3-T12d): System → Dezvoltator: its pages side by side, the routes by part of the installation. */
.ace-ui-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.ace-ui-subnav a { padding: 6px 14px; border: 1px solid var(--acs-border); border-radius: 999px; background: var(--acs-surface); color: var(--acs-text); font-weight: 600; text-decoration: none; }
.ace-ui-subnav a.is-active { border-color: var(--acs-primary); background: var(--acs-primary-soft); color: var(--acs-primary-text); }
.ace-ui-route-area summary { cursor: pointer; padding: 4px 0; }
.ace-ui-route-area[open] summary { margin-bottom: 12px; }
.ace-ui-route-area code { overflow-wrap: anywhere; }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-tabs a {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-pill);
    background: var(--acs-surface);
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-tabs a.active {
    border-color: var(--acs-primary);
    background: var(--acs-primary-soft);
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-detail-list {
    display: grid;
    gap: var(--acs-space-2);
    margin: var(--acs-space-4) 0 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-detail-list div {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr;
    gap: var(--acs-space-3);
    padding: var(--acs-space-2) 0;
    border-bottom: 1px solid var(--acs-border);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-detail-list dt {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-detail-list dd {
    margin: 0;
    color: var(--acs-text);
    font-weight: 600;
}

/* Sign-in pages use the same palette. */
:root[data-ace-theme] body[data-ace-theme-scope="auth"] {
    background: var(--acs-bg);
    font-family: var(--acs-font);
}

/* Dashboard details: legend rows, quick links and block links. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-disk-legend > div {
    background: transparent;
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-quick-grid a {
    border: 1px solid var(--acs-border);
    border-radius: 12px;
    background: var(--acs-surface-2);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-quick-grid a:hover {
    border-color: var(--acs-primary);
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-secondary-link {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface-2);
    color: var(--acs-primary-text);
    opacity: 1;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-secondary-link:hover {
    border-color: var(--acs-primary);
    background: var(--acs-primary-soft);
    color: var(--acs-primary-text);
}
/* Stage 1.3 (E1.3-T2, ACC-8): the links of a card head, a form and a page list, the chips (roles,
   permissions), the permission group titles and the small badges follow the theme. In the light theme they kept the dark theme's
   pale colors: the links 1.4:1, the chips 3.6:1, the "Proprietar" badge 1.2:1. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-row-actions a,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pagination a,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-actions a {
    border: 1px solid var(--acs-border);
    background: var(--acs-surface-2);
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-row-actions a:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-pagination a:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-actions a:hover {
    border-color: var(--acs-primary);
    background: var(--acs-primary-soft);
}
/* Stage 1.3 (E1.3-T2, ACC-8): the paragraphs of a card and the lines of the activity and action
   lists take the muted color of the theme; the old stylesheet gave them the dark theme's pale slate
   in both themes (2.6:1 on white: the queue, integrations, SEO and advanced settings pages). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-card p,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-activity-list span {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-permission-group legend,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-permission-group h3 {
    color: var(--acs-info);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-chip-list span {
    border-color: var(--acs-border);
    background: var(--acs-info-soft);
    color: var(--acs-info);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-mini-badge {
    border-color: var(--acs-border);
    background: var(--acs-success-soft);
    color: var(--acs-success);
}

/* Stat cards: icon on top, text below, words never split. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--acs-space-2);
    min-width: 0;
    padding: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card > div {
    min-width: 0;
    width: 100%;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card span,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card small,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card strong {
    display: block;
    overflow: visible;
    overflow-wrap: normal;
    text-overflow: clip;
    white-space: normal;
    word-break: normal;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card strong {
    font-size: var(--acs-fs-page);
    line-height: 1.2;
}

/* Status rows: the label keeps a readable width; label and value wrap between words. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table {
    border: 1px solid var(--acs-border);
    border-radius: 12px;
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table div {
    grid-template-columns: minmax(min-content, 1fr) auto auto;
    border-bottom: 1px solid var(--acs-border);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table div:last-child {
    border-bottom: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table span,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table strong {
    overflow: visible;
    overflow-wrap: normal;
    text-overflow: clip;
    white-space: normal;
    word-break: normal;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table span {
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table strong {
    color: var(--acs-muted);
}
/* Stage 1.3 (E1.3-T13a): the health rows carry the Health page's own sentences: the value goes under the name,
   the state stays on the right (in a middle column the sentences broke one word per line). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table.is-stacked div {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 2px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table.is-stacked strong {
    grid-column: 1;
    grid-row: 2;
    font-weight: 400;
    text-align: left;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-status-table.is-stacked em {
    grid-column: 2;
    grid-row: 1 / span 2;
}
/* The state card says it in words ("2 de urmărit"), smaller than the counts beside it. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-stat-card strong.is-text {
    font-size: var(--acs-fs-title);
    line-height: 1.25;
}
/* The disk: the percentage keeps its width and the ring takes what is left (on a row of three cards they overlapped). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-disk-card {
    grid-template-columns: auto minmax(0, 1fr);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-disk-card .acp-donut {
    width: min(138px, 100%);
    justify-self: end;
}

/* Table row actions read as links, not as disabled buttons. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content:not(.is-webpanel-content) td a:not(.acp-pill) {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--acs-primary-soft);
    color: var(--acs-primary-text);
    font-weight: 600;
    opacity: 1;
    text-decoration: none;
}

/* Web Panel OS pages share the palette (the builder keeps its editor look). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-panel,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-section-head,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-pages-filters,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-bulk-bar,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-table-wrap,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-page-stat {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    box-shadow: var(--acs-shadow);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-pages-filters,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-bulk-bar,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-table-wrap {
    background: var(--acs-surface-2);
    box-shadow: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-panel h1,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-panel h2,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-panel h3,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-section-head h1,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-section-head h2,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-page-stat strong {
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-panel p,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-page-stat span,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-pages-filters label,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-empty-inline {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-kicker {
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-page-group-tabs a,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-page-status-tabs a,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-secondary-action,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-column-picker summary {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-pill);
    background: var(--acs-surface);
    box-shadow: none;
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-page-group-tabs a.is-active,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-page-status-tabs a.is-active {
    border-color: var(--acs-primary);
    background: var(--acs-primary-soft);
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-primary-action {
    border: 1px solid var(--acs-primary);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-primary);
    box-shadow: none;
    color: var(--acs-on-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-pages-filters input,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-pages-filters select,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-bulk-bar select,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-panel form input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-panel form select,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-panel form textarea {
    border: 1px solid var(--acs-border-strong);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-table th {
    border-bottom: 1px solid var(--acs-border);
    background: var(--acs-surface-2);
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-table td {
    border-bottom: 1px solid var(--acs-border);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .is-webpanel-content .webpanel-empty-inline {
    border: 1px dashed var(--acs-border-strong);
    border-radius: 12px;
    background: var(--acs-surface);
}

/* Phones: the header wraps inside the screen, never wider than it. */
@media (max-width: 760px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-main {
        min-width: 0;
        overflow-x: clip;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header {
        flex-wrap: wrap;
        gap: var(--acs-space-2);
        min-width: 0;
        max-width: 100%;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-left,
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-actions {
        flex-wrap: wrap;
        gap: var(--acs-space-2);
        min-width: 0;
        max-width: 100%;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-search {
        flex: 1 1 auto;
        min-width: 0;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-left .acp-header-button,
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-search kbd,
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-copy {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-button:disabled {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-select {
        width: auto;
        min-width: 68px;
        display: block;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-button {
        width: auto;
        min-width: 0;
        padding: 3px;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}

/* Header fits the screen at every width: the search shrinks first, then labels give way to icons,
   then the actions move to a row of their own, right-aligned, wrapping as often as they need (the
   account menu, last, opens on the screen). Stage 1.3 (E1.3-T2, SH-2): they used to stay on one
   line at any width: on a phone the theme, the language and the account menu (Profile, Logout)
   ran off the screen, where .acp-main clipped them, and with a long company name they covered
   the search. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-main,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header {
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header {
    flex-wrap: wrap;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-left {
    flex: 1 1 260px;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-left .acp-search {
    flex: 1 1 320px;
    min-width: 120px;
    max-width: 520px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-actions {
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-actions > * {
    flex: 0 0 auto;
}
@media (max-width: 1400px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-button:disabled > span[data-i18n],
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add summary > span:not(.acp-svg-icon),
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-copy {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-button:disabled {
        padding-inline: 10px;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-button {
        width: auto;
        min-width: 0;
        padding: 3px;
    }
}
/* On a phone the account menu opens across the screen, like the bell, "Add" and the problem form. */
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-user-menu {
        position: fixed;
        top: 64px;
        right: 12px;
        left: 12px;
        width: auto;
        min-width: 0;
        max-width: none;
    }
}
@media (max-width: 1200px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-search kbd {
        display: none;
    }
}

/* Dashboard edit mode: manager bar, widget library and widget controls. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-manager {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    box-shadow: var(--acs-shadow);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-manager span,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-save-status {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-manager-actions button,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-library button {
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface-2);
    box-shadow: none;
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-manager-actions button:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-library button:hover {
    border-color: var(--acs-primary);
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-dashboard-manager-actions [data-widget-save] {
    border-color: var(--acs-primary);
    background: var(--acs-primary);
    color: var(--acs-on-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-library span,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-library small {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode [data-dashboard-widget] {
    outline: 1px dashed var(--acs-primary);
    outline-offset: 3px;
}
/* Stage 1.4 (E1.4-V47): the widget with the keyboard's focus shows it (the dashed outline above hid acpanel.css's focus rule). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .dashboard-edit-mode [data-dashboard-widget]:focus-visible {
    outline: 3px solid var(--acs-primary);
    outline-offset: 3px;
}
/* Stage 1.16b: not the Panou's X while arranging, which is the shared chosen element's (.ace-chosen-x, ace-grid.js). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-remove:not(.ace-chosen-x) {
    border: 1px solid transparent;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-danger-soft);
    box-shadow: none;
    color: var(--acs-danger);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-remove:not(.ace-chosen-x):hover {
    border-color: var(--acs-danger);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] [data-dashboard-widget].dragging {
    opacity: 0.6;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-header-left > :not(.acp-search) {
    flex: 0 0 auto;
}

/* Web Panel builder: the editor chrome follows the skin; the page inside the canvas keeps the site look. */
/* Stage 1.3 (E1.3-T2): the builder's status line wraps on a narrow screen instead of being cut off
   (its row took the width of its content inside the column layout below 1180px). */

/* Stage 5 menu: an entry without a page yet reads like the others, muted and not clickable. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-empty.is-planned {
    gap: 10px;
    color: var(--acs-sidebar-muted);
    font-size: var(--acs-fs);
    cursor: default;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-single.is-bottom {
    margin-top: var(--acs-space-3);
    border-top: 1px solid var(--acs-sidebar-line);
    border-radius: 0 0 var(--acs-radius-sm) var(--acs-radius-sm);
    color: var(--acs-sidebar-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-single.is-bottom.active {
    color: var(--acs-white);
}

/* Stage 5 page header (ACE Core UI): breadcrumb, title, description, actions, tab bar. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--acs-space-3);
    min-width: 0;
    margin: 0 0 var(--acs-space-5);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs li + li::before {
    content: "/";
    color: var(--acs-subtle);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs ol a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--acs-muted);
    text-decoration: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs ol a:hover {
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs [aria-current="page"] {
    color: var(--acs-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs .acp-svg-icon svg {
    width: 14px;
    height: 14px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs__back {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-page-header__main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--acs-space-4);
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-page-header__text {
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-page-header h1 {
    margin: 0;
    color: var(--acs-text);
    font-size: var(--acs-fs-page);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-page-header__text p {
    max-width: 72ch;
    margin: 6px 0 0;
    color: var(--acs-muted);
    font-size: var(--acs-fs);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--acs-btn-h);
    padding: 0 var(--acs-space-4);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    color: var(--acs-text);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-action.is-primary {
    border-color: var(--acs-primary);
    background: var(--acs-primary);
    color: var(--acs-on-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tabs {
    display: flex;
    align-items: center;
    gap: var(--acs-space-1);
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    box-shadow: var(--acs-shadow);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tabs__list {
    display: flex;
    flex: 1 1 auto;
    gap: var(--acs-space-1);
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: thin;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--acs-radius-sm);
    background: transparent;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] a.ace-ui-tab:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] button.ace-ui-tab:hover {
    background: var(--acs-surface-2);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab.is-active {
    background: var(--acs-tab-active-bg);
    color: var(--acs-tab-active-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab .acp-svg-icon svg {
    width: 15px;
    height: 15px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab.is-planned {
    cursor: default;
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab small {
    padding: 1px 6px;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-warning-soft);
    color: var(--acs-warning);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab__badge {
    min-width: 20px;
    padding: 0 6px;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-surface-2);
    color: var(--acs-text);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab.is-active .ace-ui-tab__badge {
    background: var(--acs-surface);
}

/* Phones: "‹ Area" instead of the full breadcrumb, rounded tabs that scroll with a fade on the
   right, the main action as an icon, and save buttons fixed at the bottom of the screen. */
@media (max-width: 760px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs ol {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crumbs__back {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        color: var(--acs-primary-text);
        font-size: var(--acs-fs);
        font-weight: 600;
        text-decoration: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-page-header h1 {
        font-size: var(--acs-fs-page);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-page-header__main {
        flex-wrap: nowrap;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-action.has-icon > span:last-child {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-action.has-icon {
        padding: 0 10px;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tabs {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tabs__list {
        gap: var(--acs-space-2);
        padding-right: var(--acs-space-6);
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent);
        mask-image: linear-gradient(to right, black 85%, transparent);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab {
        border-color: var(--acs-border);
        border-radius: var(--acs-radius-pill);
        background: var(--acs-surface);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-actions,
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] [data-ace-sticky-actions] {
        position: sticky;
        bottom: 0;
        z-index: 30;
        margin-inline: calc(var(--acs-space-4) * -1);
        padding: var(--acs-space-3) var(--acs-space-4);
        border-top: 1px solid var(--acs-border);
        background: var(--acs-surface);
        box-shadow: var(--acs-shadow-strong);
    }
}
/* Stage 5: "More options" holds rarely used fields in simple mode (more_options_start()). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-more-options {
    grid-column: 1 / -1;
    border: 1px dashed var(--acs-border-strong);
    border-radius: 12px;
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-more-options > summary {
    padding: var(--acs-space-3) var(--acs-space-4);
    color: var(--acs-primary-text);
    font-weight: 600;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-more-options__body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--acs-space-3) var(--acs-space-4);
    padding: 0 var(--acs-space-4) var(--acs-space-4);
}
/* Stage 5 permissions page: roles on the left, zones of the chosen role on the right. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    align-items: start;
    gap: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__roles {
    display: grid;
    gap: var(--acs-space-3);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__roles h2,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__head h2 {
    margin: 0;
    color: var(--acs-text);
    font-size: var(--acs-fs-title);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-select {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-select label {
    display: grid;
    gap: 6px;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-select select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--acs-border-strong);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list a {
    display: grid;
    gap: 2px;
    padding: var(--acs-space-2) var(--acs-space-3);
    border: 1px solid transparent;
    border-radius: var(--acs-radius-sm);
    color: var(--acs-text);
    text-decoration: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list a:hover {
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list a.is-active {
    border-color: var(--acs-primary);
    background: var(--acs-tab-active-bg);
    color: var(--acs-tab-active-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list a span {
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list small {
    color: var(--acs-muted);
    font-size: var(--acs-fs-xs);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list a.is-active small {
    color: var(--acs-tab-active-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list .ace-ui-perm__tag {
    justify-self: start;
    padding: 1px 7px;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-warning-soft);
    color: var(--acs-warning);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__panel {
    display: grid;
    gap: var(--acs-space-3);
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__head p {
    margin: 4px 0 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__form {
    display: grid;
    gap: var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-zone {
    border: 1px solid var(--acs-border);
    border-radius: 12px;
    background: var(--acs-surface);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-zone > summary {
    display: flex;
    align-items: center;
    gap: var(--acs-space-3);
    padding: var(--acs-space-3) var(--acs-space-4);
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-zone__name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--acs-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-zone__count {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    white-space: nowrap;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-zone__list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0 var(--acs-space-4) var(--acs-space-3);
    list-style: none;
}
/* Stage 1.3 (E1.3-T3, step 8): the new role's zones, each with Nimic / Vede / Lucrează / Administrează. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-role-zones {
    display: grid;
    gap: 4px;
    min-width: 0;
    margin: 0;
    padding: var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-role-zones legend {
    padding: 0 6px;
    color: var(--acs-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-role-zones > p {
    margin: 0 0 var(--acs-space-2);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-role-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px var(--acs-space-3);
    padding: 6px 0;
    border-top: 1px solid var(--acs-border);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-role-zone__name {
    color: var(--acs-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-role-zone .ace-ui-perm-state label {
    display: inline-flex;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-role-zone .ace-ui-perm-state input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    opacity: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-role-zone .ace-ui-perm-state input:disabled + span {
    color: var(--acs-muted);
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Stage 1.3 (E1.3-T3): the templates a new role can start from, one card each. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-role-templates {
    display: grid;
    gap: var(--acs-space-2);
    min-width: 0;
    margin: 0;
    padding: var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-role-templates legend {
    padding: 0 6px;
    color: var(--acs-text);
    font-weight: 600;
}
/* Inside the form grid, whose labels and inputs are made for text fields. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-role-template {
    display: flex;
    align-items: flex-start;
    gap: var(--acs-space-3);
    padding: var(--acs-space-2) var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-role-template:has(input:checked) {
    border-color: var(--acs-primary);
    background: var(--acs-primary-soft);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-role-template > input[type="radio"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 3px 0 0;
    padding: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-role-template > span {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-role-template strong {
    display: block;
    color: var(--acs-text);
    font-size: var(--acs-fs);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-role-template small {
    display: block;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    font-weight: 400;
}
/* Stage 1.3 (E1.3-T3): an action of the access form: its name and sentence, then Da / — / Niciodată
   and, for a Da, where it applies; the zone's quick buttons above its actions. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__summary {
    margin: 0;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 var(--acs-space-4) var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-presets .ace-ui-action {
    min-height: 32px;
    padding: 4px 12px;
    font-size: var(--acs-fs-sm);
}
/* "Vezi ca acest rol" submits the form elsewhere and is not its main button either. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content form button.ace-ui-see-as[type="submit"]:not(.danger):not(.is-danger) {
    border-color: var(--acs-border-strong);
    background: var(--acs-surface);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content form button.ace-ui-see-as[type="submit"]:not(.danger):not(.is-danger):hover {
    border-color: var(--acs-primary);
    background: var(--acs-primary-soft);
    color: var(--acs-text);
}
/* They submit the form without JavaScript, but are not its main button: the secondary look. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content form .ace-ui-perm-presets button.ace-ui-action[type="submit"]:not(.danger):not(.is-danger) {
    border-color: var(--acs-border-strong);
    background: var(--acs-surface);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content form .ace-ui-perm-presets button.ace-ui-action[type="submit"]:not(.danger):not(.is-danger):hover {
    border-color: var(--acs-primary);
    background: var(--acs-primary-soft);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-zone__list > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--acs-space-2) var(--acs-space-3);
    padding: var(--acs-space-2) 0;
    border-top: 1px solid var(--acs-border);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-action__text strong {
    display: block;
    color: var(--acs-text);
    font-size: var(--acs-fs);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-action__text small {
    display: block;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-action__key {
    display: inline-block;
    margin-top: 2px;
    color: var(--acs-muted);
    font-size: var(--acs-fs-xs);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-action__controls {
    display: grid;
    justify-items: end;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--acs-border-strong);
    border-radius: var(--acs-radius-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state label {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-action__controls:disabled .ace-ui-perm-state label {
    cursor: not-allowed;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state input + span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 12px;
    background: var(--acs-surface);
    color: var(--acs-text);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state label + label input + span {
    border-left: 1px solid var(--acs-border-strong);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state input:focus-visible + span {
    outline: 2px solid var(--acs-primary);
    outline-offset: -2px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state .is-allow input:checked + span {
    background: var(--acs-primary);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state .is-inherit input:checked + span {
    background: var(--acs-surface-2);
    box-shadow: inset 0 0 0 2px var(--acs-border-strong);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-state .is-deny input:checked + span {
    background: var(--acs-danger-solid);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-place {
    display: grid;
    justify-items: end;
    gap: 6px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-place[hidden] {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-place > label {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-place select {
    max-width: 100%;
    min-height: 32px;
    border: 1px solid var(--acs-border-strong);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    color: var(--acs-text);
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-zone__list > li {
        grid-template-columns: minmax(0, 1fr);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-action__controls,
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm-place {
        justify-items: start;
    }
}
@media (max-width: 900px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm {
        grid-template-columns: minmax(0, 1fr);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-list {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-perm__role-select {
        display: block;
    }
}

/* Stage 5 EXTENSIONS pages: counts, filter chips and package cards. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--acs-space-3);
    margin-bottom: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-stat {
    display: grid;
    gap: 4px;
    padding: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-stat span {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-stat strong {
    color: var(--acs-text);
    font-size: var(--acs-fs-page);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    margin-bottom: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--acs-tab-h);
    padding: 0 12px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-pill);
    background: var(--acs-surface);
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
    text-decoration: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chip span {
    color: var(--acs-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chip.is-active {
    border-color: var(--acs-primary);
    background: var(--acs-tab-active-bg);
    color: var(--acs-tab-active-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chip.is-active span {
    color: var(--acs-tab-active-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package-grid {
    display: grid;
    /* Stage 1.12 (E1.12-T9, MK-F18): never wider than the screen (a phone narrower than 280px plus the margins scrolled sideways). */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: var(--acs-space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package {
    display: grid;
    align-content: start;
    gap: var(--acs-space-3);
    min-width: 0;
    padding: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__head {
    display: flex;
    align-items: flex-start;
    gap: var(--acs-space-3);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--acs-primary-soft);
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__title {
    flex: 1 1 auto;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__title h3 {
    margin: 0;
    color: var(--acs-text);
    font-size: var(--acs-fs-title);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__title small,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__text {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__text {
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--acs-space-2);
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__meta dt {
    color: var(--acs-muted);
    font-size: var(--acs-fs-xs);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__meta dd {
    margin: 0;
    color: var(--acs-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package__problems {
    margin: 0;
    padding: var(--acs-space-2) var(--acs-space-3);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-danger-soft);
    color: var(--acs-danger);
    font-size: var(--acs-fs-sm);
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-package .ace-ui-action {
    justify-self: start;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-empty {
    display: grid;
    gap: 4px;
    padding: var(--acs-space-5);
    border-style: dashed;
    text-align: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-empty strong {
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-empty span {
    color: var(--acs-muted);
}
/* Stage 1.3 (E1.3-T13d, SH-5): Settings > Meniul ACPanel. A group's head and each entry are one row that wraps: the
   handle, the name, the icon with its preview, "hidden" and the up/down buttons (the keyboard's and the phone's way to
   move); an own link's address and an entry's address take a line of their own. The theme's colours in both themes. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-builder-group {
    border-color: var(--acs-border);
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-builder-item {
    border-color: var(--acs-border);
    background: var(--acs-surface);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-builder-head,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-builder-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--acs-space-3);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-builder-head > label:first-of-type,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-builder-item > label:first-of-type {
    flex: 1 1 200px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-builder .acp-sidebar-href,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-builder-item > small {
    flex: 1 1 100%;
    order: 9;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-icon-field {
    display: flex;
    align-items: center;
    gap: var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-icon-field select {
    min-width: 150px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-icon-preview {
    display: inline-grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-icon-preview svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-move {
    display: inline-flex;
    gap: var(--acs-space-1);
    margin-left: auto;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-sidebar-move button {
    min-width: 38px;
    min-height: 38px;
}

/* Stage 1.3 (E1.3-T13g): the edit bar's own boxes, also on a stat card (it makes every span a block, which broke
   the bar into a line per item): the handle stays a box, the buttons are items of the bar. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-handle {
    display: inline-grid;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-widget-controls .acp-widget-buttons {
    display: contents;
}

/* Stage 1.15 (E1.15-T4, AI-F10): "Write with AI" and "Fill from a document", in both themes; an error looks like one. */
.ace-ui-ai-write, .ace-ui-ai-extract { display: flex; flex-wrap: wrap; align-items: center; gap: var(--acs-space-2); margin-top: var(--acs-space-2); }
.ace-ui-ai-write input[type="text"] { flex: 1 1 220px; min-width: 0; padding: 6px 10px; border: 1px solid var(--acs-border); border-radius: var(--acs-radius-sm); background: var(--acs-surface); color: var(--acs-text); }
.ace-ui-ai-status { flex-basis: 100%; color: var(--acs-muted); }
.ace-ui-ai-status.is-error { color: var(--acs-danger); font-weight: 600; }
/* Stage 1.15 (E1.15-T6): the assistant: the drawer of the top bar and its conversation (the same panel on the page AI > Asistent). */
.ace-ui-ai-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1200; width: min(460px, 100vw); overflow-y: auto; padding: var(--acs-space-4); background: var(--acs-surface); color: var(--acs-text); border-left: 1px solid var(--acs-border); box-shadow: var(--acs-shadow-strong); }
.ace-ui-ai-drawer[hidden] { display: none; }
.ace-ui-ai-page { max-width: 820px; }
.ace-ui-ai-chat { display: flex; flex-direction: column; gap: var(--acs-space-3); min-width: 0; }
.ace-ui-ai-chat__head { display: flex; align-items: center; gap: var(--acs-space-2); }
.ace-ui-ai-chat__head h2 { flex: 1 1 auto; margin: 0; font-size: var(--acs-fs-title); }
.ace-ui-ai-chat__head .ace-ui-visually-hidden + .acp-header-button { margin-left: auto; }
.ace-ui-ai-chat__list summary { cursor: pointer; font-weight: 600; }
.ace-ui-ai-chat__list ul { display: grid; gap: var(--acs-space-1); margin: var(--acs-space-2) 0 0; padding: 0; list-style: none; }
.ace-ui-ai-chat__list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--acs-space-2); }
.ace-ui-ai-chat__list a { color: var(--acs-primary-text); overflow-wrap: anywhere; }
.ace-ui-ai-chat__list a[aria-current="page"] { font-weight: 600; }
.ace-ui-ai-chat__list small { color: var(--acs-muted); }
.ace-ui-ai-chat__messages { display: flex; flex-direction: column; gap: var(--acs-space-2); margin: 0; padding: 0; list-style: none; }
.ace-ui-ai-msg { max-width: 92%; padding: 10px 12px; border: 1px solid var(--acs-border); border-radius: var(--acs-radius-sm); background: var(--acs-surface-2); color: var(--acs-text); line-height: 1.5; overflow-wrap: anywhere; }
.ace-ui-ai-msg.is-user { align-self: flex-end; background: var(--acs-primary-soft); }
.ace-ui-ai-msg.is-assistant { align-self: flex-start; }
.ace-ui-ai-msg.is-tool { align-self: flex-start; padding: 4px 10px; border-style: dashed; background: transparent; color: var(--acs-muted); }
.ace-ui-ai-msg.is-note { align-self: stretch; max-width: none; background: transparent; color: var(--acs-muted); }
.ace-ui-ai-msg.is-error { align-self: stretch; max-width: none; border-color: var(--acs-danger); background: var(--acs-danger-soft); color: var(--acs-danger); font-weight: 600; }
.ace-ui-ai-msg.is-confirm { align-self: stretch; max-width: none; border-color: var(--acs-warning); background: var(--acs-warning-soft); }
.ace-ui-ai-msg.is-confirm p { margin: var(--acs-space-2) 0 0; }
.ace-ui-ai-msg a { color: var(--acs-primary-text); text-decoration: underline; }
.ace-ui-ai-msg__file { display: block; margin-top: var(--acs-space-1); color: var(--acs-muted); }
.ace-ui-ai-msg__input { margin: var(--acs-space-2) 0 0; padding-left: 18px; }
.ace-ui-ai-chat__form { display: grid; gap: var(--acs-space-2); }
.ace-ui-ai-chat__form textarea { width: 100%; min-height: 84px; padding: 10px 12px; border: 1px solid var(--acs-border-strong); border-radius: var(--acs-radius-sm); background: var(--acs-surface); color: var(--acs-text); font: inherit; resize: vertical; }
.ace-ui-ai-chat__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--acs-space-2); }
.ace-ui-ai-chat__file { display: grid; gap: var(--acs-space-1); min-width: 0; color: var(--acs-muted); }
.ace-ui-ai-chat__file input[type="file"] { max-width: 100%; color: var(--acs-text); }
.ace-ui-ai-chat__privacy { margin: 0; font-size: var(--acs-fs); }
.ace-ui-ai-chat__links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--acs-space-3); }
.ace-ui-ai-chat__links a { color: var(--acs-primary-text); }
.ace-ui-ai-chat__links form { margin: 0 0 0 auto; }
@media (max-width: 640px) { .ace-ui-ai-drawer { width: 100vw; padding: var(--acs-space-3); border-left: 0; } .ace-ui-ai-msg { max-width: 100%; } }

/* Stage 1.16 (the night of 17→18 Oct; TEMA-PANOU-ACE-CORE-OS.md points 2 and 5): the page's blue light at the top right; the chosen tab,
   the chosen pill and the menu's active entry are the main blue (--acs-primary-gradient), white text. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] {
    background: var(--acs-glow), var(--acs-bg);
    background-attachment: fixed;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tab.is-active,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chip.is-active,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-nav-submenu a.active {
    background: var(--acs-primary-gradient);
    color: var(--acs-on-primary);
    box-shadow: var(--acs-active-shadow);
}

/* Stage 1.16e (round 5): on a phone (under 768 px) the fields and the buttons are 44 px, for a finger. */
@media (max-width: 767px) {
    :root {
        --acs-field-h: 44px;
        --acs-btn-h: 44px;
        --acs-tab-h: 44px;
        --acs-row-h: 44px;
    }
}
