/*
 * Dokino Components
 * Reusable UI primitives: buttons, fields, cards, chips, tables, badges,
 * alerts, dialogs, tabs, pagination, empty states, snackbar and more.
 * Depends on tokens.css and base.css.
 */

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 40px;
    max-width: 100%;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-label-lg);
    font-weight: 600;
    line-height: 1;
    color: var(--md-sys-color-primary);
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--md-sys-shape-full);
    transition: background-color var(--motion-fast) var(--motion-easing),
        color var(--motion-fast) var(--motion-easing),
        border-color var(--motion-fast) var(--motion-easing),
        box-shadow var(--motion-fast) var(--motion-easing);
}

.btn:hover {
    text-decoration: none;
    background-color: var(--md-sys-color-hover-overlay);
}

.btn:active {
    background-color: var(--md-sys-color-pressed-overlay);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.55;
}

.btn .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-filled {
    color: var(--md-sys-color-on-primary);
    background-color: var(--md-sys-color-primary);
}

.btn-filled:hover {
    color: var(--md-sys-color-on-primary);
    background-color: var(--md-sys-color-primary-hover);
}

.btn-filled:active {
    background-color: var(--md-sys-color-primary-active);
}

.btn-tonal {
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
}

.btn-tonal:hover {
    color: var(--md-sys-color-on-primary-container);
    background-color: color-mix(in srgb, var(--md-sys-color-primary-container) 88%, var(--md-sys-color-primary));
}

.btn-outlined {
    color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-outline-variant);
}

.btn-outlined:hover {
    border-color: var(--md-sys-color-primary);
}

.btn-text {
    padding-inline: var(--space-3);
}

.btn-danger {
    color: var(--md-sys-color-on-error);
    background-color: var(--md-sys-color-error);
}

.btn-danger:hover {
    color: var(--md-sys-color-on-error);
    background-color: color-mix(in srgb, var(--md-sys-color-error) 88%, #000);
}

.btn-danger-outlined {
    color: var(--md-sys-color-error);
    border-color: color-mix(in srgb, var(--md-sys-color-error) 48%, transparent);
}

.btn-danger-outlined:hover {
    color: var(--md-sys-color-error);
    border-color: var(--md-sys-color-error);
    background-color: color-mix(in srgb, var(--md-sys-color-error) 8%, transparent);
}

.btn-sm {
    min-height: 34px;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-label-md);
}

.btn-sm .icon {
    width: 18px;
    height: 18px;
}

.btn-lg {
    min-height: 48px;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-title-sm);
}

.btn-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--md-sys-shape-full);
}

.btn-icon.btn-sm {
    width: 34px;
    min-width: 34px;
    height: 34px;
}

/* Touch devices: 44px is the comfortable minimum target size. Density stays
 * unchanged on mouse/keyboard devices, where 34–40px is precise enough. */
@media (pointer: coarse) {
    .btn,
    .btn-sm {
        min-height: 44px;
    }

    .btn-icon,
    .btn-icon.btn-sm {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }
}

.btn-block {
    width: 100%;
}

.btn .spinner {
    width: 18px;
    height: 18px;
}

/* On filled/danger buttons the default spinner would sit on a same-colored
 * background; switch it to the button's own text color so it stays visible. */
.btn-filled .spinner,
.btn-danger .spinner {
    border-color: color-mix(in srgb, currentcolor 30%, transparent);
    border-top-color: currentcolor;
}

/* --- Icons --- */

.icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: currentcolor;
    stroke: none;
}

/* --- Spinner --- */

.spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--md-sys-color-primary-container);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) 0;
}

.spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 4px;
}

.processing-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-10) var(--space-6);
    text-align: center;
}

.quote-block {
    padding: var(--space-3) var(--space-4);
    background-color: var(--md-sys-color-surface-container-low);
    border-inline-start: 4px solid var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-xs);
}

/* --- Form fields --- */

.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-5);
}

