/* =============================================
   Westminster Brief — Main Stylesheet
   ============================================= */

/* --- BASE --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    color: #2d3748;
}

/* --- BETA ENVIRONMENT BANNER --- */
.beta-env-banner {
    background: #f59e0b;
    color: #fff;
    text-align: center;
    padding: 7px 20px;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}
.beta-env-banner strong { font-weight: 700; margin-right: 4px; }

/* --- NAVIGATION --- */
.navbar {
    background: #0d1117;
    padding: 0 30px;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 36px;
    display: flex;
    gap: 2px;
    align-items: stretch;
    height: 58px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar a {
    text-decoration: none;
    color: rgba(255,255,255,0.65);
    font-weight: 500;
    font-size: 13px;
    padding: 0 14px;
    border-radius: 0;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.navbar a:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
    border-bottom-color: #b8962e;
}

.navbar a.nav-active {
    color: #fff;
    font-weight: 700;
    border-bottom-color: #b8962e;
    background: rgba(255,255,255,0.06);
}

.nav-divider {
    width: 1px;
    background: rgba(255,255,255,0.2);
    margin: 10px 10px;
    align-self: stretch;
    pointer-events: none;
    flex-shrink: 0;
}

.nav-beta {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #4a7fa5;
    background: #e8edf4;
    border-radius: 3px;
    padding: 1px 5px;
    vertical-align: middle;
    margin-left: 4px;
    position: relative;
    top: -1px;
    pointer-events: none;
}

/* Canonical BETA badge — used inline with page headings and card titles */
.badge-beta {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #4a7fa5;
    background: #e8edf4;
    border-radius: 3px;
    padding: 1px 6px;
    vertical-align: middle;
    margin-left: 6px;
    position: relative;
    top: -1px;
}

.navbar .brand {
    font-size: 17px;
    font-weight: 800;
    margin-right: 12px;
    color: #fff;
    letter-spacing: -0.5px;
    border-bottom: none !important;
    background: none !important;
    padding-left: 0;
    gap: 8px;
}

.navbar .nav-auth-login {
    border: 1.5px solid #1a4a6e;
    border-radius: 6px;
    margin: auto 0;
    padding: 6px 14px !important;
    height: auto;
    align-self: center;
}

.navbar .nav-auth-alerts {
    background: #6f42c1 !important;
    color: white !important;
    border-radius: 6px;
    margin: auto 4px;
    padding: 6px 14px !important;
    height: auto;
    align-self: center;
    border-bottom: none !important;
}

.navbar .nav-auth-alerts:hover {
    background: #5a32a3 !important;
    color: white !important;
}

.navbar .nav-logout {
    color: #d9534f !important;
}

.navbar .nav-login {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    padding: 6px 14px !important;
    align-self: center;
    height: auto;
    font-weight: 600 !important;
    color: rgba(255,255,255,0.85) !important;
}

.navbar .nav-login:hover {
    background: rgba(255,255,255,0.18) !important;
    border-bottom-color: transparent !important;
}

.navbar .nav-register {
    font-weight: 500 !important;
    color: rgba(255,255,255,0.65) !important;
}

.nav-version {
    margin-left: auto;
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    font-family: monospace;
    padding: 2px 6px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    white-space: nowrap;
}

.badge-ai {
    background: #e8edf4;
    color: #4a7fa5;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    text-transform: uppercase;
    font-weight: 700;
}

/* --- LAYOUT --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

.box {
    background: #ffffff;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(26,35,50,0.07);
    margin-bottom: 20px;
    border: 1px solid #e0e6ed;
}

/* Article content — used for long-form editorial pages (e.g. History of Hansard) */
.article-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 6px;
    line-height: 1.25;
}

.article-content .article-byline {
    color: #8a96a4;
    font-size: 13px;
    margin-bottom: 28px;
}

.article-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a2332;
    margin: 32px 0 12px;
}

.article-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
}

.article-content ul {
    margin: 12px 0 16px 24px;
    line-height: 1.8;
}

.article-content .article-sources {
    font-size: 13px;
    color: #5a6878;
    line-height: 2;
    margin: 0 0 0 20px;
}

.article-content hr {
    border: none;
    border-top: 1px solid #e0e6ed;
    margin: 36px 0 28px;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 { color: #1a2332; margin-top: 0; font-weight: 700; letter-spacing: -0.2px; }
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }

/* --- FORMS --- */
p.form-hint {
    margin: -10px 0 10px;
    font-size: 14px;
    color: #5a6878;
}

label.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #4a5568;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    margin-bottom: 15px;
    padding: 11px 14px;
    border: 1.5px solid #d1d9e0;
    border-radius: 6px;
    width: 100%;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
    color: #1a2332;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #5b9bd5;
    box-shadow: 0 0 0 3px rgba(91,155,213,0.15);
}

/* ── Select2 light theme ── */
.select2-container--default .select2-selection--single {
    background: #ffffff !important;
    border: 1.5px solid #d1d9e0 !important;
    border-radius: 6px !important;
    height: 40px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1a2332;
    line-height: 28px !important;
    padding-left: 10px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #8a96a4;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #8a96a4 transparent transparent transparent;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #8a96a4 transparent;
}
.select2-dropdown {
    background: #ffffff !important;
    border: 1.5px solid #d1d9e0 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(26,35,50,0.1);
}
.select2-container--default .select2-results__option {
    color: #2d3748;
    padding: 8px 12px;
    font-size: 14px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #1a4a6e;
    color: #fff;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background: #f0f2f5;
    color: #5a6878;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    background: #f7f9fc;
    border: 1.5px solid #d1d9e0;
    color: #1a2332;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: #4a7fa5;
}
.select2-search--dropdown { padding: 8px; }

.form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 5px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row > .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Zero out bottom margin on inputs/selects inside a form-row so flex-end aligns correctly */
.form-row input,
.form-row select,
.form-row textarea {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 15px;
}

