

/* --- Design Tokens: css/pulse-tokens.css (loaded first by every layout) holds every color and font;
       the --rtg-* names used below are pointed at it there. --- */

/* --- Base --- */
html {
    font-size: 16px;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body.rtg-body {
    background-color: var(--pulse-g);
    color: var(--pulse-ink);
    font-family: var(--pulse-font);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Links: slate. A bare element selector, so every component's own class wins. */
a {
    color: var(--pulse-slate);
}

/* Bootstrap's one utility the pages use (Kaia's input label); the full Bootstrap sheet is no longer loaded. */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Bootstrap's reboot colors code pink: here it is plain mono */
code {
    color: inherit;
    font-family: var(--pulse-mono);
}

/* Counters and timestamps only */
.rtg-mono {
    font-family: var(--pulse-mono);
    font-variant-numeric: tabular-nums;
}

/* Motion: the live dot, sheets and shimmer all stand still for people who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Header (Night bar) --- */
.rtg-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--pulse-night);
    border-bottom: 1px solid var(--pulse-night-line);
    padding-top: env(safe-area-inset-top);
    color: var(--pulse-on-night);
}

.rtg-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--pulse-header-h);
    padding: 0 6px 0 16px;
    max-width: 640px;
    margin: 0 auto;
}

.rtg-header-brand {
    display: flex;
    align-items: center;
    flex: none;
    min-height: 44px;
}

.rtg-logo {
    display: block;
    height: 28px;
    width: auto;
}

.rtg-header-who {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding-left: 10px;
    border-left: 1px solid var(--pulse-night-line);
    line-height: 1.15;
    text-decoration: none;
}

body.rtg-body .rtg-header-who {
    color: var(--pulse-on-night);
}

.rtg-header-who b {
    font-size: 14px;
    font-weight: 800;
}

.rtg-header-who span {
    font-size: 12px;
    color: var(--pulse-night-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 136px;
}

a.rtg-header-who:hover span,
a.rtg-header-who:focus-visible span {
    color: var(--pulse-on-night);
    text-decoration: underline;
}

.rtg-header-sp {
    flex: 1;
}

.rtg-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
}

    .rtg-header-actions form {
        margin: 0;
    }

.rtg-icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

body.rtg-body .rtg-icon-btn {
    color: var(--pulse-on-night);
}

    .rtg-icon-btn svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .rtg-icon-btn:hover,
    .rtg-icon-btn.rtg-active {
        background: rgba(var(--pulse-white-rgb), 0.08);
    }

    .rtg-icon-btn:focus-visible,
    .rtg-header-who:focus-visible,
    .rtg-header-brand:focus-visible,
    .rtg-header-nav-link:focus-visible,
    .rtg-bottom-nav-item:focus-visible {
        outline: 2px solid var(--pulse-night-soft);
        outline-offset: -3px;
        border-radius: 10px;
    }

/* The bell's unread count: red only because it is news */
.rtg-notif-badge {
    position: absolute;
    top: 6px;
    right: 5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--pulse-red-lit);
    color: var(--pulse-white);
    font: 700 11px/18px var(--pulse-font);
    text-align: center;
    pointer-events: none;
}

    .rtg-notif-badge[hidden] {
        display: none;
    }

    .rtg-notif-badge.pulse {
        animation: rtg-badge-pop 0.6s ease;
    }

@keyframes rtg-badge-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* --- Main Content --- */
.rtg-main {
    padding-top: calc(var(--pulse-header-h) + env(safe-area-inset-top));
    padding-bottom: calc(var(--pulse-nav-h) + env(safe-area-inset-bottom));
    min-height: 100vh;
}

@media (min-width: 768px) {
    .rtg-main {
        padding-bottom: 0;
    }
}

/* --- Header Nav (tablet+): the bottom bar's entries --- */
.rtg-header-nav {
    display: none;
}

.rtg-kaia-ic {
    color: var(--pulse-red-lit);
}

@media (min-width: 768px) {
    .rtg-header-inner {
        max-width: 960px;
        padding: 0 12px 0 24px;
    }

    .rtg-header-who span {
        max-width: 220px;
    }

    .rtg-header-nav {
        display: flex;
        align-self: stretch;
        align-items: stretch;
        gap: 2px;
        margin-left: 12px;
    }

    .rtg-header-nav-link {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 0 12px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
    }

    body.rtg-body .rtg-header-nav-link {
        color: var(--pulse-night-ink);
    }

        body.rtg-body .rtg-header-nav-link:hover,
        body.rtg-body .rtg-header-nav-link.rtg-active {
            color: var(--pulse-on-night);
        }

        .rtg-header-nav-link.rtg-active::after {
            content: "";
            position: absolute;
            left: 12px;
            right: 12px;
            bottom: -1px;
            height: 3px;
            border-radius: 3px 3px 0 0;
            background: var(--pulse-red-lit);
        }

        .rtg-header-nav-link svg {
            width: 15px;
            height: 15px;
        }
}

/* --- Bottom Nav (phones): Today, Bills, Calendar, Directory, Kaia when open; 4 or 5 equal columns --- */
.rtg-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    height: calc(var(--pulse-nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--pulse-night);
    border-top: 1px solid var(--pulse-night-line);
}

@media (min-width: 768px) {
    .rtg-bottom-nav {
        display: none;
    }
}

.rtg-bottom-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

body.rtg-body .rtg-bottom-nav-item {
    color: var(--pulse-night-ink);
}

    .rtg-bottom-nav-item svg {
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body.rtg-body .rtg-bottom-nav-item.rtg-active {
        color: var(--pulse-on-night);
    }

    /* the open tab: a red tick on the bar's top edge */
    .rtg-bottom-nav-item.rtg-active::before {
        content: "";
        position: absolute;
        top: -1px;
        left: 30%;
        right: 30%;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--pulse-red-lit);
    }

/* --- Page head: one title and one plain line --- */
.rtg-page-head {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 18px 8px;
}

.rtg-page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--pulse-ink);
}

.rtg-page-sub {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--pulse-body);
}

@media (min-width: 768px) {
    .rtg-page-head {
        max-width: 960px;
        padding: 22px 24px 10px;
    }
}

/* --- Section header (older pages): the page title --- */
.rtg-section-header {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 18px 6px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--pulse-ink);
}

@media (min-width: 768px) {
    .rtg-section-header {
        max-width: 960px;
        padding: 22px 24px 8px;
    }
}

/* --- Bill List --- */
.rtg-bill-list {
    padding: 4px 14px 28px;
    max-width: 640px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .rtg-bill-list {
        max-width: 960px;
        padding: 8px 24px 36px;
    }
}

.rtg-bill-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--pulse-mute);
    padding: 6px 4px 8px;
}

/* --- Bill Card (the link part; the wrapper below is the white card) --- */
.rtg-bill-card {
    padding: 13px 16px 10px;
    -webkit-tap-highlight-color: transparent;
}

.rtg-bill-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
    min-width: 0;
}

.rtg-bill-number {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--pulse-ink);
    flex-shrink: 0;
}

.rtg-bill-author {
    font-size: 13px;
    font-weight: 500;
    color: var(--pulse-mute);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bill status: neutral, one look on the list and the bill page (pulse-18). Red and green are the
   workspace's own signals (position, priority), never the status. */
.rtg-status-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 24px;
    padding: 2px 9px;
    border: 1px solid var(--pulse-line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--pulse-mute);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
}

.rtg-bill-title {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--pulse-ink);
    margin: 2px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Changed today: the dot, the last action in plain words */
.rtg-bill-chg {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pulse-ink);
}

    .rtg-bill-chg i {
        flex: none;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--pulse-slate);
    }

    .rtg-bill-chg span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rtg-bill-chg time,
    .rtg-bill-last time {
        flex: none;
        font-family: var(--pulse-mono);
        font-weight: 600;
        color: var(--pulse-mute);
    }

/* An older last action: quiet, one line */
.rtg-bill-last {
    display: flex;
    gap: 6px;
    margin-top: 7px;
    font-size: 13px;
    color: var(--pulse-mute);
    min-width: 0;
}

    .rtg-bill-last span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* --- Filter Bar: the search, the Changed today chip, then the existing filters --- */
.rtg-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px 10px;
    max-width: 640px;
    margin: 0 auto;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .rtg-filter-bar {
        max-width: 960px;
        padding: 6px 24px 12px;
    }
}

.rtg-filter-search-wrap {
    position: relative;
    flex: 1 1 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .rtg-filter-search-wrap {
        flex: 1 1 280px;
    }
}

.rtg-filter-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--pulse-mute);
    pointer-events: none;
}

.rtg-filter-input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px 10px 42px;
    font: inherit;
    font-size: 15px;
    border: 1px solid var(--pulse-line);
    border-radius: var(--pulse-ctl-r);
    background: var(--pulse-surface);
    color: var(--pulse-ink);
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .rtg-filter-input::placeholder {
        color: var(--pulse-mute);
    }

    .rtg-filter-input:focus {
        border-color: var(--pulse-slate);
        box-shadow: 0 0 0 3px rgba(var(--pulse-slate-rgb), 0.14);
    }

/* Chips and the existing filter selects share one pill shape */
.rtg-chips {
    display: flex;
    gap: 8px;
    flex: 1 1 100%;
    min-width: 0;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: none;
}

    .rtg-chips::-webkit-scrollbar {
        display: none;
    }

.rtg-chip,
.rtg-filter-select {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--pulse-line);
    border-radius: 999px;
    background-color: var(--pulse-surface);
    color: var(--pulse-ink);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

    .rtg-chip b {
        font-weight: 700;
        color: var(--pulse-mute);
        font-family: var(--pulse-mono);
        font-size: 12.5px;
    }

    .rtg-chip[aria-pressed="true"] {
        background-color: var(--pulse-night);
        border-color: var(--pulse-night);
        color: var(--pulse-white);
    }

        .rtg-chip[aria-pressed="true"] b {
            color: inherit;
            opacity: 0.8;
        }

    .rtg-chip i {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--pulse-slate);
    }

    .rtg-chip[aria-pressed="true"] i {
        background: var(--pulse-red-lit);
    }

/* The selects keep their own chevron, drawn with two token-colored gradients (no image with a baked color) */
.rtg-filter-select {
    padding-right: 34px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--pulse-mute) 50%),
        linear-gradient(135deg, var(--pulse-mute) 50%, transparent 50%);
    background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

    .rtg-filter-select:focus-visible,
    .rtg-chip:focus-visible {
        border-color: var(--pulse-slate);
        box-shadow: 0 0 0 3px rgba(var(--pulse-slate-rgb), 0.18);
    }

/* --- Bill Meta Row (Position + Priority: the workspace's own pills, colors pinned) --- */
.rtg-bill-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
}

.rtg-meta-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.3;
    background-color: var(--pulse-slate-tint);
    color: var(--pulse-slate-deep);
}

/* --- AI Précis --- */
.rtg-bill-precis {
    display: flex;
    gap: 6px;
    align-items: baseline;
    margin-top: 6px;
}

.rtg-precis-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--rtg-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 1px;
}

.rtg-precis-text {
    font-size: 13px;
    color: var(--rtg-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}

/* --- Empty State: one plain line, an action when there is one --- */
.rtg-empty {
    text-align: center;
    padding: 48px 24px;
}

.rtg-empty-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--pulse-ink);
    margin-bottom: 6px;
}

.rtg-empty-sub {
    font-size: 14px;
    color: var(--pulse-body);
    max-width: 44ch;
    margin: 0 auto;
}

/* --- Login Page: night navy ground, the reversed lockup, a white card --- */
body.rtg-body-login {
    background:
        radial-gradient(ellipse at 15% 10%, var(--pulse-glow-navy) 0, transparent 55%),
        radial-gradient(ellipse at 90% 100%, var(--pulse-glow-plum) 0, transparent 45%),
        var(--pulse-night);
    min-height: 100vh;
}

