/* Small Towns AI — WCAG 2.1 AA compliant styles */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary: #0b3d6e;
    --color-primary-dark: #092e54;
    --color-primary-hover: #0a3562;
    --color-text: #1a1a2e;
    --color-text-light: #4a4a5e;
    --color-bg: #f3f4f6;
    --color-white: #ffffff;
    --color-border: #d0d5dd;
    --color-focus: #2563eb;
    --color-error: #b91c1c;
    --color-error-bg: #fef2f2;
    --color-success: #166534;
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.5);
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    z-index: 1000;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

/* Header */
.header {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-seal {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.header-seal svg {
    width: 100%;
    height: 100%;
}
.header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.header .subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 1px;
    font-weight: 400;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header .badge {
    background: rgba(255,255,255,0.25);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-white);
    border: 1px solid rgba(255,255,255,0.5);
}
.staff-link {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.4);
    transition: all 0.2s;
}
.staff-link:hover {
    background: rgba(255,255,255,0.15);
    color: var(--color-white);
}
.staff-link:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

/* Tab bar / Navigation */
.tab-nav {
    background: var(--color-primary-dark);
    padding: 0 20px;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-nav [role="tab"] {
    background: none;
    border: none;
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    font-weight: 600;
    padding: 14px 14px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s, background 0.15s;
}
.tab-nav [role="tab"]:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.05);
}
.tab-nav [role="tab"]:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: -3px;
}
.tab-nav [role="tab"][aria-selected="true"] {
    color: var(--color-white);
    border-bottom-color: #4da3ff;
}

/* Main container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 36px 24px;
}

/* Search form */
.search-form {
    margin-bottom: 16px;
}
.search-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 8px;
}
.search-input-wrapper {
    position: relative;
}
.search-input-wrapper input[type="text"] {
    width: 100%;
    padding: 16px 130px 16px 20px;
    font-size: 17px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    color: var(--color-text);
}
.search-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--color-focus);
    box-shadow: var(--focus-ring);
}
.search-input-wrapper input[type="text"]::placeholder {
    color: #767676; /* 4.5:1 contrast on white */
}
.search-input-wrapper button[type="submit"] {
    position: absolute;
    right: 8px;
    top: 8px;
    bottom: 8px;
    padding: 0 28px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.search-input-wrapper button[type="submit"]:hover {
    background: var(--color-primary-hover);
}
.search-input-wrapper button[type="submit"]:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}
.search-input-wrapper button[type="submit"]:disabled {
    background: #6b7280;
    cursor: not-allowed;
}

/* Example chips */
.examples {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.examples button {
    padding: 7px 15px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.examples button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: #eef3fa;
}
.examples button:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

/* Answer panel */
.answer-panel {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    overflow: hidden;
    display: none;
}
.answer-panel.visible { display: block; }

.answer-header {
    padding: 16px 24px;
    background: #f8fafe;
    border-bottom: 1px solid #e8edf2;
    display: flex;
    align-items: center;
    gap: 12px;
}
.answer-header .icon {
    width: 30px;
    height: 30px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}
.answer-header .title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.answer-body {
    padding: 24px;
    font-size: 16px;
    line-height: 1.75;
    color: #2a2a3e;
}
.answer-body p { margin-bottom: 12px; }
.answer-body p:last-child { margin-bottom: 0; }
.answer-body h1, .answer-body h2, .answer-body h3 {
    margin: 18px 0 8px;
    color: var(--color-text);
}
.answer-body h1 { font-size: 22px; }
.answer-body h2 { font-size: 19px; }
.answer-body h3 { font-size: 17px; }
.answer-body ul, .answer-body ol {
    margin: 8px 0 12px 24px;
}
.answer-body li { margin-bottom: 5px; }
.answer-body strong { color: var(--color-text); }

/* Citation links */
.cite-link {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    vertical-align: super;
    line-height: 0;
    padding: 0 1px;
}
.cite-link:hover,
.cite-link:focus {
    text-decoration: underline;
    outline: none;
}
.cite-link:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
}

