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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0e0e0e;
    color: #e0e0e0;
    line-height: 1.6;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

a { color: #9aa0a6; }

/* ── Top Bar ── */
.top-bar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1e1e1e;
    flex-shrink: 0;
    min-height: 56px;
}

.hamburger-btn {
    background: none;
    border: none;
    color: #9aa0a6;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.hamburger-btn:hover { background: #2a2a2a; }
.hamburger-btn svg { width: 22px; height: 22px; }

.top-bar-title {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-right: 38px; /* balance hamburger width */
}

/* ── Side Panel Overlay ── */
.side-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.side-panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: #1a1a1a;
    z-index: 101;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.side-panel.open { transform: translateX(0); }

.side-panel-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #2a2a2a;
    font-weight: 600;
    font-size: 1rem;
    color: #e0e0e0;
}

.side-panel-section {
    padding: 1rem;
    border-bottom: 1px solid #2a2a2a;
}

.side-panel-section label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.side-panel-section select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #252525;
    color: #e0e0e0;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}
.side-panel-section select:focus { outline: none; border-color: #555; }

.side-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #c0c0c0;
}

.side-panel-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #666;
}

.side-panel-btn {
    width: 100%;
    padding: 0.6rem;
    background: #252525;
    color: #c0c0c0;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.5rem;
    text-align: center;
    transition: background 0.15s;
}
.side-panel-btn:hover { background: #333; color: #e0e0e0; }

.dev-only { display: none; }
body.dev-mode .dev-only { display: flex; }
.dev-only-block { display: none; }
body.dev-mode .dev-only-block { display: block; }

/* ── Main Content Area ── */
.main-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1rem 0.5rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* Welcome state */
.welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 2rem;
    min-height: 0;
}

.welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1e1e1e;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.welcome-icon svg { width: 28px; height: 28px; color: #888; }

.welcome-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 0.9rem;
    color: #666;
    max-width: 320px;
    line-height: 1.5;
}

/* Article content display */
#paste-area {
    background: #141414;
    border-radius: 12px;
    padding: 1.25rem;
    color: #c8c8c8;
    font-size: 0.9rem;
    line-height: 1.7;
    display: none;
    min-height: 240px;
    overflow-y: auto;
    border: 1px solid #1e1e1e;
}

#paste-area:empty::before {
    content: var(--paste-placeholder);
    color: #9a9a9a;
}

#paste-area:focus {
    outline: none;
    border-color: #333;
}

#fetch-error-banner {
    display: none;
    font-size: 0.82rem;
    color: #c96b6b;
    background: rgba(200, 80, 80, 0.08);
    border: 1px solid rgba(200, 80, 80, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.6rem;
}

#paste-area a { color: #8ab4f8; text-decoration: underline; }
#paste-area blockquote {
    border-left: 3px solid #333;
    padding-left: 1rem;
    margin: 0.5rem 0;
    color: #888;
}

/* ── Bottom Input Bar ── */
.bottom-bar {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid #1e1e1e;
    background: #0e0e0e;
}

.input-row {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 24px;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    transition: border-color 0.15s;
}
.input-row:focus-within { border-color: #444; }

/* ── Attach Button ── */
.attach-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}
.attach-btn:hover { color: #999; background: #252525; }
.attach-btn svg { width: 20px; height: 20px; }

/* ── Image Preview (inside input-row) ── */
.image-preview {
    flex-shrink: 0;
    position: relative;
    width: 36px;
    height: 36px;
}
.image-preview img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
}
.image-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #444;
    color: #e0e0e0;
    border: none;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.image-preview-remove:hover { background: #666; }

#content-url {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: #e0e0e0;
    outline: none;
    min-width: 0;
}
#content-url::placeholder { color: #555; }

.scan-bar-row .input-row { flex: 1; max-width: none; margin: 0; }
#action-btn { flex: none; padding: 0.65rem 1.4rem; }


