/*
 * ACE Core UI, Stage 6: components of the application contract and the shared data screens
 * (package page, lists, record pages, quick add, undo). Colors, spacing and radii come only
 * from the skin tokens (--acs-*), so both themes and the contrast test keep holding.
 */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: var(--acs-space-4);
    margin-bottom: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-two-columns > .acp-card {
    margin: 0;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-app-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: var(--acs-space-3);
    margin: var(--acs-space-3) 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-app-meta div {
    display: grid;
    gap: 2px;
    padding: var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface-2);
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-app-meta dt {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-app-meta dd {
    margin: 0;
    color: var(--acs-text);
    font-weight: 600;
    overflow-wrap: anywhere;
}
/* Stage 1.3 (E1.3-T13c): an item as wide as the list (a log line's details, in plain weight). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-app-meta .is-wide {
    grid-column: 1 / -1;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-app-meta .is-wide .ace-ui-code {
    margin: 0;
    font-weight: 400;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    align-items: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-app-actions form {
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-checks {
    display: grid;
    gap: var(--acs-space-2);
    margin: var(--acs-space-3) 0 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-checks li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px var(--acs-space-3);
    align-items: center;
    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);
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-checks li strong {
    color: var(--acs-text);
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-checks li small {
    grid-column: 2;
    color: var(--acs-muted);
    overflow-wrap: anywhere;
}
/* Stage 1.11 (E1.11-T2b, IN-F8): a webhook's buttons and its edit form take the whole row (in the narrow first column
   they widened it and squeezed the name and the address). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-webhooks li > .ace-ui-app-actions,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-webhooks li > details {
    grid-column: 1 / -1;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-webhook-meta span + span::before {
    content: " · ";
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-webhook-reason {
    color: var(--acs-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-webhook-edit summary,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-webhook-detail summary {
    cursor: pointer;
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-webhook-detail pre {
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-summary-title {
    display: inline;
    margin: 0;
    font-size: inherit;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] summary:has(.ace-ui-summary-title) {
    cursor: pointer;
    font-size: var(--acs-fs-title);
    font-weight: 600;
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-danger-zone {
    margin-top: var(--acs-space-4);
    padding: var(--acs-space-4);
    border: 1px solid var(--acs-danger);
    border-radius: var(--acs-radius);
    background: var(--acs-danger-soft);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-danger-zone h3,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-danger-zone p {
    color: var(--acs-text);
}
/* Stage 1.3 (E1.3-T5c): every red button of a form, not only those in a row of form actions (a reset in a
   table or a card was white on light red, 3.9:1, and 1.9:1 in the dark theme). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-actions button.is-danger,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content form button.is-danger {
    border-color: var(--acs-danger-solid);
    background: var(--acs-danger-solid);
    color: var(--acs-white);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-company-switch {
    display: flex;
    align-items: center;
    margin: 0;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-company-switch select {
    max-width: 200px;
    min-height: 38px;
    padding: 0 var(--acs-space-2);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    color: var(--acs-text);
    font-weight: 600;
    text-overflow: ellipsis;
}
/* The header actions keep to one line as long as they can: below 1400px the problem button keeps
   only its icon and the company list narrows (more below 1200px); two companies and every action
   fit at 768px. */
@media (max-width: 1400px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-problem summary > span:not(.acp-svg-icon) {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-company-switch select {
        max-width: 180px;
    }
}
@media (max-width: 1200px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-company-switch select {
        max-width: 140px;
    }
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-company-switch select {
        max-width: 112px;
    }
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-3);
    align-items: flex-end;
    margin: var(--acs-space-3) 0;
    padding: var(--acs-space-3) var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-list-toolbar label {
    display: grid;
    gap: 4px;
    flex: 1 1 180px;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-list-toolbar label span {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-list-toolbar input,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-list-toolbar select {
    width: 100%;
    min-height: 38px;
    padding: 0 var(--acs-space-2);
    border: 1px solid var(--acs-border);
    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-list-toolbar .acp-form-actions {
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-list-table {
    overflow-x: auto;
    max-width: 100%;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-list-select {
    width: 36px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    align-items: center;
    justify-content: center;
    margin: var(--acs-space-3) 0;
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-record {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: var(--acs-space-4);
    align-items: start;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-record > .acp-card {
    margin: 0;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-record__side h2 {
    margin-top: var(--acs-space-3);
    font-size: var(--acs-fs-title);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-field-error {
    color: var(--acs-danger);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-fieldset {
    display: grid;
    gap: var(--acs-space-2);
    margin: 0;
    padding: var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-fieldset legend {
    padding: 0 var(--acs-space-1);
    color: var(--acs-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-actions button.is-primary {
    border-color: var(--acs-primary);
    background: var(--acs-primary);
    color: var(--acs-on-primary);
}
@media (max-width: 900px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-record {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-sticky-actions {
        position: sticky;
        bottom: 0;
        z-index: 5;
        padding: var(--acs-space-2) 0;
        background: var(--acs-surface);
        border-top: 1px solid var(--acs-border);
    }
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-view-switch,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-list-tools {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    align-items: center;
    margin: var(--acs-space-3) 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-view-switch .ace-ui-action.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-columns-picker,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-save-view {
    flex: 1 1 100%;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-columns-picker summary,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-save-view summary {
    cursor: pointer;
    color: var(--acs-primary-text);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-columns-picker > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: var(--acs-space-2);
    margin-top: var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-save-view {
    flex: 0 1 auto;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-saved-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    align-items: center;
    margin-top: var(--acs-space-2);
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: var(--acs-space-3);
    align-items: start;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board__column {
    display: grid;
    gap: var(--acs-space-2);
    margin: 0;
    min-height: 120px;
    min-width: 0;
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board__column h3 {
    display: flex;
    justify-content: space-between;
    gap: var(--acs-space-2);
    margin: 0;
    color: var(--acs-text);
    font-size: var(--acs-fs);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board__card {
    display: grid;
    gap: 4px;
    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);
    min-width: 0;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board__card[draggable="true"] {
    cursor: grab;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board__card.is-dragging {
    opacity: 0.55;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board__card small {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board__move {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-1);
    align-items: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-board__move select {
    min-height: 32px;
    max-width: 100%;
    border: 1px solid var(--acs-border);
    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-calendar__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--acs-space-2);
    margin-bottom: var(--acs-space-3);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__head h3 {
    margin: 0;
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__weekday {
    padding: 4px;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
    text-align: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day {
    display: grid;
    align-content: start;
    gap: 2px;
    min-height: 84px;
    min-width: 0;
    padding: 4px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
    font-size: var(--acs-fs-sm);
    overflow: hidden;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day.is-outside {
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day.is-today {
    border-color: var(--acs-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__number {
    color: var(--acs-muted);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bars {
    display: grid;
    gap: var(--acs-space-2);
    margin: var(--acs-space-3) 0 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bars li {
    display: grid;
    grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto;
    gap: var(--acs-space-2);
    align-items: center;
    color: var(--acs-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bars__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bars__track {
    height: 14px;
    border-radius: var(--acs-radius-pill);
    background: var(--acs-surface-2);
    overflow: hidden;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bars__fill {
    display: block;
    height: 100%;
    background: var(--acs-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-tag-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day {
        min-height: 56px;
        font-size: var(--acs-fs-xs);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bars li {
        grid-template-columns: minmax(0, 90px) minmax(0, 1fr) auto;
    }
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-record-panel {
    margin-top: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-record-panel h2 + .ace-ui-checks,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-record-panel h2 {
    margin-top: var(--acs-space-3);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-comments p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--acs-text);
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-timeline {
    display: grid;
    gap: var(--acs-space-2);
    margin: var(--acs-space-2) 0 0;
    padding: 0 0 0 var(--acs-space-4);
    border-left: 2px solid var(--acs-border);
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-timeline li {
    display: grid;
    gap: 2px;
    color: var(--acs-text);
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-timeline small {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add {
    position: relative;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add summary {
    list-style: none;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add summary::-webkit-details-marker {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add__menu {
    position: absolute;
    right: 0;
    z-index: 40;
    display: grid;
    gap: 2px;
    min-width: 220px;
    max-width: min(320px, 92vw);
    margin: 6px 0 0;
    padding: var(--acs-space-2);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    box-shadow: var(--acs-shadow);
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add__menu a {
    display: flex;
    gap: var(--acs-space-2);
    align-items: center;
    padding: var(--acs-space-2);
    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-quick-add__menu a:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add__menu a:focus-visible {
    background: var(--acs-tab-active-bg);
    color: var(--acs-tab-active-text);
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add summary > span:not(.acp-svg-icon) {
        display: none;
    }
    /* Stage 1.3 (E1.3-T2, SH-2): across the screen, like the bell and the problem form. */
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-quick-add__menu {
        position: fixed;
        top: 64px;
        right: 12px;
        left: 12px;
        min-width: 0;
        max-width: none;
    }
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-undo {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-3);
    align-items: center;
    justify-content: space-between;
    margin: 0 0 var(--acs-space-3);
    padding: var(--acs-space-3) var(--acs-space-4);
    border: 1px solid var(--acs-primary);
    border-radius: var(--acs-radius);
    background: var(--acs-tab-active-bg);
    color: var(--acs-tab-active-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-undo form {
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-undo button {
    min-height: 36px;
    padding: 0 var(--acs-space-3);
    border: 1px solid var(--acs-primary);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-primary);
    color: var(--acs-on-primary);
    font-weight: 600;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-code {
    margin: var(--acs-space-2) 0 var(--acs-space-3);
    padding: var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface-2);
    color: var(--acs-text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: 100%;
}
/* Stage 7: the bell and the notification lists. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bell {
    position: relative;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bell summary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bell summary::-webkit-details-marker {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bell__count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--acs-danger-solid, #b91c1c);
    color: #ffffff;
    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-bell__panel {
    position: absolute;
    right: 0;
    z-index: 45;
    display: grid;
    gap: var(--acs-space-2);
    width: min(380px, 92vw);
    margin-top: 6px;
    padding: var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    color: var(--acs-text);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bell__head {
    display: flex;
    gap: var(--acs-space-2);
    align-items: center;
    justify-content: space-between;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bell__empty {
    margin: 0;
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bell__all {
    /* Stage 1.3 (E1.3-T2, SH-11): the color of text links (the button color was 3.2:1 in the dark theme). */
    color: var(--acs-primary-text);
    font-weight: 600;
    text-align: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list {
    display: grid;
    gap: var(--acs-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list.is-compact {
    max-height: min(60vh, 420px);
    overflow-y: auto;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list li {
    display: flex;
    gap: var(--acs-space-2);
    align-items: flex-start;
    justify-content: space-between;
    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);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list li.is-unread {
    border-left: 3px solid var(--acs-primary);
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list a {
    display: grid;
    gap: 2px;
    min-width: 0;
    color: var(--acs-text);
    text-decoration: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list a strong,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list a span {
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list li:not(.is-unread) a strong {
    font-weight: 400;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list a small {
    color: var(--acs-muted);
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-bell__panel {
        position: fixed;
        top: 60px;
        right: 8px;
        left: 8px;
        width: auto;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-notify-list li {
        flex-direction: column;
    }
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-pref-table td:not(:first-child),
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-pref-table th:not(:first-child) {
    width: 120px;
    text-align: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-pref-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--acs-primary);
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-pref-table td:not(:first-child) {
        width: auto;
        text-align: left;
    }
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-mail-preview {
    width: 100%;
    min-height: 460px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: #f4f5f7;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-variable-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-variable-list small {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-form-grid .ace-ui-wide {
    grid-column: 1 / -1;
}
/* Stage 7: automation rules and the builder. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-list {
    display: grid;
    gap: var(--acs-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-list > li {
    display: grid;
    gap: var(--acs-space-2);
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-head {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    align-items: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-sentence {
    margin: 0;
    color: var(--acs-text);
    line-height: 1.55;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-row,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-action {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: var(--acs-space-2) var(--acs-space-3);
    margin: 0 0 var(--acs-space-3);
    padding: var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-action legend {
    padding: 0 var(--acs-space-1);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-row label,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-action label {
    display: grid;
    gap: 4px;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-action .ace-ui-wide {
    grid-column: 1 / -1;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-rule-action [hidden] {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-dry-actions {
    display: grid;
    gap: var(--acs-space-2);
    margin: 0;
    padding-left: 1.2em;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    align-items: center;
    grid-column: 2;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-inline-form input {
    min-width: min(100%, 240px);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-pref-check {
    position: relative;
    display: inline-flex;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-form-block {
    /* (Stage 1.16e, round 6: its cards one under another, the scale's 12 apart, not glued.) */
    display: grid;
    gap: var(--acs-card-gap);
    min-width: 0;
    max-width: 100%;
}
/* Stage 8 (E8-T3): the Ctrl K palette and the search page. Colors only from tokens. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-search {
    position: relative;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    display: grid;
    gap: 2px;
    width: min(520px, calc(100vw - 24px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: var(--acs-space-2);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    color: var(--acs-text);
    box-shadow: var(--acs-shadow);
}
/* Stage 1.3 (E1.3-T2): a closed palette is not shown (display: grid above won over "hidden", so
   an empty bar sat under the search, and on a phone over it). */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette[hidden] {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__title {
    margin: var(--acs-space-2) var(--acs-space-2) 2px;
    color: var(--acs-muted);
    font-size: var(--acs-fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__item {
    display: grid;
    gap: 2px;
    padding: var(--acs-space-2);
    border-radius: var(--acs-radius-sm);
    color: var(--acs-text);
    text-decoration: none;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__item small {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__item:hover,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__item:focus-visible,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__item.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-palette__item.is-active small,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__item:hover small {
    color: inherit;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__item.is-all {
    border-top: 1px solid var(--acs-border);
    border-radius: 0 0 var(--acs-radius-sm) var(--acs-radius-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette__empty {
    margin: var(--acs-space-2);
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-search-form {
    display: grid;
    gap: var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-search-form__field {
    display: grid;
    gap: 4px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-search-form__field input {
    width: 100%;
    min-width: 0;
    /* Stage 1.16e (PagesLayoutProbeTest): the common field (it was the browser's 20 px one). */
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--acs-border-strong);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    color: var(--acs-text);
    font: inherit;
    box-sizing: border-box;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-search-results,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chain {
    display: grid;
    gap: var(--acs-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-search-results li {
    display: grid;
    gap: 2px;
    padding-bottom: var(--acs-space-3);
    border-bottom: 1px solid var(--acs-border);
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-search-results li:last-child {
    border-bottom: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-search-results small,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chain small {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chain {
    gap: var(--acs-space-2);
    padding-left: var(--acs-space-4);
    list-style: decimal;
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-palette {
        position: fixed;
        top: 64px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}
/* Stage 8 (E8-T4): Media OS library, drop zone, picker and crop. Colors only from tokens. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
    gap: var(--acs-space-3);
    align-items: end;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-toolbar label {
    display: grid;
    gap: 4px;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-3);
    justify-content: space-between;
    align-items: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-dropzone {
    display: grid;
    gap: var(--acs-space-2);
    justify-items: center;
    padding: var(--acs-space-5) var(--acs-space-4);
    border: 2px dashed var(--acs-border-strong);
    border-radius: var(--acs-radius);
    background: var(--acs-surface-2);
    color: var(--acs-text);
    text-align: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-dropzone.is-over {
    border-color: var(--acs-primary);
    background: var(--acs-primary-soft);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-dropzone span {
    color: var(--acs-muted);
}
/* Stage 1.16b (DE-FACUT.md 0.2, 5.8): the zone that takes an archive for a form sent whole (Ui::upload), Media's look; the
   file chosen with its size and the red X; the form's pieces one under another, the password's field at most 360 px wide. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload {
    position: relative;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload .ace-c-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--acs-primary-soft);
    color: var(--acs-primary-text);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload .ace-c-tile-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload__title {
    color: var(--acs-text);
    font-size: var(--acs-fs);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload__title label {
    color: var(--acs-primary-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload input[type="file"]:focus-visible ~ .ace-ui-upload__file,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload:focus-within {
    outline: 2px solid var(--acs-focus-color);
    outline-offset: 2px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload__hint {
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload__file {
    display: inline-flex;
    align-items: center;
    gap: var(--acs-space-2);
    max-width: 100%;
    padding: 6px 6px 6px 12px;
    border: 1px solid var(--acs-border);
    border-radius: 999px;
    background: var(--acs-surface);
    cursor: default;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload__file[hidden] {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload__file svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload__file strong {
    overflow: hidden;
    color: var(--acs-text);
    font-size: var(--acs-fs);
    text-overflow: ellipsis;
    white-space: nowrap;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload__file small {
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    white-space: nowrap;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .acp-content button.ace-ui-upload__clear[type="button"] {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--acs-danger-solid);
    color: var(--acs-white);
    font-size: var(--acs-fs-title);
    line-height: 1;
    box-shadow: none;
    cursor: pointer;
}
/* A form that asks the password before a weighty action: its pieces one under another, the buttons in a row at the end. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload-form,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-confirm-form {
    display: grid;
    gap: var(--acs-space-4);
    justify-items: start;
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload-form > .ace-ui-upload {
    justify-self: stretch;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload-section {
    display: grid;
    gap: var(--acs-space-3);
    padding-top: var(--acs-space-4);
    border-top: 1px solid var(--acs-border);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-upload-section > h3 {
    margin: 0;
    color: var(--acs-text);
    font-size: var(--acs-fs);
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-c-field.ace-ui-password-confirm {
    width: 100%;
    max-width: 360px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-c-field.ace-ui-password-confirm > input {
    min-height: 46px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-dropzone__list {
    display: grid;
    gap: 2px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-dropzone__list .is-ok {
    color: var(--acs-success);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-dropzone__list .is-error {
    color: var(--acs-danger);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--acs-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-grid li {
    position: relative;
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: var(--acs-space-2);
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-grid small {
    color: var(--acs-muted);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-select {
    position: absolute;
    top: var(--acs-space-2);
    left: var(--acs-space-2);
    z-index: 1;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-type {
    display: grid;
    place-items: center;
    min-height: 96px;
    margin: 0;
    color: var(--acs-muted);
    font-weight: 600;
    letter-spacing: 0.06em;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--acs-radius-sm);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crop {
    position: relative;
    display: inline-block;
    max-width: 100%;
    touch-action: none;
    cursor: crosshair;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crop__box {
    position: absolute;
    border: 2px solid var(--acs-primary);
    background: var(--acs-primary-soft);
    pointer-events: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crop-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    align-items: center;
    max-width: 100%;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-inline-form input {
    min-width: 0;
    max-width: 220px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-pick {
    margin-top: 4px;
    justify-self: start;
}
body[data-ace-theme-scope="acpanel"] .ace-ui-picker {
    width: min(760px, calc(100vw - 24px));
    max-height: min(80vh, 640px);
    padding: var(--acs-space-4);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    color: var(--acs-text);
    box-shadow: var(--acs-shadow-strong);
}
body[data-ace-theme-scope="acpanel"] .ace-ui-picker::backdrop {
    background: color-mix(in srgb, var(--acs-text) 45%, transparent);
}
body[data-ace-theme-scope="acpanel"] .ace-ui-picker__head,
body[data-ace-theme-scope="acpanel"] .ace-ui-picker__tools {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--acs-space-3);
}
body[data-ace-theme-scope="acpanel"] .ace-ui-picker__tools input[type="search"] {
    flex: 1 1 220px;
    min-width: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-ui-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--acs-space-2);
}
body[data-ace-theme-scope="acpanel"] .ace-ui-picker__item {
    display: grid;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface-2);
    color: var(--acs-text);
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}
body[data-ace-theme-scope="acpanel"] .ace-ui-picker__item:hover,
body[data-ace-theme-scope="acpanel"] .ace-ui-picker__item:focus-visible {
    border-color: var(--acs-primary);
}
body[data-ace-theme-scope="acpanel"] .ace-ui-picker__item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--acs-radius-sm);
}
@media (max-width: 768px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-crop-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-media-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}
/* Stage 8 (E8-T5): report builder, chart (one series, accent from tokens) and central calendar. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-fieldset {
    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-fieldset legend {
    padding: 0 4px;
    font-weight: 600;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-filter-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-filter-row label {
    display: grid;
    gap: 4px;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart {
    margin: 0 0 var(--acs-space-3);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 320px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__grid {
    stroke: var(--acs-border);
    stroke-width: 1;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__axis {
    stroke: var(--acs-border-strong);
    stroke-width: 1;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__bar {
    fill: var(--acs-primary);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__hit {
    fill: transparent;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__mark:hover .ace-ui-chart__bar {
    fill: var(--acs-primary-hover);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__line {
    fill: none;
    stroke: var(--acs-primary);
    stroke-width: 2;
    stroke-linejoin: round;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__dot {
    fill: var(--acs-primary);
    stroke: var(--acs-surface);
    stroke-width: 2;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__label {
    fill: var(--acs-muted);
    font-size: 11px; /* (the chart's own units: the drawing is 640 wide and shrinks with the screen) */
}
/* Stage 1.10 (E1.10-T5, RP-F26): the chart is drawn 640 wide and shrinks with the screen; on a phone its labels are drawn
   larger (about 10 pixels once shrunk) and every other one is left out, so they do not run into each other. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__label.is-narrow {
    display: none;
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__label {
        font-size: 22px;
    }
    /* Stage 1.10 (E1.10-V, IV-19): the short label on a phone. */
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__label.is-wide {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__label.is-narrow {
        display: inline;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-chart__label.is-minor {
        display: none;
    }
}
/* Stage 1.10 (E1.10-T5, RP-F11): numbers on the right, as in a ledger. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-report-result .is-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-bar {
    display: flex;
    gap: var(--acs-space-3);
    justify-content: space-between;
    align-items: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-bar h2 {
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2) var(--acs-space-4);
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--acs-muted);
    font-size: var(--acs-fs);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-legend li {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--acs-info);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    padding: var(--acs-space-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__head {
    padding: 4px;
    color: var(--acs-muted);
    font-size: var(--acs-fs-sm);
    font-weight: 600;
    text-align: center;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day {
    display: grid;
    align-content: start;
    gap: 2px;
    min-width: 0;
    min-height: 92px;
    padding: 4px;
    border-radius: var(--acs-radius-sm);
    background: var(--acs-surface-2);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day.is-outside {
    background: transparent;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day.is-today {
    outline: 2px solid var(--acs-primary);
    outline-offset: -2px;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__number {
    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-calendar__weekname {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__event {
    display: block;
    overflow: hidden;
    padding: 1px 6px;
    border-left: 3px solid var(--acs-info);
    border-radius: 4px;
    background: var(--acs-surface);
    color: var(--acs-text);
    font-size: var(--acs-fs-sm);
    white-space: nowrap;
    text-overflow: ellipsis;
    text-decoration: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__event.is-task,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-dot.is-task { border-color: var(--acs-primary); background-color: var(--acs-surface); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-dot.is-task { background: var(--acs-primary); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__event.is-done { border-color: var(--acs-success); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-dot.is-done { background: var(--acs-success); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__event.is-deadline { border-color: var(--acs-warning); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-dot.is-deadline { background: var(--acs-warning); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__event.is-expiry { border-color: var(--acs-danger); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-dot.is-expiry { background: var(--acs-danger); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__event.is-report,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__event.is-publish { border-color: var(--acs-muted); }
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-dot.is-report,
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar-dot.is-publish { background: var(--acs-muted); }
@media (max-width: 768px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-filter-row {
        grid-template-columns: minmax(0, 1fr);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar {
        grid-template-columns: minmax(0, 1fr);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__head,
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day.is-outside,
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day.is-empty {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__day {
        min-height: 0;
    }
    /* Stage 1.10 (E1.10-T5, RP-F19): the day's name, the week's header being hidden here. */
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__weekname {
        display: inline;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-calendar__event {
        white-space: normal;
    }
}
/* Stage 8 (E8-T8): safe mode banner, "Report a problem", long values. Colors only from tokens. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-safe-banner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
    align-items: center;
    justify-content: space-between;
    margin: 0 0 var(--acs-space-3);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-problem {
    position: relative;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-problem summary {
    list-style: none;
    cursor: pointer;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-problem summary::-webkit-details-marker {
    display: none;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-problem form {
    position: absolute;
    right: 0;
    z-index: 45;
    display: grid;
    gap: var(--acs-space-2);
    width: min(360px, calc(100vw - 24px));
    margin-top: 6px;
    padding: var(--acs-space-3);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    background: var(--acs-surface);
    color: var(--acs-text);
    box-shadow: var(--acs-shadow);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-problem textarea {
    width: 100%;
    min-height: 90px;
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-problem summary > span:not(.acp-svg-icon) {
        display: none;
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-problem form {
        position: fixed;
        top: 64px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}

/* Stage 1.6 (E1.6-T5, CT-29): the fields of a form read only, without changing the form's layout. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-form-lock {
    display: contents;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}
/* Stage 1.13 (E1.13-T7): the files of an update, long paths wrapping on a phone. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-file-list {
    margin: 0;
    padding-left: var(--acs-space-4);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-ui-file-list code {
    overflow-wrap: anywhere;
}

/* Stage 1.16d (DE-FACUT.md 0d.1): "Aplică versiunea": the steps inside the card, the tick before the buttons, the buttons whole on a phone. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply {
    display: grid;
    gap: var(--acs-space-4);
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply > h2 {
    margin: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__steps {
    display: grid;
    gap: var(--acs-space-2);
    margin: 0;
    padding-inline-start: var(--acs-space-5);
    min-width: 0;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__form {
    justify-items: stretch;
    min-width: 0;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__discard {
    padding-top: var(--acs-space-4);
    border-top: 1px solid var(--acs-border);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__confirm span {
    min-width: 0;
    overflow-wrap: anywhere;
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--acs-space-3);
}
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__buttons button.is-primary {
    border-color: var(--acs-primary);
    background: var(--acs-primary);
    color: var(--acs-on-primary);
}
@media (max-width: 640px) {
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__buttons {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__buttons > button,
    :root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-update-apply__buttons > a {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        text-align: center;
        white-space: normal;
    }
}

/* Stage 1.16c (19 Oct): "Ce să încercați", in ACPanel and in Panoul Client: the numbered steps of each card. */
:root[data-ace-theme] body[data-ace-theme-scope="acpanel"] .ace-testers-steps {
    display: grid;
    gap: var(--acs-space-1);
    margin: 0;
    padding-inline-start: var(--acs-space-5);
}