.rtg-login-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
    min-height: 100vh;
}

.rtg-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--pulse-on-night);
}

.rtg-login-logo {
    display: block;
    height: 40px;
    width: auto;
}

.rtg-login-app {
    padding-left: 12px;
    border-left: 1px solid var(--pulse-night-line);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 40px;
}

.rtg-login-card {
    background: var(--pulse-surface);
    border-radius: 18px;
    padding: 28px 24px 18px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 24px 50px -24px rgba(var(--pulse-shade-rgb), 0.6);
}

.rtg-login-title {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--pulse-ink);
    margin: 0 0 4px;
}

.rtg-login-subtitle {
    font-size: 14px;
    color: var(--pulse-body);
    margin: 0 0 22px;
}

.rtg-form-group {
    margin-bottom: 16px;
}

.rtg-form-group-last {
    margin-bottom: 22px;
}

.rtg-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pulse-ink);
    margin-bottom: 6px;
}

.rtg-form-input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font: inherit;
    font-size: 16px;
    border: 1px solid var(--pulse-line-strong);
    border-radius: var(--pulse-ctl-r);
    background: var(--pulse-surface);
    color: var(--pulse-ink);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}

    .rtg-form-input:focus {
        border-color: var(--pulse-slate);
        box-shadow: 0 0 0 3px rgba(var(--pulse-slate-rgb), 0.16);
    }

.rtg-btn-primary {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    background-color: var(--pulse-slate);
    color: var(--pulse-white);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--pulse-ctl-r);
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
}

    .rtg-btn-primary:hover,
    .rtg-btn-primary:active {
        background-color: var(--pulse-slate-deep);
    }

    .rtg-btn-primary:active {
        transform: scale(0.985);
    }

    .rtg-btn-primary:focus-visible {
        outline: 3px solid rgba(var(--pulse-slate-rgb), 0.35);
        outline-offset: 2px;
    }

/* "Forgot your password?": a full 44 px target under the button */
body.rtg-body .rtg-login-forgot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--pulse-slate);
    text-decoration: none;
}

    body.rtg-body .rtg-login-forgot:hover {
        text-decoration: underline;
    }

/* --- Alert / Error --- */
.rtg-alert {
    background: var(--pulse-bad-wash);
    border: 1px solid var(--pulse-bad-tint);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--rtg-error);
    margin-bottom: 18px;
    font-weight: 500;
}

/* --- Bill Card as Link --- */
a.rtg-bill-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* --- Bill Detail Page (Night bar: the bill's name large, its sections on white) --- */
.rtg-detail-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 40px;
}

@media (min-width: 768px) {
    .rtg-detail-wrap {
        max-width: 960px;
        padding: 0 0 48px;
    }
}

.rtg-detail-back {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 2px 10px 0 8px;
}

@media (min-width: 768px) {
    .rtg-detail-back {
        padding: 6px 18px 0 16px;
    }
}

.rtg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

body.rtg-body .rtg-back-link {
    color: var(--pulse-slate);
}

    body.rtg-body .rtg-back-link:hover {
        color: var(--pulse-slate-deep);
    }

    .rtg-back-link svg {
        width: 20px;
        height: 20px;
    }

.rtg-detail-session {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pulse-mute);
    padding: 3px 9px;
    border: 1px dashed var(--pulse-line-strong);
    border-radius: 999px;
}

.rtg-detail-header {
    padding: 4px 18px 10px;
}

@media (min-width: 768px) {
    .rtg-detail-header {
        padding: 8px 24px 12px;
    }
}

.rtg-detail-bill-number {
    font-size: 34px;
    font-weight: 900;
    color: var(--pulse-ink);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.rtg-detail-title {
    margin: 8px 0 2px;
    font-size: 17px;
    font-weight: 700;
    color: var(--pulse-ink);
    line-height: 1.3;
}

.rtg-detail-author {
    font-size: 14px;
    color: var(--pulse-body);
    font-weight: 400;
}

.rtg-detail-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 18px 14px;
}

@media (min-width: 768px) {
    .rtg-detail-badges {
        padding: 0 24px 16px;
    }
}

.rtg-detail-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.3;
    background: var(--pulse-slate-tint);
    color: var(--pulse-slate-deep);
}

.rtg-detail-section {
    margin: 0 14px 12px;
    padding: 14px 16px;
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-line);
    border-radius: var(--pulse-card-r);
}

@media (min-width: 768px) {
    .rtg-detail-section {
        margin: 0 24px 14px;
        padding: 16px 20px;
    }
}

.rtg-detail-section-label {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--pulse-ink);
    margin-bottom: 8px;
}

/* ── Live Vote Tally card (bill detail) ───────────────────────────────── */
.rtg-tally-section{
    scroll-margin-top: 72px;
}

.rtg-tally-label{
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--pulse-red);
}

.rtg-tally-live-dot{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pulse-red);
    box-shadow: 0 0 0 0 rgba(var(--pulse-red-rgb), .6);
    animation: rtg-tally-pulse 1.5s ease-out infinite;
}

@keyframes rtg-tally-pulse{
    0%   { box-shadow: 0 0 0 0   rgba(var(--pulse-red-rgb), .55); }
    70%  { box-shadow: 0 0 0 7px rgba(var(--pulse-red-rgb), 0); }
    100% { box-shadow: 0 0 0 0   rgba(var(--pulse-red-rgb), 0); }
}

.rtg-tally-card{
    background: linear-gradient(135deg, var(--pulse-g) 0%, var(--pulse-line) 100%);
    border: 1px solid var(--rtg-border);
    border-left: 4px solid var(--pulse-red);
    border-radius: 10px;
    padding: 12px 14px;
}

.rtg-tally-card + .rtg-tally-card{
    margin-top: 8px;
}

.rtg-tally-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.rtg-tally-chamber{
    font-size: 13px;
    font-weight: 600;
    color: var(--rtg-text-primary);
}

.rtg-tally-outcome{
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.rtg-tally-passed { background: rgba(var(--pulse-ok-rgb), .12);  color: var(--pulse-ok); }
.rtg-tally-failed { background: rgba(var(--pulse-red-rgb), .12);  color: var(--pulse-red); }
.rtg-tally-oncall { background: rgba(var(--pulse-warn-rgb), .14);   color: var(--pulse-warn); }

.rtg-tally-timestamp{
    font-size: 11px;
    color: var(--rtg-text-secondary);
    margin: -4px 0 8px;
    letter-spacing: .02em;
}

.rtg-tally-motion{
    font-size: 12px;
    color: var(--rtg-text-secondary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.rtg-tally-counts{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.rtg-tally-count{
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--pulse-surface);
    border: 1px solid var(--rtg-border);
    border-radius: 8px;
}

.rtg-tally-num{
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--rtg-text-primary);
}

.rtg-tally-total .rtg-tally-num{
    font-size: 14px;
    letter-spacing: .02em;
}

.rtg-tally-ref{
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--rtg-text-secondary);
    margin-top: 2px;
}

.rtg-tally-yes .rtg-tally-num { color: var(--pulse-ok); }
.rtg-tally-no  .rtg-tally-num { color: var(--pulse-red); }
.rtg-tally-nv  .rtg-tally-num { color: var(--pulse-mute); }

/* Per-legislator vote list (most recent ballot only) */
.rtg-tally-votes{
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rtg-vote-group{
    background: var(--pulse-surface);
    border: 1px solid var(--rtg-border);
    border-radius: 8px;
    overflow: hidden;
}

.rtg-vote-group-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--rtg-border);
}

.rtg-vote-group-yes .rtg-vote-group-head{
    background: rgba(var(--pulse-ok-rgb), .08);
    color: var(--pulse-ok);
}
.rtg-vote-group-no .rtg-vote-group-head{
    background: rgba(var(--pulse-red-rgb), .08);
    color: var(--pulse-red);
}
.rtg-vote-group-nv .rtg-vote-group-head{
    background: rgba(var(--pulse-mute-rgb), .08);
    color: var(--pulse-body);
}

.rtg-vote-group-count{
    font-size: 12px;
    font-weight: 600;
    background: var(--pulse-surface);
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid currentColor;
    line-height: 1.4;
}

.rtg-vote-list{
    list-style: none;
    margin: 0;
    padding: 6px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (min-width: 768px){
    .rtg-vote-list{ grid-template-columns: repeat(3, 1fr); }
}

.rtg-vote-list li{
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--rtg-text-primary);
    padding: 4px 10px;
    line-height: 1.35;
    min-width: 0;
}

/* Per-name Y / N / NV chip — reads like the chamber board, and keeps a name
   legible after its group header has scrolled off. */
.rtg-vote-mark{
    flex: 0 0 auto;
    min-width: 17px;
    height: 15px;
    padding: 0 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .03em;
    line-height: 1;
}

.rtg-vote-group-yes .rtg-vote-mark { background: rgba(var(--pulse-ok-rgb), .14);   color: var(--pulse-ok); }
.rtg-vote-group-no  .rtg-vote-mark { background: rgba(var(--pulse-red-rgb), .14);   color: var(--pulse-red); }
.rtg-vote-group-nv  .rtg-vote-mark { background: rgba(var(--pulse-mute-rgb), .16); color: var(--pulse-body); }

.rtg-vote-name{
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rtg-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

@media (min-width: 768px) {
    .rtg-detail-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px 24px;
    }
}

.rtg-detail-grid-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rtg-detail-grid-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--rtg-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rtg-detail-grid-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--rtg-text-primary);
    line-height: 1.4;
}

.rtg-detail-grid-date {
    color: var(--rtg-text-secondary);
    font-weight: 400;
}

.rtg-precis-section {
    background: linear-gradient(135deg, rgba(var(--pulse-slate-rgb), 0.05) 0%, rgba(var(--pulse-slate-rgb), 0.04) 100%);
}

.rtg-precis-ai-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rtg-accent);
}

.rtg-detail-precis-text {
    font-size: 14px;
    color: var(--rtg-text-primary);
    line-height: 1.6;
    margin: 0;
}

.rtg-detail-body-text {
    font-size: 14px;
    color: var(--rtg-text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* --- Tag rows (Law Codes, Flags, Fiscal) --- */
.rtg-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rtg-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.5;
}

.rtg-tag-fiscal {
    background: var(--pulse-warn-wash);
    color: var(--pulse-warn-deep);
}

.rtg-tag-law {
    background: var(--rtg-primary-100);
    color: var(--rtg-primary-700);
}

.rtg-tag-flag {
    background: var(--pulse-ok-tint);
    color: var(--rtg-success);
}

/* --- Workspace Select --- */
.rtg-workspace-list {
    padding: 14px 14px 32px;
    max-width: 640px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .rtg-workspace-list {
        max-width: 960px;
        padding: 20px 24px 40px;
    }
}

.rtg-workspace-list form {
    margin: 0;
}

.rtg-workspace-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-line);
    border-radius: var(--pulse-card-r);
    padding: 16px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    min-height: 60px;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.1s;
    -webkit-tap-highlight-color: transparent;
}

    .rtg-workspace-card:hover {
        border-color: var(--rtg-primary-600);
        box-shadow: 0 2px 10px rgba(var(--pulse-slate-rgb), 0.12);
    }

    .rtg-workspace-card:active {
        background-color: var(--rtg-primary-100);
        border-color: var(--rtg-primary-600);
    }

.rtg-workspace-name-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--rtg-text-primary);
}

.rtg-workspace-chevron {
    color: var(--rtg-text-secondary);
    flex-shrink: 0;
}