/* ── Claims Screen ── */
#claims-inspect {
    display: none;
}

#claims-inspect .claims-header {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #e0e0e0;
}

#claims-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.claim-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #1e1e1e;
}

.claim-card .claim-tactic-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.claim-card .claim-tactic-label {
    font-size: 0.8rem;
    color: #888;
}

.claim-card .claim-quote {
    font-style: italic;
    color: #b0b0b0;
    margin-bottom: 0.75rem;
    border-left: 3px solid #2d5e5b;
    padding-left: 0.75rem;
}

.claim-card .claim-tactic-tag {
    display: inline-block;
    font-weight: 600;
    font-size: 0.8rem;
    color: #c89c4a;
    background: rgba(200, 156, 74, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.claim-card .claim-desc {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.claim-card .research-btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: #1c3937;
    color: #5bbab6;
    border: 1px solid #2d5e5b;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}
.claim-card .research-btn:hover { background: #224644; }
.claim-card .research-btn:disabled { background: #141e1e; color: #3a6663; cursor: not-allowed; border-color: #1e3432; }

.claim-card .search-results {
    margin-top: 0.75rem;
    border-top: 1px solid #252525;
    padding-top: 0.75rem;
}

.claim-card .search-result {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #1f1f1f;
}

.claim-card .search-result:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.claim-card .search-result a {
    color: #8ab4f8;
    font-weight: 500;
    text-decoration: none;
}
.claim-card .search-result a:hover { text-decoration: underline; }

.claim-card .search-result .search-score {
    font-size: 0.75rem;
    color: #666;
    margin-left: 0.5rem;
}

.claim-card .search-result .search-snippet {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.2rem;
}

.claim-card .assessment {
    margin-top: 0.75rem;
    border-top: 1px solid #252525;
    padding-top: 0.75rem;
}

.claim-card .assessment .verdict-badge {
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.claim-card .assessment .assessment-explanation {
    font-size: 0.9rem;
    color: #b0b0b0;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.claim-card .assessment .assessment-sources {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.claim-card .assessment .assessment-sources a {
    color: #8ab4f8;
    text-decoration: none;
}
.claim-card .assessment .assessment-sources a:hover { text-decoration: underline; }

.claim-card .assessment details {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.claim-card .assessment details summary {
    cursor: pointer;
    color: #888;
    font-weight: 500;
}

.claims-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.claims-back-btn {
    padding: 0.5rem 1rem;
    background: #252525;
    color: #c0c0c0;
    border: 1px solid #333;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}
.claims-back-btn:hover { background: #333; color: #e0e0e0; }

/* ── Status ── */
#status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: none;
    font-weight: 500;
    font-size: 0.9rem;
}
#status.loading { display: block; background: rgba(91, 186, 182, 0.07); color: #5bbab6; }
#status.error { display: block; background: rgba(224, 82, 82, 0.1); color: #e05252; }

.verdict-accurate { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.verdict-misleading { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.verdict-inaccurate { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.verdict-maliciously-inaccurate { background: rgba(185, 28, 28, 0.3); color: #fca5a5; }
.verdict-inconclusive { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(91, 186, 182, 0.2);
    border-top-color: #5bbab6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scan Bar (shown after content loads) ── */
.scan-bar-row {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 0.75rem;
}

.scan-back-btn {
    flex: 1;
    padding: 0.75rem;
    background: #1e1e1e;
    color: #888;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.scan-back-btn:hover { background: #2a2a2a; color: #c0c0c0; }

.scan-bias-btn {
    flex: 2;
    padding: 0.75rem;
    background: #1c3937;
    color: #5bbab6;
    border: 1px solid #2d5e5b;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.scan-bias-btn:hover { background: #224644; }
.scan-bias-btn:disabled { background: #141e1e; color: #3a6663; cursor: not-allowed; border-color: #1e3432; }

#loading-text {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #5bbab6;
    display: none;
}
