/* c-* components — docs/06-admin-ui/03-components.md, design system §2. Tokens only; no hex values here. */

/* Icon */
.c-icon { width: 18px; height: 18px; flex: none; stroke-width: 1.7; }
.c-icon--sm { width: 16px; height: 16px; }
.c-icon--lg { width: 24px; height: 24px; }

/* Button: ink fill primary, white bordered secondary (design 2.1.2) */
.c-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--size-btn); padding: 0 var(--space-4); border: 1.5px solid transparent; border-radius: var(--radius-md); font-size: var(--text-base); font-weight: var(--weight-semibold); line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.c-button:hover { text-decoration: none; }
.c-button:active:not(:disabled):not(.is-disabled) { transform: translateY(1px); }
.c-button:disabled, .c-button.is-disabled { background: var(--color-disabled-bg); border-color: transparent; color: var(--color-disabled-text); cursor: not-allowed; }
.c-button--sm { height: var(--size-btn-sm); padding: 0 var(--space-3); border-radius: var(--radius-item); font-size: var(--text-sm); }
.c-button--sm .c-icon { width: 16px; height: 16px; }
.c-button--primary { background: var(--color-ink); color: var(--color-surface); }
.c-button--primary:hover:not(:disabled) { background: var(--color-ink-hover); color: var(--color-surface); }
.c-button--secondary { background: var(--color-surface); border-color: var(--border-strong); color: var(--color-ink); }
.c-button--secondary:hover:not(:disabled) { background: var(--color-canvas); border-color: var(--color-ink-weak); color: var(--color-ink); }
.c-button--ghost { background: transparent; color: var(--color-ink-secondary); }
.c-button--ghost:hover:not(:disabled) { background: var(--color-surface-alt); color: var(--color-ink); }
.c-button--danger { background: var(--tone-error-text); color: var(--color-surface); }
.c-button--danger:hover:not(:disabled) { background: var(--tone-critical-border); color: var(--color-surface); }
.c-button:focus-visible { outline-offset: 3px; border-radius: var(--radius-md); }

/* Page header */
.c-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.c-page-header__title { font-size: var(--text-2xl); }
.c-page-header__description { margin-top: var(--space-1); font-size: var(--text-body); color: var(--color-ink-secondary); }
.c-page-header__actions { display: flex; gap: var(--space-2h); flex: none; }
.c-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1h); list-style: none; margin: 0 0 var(--space-2); padding: 0; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--fg-muted); }
.c-breadcrumbs li + li::before { content: "/"; margin-right: var(--space-1h); color: var(--color-ink-weak); }
.c-breadcrumbs a { color: var(--fg-muted); }
.c-breadcrumbs a:hover { color: var(--color-ink); }

/* Card: border, no shadow (design 2.5) */
.c-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.c-card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-4h); border-bottom: 1px solid var(--color-divider-card); }
.c-card__title { font-size: var(--text-md); font-weight: var(--weight-bold); letter-spacing: var(--tracking-card); }
.c-card__body { padding: var(--space-4h); }
.c-card--flush .c-card__body { padding: 0; }

/* Table (design 2.12) */
.c-table-card { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-modal); overflow: hidden; }
.c-table-wrap { overflow: auto; max-height: calc(100vh - 260px); }
.c-card--flush .c-table-card { border: 0; border-radius: 0; background: transparent; }
.c-table { font-size: var(--text-base); }
.c-table th, .c-table td { padding: 14px var(--space-5); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--color-divider-card); }
.c-table thead th { position: sticky; top: 0; z-index: 1; padding-top: 14px; padding-bottom: 12px; background: var(--bg-surface); border-bottom-color: var(--border); font-size: var(--text-caps); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--fg-muted); white-space: nowrap; }
.c-table tbody tr { transition: background-color var(--duration-fast) var(--ease-out); }
.c-table tbody tr:last-child td { border-bottom: 0; }
.c-table tbody tr:hover { background: var(--color-surface-selected); }
.c-table tbody tr.is-flagged { background: var(--tone-error-row); }
.c-table tbody tr.is-flagged:hover { background: var(--tone-error-row-hover); }
.c-table td.is-danger, .c-table .u-danger { color: var(--tone-error-text); }
.c-table tbody tr[data-href] { cursor: pointer; }
.c-table__sort { display: inline-flex; align-items: center; gap: var(--space-1); color: inherit; }
.c-table__sort:hover { color: var(--color-ink); text-decoration: none; }
.c-table__sort .c-icon { width: 14px; height: 14px; opacity: .45; }
.c-table__sort.is-sorted { color: var(--color-ink); }
.c-table__sort.is-sorted .c-icon { opacity: 1; color: var(--color-accent); }
.c-table td > a:not([class]), .c-table .c-cell__main { font-weight: var(--weight-bold); color: var(--color-ink); }
.c-table td > a:not([class]):hover, .c-table a.c-cell__main:hover { color: var(--color-accent); text-decoration: none; }
.c-table__progress { min-width: 140px; }
.c-cell { display: grid; gap: var(--space-1); }
.c-cell__main { font-weight: var(--weight-semibold); }
.c-cell__sub { font-size: var(--text-sm); color: var(--fg-muted); }
.c-cell__code { font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; color: var(--fg-muted); }
.c-table .c-cell { gap: 2px; }
.c-cell__badge { margin-top: var(--space-2); }
.c-table--roomy th, .c-table--roomy td { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.c-table__actions { text-align: right; white-space: nowrap; }
.c-table__action-row { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.c-table__action-row form { margin: 0; }

/* Filters toolbar: search, filter pills, sort pill, count (assets/js/modules/listing.js builds the pills) */
.c-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2h); margin-bottom: var(--space-4); }
.c-filters .c-button { height: 40px; }
.c-filters .c-field { margin: 0; min-width: 160px; flex: 0 1 200px; max-width: 280px; }
.c-filters .c-input, .c-filters .c-select { height: 40px; border-radius: var(--radius-md); }
.c-filters .c-field--checks { flex: 1 1 100%; max-width: none; }
.c-filters .c-field.is-pill, .c-filters .c-field.is-search { min-width: 0; flex: 0 0 auto; }
.c-filters .c-field.is-search { flex: 1 1 260px; max-width: 340px; }
.c-filters .c-field.is-pill > .c-field__error, .c-filters .c-field.is-search > .c-field__error { display: none; }
.c-field--checks__row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); padding-top: var(--space-1); }
.c-filters__actions { display: flex; gap: var(--space-4); align-items: center; height: 40px; }
.c-filters__actions:last-child { margin-left: auto; }
.c-filters__actions a { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.c-filters__count { margin-left: auto; align-self: center; font-size: var(--text-sm); color: var(--fg-muted); white-space: nowrap; }
.c-search { position: relative; }
.c-search > .c-icon { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--color-ink-muted); pointer-events: none; }
.c-search .c-input { padding-left: 40px; }
.c-pill { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-3h); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--color-ink-secondary); white-space: nowrap; transition: border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
.c-pill .c-icon { width: 16px; height: 16px; flex: none; color: var(--color-ink-secondary); }
.c-pill .c-icon:last-of-type { width: 14px; height: 14px; color: var(--color-ink-muted); }
.c-pill__value { font-weight: var(--weight-semibold); color: var(--color-ink); }
.c-pill:hover { border-color: var(--color-ink-weak); }
.c-pill:focus-within { border-color: var(--color-accent); box-shadow: var(--focus-ring); }
.c-pill.is-active { background: var(--color-accent-tint); border-color: var(--color-accent-border); }
.c-pill.is-active .c-pill__value, .c-pill.is-active > .c-icon:first-child { color: var(--color-accent-hover); }
.c-pill > .c-select { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; border-radius: var(--radius-md); }

