* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --bg-ink: #08111f;
    --bg-deep: #0d1b2e;
    --panel: rgba(10, 21, 37, 0.78);
    --panel-strong: rgba(11, 25, 42, 0.92);
    --line: rgba(151, 177, 210, 0.22);
    --text-main: #ecf4ff;
    --text-muted: #99adc9;
    --accent: #8ff0c7;
    --accent-strong: #38c49a;
    --accent-warm: #f4b860;
    --shadow: 0 22px 80px rgba(1, 8, 18, 0.38);
}

body {
    font-family: "SF Pro Display", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(56, 196, 154, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(244, 184, 96, 0.16), transparent 24%),
        linear-gradient(140deg, #06101c 0%, #0a1422 48%, #101b2c 100%);
    min-height: 100vh;
    color: var(--text-main);
}

.page-shell {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 28px 20px 56px;
}

.bg-orb {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.34;
    pointer-events: none;
}

.bg-orb-left {
    top: -140px;
    left: -120px;
    background: #178f76;
}

.bg-orb-right {
    top: 80px;
    right: -120px;
    background: #84551e;
}

.container {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
}

.hero,
.search-section,
.status-section,
.result-section,
.architecture-band {
    position: relative;
    z-index: 1;
}

.hero {
    margin-bottom: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(7, 16, 29, 0.56);
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 368px;
    height: auto;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.brand-copy h1 {
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}

.eyebrow,
.kicker,
.section-kicker,
.signal-label,
.proof-title,
.arch-step {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
}

.eyebrow,
.section-kicker,
.signal-label,
.proof-title,
.arch-step {
    color: var(--accent);
}

.topbar-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.top-link,
.proof-links a,
.secondary-link {
    color: var(--text-main);
    text-decoration: none;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.top-link,
.proof-links a {
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 22px;
}

.hero-copy,
.proof-panel,
.search-section,
.status-section,
.result-section,
.arch-card,
.admin-section {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.hero-copy {
    border-radius: 32px;
    padding: 34px;
}

.proof-panel {
    border-radius: 28px;
    padding: 28px;
    background: linear-gradient(180deg, rgba(11, 25, 42, 0.98), rgba(9, 22, 38, 0.9));
}

.kicker {
    color: var(--accent-warm);
    margin-bottom: 14px;
}

.hero-copy h2 {
    font-size: clamp(2.2rem, 4vw, 4.4rem);
    line-height: 0.98;
    max-width: 12ch;
    margin-bottom: 18px;
}

.hero-text {
    font-size: 1.06rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 64ch;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 24px 0 26px;
}

.primary-link,
.secondary-link,
#searchBtn,
.refresh-btn,
.actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-link,
#searchBtn,
.refresh-btn,
.actions button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #08111f;
    border: none;
    box-shadow: 0 16px 34px rgba(56, 196, 154, 0.28);
}

.primary-link,
.secondary-link {
    padding: 13px 18px;
}

.secondary-link {
    border: 1px solid var(--line);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.signal-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.signal-card {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(151, 177, 210, 0.12);
}

.signal-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1rem;
}

.proof-list {
    list-style: none;
    display: grid;
    gap: 12px;
    margin: 18px 0 26px;
}

.proof-list li {
    position: relative;
    padding-left: 18px;
    color: var(--text-muted);
    line-height: 1.55;
}

.proof-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.proof-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.architecture-band {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.arch-card {
    border-radius: 24px;
    padding: 24px;
}

.arch-card h3 {
    margin: 12px 0 10px;
    font-size: 1.05rem;
}

.arch-card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

.search-section,
.status-section,
.result-section {
    border-radius: 30px;
}

.search-section {
    padding: 30px;
    margin-bottom: 24px;
    background: linear-gradient(180deg, rgba(11, 24, 40, 0.92), rgba(10, 21, 37, 0.88));
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading h3 {
    font-size: 1.8rem;
    margin: 8px 0 10px;
}

.section-heading p {
    color: var(--text-muted);
    line-height: 1.6;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

#queryInput {
    flex: 1;
    padding: 18px 22px;
    font-size: 1rem;
    border: 1px solid rgba(151, 177, 210, 0.18);
    border-radius: 18px;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#queryInput::placeholder {
    color: #88a0bd;
}

#queryInput:focus {
    border-color: rgba(143, 240, 199, 0.7);
    box-shadow: 0 0 0 3px rgba(143, 240, 199, 0.12);
}

.search-options {
    display: flex;
    align-items: center;
    margin: 0 4px;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
}

.slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(22px);
}

.label-text {
    color: var(--text-muted);
    font-weight: 600;
}

#searchBtn {
    padding: 18px 28px;
    font-size: 1rem;
    min-width: 150px;
}

#searchBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tools-info {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.tool-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(151, 177, 210, 0.12);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
}

.status-section {
    padding: 20px 22px;
    margin-bottom: 24px;
    display: none;
}

.status-section.active {
    display: block;
}

.status-message {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 12px;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-warm));
    transition: width 0.3s;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