.field-label {
    font-size: var(--text-label-lg);
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.field-hint {
    font-size: var(--text-label-md);
    color: var(--md-sys-color-on-surface-variant);
}

.amount-words {
    display: block;
    min-height: 1.4em;
    overflow-wrap: anywhere;
}

.field-required {
    color: var(--md-sys-color-error);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-body-md);
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-sm);
    transition: border-color var(--motion-fast) var(--motion-easing),
        box-shadow var(--motion-fast) var(--motion-easing);
    appearance: none;
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--md-sys-color-outline);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.7;
}

.input:disabled,
.select:disabled,
.textarea:disabled {
    color: var(--md-sys-color-on-surface-variant);
    background-color: var(--md-sys-color-surface-container);
    cursor: not-allowed;
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.select {
    padding-inline-end: var(--space-8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2373777f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left var(--space-3) center;
}

/* iOS Safari zooms the whole page in when a focused input is smaller than
 * 16px; keep phone forms stable. */
@media (max-width: 767.98px) {
    .input,
    .select,
    .textarea {
        font-size: 16px;
    }
}

.input-otp {
    direction: ltr;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    letter-spacing: 0.6em;
    text-align: center;
}

.input-error,
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
    border-color: var(--md-sys-color-error);
}

.field-error {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-label-md);
    color: var(--md-sys-color-error);
}

.field-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    font-size: var(--text-body-sm);
    cursor: pointer;
}

.field-check input[type="checkbox"],
.field-check input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--md-sys-color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* Phones: stack form actions full-width so long Persian labels can never
 * squeeze or overflow the pill shape (same pattern as .dialog-footer). */
@media (max-width: 479px) {
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* --- Collapsible field guide (e.g. WordPress Application Password) --- */

.field-guide {
    padding: var(--space-4);
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-sm);
    font-size: var(--text-body-sm);
}

.field-guide > summary {
    font-size: var(--text-label-lg);
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    list-style-position: inside;
}

.field-guide[open] > summary {
    margin-bottom: var(--space-3);
}

.guide-steps {
    margin: 0;
    padding-inline-start: var(--space-6);
    color: var(--md-sys-color-on-surface-variant);
    line-height: var(--leading-relaxed);
    /* base.css resets lists; restore numbered steps (Persian digits where
       the browser supports the "persian" counter style, decimal otherwise). */
    list-style: decimal;
    list-style: persian;
}

.guide-steps li + li {
    margin-top: var(--space-2);
}

.guide-note {
    margin-top: var(--space-3);
    font-size: var(--text-label-md);
    color: var(--md-sys-color-on-surface-variant);
    line-height: var(--leading-relaxed);
}

/* --- Search bar --- */

.search-bar {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.search-bar .icon {
    position: absolute;
    top: 50%;
    inset-inline-start: var(--space-3);
    width: 20px;
    height: 20px;
    color: var(--md-sys-color-on-surface-variant);
    transform: translateY(-50%);
    pointer-events: none;
}

.search-bar .input {
    padding-inline-start: var(--space-10);
}

/* --- List filters (search + chip rows) --- */

.list-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.list-filters .search-bar {
    margin-inline-start: auto;
}

.list-filters .chip-row-full {
    flex-basis: 100%;
}

@media (max-width: 767.98px) {
    .list-filters {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }

    /* On phones search is the primary action: full-width and above the filters. */
    .list-filters .search-bar {
        order: -1;
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
        margin-inline-start: 0;
    }

    /* One swipeable line per chip row instead of a ragged multi-line wrap. */
    .list-filters .chip-row {
        width: 100%;
        min-width: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-block: 3px 5px;
    }

    .list-filters .chip-row::-webkit-scrollbar {
        display: none;
    }

    .list-filters .chip {
        flex: 0 0 auto;
        min-height: 38px;
    }
}

/* --- Cards --- */

.card {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-md);
    box-shadow: var(--md-sys-elevation-1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--md-sys-color-divider);
}

.card-title {
    font-size: var(--text-title-md);
    font-weight: 700;
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--md-sys-color-divider);
}

.card-hover {
    transition: box-shadow var(--motion-medium) var(--motion-easing),
        transform var(--motion-medium) var(--motion-easing);
}