.rtg-workspace-hint {
    font-size: 13px;
    color: var(--rtg-text-secondary);
    padding: 4px 2px 12px;
}

/* --- Bookmark --- */
.rtg-detail-back-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rtg-bookmark-form {
    display: flex;
    align-items: center;
}

.rtg-bookmark-btn {
    background: none;
    border: none;
    padding: 5px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    color: var(--rtg-text-secondary);
    transition: color 0.15s, background-color 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

    .rtg-bookmark-btn::after { /* 44px hit area around the 36px button */
        content: "";
        position: absolute;
        inset: -4px;
    }

    .rtg-bookmark-btn:hover {
        background-color: var(--rtg-primary-100);
        color: var(--rtg-primary-600);
    }

    .rtg-bookmark-btn.rtg-bookmarked {
        color: var(--pulse-gold);
    }

        .rtg-bookmark-btn.rtg-bookmarked:hover {
            color: var(--pulse-gold-deep);
            background-color: var(--pulse-warn-wash);
        }

.rtg-bill-bookmark-icon {
    display: inline-flex;
    align-items: center;
    color: var(--pulse-gold);
    flex-shrink: 0;
    margin-right: 2px;
}

/* --- Badge base class --- */
.rtg-badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 10px;
    white-space: nowrap;
    vertical-align: middle;
}

/* --- Badge color modifiers (mapped from Cirkadia Bootstrap CSS values): the workspace's own position and
       priority signals. Pinned: --sig-* keep the colors they always had. --- */
.rtg-badge-success { background: var(--sig-success); color: var(--sig-on); }
.rtg-badge-primary { background: var(--sig-primary); color: var(--sig-on); }
.rtg-badge-neutral { background: var(--sig-neutral); color: var(--sig-on); }
.rtg-badge-warning { background: var(--sig-warning); color: var(--sig-on); }
.rtg-badge-danger  { background: var(--sig-danger);  color: var(--sig-on); }
.rtg-badge-info    { background: var(--sig-info);    color: var(--sig-on); }
.rtg-badge-yellow  { background: var(--sig-yellow);  color: var(--sig-on); }
.rtg-badge-teal    { background: var(--sig-teal);    color: var(--sig-on); }
.rtg-badge-kombu   { background: var(--sig-kombu);   color: var(--sig-on); }
.rtg-badge-red     { background: var(--sig-red);     color: var(--sig-on); }

/* --- Search loading state --- */
@keyframes rtg-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.15;
    }
}

.rtg-search-loading {
    padding: 32px 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--rtg-primary-600);
    animation: rtg-pulse 1s ease-in-out infinite;
}

/* --- Bill Card Wrapper: the white card (link part + footer) --- */
.rtg-bill-card-wrap {
    margin-bottom: 10px;
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-line);
    border-radius: var(--pulse-card-r);
}

    .rtg-bill-card-wrap > .rtg-bill-card {
        margin-bottom: 0;
        border-radius: var(--pulse-card-r) var(--pulse-card-r) 0 0;
    }

        .rtg-bill-card-wrap > .rtg-bill-card:active {
            background: var(--pulse-g);
        }

        .rtg-bill-card-wrap > .rtg-bill-card:focus-visible {
            outline: 2px solid var(--pulse-slate);
            outline-offset: -2px;
        }

    .rtg-bill-card-wrap.rtg-changed {
        border-color: var(--pulse-slate-soft);
    }

/* --- Card Footer (two-section row below card) --- */
.rtg-card-footer {
    display: flex;
    align-items: stretch;
    min-height: 44px;
    border-top: 1px solid var(--pulse-line);
    border-radius: 0 0 var(--pulse-card-r) var(--pulse-card-r);
}

.rtg-card-footer-left {
    flex: 0 0 auto;
}

.rtg-card-footer-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 4px 10px;
}

/* --- Card footer pulse button (icon-only, left section) --- */
.rtg-footer-pulse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 44px;
    padding: 0 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--pulse-mute);
    transition: background 0.12s, color 0.12s;
    -webkit-tap-highlight-color: transparent;
    height: 100%;
    position: relative;
    border-bottom-left-radius: calc(var(--pulse-card-r) - 1px); /* the footer's inner corner */
}

    .rtg-footer-pulse-btn:hover {
        background: rgba(var(--pulse-slate-rgb), 0.06);
        color: var(--rtg-primary-600);
    }

/* --- AI Pill (in-flow badge in footer right) --- */
.rtg-ai-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px 3px 7px;
    background: var(--rtg-surface);
    border: 1px solid var(--rtg-accent);
    border-radius: 20px;
    color: var(--rtg-accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 4px rgba(var(--pulse-slate-rgb), 0.18);
    transition: background-color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

    .rtg-ai-pill::after { /* 44px tall hit area around the 23px pill (insets start inside its 1px border) */
        content: "";
        position: absolute;
        inset: -12px 0 -11px;
    }

    .rtg-ai-pill:hover {
        background: var(--pulse-slate-tint);
        box-shadow: 0 2px 8px rgba(var(--pulse-slate-rgb), 0.28);
    }

/* --- AI Pulse Dot --- */
@keyframes rtg-pulse-dot {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

.rtg-ai-pulse-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--rtg-accent);
    flex-shrink: 0;
    animation: rtg-pulse-dot 2s ease-in-out infinite;
}

/* --- AI Analysis Section (detail page — blends with existing sections) --- */
.rtg-ai-analysis-section {
    background: linear-gradient(135deg, rgba(var(--pulse-slate-rgb), 0.06) 0%, rgba(var(--pulse-slate-rgb), 0.04) 100%);
    border-left: 3px solid var(--rtg-accent);
    padding-left: 13px; /* 16px - 3px border */
}

@media (min-width: 768px) {
    .rtg-ai-analysis-section {
        padding-left: 21px; /* 24px - 3px border */
    }
}

.rtg-ai-analysis-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--rtg-accent);
}

.rtg-ai-model-tag {
    font-size: 10px;
    font-weight: 500;
    color: var(--rtg-text-secondary);
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    margin-left: 2px;
    opacity: 0.75;
}

/* --- AI Modal (bottom sheet on mobile, centered card on desktop) --- */
.rtg-ai-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.rtg-ai-modal-open {
    pointer-events: auto;
}

.rtg-ai-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(var(--pulse-shade-rgb), 0);
    transition: background-color 0.25s;
}

.rtg-ai-modal-open .rtg-ai-modal-backdrop {
    background: rgba(var(--pulse-shade-rgb), 0.5);
}

.rtg-ai-modal-panel {
    position: relative;
    width: 100%;
    max-height: 85vh;
    background: linear-gradient(160deg, var(--pulse-night) 0%, var(--pulse-night) 100%);
    border-top: 1px solid var(--pulse-night-2);
    border-radius: 18px 18px 0 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    scrollbar-width: none;
}

    .rtg-ai-modal-panel::-webkit-scrollbar {
        display: none;
    }

.rtg-ai-modal-open .rtg-ai-modal-panel {
    transform: translateY(0);
}

.rtg-ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 10px;
    position: sticky;
    top: 0;
    background: linear-gradient(160deg, var(--pulse-night) 0%, var(--pulse-night) 100%);
    border-bottom: 1px solid rgba(var(--pulse-night-soft-rgb), 0.12);
    z-index: 1;
}

.rtg-ai-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--pulse-night-soft);
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
}

.rtg-ai-modal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pulse-night-soft);
    animation: rtg-pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

.rtg-ai-modal-close-btn {
    background: none;
    border: none;
    color: rgba(var(--pulse-night-soft-rgb), 0.55);
    cursor: pointer;
    padding: 4px;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
    position: relative;
}

    .rtg-ai-modal-close-btn::after { /* 44px hit area around the 32px button */
        content: "";
        position: absolute;
        inset: -6px;
    }

    .rtg-ai-modal-close-btn:hover {
        color: var(--pulse-night-soft);
        background: rgba(var(--pulse-night-soft-rgb), 0.08);
    }

.rtg-ai-modal-bill-info {
    padding: 12px 18px 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-bottom: 1px solid rgba(var(--pulse-white-rgb), 0.05);
}

.rtg-ai-modal-bill-num {
    font-size: 17px;
    font-weight: 800;
    color: var(--rtg-primary-100);
    letter-spacing: -0.01em;
}

.rtg-ai-modal-bill-title {
    font-size: 12px;
    color: rgba(var(--pulse-night-soft-rgb), 0.6);
    line-height: 1.4;
}

.rtg-ai-modal-body {
    padding: 14px 18px calc(32px + env(safe-area-inset-bottom));
}

.rtg-ai-modal-section-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(var(--pulse-night-soft-rgb), 0.45);
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.rtg-ai-modal-precis-wrap {
    margin-bottom: 20px;
}

.rtg-ai-modal-precis {
    font-size: 14px;
    color: rgba(var(--pulse-night-soft-rgb), 0.9);
    line-height: 1.7;
    font-style: italic;
    margin: 0;
    padding-left: 12px;
    border-left: 2px solid rgba(var(--pulse-night-soft-rgb), 0.35);
}

.rtg-ai-modal-summary {
    font-size: 14px;
    color: rgba(var(--pulse-night-soft-rgb), 0.78);
    line-height: 1.78;
    margin: 0;
}

@media (min-width: 768px) {
    .rtg-ai-modal {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .rtg-ai-modal-panel {
        border-radius: 16px;
        max-width: 600px;
        max-height: 80vh;
        border: 1px solid var(--pulse-night-2);
        transform: translateY(16px) scale(0.98);
        opacity: 0;
        transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.18s;
    }

    .rtg-ai-modal-open .rtg-ai-modal-panel {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* --- Bill Progress Chart --- */
.rtg-progress-section {
    padding-bottom: 16px;
}

.rtg-progress-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 6px 0 4px;
    margin: 0 -2px;
}

    .rtg-progress-wrap::-webkit-scrollbar {
        display: none;
    }

.rtg-progress-track {
    display: flex;
    align-items: center;
    width: max-content;
    gap: 0;
    padding: 2px 2px;
}

/* Node */
.rtg-node {
    width: 38px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: -0.03em;
    flex-shrink: 0;
    user-select: none;
}

.rtg-node-done,
.rtg-node-current {
    color: var(--pulse-white);
}

/* Phase colors from data (sHouseCode: origin=House1 green, other=House2 amber, L=Final night navy). Not red:\r
   red is for live and for oppose-type signals. */
.rtg-node-done.rtg-node-ph-house1,
.rtg-node-current.rtg-node-ph-house1 { background: var(--pulse-ok); }

.rtg-node-done.rtg-node-ph-house2,
.rtg-node-current.rtg-node-ph-house2 { background: var(--pulse-warn); }

.rtg-node-done.rtg-node-ph-final,
.rtg-node-current.rtg-node-ph-final  { background: var(--pulse-night); }

.rtg-node-pending {
    background: var(--pulse-line);
    color: var(--pulse-faint);
}

.rtg-node-skipped {
    background: var(--pulse-line);
    color: var(--pulse-line-strong);
    opacity: 0.6;
}

.rtg-node-dead {
    background: var(--rtg-error);
    color: var(--pulse-white);
}

/* Stage wrap — holds node + label stacked */
.rtg-stage-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.rtg-stage-label {
    font-size: 8px;
    color: var(--rtg-text-secondary);
    margin-top: 3px;
    text-align: center;
    white-space: nowrap;
    max-width: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 10px;
    line-height: 1.2;
}

.rtg-stage-label-empty {
    min-height: 10px;
}

/* Connector */
.rtg-conn {
    font-size: 13px;
    line-height: 1;
    padding: 0 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 9px; /* align with node center, not label */
    user-select: none;
}

.rtg-conn-done { color: var(--pulse-ok); }
.rtg-conn-done.rtg-conn-ph-house1 { color: var(--pulse-ok); }
.rtg-conn-done.rtg-conn-ph-house2 { color: var(--pulse-warn); }
.rtg-conn-done.rtg-conn-ph-final  { color: var(--pulse-night); }

.rtg-conn-pend {
    color: var(--pulse-line-strong);
}

/* House separator — slightly wider gap */
.rtg-conn-sep {
    padding: 0 7px;
    color: var(--rtg-text-secondary);
    font-size: 14px;
}

@media (min-width: 768px) {
    .rtg-node {
        width: 50px;
        height: 40px;
        border-radius: 8px;
        font-size: 11px;
    }

    .rtg-stage-label {
        font-size: 9px;
        max-width: 54px;
    }

    .rtg-conn {
        padding: 0 5px;
        font-size: 15px;
        margin-top: 11px; /* align with larger node */
    }

    .rtg-conn-sep {
        padding: 0 10px;
        font-size: 16px;
    }
}

/* 
   PULSEMARK — Detail page header button
   */
.rtg-pm-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--rtg-text-secondary);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

    .rtg-pm-header-btn::after { /* 44px hit area; 4px on the left, where Ask Kaia's own hit area ends */
        content: "";
        position: absolute;
        inset: -7px -6px -7px -4px;
    }

    .rtg-pm-header-btn:hover {
        background: var(--rtg-primary-100);
        color: var(--rtg-primary-600);
    }

.rtg-pm-header-btn-active {
    color: var(--pulse-gold);
}

    .rtg-pm-header-btn-active:hover {
        background: var(--pulse-warn-wash);
        color: var(--pulse-gold-deep);
    }

.rtg-pm-header-count {
    font-size: 11px;
    font-weight: 700;
    background: var(--pulse-gold);
    color: var(--pulse-white);
    border-radius: 10px;
    padding: 1px 5px;
    line-height: 1.4;
}

/*
   PULSEMARK — Detail page tabs
   */
.rtg-detail-tabs {
    display: flex;
    border-bottom: 2px solid var(--rtg-border);
    margin: 0 0 4px;
}

.rtg-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rtg-text-secondary);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

    .rtg-tab-btn:hover {
        color: var(--rtg-primary-600);
    }

    .rtg-tab-btn.rtg-tab-active {
        color: var(--rtg-primary-700);
        border-bottom-color: var(--rtg-primary-600);
    }

