/* ==========================================================================
   Copyright Clearance System — Blazor UI Styles
   Clean, minimal design. No CSS frameworks.
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #1a1a2e;
    --navy-light: #16213e;
    --primary: #4a6cf7;
    --primary-hover: #3a5ce5;
    --primary-light: #e8edff;
    --success: #10b981;
    --success-bg: #d1fae5;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    /*
        --gray-400/600/800 and the four colours below were referenced across the
        UI long before they were declared here. An unresolvable var() with no
        fallback makes the whole declaration invalid at computed-value time, and
        for an inherited property like `color` that computes to `inherit` — so
        every `color: var(--gray-600)` silently rendered as whatever the ancestor
        chain supplied instead of a mid grey.

        On most screens the ancestor was `body { color: var(--gray-900) }`, so the
        text merely came out too dark and nobody noticed. Inside the notification
        bell it was fatal: the dropdown is nested in `.nav-bar`, which sets
        `color: white`, and `.bell-dropdown` sets only a background — so
        `.bell-item-reqtitle` inherited white onto white and the request title was
        invisible. That is the bug this block fixes; declaring the properties here
        corrects all ~63 usages at once rather than patching call sites.

        Greys continue the Tailwind gray ramp the existing seven already match
        exactly. The four below are declared at precisely the fallback values
        already in use at their call sites (`var(--red-600, #dc2626)` etc.), so
        nothing changes visually — they exist so a future edit that drops a
        fallback doesn't reopen the same class of bug.
    */
    --blue-50: #eff6ff;
    --green-50: #f0fdf4;
    --green-200: #bbf7d0;
    --green-700: #15803d;
    --red-600: #dc2626;
    --info-bg: #e7f3ff;
    --font-mono: monospace;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* --- App Layout --- */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 2rem 1.5rem; }

/* --- Navigation --- */
.nav-bar {
    background: var(--navy);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}
.nav-brand { display: flex; align-items: center; gap: 0.75rem; margin-right: 2rem; }
.nav-logo {
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
}
.nav-title { font-weight: 600; font-size: 1rem; white-space: nowrap; }
.nav-links { display: flex; gap: 0.25rem; flex: 1; }
.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.15s;
    white-space: nowrap;
}
.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-auth { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.nav-user { font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.nav-signin { background: var(--primary); color: white !important; border-radius: 6px; }
.nav-signout { color: rgba(255,255,255,0.6) !important; font-size: 0.8rem; }

/* --- Footer --- */
.app-footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* --- Page Header --- */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); }
.page-subtitle { color: var(--gray-500); font-size: 1rem; margin-top: 0.25rem; }

/* --- Hero (unauthenticated) --- */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 3rem auto;
}
.hero-section h2 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--navy); }
.hero-section p { color: var(--gray-500); margin-bottom: 2rem; line-height: 1.7; }
.hero-actions { margin-top: 1.5rem; }

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
    display: block;
    color: inherit;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-2px); color: inherit; }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.card p { font-size: 0.85rem; color: var(--gray-500); }
.card-staff { border-left: 3px solid var(--primary); }
.card-admin { border-left: 3px solid var(--warning); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: white; }
.btn-large { padding: 0.75rem 2rem; font-size: 1rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Forms --- */
.form-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); margin-bottom: 0.35rem; }
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.15s;
    background: white;
    color: var(--gray-900);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