/* Page entrance — short fade so navigation between /, /staff, /staff/usage,
   /admin doesn't feel like a hard page swap. Disabled if the user has
   reduced-motion preferences set. */
@keyframes sta-page-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
body { animation: sta-page-fade-in 0.22s ease-out both; }
@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
}

/* Loading state */
.loading {
    padding: 44px 24px;
    text-align: center;
    color: var(--color-text-light);
}
.loading .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sources */
.sources {
    border-top: 1px solid #e8edf2;
    padding: 18px 24px;
    background: #fafbfc;
}
.sources-title {
    font-size: 12px;
    font-weight: 700;
    color: #595959; /* 4.5:1 on #fafbfc */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}
.sources-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.sort-toggle {
    display: inline-flex;
    border: 1px solid #d4d9e0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}
.sort-toggle .sort-btn {
    background: white;
    border: none;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #4a4a5e;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sort-toggle .sort-btn + .sort-btn {
    border-left: 1px solid #d4d9e0;
}
.sort-toggle .sort-btn:hover {
    background: #f1f5f9;
}
.sort-toggle .sort-btn.active {
    background: var(--color-primary);
    color: white;
}
.sort-toggle .sort-btn:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
    z-index: 1;
}
.source-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    font-size: 14px;
    transition: background 0.2s;
    border-radius: 6px;
    margin: 0 -8px;
}
.source-item[hidden] { display: none; }
/* Progressive "Show 10 more" expander, sits beneath the source-item list */
.sources-expand-row { display: flex; justify-content: center; margin-top: 10px; }
.sources-show-more {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #4a4a5e;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.sources-show-more:hover { background: #eef2f7; border-color: #9ca3af; }
.sources-show-more:focus-visible { outline: 2px solid var(--color-focus, #1e6fd9); outline-offset: 1px; }
.sources-show-more[hidden] { display: none; }
.source-item.highlight {
    background: #eef3fa;
}
.source-item a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.source-item a:hover { text-decoration: underline; }
.source-item a:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}
.source-item .num {
    background: #e8edf2;
    color: #333;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.source-item .jurisdiction-badge {
    background: #e8f0fe;
    color: var(--color-primary);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.source-item .page-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.source-item .page-badge a {
    color: inherit;
    text-decoration: none;
    padding: 0 1px;
    border-radius: 3px;
}
.source-item .page-badge a:hover,
.source-item .page-badge a:focus-visible {
    text-decoration: underline;
    background: #fde68a;
}
.source-item .page-badge a:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
}

.source-item .relevance-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
}
.source-item .relevance-green {
    background: #d1fae5;
    color: #065f46;
}
.source-item .relevance-yellow {
    background: #fef3c7;
    color: #92400e;
}
.source-item .relevance-red {
    background: #fee2e2;
    color: #991b1b;
}

.copy-link-btn {
    background: none;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    padding: 3px 6px;
    cursor: pointer;
    color: #667085;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s, border-color 0.15s;
}
.copy-link-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }
.copy-link-btn:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* "Watch meeting" YouTube link on citation cards. Server attaches video_url
   when a citation's meeting_date matches the cumulative video index from
   sync_agent/youtube_videos.py. */
.video-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    color: #c4302b;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.video-link:hover { background: #fff5f5; border-color: #c4302b; color: #a4262c; text-decoration: none; }
.video-link:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.video-link svg { display: block; }

/* Error state */
.error-msg {
    padding: 24px;
    color: var(--color-error);
    background: var(--color-error-bg);
    border-radius: 8px;
    font-size: 15px;
}

/* Stats */
.stats {
    display: flex;
    gap: 20px;
    padding: 10px 24px 14px;
    font-size: 13px;
    color: var(--color-text-light);
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 24px;
    font-size: 13px;
    color: #595959;
}