.rtg-tab-count {
    font-size: 11px;
    font-weight: 700;
    background: var(--pulse-gold);
    color: var(--pulse-white);
    border-radius: 10px;
    padding: 1px 6px;
    line-height: 1.4;
}

.rtg-tab-panel {
    /* no extra spacing — inner sections carry their own, but if spacing needed, edit this section */
}

/* ═══════════════════════════════════════════════════════════════════════════
   PULSEMARK — Gold bookmark badge (outside card, links to pulsemark tab)
   ═══════════════════════════════════════════════════════════════════════════ */
.rtg-pm-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pulse-gold);
    cursor: pointer;
    flex-shrink: 0;
    padding: 2px 8px 2px 4px;
    text-decoration: none;
}

    .rtg-pm-badge::after { /* 44px hit area; 3px on the right, half the gap to the RTG Summary pill */
        content: "";
        position: absolute;
        inset: -11px -3px -11px -11px;
    }

    .rtg-pm-badge:hover {
        color: var(--pulse-gold);
    }

.rtg-pm-badge-count {
    position: absolute;
    top: 0;
    right: 4px;
    background: var(--pulse-gold);
    color: var(--pulse-white);
    font-size: 9px;
    font-weight: 800;
    border-radius: 50%;
    min-width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--rtg-surface);
    line-height: 1;
}

/* 
   PULSEMARK — Bottom-sheet modal (list page)
  */
.rtg-pm-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    pointer-events: none;
    overflow: hidden;
}

.rtg-pm-modal-open {
    pointer-events: auto;
}

.rtg-pm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background 0.2s;
}

.rtg-pm-modal-open .rtg-pm-modal-backdrop {
    background: rgba(var(--pulse-shade-rgb), 0.45);
}

.rtg-pm-modal-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--rtg-surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(var(--pulse-shade-rgb), 0.18);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}

.rtg-pm-modal-open .rtg-pm-modal-panel {
    transform: translateY(0);
}

.rtg-pm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--rtg-border);
}

.rtg-pm-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--rtg-text-primary);
}

.rtg-pm-modal-body {
    padding: 14px 18px 24px;
}

.rtg-pm-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rtg-pm-modal-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: 1px solid var(--rtg-border);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--rtg-text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, border-color 0.12s;
    width: 100%;
}

    .rtg-pm-modal-action-btn:hover:not(:disabled) {
        background: var(--rtg-primary-100);
        border-color: var(--rtg-primary-600);
    }

    .rtg-pm-modal-action-btn:disabled,
    .rtg-pm-modal-action-btn.rtg-pm-btn-disabled {
        opacity: 0.38;
        cursor: not-allowed;
    }

    .rtg-pm-modal-action-btn.rtg-pm-remember-remove {
        color: var(--pulse-red);
        border-color: rgba(var(--pulse-red-rgb), 0.35);
    }

        .rtg-pm-modal-action-btn.rtg-pm-remember-remove:hover:not(:disabled) {
            background: rgba(var(--pulse-red-rgb), 0.06);
            border-color: rgba(var(--pulse-red-rgb), 0.55);
        }

.rtg-pm-modal-compose {
    margin-top: 14px;
}

/*
   PULSEMARK — Detail page tab content
  */
.rtg-pm-tab-wrap {
    padding: 16px 0 32px;
}

.rtg-pm-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.rtg-pm-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--rtg-border);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rtg-text-primary);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    white-space: nowrap;
}

    .rtg-pm-action-btn:hover:not(:disabled) {
        background: var(--rtg-primary-100);
        border-color: var(--rtg-primary-600);
        color: var(--rtg-primary-700);
    }

    .rtg-pm-action-btn.rtg-pm-btn-disabled,
    .rtg-pm-action-btn:disabled {
        opacity: 0.38;
        cursor: not-allowed;
    }

/* Compose / edit textarea area */
.rtg-pm-compose-wrap,
.rtg-pm-edit-wrap {
    background: var(--rtg-surface);
    border: 1px solid var(--rtg-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}

.rtg-pm-compose-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rtg-primary-600);
    margin-bottom: 8px;
}

.rtg-pm-textarea {
    width: 100%;
    background: var(--rtg-bg);
    border: 1px solid var(--rtg-border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--rtg-text-primary);
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

    .rtg-pm-textarea:focus {
        outline: none;
        border-color: var(--rtg-primary-600);
        box-shadow: 0 0 0 2px rgba(var(--pulse-slate-rgb), 0.12);
    }

/* @mention autocomplete */
.rtg-pm-textarea-wrap { position: relative; }

.rtg-mention-dropdown {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 2px);
    background: var(--pulse-surface);
    border: 1px solid var(--rtg-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(var(--pulse-shade-rgb), 0.12);
    z-index: 200;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.rtg-mention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--pulse-soft);
    transition: background 0.12s;
}
.rtg-mention-item:last-child { border-bottom: none; }
.rtg-mention-item:hover,
.rtg-mention-item.rtg-mention-active { background: var(--pulse-slate-tint); }

.rtg-mention-name  { font-size: 13px; font-weight: 600; color: var(--pulse-ink); }
.rtg-mention-login { font-size: 11px; color: var(--pulse-faint); }

.rtg-pm-compose-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

.rtg-pm-save-btn {
    background: var(--rtg-primary-700);
    color: var(--pulse-white);
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s;
}

    .rtg-pm-save-btn:hover {
        background: var(--rtg-primary-600);
    }

.rtg-pm-cancel-btn {
    background: none;
    color: var(--rtg-text-secondary);
    border: 1px solid var(--rtg-border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
}

    .rtg-pm-cancel-btn:hover {
        background: var(--rtg-border);
    }

/* Empty state */
.rtg-pm-empty {
    padding: 32px 0;
    text-align: center;
}

.rtg-pm-empty-text {
    font-size: 14px;
    color: var(--rtg-text-secondary);
    line-height: 1.6;
}

/*
   PULSEMARK — Cards
  */
.rtg-pm-card {
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--rtg-border);
    position: relative;
}

/* No-note card — warm dark with golden accent */
.rtg-pm-card-remember {
    background: linear-gradient(135deg, var(--pulse-night), var(--pulse-night-2));
    border-color: var(--pulse-night-line);
}

.rtg-pm-remember-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--pulse-gold);
    letter-spacing: 0.01em;
    line-height: 1.45;
}

/* Note card — dark surface with "Your Thoughts" identity */
.rtg-pm-card-thought {
    background: linear-gradient(135deg, var(--pulse-night), var(--pulse-night));
    border-color: var(--pulse-night-2);
}

.rtg-pm-thought-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pulse-night-soft);
    margin-bottom: 6px;
}

.rtg-pm-card-note {
    font-size: 14px;
    color: var(--pulse-slate-soft);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.rtg-pm-mention {
    display: inline;
    background: rgba(var(--pulse-night-soft-rgb), 0.18);
    color: var(--pulse-night-soft);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 600;
    font-size: 0.95em;
}

/* Card footer */
.rtg-pm-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}

.rtg-pm-date {
    font-size: 11px;
    color: rgba(var(--pulse-night-soft-rgb), 0.45);
    flex-shrink: 0;
}

.rtg-pm-card-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.rtg-pm-edit-btn,
.rtg-pm-remove-btn {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
    position: relative;
}

    .rtg-pm-edit-btn::after,
    .rtg-pm-remove-btn::after { /* 44px tall hit area around the 26px button: 9px into the footer's 12px top margin and the card's 14px bottom padding */
        content: "";
        position: absolute;
        inset: -9px -3px; /* 3px to the sides: half the 6px gap between Edit and Remove */
    }

    .rtg-pm-edit-btn::after {
        left: -5px; /* 44px wide: 5px toward the date, which is not a control */
    }

.rtg-pm-edit-btn {
    color: var(--pulse-night-soft);
}

    .rtg-pm-edit-btn:hover {
        background: rgba(var(--pulse-night-soft-rgb), 0.1);
    }

.rtg-pm-remove-btn {
    color: rgba(var(--pulse-night-soft-rgb), 0.5);
}

    .rtg-pm-remove-btn:hover {
        background: rgba(var(--pulse-red-rgb), 0.12);
        color: var(--pulse-red);
    }

.rtg-pm-edit-wrap {
    margin-top: 10px;
    background: rgba(var(--pulse-shade-rgb), 0.2);
    border: 1px solid rgba(var(--pulse-night-soft-rgb), 0.2);
    border-radius: 8px;
    padding: 10px;
}

@media (min-width: 600px) {
    .rtg-pm-modal-panel {
        max-width: 480px;
        left: 50%;
        right: auto;
        transform: translate(-50%, calc(100% + 40px));
        border-radius: 16px;
        bottom: 40px;
    }

    .rtg-pm-modal-open .rtg-pm-modal-panel {
        transform: translate(-50%, 0);
    }
}

/* ============================================================
   Error Page
   ============================================================ */
.rtg-error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--rtg-header-height) - var(--rtg-bottom-nav-height));
    padding: 24px 24px 40px;
    text-align: center;
}

.rtg-error-illustration {
    width: 100%;
    max-width: 380px;
    margin-bottom: 8px;
}

.rtg-error-svg {
    width: 100%;
    height: auto;
    display: block;
}

.rtg-error-body {
    max-width: 360px;
    width: 100%;
}

.rtg-error-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--rtg-text-primary);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.rtg-error-desc {
    font-size: 15px;
    color: var(--rtg-text-secondary);
    line-height: 1.6;
    margin: 0 0 28px;
}