/* Pagination: lives in the table card footer; standalone (no card) keeps its own spacing */
.c-pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-4); font-size: var(--text-sm); color: var(--fg-muted); }
.c-table-card > .c-pagination { margin: 0; padding: var(--space-3h) var(--space-5); border-top: 1px solid var(--color-divider-card); }
.c-pagination__pages { display: flex; gap: var(--space-1h); list-style: none; margin: 0; padding: 0; }
.c-pagination__link { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--color-ink-body); font-weight: var(--weight-semibold); transition: background-color var(--duration-fast) var(--ease-out); }
.c-pagination__link:hover { background: var(--color-canvas); color: var(--color-ink); text-decoration: none; }
.c-pagination__link.is-current { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-surface); }
.c-pagination__link.is-disabled { color: var(--fg-subtle); pointer-events: none; background: var(--bg-surface); }
span.c-pagination__link.is-disabled { border-color: transparent; }

/* Row "…" menu: panel is fixed-positioned by listing.js so the scrolling table never clips it */
.c-row-menu > summary { display: grid; place-items: center; width: 32px; height: 32px; list-style: none; border-radius: var(--radius-item); color: var(--color-ink-muted); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.c-row-menu > summary::-webkit-details-marker { display: none; }
.c-row-menu > summary:hover, .c-row-menu[open] > summary { background: var(--color-canvas); color: var(--color-ink); }
.c-row-menu > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.c-row-menu .c-menu__panel { position: fixed; right: auto; min-width: 200px; text-align: left; }
.c-row-menu .c-menu__panel form { margin: 0; }
.c-menu__item--danger, .c-menu__item--danger .c-icon { color: var(--tone-error-text); }
.c-menu__item--danger:hover { background: var(--tone-error-bg); color: var(--tone-error-text); }
.c-menu__divider { height: 1px; margin: var(--space-1h) calc(var(--space-1h) * -1); background: var(--color-divider-card); border: 0; }

/* Empty state: icon in a 64px tile (design 2.11) */
.c-empty-state { text-align: center; padding: var(--space-12) var(--space-8); background: var(--bg-surface); border: 1.5px dashed var(--color-ink-weak); border-radius: var(--radius-lg); }
.c-card .c-empty-state { border: 0; background: transparent; }
.c-empty-state__icon { width: 64px; height: 64px; padding: 18px; margin: 0 auto var(--space-4); border-radius: 22px; background: var(--color-surface-alt); color: var(--color-ink-muted); }
.c-empty-state__title { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.c-empty-state__body { max-width: 480px; margin: 0 auto var(--space-5); font-size: var(--text-body); color: var(--color-ink-secondary); }
.c-empty-state__actions { display: flex; justify-content: center; gap: var(--space-2h); }

/* Forms (design 2.2): 42px fields, accent border + ring on focus */
.c-field { margin-bottom: var(--space-5); }
.c-field__label { display: block; margin-bottom: var(--space-1h); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-ink-body); }
.c-field__required { color: var(--tone-error-text); margin-left: 2px; }
.c-field__help { margin-top: var(--space-1h); font-size: var(--text-sm); color: var(--fg-muted); }
.c-field__error { margin-top: var(--space-1h); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-error); }
.c-input, .c-select, .c-textarea { display: block; width: 100%; height: var(--size-input); padding: 0 var(--space-3h); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--color-ink); transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out); }
.c-input::placeholder, .c-textarea::placeholder { color: var(--fg-subtle); font-weight: var(--weight-regular); }
.c-textarea { height: auto; min-height: 96px; padding: var(--space-2h) var(--space-3h); resize: vertical; line-height: var(--leading-normal); }
.c-select { appearance: none; padding-right: var(--space-8); background-image: linear-gradient(45deg, transparent 50%, var(--color-ink-muted) 50%), linear-gradient(135deg, var(--color-ink-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.c-input:hover:not(:disabled):not([readonly]), .c-select:hover:not(:disabled), .c-textarea:hover:not(:disabled):not([readonly]) { border-color: var(--color-ink-weak); }
.c-input:focus, .c-select:focus, .c-textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: var(--focus-ring); }
.c-input[aria-invalid="true"], .c-select[aria-invalid="true"], .c-textarea[aria-invalid="true"] { border-color: var(--color-error); border-width: 1.5px; }
.c-input[aria-invalid="true"]:focus, .c-select[aria-invalid="true"]:focus, .c-textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--tone-error-bg); }
.c-input:disabled, .c-select:disabled, .c-textarea:disabled, .c-input[readonly], .c-textarea[readonly] { background: var(--color-surface-locked); border-color: var(--color-border-locked); color: var(--fg-muted); cursor: not-allowed; }
.c-input[type="file"] { height: auto; padding: var(--space-2); font-weight: var(--weight-regular); color: var(--color-ink-secondary); }
.c-input[type="file"]::file-selector-button { height: 28px; margin-right: var(--space-3); padding: 0 var(--space-3); border: 1.5px solid var(--border-strong); border-radius: var(--radius-item); background: var(--bg-surface); color: var(--color-ink); font: inherit; font-weight: var(--weight-semibold); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out); }
.c-input[type="file"]::file-selector-button:hover { background: var(--color-canvas); }
.c-check { display: flex; align-items: flex-start; gap: var(--space-2h); cursor: pointer; font-weight: var(--weight-medium); color: var(--color-ink-body); }
.c-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--color-ink); flex: none; cursor: pointer; }
.c-check__hint { display: block; font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--fg-muted); }
.c-radio-group { display: flex; flex-direction: column; gap: var(--space-2h); border: 0; margin: 0; padding: 0; }
.c-radio-group--inline { flex-direction: row; gap: var(--space-5); }
.c-radio-group input[type="radio"] { accent-color: var(--color-ink); }
.c-form-actions { display: flex; gap: var(--space-2h); padding-top: var(--space-4); border-top: 1px solid var(--color-divider-card); margin-top: var(--space-2); }
.c-error-summary { padding: var(--space-3h) var(--space-4); margin-bottom: var(--space-5); border: 1px solid var(--tone-error-border); border-radius: var(--radius-menu); background: var(--tone-error-bg); color: var(--tone-error-text); font-size: var(--text-sm); }
.c-error-summary ul { margin: var(--space-1) 0 0; padding-left: var(--space-5); }