.card-hover:hover {
    box-shadow: var(--md-sys-elevation-3);
    transform: translateY(-2px);
}

/* --- Stat cards --- */

/* Explicit breakpoints keep every row perfectly filled for the 4-card grids
   used on the dashboard overview and the wallet page: one column on phones,
   two on tablets, four on wide desktop. */
.stat-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
}

@media (min-width: 600px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 6.5rem;
    padding: var(--space-5);
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-md);
    box-shadow: var(--md-sys-elevation-1);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
    border-radius: var(--md-sys-shape-sm);
    flex-shrink: 0;
}

.stat-icon.success {
    color: var(--md-sys-color-on-success-container);
    background-color: var(--md-sys-color-success-container);
}

.stat-icon.warning {
    color: var(--md-sys-color-on-warning-container);
    background-color: var(--md-sys-color-warning-container);
}

.stat-icon.error {
    color: var(--md-sys-color-on-error-container);
    background-color: var(--md-sys-color-error-container);
}

.stat-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-value {
    font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.6rem);
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    /* Never break a number mid-digits; wrap only at natural boundaries. */
    overflow-wrap: normal;
}

.stat-label {
    font-size: var(--text-label-md);
    line-height: 1.5;
    color: var(--md-sys-color-on-surface-variant);
    overflow-wrap: normal;
}

/* --- Money display (amount and unit never break or reorder) --- */

.money {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px var(--space-2);
    max-width: 100%;
}

.money-value {
    font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.6rem);
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.money-unit {
    font-size: var(--text-label-md);
    font-weight: 600;
    white-space: nowrap;
    color: var(--md-sys-color-on-surface-variant);
}

.money-lg .money-value {
    font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem);
}

.money-lg .money-unit {
    font-size: var(--text-body-sm);
}

/* Money summary cards: icon + title on top, amount spans the full card width
   so long amounts always fit without shrinking the font or overflowing. */
.money-card {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
}

.money-card-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.money-card .stat-label {
    font-size: var(--text-label-lg);
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.stat-card-featured {
    border-color: var(--md-sys-color-primary);
}

a.stat-card {
    color: inherit;
    text-decoration: none;
}

a.stat-card:hover {
    color: inherit;
    text-decoration: none;
}

/* --- Wallet banner (dashboard overview) --- */

.wallet-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-6);
    padding: var(--space-5) var(--space-6);
}

.wallet-banner-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-width: 0;
}

.wallet-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
    border-radius: var(--md-sys-shape-sm);
}

.wallet-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wallet-banner-label {
    font-size: var(--text-label-md);
    color: var(--md-sys-color-on-surface-variant);
}

.wallet-banner-note {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-body-sm);
    color: var(--md-sys-color-on-surface-variant);
}

.wallet-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

@media (max-width: 599.98px) {
    .wallet-banner {
        padding: var(--space-5);
    }

    .wallet-banner-actions {
        width: 100%;
    }

    .wallet-banner-actions .btn {
        flex: 1;
    }
}

/* --- Badges --- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px var(--space-3);
    font-size: var(--text-label-sm);
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    border-radius: var(--md-sys-shape-full);
}

.badge-primary {
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
}

.badge-neutral {
    color: var(--md-sys-color-on-surface-variant);
    background-color: var(--md-sys-color-surface-container-high);
}

.badge-success {
    color: var(--md-sys-color-on-success-container);
    background-color: var(--md-sys-color-success-container);
}

.badge-warning {
    color: var(--md-sys-color-on-warning-container);
    background-color: var(--md-sys-color-warning-container);
}

.badge-error {
    color: var(--md-sys-color-on-error-container);
    background-color: var(--md-sys-color-error-container);
}

.badge-info {
    color: var(--md-sys-color-on-info-container);
    background-color: var(--md-sys-color-info-container);
}

.badge-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: currentcolor;
}

/* --- Chips (filters) --- */

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 34px;
    padding: var(--space-1) var(--space-4);
    font-size: var(--text-label-md);
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    background-color: transparent;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-full);
    transition: background-color var(--motion-fast) var(--motion-easing),
        color var(--motion-fast) var(--motion-easing),
        border-color var(--motion-fast) var(--motion-easing);
}

