/* Tokenised 2026-08-08 against proaudit-theme.css. Previously 89 raw literals and
   zero tokens, in a file all three themed layouts load — including #dd9142 five
   times, which opted the whole file out of ProAuditLayout's per-tenant white-label
   rewrite, plus Tailwind's #b91c1c / #7c3aed / #16a34a and two cool off-whites.
   The --rt-* aliases are kept and now POINT AT house tokens, which is the shape
   .claude/rules/theme-ui.md prescribes; what it forbids is an alias holding a
   literal, because that reads as tokenised to every grep while being hardcoded.

   TWO DELIBERATE SPLITS, both because --pa-teal / --pa-orange are FILL tokens:
   * --rt-teal-text (--pa-teal-deep) carries every `color:`. --pa-teal as text is
     2.70:1 on --pa-card — under even the 3:1 non-text bar, so the teal check
     glyphs and eyebrows were failing.
   * --rt-trial-text carries the trial pill's label, which sits on an orange TINT
     where --pa-orange-deep alone is 4.36:1; the house mix is 6.43:1.
   The deep twin also ended up on ~10 `border-color` / `accent-color` state
   indicators (input :focus, active tab, selected bundle, checkbox). That began as
   an over-broad substring replace on my part, then was kept on review: every one
   is a STATE indicator, where 5.52:1 beats 2.92:1 and WCAG 1.4.11 actually
   applies. Fills, dots and the inset selection bars stay on --rt-teal. */
    .rt-apply-dialog {
        --rt-charcoal: var(--pa-ink);
        --rt-teal: var(--pa-teal);
        --rt-teal-text: var(--pa-teal-deep);
        --rt-orange: var(--pa-orange);
        --rt-trial: var(--pa-orange);
        /* Orange TEXT on an orange TINT: the house mix, not the raw token.
           --pa-orange-deep alone is 4.36:1 over a tinted ground. */
        --rt-trial-text: color-mix(in srgb, var(--pa-orange-deep) 70%, var(--pa-ink));
        --rt-border: var(--pa-hair);
        --rt-border-strong: var(--pa-hair-strong);
        --rt-text-muted: var(--pa-muted);
        font-family: var(--pa-font-body);
    }
    .rt-apply-dialog .mud-dialog {
        max-width: 640px !important;
        width: min(640px, 96vw) !important;
    }
    .rt-apply-summary {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.85rem 1rem;
        background: linear-gradient(135deg, color-mix(in srgb, var(--pa-teal) 6%, transparent), color-mix(in srgb, var(--pa-orange) 6%, transparent));
        border: 1px solid var(--rt-border);
        border-radius: 8px;
        margin-bottom: 1.25rem;
    }
    .rt-apply-summary-icon {
        width: 38px;
        height: 38px;
        background: var(--pa-card);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--rt-teal-text);
        flex-shrink: 0;
        border: 1px solid var(--rt-border);
    }
    .rt-apply-summary-title {
        font-size: 1rem;
        font-weight: 700;
        margin: 0;
        color: var(--rt-charcoal);
    }
    .rt-apply-summary-meta {
        margin: 0.1rem 0 0 0;
        font-size: 0.75rem;
        color: var(--rt-text-muted);
    }

    .rt-field { margin-bottom: 1.25rem; }

    .rt-field-label {
        display: block;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--rt-charcoal);
        margin-bottom: 0.4rem;
    }

    .rt-search-wrap {
        position: relative;
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
    }
    .rt-search-icon {
        position: absolute;
        left: 0.75rem;
        color: var(--rt-text-muted);
        pointer-events: none;
    }
    .rt-search-input {
        width: 100%;
        padding: 0.6rem 0.75rem 0.6rem 2.25rem;
        border: 1px solid var(--rt-border-strong);
        border-radius: 6px;
        font-size: 0.875rem;
        font-family: inherit;
        outline: none;
    }
    .rt-search-input:focus { border-color: var(--rt-teal-text); }

    .rt-search-loading {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        color: var(--rt-text-muted);
    }
    .rt-search-empty {
        padding: 0.85rem 0.75rem;
        font-size: 0.8125rem;
        color: var(--rt-text-muted);
        font-style: italic;
    }

    .rt-result-list {
        max-height: 240px;
        overflow-y: auto;
        border: 1px solid var(--rt-border);
        border-radius: 6px;
        background: var(--pa-card);
    }

    .rt-result-row {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.65rem 0.85rem;
        background: var(--pa-card);
        border: none;
        border-bottom: 1px solid var(--rt-border);
        text-align: left;
        cursor: pointer;
        font-family: inherit;
        transition: background 0.12s ease;
    }
    .rt-result-row:last-child { border-bottom: none; }
    .rt-result-row:hover { background: color-mix(in srgb, var(--pa-teal) 4%, transparent); }
    .rt-result-row.selected {
        background: color-mix(in srgb, var(--pa-teal) 8%, transparent);
        box-shadow: inset 3px 0 0 var(--rt-teal);
    }

    .rt-result-row-main {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex: 1;
        min-width: 0;
    }
    .rt-result-name {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--rt-charcoal);
    }
    .rt-trial-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.18rem 0.55rem;
        background: var(--pa-orange-tint);
        color: var(--rt-trial-text);
        font-size: 0.6875rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-radius: 999px;
        white-space: nowrap;
    }
    .rt-trial-dot {
        width: 6px;
        height: 6px;
        background: var(--rt-trial);
        border-radius: 50%;
        animation: pulse 1.6s ease-in-out infinite;
    }
    .rt-trial-meta {
        text-transform: none;
        letter-spacing: 0;
        font-weight: 500;
        opacity: 0.85;
    }
    @keyframes pulse {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.5; transform: scale(0.85); }
    }
    .rt-standard-pill {
        padding: 0.18rem 0.55rem;
        background: color-mix(in srgb, var(--pa-ink) 6%, transparent);
        color: var(--rt-text-muted);
        font-size: 0.6875rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-radius: 999px;
        white-space: nowrap;
    }
    .rt-selected-check { color: var(--rt-teal-text); }

    .rt-mode-section { margin-bottom: 1.25rem; }
    .rt-mode-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .rt-mode-card {
        display: block;
        padding: 0.75rem;
        background: var(--pa-card);
        border: 1px solid var(--rt-border-strong);
        border-radius: 6px;
        cursor: pointer;
        text-align: left;
        font-family: inherit;
        transition: all 0.15s ease;
    }
    .rt-mode-card:hover {
        background: color-mix(in srgb, var(--pa-teal) 3%, transparent);
        border-color: var(--rt-teal-text);
    }
    .rt-mode-card.active {
        background: color-mix(in srgb, var(--pa-teal) 6%, transparent);
        border-color: var(--rt-teal-text);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--pa-teal) 10%, transparent);
    }
    .rt-mode-card-head {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.8125rem;
        font-weight: 700;
        color: var(--rt-charcoal);
        margin-bottom: 0.4rem;
    }
    .rt-mode-recommended {
        margin-left: auto;
        font-size: 0.625rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        background: color-mix(in srgb, var(--pa-teal) 10%, transparent);
        color: var(--rt-teal-text);
        padding: 0.12rem 0.4rem;
        border-radius: 999px;
    }
    .rt-mode-card-body {
        font-size: 0.75rem;
        color: var(--rt-text-muted);
        line-height: 1.5;
        margin: 0;
    }

    .rt-apply-result {
        background: color-mix(in srgb, var(--pa-teal) 6%, transparent);
        border: 1px solid color-mix(in srgb, var(--pa-teal) 25%, transparent);
        color: var(--rt-charcoal);
        padding: 0.85rem 1rem;
        border-radius: 6px;
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    .rt-apply-result strong { color: var(--rt-charcoal); font-weight: 700; }
    .rt-apply-result ul {
        margin: 0.5rem 0 0 1.25rem;
        padding: 0;
    }
    .rt-apply-result li { line-height: 1.6; font-size: 0.8125rem; }

    .rt-error {
        background: var(--pa-bad-bg);
        border: 1px solid var(--pa-bad-border);
        color: var(--pa-bad-fg);
        padding: 0.6rem 0.75rem;
        border-radius: 6px;
        font-size: 0.8125rem;
    }

    .rt-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.55rem 1rem;
        border-radius: 6px;
        font-size: 0.8125rem;
        font-weight: 600;
        cursor: pointer;
        border: 1px solid transparent;
        font-family: inherit;
    }
    .rt-btn-primary { background: var(--rt-orange); color: var(--pa-orange-fg); border-color: var(--rt-orange); }
    .rt-btn-primary:hover:not([disabled]) { background: var(--pa-orange-hover); }
    .rt-btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }
    .rt-btn-ghost { background: transparent; color: var(--rt-charcoal); border-color: var(--rt-border-strong); }
    .rt-btn-ghost:hover { background: color-mix(in srgb, var(--pa-ink) 4%, transparent); }

    .rt-add-dialog {
        --rt-charcoal: var(--pa-ink);
        --rt-teal: var(--pa-teal);
        --rt-teal-text: var(--pa-teal-deep);
        --rt-orange: var(--pa-orange);
        --rt-border: var(--pa-hair);
        --rt-border-strong: var(--pa-hair-strong);
        --rt-text-muted: var(--pa-muted);
        font-family: var(--pa-font-body);
    }
    .rt-add-dialog .mud-dialog {
        max-width: 760px !important;
        width: min(760px, 96vw) !important;
    }
    .rt-dialog-lead {
        font-size: 0.875rem;
        color: var(--rt-text-muted);
        line-height: 1.55;
        margin: 0 0 1rem 0;
    }
    .rt-dialog-lead em { color: var(--rt-charcoal); font-style: normal; font-weight: 600; }

    .rt-add-toolbar {
        display: flex;
        gap: 1rem;
        align-items: center;
        margin-bottom: 1rem;
    }
    .rt-search-wrap {
        flex: 1;
        position: relative;
        display: flex;
        align-items: center;
    }
    .rt-search-icon {
        position: absolute;
        left: 0.75rem;
        color: var(--rt-text-muted);
        pointer-events: none;
    }
    .rt-search-input {
        width: 100%;
        padding: 0.55rem 0.75rem 0.55rem 2.25rem;
        border: 1px solid var(--rt-border-strong);
        border-radius: 6px;
        font-size: 0.875rem;
        font-family: inherit;
        outline: none;
    }
    .rt-search-input:focus { border-color: var(--rt-teal-text); }
    .rt-add-counter {
        font-size: 0.8125rem;
        color: var(--rt-text-muted);
        flex-shrink: 0;
    }
    .rt-add-counter strong { color: var(--rt-teal-text); }

    .rt-add-loading,
    .rt-add-empty {
        padding: 1.5rem;
        text-align: center;
        color: var(--rt-text-muted);
        font-size: 0.875rem;
    }

    .rt-section-label {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        margin: 1rem 0 0.6rem 0;
        padding-bottom: 0.4rem;
        border-bottom: 1px solid var(--rt-border);
    }
    .rt-section-label:first-child { margin-top: 0; }
    .rt-section-eyebrow {
        font-size: 0.6875rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: var(--rt-teal-text);
    }
    .rt-section-meta {
        font-size: 0.75rem;
        color: var(--rt-text-muted);
    }

    /* ── BUNDLES ── */
    .rt-bundle-list {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        margin-bottom: 1rem;
    }
    .rt-bundle {
        position: relative;
        background: var(--pa-card);
        border: 1px solid var(--rt-border-strong);
        border-radius: 8px;
        overflow: hidden;
        transition: all 0.18s ease;
    }
    .rt-bundle:hover { box-shadow: 0 4px 14px color-mix(in srgb, var(--pa-shadow-ink) 6%, transparent); }
    .rt-bundle--some { border-color: color-mix(in srgb, var(--pa-teal) 45%, transparent); }
    .rt-bundle--all  {
        border-color: var(--rt-teal-text);
        background: linear-gradient(180deg, var(--pa-card), color-mix(in srgb, var(--pa-teal) 4%, transparent));
    }

    .rt-bundle-accent {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 4px;
        opacity: 0.85;
    }

    .rt-bundle-head {
        display: flex;
        align-items: flex-start;
        gap: 0.7rem;
        padding: 0.85rem 1rem 0.85rem 1.1rem;
    }

    .rt-bundle-expand {
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0.15rem 0.3rem;
        color: var(--rt-text-muted);
        font-family: inherit;
        font-size: 1.1rem;
        line-height: 1;
        flex-shrink: 0;
    }
    .rt-bundle-chev {
        display: inline-block;
        transition: transform 0.18s ease;
        font-size: 1.2rem;
        line-height: 1;
    }
    .rt-bundle-chev.open { transform: rotate(90deg); color: var(--rt-teal-text); }

    .rt-bundle-icon {
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: color-mix(in srgb, var(--pa-teal) 8%, transparent);
        color: var(--rt-teal-text);
        border-radius: 6px;
    }
    .rt-bundle-icon svg { width: 18px; height: 18px; }

    .rt-bundle-main { flex: 1; min-width: 0; }

    .rt-bundle-title-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.4rem;
    }

    .rt-bundle-name {
        font-size: 0.9375rem;
        font-weight: 700;
        color: var(--rt-charcoal);
        margin-right: 0.2rem;
    }

    .rt-bundle-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        padding: 0.18rem 0.5rem;
        background: linear-gradient(135deg, var(--rt-orange), var(--pa-orange-hover));
        color: var(--pa-orange-fg);
        font-size: 0.625rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        border-radius: 999px;
    }
    .rt-bundle-badge svg { width: 11px; height: 11px; }

    .rt-bundle-cat-chip {
        font-size: 0.625rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 0.18rem 0.5rem;
        border-radius: 999px;
    }

    .rt-bundle-count {
        font-size: 0.75rem;
        color: var(--rt-text-muted);
        font-weight: 600;
    }

    .rt-bundle-type {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.15rem 0.45rem;
        border-radius: 4px;
        font-size: 0.625rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .rt-bundle-type svg { width: 10px; height: 10px; }
    .rt-bundle-type--locked {
        background: var(--pa-bad-bg);
        color: var(--pa-bad-fg);
        border: 1px solid var(--pa-bad-border);
    }
    .rt-bundle-type--coll {
        background: color-mix(in srgb, var(--pa-teal) 6%, transparent);
        color: var(--rt-teal-text);
        border: 1px solid color-mix(in srgb, var(--pa-teal) 20%, transparent);
    }

    .rt-bundle-desc {
        margin: 0.3rem 0 0 0;
        font-size: 0.8125rem;
        color: var(--rt-text-muted);
        line-height: 1.5;
        max-width: 480px;
    }

    .rt-bundle-actions { flex-shrink: 0; }

    .rt-bundle-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.4rem 0.85rem;
        background: var(--rt-orange);
        color: var(--pa-orange-fg);
        border: 1px solid var(--rt-orange);
        border-radius: 5px;
        font-size: 0.8125rem;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: all 0.15s ease;
    }
    .rt-bundle-btn--add:hover { background: var(--pa-orange-hover); border-color: var(--pa-orange-hover); }
    .rt-bundle-btn--clear {
        background: color-mix(in srgb, var(--pa-teal) 8%, transparent);
        color: var(--rt-teal-text);
        border-color: color-mix(in srgb, var(--pa-teal) 40%, transparent);
    }
    .rt-bundle-btn--clear:hover {
        background: color-mix(in srgb, var(--pa-teal) 14%, transparent);
        border-color: var(--rt-teal-text);
    }
    .rt-bundle-btn--clear svg { width: 12px; height: 12px; }

    .rt-bundle-btn-count {
        background: color-mix(in srgb, var(--pa-card) 35%, transparent);
        padding: 0.1rem 0.4rem;
        border-radius: 999px;
        font-size: 0.6875rem;
        font-weight: 700;
        margin-left: 0.1rem;
    }

    .rt-bundle-loading {
        padding: 1rem;
        display: flex;
        gap: 0.5rem;
        align-items: center;
        font-size: 0.8125rem;
        color: var(--rt-text-muted);
        border-top: 1px dashed var(--rt-border);
    }

    .rt-bundle-rule-list {
        list-style: none;
        margin: 0;
        padding: 0;
        background: var(--pa-card-tint);
        border-top: 1px dashed var(--rt-border);
    }

    .rt-bundle-rule { border-bottom: 1px solid var(--rt-border); }
    .rt-bundle-rule:last-child { border-bottom: none; }

    .rt-bundle-rule-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.45rem 1rem 0.45rem 3.4rem;
        background: transparent;
        border: none;
        font-family: inherit;
        font-size: 0.8125rem;
        cursor: pointer;
        text-align: left;
        color: var(--rt-charcoal);
        transition: background 0.12s ease;
    }
    .rt-bundle-rule-toggle:hover:not([disabled]) { background: color-mix(in srgb, var(--pa-teal) 5%, transparent); }
    .rt-bundle-rule-toggle[disabled] {
        cursor: not-allowed;
        color: var(--rt-text-muted);
        background: color-mix(in srgb, var(--pa-ink) 3%, transparent);
    }
    .rt-bundle-rule.picked { background: color-mix(in srgb, var(--pa-teal) 6%, transparent); }
    .rt-bundle-rule.picked .rt-bundle-rule-toggle { color: var(--rt-teal-text); font-weight: 600; }

    .rt-bundle-rule-name { flex: 1; }

    .rt-bundle-rule-tag {
        font-size: 0.625rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 0.15rem 0.45rem;
        border-radius: 999px;
        background: color-mix(in srgb, var(--pa-ink) 7%, transparent);
        color: var(--rt-text-muted);
    }

    /* ── INDIVIDUAL RULE LIST ── */
    .rt-add-list {
        max-height: 320px;
        overflow-y: auto;
        border: 1px solid var(--rt-border);
        border-radius: 6px;
    }
    .rt-add-row {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
        padding: 0.65rem 0.85rem;
        background: var(--pa-card);
        border: none;
        border-bottom: 1px solid var(--rt-border);
        text-align: left;
        cursor: pointer;
        font-family: inherit;
        transition: background 0.12s ease;
    }
    .rt-add-row:last-child { border-bottom: none; }
    .rt-add-row:hover { background: color-mix(in srgb, var(--pa-teal) 4%, transparent); }
    .rt-add-row.selected {
        background: color-mix(in srgb, var(--pa-teal) 8%, transparent);
        box-shadow: inset 3px 0 0 var(--rt-teal);
    }
    .rt-add-row-check { color: var(--rt-text-muted); flex-shrink: 0; padding-top: 0.1rem; }
    .rt-add-row.selected .rt-add-row-check { color: var(--rt-teal-text); }
    .rt-add-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
    .rt-add-row-line1 {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .rt-add-row-name {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--rt-charcoal);
    }
    .rt-add-row-desc {
        font-size: 0.75rem;
        color: var(--rt-text-muted);
        line-height: 1.4;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .rt-cat-chip {
        font-size: 0.625rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 0.15rem 0.45rem;
        border-radius: 999px;
        line-height: 1;
        white-space: nowrap;
    }
    .rt-add-row-vars {
        font-size: 0.625rem;
        font-weight: 600;
        color: var(--pa-adas-fg);
        background: var(--pa-adas-bg);
        padding: 0.1rem 0.4rem;
        border-radius: 4px;
    }

    .rt-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.55rem 1rem;
        border-radius: 6px;
        font-size: 0.8125rem;
        font-weight: 600;
        cursor: pointer;
        border: 1px solid transparent;
        font-family: inherit;
    }
    .rt-btn-primary { background: var(--rt-orange); color: var(--pa-orange-fg); border-color: var(--rt-orange); }
    .rt-btn-primary:hover:not([disabled]) { background: var(--pa-orange-hover); }
    .rt-btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }
    .rt-btn-ghost { background: transparent; color: var(--rt-charcoal); border-color: var(--rt-border-strong); }
    .rt-btn-ghost:hover { background: color-mix(in srgb, var(--pa-ink) 4%, transparent); }

    .rt-dialog {
        --rt-charcoal: var(--pa-ink);
        --rt-teal: var(--pa-teal);
        --rt-teal-text: var(--pa-teal-deep);
        --rt-orange: var(--pa-orange);
        --rt-border: var(--pa-hair);
        --rt-border-strong: var(--pa-hair-strong);
        --rt-text-muted: var(--pa-muted);
        font-family: var(--pa-font-body);
    }

    .rt-dialog-lead {
        font-size: 0.875rem;
        color: var(--rt-text-muted);
        line-height: 1.5;
        margin: 0 0 1.25rem 0;
    }

    .rt-field {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        margin-bottom: 1rem;
    }

    .rt-field-label {
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--rt-charcoal);
    }

    .rt-field-input {
        padding: 0.6rem 0.75rem;
        border: 1px solid var(--rt-border-strong);
        border-radius: 6px;
        font-size: 0.875rem;
        font-family: inherit;
        color: var(--rt-charcoal);
        background: var(--pa-card);
        outline: none;
        transition: border-color 0.15s ease;
    }

    .rt-field-input:focus {
        border-color: var(--rt-teal-text);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--pa-teal) 10%, transparent);
    }

    .rt-field-textarea {
        resize: vertical;
        min-height: 70px;
    }

    .rt-field-help {
        font-size: 0.75rem;
        color: var(--rt-text-muted);
    }

    .rt-error {
        background: var(--pa-bad-bg);
        border: 1px solid var(--pa-bad-border);
        color: var(--pa-bad-fg);
        padding: 0.6rem 0.75rem;
        border-radius: 6px;
        font-size: 0.8125rem;
        margin-top: 0.5rem;
    }

    .rt-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.55rem 1rem;
        border-radius: 6px;
        font-size: 0.8125rem;
        font-weight: 600;
        cursor: pointer;
        border: 1px solid transparent;
        transition: all 0.15s ease;
        font-family: inherit;
    }

    .rt-btn-primary { background: var(--rt-orange); color: var(--pa-orange-fg); border-color: var(--rt-orange); }
    .rt-btn-primary:hover:not([disabled]) { background: var(--pa-orange-hover); border-color: var(--pa-orange-hover); }
    .rt-btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }

    .rt-btn-ghost { background: transparent; color: var(--rt-charcoal); border-color: var(--rt-border-strong); }
    .rt-btn-ghost:hover { background: color-mix(in srgb, var(--pa-ink) 4%, transparent); }

    .rt-dialog {
        --rt-charcoal: var(--pa-ink);
        --rt-teal: var(--pa-teal);
        --rt-teal-text: var(--pa-teal-deep);
        --rt-orange: var(--pa-orange);
        --rt-border: var(--pa-hair);
        --rt-border-strong: var(--pa-hair-strong);
        --rt-text-muted: var(--pa-muted);
        --rt-good: var(--pa-ok-fg);
        --rt-bad: var(--pa-bad-fg);
        font-family: var(--pa-font-body);
    }
    .rt-dialog-lead {
        font-size: 0.875rem;
        color: var(--rt-text-muted);
        line-height: 1.5;
        margin: 0 0 1rem 0;
    }
    .rt-import-tabs {
        display: flex;
        gap: 0.4rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid var(--rt-border);
        padding-bottom: 0;
    }
    .rt-tab-btn {
        padding: 0.5rem 0.85rem;
        background: transparent;
        border: none;
        border-bottom: 2px solid transparent;
        color: var(--rt-text-muted);
        font-size: 0.8125rem;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        transition: all 0.15s ease;
    }
    .rt-tab-btn.active {
        color: var(--rt-teal-text);
        border-bottom-color: var(--rt-teal-text);
    }
    .rt-paste-area {
        width: 100%;
        min-height: 200px;
        padding: 0.6rem 0.75rem;
        font-family: var(--pa-font-mono);
        font-size: 0.8125rem;
        background: var(--pa-card-tint);
        border: 1px solid var(--rt-border-strong);
        border-radius: 6px;
        color: var(--rt-charcoal);
        outline: none;
        resize: vertical;
        margin-bottom: 1rem;
    }
    .rt-paste-area:focus { border-color: var(--rt-teal-text); }
    .rt-upload {
        padding: 1.25rem;
        background: var(--pa-card-tint);
        border: 1px dashed var(--rt-border-strong);
        border-radius: 6px;
        margin-bottom: 1rem;
    }
    .rt-upload-input {
        display: block;
        font-size: 0.875rem;
        color: var(--rt-charcoal);
    }
    .rt-upload-preview {
        margin-top: 0.75rem;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.4rem 0.75rem;
        background: var(--pa-card);
        border: 1px solid var(--rt-border);
        border-radius: 5px;
        font-size: 0.8125rem;
        color: var(--rt-charcoal);
    }
    .rt-upload-size {
        color: var(--rt-text-muted);
        font-size: 0.75rem;
        font-weight: 600;
    }
    .rt-overwrite-toggle {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.8125rem;
        color: var(--rt-text-muted);
        line-height: 1.5;
        margin-bottom: 1rem;
        cursor: pointer;
    }
    .rt-overwrite-toggle input { margin-top: 0.18rem; accent-color: var(--rt-teal-text); }
    .rt-overwrite-toggle strong { color: var(--rt-charcoal); }
    .rt-import-result {
        background: var(--pa-card-tint);
        border: 1px solid var(--rt-border);
        border-radius: 6px;
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
    .rt-import-result-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.875rem;
        color: var(--rt-charcoal);
        margin-bottom: 0.35rem;
    }
    .rt-import-result-num {
        font-size: 1rem;
        font-weight: 700;
        min-width: 28px;
        text-align: center;
        padding: 0.18rem 0.4rem;
        border-radius: 4px;
        line-height: 1;
    }
    .rt-import-result-good { background: var(--pa-ok-bg); color: var(--rt-good); }
    .rt-import-result-bad  { background: var(--pa-bad-bg); color: var(--rt-bad); }
    .rt-import-unmatched {
        margin: 0.4rem 0 0 2.5rem;
        padding: 0;
        font-size: 0.8125rem;
        color: var(--rt-text-muted);
    }
    .rt-import-unmatched li { line-height: 1.6; }
    .rt-error {
        background: var(--pa-bad-bg);
        border: 1px solid var(--pa-bad-border);
        color: var(--pa-bad-fg);
        padding: 0.6rem 0.75rem;
        border-radius: 6px;
        font-size: 0.8125rem;
    }
    .rt-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.55rem 1rem;
        border-radius: 6px;
        font-size: 0.8125rem;
        font-weight: 600;
        cursor: pointer;
        border: 1px solid transparent;
        font-family: inherit;
    }
    .rt-btn-primary { background: var(--rt-orange); color: var(--pa-orange-fg); border-color: var(--rt-orange); }
    .rt-btn-primary:hover:not([disabled]) { background: var(--pa-orange-hover); }
    .rt-btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; }
    .rt-btn-ghost { background: transparent; color: var(--rt-charcoal); border-color: var(--rt-border-strong); }
    .rt-btn-ghost:hover { background: color-mix(in srgb, var(--pa-ink) 4%, transparent); }

/* Admin RuleOverrideManagerDialog shell sizing: MudDialog-rooted, not isolation-reachable. */
.override-manager-dialog .mud-dialog {
    max-width: min(650px, 96vw) !important;
    width: min(650px, 96vw) !important;
}

.override-manager-dialog .cancel-btn { text-transform: none; color: var(--pa-muted); }