/* Badges: tone fill, border, text (design 2.9) */
.c-badge { display: inline-flex; align-items: center; gap: var(--space-1h); height: 24px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1; white-space: nowrap; }
.c-badge--neutral { background: var(--tone-neutral-bg); border-color: var(--tone-neutral-border); color: var(--tone-neutral-text); }
.c-badge--success { background: var(--tone-success-bg); border-color: var(--tone-success-border); color: var(--tone-success-text); }
.c-badge--warning { background: var(--tone-warning-bg); border-color: var(--tone-warning-border); color: var(--tone-warning-text); }
.c-badge--danger { background: var(--tone-error-bg); border-color: var(--tone-error-border); color: var(--tone-error-text); }
.c-badge--info { background: var(--tone-sky-bg); border-color: var(--tone-sky-border); color: var(--tone-sky-text); }
.c-badge--accent { background: var(--tone-info-bg); border-color: var(--tone-info-border); color: var(--tone-info-text); }
.c-badge--result { font-family: var(--font-mono); font-weight: var(--weight-bold); letter-spacing: .04em; }
.c-badge--pass { background: var(--result-pass-bg); border-color: var(--tone-success-border); color: var(--result-pass-fg); }
.c-badge--warning-result { background: var(--result-warning-bg); border-color: var(--tone-warning-border); color: var(--result-warning-fg); }
.c-badge--fail { background: var(--result-fail-bg); border-color: var(--tone-error-border); color: var(--result-fail-fg); }
.c-badge--critical { background: var(--result-critical-bg); border-color: var(--tone-critical-border); color: var(--result-critical-fg); }
.c-badge--na { background: var(--result-na-bg); border-color: var(--tone-neutral-border); color: var(--result-na-fg); }
.c-badge--recorded { background: var(--result-recorded-bg); border-color: var(--tone-sky-border); color: var(--result-recorded-fg); }
.c-badge--modifier { background: var(--bg-surface); border-color: var(--border-strong); color: var(--color-ink-secondary); font-weight: var(--weight-medium); }
.c-badge--official { background: var(--prov-official-bg); border-color: var(--tone-info-border); color: var(--prov-official-fg); }
.c-badge--organization { background: var(--prov-org-bg); border-color: var(--tone-neutral-border); color: var(--prov-org-fg); }
.c-result { display: inline-flex; align-items: center; gap: var(--space-1h); flex-wrap: wrap; }

/* Count pill (mono, pending work: visible, not alarming) */
.c-count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--color-accent-tint-strong); color: var(--color-accent); font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-semibold); }

/* Flash and banners (design 2.10) */
.c-flash-stack { display: flex; flex-direction: column; gap: var(--space-2h); margin-bottom: var(--space-5); }
.c-flash { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-3h); border: 1px solid; border-radius: var(--radius-menu); font-size: var(--text-sm); font-weight: var(--weight-medium); animation: rf-fade var(--duration-base) var(--ease-out) both; }
.c-flash__body { flex: 1; }
.c-flash__close { background: none; border: 0; padding: 2px; cursor: pointer; color: inherit; opacity: .6; border-radius: var(--radius-xs); transition: opacity var(--duration-fast); }
.c-flash__close:hover { opacity: 1; }
.c-flash--success { background: var(--tone-success-bg); border-color: var(--tone-success-border); color: var(--tone-success-text); }
.c-flash--error { background: var(--tone-error-bg); border-color: var(--tone-error-border); color: var(--tone-error-text); }
.c-flash--warning { background: var(--tone-warning-bg); border-color: var(--tone-warning-border); color: var(--tone-warning-text); }
.c-flash--info { background: var(--tone-sky-bg); border-color: var(--tone-sky-border); color: var(--tone-sky-text); }

/* Key-value list */
.c-kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2h) var(--space-6); margin: 0; }
.c-kv + p { margin-top: var(--space-3); }
.c-kv dt { color: var(--fg-muted); font-size: var(--text-sm); }
.c-kv dd { margin: 0; color: var(--color-ink); font-weight: var(--weight-semibold); overflow-wrap: anywhere; min-width: 0; }
/* Rows for short linked lists inside a card: main text and sub line left, badge right */
.c-link-list { list-style: none; margin: 0; padding: 0; }
.c-link-list > li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider); }
.c-link-list > li:first-child { padding-top: 0; }
.c-link-list > li:last-child { padding-bottom: 0; border-bottom: 0; }
.c-link-list__main { display: grid; gap: var(--space-1); min-width: 0; }
.c-link-list__sub { font-size: var(--text-sm); color: var(--fg-muted); }