/* Responsive */
@media (max-width: 640px) {
    .header { padding: 16px 18px; }
    .header-seal { width: 36px; height: 36px; }
    .header h1 { font-size: 18px; }
    .header .subtitle { font-size: 12px; }
    .tab-nav { padding: 0 12px; }
    .tab-nav [role="tab"] { padding: 12px 16px; font-size: 13px; }
    .container { padding: 24px 14px; }
    .search-input-wrapper input[type="text"] { padding: 14px 100px 14px 16px; font-size: 16px; }
    .search-input-wrapper button[type="submit"] { padding: 0 18px; font-size: 15px; }
    .answer-body { padding: 20px 18px; }
    .sources { padding: 14px 18px; }
    .examples button { font-size: 12px; padding: 6px 12px; }
}

/* ── Feedback widget (sta-fb*) ──────────────────────────────────── */
.sta-fb { margin-top: 16px; padding: 12px 18px; background: #f8f9fb; border-top: 1px solid #e5e7eb; border-radius: 0 0 8px 8px; font-size: 14px; }
/* Prominent placement: widget sits between the answer body and the sources
   list, so it should look like a discrete callout rather than a panel
   footer. All-around border, full radius, slightly stronger background. */
.sta-fb-prominent { margin: 18px 0 8px; padding: 14px 18px; background: #f0f7ff; border: 1px solid #bcd6f5; border-top: 1px solid #bcd6f5; border-radius: 8px; }
.sta-fb-prominent .sta-fb-label { color: #0b3d6e; font-weight: 600; }
.sta-fb-row { display: flex; align-items: center; gap: 18px; }
.sta-fb-row .sta-fb-thumb + .sta-fb-thumb { margin-left: 4px; }
.sta-fb-label { color: #595959; }
.sta-fb-thumb { background: white; border: 1px solid #d1d5db; border-radius: 6px; padding: 9px 16px; cursor: pointer; color: #4a4a5e; transition: all 0.15s; display: inline-flex; align-items: center; }
.sta-fb-thumb:hover { background: #eef2f7; border-color: #9ca3af; }
.sta-fb-thumb:focus-visible { outline: 2px solid var(--color-focus, #1e6fd9); outline-offset: 1px; }
.sta-fb-thumb.active { background: #0b3d6e; color: white; border-color: #0b3d6e; }
.sta-fb-thanks { color: #2e7d32; font-weight: 500; }
.sta-fb-detail { margin-top: 12px; }
.sta-fb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sta-fb-chip { background: white; border: 1px solid #d1d5db; border-radius: 14px; padding: 4px 12px; cursor: pointer; font-size: 13px; color: #4a4a5e; }
.sta-fb-chip:hover { border-color: #9ca3af; }
.sta-fb-chip.active { background: #0b3d6e; color: white; border-color: #0b3d6e; }
.sta-fb-text { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-family: inherit; font-size: 14px; resize: vertical; min-height: 50px; }
.sta-fb-text:focus { outline: 2px solid var(--color-focus, #1e6fd9); outline-offset: 1px; }
.sta-fb-submit { margin-top: 8px; background: #0b3d6e; color: white; border: none; border-radius: 6px; padding: 7px 16px; cursor: pointer; font-size: 13px; }
.sta-fb-submit:hover { background: #082f56; }

/* ── Post-click doc-rating toast ─────────────────────────────────── */
.sta-doc-toast { position: fixed; bottom: 20px; right: 20px; left: auto; max-width: 380px; background: white; border: 1px solid #d1d5db; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.15); padding: 14px 16px; opacity: 0; transform: translateY(12px); transition: opacity 0.25s, transform 0.25s; z-index: 9000; }
.sta-doc-toast.visible { opacity: 1; transform: translateY(0); }
.sta-doc-toast-q { font-size: 14px; color: #2c2c3a; margin-bottom: 10px; line-height: 1.4; }
.sta-doc-toast-btns { display: flex; gap: 6px; align-items: center; }
.sta-doc-toast-btns button { background: white; border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: #4a4a5e; }
.sta-doc-toast-btns button:hover { background: #eef2f7; border-color: #9ca3af; }
.sta-doc-toast-btns button[data-r="right"]:hover { background: #e6f4e6; border-color: #2e7d32; color: #1b5e20; }
.sta-doc-toast-btns button[data-r="wrong"]:hover { background: #fdeaea; border-color: #c62828; color: #b71c1c; }
.sta-doc-toast-x { margin-left: auto; padding: 5px 10px !important; font-size: 16px !important; line-height: 1; }

/* ── Heartbeat glow (low-visibility feature discovery) ──────────── */
@keyframes sta-pulse-light {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,236,168,0); }
    18% { box-shadow: 0 0 0 5px rgba(255,236,168,0.55); }
    32% { box-shadow: 0 0 0 0 rgba(255,236,168,0); }
    50% { box-shadow: 0 0 0 7px rgba(255,236,168,0.55); }
    68% { box-shadow: 0 0 0 0 rgba(255,236,168,0); }
}
@keyframes sta-pulse-dark {
    0%, 100% { box-shadow: 0 0 0 0 rgba(30,111,217,0); }
    18% { box-shadow: 0 0 0 5px rgba(30,111,217,0.40); }
    32% { box-shadow: 0 0 0 0 rgba(30,111,217,0); }
    50% { box-shadow: 0 0 0 7px rgba(30,111,217,0.40); }
    68% { box-shadow: 0 0 0 0 rgba(30,111,217,0); }
}
@keyframes sta-pulse-toast {
    0%, 100% { box-shadow: 0 6px 24px rgba(0,0,0,0.15), 0 0 0 0 rgba(30,111,217,0); }
    18% { box-shadow: 0 6px 24px rgba(0,0,0,0.15), 0 0 0 6px rgba(30,111,217,0.45); }
    32% { box-shadow: 0 6px 24px rgba(0,0,0,0.15), 0 0 0 0 rgba(30,111,217,0); }
    50% { box-shadow: 0 6px 24px rgba(0,0,0,0.15), 0 0 0 8px rgba(30,111,217,0.45); }
    68% { box-shadow: 0 6px 24px rgba(0,0,0,0.15), 0 0 0 0 rgba(30,111,217,0); }
}
.report-pill { animation: sta-pulse-dark 1.4s ease-out 2.5s 2; }
.sta-doc-toast.visible { animation: sta-pulse-toast 1.4s ease-out 0.6s 2; }
.report-pill:hover, .report-pill:focus, .sta-doc-toast:hover { animation: none; }
@media (prefers-reduced-motion: reduce) {
    .report-pill, .sta-doc-toast.visible { animation: none; }
}

/* ── "Report a problem" triggers + bubble ───────────────────────── */
.header-cross-link { color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 500; text-decoration: none; padding: 3px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.35); transition: all 0.2s; }
.header-cross-link:hover { background: rgba(255,255,255,0.15); color: white; }
.header-cross-link:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.report-bar { display: flex; justify-content: flex-end; padding: 12px 40px 0; box-sizing: border-box; }
@media (max-width: 640px) { .report-bar { padding: 10px 18px 0; } }
.footer-report { margin-top: 12px; }
.report-pill { background: white; border: 1px solid #d1d5db; border-radius: 16px; padding: 6px 16px; cursor: pointer; font-family: inherit; font-size: 12px; color: #595959; box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.report-pill:hover { background: #f5f7fa; color: #2c2c3a; border-color: #9ca3af; }
.report-pill:focus-visible { outline: 2px solid var(--color-focus, #1e6fd9); outline-offset: 2px; }
.sta-report-bubble { position: fixed; right: 14px; bottom: 14px; width: 340px; max-width: calc(100vw - 28px); background: white; border: 1px solid #d1d5db; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); padding: 16px; z-index: 8001; }
.sta-report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sta-report-header h3 { margin: 0; font-size: 15px; }
.sta-report-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #595959; padding: 0 4px; }
.sta-report-close:hover { color: #2c2c3a; }
.sta-report-help { font-size: 12px; color: #595959; margin: 0 0 10px; }
.sta-report-text { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-family: inherit; font-size: 14px; resize: vertical; }
.sta-report-text:focus { outline: 2px solid var(--color-focus, #1e6fd9); outline-offset: 1px; }
.sta-report-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.sta-report-submit { background: #0b3d6e; color: white; border: none; border-radius: 6px; padding: 7px 16px; cursor: pointer; font-size: 13px; }
.sta-report-submit:hover { background: #082f56; }
.sta-report-status { font-size: 13px; color: #2e7d32; }

/* ── Staff CSAT bar ─────────────────────────────────────────────── */
.sta-csat { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #0b3d6e; color: white; padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 12px; opacity: 0; transition: opacity 0.25s, transform 0.25s; z-index: 9000; max-width: calc(100vw - 28px); }
.sta-csat.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.sta-csat-q { font-size: 14px; }
.sta-csat-stars { display: flex; gap: 4px; }
.sta-csat-stars button { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: white; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.sta-csat-stars button:hover { background: rgba(255,255,255,0.3); }
.sta-csat-x { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1; }
.sta-csat-x:hover { color: white; }

@media (max-width: 480px) {
    .sta-doc-toast { left: 12px; right: 12px; max-width: none; }
    .sta-report-bubble { left: 8px; right: 8px; width: auto; bottom: 8px; }
}

/* ── About modal ────────────────────────────────────────────────── */
.sta-about-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.sta-about-overlay[hidden] { display: none; }
.sta-about-card { background: white; border-radius: 10px; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.25); animation: sta-about-pop 0.18s ease-out; }
@keyframes sta-about-pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sta-about-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid #e5e7eb; }
.sta-about-header h2 { margin: 0; font-size: 18px; color: #0f172a; }
.sta-about-close { background: none; border: none; font-size: 24px; line-height: 1; color: #64748b; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.sta-about-close:hover { background: #f1f5f9; color: #0f172a; }
.sta-about-close:focus-visible { outline: 2px solid var(--color-focus, #1e6fd9); outline-offset: 1px; }
.sta-about-body { padding: 18px 22px 22px; color: #334155; font-size: 14px; line-height: 1.55; }
.sta-about-body h3 { margin: 16px 0 6px; font-size: 14px; color: #0f172a; }
.sta-about-body p { margin: 0 0 10px; }
.sta-about-build { margin-top: 16px !important; padding-top: 12px; border-top: 1px solid #e5e7eb; color: #64748b; font-size: 12px; font-family: ui-monospace, 'SF Mono', Monaco, monospace; }
.sta-about-dtech { margin-top: 18px; padding: 14px 16px; background: #f8fafc; border: 1px solid #e5e7eb; border-left: 3px solid var(--color-primary, #0b3d6e); border-radius: 8px; }
.sta-about-dtech h3 { margin: 0 0 6px; }
.sta-about-dtech p { margin: 0 0 10px; }
.sta-about-cta { display: inline-block; font-weight: 600; color: var(--color-primary, #0b3d6e); text-decoration: none; }
.sta-about-cta:hover { text-decoration: underline; }
.sta-about-cta:focus-visible { outline: 2px solid var(--color-focus, #2563eb); outline-offset: 2px; border-radius: 3px; }

/* Quick-action cards -- navigational/transactional intents, rendered above the answer */
.quick-actions { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.quick-action { display: flex; flex-direction: column; }
.quick-action-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--color-primary, #0b3d6e); color: #fff; border-radius: 10px; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,0.12); transition: filter .12s; }
.quick-action-card:hover { filter: brightness(1.08); }
.quick-action-card:focus-visible { outline: 3px solid var(--color-focus, #2563eb); outline-offset: 2px; }
.qa-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.qa-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.qa-title { font-weight: 600; font-size: 15px; }
.qa-sub { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.qa-go { font-size: 18px; flex: 0 0 auto; opacity: .9; }
.quick-action-sub { align-self: flex-start; margin-top: 4px; margin-left: 2px; font-size: 12.5px; color: var(--color-primary, #0b3d6e); text-decoration: none; font-weight: 600; }
.quick-action-sub:hover { text-decoration: underline; }