.result-section {
    padding: 28px;
    display: none;
}

.result-section.active {
    display: block;
}

.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(151, 177, 210, 0.14);
    padding-bottom: 12px;
}

.tab-button {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: 0.2s ease;
}

.tab-button.active {
    color: #08111f;
    background: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.report-content {
    line-height: 1.8;
    font-size: 1.02rem;
    color: var(--text-main);
}

.report-content h1,
.report-content h2,
.report-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
}

.report-content a,
.source-item a {
    color: var(--accent);
}

.report-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
}

.sources-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.source-item,
.metric-card,
.job-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(151, 177, 210, 0.12);
    border-radius: 18px;
}

.source-item {
    border-left: 4px solid var(--accent);
}

.admin-section {
    margin-bottom: 18px;
    border-radius: 22px;
    padding: 22px;
}

.admin-section h3 {
    margin-bottom: 14px;
}

.refresh-btn,
.actions button {
    padding: 12px 18px;
    font-size: 0.95rem;
}

.metrics-display,
.jobs-display {
    margin-top: 1rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 1rem;
}

.metric-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 16px;
    border-left: 3px solid var(--accent);
}

.metric-item .label,
.job-id,
.job-time,
.placeholder {
    color: var(--text-muted);
}

.metric-item .value {
    font-size: 1.4rem;
    font-weight: bold;
    margin-top: 0.25rem;
}

.job-item.running {
    border-left: 4px solid #6bb7ff;
}

.job-item.completed {
    border-left: 4px solid #42d09e;
}

.job-item.failed {
    border-left: 4px solid #ff7b7b;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.job-status {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: bold;
    text-transform: uppercase;
}

.job-status.pending {
    background: #f4b860;
    color: #08111f;
}

.job-status.running {
    background: #6bb7ff;
    color: #08111f;
}

.job-status.completed {
    background: #42d09e;
    color: #08111f;
}

.job-status.failed {
    background: #ff7b7b;
    color: #08111f;
}

.job-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.job-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #6bb7ff);
}

.actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.placeholder {
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

.top-link:hover,
.primary-link:hover,
.secondary-link:hover,
#searchBtn:hover,
.refresh-btn:hover,
.actions button:hover {
    transform: translateY(-2px);
}

@media (max-width: 1100px) {
    .hero-grid,
    .architecture-band,
    .signal-strip {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 820px) {
    .topbar,
    .search-box,
    .hero-grid,
    .architecture-band,
    .signal-strip {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar {
        align-items: flex-start;
    }

    .brand {
        align-items: flex-start;
    }

    .logo {
        width: 220px;
    }

    .hero-copy,
    .proof-panel,
    .search-section,
    .result-section,
    .status-section {
        padding: 22px;
    }

    .hero-copy h2 {
        max-width: none;
        font-size: 2.3rem;
    }

    #searchBtn {
        width: 100%;
    }
}