/* Support-view banner */
.c-support-banner { display: flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--support-bg); color: var(--support-fg); font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.c-support-banner .c-icon { width: 16px; height: 16px; }
.c-support-banner__exit { margin-left: var(--space-4); }
.c-support-banner__button { padding: 2px var(--space-3); border: 1px solid currentColor; border-radius: var(--radius-pill); background: transparent; color: inherit; font: inherit; cursor: pointer; transition: background-color var(--duration-fast); }
.c-support-banner__button:hover { background: var(--overlay-light-hover); }

/* Dialog (design 2.8) */
.c-dialog { width: 520px; max-width: calc(100vw - 2 * var(--space-8)); padding: 0; border: 0; border-radius: var(--radius-modal); box-shadow: var(--shadow-lg); color: var(--fg); background: var(--bg-surface); }
.c-dialog[open] { animation: rf-rise var(--duration-base) var(--ease-out) both; }
.c-dialog::backdrop { background: var(--scrim-modal); }
.c-dialog__header { padding: var(--space-6) var(--space-6) 0; }
.c-dialog__title { font-size: var(--text-lg); }
.c-dialog__body { padding: var(--space-3) var(--space-6) var(--space-5); color: var(--color-ink-body); }
.c-dialog__summary { margin-top: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--color-surface-locked); border: 1px solid var(--color-border-locked); border-radius: var(--radius-md); font-size: var(--text-sm); }
.c-dialog__footer { display: flex; justify-content: flex-end; gap: var(--space-2h); padding: var(--space-4) var(--space-6) var(--space-5); border-top: 1px solid var(--color-divider-card); }
.c-dialog--consequential .c-dialog__header { border-top: 4px solid var(--color-accent); border-radius: var(--radius-modal) var(--radius-modal) 0 0; }

/* Side panel / drawer */
.c-side-panel { position: fixed; inset: 0 0 0 auto; width: var(--panel-width); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--border); background: var(--bg-surface); color: var(--fg); box-shadow: var(--shadow-drawer); }
.c-side-panel[open] { animation: rf-fade var(--duration-base) var(--ease-out) both; }
.c-side-panel::backdrop { background: var(--scrim-drawer); }
.c-side-panel__inner { display: flex; flex-direction: column; height: 100%; }
.c-side-panel__bar { display: flex; justify-content: flex-end; padding: var(--space-3h) var(--space-4) 0; }
.c-side-panel__body { flex: 1; overflow-y: auto; padding: 0 var(--space-6) var(--space-6); }
.c-side-panel__body .c-page-header { margin-bottom: var(--space-5); }
.c-side-panel__body .c-page-header__title { font-size: var(--text-xl); }
.c-side-panel.is-loading .c-side-panel__body { opacity: .5; }
.c-icon-button { display: inline-grid; place-items: center; width: var(--size-icon-btn); height: var(--size-icon-btn); padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-ink-secondary); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.c-icon-button:hover { background: var(--color-surface-alt); color: var(--color-ink); }

/* Toasts: dark ink (design 2.10) */
.c-toast-stack { position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-2h); width: 380px; }
.c-toast { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3h) var(--space-4); border-radius: 15px; background: var(--color-ink); color: var(--color-surface); box-shadow: var(--shadow-toast); font-size: var(--text-base); font-weight: var(--weight-semibold); animation: rf-rise var(--duration-base) var(--ease-out) both; }
.c-toast--error { background: var(--tone-error-text); }
.c-toast--success { background: var(--tone-success-text); }
.c-toast__body { flex: 1; }
.c-toast .c-icon-button { width: 24px; height: 24px; border-radius: var(--radius-xs); color: inherit; opacity: .8; }
.c-toast .c-icon-button:hover { background: var(--overlay-light-hover); color: inherit; opacity: 1; }

/* Tabs (query-string links) */
.c-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-6); border-bottom: 1px solid var(--border); }
.c-tabs__link { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2h) var(--space-3h); margin-bottom: -1px; color: var(--fg-muted); font-weight: var(--weight-semibold); transition: color var(--duration-fast) var(--ease-out); }
.c-tabs__link:hover { color: var(--color-ink); text-decoration: none; }
.c-tabs__link.is-active { color: var(--color-ink); }
.c-tabs__count { min-width: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--color-surface-alt); color: var(--color-ink-secondary); font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-semibold); text-align: center; }
.c-tabs__link.is-active .c-tabs__count { background: var(--color-accent-tint-strong); color: var(--color-accent); }

/* Tree */
.c-tree, .c-tree__group { list-style: none; margin: 0; padding: 0; }
.c-tree__group { padding-left: var(--space-5); }
.c-tree__item:focus-visible { outline: none; }
.c-tree__item:focus-visible > .c-tree__row { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.c-tree__row { display: flex; align-items: center; gap: var(--space-1); min-height: 34px; padding: 0 var(--space-2) 0 0; border-radius: var(--radius-item); transition: background-color var(--duration-fast) var(--ease-out); }
.c-tree__row:hover { background: var(--color-canvas); }
.c-tree__item[aria-selected="true"] > .c-tree__row { background: var(--color-accent-tint); color: var(--color-ink); font-weight: var(--weight-bold); }
.c-tree__item[aria-selected="true"] > .c-tree__row .c-tree__label .c-icon { color: var(--color-accent); }
.c-tree__toggle { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--fg-muted); cursor: pointer; border-radius: var(--radius-xs); }
.c-tree__toggle .c-icon { width: 14px; height: 14px; transition: transform var(--duration-fast) var(--ease-out); }
.c-tree__item[aria-expanded="true"] > .c-tree__row .c-tree__toggle .c-icon { transform: rotate(90deg); }
.c-tree__item[aria-expanded="false"] > .c-tree__group { display: none; }
.c-tree__spacer { width: 24px; flex: none; }
.c-tree__label { display: inline-flex; align-items: center; gap: var(--space-2); color: inherit; font-weight: var(--weight-semibold); }
.c-tree__label:hover { text-decoration: none; color: inherit; }
.c-tree__label .c-icon { width: 16px; height: 16px; color: var(--fg-muted); }
.c-tree__hint { margin: 0; padding: var(--space-3) var(--space-4); font-size: var(--text-sm); color: var(--fg-muted); }
.c-tree__item.is-dragging > .c-tree__row { opacity: .4; }
.c-tree__item.is-drop-before > .c-tree__row { box-shadow: 0 -2px 0 var(--color-accent); }
.c-tree__item.is-drop-after > .c-tree__row { box-shadow: 0 2px 0 var(--color-accent); }
[data-editable] .c-tree__item[draggable="true"] > .c-tree__row { cursor: grab; }
.c-tree__meta { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); }