.chip:hover {
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    background-color: var(--md-sys-color-hover-overlay);
}

.chip.active,
.chip[aria-current="true"] {
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
    border-color: transparent;
}

/* --- Alerts --- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-body-sm);
    border-radius: var(--md-sys-shape-sm);
    border: 1px solid transparent;
}

.alert .icon {
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-info {
    color: var(--md-sys-color-on-info-container);
    background-color: var(--md-sys-color-info-container);
}

.alert-success {
    color: var(--md-sys-color-on-success-container);
    background-color: var(--md-sys-color-success-container);
}

.alert-warning {
    color: var(--md-sys-color-on-warning-container);
    background-color: var(--md-sys-color-warning-container);
}

.alert-error {
    color: var(--md-sys-color-on-error-container);
    background-color: var(--md-sys-color-error-container);
}

/* --- Tables --- */

.table-wrap {
    overflow-x: auto;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-md);
    box-shadow: var(--md-sys-elevation-1);
}

.table-wrap-plain {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.table {
    width: 100%;
    min-width: 640px;
    font-size: var(--text-body-sm);
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: start;
    vertical-align: middle;
    border-bottom: 1px solid var(--md-sys-color-divider);
}

.table th {
    font-size: var(--text-label-md);
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    background-color: var(--md-sys-color-surface-container-low);
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color var(--motion-fast) var(--motion-easing);
}

.table tbody tr:hover {
    background-color: var(--md-sys-color-hover-overlay);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table .cell-actions {
    display: flex;
    gap: var(--space-1);
    justify-content: flex-end;
}

/* --- Pagination --- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-5) 0 0;
}

.pagination-count {
    margin-top: var(--space-4);
    font-size: var(--text-label-md);
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 var(--space-2);
    font-size: var(--text-label-lg);
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--md-sys-shape-full);
    transition: background-color var(--motion-fast) var(--motion-easing),
        color var(--motion-fast) var(--motion-easing);
}

.page-link:hover {
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    background-color: var(--md-sys-color-hover-overlay);
}

.page-link.active {
    color: var(--md-sys-color-on-primary);
    background-color: var(--md-sys-color-primary);
}

.page-link.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.page-ellipsis {
    padding: 0 var(--space-1);
    color: var(--md-sys-color-on-surface-variant);
}

/* --- Breadcrumb --- */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    font-size: var(--text-body-sm);
    color: var(--md-sys-color-on-surface-variant);
}

.breadcrumb a {
    color: var(--md-sys-color-on-surface-variant);
}

.breadcrumb a:hover {
    color: var(--md-sys-color-primary);
}

.breadcrumb .sep {
    color: var(--md-sys-color-outline);
}

/* --- Page header --- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.page-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-display-sm);
    font-weight: 700;
}

.page-subtitle {
    margin-top: var(--space-1);
    font-size: var(--text-body-sm);
    color: var(--md-sys-color-on-surface-variant);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* --- Empty state --- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-8) var(--space-6);
    text-align: center;
}

.empty-state .icon {
    width: 56px;
    height: 56px;
    color: var(--md-sys-color-outline);
}

.empty-title {
    font-size: var(--text-title-md);
    font-weight: 700;
}

.empty-text {
    max-width: 420px;
    font-size: var(--text-body-sm);
    color: var(--md-sys-color-on-surface-variant);
}

/* --- Tabs --- */

.tabs {
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    border-bottom: 1px solid var(--md-sys-color-divider);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-label-lg);
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color var(--motion-fast) var(--motion-easing),
        border-color var(--motion-fast) var(--motion-easing);
}

.tab:hover {
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
}

.tab.active {
    color: var(--md-sys-color-primary);
    border-bottom-color: var(--md-sys-color-primary);
}