.rtg-error-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.rtg-error-btn {
    display: inline-block;
    padding: 12px 32px;
    background-color: var(--rtg-primary-600);
    color: var(--pulse-white);
    font-size: 15px;
    font-weight: 600;
    border-radius: 9px;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background-color 0.15s, transform 0.1s;
    min-width: 160px;
}

    .rtg-error-btn:hover {
        background-color: var(--rtg-primary-700);
        color: var(--pulse-white);
    }

    .rtg-error-btn:active {
        background-color: var(--rtg-primary-700);
        transform: scale(0.985);
    }

.rtg-error-link {
    font-size: 14px;
    color: var(--rtg-text-secondary);
    text-decoration: none;
    font-weight: 500;
}

    .rtg-error-link:hover {
        color: var(--rtg-primary-600);
        text-decoration: underline;
    }

.rtg-error-trace {
    font-size: 11px;
    color: var(--rtg-text-secondary);
    opacity: 0.55;
    margin: 0;
}

    .rtg-error-trace code {
        font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
        font-size: 10px;
        word-break: break-all;
    }

@media (min-width: 768px) {
    .rtg-error-page {
        min-height: calc(100vh - var(--rtg-header-height));
    }

    .rtg-error-illustration {
        max-width: 440px;
    }

    .rtg-error-title {
        font-size: 28px;
    }

    .rtg-error-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* The layout's column, as the header and Bills: 640, then 960 from 768 (the Desktop block below) */
.rtg-dir-page{
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 640px;
    margin: 0 auto;
}

/* Tabs */
.rtg-dir-tabs{
    display: flex;
    border-bottom: 1px solid var(--rtg-border);
    background: var(--rtg-surface);
    flex-shrink: 0;
}

.rtg-dir-tab{
    flex:1;
    padding: 12px 8px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--rtg-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.rtg-dir-tab.rtg-active{
    color: var(--rtg-primary-600);
    border-bottom-color: var(--rtg-primary-600);
}

.rtg-dir-tabs.rtg-hidden,
.rtg-dir-panel.rtg-hidden {
    display: none !important;
}

/* Legislator detail modal */

.rtg-leg-modal-backdrop{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(var(--pulse-shade-rgb), 0.45);
    z-index: 1100;
    align-items: flex-end;
    justify-content: center;
}

.rtg-leg-modal-backdrop.rtg-open{
    display:flex;
}

.rtg-leg-modal{
    background: var(--rtg-surface);
    width: 100%;
    max-width: 560px;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    padding-bottom: env(safe-area-inset-bottom);
}

.rtg-leg-modal-backdrop.rtg-open .rtg-leg-modal{
    transform: translateY(0);
}

.rtg-leg-modal-drag{
    width: 36px;
    height: 4px;
    background: var(--rtg-border);
    border-radius: 2px;
    margin: 10px auto 0;
}

.rtg-leg-modal-header{
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--rtg-border);
}

.rtg-leg-modal-photo-wrap{
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--pulse-slate-soft);
    position: relative;
}

.rtg-leg-modal-photo{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0;
    transition: opacity .25s ease;
}

.rtg-leg-modal-photo.rtg-photo-loaded{
    opacity: 1;
}


.rtg-leg-modal-photo-fallback{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--rtg-primary-600);
}

.rtg-leg-modal-title{
    flex:1;
    min-width: 0;
}

.rtg-leg-modal-name{
    font-size: 17px;
    font-weight: 700;
    color: var(--rtg-text-primary);
    margin-bottom: 4px;
}

.rtg-leg-modal-meta{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--rtg-text-secondary);
}

.rtg-leg-modal-close{
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -8px -10px 0 0;
    background: none;
    border: none;
    border-radius: 12px;
    color: var(--pulse-mute);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.rtg-leg-modal-body{
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Contact info rows (icon + label/value) */
.rtg-leg-modal-info-row{
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 20px;
}

.rtg-leg-modal-info-icon{
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(var(--pulse-slate-rgb), .12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rtg-primary-600);
    margin-top: 1px;
}

.rtg-leg-modal-info-content{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    min-height: 32px;
}

.rtg-leg-modal-info-label{
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rtg-text-secondary);
}

.rtg-leg-modal-info-value{
    font-size: 14px;
    color: var(--rtg-text-primary);
    line-height: 1.4;
}

/* Tappable action rows (phone / email / website) */
.rtg-leg-modal-action-row{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    text-decoration: none;
    transition: background .13s;
    -webkit-tap-highlight-color: transparent;
}

.rtg-leg-modal-action-row:active{
    background: rgba(var(--pulse-white-rgb), .05);
}

.rtg-leg-modal-action-row .rtg-leg-modal-info-value{
    color: var(--rtg-primary-600);
    flex: 1;
}

.rtg-leg-modal-action-chevron{
    flex-shrink: 0;
    color: var(--rtg-text-secondary);
    opacity: .5;
}

/* legacy link class kept for safety */
.rtg-leg-modal-link{
    font-size: 14px;
    color: var(--rtg-primary-600);
    text-decoration: none;
    word-break: break-all;
}

.rtg-leg-modal-link:hover{
    text-decoration: underline;
}

@media(min-width:768px){
    .rtg-leg-modal-backdrop{
        align-items: center;
    }
    .rtg-leg-modal{
        border-radius: 16px;
        max-height: 80vh;
    }

}

/* Toolbar */
.rtg-dir-toolbar{
    padding: 10px 16px 8px;
    background: var(--rtg-surface);
    border-bottom: 1px solid var(--rtg-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rtg-dir-search-wrap{
    position: relative;
}

.rtg-dir-search-icon{
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rtg-text-secondary);
    pointer-events: none;
}

.rtg-dir-search{
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--rtg-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--rtg-bg);
    color: var(--rtg-text-primary);
    outline: none;
    transition: border-color 0.15s;
}

.rtg.rtg-dir-search:focus{
    border-color: var(--rtg-primary-600);
}

.rtg-dir-house-filter{
    display: flex;
    gap: 5px;
}

.rtg-dir-house-btn{
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--rtg-border);
    border-radius: 6px;
    background: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--rtg-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.rtg-dir-house-btn::after{ /* 44px tall hit area (insets start inside the 1px border), within the toolbar's 8px gap and padding */
    content: "";
    position: absolute;
    inset: -8px 0;
}

/* Results */
.rtg-dir-results{
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.rtg-dir-loading{
    display: flex;
    justify-content: center;
    padding: 40px;
}

.rtg-dir-empty{
    text-align: center;
    color: var(--rtg-text-secondary);
    font-size: 14px;
    padding: 40px 16px;
}

/* Card */
.rtg-dir-card{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--pulse-line);
    background: var(--pulse-surface);
    transition: background 0.1s;
}

.rtg-dir-card:active{
    background: var(--pulse-g);
}

.rtg-dir-card-clickable{
    cursor: pointer;
}

.rtg-dir-card-clickable:hover{
    background: var(--rtg-primary-100);
}

.rtg-dir-chevron{
    flex-shrink: 0;
    color: var(--rtg-text-secondary);
    align-self: center;
}

/* Photo */
.rtg-dir-photo-wrap{
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--rtg-surface);
    position: relative;
}

.rtg-dir-photo{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0;
    transition: opacity .25s ease;
}

.rtg-dir-photo.rtg-photo-loaded{
    opacity: 1;
}

.rtg-dir-photo-fallback{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pulse-slate-soft);
    color: var(--rtg-primary-600);
    font-weight: 700;
    font-size: 16px;
}

/* Initials (Staff) */

.rtg-dir-initials-wrap{
    flex-shrink: 0;
    width: 52px;
    height: 52px;
}

.rtg-dir-initials{
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--rtg-surface);
    border: 1px solid var(--rtg-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--rtg-primary-600);
}

/* Info */