/* Summary strip (project hub) */
.c-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.c-summary__item { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; padding: var(--space-4) var(--space-5); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.c-summary__value { font-size: var(--text-xl); font-weight: var(--weight-extrabold); letter-spacing: var(--tracking-title); line-height: var(--leading-tight); color: var(--color-ink); }
.c-summary__label { font-size: var(--text-sm); color: var(--fg-muted); }
.c-summary__item--text { justify-content: center; }
.c-toolbar { display: flex; justify-content: flex-end; margin-bottom: var(--space-4); }
.u-mt { margin-top: var(--space-4); }

/* Key-values editor */
.c-key-values { display: flex; flex-direction: column; gap: var(--space-2h); }
.c-key-values__head, .c-key-values__row { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr) 36px; gap: var(--space-2h); align-items: start; }
.c-key-values__head { font-size: var(--text-caps); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--fg-muted); }
.c-key-values__row .c-field__error { grid-column: 1 / -1; margin-top: 0; }
.c-key-values__add { align-self: flex-start; }

/* Acting-as notice */
.c-acting-as { display: flex; align-items: center; gap: var(--space-2h); padding: var(--space-2h) var(--space-3h); border: 1px solid var(--tone-sky-border); border-radius: var(--radius-md); background: var(--tone-sky-bg); color: var(--tone-sky-text); font-size: var(--text-sm); font-weight: var(--weight-medium); }

/* Progress */
.c-progress-wrap { display: flex; align-items: center; gap: var(--space-3); }
.c-progress { appearance: none; width: 100%; min-width: 120px; height: 8px; border: 0; border-radius: 4px; background: var(--color-surface-alt); overflow: hidden; }
.c-progress::-webkit-progress-bar { background: var(--color-surface-alt); border-radius: 4px; }
.c-progress::-webkit-progress-value { background: var(--bar-info); border-radius: 4px; transition: width var(--duration-slow) var(--ease-out); }
.c-progress::-moz-progress-bar { background: var(--bar-info); border-radius: 4px; }
.c-progress--complete::-webkit-progress-value { background: var(--bar-success); }
.c-progress--complete::-moz-progress-bar { background: var(--bar-success); }
.c-progress-wrap__label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-muted); white-space: nowrap; }

/* Dropdown menu (<details>, no JS needed; app.js closes it on outside click / Esc) */
.c-menu { position: relative; }
.c-menu__panel { position: absolute; right: 0; top: calc(100% + var(--space-1h)); z-index: var(--z-menu); min-width: 220px; padding: var(--space-1h); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-menu); box-shadow: var(--shadow-md); animation: rf-fade var(--duration-fast) var(--ease-out) both; }
.c-menu__item { display: flex; align-items: center; gap: var(--space-2h); width: 100%; padding: 9px var(--space-2h); border: 0; border-radius: var(--radius-item); background: none; color: var(--color-ink-body); text-align: left; cursor: pointer; font-size: var(--text-base); font-weight: var(--weight-medium); transition: background-color var(--duration-fast) var(--ease-out); }
.c-menu__item .c-icon { color: var(--color-ink-muted); }
.c-menu__item:hover { background: var(--color-canvas); color: var(--color-ink); text-decoration: none; }

/* Logo preview (ADM-32 report branding) */
.c-logo-preview { display: block; max-width: 240px; max-height: 96px; object-fit: contain; padding: var(--space-2); background: var(--color-surface-locked); border: 1px solid var(--color-border-locked); border-radius: var(--radius-md); }

/* Style guide (local only) */
.c-styleguide-section { scroll-margin-top: calc(var(--topbar-height) + var(--space-4)); }
.c-styleguide-toc { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-6); font-size: var(--text-sm); font-weight: var(--weight-semibold); }