/* --- Dropdown menu --- */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    z-index: 500;
    top: calc(100% + var(--space-2));
    inset-inline-end: 0;
    min-width: 200px;
    padding: var(--space-2);
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-sm);
    box-shadow: var(--md-sys-elevation-3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--motion-fast) var(--motion-easing),
        transform var(--motion-fast) var(--motion-easing),
        visibility var(--motion-fast);
}

.dropdown.open .dropdown-menu,
.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-body-sm);
    color: var(--md-sys-color-on-surface);
    text-align: start;
    text-decoration: none;
    background: none;
    border: none;
    border-radius: var(--md-sys-shape-xs);
    cursor: pointer;
    transition: background-color var(--motion-fast) var(--motion-easing);
}

.dropdown-item:hover {
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    background-color: var(--md-sys-color-hover-overlay);
}

.dropdown-item .icon {
    width: 20px;
    height: 20px;
    color: var(--md-sys-color-on-surface-variant);
}

.dropdown-item.danger {
    color: var(--md-sys-color-error);
}

.dropdown-item.danger .icon {
    color: var(--md-sys-color-error);
}

.dropdown-divider {
    height: 1px;
    margin: var(--space-2) 0;
    background-color: var(--md-sys-color-divider);
}

.dropdown-user {
    padding: var(--space-2) var(--space-3);
}

/* --- Dialog --- */

dialog.dialog {
    /* Restore native centered positioning (the global margin reset breaks it). */
    margin: auto;
    width: min(520px, calc(100vw - var(--space-8)));
    padding: 0;
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-lg);
    box-shadow: var(--md-sys-elevation-4);
}

dialog.dialog[open] {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--space-8));
    max-height: calc(100dvh - var(--space-8));
}

dialog.dialog::backdrop {
    background-color: var(--md-sys-color-scrim);
    backdrop-filter: blur(2px);
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-shrink: 0;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--md-sys-color-divider);
}

.dialog-title {
    font-size: var(--text-title-md);
    font-weight: 700;
}

.dialog-body {
    padding: var(--space-5);
    overflow-y: auto;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    flex-shrink: 0;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--md-sys-color-divider);
}

.dialog-footer .btn {
    flex-shrink: 0;
}

@media (max-width: 479px) {
    .dialog-footer {
        flex-direction: column-reverse;
    }

    .dialog-footer .btn {
        width: 100%;
    }
}

/* --- Snackbar / toast --- */

.snackbar-stack {
    position: fixed;
    z-index: 1500;
    bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    inset-inline-start: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: min(420px, calc(100vw - var(--space-8)));
    pointer-events: none;
}

.snackbar {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    overflow: hidden;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-body-sm);
    line-height: var(--leading-relaxed);
    color: var(--md-sys-color-inverse-on-surface);
    background-color: var(--md-sys-color-inverse-surface);
    border-radius: var(--md-sys-shape-sm);
    box-shadow: var(--md-sys-elevation-3);
    animation: snackbar-in var(--motion-medium) var(--motion-easing);
    pointer-events: auto;
}

.snackbar.success { border-inline-start: 4px solid var(--md-sys-color-success); }
.snackbar.error { border-inline-start: 4px solid var(--md-sys-color-error); }
.snackbar.warning { border-inline-start: 4px solid var(--md-sys-color-warning); }
.snackbar.info { border-inline-start: 4px solid var(--md-sys-color-info); }

.snackbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    flex-shrink: 0;
}

.snackbar-icon svg {
    width: 18px;
    height: 18px;
}

.snackbar.success .snackbar-icon { color: var(--md-sys-color-success); }
.snackbar.error .snackbar-icon { color: var(--md-sys-color-error); }
.snackbar.warning .snackbar-icon { color: var(--md-sys-color-warning); }
.snackbar.info .snackbar-icon { color: var(--md-sys-color-info); }

.snackbar-body {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.snackbar-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    opacity: 0.35;
    transform-origin: right center;
    animation: snackbar-progress 6s linear forwards;
}

.snackbar:hover .snackbar-progress,
.snackbar.is-paused .snackbar-progress {
    animation-play-state: paused;
}

.snackbar-leaving {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms ease, transform 200ms ease;
}