/* --- BUTTONS --- */
.btn {
    padding: 11px 22px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.18s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary,
.btn-success,
.btn-purple  { background: #1a4a6e; color: #fff; border: 1px solid rgba(91,155,213,0.35); }
.btn-muted,
.btn-secondary { background: #e8edf4; color: #4a5568; border: 1px solid #d1d9e0; }
.btn-dark    { background: #1a2332; color: #fff; border: 1px solid #1a2332; }
.btn-full    { width: 100%; }

/* Legacy alias — same style as btn-primary */
.btn-search { background: #1a4a6e; color: white; padding: 13px 20px; border: 1px solid rgba(91,155,213,0.35); border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: 600; transition: all 0.2s; }
.btn-search:hover { filter: brightness(1.15); transform: translateY(-1px); }

/* --- RESULTS / CARDS --- */
.result-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(26,35,50,0.05);
    border: 1px solid #e0e6ed;
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.result-card:hover { border-color: #c0ccd8; box-shadow: 0 3px 12px rgba(26,35,50,0.09); }

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid #f0f2f5;
    padding: 14px 18px 10px;
}

.result-card-dept {
    font-weight: 700;
    color: #1a4a6e;
    font-size: 15px;
}

.result-card-date {
    color: #8a96a4;
    font-size: 13px;
}

.result-card-body { padding: 14px 18px 16px; }

.result-card-quote {
    font-style: italic;
    color: #5a6878;
    background: #f7f9fc;
    padding: 12px 15px;
    border-left: 3px solid #4a7fa5;
    border-radius: 0 4px 4px 0;
    margin: 10px 0;
    line-height: 1.6;
    font-size: 14.5px;
}

.result-card-link {
    display: inline-block;
    margin-top: 10px;
    color: #4a7fa5;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.result-card-link:hover { text-decoration: underline; }

/* --- PAGE DESCRIPTION (purpose/usage line below page heading) --- */
.page-desc {
    color: #5a6878;
    font-size: 14px;
    line-height: 1.6;
    margin: 6px 0 18px;
}

.wq-freshness {
    display: inline-block;
    font-size: 12px;
    color: #7a8a9a;
    margin-left: 10px;
    border-left: 1px solid #d0dce8;
    padding-left: 10px;
}

/* --- INFO BOX (tip/hint panels) --- */
.info-box {
    background: #eef5fb;
    border-left: 4px solid #4a7fa5;
    padding: 15px 18px;
    margin-bottom: 20px;
    border-radius: 0 6px 6px 0;
    color: #2d3748;
    font-size: 14.5px;
    line-height: 1.6;
}

/* --- FLASH MESSAGES --- */
.flash-messages { list-style: none; padding: 0; margin: 0 0 20px 0; }

.flash-error {
    background: #fdf0f0;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #fca5a5;
    margin-bottom: 8px;
}

.flash-success {
    background: #f0faf3;
    color: #166534;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #86efac;
    margin-bottom: 8px;
}

/* --- HOME PAGE TOOL GRID --- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 10px;
}

.tool-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dce8f5;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    box-shadow: 0 12px 32px rgba(28,62,110,0.18);
    transform: translateY(-3px);
    border-color: #b8962e;
}

.tool-card-header {
    background: #1a4a6e;
    padding: 18px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid rgba(184,150,46,0.4);
}

.tool-card-icon {
    font-size: 26px;
    line-height: 1;
    color: #1a4a6e;
}
.tool-card-icon svg { display: block; }

.tool-card-title {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.tool-card-badge {
    background: rgba(255,255,255,0.25);
    color: white;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
    flex-shrink: 0;
}

.tool-card-body {
    padding: 16px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-card-desc {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 16px;
}

.tool-card-link {
    display: block;
    background: #1a4a6e;
    color: white;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.18s;
    letter-spacing: 0.01em;
}

.tool-card-link:hover {
    background: #155278;
    box-shadow: 0 4px 14px rgba(26,74,110,0.25);
    transform: translateY(-1px);
}

.tool-card-link.disabled {
    background: #adb5bd;
    cursor: not-allowed;
    pointer-events: none;
}

/* Hero section on home */
.home-hero {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(255,255,255,0.03) 39px,
            rgba(255,255,255,0.03) 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 79px,
            rgba(255,255,255,0.025) 79px,
            rgba(255,255,255,0.025) 80px
        ),
        linear-gradient(135deg, #0e2240 0%, #1a3560 45%, #1a4a6e 75%, #1e4a82 100%);
    border-radius: 14px;
    padding: 36px 40px;
    margin-bottom: 28px;
    color: white;
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #b8962e 0%, #d4af4a 50%, #b8962e 100%);
}

.home-hero-icon { font-size: 52px; line-height: 1; flex-shrink: 0; }

.home-hero-title {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: white;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.home-hero-subtitle {
    font-size: 15px;
    color: #5a6878;
    margin: 0;
    line-height: 1.6;
    font-weight: 400;
}

/* --- FOOTER --- */
.footer {
    text-align: center;
    padding: 28px 20px;
    margin-top: 48px;
    font-size: 12.5px;
    color: #8a96a4;
    border-top: 1px solid #e0e6ed;
    letter-spacing: 0.01em;
}

.footer a { color: #5a6878; text-decoration: none; }
.footer a:hover { color: #1a2332; text-decoration: underline; }

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-state p { font-size: 16px; margin: 0; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; gap: 0; overflow-x: auto; }
    .navbar a { font-size: 12px; padding: 0 9px; }
    .navbar .brand { font-size: 15px; }
    .container { padding: 0 14px; }
    .box { padding: 20px 16px; }
    .tool-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
}

/* --- DEBATE SCANNER TABS --- */
.scanner-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e6ed;
    margin-bottom: 28px;
    overflow-x: auto;
}

.scanner-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 500;
    color: #8a96a4;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.scanner-tab:hover { color: #2d3748; }

.scanner-tab.active {
    color: #1a2332;
    border-bottom-color: #1a4a6e;
    font-weight: 600;
}

.scanner-tab .badge-ai {
    display: inline-block;
    background: #e8edf4;
    color: #4a7fa5;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.scanner-tab .badge-beta {
    margin-left: 4px;
    top: 0;
}

.scanner-panel { display: none; }
.scanner-panel.active { display: block; }

/* --- TOPIC SEARCH RESULT CARDS --- */
.topic-result-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.topic-source-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #777;
}

.topic-source-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    color: #fff;
}

.topic-source-commons { background: #1a56db; }
.topic-source-westminsterhall { background: #b45309; }
.topic-source-lords { background: #6d28d9; }
.topic-source-wrans { background: #047857; }
.topic-source-wms { background: #7c3aed; }
.topic-source-urgent { background: #b91c1c; }

.topic-party-badge {
    display: inline-block;
    background: #f0f0f0;
    color: #444;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

.topic-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #222;
    margin-bottom: 4px;
}

.topic-card-body {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* --- TOPIC BRIEFING PANEL --- */
.topic-briefing-summary {
    background: #f8f4ff;
    border-left: 4px solid #4a154b;
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.topic-briefing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.topic-briefing-section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 14px 16px;
}

.topic-briefing-section h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4a154b;
    margin: 0 0 8px 0;
}

.topic-briefing-section p {
    font-size: 13px;
    color: #444;
    line-height: 1.55;
    margin: 0;
}

.topic-speakers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-speakers-list li {
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    line-height: 1.45;
}

.topic-speakers-list li:last-child { border-bottom: none; }

.topic-quote-attr {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

.topic-coverage-note {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

@media (max-width: 768px) {
    .scanner-tabs { gap: 0; }
    .topic-briefing-grid { grid-template-columns: 1fr; }
}

/* --- RESEARCH TOOL COLLAPSIBLE SECTIONS --- */
.classification-note {
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafd;
}
.classification-note > summary {
    padding: 7px 12px;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.classification-note > summary::-webkit-details-marker { display: none; }
.classification-note[open] > summary { border-bottom: 1px solid #e2e8f0; }
.classification-note-body {
    padding: 10px 14px;
    font-size: 11px;
    color: #555;
    line-height: 1.7;
}

.research-sections {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.research-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.research-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    background: #f8fafd;
    border-bottom: 1px solid #eef0f4;
    list-style: none;
    user-select: none;
}
.research-section-header::-webkit-details-marker { display: none; }
.research-section-header::before {
    content: "▶";
    font-size: 11px;
    color: #888;
    transition: transform 0.2s;
    flex-shrink: 0;
}
details[open] > .research-section-header::before { transform: rotate(90deg); }

.research-section-title {
    font-weight: 700;
    font-size: 15px;
    color: #1a4a6e;
    flex: 1;
}

.research-section-count {
    background: #1a4a6e;
    color: #fff;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.research-section-dl {
    background: #005a8f;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.research-section-dl:hover { background: #004a77; }

.research-section-body { padding: 10px 14px; }

.research-load-more {
    font-size: 13px;
    color: #555;
    padding: 10px 0;
    border-top: 1px solid #eee;
    margin-top: 12px;
}
.research-load-more a { color: #005a8f; font-weight: 600; text-decoration: none; }
.research-load-more a:hover { text-decoration: underline; }

/* Compact overrides for cards inside research sections */
.research-section-body .result-card { margin-bottom: 6px; }
.research-section-body .result-card-header { padding: 7px 12px 6px; gap: 5px; }
.research-section-body .result-card-dept { font-size: 13px; }
.research-section-body .result-card-date { font-size: 11px; }
.research-section-body .result-card-body { padding: 6px 12px 8px; }
.research-section-body .result-card-quote { font-size: 12px; padding: 6px 10px; margin: 5px 0; line-height: 1.5; }
.research-section-body .wq-heading { font-size: 11px; padding: 2px 12px 0; }
.research-section-body .wq-party-label { font-size: 11px; }
.research-section-body .wq-answer-details { margin: 6px 0 4px; padding-top: 6px; }
.research-section-body .wq-answer-text { font-size: 12px; padding: 6px 10px; line-height: 1.45; margin-top: 6px; }
.research-section-body .wq-answer-summary { font-size: 11px; }
.research-section-body .result-card-body p { font-size: 12px; margin-bottom: 3px; }
.research-section-body .result-card-link { font-size: 11px; margin-top: 4px; }

/* Debate group card */
.debate-group {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}
.debate-group-minister {
    border-left: 3px solid #166534;
}

.debate-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #f8fafd;
    border-bottom: 1px solid #eef0f4;
    flex-wrap: wrap;
}
.debate-group-date {
    font-size: 12px;
    color: #777;
    white-space: nowrap;
}
.debate-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a4a6e;
    text-decoration: none;
    flex: 1;
}
.debate-group-title:hover { text-decoration: underline; }
.debate-minister-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.debate-speeches-details { margin: 0; }
.debate-speeches-summary {
    font-size: 11px;
    color: #666;
    padding: 5px 12px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f4f6fb;
    border-bottom: 1px solid #eef0f4;
}
.debate-speeches-summary::-webkit-details-marker { display: none; }
.debate-speeches-summary::before {
    content: '▶';
    font-size: 9px;
    transition: transform 0.15s;
}
details[open] > .debate-speeches-summary::before { content: '▼'; }

.debate-speech {
    padding: 8px 12px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 12px;
}
.debate-speech:last-child { border-bottom: none; }
.debate-speech-minister {
    background: #f8fff8;
}

.debate-speech-name {
    font-weight: 700;
    color: #222;
    margin-right: 6px;
    font-size: 12px;
}
.debate-speech-role {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    margin-right: 4px;
}
.debate-speech-body {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #444;
    line-height: 1.5;
}

/* Relevance indicator dot on debate group headers */
.rel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.rel-high   { background: #16a34a; }
.rel-medium { background: #d97706; }
.rel-low    { background: #dc2626; opacity: 0.6; }

/* Relevance legend inside classification note */
.relevance-legend {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.relevance-legend strong { margin-bottom: 2px; }
.rel-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: #555;
}
.rel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.debate-speech-source {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    color: #005a8f;
    text-decoration: none;
    opacity: 0.7;
}
.debate-speech-source:hover { opacity: 1; text-decoration: underline; }

/* Speech select checkbox */
.debate-speech { display: flex; gap: 8px; align-items: flex-start; }
.speech-select-wrap { padding-top: 3px; flex-shrink: 0; }
.speech-select { width: 14px; height: 14px; cursor: pointer; accent-color: #005a8f; }
.debate-speech-content { flex: 1; min-width: 0; }

/* Floating selection bar */
#speech-selection-bar {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a4a6e;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    z-index: 200;
}
.sel-bar-btn { border: none; border-radius: 5px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.sel-bar-dl { background: #fff; color: #1a4a6e; }
.sel-bar-dl:hover { background: #e8f0fb; }
.sel-bar-clear { background: rgba(255,255,255,0.15); color: #fff; }
.sel-bar-clear:hover { background: rgba(255,255,255,0.25); }

/* --- WRITTEN QUESTIONS SCANNER ENHANCEMENTS --- */
.wq-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #fff;
    flex-shrink: 0;
}
.wq-status-answered   { background: #28a745; }
.wq-status-unanswered { background: #d9534f; }
.wq-status-holding    { background: #fd7e14; }
.wq-status-withdrawn  { background: #6c757d; }

.wq-heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    padding: 4px 18px 0;
}

.wq-party-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}

.wq-party-label { color: #555; font-size: 13px; }

.wq-answer-details {
    margin: 12px 0 8px;
    border-top: 1px solid #eef0f4;
    padding-top: 10px;
}

.wq-answer-summary {
    font-size: 13px;
    font-weight: 600;
    color: #005a8f;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.wq-answer-summary::-webkit-details-marker { display: none; }
.wq-answer-summary::before { content: "▶"; font-size: 10px; color: #005a8f; }
details[open] .wq-answer-summary::before { content: "▼"; }
.wq-minister-role { font-weight: 400; color: #5a6a7a; }

.wq-answer-text {
    font-size: 13px;
    color: #444;
    line-height: 1.65;
    background: #f4f8f0;
    border-left: 3px solid #28a745;
    padding: 12px 14px;
    border-radius: 0 4px 4px 0;
    margin-top: 10px;
}
.wq-answer-text p { margin: 0 0 0.75em; }
.wq-answer-text p:last-child { margin-bottom: 0; }
.wq-answer-text ul, .wq-answer-text ol { margin: 0.5em 0 0.75em 1.5em; padding: 0; }
.wq-answer-text li { margin-bottom: 0.25em; }
.wq-answer-text table { border-collapse: collapse; font-size: 12px; margin: 0.75em 0; width: 100%; }
.wq-answer-text th, .wq-answer-text td { border: 1px solid #c8d6b0; padding: 4px 8px; text-align: left; vertical-align: top; }
.wq-answer-text th { background: #e8f0e0; font-weight: 600; }

.wq-answered-note {
    font-size: 13px;
    color: #555;
    margin: 8px 0;
}

/* ── Stakeholder Research ───────────────────────────────── */
.stakeholder-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12.5px;
    color: #1a4a6e;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.stakeholder-pill:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.stakeholder-pill-name {
    font-weight: 600;
}
.stakeholder-pill-links {
    display: flex;
    gap: 4px;
    font-size: 13px;
}
.stakeholder-pill-links a {
    text-decoration: none;
    opacity: 0.75;
}
.stakeholder-pill-links a:hover {
    opacity: 1;
}


/* =============================================
   HOMEPAGE — light theme, archive design tokens
   ============================================= */

/* body.page-home bg is now the global default — kept here for specificity only */
body.page-home {
    background: #f0f2f5;
}

/* Hero */
.wb-hero {
    padding: 48px 0 40px;
    border-bottom: 1px solid #e0e6ed;
    margin-bottom: 36px;
}

.wb-hero-inner {
    max-width: 660px;
}

.wb-hero-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 36px;
    font-weight: 600;
    color: #1a2332;
    margin: 0 0 14px;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.wb-hero-sub {
    font-size: 17px;
    color: #5a6878;
    margin: 0 0 22px;
    line-height: 1.6;
    max-width: 560px;
}

.wb-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wb-hero-tag {
    font-size: 12px;
    font-weight: 500;
    color: #5a6878;
    background: #e8edf4;
    border-radius: 4px;
    padding: 3px 9px;
}

/* Coverage statement — full-width fact line between hero and Why panel */
.wb-coverage {
    padding: 0 0 32px;
    margin-bottom: 36px;
}

.wb-coverage-text {
    font-size: 13px;
    color: #5a6878;
    line-height: 1.6;
    margin: 0;
}

/* Why Westminster Brief section */
.wb-why {
    padding: 0 0 36px;
    border-bottom: 1px solid #e0e6ed;
    margin-bottom: 36px;
}

.wb-why-heading {
    font-size: 11px;
    font-weight: 700;
    color: #8a96a4;
    margin: 0 0 20px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wb-why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.wb-why-item {
    display: flex;
    gap: 13px;
    align-items: flex-start;
}

.wb-why-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
    color: #1a4a6e;
}
.wb-why-icon svg { display: block; }

.wb-why-title {
    font-weight: 600;
    color: #1a2332;
    font-size: 14px;
    margin-bottom: 5px;
}

.wb-why-body {
    font-size: 13px;
    color: #5a6878;
    line-height: 1.6;
}

/* Credibility line */
.wb-cred-line {
    font-size: 12px;
    color: #8a96a4;
    text-align: center;
    margin: 28px 0 0;
    padding-bottom: 8px;
    line-height: 1.5;
}

/* Tool cards — light theme */
body.page-home .tool-card {
    background: #ffffff;
    border: 1px solid #e0e6ed;
    border-top: 3px solid #1a4a6e;
    box-shadow: 0 1px 4px rgba(26,35,50,0.05);
    transition: box-shadow 0.15s, transform 0.15s, border-top-color 0.15s;
}

body.page-home .tool-card:hover {
    box-shadow: 0 4px 18px rgba(26,35,50,0.11);
    transform: translateY(-2px);
    border-top-color: #4a7fa5;
}

body.page-home .tool-card-header {
    background: #ffffff;
    border-bottom: 1px solid #f0f2f5;
}

body.page-home .tool-card-icon {
    font-size: 22px;
}

body.page-home .tool-card-title {
    color: #1a2332;
    font-size: 15px;
    font-weight: 600;
}

body.page-home .tool-card-badge {
    background: #e8edf4;
    color: #4a7fa5;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    padding: 2px 6px;
}

body.page-home .tool-card-body {
    background: #ffffff;
}

body.page-home .tool-card-desc {
    color: #5a6878;
    font-size: 13.5px;
    line-height: 1.6;
}

body.page-home .tool-card-link {
    background: #1a4a6e;
    border: none;
    color: #ffffff;
    font-size: 13px;
    padding: 9px 16px;
}

body.page-home .tool-card-link:hover {
    background: #155278;
    box-shadow: none;
    transform: none;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .wb-hero-title { font-size: 28px; }
    .wb-why-grid { grid-template-columns: 1fr; gap: 20px; }
    .wb-hero-meta { gap: 8px; }
}

/* =====================================================================
   HANSARD ARCHIVE — session detail, search, policy pages (Phase 2A W3)
   ===================================================================== */

/* --- Session detail page (light theme) --- */

/* dtype badges — used on both archive home cards and session detail header */
.archive-dtype-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    color: #fff;
    background: #374151;
}
.archive-dtype-oral_questions    { background: #1a56db; }
.archive-dtype-pmqs              { background: #b45309; }
.archive-dtype-westminster_hall  { background: #7c6d1a; }
.archive-dtype-debate            { background: #1e6645; }
.archive-dtype-ministerial_statement { background: #6d28d9; }
.archive-dtype-statutory_instrument  { background: #374151; }
.archive-dtype-committee_stage   { background: #7c3aed; }
.archive-dtype-petition          { background: #047857; }
.archive-dtype-other             { background: #6b7280; }

/* Department badge — oral questions attribution, links back to dept filter */
.archive-dept-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e8edf3;
    color: #3d5166;
    border: 1px solid #cdd6e0;
    text-decoration: none;
    letter-spacing: 0.2px;
}
a.archive-dept-badge:hover { background: #d6dfe8; color: #1a3350; }

/* OQ / PMQs grouped view */
.ah-group {
    margin-bottom: 20px;
}
.ah-group-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 14px;
    background: #e8edf3;
    border-left: 3px solid #3d7ab5;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}
.ah-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a3350;
    flex: 1;
}
.ah-group-count {
    font-size: 11px;
    color: #5a7a99;
    white-space: nowrap;
}
.ah-group-sessions {
    border: 1px solid #dce3eb;
    border-top: none;
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}
.ah-card-in-group {
    border: none;
    border-bottom: 1px solid #eef1f5;
    border-radius: 0;
    padding: 10px 14px;
    box-shadow: none;
    background: #fff;
}
.ah-card-in-group:last-child {
    border-bottom: none;
}
.ah-card-in-group:hover {
    background: #f7f9fb;
}

/* Theme tags — used on both archive home and session detail */
.archive-tag {
    display: inline-block;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 10px;
    text-decoration: none;
    letter-spacing: 0.2px;
}
.archive-tag-policy {
    background: #e8f0f8;
    color: #2a5a8a;
    border: 1px solid #c8dcea;
}
.archive-tag-policy:hover { background: #d4e5f5; text-decoration: underline; }
.archive-tag-topic {
    background: #f0f4f0;
    color: #3a6040;
    border: 1px solid #c8dcc8;
}
.archive-tag-topic:hover { background: #e4ece4; text-decoration: underline; }
.sd-theme-label {
    font-size: 11px;
    color: #6b7a8d;
    font-weight: 600;
    margin-right: 4px;
    letter-spacing: 0.2px;
}

/* Page wrapper — sets light background for this page only */
.sd-page {
    background: #f0f2f5;
    margin: -36px -30px 0;   /* bleed to container edges */
    color-scheme: light;
    padding: 0 0 48px;
}

/* Session header — white card, sticky below navbar */
.sd-header {
    background: #fff;
    border-bottom: 1px solid #e0e6ed;
    padding: 24px 30px 20px;
    margin-bottom: 0;
    position: sticky;
    top: 58px;   /* navbar height */
    z-index: 90;
}

.sd-breadcrumb {
    font-size: 12px;
    color: #8a96a4;
    margin-bottom: 14px;
}
.sd-breadcrumb a { color: #4a7fa5; text-decoration: none; }
.sd-breadcrumb a:hover { text-decoration: underline; }
.sd-breadcrumb-sep { margin: 0 6px; color: #c0c8d4; }

.sd-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 24px;
    font-weight: 600;
    color: #1a2332;
    line-height: 1.3;
    margin: 0 0 12px;
    max-width: 720px;
}

.sd-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.sd-date { font-size: 13px; color: #5a6878; }
.sd-hansard-link {
    font-size: 12px;
    color: #4a7fa5;
    text-decoration: none;
    margin-left: auto;
}
.sd-hansard-link:hover { text-decoration: underline; }

.sd-theme-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.sd-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sd-contrib-count { font-size: 12px; color: #8a96a4; }

.btn-export {
    display: inline-block;
    padding: 7px 14px;
    background: #1a4a6e;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}
.btn-export:hover { background: #1e5580; }

/* Bill-grouped committee stage accordion */
.ah-bill-group {
    background: #fff;
    border: 1px solid #d8e4ed;
    border-radius: 6px;
    margin-bottom: 6px;
    overflow: hidden;
}
.ah-bill-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ah-bill-group-header::-webkit-details-marker { display: none; }
.ah-bill-group-header::before {
    content: '▶';
    font-size: 10px;
    color: #7a8a9a;
    transition: transform 0.15s;
    flex-shrink: 0;
}
details[open] > .ah-bill-group-header::before { transform: rotate(90deg); }
.ah-bill-group-header:hover { background: #f4f8fc; }
.ah-bill-group-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1a2332;
}
.ah-bill-group-count {
    font-size: 12px;
    color: #8a96a4;
    white-space: nowrap;
}
.ah-bill-group-sessions {
    border-top: 1px solid #e8f0f7;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ah-bill-stage-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.12s;
}
.ah-bill-stage-item:hover { background: #f0f6fb; }
.ah-bill-stage-date {
    font-size: 12px;
    font-weight: 600;
    color: #1a2332;
    min-width: 105px;
}
.ah-bill-stage-dtype {
    font-size: 12px;
    color: #5a6878;
    flex: 1;
}
.ah-bill-stage-contribs {
    font-size: 11px;
    color: #8a96a4;
    white-space: nowrap;
}

/* Related sessions panel */
.sd-related {
    background: #eef3f8;
    border-bottom: 1px solid #d8e4ed;
    padding: 12px 30px;
}
.sd-related-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 900px;
}
.sd-related-label {
    font-size: 11px;
    font-weight: 600;
    color: #7a8a9a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-basis: 100%;
    margin-bottom: 2px;
}
.sd-related-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #d0dce8;
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.sd-related-item:hover {
    border-color: #4a7fa5;
    background: #f4f8fc;
}
.sd-related-date {
    font-size: 12px;
    font-weight: 600;
    color: #1a2332;
}
.sd-related-dtype {
    font-size: 12px;
    color: #5a6878;
}
.sd-related-contribs {
    font-size: 11px;
    color: #8a96a4;
    border-left: 1px solid #dce6ef;
    padding-left: 7px;
}
.sd-related-overflow {
    font-size: 11px;
    color: #8a96a4;
    font-style: italic;
    white-space: nowrap;
    margin-left: 4px;
}
.sd-related-note {
    font-size: 11px;
    color: #8a96a4;
    margin: 6px 4px 0;
    line-height: 1.4;
}
.sd-related-note a { color: #4a7fa5; text-decoration: none; }
.sd-related-note a:hover { text-decoration: underline; }

/* Transcript — constrained column */
.sd-transcript {
    max-width: 720px;
    padding: 4px 30px 0;
}

.sd-contrib {
    padding: 20px 0 18px;
    border-bottom: 1px solid #e8edf2;
    position: relative;
}
.sd-contrib:last-child { border-bottom: none; }

/* Permalink — appears on hover */
.sd-contrib-permalink {
    position: absolute;
    right: 0;
    top: 22px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #b0bac6;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.sd-contrib:hover .sd-contrib-permalink { opacity: 1; }
.sd-contrib-permalink:hover { color: #4a7fa5; }

/* Speaker row */
.sd-contrib-speaker {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 10px;
    padding-left: 12px;
    border-left: 3px solid #1a4a6e; /* overridden per-contrib via inline style */
}
.sd-speaker-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a2332;
    text-decoration: none;
    margin-right: 7px;
    font-family: 'Inter', sans-serif;
}
.sd-speaker-name:hover { color: #1a4a6e; text-decoration: underline; }
.sd-speaker-secondary {
    font-size: 13px;
    color: #6a7888;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}

/* Speech text — serif for document reading */
.sd-contrib-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 15px;
    line-height: 1.8;
    color: #2d3748;
    padding-left: 15px;
    white-space: pre-line;
}
.sd-contrib-text p { margin: 0 0 1em; white-space: normal; }
.sd-contrib-text p:last-child { margin-bottom: 0; }
.sd-contrib-text ul, .sd-contrib-text ol { margin: 0.5em 0 1em 1.75em; padding: 0; white-space: normal; }
.sd-contrib-text li { margin-bottom: 0.3em; }
.sd-contrib-text table { border-collapse: collapse; font-size: 14px; margin: 1em 0; width: 100%; white-space: normal; }
.sd-contrib-text th, .sd-contrib-text td { border: 1px solid #c8d0dc; padding: 6px 10px; text-align: left; vertical-align: top; }
.sd-contrib-text th { background: #e8ecf2; font-weight: 600; }

/* Day navigation — prev/next session within the same day */
.sd-day-nav {
    display: flex;
    gap: 12px;
    max-width: 720px;
    padding: 20px 30px 0;
    margin-bottom: 8px;
}
.sd-day-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
    min-width: 0;
}
.sd-day-nav-item:hover {
    border-color: #4a7fa5;
    background: #f4f8fc;
}
.sd-day-nav-empty {
    pointer-events: none;
    background: transparent;
    border-color: transparent;
}
.sd-day-nav-prev { text-align: left; }
.sd-day-nav-next { text-align: right; }
.sd-day-nav-dir {
    font-size: 11px;
    font-weight: 600;
    color: #4a7fa5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sd-day-nav-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a2332;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-day-nav-dtype {
    font-size: 11px;
    color: #8a96a4;
}

/* Source note */
.sd-source-note {
    max-width: 720px;
    font-size: 12px;
    color: #9aa4b0;
    margin: 24px 30px 0;
    padding-top: 14px;
    border-top: 1px solid #e0e6ed;
}
.sd-source-note a { color: #6a96b8; text-decoration: none; }
.sd-source-note a:hover { text-decoration: underline; }

/* ---- Archive Home: search + results (light theme) ---- */

/* Page wrapper — same bleed pattern as .sd-page */
.ah-page {
    background: #f0f2f5;
    margin: -36px -30px 0;
    padding-bottom: 60px;
    min-height: 100vh;
    color-scheme: light;
}

/* Reset global dark form styles for archive page inputs/selects */
.ah-page input[type="text"],
.ah-page input[type="date"],
.ah-page select {
    background: #fff;
    color: #1a2332;
    border: 1px solid #d0d8e4;
    width: auto;
    margin-bottom: 0;
    color-scheme: light;
    box-shadow: none;
}
.ah-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Page header */
.ah-header { padding: 28px 0 20px; }
.ah-title {
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
}
.ah-desc { font-size: 13px; color: #8a96a4; margin: 0; }
.ah-currency { font-size: 12px; color: #8a96a4; margin: 5px 0 0; }

/* Recently added feed */
.ah-recent {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    background: #f0f6ff;
    border: 1px solid #d0e0f0;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 14px;
    font-size: 12px;
}
.ah-recent-label {
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: #1a4a6e;
    text-transform: uppercase;
    white-space: nowrap;
}
.ah-recent-count { color: #2d3748; }
.ah-recent-browse { color: #1a4a6e; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ah-recent-browse:hover { text-decoration: underline; }
.ah-recent-updated { color: #8a96a4; margin-left: auto; white-space: nowrap; }


/* Search form — white card */
.ah-form {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.ah-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.ah-search-input {
    flex: 1;
    padding: 9px 13px;
    background: #f7f9fb;
    border: 1px solid #d0d8e4;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #1a2332;
    min-width: 0;
}
.ah-search-input::placeholder { color: #aab4c0; }
.ah-search-input:focus { outline: none; border-color: #4a7fa5; background: #fff; }
.ah-search-btn {
    padding: 9px 20px;
    background: #1a4a6e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.ah-search-btn:hover { background: #1e5580; }
.ah-clear-link {
    font-size: 13px;
    color: #8a96a4;
    text-decoration: none;
    white-space: nowrap;
}
.ah-clear-link:hover { color: #4a7fa5; text-decoration: underline; }
.ah-visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Filter row */
.ah-filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.ah-filter-select {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #d0d8e4;
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #2d3748;
    cursor: pointer;
    width: auto;
    margin-bottom: 0;
}
.ah-filter-select-wide { min-width: 200px; }
.ah-filter-select:focus { outline: none; border-color: #4a7fa5; }
/* Override global input[type="date"] width:100% / margin-bottom:15px inside filter rows */
.ah-filter-row input[type="date"] {
    width: 140px;
    margin-bottom: 0;
    padding: 6px 10px;
    font-size: 13px;
}
.ah-filter-date {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #d0d8e4;
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #2d3748;
    width: 140px;
}
.ah-filter-date:focus { outline: none; border-color: #4a7fa5; }
.ah-filter-label {
    font-size: 12px;
    color: #8a96a4;
    white-space: nowrap;
}
.ah-title-only-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #5a6878;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 4px;
}
.ah-title-only-label input { cursor: pointer; }

/* Results bar */
.ah-results-bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 2px;
}
.ah-results-count { font-size: 13px; color: #5a6878; }
.ah-results-count strong { color: #1a2332; }
.ah-results-range { font-size: 12px; color: #9aa4b0; }

/* Result cards */
.ah-results-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}
.ah-card {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    padding: 12px 16px 11px;
    transition: border-color 0.15s, background 0.15s;
}
.ah-card:hover { border-color: #4a7fa5; background: #f7fafe; }
.ah-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}
.ah-card-date { font-size: 12px; color: #5a6878; }
.ah-card-contribs { font-size: 12px; color: #9aa4b0; margin-left: auto; }
.ah-card-title {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1a2332;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 8px;
}
.ah-card-title:hover { color: #1a4a6e; text-decoration: underline; }
.ah-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.ah-empty { padding: 24px 0; }

/* Pagination */
.ah-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}
.ah-page-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #4a7fa5;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.ah-page-btn:hover { border-color: #4a7fa5; background: #f4f8fc; }
.ah-page-disabled { color: #c0c8d4; cursor: default; pointer-events: none; }
.ah-page-info { font-size: 13px; color: #8a96a4; margin: 0 4px; }

/* Source note */
.ah-source-note {
    font-size: 12px;
    color: #9aa4b0;
    margin: 20px 0 0;
    padding-top: 14px;
    border-top: 1px solid #e0e6ed;
}
.ah-source-note a { color: #6a96b8; text-decoration: none; }
.ah-source-note a:hover { text-decoration: underline; }

/* --- ARCHIVE COLLECTION / MP / SEARCH PAGES --- */

/* Page wrapper — matches .ah-page / .sd-page bleed pattern */
.ac-page {
    background: #f0f2f5;
    min-height: 70vh;
    padding: 0 0 40px;
}
.ac-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Breadcrumb */
.ac-breadcrumb {
    padding: 16px 0 8px;
    font-size: 12px;
    color: #8a96a4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}
.ac-breadcrumb a { color: #4a7fa5; text-decoration: none; }
.ac-breadcrumb a:hover { text-decoration: underline; }
.ac-breadcrumb-sep { margin: 0 6px; color: #c0c8d4; }

/* Page header */
.ac-header { padding: 8px 0 16px; }
.ac-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 6px;
    line-height: 1.25;
}
.ac-desc { font-size: 13px; color: #8a96a4; margin: 0; }
.ac-tag-large {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 11px;
}
.ac-empty { padding: 24px 0; }

/* MP page — contribution excerpts */
.amp-card { flex-direction: column; align-items: flex-start; }
.amp-excerpts { margin-top: 8px; width: 100%; }
.amp-excerpt {
    font-size: 12px;
    color: #5a6878;
    line-height: 1.5;
    padding: 6px 10px;
    background: #f8fafb;
    border-left: 3px solid #d0dae5;
    margin-bottom: 4px;
}
.amp-excerpt:last-of-type { margin-bottom: 0; }
.amp-more-contribs {
    font-size: 11px;
    color: #9aa4b0;
    margin-top: 4px;
    font-style: italic;
}

/* MP analytics panel */
.amp-analytics {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.amp-analytics-thin {
    background: #f8fafb;
    border-color: #e8edf2;
    padding: 10px 14px;
}
.amp-analytics-thin-note {
    font-size: 12px;
    color: #8a96a4;
    margin: 0;
}

/* Activity stats row */
.amp-stats-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.amp-stat {
    display: flex;
    flex-direction: column;
    min-width: 90px;
}
.amp-stat-wide { min-width: 200px; }
.amp-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.1;
}
.amp-stat-label {
    font-size: 11px;
    color: #8a96a4;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.amp-stat-sub {
    font-size: 11px;
    color: #4a7fa5;
    margin-top: 3px;
    font-weight: 500;
}
.amp-stat-focus {
    font-size: 13px;
    color: #2d3e50;
    margin-top: 4px;
    font-weight: 500;
}

/* Analytics sections */
.amp-section { margin-bottom: 14px; }
.amp-section:last-of-type { margin-bottom: 0; }
.amp-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #8a96a4;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}

/* Policy area distribution bars */
.amp-pa-list { display: flex; flex-direction: column; gap: 5px; }
.amp-pa-row {
    display: grid;
    grid-template-columns: 220px 1fr 36px auto;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.amp-pa-name { color: #2d3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amp-pa-track {
    background: #eef1f5;
    border-radius: 3px;
    height: 8px;
    overflow: hidden;
}
.amp-pa-bar {
    background: #4a7fa5;
    height: 100%;
    border-radius: 3px;
    min-width: 4px;
    transition: width 0.2s;
}
.amp-pa-count { color: #5a6878; text-align: right; font-weight: 500; }
.amp-pa-rank {
    font-size: 11px;
    color: #2e7d5a;
    font-weight: 600;
    white-space: nowrap;
    background: #edf7f2;
    padding: 1px 6px;
    border-radius: 3px;
}

/* Recent shifts */
.amp-section-shifts { margin-top: 10px; }
.amp-shifts { display: flex; flex-wrap: wrap; gap: 6px; }
.amp-shift-tag {
    font-size: 11px;
    background: #f0f5fa;
    color: #3a6d93;
    border: 1px solid #ccd9e6;
    border-radius: 3px;
    padding: 2px 8px;
}

/* Analytics footnote */
.amp-analytics-note {
    font-size: 11px;
    color: #9aa4b0;
    margin: 12px 0 0;
    line-height: 1.5;
    border-top: 1px solid #eef1f5;
    padding-top: 10px;
}

/* Search page */
.as-form { margin-bottom: 12px; }
.as-hint { font-size: 12px; color: #9aa4b0; margin: 6px 0 0; }
.as-card { flex-direction: column; align-items: flex-start; }
.as-snippet {
    font-size: 12px;
    color: #5a6878;
    line-height: 1.55;
    margin-top: 6px;
    padding: 6px 10px;
    background: #f8fafb;
    border-left: 3px solid #d0dae5;
}
/* Highlight for FTS match terms */
.as-snippet mark {
    background: #fff3b0;
    color: #1a2332;
    padding: 0 2px;
    border-radius: 2px;
    font-style: normal;
    font-weight: 600;
}

/* Search results tabs */
.as-tabs {
    display: flex;
    gap: 4px;
    margin: 18px 0 0;
    border-bottom: 2px solid #e0e6ed;
    padding-bottom: 0;
}
.as-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6a7788;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color .15s;
}
.as-tab:hover { color: #2a3a4a; }
.as-tab-active {
    color: #1a2332;
    border-bottom-color: #2563eb;
}
.as-tab-count {
    background: #e8eef5;
    color: #4a5a6a;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}
.as-tab-active .as-tab-count {
    background: #dbeafe;
    color: #1d4ed8;
}
.as-auto-switch-notice {
    font-size: 13px;
    color: #6b7280;
    margin: 10px 0 4px;
    padding: 7px 12px;
    background: #f8f9fb;
    border-radius: 4px;
    border-left: 3px solid #d1d5db;
}
.as-auto-switch-notice a {
    color: #4b5563;
    text-decoration: underline;
}

/* --- FEEDBACK FORM --- */
.feedback-success {
    background: #f0faf3;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 18px 22px;
    color: #166534;
    font-size: 14px;
    line-height: 1.5;
}
.fb-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.fb-field label { font-size: 13px; font-weight: 600; color: #4a5568; }
.fb-required { color: #b91c1c; }
.fb-optional { font-weight: 400; color: #8a96a4; }
.fb-select, .fb-input, .fb-textarea {
    background: #ffffff;
    border: 1.5px solid #d1d9e0;
    border-radius: 6px;
    color: #1a2332;
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.fb-select:focus, .fb-input:focus, .fb-textarea:focus {
    outline: none;
    border-color: #4a7fa5;
}
.fb-textarea { resize: vertical; min-height: 120px; }
.fb-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.fb-submit {
    background: #1a6496;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.fb-submit:hover { background: #155278; }
.fb-direct {
    margin-top: 20px;
    font-size: 13px;
    color: #8a96a4;
}
.fb-direct a { color: #6a96b8; text-decoration: none; }
.fb-direct a:hover { text-decoration: underline; }
@media (max-width: 560px) {
    .fb-field-row { grid-template-columns: 1fr; }
}