/* Notice (read-only banners) */
.c-notice { padding: var(--space-3) var(--space-3h); border: 1px solid var(--tone-sky-border); border-radius: var(--radius-menu); background: var(--tone-sky-bg); color: var(--tone-sky-text); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.c-notice--success { background: var(--tone-success-bg); border-color: var(--tone-success-border); color: var(--tone-success-text); }
.c-notice--warning { background: var(--tone-warning-bg); border-color: var(--tone-warning-border); color: var(--tone-warning-text); }
.c-notice--danger { background: var(--tone-error-bg); border-color: var(--tone-error-border); color: var(--tone-error-text); }

/* Workflow builder outline (ADM-18): current row = builder tint + 3px ink rule */
.c-outline, .c-outline__tasks { list-style: none; margin: 0; padding: 0; }
.l-builder__outline .c-card__body { padding: var(--space-4); }
.c-outline__stage + .c-outline__stage { margin-top: var(--space-5); }
.c-outline__row { display: flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-item); color: inherit; transition: background-color var(--duration-fast) var(--ease-out); }
.c-outline__row:hover { background: var(--color-canvas); text-decoration: none; color: inherit; }
.c-outline__row.is-selected { background: var(--color-surface-builder); box-shadow: inset 3px 0 0 var(--color-ink); font-weight: var(--weight-bold); }
.c-outline__stage-row { font-weight: var(--weight-bold); }
.c-outline__tasks { padding-left: var(--space-5); }
/* Task rows: code and type on the first line, the title on its own line so it never wraps beside them */
.c-outline__tasks .c-outline__row { flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); padding-top: var(--space-2); padding-bottom: var(--space-2); line-height: var(--leading-snug, 1.4); }
.c-outline__tasks .c-outline__row > span:not([class]) { order: 3; flex-basis: 100%; line-height: var(--leading-tight); }
.c-outline__tasks .c-outline__code { order: 1; }
.c-outline__tasks .c-outline__mark { order: 2; }
.c-outline__tasks .c-outline__type { order: 2; }
.c-outline__code { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); white-space: nowrap; }
.c-outline__type { margin-left: auto; font-size: var(--text-xs); color: var(--fg-muted); white-space: nowrap; }
.c-outline__mark { color: var(--fg-muted); font-size: var(--text-xs); }
.c-outline__empty { padding: var(--space-2); font-size: var(--text-sm); color: var(--fg-muted); }
/* Outline as a flow: stage nodes joined by a rule, tasks hang off it */
.c-outline__stage { position: relative; }
.c-outline__stage-row { background: var(--color-canvas); border: 1px solid var(--border); }
.c-outline__stage-row.is-selected { border-color: var(--color-ink); }
.c-outline__tasks { margin: var(--space-2) 0 0 var(--space-4); padding-left: var(--space-4); display: grid; gap: var(--space-1); border-left: 2px solid var(--border); }
.c-outline__tasks > li { position: relative; }
.c-outline__tasks > li::before { content: ""; position: absolute; left: calc(-1 * var(--space-4)); top: 22px; width: var(--space-3); border-top: 2px solid var(--border); }
.c-outline__add { margin: var(--space-5) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.c-outline__add > summary { list-style: none; cursor: pointer; width: 100%; justify-content: center; }
.c-outline__add > summary::-webkit-details-marker { display: none; }
.c-outline__add[open] > summary { margin-bottom: var(--space-3); }
/* Version settings as a slim bar instead of a full card above the panes */
.c-builder-bar { margin-bottom: var(--space-4); }
.c-builder-bar > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2h) var(--space-4); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.c-builder-bar > summary::-webkit-details-marker { display: none; }
.c-builder-bar > summary::after { content: "Edit"; margin-left: auto; font-size: var(--text-sm); color: var(--fg-muted); }
.c-builder-bar[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.c-builder-bar[open] > summary::after { content: "Close"; }
.c-builder-bar__title { font-weight: var(--weight-bold); }
.c-builder-bar__meta { font-size: var(--text-sm); color: var(--fg-muted); }
.c-builder-bar > .c-card { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.c-builder-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3h); }
.c-builder-fields > .is-wide { grid-column: 1 / -1; }
.c-builder-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.c-builder-actions { display: flex; flex-wrap: wrap; gap: var(--space-2h); align-items: center; }

/* Procedure content blocks (ADM-18, M08 §4) */
.c-block { border: 1px solid var(--border); border-radius: var(--radius-menu); padding: var(--space-4); background: var(--bg-surface); display: grid; gap: var(--space-3); }
.c-block--caution { border-color: var(--tone-warning-border); background: var(--tone-warning-bg); }
.c-blocks [data-list-items] { counter-reset: block; }
.c-blocks [data-list-items] > .c-block { counter-increment: block; }
.c-blocks [data-list-items] > .c-block > .c-block__bar > .c-block__title::before { content: counter(block) ". "; color: var(--fg-muted); font-family: var(--font-mono); }
.c-block__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.c-block__title { font-weight: var(--weight-bold); }
.c-block__sub { border-left: 2px solid var(--color-accent-border); padding-left: var(--space-3); display: grid; gap: var(--space-2); }
.c-block__item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.c-block__preview img { max-width: 240px; max-height: 180px; border: 1px solid var(--border); border-radius: var(--radius-md); }
[data-md-options][hidden] { display: none; }
.c-cond-group { display: grid; gap: var(--space-3); border-left: 2px solid var(--color-accent-border); padding-left: var(--space-3); }
.c-cond-node { display: grid; gap: var(--space-2); }
.c-cond-node--group { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-menu); padding: var(--space-3); }
.c-cond-node__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.c-cond-leaf { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-2); align-items: end; }
.c-cond-leaf [hidden], .c-cond-group [hidden] { display: none !important; }

/* Validation profile criteria (ADM-22, M09 R6) */
.c-builder-fields--dense { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.c-criterion-kind { margin: var(--space-3) 0; padding: var(--space-2h) var(--space-3h); border: 1px solid var(--color-border-locked); border-radius: var(--radius-md); background: var(--color-surface-locked); font-size: var(--text-sm); color: var(--color-ink-secondary); }
.c-criterion-kind:empty { display: none; }
[data-cr-kind="recorded"] > .c-criterion-kind { font-style: italic; }
[data-cr-kind="warn-only"] > .c-criterion-kind { background: var(--tone-warning-bg); border-color: var(--tone-warning-border); color: var(--tone-warning-text); }
[data-cr-kind="simple"] > .c-criterion-kind, [data-cr-kind="range"] > .c-criterion-kind { background: var(--tone-info-bg); border-color: var(--tone-info-border); color: var(--color-ink-body); }
.c-check-group[data-cr-field="critical"] { margin: var(--space-3) 0; padding: var(--space-3); background: var(--tone-error-bg); border: 1px solid var(--tone-error-border); border-radius: var(--radius-md); }
.c-check-group[data-cr-field="critical"] .c-check__hint { color: var(--tone-error-text); }
/* Exceptions (ADM-25/26): the reason is what the decision turns on, so it is large and never truncated */
.c-reason { font-size: var(--text-lg); line-height: 1.5; white-space: pre-wrap; }
/* A submission's raw payload (review queue). */
.c-code { margin: var(--space-2) 0 0; padding: var(--space-3); background: var(--color-surface-locked); border: 1px solid var(--color-border-locked); border-radius: var(--radius-md); overflow-x: auto; font-family: var(--font-mono); font-size: var(--text-xs); white-space: pre-wrap; word-break: break-word; }
.c-clamp summary { cursor: pointer; }
.c-clamp[open] summary { display: none; }
.c-clamp p { margin: 0; white-space: pre-wrap; }

/* ADM-38 draft preview: the frame that shows the generated PDF. */
.c-preview-frame { display: block; width: 100%; height: 80vh; min-height: 480px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); }
.c-preview-form .c-select { width: 9rem; }
.c-preview-form .c-field { margin: 0; }