@keyframes snackbar-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.snackbar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -2px -4px 0 0;
    color: inherit;
    opacity: 0.65;
    border-radius: 50%;
    flex-shrink: 0;
}

.snackbar-close:hover {
    opacity: 1;
    background-color: color-mix(in srgb, currentColor 12%, transparent);
}

.snackbar-close svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 479px) {
    .snackbar-stack {
        inset-inline: var(--space-3);
        max-width: none;
    }
}

@keyframes snackbar-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Copy field --- */

.copy-group {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
}

.copy-group .input {
    font-family: var(--font-mono);
    font-size: var(--text-body-sm);
    direction: ltr;
    text-align: left;
}

/* --- Definition rows --- */

.detail-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px dashed var(--md-sys-color-divider);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    min-width: 150px;
    font-size: var(--text-body-sm);
    color: var(--md-sys-color-on-surface-variant);
}

.detail-value {
    flex: 1;
    font-size: var(--text-body-sm);
    font-weight: 500;
    word-break: break-word;
}

/* --- Progress bar --- */

.progress {
    overflow: hidden;
    height: 8px;
    background-color: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-full);
}

.progress-bar {
    height: 100%;
    background-color: var(--md-sys-color-primary);
    border-radius: inherit;
    transition: width var(--motion-slow) var(--motion-easing);
}

/* --- Skeleton --- */

.skeleton {
    position: relative;
    overflow: hidden;
    background-color: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-xs);
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(100%);
    background-image: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--md-sys-color-surface) 60%, transparent),
        transparent
    );
    animation: skeleton-shimmer 1.4s infinite;
}

@keyframes skeleton-shimmer {
    100% { transform: translateX(-100%); }
}

/* --- Avatar --- */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: var(--text-label-lg);
    font-weight: 700;
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--text-label-md);
}

.avatar-lg {
    width: 72px;
    height: 72px;
    font-size: var(--text-headline-sm);
}

/* --- Avatar picker (profile upload) --- */

.avatar-picker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-4);
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-md);
}

.avatar-picker-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    flex: 1;
}

.avatar-picker-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.avatar-picker-input {
    display: none;
}

.avatar-remove {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-label-lg);
    color: var(--md-sys-color-error);
    cursor: pointer;
}

.avatar-picker-status {
    font-size: var(--text-label-md);
    color: var(--md-sys-color-on-surface-variant);
}

.avatar-picker-status[data-kind="error"] {
    color: var(--md-sys-color-error);
}

/* --- Divider --- */

.divider {
    height: 1px;
    margin: var(--space-4) 0;
    background-color: var(--md-sys-color-divider);
    border: none;
}

/* --- Tooltip --- */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 600;
    bottom: calc(100% + 6px);
    inset-inline-start: 50%;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-label-sm);
    font-weight: 500;
    color: var(--md-sys-color-inverse-on-surface);
    white-space: nowrap;
    background-color: var(--md-sys-color-inverse-surface);
    border-radius: var(--md-sys-shape-xs);
    opacity: 0;
    visibility: hidden;
    transform: translateX(50%);
    transition: opacity var(--motion-fast) var(--motion-easing),
        visibility var(--motion-fast);
    pointer-events: none;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

/* --- Conversation thread --- */

.thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.thread-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    max-width: 82%;
}

.thread-mine {
    align-self: flex-start;
}

.thread-other {
    align-self: flex-end;
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-inline: var(--space-1);
}

.thread-other .thread-meta {
    justify-content: flex-end;
}

.thread-bubble {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-body-sm);
    line-height: var(--leading-relaxed);
    border-radius: var(--md-sys-shape-md);
}

.thread-mine .thread-bubble {
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
    border-start-start-radius: var(--md-sys-shape-xs);
}

.thread-other .thread-bubble {
    background-color: var(--md-sys-color-surface-container-high);
    border-start-end-radius: var(--md-sys-shape-xs);
}

/* --- Markdown rendered content --- */

.prose {
    font-size: var(--text-body-lg);
    line-height: var(--leading-relaxed);
    color: var(--md-sys-color-on-surface);
    word-break: break-word;
}