.rtg-dir-info{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rtg-dir-name{
    font-size: 15px;
    font-weight: 600;
    color: var(--rtg-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rtg-dir-meta{
    display:flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--rtg-text-secondary);
}

.rtg-dir-party-badge{
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* Party: pinned signal colors */
.rtg-dir-party-dem {
    background: var(--sig-party-dem-bg);
    color: var(--sig-party-dem);
}
.rtg-dir-party-rep {
    background: var(--sig-party-rep-bg);
    color: var(--sig-party-rep);
}
.rtg-dir-party-other {
    background: var(--sig-party-other-bg);
    color: var(--sig-party-other);
}

.rtg-dir-district{
    font-size: 12px;
    color: var(--rtg-text-secondary);
}

.rtg-dir-role-badge{
    font-size: 11.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid var(--pulse-line-strong);
    background: transparent;
    color: var(--pulse-ink-2);
}

.rtg-dir-sub{
    font-size: 12px;
    color: var(--rtg-text-secondary);
}

/* Contact links */

.rtg-dir-contacts{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.rtg-dir-contact-link{
    font-size:12px;
    color: var(--rtg-primary-600);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;

}

.rtg-dir-contact-link:hover{
    text-decoration: underline;

}

/* Desktop */
@media(min-width: 768px){
    .rtg-dir-page{
        max-width: 960px;
    }

    .rtg-dir-tabs{
        padding: 0 24px;
    }

    .rtg-dir-tab{
        flex:none;
        padding: 12px 20px;

    }

    .rtg-dir-toolbar{
        padding: 12px 24px;
        flex-direction: row;
        align-items: center;
    }

    .rtg-dir-search-wrap{
        flex: 1;
        max-width: 360px;
    }

    .rtg-dir-house-filter{
        flex-shrink: 0;
    }

    .rtg-dir-results{
        padding: 12px 0;
    }

    .rtg-dir-card{
        padding: 14px 24px;
        gap: 16px;
    }

    .rtg-dir-photo-wrap,
    .rtg-dir-initials-wrap,
    .rtg-dir-initials{
        width: 60px;
        height: 60px;
    }

    .rtg-dir-photo-fallback{
        font-size: 18px;
    }
    .rtg-dir-name{
        font-size: 16px;
    }

}

/* ── Photo skeleton shimmer ─────────────────────────────────────────────── */

@keyframes rtg-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

.rtg-dir-photo-wrap.rtg-photo-loading::after,
.rtg-leg-modal-photo-wrap.rtg-photo-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        rgba(var(--pulse-white-rgb), 0)    0%,
        rgba(var(--pulse-white-rgb), .18) 50%,
        rgba(var(--pulse-white-rgb), 0)  100%
    );
    background-size: 200% 100%;
    animation: rtg-shimmer 1.3s ease-in-out infinite;
}

/* ── Directory: Committees ──────────────────────────────────────────────── */

.rtg-cmte-card{
    gap: 12px;
}

.rtg-cmte-meta{
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.rtg-cmte-house-badge{
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* Chambers: quiet tints, no red (red is for live and oppose-type signals) */
.rtg-cmte-house-a{ background: var(--pulse-ok-tint);    color: var(--pulse-ok-deep); }
.rtg-cmte-house-s{ background: var(--pulse-slate-tint); color: var(--pulse-slate-deep); }
.rtg-cmte-house-j,
.rtg-cmte-house-l{ background: var(--pulse-soft-2);     color: var(--pulse-body); }

.rtg-cmte-type-label{
    font-size: 11px;
    color: var(--rtg-text-secondary);
    font-style: italic;
}

.rtg-cmte-footer{
    margin-top: 4px;
}

.rtg-cmte-member-count{
    font-size: 11px;
    color: var(--rtg-text-secondary);
}

/* ── Upcoming hearings strip (committees tab) ──────────────────────────── */
.rtg-hearing-strip{
    background: linear-gradient(135deg, var(--pulse-soft) 0%, var(--pulse-slate-tint) 100%);
    border-bottom: 1px solid var(--rtg-border);
    padding: 10px 0 12px;
}

.rtg-hearing-strip.rtg-hidden{ display: none; }

.rtg-hearing-strip-header{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 8px;
}

.rtg-hearing-strip-title{
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rtg-primary-600, var(--pulse-slate-deep));
}

.rtg-hearing-strip-count{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--rtg-primary-600, var(--pulse-slate-deep));
    color: var(--pulse-white);
    font-size: 11px;
    font-weight: 600;
}

.rtg-hearing-strip-scroll{
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 16px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.rtg-hearing-strip-scroll::-webkit-scrollbar{ height: 4px; }
.rtg-hearing-strip-scroll::-webkit-scrollbar-thumb{ background: rgba(var(--pulse-shade-rgb), .15); border-radius: 2px; }

.rtg-hearing-card{
    flex: 0 0 240px;
    scroll-snap-align: start;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: var(--pulse-surface);
    border: 1px solid var(--rtg-border);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(var(--pulse-shade-rgb), .04);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.rtg-hearing-card:hover,
.rtg-hearing-card:focus-visible{
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(var(--pulse-slate-rgb), .12);
    border-color: var(--rtg-primary-600, var(--pulse-slate-deep));
    outline: none;
}

.rtg-hearing-card-date{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-right: 10px;
    border-right: 1px solid var(--rtg-border);
    min-width: 62px;
}

.rtg-hearing-card-day{
    font-size: 11px;
    font-weight: 700;
    color: var(--rtg-primary-600, var(--pulse-slate-deep));
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.2;
}

.rtg-hearing-card-time{
    font-size: 12px;
    color: var(--rtg-text-secondary);
    margin-top: 2px;
}

.rtg-hearing-card-body{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rtg-hearing-card-cmte{
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.rtg-hearing-card-name{
    font-size: 13px;
    font-weight: 600;
    color: var(--rtg-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rtg-hearing-card-subject{
    font-size: 11px;
    color: var(--rtg-text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rtg-hearing-card-meta{
    display: flex;
    gap: 8px;
    margin-top: 2px;
    font-size: 10px;
    color: var(--rtg-text-secondary);
}

.rtg-hearing-card-items{
    color: var(--rtg-primary-600, var(--pulse-slate-deep));
    font-weight: 600;
}

.rtg-hearing-card-room{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* ── Committee detail modal: sections ─────────────────────────────────── */
.rtg-cmte-modal-section{
    padding: 10px 16px 14px;
    border-bottom: 1px solid var(--rtg-border);
}
.rtg-cmte-modal-section:last-child{ border-bottom: none; }

.rtg-cmte-modal-section-title{
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--rtg-text-secondary);
    margin-bottom: 8px;
}

.rtg-cmte-modal-section-count{
    font-weight: 400;
    opacity: .6;
}

/* Hearings section inside committee modal */
.rtg-cmte-hearings-section{
    background: linear-gradient(135deg, var(--pulse-soft) 0%, var(--pulse-slate-tint) 100%);
}

.rtg-cmte-hearing-row{
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    background: var(--pulse-surface);
    border: 1px solid var(--rtg-border);
    border-radius: 8px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.rtg-cmte-hearing-row + .rtg-cmte-hearing-row{ margin-top: 6px; }
.rtg-cmte-hearing-row:hover,
.rtg-cmte-hearing-row:focus-visible{
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--pulse-slate-rgb), .10);
    border-color: var(--rtg-primary-600, var(--pulse-slate-deep));
    outline: none;
}

.rtg-cmte-hearing-date{
    display: flex;
    flex-direction: column;
    min-width: 70px;
    padding-right: 10px;
    border-right: 1px solid var(--rtg-border);
}

.rtg-cmte-hearing-day{
    font-size: 11px;
    font-weight: 700;
    color: var(--rtg-primary-600, var(--pulse-slate-deep));
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.2;
}

.rtg-cmte-hearing-time{
    font-size: 12px;
    color: var(--rtg-text-secondary);
    margin-top: 2px;
}

.rtg-cmte-hearing-body{
    flex: 1;
    min-width: 0;
}

.rtg-cmte-hearing-subject{
    font-size: 12px;
    color: var(--rtg-text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}

.rtg-cmte-hearing-meta{
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: var(--rtg-text-secondary);
}

.rtg-cmte-hearing-items{
    color: var(--rtg-primary-600, var(--pulse-slate-deep));
    font-weight: 600;
}

.rtg-cmte-hearing-room{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

/* ── Legislator modal: enriched body ───────────────────────────────────── */

.rtg-leg-modal-leadership{
    font-size: 12px;
    color: var(--pulse-night-soft);
    font-weight: 500;
    margin-top: 2px;
    margin-bottom: 2px;
    line-height: 1.3;
}

.rtg-leg-modal-section{
    border-top: 1px solid var(--rtg-border);
    padding: 6px 0 8px;
}

.rtg-leg-modal-section:first-child{
    border-top: none;
    padding-top: 8px;
}

/* Section title with left accent */
.rtg-leg-modal-section-title{
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--rtg-text-secondary);
    padding: 6px 20px 10px;
}

.rtg-leg-modal-section-title::before{
    content: '';
    display: block;
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--rtg-primary-600);
    flex-shrink: 0;
}

/* Staff rows — avatar + info */
.rtg-leg-modal-staff-row{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    border-bottom: 1px solid rgba(var(--pulse-white-rgb), .04);
}

.rtg-leg-modal-staff-row:last-child{
    border-bottom: none;
}

.rtg-leg-modal-staff-avatar{
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--pulse-slate-rgb), .18);
    color: var(--rtg-primary-600);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .02em;
}

.rtg-leg-modal-staff-body{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rtg-leg-modal-staff-top{
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rtg-leg-modal-staff-name{
    font-size: 14px;
    font-weight: 500;
    color: var(--rtg-text-primary);
}

.rtg-leg-modal-staff-email{
    font-size: 12px;
    color: var(--rtg-primary-600);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rtg-leg-modal-staff-email:hover{
    text-decoration: underline;
}

/* Committee rows — always tappable, always show chevron */
.rtg-leg-modal-cmte-row{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background .13s;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.rtg-leg-modal-cmte-row:active,
.rtg-leg-modal-cmte-row:hover{
    background: rgba(var(--pulse-white-rgb), .05);
}

.rtg-leg-modal-cmte-body{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rtg-leg-modal-cmte-name{
    font-size: 13px;
    font-weight: 500;
    color: var(--rtg-text-primary);
    line-height: 1.35;
}

.rtg-leg-modal-cmte-chevron{
    flex-shrink: 0;
    color: var(--rtg-text-secondary);
    opacity: .45;
}

.rtg-leg-modal-empty{
    padding: 24px 20px;
    color: var(--rtg-text-secondary);
    font-size: 14px;
    text-align: center;
}

/* ── Committee role badge ───────────────────────────────────────────────── */

.rtg-cmte-role-badge{
    display: inline-flex;
    align-items: center;
    align-self: flex-start;          /* shrink to content; parent is column-flex */
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(var(--pulse-gold-rgb), .18);
    color: var(--pulse-warn);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Committee modal header ─────────────────────────────────────────────── */

.rtg-cmte-modal-header{
    padding-left: 20px;
}

/* ── Committee member rows ──────────────────────────────────────────────── */

.rtg-cmte-member-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    border-bottom: 1px solid rgba(var(--pulse-white-rgb), .05);
    transition: background .15s;
}

.rtg-cmte-member-row:last-child{
    border-bottom: none;
}

.rtg-cmte-member-row.rtg-dir-card-clickable{
    cursor: pointer;
}

.rtg-cmte-member-row.rtg-dir-card-clickable:hover{
    background: rgba(var(--pulse-white-rgb), .04);
}

.rtg-cmte-member-info{
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.rtg-cmte-member-name{
    font-size: 14px;
    font-weight: 500;
    color: var(--rtg-text-primary);
}

/* ── Responsive: tablet/desktop ─────────────────────────────────────────── */

@media (min-width: 640px){

    .rtg-cmte-house-badge{ font-size: 12px; }

    .rtg-leg-modal-section-title{ padding: 8px 24px 12px; }

    .rtg-leg-modal-info-row,
    .rtg-leg-modal-action-row{ padding: 11px 24px; }

    .rtg-leg-modal-staff-row{ padding: 10px 24px; }

    .rtg-leg-modal-cmte-row{ padding: 13px 24px; }

    .rtg-cmte-member-row{ padding: 12px 24px; }

    .rtg-leg-modal-cmte-name{ font-size: 14px; }

}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTACTS — Contact tab, cards, FAB, modals, select mode
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Contact toolbar ────────────────────────────────────────────────────── */
.rtg-contact-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rtg-contact-select-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--rtg-border);
    border-radius: 10px;
    background: var(--rtg-surface);
    color: var(--rtg-text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rtg-contact-select-btn.rtg-active {
    background: var(--rtg-primary-100);
    border-color: var(--rtg-primary-600);
    color: var(--rtg-primary-600);
}

/* ── Contact card ───────────────────────────────────────────────────────── */
.rtg-contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--rtg-surface);
    border-bottom: 1px solid var(--rtg-border);
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.12s;
    position: relative;
}
.rtg-contact-card:active  { background: var(--rtg-primary-100); }
.rtg-contact-card.rtg-selected { background: var(--pulse-slate-tint); }
.rtg-contact-card:first-child  { border-top: 1px solid var(--rtg-border); }

/* Checkbox (hidden until select mode) */
.rtg-contact-checkbox-wrap {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 0;
    overflow: hidden;
    transition: width 0.2s;
}
.rtg-select-mode .rtg-contact-checkbox-wrap {
    display: flex;
    width: 28px;
}
.rtg-contact-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    accent-color: var(--rtg-primary-600);
    cursor: pointer;
    flex-shrink: 0;
}

/* Avatar */
.rtg-contact-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--pulse-white);
}
.rtg-av-blue   { background: var(--pulse-slate); }
.rtg-av-teal   { background: var(--pulse-slate); }
.rtg-av-purple { background: var(--pulse-violet); }
.rtg-av-green  { background: var(--pulse-ok); }
.rtg-av-amber  { background: var(--pulse-warn); }
.rtg-av-rose   { background: var(--pulse-rose); }

/* Info block */
.rtg-contact-info {
    flex: 1;
    min-width: 0;
}
.rtg-contact-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--rtg-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rtg-contact-sub {
    font-size: 13px;
    color: var(--rtg-text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rtg-contact-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.rtg-contact-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--rtg-primary-100);
    color: var(--rtg-primary-600);
    text-decoration: none;
    transition: background 0.15s;
}
.rtg-contact-action-icon:active { background: var(--pulse-slate-soft); }

/* Card right-side meta */
.rtg-contact-card-meta {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.rtg-contact-chevron { opacity: 0.4; }
.rtg-select-mode .rtg-contact-chevron { opacity: 0; }

.rtg-contact-scope-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.rtg-scope-org-dot { background: var(--rtg-primary-600); }
.rtg-contact-lock-dot { font-size: 11px; line-height: 1; }

/* ── FAB button ─────────────────────────────────────────────────────────── */
.rtg-contact-fab {
    position: fixed;
    bottom: calc(var(--rtg-bottom-nav-height) + 20px);
    right: 20px;
    z-index: 90;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--rtg-primary-600);
    color: var(--pulse-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(var(--pulse-slate-rgb), 0.45);
    transition: transform 0.15s, background 0.15s, opacity 0.2s;
}
.rtg-contact-fab:active  { transform: scale(0.93); background: var(--rtg-primary-700); }
.rtg-contact-fab.rtg-hidden { opacity: 0; pointer-events: none; }
/* Picking contacts: the bulk bar is up, so the add button steps aside (it sat half under the bar) */
body:has(.rtg-contact-bulk-bar.rtg-bulk-visible) .rtg-contact-fab { opacity: 0; pointer-events: none; }

/* ── Bulk action bar ─────────────────────────────────────────────────────── */
.rtg-contact-bulk-bar {
    position: fixed;
    bottom: var(--rtg-bottom-nav-height);
    left: 0;
    right: 0;
    z-index: 95;
    background: var(--rtg-primary-700);
    color: var(--pulse-white);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    /* Push far enough to clear both bar height AND the bottom nav offset */
    transform: translateY(calc(100% + var(--rtg-bottom-nav-height)));
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -2px 12px rgba(var(--pulse-shade-rgb), 0.18);
}
.rtg-contact-bulk-bar.rtg-bulk-visible { transform: translateY(0); }

.rtg-contact-bulk-count {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}
.rtg-contact-bulk-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(var(--pulse-white-rgb), 0.5);
    background: transparent;
    color: var(--pulse-white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.rtg-contact-bulk-export:disabled { opacity: 0.45; cursor: not-allowed; }
.rtg-contact-bulk-delete {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: var(--rtg-error);
    color: var(--pulse-white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.rtg-contact-bulk-delete:disabled { opacity: 0.45; cursor: not-allowed; }
.rtg-contact-bulk-cancel {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(var(--pulse-white-rgb), 0.3);
    background: transparent;
    color: var(--pulse-white);
    font-size: 14px;
    cursor: pointer;
}

/* ── Contact view modal ─────────────────────────────────────────────────── */
.rtg-contact-view-header {
    gap: 12px;
}
.rtg-contact-view-avatar-wrap {
    flex-shrink: 0;
}
.rtg-contact-view-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--pulse-white);
}
.rtg-contact-view-sub {
    font-size: 13px;
    color: var(--rtg-text-secondary);
    margin-top: 2px;
}
.rtg-contact-view-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.rtg-contact-scope-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}
.rtg-scope-org { background: var(--rtg-primary-100); color: var(--rtg-primary-700); }
.rtg-scope-ws  { background: var(--pulse-ok-tint); color: var(--pulse-ok-deep); }
.rtg-contact-lock-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--pulse-warn-wash);
    color: var(--pulse-gold-deep);
    font-weight: 600;
}
.rtg-contact-owner-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--rtg-primary-100);
    color: var(--rtg-primary-700);
    font-weight: 600;
}

.rtg-contact-view-notes {
    font-size: 14px;
    color: var(--rtg-text-secondary);
    line-height: 1.55;
    white-space: pre-wrap;
}

.rtg-contact-view-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--rtg-border);
}
.rtg-contact-view-edit-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1.5px solid var(--rtg-primary-600);
    background: transparent;
    color: var(--rtg-primary-600);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.rtg-contact-view-edit-btn:active { background: var(--rtg-primary-100); }
.rtg-contact-view-delete-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1.5px solid var(--rtg-error);
    background: transparent;
    color: var(--rtg-error);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.rtg-contact-view-delete-btn:active { background: var(--pulse-bad-wash); }
.rtg-contact-view-export-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1.5px solid var(--rtg-border);
    background: transparent;
    color: var(--rtg-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.rtg-contact-view-export-btn:active { background: var(--rtg-surface); }
.rtg-contact-view-share-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1.5px solid var(--rtg-border);
    background: transparent;
    color: var(--rtg-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.rtg-contact-view-share-btn:active { background: var(--rtg-surface); }

/* ── QR Share modals ────────────────────────────────────────────────────── */
.rtg-contact-share-confirm-modal,
.rtg-contact-share-qr-modal {
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}
.rtg-contact-share-confirm-body {
    padding: 8px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rtg-contact-share-confirm-desc {
    font-size: 14px;
    color: var(--rtg-text-secondary);
    line-height: 1.5;
}
.rtg-contact-share-hours-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rtg-text-primary);
}
.rtg-contact-share-hours-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rtg-contact-share-hours-input {
    width: 90px;
    padding: 10px 12px;
    border: 1.5px solid var(--rtg-border);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--rtg-text-primary);
    background: var(--rtg-bg);
    text-align: center;
}
.rtg-contact-share-hours-input:focus {
    outline: none;
    border-color: var(--rtg-primary-600);
}
.rtg-contact-share-hours-unit {
    font-size: 14px;
    color: var(--rtg-text-secondary);
}
.rtg-contact-share-confirm-presets {
    display: flex;
    gap: 8px;
}
.rtg-share-preset {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--rtg-border);
    background: transparent;
    color: var(--rtg-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.rtg-share-preset.rtg-active,
.rtg-share-preset:hover {
    border-color: var(--rtg-primary-600);
    color: var(--rtg-primary-600);
    background: var(--rtg-primary-50, var(--pulse-slate-tint));
}
.rtg-contact-share-confirm-footer {
    padding: 12px 20px 20px;
    border-top: 1px solid var(--rtg-border);
}
.rtg-contact-share-confirm-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--rtg-primary-600);
    color: var(--pulse-white);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.rtg-contact-share-confirm-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.rtg-contact-share-confirm-btn:not(:disabled):active { background: var(--rtg-primary-700); }

/* QR result modal */
.rtg-contact-share-qr-body {
    padding: 16px 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.rtg-contact-share-qr-wrap {
    padding: 12px;
    background: var(--pulse-surface);
    border-radius: 12px;
    border: 1px solid var(--rtg-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rtg-contact-share-url-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.rtg-contact-share-url-input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid var(--rtg-border);
    border-radius: 10px;
    font-size: 13px;
    color: var(--rtg-text-secondary);
    background: var(--rtg-surface);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rtg-contact-share-copy-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1.5px solid var(--rtg-border);
    background: transparent;
    color: var(--rtg-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.rtg-contact-share-qr-expiry {
    font-size: 12px;
    color: var(--rtg-text-secondary);
    text-align: center;
}
.rtg-contact-share-qr-footer {
    padding: 12px 20px 20px;
    border-top: 1px solid var(--rtg-border);
}
.rtg-contact-share-save-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid var(--rtg-primary-600);
    background: transparent;
    color: var(--rtg-primary-600);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.rtg-contact-share-save-btn:active { background: var(--rtg-primary-50, var(--pulse-slate-tint)); }

/* QR icon button on contact card */
.rtg-contact-qr-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--rtg-text-secondary);
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}
.rtg-contact-qr-btn:hover { color: var(--rtg-primary-600); }

/* ── Contact add/edit sheet ─────────────────────────────────────────────── */
.rtg-contact-edit-modal {
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
}
.rtg-contact-edit-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 16px 24px;
    flex: 1;
}
.rtg-contact-edit-field {
    margin-bottom: 14px;
}
.rtg-contact-edit-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--rtg-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.rtg-contact-edit-input {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--rtg-border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--rtg-text-primary);
    background: var(--rtg-surface);
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}
.rtg-contact-edit-input:focus { border-color: var(--rtg-primary-600); }
.rtg-contact-edit-textarea {
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
    line-height: 1.5;
}
.rtg-contact-edit-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Toggles */
.rtg-contact-edit-toggles {
    background: var(--rtg-bg);
    border: 1.5px solid var(--rtg-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.rtg-contact-edit-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    gap: 12px;
}
.rtg-contact-edit-toggle-row + .rtg-contact-edit-toggle-row {
    border-top: 1px solid var(--rtg-border);
}
.rtg-contact-edit-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--rtg-text-primary);
}
.rtg-contact-edit-toggle-hint {
    font-size: 12px;
    color: var(--rtg-text-secondary);
    margin-top: 2px;
}
/* Toggle switch */
.rtg-toggle-switch {
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.rtg-toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rtg-toggle-track {
    width: 46px;
    height: 26px;
    border-radius: 13px;
    background: var(--rtg-border);
    transition: background 0.2s;
    position: relative;
    display: block;
}
.rtg-toggle-switch input:checked + .rtg-toggle-track { background: var(--rtg-primary-600); }
.rtg-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pulse-surface);
    box-shadow: 0 1px 4px rgba(var(--pulse-shade-rgb), 0.2);
    transition: transform 0.2s;
}
.rtg-toggle-switch input:checked + .rtg-toggle-track .rtg-toggle-thumb { transform: translateX(20px); }

/* Error + actions */
.rtg-contact-edit-error {
    font-size: 13px;
    color: var(--rtg-error);
    margin-bottom: 10px;
    display: none;
    min-height: 0;
}
.rtg-contact-edit-error:not(:empty) { display: block; }
.rtg-contact-edit-actions {
    display: flex;
    gap: 10px;
}
.rtg-contact-edit-cancel {
    flex: 1;
    padding: 13px;
    border-radius: 10px;
    border: 1.5px solid var(--rtg-border);
    background: transparent;
    color: var(--rtg-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.rtg-contact-edit-save {
    flex: 2;
    padding: 13px;
    border-radius: 10px;
    border: none;
    background: var(--rtg-primary-600);
    color: var(--pulse-white);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.rtg-contact-edit-save:disabled { opacity: 0.55; cursor: not-allowed; }
.rtg-contact-edit-save:not(:disabled):active { background: var(--rtg-primary-700); }

/* ── Scope select dropdown ──────────────────────────────────────────────── */
.rtg-contact-edit-select-wrap {
    position: relative;
}
.rtg-contact-edit-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    cursor: pointer;
}
.rtg-contact-edit-select-chevron {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--rtg-text-secondary);
}

/* ── Toast notification ─────────────────────────────────────────────────── */
.rtg-contact-toast {
    position: fixed;
    bottom: calc(var(--rtg-bottom-nav-height) + 80px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--pulse-ink);
    color: var(--pulse-white);
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(var(--pulse-shade-rgb), 0.25);
    z-index: 200;
    white-space: nowrap;
    pointer-events: none;
    animation: rtg-toast-in 0.2s ease;
}
@keyframes rtg-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Responsive: tablet+ ─────────────────────────────────────────────────── */
@media (min-width: 768px) {
    .rtg-contact-card { padding: 14px 20px; }
    .rtg-contact-edit-body { padding: 4px 24px 28px; }
    .rtg-contact-view-footer { padding: 14px 24px; }

    /* Bottom nav is hidden on desktop — reset positions that depend on it */
    /* The page is a 960 column in the middle of the window: the add button sits 24px inside its right edge (32px
       from the window's edge when the window is narrower), and the bulk bar, edge to edge, keeps its count and
       buttons in the column */
    .rtg-contact-fab {
        bottom: 32px;
        right: max(32px, calc(50% - 456px));
    }
    .rtg-contact-bulk-bar {
        bottom: 0;
        /* With bottom:0, translateY(100%) is sufficient to fully hide */
        transform: translateY(100%);
        padding-left: max(16px, calc(50% - 456px));
        padding-right: max(16px, calc(50% - 456px));
    }
    .rtg-contact-bulk-bar.rtg-bulk-visible {
        transform: translateY(0);
    }
    .rtg-contact-toast {
        bottom: 80px;
    }
}
/* Floor heads-up inbox icon — sibling variants (.cal/.vote/.pulse/.bill/.general)
   live in calendar.css; this family was added later. */
.rtg-notif-item-icon.floor    { background: var(--pulse-bad-wash); color: var(--pulse-bad); }

/* ── In-app alert toasts (push.js draws them): night navy, above the bottom bar ─────────────────────── */
#rtg-toast-container {
    position: fixed;
    bottom: calc(var(--pulse-nav-h) + env(safe-area-inset-bottom) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(380px, calc(100vw - 24px));
    pointer-events: none;
}

@media (min-width: 768px) {
    #rtg-toast-container {
        bottom: 24px;
    }
}

.rtg-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 44px;
    padding: 12px 8px 12px 14px;
    border: 1px solid var(--pulse-night-line);
    border-radius: 14px;
    background: var(--pulse-night);
    color: var(--pulse-on-night);
    box-shadow: 0 10px 30px -12px rgba(var(--pulse-shade-rgb), 0.55);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: all;
    cursor: pointer;
}

    .rtg-toast.visible {
        opacity: 1;
        transform: translateY(0);
    }