/* Dashboard KPI cards (ADM-04, design 3.5) */
.c-section-title { font-size: var(--text-md); margin: 0 0 var(--space-3); }
.c-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3h); margin: 0; }
.c-stat { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) var(--space-4h); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: inherit; transition: border-color var(--duration-fast) var(--ease-out), transform var(--duration-base) var(--ease-out); }
a.c-stat:hover { text-decoration: none; color: inherit; border-color: var(--color-ink-weak); transform: translateY(-2px); }
.c-stat--warning { background: var(--tone-warning-bg); border-color: var(--tone-warning-border); }
.c-stat--warning .c-stat__value { color: var(--tone-warning-text); }
.c-stat--danger { background: var(--tone-error-bg); border-color: var(--tone-error-border); }
.c-stat--danger .c-stat__value, .c-stat--danger .c-stat__label, .c-stat--danger .c-stat__detail { color: var(--tone-error-text); }
.c-stat--warning .c-stat__label, .c-stat--warning .c-stat__detail { color: var(--tone-warning-text); }
.c-stat__value { font-size: var(--text-xl); font-weight: var(--weight-extrabold); letter-spacing: var(--tracking-title); line-height: 1.1; margin: 0; }
.c-stat__label { font-size: var(--text-sm); color: var(--color-ink-secondary); }
.c-stat__label--headline { font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--color-ink); }
.c-stat__detail { font-size: var(--text-xs); color: var(--fg-muted); }
.c-stat-grid--plain .c-stat { flex-direction: column-reverse; justify-content: flex-end; }
.c-steps { margin: var(--space-3) 0 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); }

/* Audit browser (ADM-30) */
.c-audit-toggle { display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2); padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-ink-secondary); cursor: pointer; }
.c-audit-toggle:hover { color: var(--color-ink); }
.c-audit-toggle .c-icon { transition: transform var(--duration-fast) var(--ease-out); }
.c-audit-toggle[aria-expanded="true"] .c-icon { transform: rotate(90deg); }
.c-table tbody tr.is-expanded > td { border-bottom-color: transparent; }
.c-table tbody tr.c-audit-detail-row:hover, .c-table tbody tr.c-audit-detail-row > td { background: var(--color-canvas); }
.c-audit-detail { max-width: 960px; padding: var(--space-2) var(--space-2) var(--space-3); font-size: var(--text-sm); }
.c-audit-details { margin-top: var(--space-2); font-size: var(--text-sm); }
.c-audit-details > summary, .c-audit-fold > summary { cursor: pointer; color: var(--color-ink-secondary); font-weight: var(--weight-semibold); }
.c-audit-details[open] { max-width: 640px; }
.c-audit-payload { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: var(--space-1) var(--space-3); margin: var(--space-2) 0; font-size: var(--text-sm); }
.c-audit-payload dt { color: var(--fg-muted); }
.c-audit-payload dd { margin: 0; min-width: 0; }
.c-audit-meta { padding-top: var(--space-3); border-top: 1px solid var(--color-divider-card); }
.u-break { overflow-wrap: anywhere; }
.c-pager { display: flex; justify-content: space-between; gap: var(--space-4); }

/* Floating-label field (sign-in): label sits inside the box above the value; optional trailing toggle */
.c-field--float { position: relative; }
.c-field--float .c-field__label { position: absolute; top: 11px; left: 17px; z-index: 1; margin: 0; font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--color-ink-muted); pointer-events: none; }
.c-field--float .c-input { height: 68px; padding: 24px 17px 0; border-radius: 18px; font-size: var(--text-md); }
.c-field__control { position: relative; }
.c-field__control .c-input { padding-right: 76px; }
.c-field__toggle { position: absolute; right: 17px; bottom: 14px; padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-body); font-weight: var(--weight-semibold); color: var(--color-accent); cursor: pointer; }
.c-field__toggle:hover { color: var(--color-accent-hover); }

/* Menu header (account name and role at the top of the avatar menu) */
.c-menu__header { padding: var(--space-2h) var(--space-2h) var(--space-2); margin-bottom: var(--space-1); border-bottom: 1px solid var(--color-divider-card); }
.c-menu__header-name { font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--color-ink); }
.c-menu__header-sub { font-size: var(--text-xs); color: var(--color-ink-muted); }

/* Help dialog contact */
.c-help-contact { display: flex; align-items: center; gap: var(--space-2h); margin: 0; padding: var(--space-3h) var(--space-4); border-radius: var(--radius-md); background: var(--color-accent-tint); font-weight: var(--weight-semibold); }
.c-help-contact .c-icon { color: var(--color-accent); }

/* Search palette (Ctrl/⌘ + K) */
.c-palette { width: 640px; max-width: calc(100vw - 48px); margin: 12vh auto auto; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-modal); background: var(--bg-surface); color: var(--color-ink-body); box-shadow: 0 24px 60px -20px rgba(20, 22, 26, .35); overflow: hidden; }
.c-palette::backdrop { background: var(--scrim-modal); }
.c-palette__form { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-5); height: 60px; border-bottom: 1px solid var(--border); }
.c-palette__form .c-icon { color: var(--color-ink-muted); }
.c-palette__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--text-md); color: var(--color-ink); }
.c-palette__input::-webkit-search-cancel-button { display: none; }
.c-palette__body { max-height: 360px; overflow-y: auto; padding: var(--space-2); }
.c-palette__status { margin: 0; padding: var(--space-6) var(--space-4); text-align: center; font-size: var(--text-body); color: var(--color-ink-muted); }
.c-palette__list { list-style: none; margin: 0; padding: 0; }
.c-palette__list a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2h) var(--space-3); border-radius: var(--radius-item); color: inherit; }
.c-palette__list a:hover { text-decoration: none; }
.c-palette__list li.is-active a { background: var(--color-accent-tint); }
.c-palette__list .c-icon { flex: none; color: var(--color-ink-muted); }
.c-palette__list li.is-active .c-icon { color: var(--color-accent); }
.c-palette__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.c-palette__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--weight-semibold); color: var(--color-ink); }
.c-palette__detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); color: var(--color-ink-muted); }
.c-palette__type { flex: none; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-ink-muted); }
.c-palette__foot { display: flex; gap: var(--space-5); padding: var(--space-2h) var(--space-5); border-top: 1px solid var(--border); background: var(--color-surface-head); font-size: var(--text-xs); color: var(--color-ink-muted); }
.c-palette__foot kbd { margin-right: 4px; }