select.form-control { appearance: auto; }
textarea.form-control { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

/* --- Tables --- */
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.results-table thead { background: var(--gray-100); }
.results-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.results-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.results-table tbody tr:hover { background: var(--gray-50); }
.results-table tbody tr { cursor: pointer; transition: background 0.1s; }

/* --- Alerts --- */
.alert { padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.85rem; margin-bottom: 1rem; }
.alert-danger { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
/*
    .alert-info was in use at nine call sites — the "no results" box on
    Reports, AdminLookups, AdminFailedEmails, AdminAuditLog, RequestDetail,
    ItemEditModal and ReplaceCopyrightHolderModal — and had never been
    declared. Those boxes have been rendering with the bare .alert rule and
    no colour since they were written. Same class of defect as the missing
    --gray-600: the call sites were right, the declaration was absent.
    Uses --info-bg, the tint the modals already reach for as a fallback.
*/
.alert-info { background: var(--info-bg); color: #1e40af; border: 1px solid #bfdbfe; }

/* --- Status Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-submitted { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-referred { background: #fee2e2; color: #991b1b; }
.badge-closed { background: var(--gray-200); color: var(--gray-500); }
.badge-locked { background: #fce7f3; color: #9d174d; }

/* --- Auth Message --- */
.auth-message { text-align: center; padding: 3rem; color: var(--gray-500); }
.not-found { text-align: center; padding: 3rem; }
.not-found h2 { color: var(--gray-700); margin-bottom: 0.5rem; }
.not-found p { color: var(--gray-500); }

/* --- Loading --- */
.loading { display: flex; align-items: center; gap: 0.5rem; color: var(--gray-500); font-size: 0.85rem; padding: 1rem 0; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--gray-300); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Section Headers --- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.25rem; font-weight: 600; }

/* --- Filters --- */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.filter-bar .form-group { margin-bottom: 0; min-width: 150px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
    .main-content { padding: 1rem; }
}

/* ==========================================================================
   Group A — Notifications bell, login-notice modal, dashboard, notices admin
   ========================================================================== */

/* --- Notification Bell --- */
.bell-wrapper { position: relative; display: inline-flex; align-items: center; margin-right: 0.75rem; }
.bell-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius);
    position: relative;
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.15s;
}
.bell-btn:hover { background: rgba(255,255,255,0.1); }
.bell-icon { display: inline-block; }
.bell-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bell-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent;
    z-index: 90;
}
.bell-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 380px;
    max-width: calc(100vw - 2rem);
    max-height: 520px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bell-dropdown-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
    color: var(--gray-900);
}
.bell-link {
    background: none; border: none; color: var(--primary);
    cursor: pointer; font-size: 0.8rem; padding: 0;
}
.bell-link:hover { text-decoration: underline; }
.bell-dropdown-body {
    overflow-y: auto;
    flex: 1;
    min-height: 80px;
}
.bell-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.1s;
}
.bell-item:hover { background: var(--gray-50); }
.bell-item:last-child { border-bottom: none; }
.bell-item-unread { background: var(--primary-light); }
.bell-item-unread:hover { background: #dce4ff; }
.bell-item-title { font-weight: 600; font-size: 0.85rem; color: var(--gray-900); margin-bottom: 0.15rem; }
.bell-item-body { font-size: 0.8rem; color: var(--gray-700); margin-bottom: 0.25rem; line-height: 1.4; }
.bell-item-meta { font-size: 0.7rem; color: var(--gray-500); }
/* Request header on a notification card (patch 032). Only rendered when the
   notification has a related request; the ActionAlerter digest has none. */
.bell-item-request { display: flex; gap: 0.4rem; align-items: baseline; margin-bottom: 0.2rem; }
.bell-item-reqno { font-size: 0.72rem; font-weight: 700; color: var(--primary, #4f46e5); flex: none; }
.bell-item-reqtitle { font-size: 0.72rem; color: var(--gray-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The whole card is clickable; this just makes that visible. */
.bell-item-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.bell-item-open { color: var(--primary, #4f46e5); font-weight: 600; flex: none; }
.bell-item:hover .bell-item-open { text-decoration: underline; }
.bell-empty { padding: 1.5rem; text-align: center; color: var(--gray-500); font-size: 0.85rem; }
.bell-dropdown-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    text-align: center;
}
.bell-dropdown-footer a {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.bell-dropdown-footer a:hover { text-decoration: underline; }

/* --- Notifications Page --- */
.notification-list { list-style: none; padding: 0; margin: 0; }
.notification-row {
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.1s, box-shadow 0.1s;
}
.notification-row:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.notification-unread { border-left: 3px solid var(--primary); background: var(--primary-light); }
.notification-top {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin-bottom: 0.4rem;
}
.notification-title { font-weight: 600; color: var(--gray-900); }
.notification-body { color: var(--gray-700); font-size: 0.9rem; margin-bottom: 0.4rem; line-height: 1.5; }
.notification-meta { font-size: 0.75rem; color: var(--gray-500); display: flex; gap: 0.35rem; }

/* --- Modal (login notice + edit forms) --- */
.modal-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}
.modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1001;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    pointer-events: none;
}
.modal-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    display: flex; flex-direction: column;
    pointer-events: auto;
    overflow: hidden;
}
.modal-card-wide { max-width: 820px; }
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.modal-header h2 { font-size: 1.25rem; font-weight: 600; color: var(--gray-900); margin: 0; }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem;
    background: var(--gray-50);
}
.modal-counter { font-size: 0.8rem; color: var(--gray-500); margin-right: auto; }

/* --- Notice body (rendered markdown) --- */
.notice-body { line-height: 1.6; color: var(--gray-900); font-size: 0.95rem; }
.notice-body p { margin-bottom: 0.75rem; }
.notice-body p:last-child { margin-bottom: 0; }
.notice-body h1, .notice-body h2, .notice-body h3 { margin: 1rem 0 0.5rem; font-weight: 600; }
.notice-body h1 { font-size: 1.2rem; }
.notice-body h2 { font-size: 1.1rem; }
.notice-body h3 { font-size: 1rem; }
.notice-body ul, .notice-body ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.notice-body li { margin-bottom: 0.25rem; }
.notice-body code {
    background: var(--gray-100); padding: 0.1rem 0.35rem;
    border-radius: 3px; font-size: 0.85em; font-family: monospace;
}
.notice-body pre {
    background: var(--gray-100); padding: 0.75rem;
    border-radius: 4px; overflow-x: auto; margin: 0.75rem 0;
}
.notice-body pre code { background: transparent; padding: 0; }
.notice-body a { color: var(--primary); }
.notice-body blockquote {
    border-left: 3px solid var(--gray-300); padding-left: 1rem;
    color: var(--gray-700); margin: 0.75rem 0; font-style: italic;
}

/* Preview inside notice edit form */
.notice-preview {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    min-height: 80px;
}
.form-markdown { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.85rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; margin-right: 0.25rem; }

/* --- Dashboard --- */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.metric-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, transform 0.15s;
}
.metric-clickable { cursor: pointer; }
.metric-clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.metric-label { font-size: 0.8rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; margin-bottom: 0.4rem; }
.metric-value { font-size: 2rem; font-weight: 700; color: var(--gray-900); line-height: 1.1; margin-bottom: 0.25rem; }
.metric-sub { font-size: 0.75rem; color: var(--gray-500); }
.metric-warn .metric-value { color: var(--warning); }
.metric-danger .metric-value { color: var(--danger); }

.dash-split {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}
.dash-panel {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.dash-table { box-shadow: none; border: 1px solid var(--gray-200); }
.dash-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-top { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.1rem; }
.activity-action { font-weight: 600; color: var(--gray-900); font-size: 0.85rem; }
.activity-entity { color: var(--gray-500); font-size: 0.85rem; }
.activity-meta { font-size: 0.75rem; color: var(--gray-500); display: flex; gap: 0.35rem; }
.activity-dot { color: var(--gray-300); }

@media (max-width: 768px) {
    .dash-split { grid-template-columns: 1fr; }
    .bell-dropdown { width: calc(100vw - 2rem); right: 1rem; }
}

/* Ready-for-Requestor page — subtext beneath a table row title (e.g., course name under request title) */
.row-subtext { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.15rem; }

/* =========================================================================
   Record Rights Holder Response — card-per-item layout
   Replaces the old cramped 7-column table. Each item is a card; the
   "Approved?" choice is a segmented N/A | Yes | No toggle that can't wrap.
   Fee / date / comments stay visible but are disabled (greyed) unless the
   item is approved ("Yes"), mirroring the server-side ValidateChResponses
   rules (Yes => fee+date; No => comments required, estimate forbidden;
   N/A => nothing recorded).
   ========================================================================= */
.resp-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}
.resp-card.is-na { opacity: 0.7; }                 /* not recorded yet — de-emphasised */
.resp-card.is-recorded { border-left: 3px solid var(--warning); }
.resp-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.resp-item-title { font-weight: 600; color: var(--gray-900); font-size: 0.95rem; }
.resp-item-meta { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.15rem; }
.resp-recorded-note { font-size: 0.8rem; color: var(--warning); margin-top: 0.25rem; }

/* Segmented toggle */
.seg {
    display: inline-flex;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}
.seg-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: white;
    color: var(--gray-500);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    cursor: pointer;
    border-right: 1px solid var(--gray-200);
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--gray-50); }
.seg-btn.active { color: white; }
.seg-btn.active-na  { background: var(--gray-500); color: white; }
.seg-btn.active-yes { background: var(--success); color: white; }
.seg-btn.active-no  { background: var(--danger); color: white; }

/* Contextual field grid revealed below the toggle */
.resp-fields {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--gray-100);
}
.resp-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}
.resp-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}
.resp-estimate {
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.5rem;
    font-size: 0.85rem;
}
.resp-estimate label { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.resp-comments { margin-top: 0.75rem; }

/* Disabled fields stay in place but read as inactive (mirrors .btn:disabled) */
.resp-field input:disabled,
.resp-comments textarea:disabled,
.resp-estimate input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-50);
}
.resp-field .req-mark { color: var(--danger); }
.resp-field .req-hint { color: var(--gray-500); font-weight: 400; }