.prose > * + * {
    margin-top: var(--space-4);
}

.prose h2 {
    margin-top: var(--space-8);
    font-size: var(--text-headline-sm);
}

.prose h3 {
    margin-top: var(--space-6);
    font-size: var(--text-title-lg);
}

.prose ul,
.prose ol {
    padding-inline-start: var(--space-6);
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li + li {
    margin-top: var(--space-1);
}

.prose blockquote {
    padding: var(--space-3) var(--space-4);
    color: var(--md-sys-color-on-surface-variant);
    background-color: var(--md-sys-color-surface-container-low);
    border-inline-start: 4px solid var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-xs);
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--md-sys-shape-sm);
}

.prose pre {
    max-width: 100%;
    padding: var(--space-3) var(--space-4);
    overflow-x: auto;
    font-size: var(--text-body-sm);
    background-color: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-sm);
}

.prose table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    font-size: var(--text-body-sm);
}

.prose th,
.prose td {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--md-sys-color-divider);
}

.prose th {
    background-color: var(--md-sys-color-surface-container-low);
}

.prose a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Split layouts (main + side column) --- */

.split-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-6);
}

.split-grid > .split-main {
    flex: 1;
    min-width: min(100%, 480px);
}

.split-grid > .split-side {
    flex: 1;
    min-width: min(100%, 300px);
    max-width: 440px;
}

/* Equal-height split columns (dashboard overview): the cards stretch to the
   same height and their content areas absorb the extra space instead of
   leaving one card visibly shorter than the other. */
.split-grid-equal {
    align-items: stretch;
}

.split-grid-equal > .card {
    display: flex;
    flex-direction: column;
}

.split-grid-equal > .card > .table-wrap,
.split-grid-equal > .card > .empty-state {
    flex: 1;
}

.split-grid-equal > .card > .empty-state {
    justify-content: center;
}

/* --- Variant detail: the publish panel keeps its history next to it --- */

@media (max-width: 851.98px) {
    /* Below the width where the article and the action rail stop fitting
       side by side, the rail dissolves and the publish panel and its history
       move above the article, so the history is always one glance away. */
    .variant-detail-split {
        flex-direction: column;
        align-items: stretch;
    }

    .variant-detail-split > .split-side {
        display: contents;
    }

    .variant-detail-split > .split-side > .card {
        order: 4;
    }

    .variant-detail-split > .split-side > [data-publish-card] {
        order: 1;
    }

    .variant-detail-split > .split-side > [data-publish-history] {
        order: 2;
    }

    .variant-detail-split > .split-main {
        order: 3;
    }
}

/* Compact publication rows: readable in the narrow rail and on mobile,
   without the horizontal scroll a wide table would force. */

.publish-log-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-md);
}

.publish-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.publish-log-date {
    font-size: var(--text-label-sm);
    color: var(--md-sys-color-on-surface-variant);
}

.publish-log-site {
    font-size: var(--text-label-md);
    color: var(--md-sys-color-on-surface-variant);
    word-break: break-all;
}

.publish-log-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.publish-log-error {
    font-size: var(--text-label-md);
    color: var(--md-sys-color-error);
}

/* --- Form rows --- */

.field-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.field-row > * {
    flex: 1;
    min-width: min(100%, 200px);
}

/* --- Numeric / LTR aligned cells --- */

.amount-cell {
    direction: ltr;
    text-align: end;
    font-variant-numeric: tabular-nums;
}

/* --- Transaction description cells --- */

.trx-desc-cell {
    max-width: 320px;
}

.trx-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Bank transfer card --- */

.bank-card {
    color: var(--md-sys-color-on-primary-container);
    background-color: var(--md-sys-color-primary-container);
    border-radius: var(--md-sys-shape-md);
    padding: var(--space-5);
}

.bank-card + .bank-card {
    margin-top: var(--space-4);
}

.bank-card-label {
    display: block;
    font-size: var(--text-label-md);
    opacity: 0.8;
    margin-bottom: var(--space-1);
}

.bank-card-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 36px;
}