/* KPI cards: icon tile + value + label + optional sub-line (platform dashboard) */
.c-kpi-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-3h); margin: 0; }
.c-kpi { display: flex; align-items: center; gap: var(--space-3h); padding: var(--space-4); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.c-kpi__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; }
.c-kpi__icon .c-icon { width: 22px; height: 22px; }
.c-kpi__icon--violet { background: var(--color-accent-tint-strong); color: var(--color-accent); }
.c-kpi__icon--green { background: var(--tone-success-bg); color: var(--tone-success-text); }
.c-kpi__icon--amber { background: var(--tone-warning-bg); color: var(--tone-warning-text); }
.c-kpi__icon--blue { background: var(--tone-sky-bg); color: var(--tone-sky-text); }
.c-kpi__icon--red { background: var(--tone-error-bg); color: var(--tone-error-text); }
.c-kpi__icon--gray { background: var(--tone-neutral-bg); color: var(--tone-neutral-text); }
.c-kpi__value { margin: 0; font-size: var(--text-xl); font-weight: var(--weight-extrabold); letter-spacing: var(--tracking-title); line-height: 1.1; color: var(--color-ink); }
.c-kpi__label { font-size: var(--text-sm); color: var(--color-ink-secondary); }
.c-kpi__sub { margin-top: 2px; font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.c-kpi__sub--success { color: var(--tone-success-text); }
.c-kpi__sub--warning { color: var(--tone-warning-text); }
.c-kpi__sub--danger { color: var(--tone-error-text); }

/* Icon tile used in attention and activity rows */
.c-tile { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-md); }
.c-tile--neutral { background: var(--tone-neutral-bg); color: var(--tone-neutral-text); }
.c-tile--info { background: var(--tone-info-bg); color: var(--tone-info-text); }
.c-tile--success { background: var(--tone-success-bg); color: var(--tone-success-text); }
.c-tile--warning { background: var(--tone-warning-bg); color: var(--tone-warning-text); }
.c-tile--error { background: var(--tone-error-bg); color: var(--tone-error-text); }

/* Rows of "tile · title + detail · chevron" (needs attention, recent activity) */
.c-attention { list-style: none; margin: 0; padding: 0; }
.c-attention li + li { border-top: 1px solid var(--color-divider); }
.c-attention__row { display: flex; align-items: center; gap: var(--space-3h); padding: var(--space-3h) var(--space-4h); color: inherit; transition: background-color var(--duration-fast) var(--ease-out); }
a.c-attention__row:hover { background: var(--color-surface-selected); text-decoration: none; }
.c-attention__row > .c-icon { margin-left: auto; color: var(--color-ink-faint); }
.c-attention__text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.c-attention__title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--color-ink); }
.c-attention__detail { font-size: var(--text-xs); color: var(--color-ink-muted); }
.c-attention--compact .c-attention__row { padding-block: var(--space-3); }
.c-attention--compact .c-tile { width: 36px; height: 36px; }
.c-attention__empty { display: flex; align-items: center; gap: var(--space-2h); margin: 0; padding: var(--space-4) var(--space-4h); font-size: var(--text-base); color: var(--tone-success-text); }

/* Label left, value right rows inside a flush card */
.c-kv--rows { gap: 0; }
.c-kv--rows dt, .c-kv--rows dd { padding: var(--space-3) 0; border-top: 1px solid var(--color-divider); font-size: var(--text-base); }
.c-kv--rows dt:first-of-type, .c-kv--rows dt:first-of-type + dd { border-top: 0; }
.c-kv--rows dt { padding-left: var(--space-4h); color: var(--color-ink-muted); font-size: var(--text-base); }
.c-kv--rows dd { padding-right: var(--space-4h); text-align: right; }
.c-table .c-table__strong { color: var(--color-ink); font-weight: var(--weight-bold); }
.c-table .c-table__strong:hover { text-decoration: none; color: var(--color-accent); }

/* Organization dashboard additions */
.c-card__link { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--color-accent); }
.c-attention__count { font-size: inherit; font-weight: var(--weight-extrabold); letter-spacing: 0; }
.c-table__sub { margin-top: 2px; font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-ink-muted); }
.c-progress-wrap--compact { gap: var(--space-2); min-width: 90px; }
.c-progress-wrap--compact .c-progress { min-width: 44px; }
.c-progress-wrap--compact .c-progress-wrap__label { min-width: 34px; text-align: right; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-ink-secondary); }
.c-progress--amber::-webkit-progress-value { background: var(--bar-warning); }
.c-progress--amber::-moz-progress-bar { background: var(--bar-warning); }
.c-usage { display: flex; flex-direction: column; gap: var(--space-2h); }
.c-usage__row { display: flex; justify-content: space-between; font-size: var(--text-base); color: var(--color-ink-body); }
.c-usage__figure { font-weight: var(--weight-bold); color: var(--color-ink); }
.c-usage .c-progress { width: 100%; }
.c-usage__note { margin: var(--space-1h) 0 0; font-size: var(--text-sm); color: var(--color-ink-muted); }
.c-usage__note--error { color: var(--tone-error-text); font-weight: var(--weight-semibold); }

/* Figure card that links to the list behind it */
a.c-kpi { color: inherit; transition: border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
a.c-kpi:hover { text-decoration: none; border-color: var(--color-ink-weak); transform: translateY(-2px); }
a.c-kpi:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