.rtg-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    font-size: 16px;
    line-height: 20px;
    color: var(--pulse-red-lit);
}

.rtg-toast-content {
    flex: 1;
    min-width: 0;
}

.rtg-toast-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.rtg-toast-body {
    font-size: 13px;
    color: var(--pulse-night-soft);
    line-height: 1.35;
}

.rtg-toast-close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin: -12px -4px -12px 0;
    padding: 0;
    border: none;
    background: none;
    color: var(--pulse-night-ink);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

    .rtg-toast-close:hover {
        color: var(--pulse-on-night);
    }

/* ── Directory, slice 2: one search, tap to call (pulse-15) ─────────────────────────────────────────── */
.rtg-dir-find {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 16px 10px;
}

.rtg-dir-find-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    margin-top: 2px;
    color: var(--pulse-mute);
    pointer-events: none;
}

.rtg-dir-find-input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px 10px 42px;
    border: 1px solid var(--pulse-line);
    border-radius: var(--pulse-ctl-r);
    background: var(--pulse-surface);
    color: var(--pulse-ink);
    font: inherit;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
}

    .rtg-dir-find-input::placeholder {
        color: var(--pulse-mute);
    }

    .rtg-dir-find-input:focus {
        border-color: var(--pulse-slate);
        box-shadow: 0 0 0 3px rgba(var(--pulse-slate-rgb), 0.14);
    }