.bank-card-number {
    font-size: var(--text-title-lg);
    font-weight: 700;
    letter-spacing: 0.12em;
    direction: ltr;
    unicode-bidi: embed;
}

.bank-card .btn {
    color: inherit;
}

/* --- Image gallery (generated content suggestions) --- */

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

.image-tile {
    position: relative;
    overflow: hidden;
    border-radius: var(--md-sys-shape-sm);
    border: 1px solid var(--md-sys-color-divider);
    background-color: var(--md-sys-color-surface-container-low);
}

.image-tile-preview {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
}

.image-tile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--motion-medium) var(--motion-easing);
}

.image-tile:hover .image-tile-preview img {
    transform: scale(1.04);
}

.image-tile-actions {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
    opacity: 0;
    transition: opacity var(--motion-medium) var(--motion-easing);
}

.image-tile-actions .btn {
    padding-inline: 10px;
}

.image-tile:hover .image-tile-actions,
.image-tile:focus-within .image-tile-actions {
    opacity: 1;
}

@media (hover: none) {
    .image-tile-actions {
        opacity: 1;
    }
}

/* --- Landing helpers --- */

/* The hidden state is scoped to .js (set in the document head) so content
   stays visible when JavaScript is unavailable. */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms var(--motion-easing), transform 600ms var(--motion-easing);
}

.js [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.narrow-container {
    width: 100%;
    max-width: 780px;
    margin-inline: auto;
}

.cta-card {
    padding: var(--space-10) var(--space-6);
    text-align: center;
}

.plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding-block-end: var(--space-2);
    border-bottom: 1px dashed var(--md-sys-color-divider);
}

.plan-row:last-child {
    padding-block-end: 0;
    border-bottom: none;
}

/* --- Live field counter --- */

.field-counter {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-label-md);
    color: var(--md-sys-color-on-surface-variant);
}

.field-counter.is-limit {
    color: var(--md-sys-color-error);
}

/* --- Variant rows (topic detail) --- */

.variant-row {
    padding-block-end: var(--space-4);
    border-bottom: 1px dashed var(--md-sys-color-divider);
}

.variant-row:last-child {
    padding-block-end: 0;
    border-bottom: none;
}

/* --- Publish preview (content/variant_preview.html) --- */

.preview-shell {
    overflow: hidden;
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-lg);
    background-color: var(--md-sys-color-surface);
}

.preview-sitebar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background-color: var(--md-sys-color-surface-container-low);
    border-block-end: 1px solid var(--md-sys-color-divider);
}

.preview-post {
    padding: var(--space-8) var(--space-6);
}

.preview-title {
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 700;
    line-height: 1.6;
    margin-block-end: var(--space-3);
}

.preview-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--text-label-md);
    margin-block-end: var(--space-6);
}

.preview-hero {
    margin-block-end: var(--space-6);
    border: 1px solid var(--md-sys-color-divider);
    border-radius: var(--md-sys-shape-md);
    overflow: hidden;
}

.preview-hero img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

.preview-social {
    padding: var(--space-6);
}

.preview-social-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-4);
}

.preview-social-body {
    font-size: var(--text-body-md);
    line-height: 1.9;
}

.preview-social-actions {
    margin-block-start: var(--space-4);
}

/* --- Readiness checklist (preview side column) --- */

.check-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-body-sm);
    color: var(--md-sys-color-on-surface);
}

.check-row .icon {
    flex: none;
    margin-block-start: 2px;
}

.check-row.is-ok .icon {
    color: var(--md-sys-color-success);
}

.check-row.is-warning .icon {
    color: var(--md-sys-color-warning);
}

.check-row.is-error .icon {
    color: var(--md-sys-color-error);
}

/* --- Confirmation dialog (destructive actions) --- */

.confirm-dialog-body {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

.confirm-dialog-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--md-sys-shape-full);
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.confirm-dialog-text {
    font-size: var(--text-body-md);
    line-height: 1.9;
}

.confirm-dialog-subject {
    display: block;
    margin-block-start: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--md-sys-shape-sm);
    background-color: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-divider);
    font-size: var(--text-body-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