.rtg-dir-find-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    padding: 14px 16px 6px;
    font-size: 15px;
    font-weight: 800;
    color: var(--pulse-ink);
}

    .rtg-dir-find-head span {
        font: 600 12.5px var(--pulse-mono);
        color: var(--pulse-mute);
    }

.rtg-dir-hint {
    margin: 0;
    padding: 10px 16px 4px;
    font-size: 13.5px;
    color: var(--pulse-body);
}

/* Tablet and desktop: the search fills the page's column (as Bills' search does), and its words and the find
   results' heads start at 24px, with the tabs, the toolbar and the cards */
@media (min-width: 768px) {
    .rtg-dir-find {
        max-width: none;
        padding: 14px 24px 10px;
    }

    .rtg-dir-find-icon {
        left: 38px;
    }

    .rtg-dir-find-head,
    .rtg-dir-hint {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* A member's card: the main part opens the sheet; call and email sit beside it */
.rtg-dir-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    min-height: 52px;
    margin: -4px 0;
    padding: 4px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

    .rtg-dir-card-main:focus-visible {
        outline: 2px solid var(--pulse-slate);
        outline-offset: 2px;
        border-radius: 10px;
    }

.rtg-dir-ibs {
    display: flex;
    flex: none;
    gap: 6px;
}

.rtg-dir-ib {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--pulse-soft-2);
    color: var(--pulse-slate);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

    .rtg-dir-ib svg {
        width: 20px;
        height: 20px;
    }

    .rtg-dir-ib:hover,
    .rtg-dir-ib:active {
        background: var(--pulse-slate-tint);
    }

    .rtg-dir-ib:focus-visible {
        outline: 2px solid var(--pulse-slate);
        outline-offset: 2px;
    }

.rtg-dir-phone {
    margin-top: 3px;
    font: 600 13px var(--pulse-mono);
    color: var(--pulse-body);
}

    .rtg-dir-phone span {
        font-family: var(--pulse-font);
        font-weight: 500;
        color: var(--pulse-mute);
    }

.rtg-leg-modal-staff-row .rtg-dir-ibs {
    align-self: center;
}

/* The member's sheet: Call Capitol office and Email as full buttons, the number in mono */
.rtg-dir-call {
    display: grid;
    gap: 10px;
    padding: 6px 16px 8px;
}

.rtg-dir-call-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--pulse-line-strong);
    border-radius: var(--pulse-ctl-r);
    background: var(--pulse-surface);
    color: var(--pulse-ink);
    font-size: 15.5px;
    font-weight: 700;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

    .rtg-dir-call-btn svg {
        flex: none;
        width: 19px;
        height: 19px;
    }

    .rtg-dir-call-btn span {
        margin-left: auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font: 600 13.5px var(--pulse-mono);
        opacity: 0.85;
    }

    .rtg-dir-call-btn.rtg-dir-call-pri {
        background: var(--pulse-slate);
        border-color: var(--pulse-slate);
        color: var(--pulse-white);
    }

    .rtg-dir-call-btn:focus-visible {
        outline: 2px solid var(--pulse-slate);
        outline-offset: 2px;
    }

.rtg-contact-lock-badge svg,
.rtg-contact-lock-dot svg {
    vertical-align: -1px;
    margin-right: 3px;
}

/* --- Quick find (slice 3, lane F): the header's search button opens this sheet over any page.
       Night bar on top (the input on white), results on the page ground in white cards. --- */
html.rtg-find-open,
html.rtg-find-open body {
    overflow: hidden;
}

.rtg-find {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    background: var(--pulse-g);
}

.rtg-find-in {
    max-width: 640px;
    margin: 0 auto;
}

.rtg-find-bar {
    flex: none;
    padding: calc(10px + env(safe-area-inset-top)) 12px 12px;
    background: var(--pulse-night);
    border-bottom: 1px solid var(--pulse-night-line);
    color: var(--pulse-on-night);
}

.rtg-find-label {
    display: block;
    margin: 0 0 6px 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--pulse-night-soft);
}

.rtg-find-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rtg-find-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.rtg-find-ic {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--pulse-mute);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.rtg-find-input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--pulse-night-line);
    border-radius: var(--pulse-ctl-r);
    background: var(--pulse-surface);
    color: var(--pulse-ink);
    font: inherit;
    font-size: 16px; /* 16 px or more: iPhone does not zoom into the box */
    outline: none;
    -webkit-appearance: none;
}

    .rtg-find-input::placeholder {
        color: var(--pulse-mute);
    }

    .rtg-find-input:focus {
        border-color: var(--pulse-night-soft);
        box-shadow: 0 0 0 3px rgba(var(--pulse-night-soft-rgb), 0.35);
    }

body.rtg-body .rtg-find-close {
    flex: none;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--pulse-on-night);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

    body.rtg-body .rtg-find-close:hover {
        background: rgba(var(--pulse-white-rgb), 0.08);
    }

    body.rtg-body .rtg-find-close:focus-visible {
        outline: 2px solid var(--pulse-night-soft);
        outline-offset: -2px;
    }

.rtg-find-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 4px 14px calc(28px + env(safe-area-inset-bottom));
}

.rtg-find-status:empty {
    display: none;
}

.rtg-find-status {
    margin: 12px 4px 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pulse-body);
}

.rtg-find-hint {
    margin: 14px 4px 0;
    font-size: 14px;
    color: var(--pulse-body);
}

    .rtg-find-hint p {
        margin: 0 0 6px;
    }

body.rtg-body .rtg-find-door {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 15px;
    font-weight: 700;
    color: var(--pulse-slate);
    text-decoration: none;
}

    body.rtg-body .rtg-find-door:hover {
        text-decoration: underline;
    }

.rtg-find-group {
    margin-top: 14px;
}

.rtg-find-gh {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0 4px 6px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--pulse-ink);
}

    .rtg-find-gh span {
        font-size: 12.5px;
        font-weight: 600;
        letter-spacing: 0;
        color: var(--pulse-mute);
    }

.rtg-find-list {
    list-style: none;
    margin: 0;
    padding: 0 14px;
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-line);
    border-radius: var(--pulse-card-r);
}

    .rtg-find-list > li + li {
        border-top: 1px solid var(--pulse-line);
    }

.rtg-find-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

    /* The sprite's line icons (#pi-phone, #pi-mail) draw with a stroke */
    .rtg-find-person .rtg-dir-ib svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.rtg-find-main,
.rtg-find-bill {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 4px 0;
    text-decoration: none;
}

.rtg-find-bill {
    padding: 9px 0;
}

body.rtg-body a.rtg-find-main,
body.rtg-body a.rtg-find-bill {
    color: inherit;
}

    a.rtg-find-main:focus-visible,
    a.rtg-find-bill:focus-visible,
    .rtg-find-law-head:focus-visible {
        outline: 2px solid var(--pulse-slate);
        outline-offset: 2px;
        border-radius: 10px;
    }

.rtg-find-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--pulse-ink);
}

.rtg-find-sub {
    font-size: 13.5px;
    color: var(--pulse-body);
    overflow-wrap: anywhere;
}

.rtg-find-room {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pulse-mute);
}

.rtg-find-bill-top {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
}

    .rtg-find-bill-top b {
        font-size: 15px;
        font-weight: 800;
        color: var(--pulse-ink);
    }

.rtg-find-author {
    min-width: 0;
    font-size: 13px;
    color: var(--pulse-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rtg-find-ses,
.rtg-find-tracked {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.rtg-find-ses {
    background: var(--pulse-slate-tint);
    color: var(--pulse-slate-deep);
}

/* "Tracked" is a word, not a control: stopping is on the bill page only, so a search list never untracks */
.rtg-find-tracked {
    border: 1px solid var(--pulse-ok);
    color: var(--pulse-ok-deep);
}

/* The portal's word for an Archived or Don't Track row (pulse-16, review round): plain, and no Track button beside it */
.rtg-find-kept {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 8px;
    border: 1px solid var(--pulse-line-strong);
    border-radius: 999px;
    color: var(--pulse-body);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

/* A bill row: the link, and Track beside it on an untracked bill (pulse-16, find.js); an error line under both */
.rtg-find-billrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 10px;
}

/* Quick send on a bill row: the glyph alone after Track (the bill's newest update) */
.rtg-find-send {
    flex: none;
    margin: 0 -8px 0 -6px;
}

body.rtg-body .rtg-find-track {
    flex: none;
    min-width: 64px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--pulse-slate);
    border-radius: var(--pulse-ctl-r);
    background: var(--pulse-surface);
    color: var(--pulse-slate-deep);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

    body.rtg-body .rtg-find-track:active {
        background: var(--pulse-slate-tint);
    }

    body.rtg-body .rtg-find-track:focus-visible {
        outline: 2px solid var(--pulse-slate);
        outline-offset: 2px;
    }

    body.rtg-body .rtg-find-track[aria-busy="true"] {
        opacity: 0.7;
        cursor: progress;
    }

.rtg-find-track-err {
    flex-basis: 100%;
    margin: 0 0 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--pulse-bad);
}

.rtg-find-law-head {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    min-height: 44px;
    padding: 10px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

button.rtg-find-law-head {
    cursor: pointer;
}

.rtg-find-count {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--pulse-ink-2);
}

.rtg-find-toggle {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--pulse-slate);
}

.rtg-find-sublist {
    margin: 0 0 10px;
    padding: 0 12px;
    background: var(--pulse-g);
}

/* The page head's quiet door to a related page (Bills: Support & Opposition) */
.rtg-page-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
}

body.rtg-body .rtg-page-head-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--pulse-slate);
    text-decoration: none;
}

    body.rtg-body .rtg-page-head-link:hover {
        text-decoration: underline;
    }

    body.rtg-body .rtg-page-head-link:focus-visible {
        outline: 2px solid var(--pulse-slate);
        outline-offset: 2px;
        border-radius: 8px;
    }
