/* ========== CSS VARIABLES / THEME ========== */
:root {
    --accent: #E8735A;
    --accent-light: #F09A82;
    --accent-dark: #C55A42;
    --danger: #e05555;
    --warning: #e8a83e;
    --info: #5ba8e0;
    --purple: #8b5ae0;
    --transition: .3s ease;
}

[data-theme="dark"] {
    --bg-primary: #1A1A1A;
    --bg-secondary: #242424;
    --bg-card: #2A2A2A;
    --bg-elevated: #333333;
    --text-primary: #E8E8E8;
    --text-secondary: #999999;
    --text-muted: #666666;
    --border: #3A3A3A;
    --globe-land: #3A3A3A;
    --globe-border: var(--accent);
    --globe-water: #1A1A1A;
    --globe-label: #5A5A5A;
}

[data-theme="light"] {
    --bg-primary: #F5F5F5;
    --bg-secondary: #EBEBEB;
    --bg-card: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #DDDDDD;
    --globe-land: #D5D5D5;
    --globe-border: var(--accent);
    --globe-water: #F5F5F5;
    --globe-label: #AAAAAA;
}

/* ========== RESET ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%; width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.hidden { display: none !important; }
.view-hidden {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    opacity: 0;
}

/* ========== INTRO SCREEN ========== */
#intro-screen {
    position: fixed; inset: 0; z-index: 1000;
    background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
}

#intro-camera-wrap {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
    width: 100%; height: 100%; text-align: center;
}

#intro-camera {
    filter: drop-shadow(0 4px 24px color-mix(in srgb, var(--accent) 30%, transparent));
    display: block; margin: 0 auto;
    transform: translateX(-12px);
}

#intro-text {
    font-size: 28px; font-weight: 700; letter-spacing: 12px;
    color: var(--accent); opacity: 0;
    transition: opacity .6s ease;
    text-align: center; width: 100%;
    transform: translateX(-12px);
}
#intro-text.visible { opacity: 1; }

/* Camera look animation */
@keyframes camLookAround {
    0%   { transform: translateX(-12px) rotate(0deg); }
    15%  { transform: translateX(-42px) rotate(-8deg); }
    30%  { transform: translateX(-42px) rotate(-8deg); }
    50%  { transform: translateX(18px) rotate(8deg); }
    65%  { transform: translateX(18px) rotate(8deg); }
    80%  { transform: translateX(-12px) rotate(0deg); }
    100% { transform: translateX(-12px) rotate(0deg); }
}

@keyframes pupilLook {
    0%   { cx: 105; }
    15%  { cx: 92; }
    30%  { cx: 92; }
    50%  { cx: 118; }
    65%  { cx: 118; }
    80%  { cx: 105; }
    100% { cx: 105; }
}

@keyframes recBlink {
    0%, 100% { opacity: 0; }
    10% { opacity: 1; }
    20% { opacity: 0; }
    30% { opacity: 1; }
    40% { opacity: 0; }
    50% { opacity: 1; }
    60% { opacity: .6; }
    70% { opacity: 1; }
    80% { opacity: .4; }
    90% { opacity: 1; }
}

@keyframes introFadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.15); }
}

.cam-looking {
    animation: camLookAround 2.5s ease-in-out forwards;
}

.pupil-looking {
    animation: pupilLook 2.5s ease-in-out forwards;
}

.rec-blinking {
    animation: recBlink 1.5s ease-in-out forwards;
}

@keyframes textPulse {
    0%   { transform: scale(1);    text-shadow: none; }
    40%  { transform: scale(1.18); text-shadow: 0 0 18px var(--accent), 0 0 40px var(--accent), 0 0 70px var(--accent); }
    100% { transform: scale(1);    text-shadow: none; }
}
.text-pulsing {
    animation: textPulse 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.intro-exit {
    animation: introFadeOut .6s ease-in forwards;
}

/* ========== TOP BAR ========== */
#top-bar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px; z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
}

#logo-area {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    user-select: none;
}
.logo-text {
    font-size: 16px; font-weight: 700; letter-spacing: 4px;
    color: var(--accent);
}

#time-filter {
    position: fixed; top: 68px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px; padding: 3px;
    z-index: 90;
}

.tf-btn {
    background: none; border: none; color: var(--text-secondary);
    font-size: 12px; font-weight: 600; padding: 6px 14px;
    border-radius: 8px; cursor: pointer;
    transition: all var(--transition);
}
.tf-btn.active {
    background: var(--accent); color: #fff;
}
.tf-btn:hover:not(.active) { color: var(--text-primary); }

#settings-btn {
    background: none; border: none; cursor: pointer;
    padding: 6px; border-radius: 8px;
    transition: background var(--transition);
}
#settings-btn:hover { background: var(--bg-secondary); }

/* ========== FEED ========== */
#feed-container {
    position: fixed; top: 102px; bottom: 100px; left: 0; right: 0;
    overflow: hidden;
}

#feed-scroll {
    height: 100%; overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
#feed-scroll::-webkit-scrollbar { display: none; }
#feed-scroll.app-preload-hidden { visibility: hidden; }
#feed-scroll.feed-loading {
    opacity: 0; pointer-events: none;
}

/* ── Feed Loader ── */
#feed-loader {
    position: fixed; top: 56px; bottom: 100px; left: 0; right: 0;
    z-index: 490;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 28px;
    background: var(--bg-primary);
    animation: flIn .35s ease;
}
#feed-loader.fl-out { animation: flOut .4s ease forwards; }
@keyframes flIn  { from { opacity:0; } to { opacity:1; } }
@keyframes flOut { from { opacity:1; } to { opacity:0; } }

.fl-scene {
    position: relative; width: 220px; height: 220px;
    display: flex; align-items: center; justify-content: center;
}

/* Zentrales Kamera-Icon */
.fl-center {
    position: absolute; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    width: 80px; height: 80px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    animation: flPulse 2s ease-in-out infinite;
}
@keyframes flPulse {
    0%,100% { transform: scale(1);    box-shadow: 0 0 0 0   color-mix(in srgb, var(--accent) 20%, transparent); }
    50%      { transform: scale(1.08); box-shadow: 0 0 0 18px color-mix(in srgb, var(--accent) 0%,  transparent); }
}

/* Orbit-Ring */
.fl-orbit-ring {
    position: absolute; inset: 0;
    animation: flOrbit 12s linear infinite;
}
@keyframes flOrbit { to { transform: rotate(360deg); } }

/* Einzelne Icons auf dem Ring */
.fl-orbit-icon {
    position: absolute;
    top: 50%; left: 50%;
    width: 34px; height: 34px;
    margin: -17px 0 0 -17px;
    transform: rotate(var(--angle)) translateX(95px) rotate(calc(-1 * var(--angle)));
    animation: flIconAppear .5s ease var(--delay) both;
}
@keyframes flIconAppear {
    from { opacity:0; transform: rotate(var(--angle)) translateX(60px) rotate(calc(-1 * var(--angle))) scale(0.3); }
    to   { opacity:1; transform: rotate(var(--angle)) translateX(95px) rotate(calc(-1 * var(--angle))) scale(1); }
}

/* Icons drehen sich gegen den Orbit damit Beschriftung lesbar bleibt */
.fl-orbit-icon .source-icon {
    counter-reset: none;
    animation: flIconCounter 12s linear infinite;
}
@keyframes flIconCounter { to { transform: rotate(-360deg); } }

/* Status-Text */
.fl-msg {
    font-size: 15px; font-weight: 600; color: var(--text);
    text-align: center; transition: opacity .3s ease;
    letter-spacing: 0.01em;
}
.fl-msg.fl-msg-out { opacity: 0; }
.fl-sub {
    font-size: 12px; color: var(--text-muted); text-align: center;
    margin-top: -20px;
}

.pulse-card {
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px 20px 32px;
    position: relative;
    background: var(--bg-primary);
}

.pulse-card-inner {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 160px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0;
    position: relative;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.pulse-card-inner:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 24px color-mix(in srgb, var(--accent) 20%, transparent);
}
.pulse-card-inner.swipe-state-like  { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.pulse-card-inner.swipe-state-dislike { border-color: rgba(120,120,120,.4); }

/* Swipe overlays — on .pulse-card level (full viewport slot) */
.swipe-overlay-left,
.swipe-overlay-right {
    position: absolute; top: 0; bottom: 0;
    width: 44%; pointer-events: none;
    opacity: 0; z-index: 20;
    display: flex; align-items: center;
    transition: opacity 0.05s;
}
.swipe-overlay-left {
    left: 0;
    background: linear-gradient(to right,
        color-mix(in srgb, var(--accent) 60%, transparent) 0%,
        color-mix(in srgb, var(--accent) 25%, transparent) 55%,
        transparent 100%);
    justify-content: flex-start;
    padding-left: 22px;
}
.swipe-overlay-right {
    right: 0;
    background: linear-gradient(to left,
        color-mix(in srgb, var(--accent) 60%, transparent) 0%,
        color-mix(in srgb, var(--accent) 25%, transparent) 55%,
        transparent 100%);
    justify-content: flex-end;
    padding-right: 22px;
}

/* Optional image in card */
.pulse-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.pulse-card-body {
    padding: 22px 24px 20px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Depolarized icon - top right of card */
.depolar-icon {
    position: absolute;
    top: 14px; right: 14px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-radius: 50%;
    z-index: 5;
}

.pulse-category {
    font-size: 11px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 10px;
}

.pulse-card-unverified {
    opacity: 0.82;
    border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

/* When showing single-source articles: make card backgrounds transparent so ! pattern shows through */
.unverified-mode .pulse-card {
    background: transparent;
}
.unverified-mode .pulse-card-inner {
    background: color-mix(in srgb, var(--bg-card) 80%, transparent);
}

.single-source-badge {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 10px;
    font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--text-muted) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-muted) 20%, transparent);
    border-radius: 4px;
    padding: 3px 7px;
}

/* ── Unverified / single-source warning screen ─────────────────────────────── */
.feed-warning-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    background: var(--card-bg);
}

.feed-warning-pattern,
.feed-unverified-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    color: var(--accent);
    opacity: 0.06;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 14px;
    line-height: 1.8;
    word-break: break-all;
    padding: 16px;
    user-select: none;
}

.feed-unverified-bg {
    position: fixed;
    top: 56px;     /* below top-bar */
    bottom: 100px; /* above tab-bar */
    left: 0;
    right: 0;
    z-index: 0;
    opacity: 0.05;
}

.feed-warning-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 32px;
    gap: 12px;
}

.feed-warning-icon {
    font-size: 80px;
    font-weight: 900;
    line-height: 1;
    color: var(--accent);
    text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 40%, transparent);
    margin-bottom: 8px;
}

.feed-warning-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.feed-warning-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 280px;
    margin: 0;
}

.feed-warning-btn {
    margin-top: 8px;
    padding: 10px 22px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.feed-warning-btn:active {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.pulse-headline {
    font-size: 22px; font-weight: 700; line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 10px;
    max-width: 90%;
}

.pulse-summary {
    font-size: 14px; line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 18px;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}

/* Bullet-point facts in feed */
.pulse-facts {
    list-style: none; padding: 0; margin: 0 0 18px 0;
    min-height: 20px; /* Platzhalter während Laden */
}
.pulse-facts:empty::after {
    content: '';
    display: block; height: 12px; border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-secondary) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    opacity: 0.5;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.pulse-facts.facts-loaded { animation: factsIn .3s ease forwards; }
@keyframes factsIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pulse-fact {
    font-size: 13px; line-height: 1.5;
    color: var(--text-secondary);
    padding: 3px 0 3px 16px;
    position: relative;
}
.pulse-fact::before {
    content: '';
    position: absolute; left: 0; top: 10px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
}

/* Action Buttons Row */
.pulse-actions {
    display: flex; gap: 8px; margin-bottom: 14px;
}

.interest-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    z-index: 10;
}
.interest-btn:hover {
    border-color: var(--accent);
    background: var(--bg-elevated);
    transform: scale(1.1);
}
.interest-btn.active.like-btn {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border-color: var(--accent);
}
.interest-btn.active.dislike-btn {
    background: rgba(102,102,102,.2);
    border-color: var(--text-muted);
}
.interest-btn.active.archive-btn {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border-color: var(--accent);
}

.pulse-meta {
    display: flex; align-items: center; justify-content: space-between;
}

.pulse-sources {
    display: flex; gap: 6px; align-items: center;
}

.source-icon {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--bg-elevated); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: var(--text-secondary);
    overflow: hidden;
    transition: border-color var(--transition);
}
.source-icon:hover { border-color: var(--accent); }
.source-icon img { width: 100%; height: 100%; object-fit: cover; }
.source-icon-more {
    border-color: var(--border) !important;
    color: var(--text-secondary);
    font-size: 9px;
    cursor: default;
}

.pulse-time {
    font-size: 12px; color: var(--text-muted); font-weight: 500;
}


/* ========== DETAIL VIEW ========== */
#detail-view {
    position: fixed; inset: 0; z-index: 200;
    background: var(--bg-primary);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
#detail-view.visible {
    display: block !important;
    transform: translateX(0);
}

#detail-header {
    height: 56px; display: flex; align-items: center;
    padding: 0 16px; gap: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    position: sticky; top: 0; z-index: 10;
}

#detail-back {
    background: none; border: none; cursor: pointer;
    padding: 4px; border-radius: 8px;
    transition: background var(--transition);
}
#detail-back:hover { background: var(--bg-secondary); }

#detail-title {
    font-size: 16px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#detail-content {
    height: calc(100% - 56px); overflow-y: auto;
    padding: 24px 20px 40px;
    scrollbar-width: thin;
}

.detail-hero-category {
    font-size: 11px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 12px;
}

.detail-hero-headline {
    font-size: 30px; font-weight: 800; line-height: 1.15;
    color: var(--text-primary); margin-bottom: 16px;
}

/* Countries row in detail view */
.detail-countries {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 16px;
}
.detail-country-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px;
    font-size: 12px; font-weight: 600;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 20px;
    cursor: pointer;
    transition: all .2s ease;
}
.detail-country-btn::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .7;
}
.detail-country-btn:hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    border-color: var(--accent);
    transform: scale(1.04);
}

.detail-hero-time {
    font-size: 13px; color: var(--text-muted); margin-bottom: 24px;
}

.detail-translated-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 20px; padding: 3px 9px;
    margin-bottom: 8px;
}

.detail-rss-summary {
    font-size: 15px; line-height: 1.6; color: var(--text-secondary);
    margin-bottom: 20px;
}

.detail-rss-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--accent); text-decoration: none;
    border: 1px solid var(--accent); border-radius: 8px;
    padding: 8px 14px; margin-bottom: 24px;
    transition: background var(--transition);
}
.detail-rss-link:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

.detail-ai-loading {
    display: flex; gap: 6px; align-items: center;
    padding: 14px 0 20px;
}
.detail-ai-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); opacity: 0.4;
    animation: aiDotPulse 1.2s ease-in-out infinite;
}
.detail-ai-dot:nth-child(2) { animation-delay: 0.2s; }
.detail-ai-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDotPulse {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Feed end card */
.feed-end-card { pointer-events: none; }
.feed-end-ring {
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    animation: feedRingDraw 0.8s ease-out 0.2s forwards;
}
.feed-end-tick {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: feedTickDraw 0.4s ease-out 0.9s forwards;
}
@keyframes feedRingDraw {
    to { stroke-dashoffset: 0; }
}
@keyframes feedTickDraw {
    to { stroke-dashoffset: 0; }
}

.detail-summary {
    font-size: 16px; line-height: 1.7; color: var(--text-secondary);
    margin-bottom: 32px; padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.detail-sources-title {
    font-size: 13px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 16px;
}

/* Quellen collapsible section */
.detail-sources-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: border-color var(--transition);
}
.detail-sources-section:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.detail-sources-toggle {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: none; cursor: pointer; color: inherit;
}
.detail-sources-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-muted);
}
.detail-sources-count {
    font-size: 11px; font-weight: 700;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px; padding: 1px 7px;
    color: var(--text-muted);
}
.sources-arrow {
    transition: transform .25s ease;
    flex-shrink: 0;
}
.detail-sources-section.open .sources-arrow { transform: rotate(180deg); }
.detail-sources-body {
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease;
}
.detail-sources-section.open .detail-sources-body {
    max-height: 2000px;
}
.detail-sources-body .detail-source-dropdown {
    border-radius: 0;
    border-left: none; border-right: none; border-top: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}
.detail-sources-body .detail-source-dropdown:last-child { border-bottom: none; }

.detail-source-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px; padding: 16px;
    margin-bottom: 12px;
    transition: border-color var(--transition);
}
.detail-source-card:hover { border-color: var(--accent); }

.detail-source-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.detail-source-header .source-icon { width: 32px; height: 32px; font-size: 12px; }

.detail-source-name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.detail-source-type {
    font-size: 11px; color: var(--text-muted);
}

.detail-source-text {
    font-size: 14px; line-height: 1.6; color: var(--text-secondary);
}

/* Detail facts */
.detail-facts {
    margin-bottom: 28px; padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.detail-facts-list {
    list-style: none; padding: 0; margin: 0;
}
.detail-facts-list li {
    font-size: 15px; line-height: 1.6;
    color: var(--text-secondary);
    padding: 5px 0 5px 20px;
    position: relative;
}
.detail-facts-list li::before {
    content: '';
    position: absolute; left: 0; top: 13px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
}

/* Depolarized inline badge */
.depolar-icon-inline {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--accent); font-weight: 600;
    margin-bottom: 20px;
}

/* Source dropdown */
.detail-source-dropdown {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color var(--transition);
}
.detail-source-dropdown:hover { border-color: var(--accent); }
.detail-source-toggle {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: none; cursor: pointer;
    color: inherit;
}
.detail-source-toggle .detail-source-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 0;
}
.detail-source-toggle .source-icon { width: 30px; height: 30px; font-size: 11px; }
.detail-source-info { text-align: left; }
.dropdown-arrow {
    transition: transform .25s ease;
    flex-shrink: 0;
}
.detail-source-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}
.detail-source-body {
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    padding: 0 16px;
    background: var(--bg-secondary);
}
.detail-source-dropdown.open .detail-source-body {
    max-height: 300px;
    padding: 14px 16px;
}

.detail-source-link {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 10px;
    font-size: 12px; font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: opacity .2s;
}
.detail-source-link:hover { opacity: .7; }
.detail-source-link svg { flex-shrink: 0; }

/* ========== PULSE CONSEQUENCES ========== */
.consequences-section {
    margin-top: 24px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}
.consequences-header {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2a1f4e 0%, #1a1a2e 100%);
    border-bottom: 1px solid rgba(139, 90, 224, 0.3);
}
[data-theme="light"] .consequences-header {
    background: linear-gradient(135deg, #ede8fa 0%, #ddd5f7 100%);
    border-bottom: 1px solid rgba(139, 90, 224, 0.2);
}
.consequences-header-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: rgba(139, 90, 224, 0.25);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.consequences-header-icon svg { opacity: .9; }
.consequences-title {
    font-size: 13px; font-weight: 700; letter-spacing: .03em;
    color: #c4a8ff;
}
[data-theme="light"] .consequences-title { color: #6b3fc8; }
.consequences-subtitle {
    font-size: 11px; color: rgba(196, 168, 255, 0.6);
    margin-left: auto;
}
[data-theme="light"] .consequences-subtitle { color: rgba(107, 63, 200, 0.55); }
.consequences-body {
    display: flex; flex-direction: column;
}
.consequences-col {
    padding: 14px 16px;
}
.consequences-col:first-child {
    border-bottom: 1px solid var(--border);
}
.consequences-col-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.consequences-col-label .label-dot {
    width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}
.label-dot-short { background: #e8a83e; }
.label-dot-long  { background: #8b5ae0; }
.consequences-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 7px;
}
.consequences-list li {
    font-size: 13.5px; line-height: 1.5;
    color: var(--text-secondary);
    padding-left: 12px;
    position: relative;
}
.consequences-list li::before {
    content: '';
    position: absolute; left: 0; top: 7px;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--text-muted);
}
.consequences-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 20px 16px;
    font-size: 12px; color: var(--text-muted);
}
.consequences-spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(139,90,224,.2);
    border-top-color: #8b5ae0;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== PROFILE VIEW ========== */
#profile-view {
    position: fixed; top: 56px; bottom: 100px; left: 0; right: 0;
    z-index: 50;
    background: var(--bg-primary);
    overflow: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
#profile-view.view-visible {
    visibility: visible; pointer-events: all; opacity: 1;
}

#profile-scroll {
    height: 100%; overflow-y: auto;
    padding: 20px 16px 24px;
    scrollbar-width: thin;
    display: flex; flex-direction: column; gap: 12px;
}

.profile-hero {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 0 8px;
}
.profile-avatar {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden; position: relative;
}
.profile-avatar-clickable {
    cursor: pointer;
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    transition: border-color .2s, transform .15s;
}
.profile-avatar-clickable:hover { border-color: var(--accent); transform: scale(1.05); }
.profile-avatar-clickable:hover .profile-avatar-overlay { opacity: 1; }
.profile-avatar-img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.profile-avatar-overlay {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s;
}
.profile-location-chip {
    display: inline-block; margin-left: 6px;
    font-size: 11px; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 20px; padding: 1px 7px;
    vertical-align: middle;
}
.profile-party-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.profile-party-label {
    font-size: 11px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--text-muted);
}
.profile-party-badge {
    font-size: 12px; font-weight: 700;
    border: 1px solid; border-radius: 20px;
    padding: 3px 10px;
}
.profile-hero-title {
    font-size: 18px; font-weight: 800; color: var(--text-primary);
    margin-bottom: 4px;
}
.profile-hero-sub {
    font-size: 12px; color: var(--text-muted); line-height: 1.4;
}

.profile-section-label {
    font-size: 11px; font-weight: 700; letter-spacing: .1em;
    color: var(--accent); text-transform: uppercase;
    padding: 4px 0 0;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}
.profile-overall-card {
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    background: color-mix(in srgb, var(--accent) 5%, var(--bg-card));
}
.profile-card-label {
    font-size: 11px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 6px;
}
.profile-overall-result {
    font-size: 22px; font-weight: 800;
    margin-bottom: 12px;
}
.profile-overall-counts {
    display: flex; gap: 12px; margin-top: 10px;
    font-size: 12px; font-weight: 700;
}
.profile-cat-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.profile-cat-name {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.profile-cat-pos {
    font-size: 12px; font-weight: 600;
}
.profile-cat-counts {
    display: flex; gap: 10px; margin-top: 8px;
    font-size: 11px; font-weight: 700;
}

/* Scale bar */
.profile-scale {
    display: flex; align-items: center; gap: 8px;
}
.profile-scale-label {
    font-size: 10px; font-weight: 800; letter-spacing: .06em;
    flex-shrink: 0; width: 14px; text-align: center;
}
.profile-scale-l { color: #e05555; }
.profile-scale-r { color: #5ba8e0; }
.profile-scale-track {
    flex: 1; height: 8px; border-radius: 4px;
    background: var(--bg-secondary);
    position: relative; overflow: visible;
}
.profile-scale-fill {
    position: absolute; inset: 0; border-radius: 4px;
}
.profile-scale-dot {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--bg-card);
    transition: left .6s cubic-bezier(.4,0,.2,1);
}
.profile-scale-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: var(--text-muted); font-style: italic;
}

.profile-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 16px; padding: 40px 20px;
    text-align: center;
    color: var(--text-muted); font-size: 13px; line-height: 1.6;
}

.profile-reset-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px; width: 100%;
    color: var(--text-muted); font-size: 13px;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    margin-top: 4px;
}
.profile-reset-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ========== POLITICAL SPECTRUM SECTION ========== */
.spectrum-section {
    margin-top: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    overflow: hidden;
}
.spectrum-header {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
.spectrum-title {
    font-size: 13px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-primary);
    flex: 1;
}
.spectrum-country {
    font-size: 11px; color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px; padding: 2px 8px;
}
.spectrum-cols {
    display: flex; flex-direction: column;
}
.spectrum-col {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.spectrum-col:last-child { border-bottom: none; }
.spectrum-col-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; margin-bottom: 6px;
    color: var(--text-primary);
}
/* Anonymous label before reveal */
.spectrum-col-anon {
    color: var(--text-muted) !important;
}
.spectrum-anon-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%; border: 1.5px solid var(--border);
    font-size: 10px; font-weight: 700; color: var(--text-muted);
}
.spectrum-side-icon { font-size: 8px; opacity: .8; }
.spectrum-parties {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    margin-bottom: 6px; line-height: 1.4;
}
.spectrum-stance {
    font-size: 12px; line-height: 1.45;
    color: var(--text-secondary);
    margin: 0 0 8px;
    word-break: break-word;
}
.spectrum-sources {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.spectrum-src-badge {
    font-size: 9px; font-weight: 700;
    border: 1px solid; border-radius: 6px;
    padding: 1px 5px;
    opacity: .8;
}

/* Anonymous / blur state */
.spectrum-blur {
    filter: blur(5px);
    user-select: none;
    transition: filter .5s ease, opacity .5s ease;
}
.spectrum-reveal-anim {
    filter: blur(0) !important;
    animation: spectrumReveal .5s ease forwards;
}
@keyframes spectrumReveal {
    from { opacity: 0; filter: blur(8px); transform: translateY(4px); }
    to   { opacity: 1; filter: blur(0);   transform: translateY(0); }
}
.spectrum-reveal-hint {
    font-size: 10px; color: var(--accent);
    text-align: center; margin-top: 8px;
    font-weight: 600; letter-spacing: .04em;
    opacity: .8;
    animation: pulse-hint 2s ease-in-out infinite;
}
@keyframes pulse-hint {
    0%, 100% { opacity: .5; }
    50%       { opacity: 1; }
}
.spectrum-col[data-side] { transition: background .3s, border-color .3s; }
.spectrum-col[data-side]:not(.spectrum-chosen):hover {
    background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.spectrum-col[data-side]:not(.spectrum-chosen):hover .spectrum-blur {
    filter: blur(3px);
}
.spectrum-chosen {
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 8%, transparent) !important;
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* ========== SOCIAL MEDIA ENHANCED DISPLAY ========== */
.detail-source-social .detail-source-header { border-left: 2px solid var(--accent); padding-left: 8px; margin-left: -8px; }
.source-type-badge {
    font-size: 9px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-muted);
    margin-top: 1px;
}
.source-country-badge {
    font-size: 10px; font-weight: 500; color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px; padding: 1px 5px;
    margin-left: 6px; vertical-align: middle;
}
.social-accounts-row {
    display: flex; flex-wrap: wrap; gap: 5px;
    margin-bottom: 10px;
}
.social-account {
    font-size: 11px; font-weight: 500;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: 20px;
    padding: 3px 9px;
}
.social-factcheck {
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 11.5px; font-weight: 600;
    margin-bottom: 10px;
}
.factcheck-confirmed {
    background: rgba(91,192,160,.1);
    border: 1px solid rgba(91,192,160,.3);
    color: #5bc0a0;
}
.factcheck-partial {
    background: rgba(232,168,62,.08);
    border: 1px solid rgba(232,168,62,.3);
    color: #e8a83e;
}
.factcheck-disputed {
    background: rgba(224,85,85,.08);
    border: 1px solid rgba(224,85,85,.3);
    color: #e05555;
}
.factcheck-source {
    font-size: 9px; font-weight: 700;
    border: 1px solid; border-radius: 5px;
    padding: 1px 5px;
    opacity: .85;
    color: var(--text-muted);
}

/* ========== PREFERRED SOURCES IN SETTINGS ========== */
.source-group {
    margin-bottom: 16px;
}
.source-group-label {
    font-size: 10px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 8px; padding-left: 2px;
}
.source-pref-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition);
}
.source-pref-item:hover { background: var(--bg-secondary); }
.source-pref-item.favorited {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
.source-pref-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--bg-elevated);
    border: 1.5px solid;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800;
    flex-shrink: 0;
}
.source-pref-info {
    flex: 1; min-width: 0;
}
.source-pref-name {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    display: block;
}
.source-pref-country {
    font-size: 11px; color: var(--text-muted);
}
.source-fav-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted);
    padding: 4px; border-radius: 6px;
    transition: color .2s, transform .2s;
    flex-shrink: 0;
}
.source-fav-btn:hover { color: #e05599; transform: scale(1.2); }
.source-fav-btn.active { color: #e05599; }

/* ========== GLOBE VIEW ========== */
#globe-view {
    position: fixed; top: 56px; bottom: 100px; left: 0; right: 0;
    z-index: 50;
    background: var(--bg-primary);
    transition: opacity .3s ease, visibility .3s ease;
}
#globe-view.view-visible {
    visibility: visible; pointer-events: all;
    position: fixed; opacity: 1;
}

#globe-time-filter {
    position: absolute; top: 12px; left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex; gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px; padding: 3px;
}

#globe-container {
    position: relative;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
}
#globe-container svg { cursor: grab; }
#globe-container svg:active { cursor: grabbing; }

#globe-legend {
    position: absolute; bottom: 16px; left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 480px;
    z-index: 100; pointer-events: all;
}
#legend-handle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    padding: 8px 16px;
    cursor: pointer; user-select: none;
    transition: background .15s;
}
#legend-handle:hover { background: var(--bg-secondary); }
#legend-handle:hover #legend-arrow { stroke: var(--text-secondary); }
#legend-arrow {
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    stroke: var(--text-muted);
}
#globe-legend.open #legend-arrow {
    transform: rotate(180deg);
}
#legend-items {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
    padding: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
}
.legend-item {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 20px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    transition: opacity .2s, border-color .2s;
    user-select: none; pointer-events: all; cursor: pointer;
    font-size: 12px; color: var(--text-secondary);
}
.legend-item[data-category]:hover { border-color: var(--text-muted); }
.legend-item-off { opacity: .35; }
.legend-item-off svg { filter: grayscale(1); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Globe pins */
.globe-pin { cursor: pointer; }
.globe-pin * { pointer-events: none; }
.globe-pin .pin-hitarea { pointer-events: all !important; }

/* Crisis zones */
.crisis-zone-g { pointer-events: all; cursor: pointer; }
.crisis-inner {
    animation: crisisPulse 2.2s ease-in-out infinite;
}
.crisis-outer {
    animation: crisisOuterPulse 2.2s ease-in-out infinite;
}
@keyframes crisisPulse {
    0%, 100% { opacity: 0.25; }
    50%       { opacity: 0.55; }
}
@keyframes crisisOuterPulse {
    0%, 100% { opacity: 0.1;  transform: scale(1);    transform-origin: center; transform-box: fill-box; }
    50%       { opacity: 0.28; transform: scale(1.15); transform-origin: center; transform-box: fill-box; }
}
/* Stop pulsing once the related news has been viewed */
.crisis-zone-g.viewed .crisis-inner,
.crisis-zone-g.viewed .crisis-outer {
    animation: none;
    opacity: 0.08;
}

/* ========== COUNTRY NEWS PANEL ========== */
#country-news-panel {
    position: fixed;
    top: 56px; bottom: 100px; left: 0; right: 0;
    z-index: 80;
    background: var(--bg-primary);
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#country-news-panel.visible {
    display: flex !important;
    transform: translateY(0);
}

#country-news-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    height: 52px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}

#country-news-back {
    background: none; border: none; cursor: pointer;
    padding: 4px; border-radius: 8px;
    transition: background var(--transition);
    flex-shrink: 0;
}
#country-news-back:hover { background: var(--bg-secondary); }

#country-news-title-wrap {
    display: flex; align-items: center; gap: 6px;
    flex: 1; min-width: 0;
}

#country-news-title {
    font-size: 15px; font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#country-time-filter {
    display: flex; gap: 2px;
    background: var(--bg-secondary);
    border-radius: 10px; padding: 3px;
    flex-shrink: 0;
}

#country-news-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 16px;
    scrollbar-width: thin;
}

.country-news-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.country-news-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 16px color-mix(in srgb, var(--accent) 15%, transparent);
}
.country-news-cat {
    font-size: 10px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 5px;
}
.country-news-headline {
    font-size: 15px; font-weight: 700; line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.country-news-countries {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-bottom: 8px;
}
.country-tag-small {
    font-size: 11px; font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2px 8px;
}
.country-news-meta {
    display: flex; align-items: center; justify-content: space-between;
}
.country-news-sources {
    display: flex; gap: 4px;
}
.source-icon-sm {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--bg-elevated); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; color: var(--text-secondary);
}
.country-news-time {
    font-size: 12px; color: var(--text-muted);
}

/* Multi-country tags on feed cards */
.pulse-countries {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-bottom: 10px;
}
.pulse-country-tag {
    font-size: 11px; font-weight: 500;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 10px;
    padding: 2px 8px;
}

/* ========== TAB BAR ========== */
#tab-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 100px; z-index: 100;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-btn {
    background: none; border: none;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: var(--text-muted); cursor: pointer;
    padding: 12px 28px; border-radius: 12px;
    transition: color var(--transition);
    font-size: 13px; font-weight: 600;
}
.tab-btn.active { color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--text-secondary); }

/* ========== SETTINGS PANEL ========== */
#settings-panel {
    position: fixed; inset: 0; z-index: 300;
}

#settings-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.5);
    animation: fadeIn .25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#settings-content {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: min(380px, 90vw);
    background: var(--bg-primary);
    overflow: hidden;
    border-left: 1px solid var(--border);
    animation: slideIn .3s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    overflow: hidden;
}

@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

#settings-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
#settings-header h2 { font-size: 18px; font-weight: 700; }

#settings-close {
    background: none; border: none; cursor: pointer;
    padding: 4px; border-radius: 8px;
    transition: background var(--transition);
}
#settings-close:hover { background: var(--bg-secondary); }

#settings-body {
    flex: 1; overflow-y: auto; padding: 0;
    scrollbar-width: thin;
    position: relative;
}

/* Settings nav list */
#settings-nav-list {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 0;
}

.settings-nav-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 12px;
    transition: background var(--transition);
    margin: 0 6px;
}
.settings-nav-item:hover, .settings-nav-item:active {
    background: var(--bg-secondary);
}
.settings-nav-item-left {
    display: flex; align-items: center; gap: 12px;
}
.settings-nav-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}
.settings-nav-item > .settings-nav-item-left > span {
    font-size: 15px; font-weight: 500; color: var(--text-primary);
}
.settings-nav-chevron {
    color: var(--text-muted);
}

/* Settings sub-pages */
.settings-subpage {
    display: flex; flex-direction: column;
    position: absolute; inset: 0;
    background: var(--bg-primary);
    overflow-y: auto;
    scrollbar-width: none;
}
.settings-subpage::-webkit-scrollbar { display: none; }
.settings-subpage-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}
.settings-subpage-header span {
    font-size: 16px; font-weight: 600; color: var(--text-primary);
}
.settings-back-btn {
    background: none; border: none; cursor: pointer;
    padding: 2px; display: flex; align-items: center;
}
.settings-subpage-body {
    padding: 8px 0;
}
.settings-subpage-body .settings-section {
    margin-bottom: 0;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.settings-subpage-body .settings-section:last-child {
    border-bottom: none;
}

.settings-section {
    margin-bottom: 28px;
}
.settings-section-legal {
    padding: 0 20px;
}
.settings-section h3 {
    font-size: 13px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 14px;
}

.setting-desc {
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.5; margin-bottom: 12px;
}

.setting-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0;
    font-size: 14px; color: var(--text-primary);
}

.location-fields {
    display: flex; flex-direction: column; gap: 10px;
}
.location-fields select,
.location-fields input[type="text"] {
    width: 100%; padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    appearance: none; -webkit-appearance: none;
    cursor: pointer;
    transition: border-color .2s;
}
.location-fields select:focus,
.location-fields input[type="text"]:focus { border-color: var(--accent); }
.location-fields input[type="text"]::placeholder { color: var(--text-muted); }

/* Toggle Switch */
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--bg-elevated); border-radius: 12px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.toggle-slider::before {
    content: ''; position: absolute;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--text-muted);
    left: 2px; top: 2px;
    transition: all var(--transition);
}
.toggle input:checked + .toggle-slider {
    background: var(--accent); border-color: var(--accent);
}
.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px); background: #fff;
}

/* Color Picker */
.color-picker {
    display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 0;
}
.color-swatch {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer; transition: all .2s ease;
    position: relative;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-primary);
}
.color-swatch.active::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff;
}

/* Topics Grid */
#topics-grid {
    display: flex; flex-wrap: wrap; gap: 8px;
}

.topic-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 500;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.topic-chip.active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-color: var(--accent);
    color: var(--accent);
}
.topic-chip:hover:not(.active) {
    border-color: var(--text-muted);
}
.topic-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    background: none; border: none; padding: 0;
    cursor: pointer; color: var(--text-muted);
    opacity: 0; transition: opacity .15s ease;
    flex-shrink: 0;
}
.topic-chip:hover .topic-del { opacity: 0.7; }
.topic-del:hover { opacity: 1 !important; color: #e05555; }
.topic-del svg { pointer-events: none; }

/* Inline premium gate for Themen ergänzen */
.premium-gate-overlay-inline {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 10px;
    font-size: 13px; color: var(--text-secondary);
}
.premium-gate-overlay-inline span { flex: 1; }
.premium-gate-btn-inline {
    background: var(--accent); color: #fff;
    border: none; border-radius: 8px;
    padding: 6px 12px; font-size: 12px; font-weight: 600;
    cursor: pointer;
}

/* Keyword Input */
#keyword-input-wrap {
    display: flex; gap: 8px; margin-bottom: 12px;
}
#keyword-input {
    flex: 1; padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 10px; color: var(--text-primary);
    font-size: 14px; outline: none;
    transition: border-color var(--transition);
}
#keyword-input:focus { border-color: var(--accent); }
#keyword-input::placeholder { color: var(--text-muted); }

#keyword-add {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--accent); border: none;
    color: #fff; font-size: 20px; font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
#keyword-add:hover { background: var(--accent-dark); }

#keywords-list {
    display: flex; flex-wrap: wrap; gap: 8px;
}

.keyword-tag {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px 5px 12px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid var(--accent);
    border-radius: 16px;
    font-size: 12px; color: var(--accent); font-weight: 500;
}
.keyword-remove {
    background: none; border: none;
    color: var(--accent); cursor: pointer;
    font-size: 14px; font-weight: 700;
    padding: 0 2px; line-height: 1;
    opacity: .7;
}
.keyword-remove:hover { opacity: 1; }

/* Archive List in Settings */
.archive-list {
    display: flex; flex-direction: column; gap: 8px;
}
.archive-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color var(--transition);
}
.archive-item:hover { border-color: var(--accent); }
.archive-item-text {
    flex: 1; min-width: 0;
}
.archive-item-cat {
    font-size: 10px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 2px;
}
.archive-item-title {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.archive-remove {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: 4px;
    transition: color .2s;
}
.archive-remove:hover { color: var(--danger); }
.archive-empty {
    font-size: 13px; color: var(--text-muted); font-style: italic;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 768px) {
    .pulse-card-inner { max-width: 520px; }
    .pulse-headline { font-size: 26px; }
    .pulse-summary { max-width: 100%; }
    .detail-hero-headline { font-size: 38px; }
    #detail-content { padding: 32px 40px 60px; max-width: 720px; margin: 0 auto; }
}

@media (max-width: 480px) {
    .pulse-card-inner { padding: 20px 18px 18px; }
    .pulse-headline { font-size: 20px; }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ========== SWIPE HINT ========== */
.swipe-hint {
    position: absolute; bottom: 16px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    animation: bounceUp 2s ease-in-out infinite;
    color: var(--text-muted);
    font-size: 11px;
    pointer-events: none;
}

@keyframes bounceUp {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: .5; }
    50% { transform: translateX(-50%) translateY(-8px); opacity: 1; }
}

/* ========== NOTIFICATION TOAST ========== */
.notif-toast {
    position: fixed; bottom: 80px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--text-primary);
    z-index: 500;
    opacity: 0;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
    white-space: nowrap;
}
.notif-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== NEWS-CHECK ========== */

#newscheck-view {
    position: fixed; top: 56px; bottom: 100px; left: 0; right: 0;
    z-index: 50;
    background: var(--bg-primary);
    overflow: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
#newscheck-view.view-visible {
    visibility: visible; pointer-events: all; opacity: 1;
}

#newscheck-scroll {
    height: 100%; overflow-y: auto;
    padding: 20px 16px 28px;
    display: flex; flex-direction: column; gap: 14px;
    scrollbar-width: thin;
}

/* Card base */
.nc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 18px;
}

/* Input card */
.nc-card-header {
    display: flex; align-items: center; gap: 9px;
    font-size: 17px; font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.nc-desc {
    font-size: 13px; color: var(--text-secondary);
    margin-bottom: 14px; line-height: 1.5;
}

.nc-textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    padding: 12px 14px;
    resize: none;
    outline: none;
    transition: border-color .2s;
    line-height: 1.5;
}
.nc-textarea:focus { border-color: var(--accent); }

.nc-actions {
    display: flex; align-items: center; gap: 10px;
    margin-top: 12px;
}

.nc-btn-secondary {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    white-space: nowrap;
}
.nc-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.nc-btn-primary {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px;
    border: none; border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}
.nc-btn-primary:active { opacity: .85; transform: scale(.98); }

/* Photo preview */
.nc-photo-thumb {
    position: relative; display: inline-block;
    margin-top: 12px;
}
.nc-photo-thumb img {
    width: 80px; height: 80px;
    object-fit: cover; border-radius: 10px;
    border: 1px solid var(--border);
    display: block;
}
.nc-photo-remove {
    position: absolute; top: -6px; right: -6px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* Loading */
.nc-loading {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.nc-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ncSpin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes ncSpin { to { transform: rotate(360deg); } }

/* Gauge card */
/* Divider between input and result inside unified card */
.nc-result-divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 4px 0 12px;
}

.nc-gauge-wrap {
    display: flex; justify-content: center;
    width: 100%;
}

/* AI result block */
.nc-ai-result-block {
    display: flex; flex-direction: column; gap: 8px;
}
.nc-ai-pct-row {
    display: flex; justify-content: space-between; align-items: center;
}

.nc-ai-criteria {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.nc-ai-criterion {
    display: flex; flex-direction: column; gap: 3px;
}
.nc-ai-crit-header {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.nc-ai-crit-label {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.nc-ai-crit-tag {
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 20px; border: 1px solid;
    white-space: nowrap; flex-shrink: 0;
}
.nc-ai-crit-hint {
    font-size: 12px; color: var(--text-secondary); line-height: 1.45;
}

.nc-verdict-badge {
    font-size: 18px; font-weight: 700; letter-spacing: .3px;
    padding: 6px 18px;
    border: 1.5px solid;
    border-radius: 20px;
    background: transparent;
}

.nc-score-label {
    font-size: 13px; color: var(--text-secondary);
}
.nc-score-label strong { color: var(--text-primary); }

.nc-sources-row {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center;
    margin-top: 4px;
}

.nc-chip {
    font-size: 11px; font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    white-space: nowrap;
}
.nc-chip-news        { border-color: var(--accent)44; color: var(--accent); background: var(--accent)12; }
.nc-chip-institution { border-color: #5ba8e044; color: #5ba8e0; background: #5ba8e012; }
.nc-chip-scientific  { border-color: #8b5ae044; color: #8b5ae0; background: #8b5ae012; }
.nc-chip-data        { border-color: #7bc86c44; color: #7bc86c; background: #7bc86c12; }

.nc-analysis-inner {
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 10px;
}

/* AI detection */
.nc-ai-row {
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.nc-ai-header {
    display: flex; align-items: center; gap: 7px;
}
.nc-ai-label {
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    flex: 1;
}
.nc-ai-badge {
    font-size: 11px; font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid;
    white-space: nowrap;
}
.nc-ai-bar-track {
    height: 4px; border-radius: 4px;
    background: var(--bg-elevated);
    overflow: hidden;
}
.nc-ai-bar-fill {
    height: 100%; border-radius: 4px;
    transition: width 1s cubic-bezier(.4,0,.2,1);
}

.nc-fact-row {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; line-height: 1.5;
    color: var(--text-secondary);
}
.nc-fact-support svg { color: #5bc0a0; }
.nc-fact-contra  svg { color: #e05555; }
.nc-fact-support { color: var(--text-primary); }

.nc-disclaimer {
    font-size: 11px; color: var(--text-muted);
    margin-top: 6px; line-height: 1.5;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ========== DEVELOPER MODE ========== */
.settings-section-dev {
    border-top: 1px dashed var(--border);
    padding: 20px 20px 0 20px;
    margin-top: 8px;
}
.dev-section-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}
.toggle input:checked + .toggle-slider-dev {
    background: var(--accent) !important; border-color: var(--accent) !important;
}

/* Dev code prompt */
#dev-code-prompt {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.dev-code-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.6);
}
.dev-code-box {
    position: relative; z-index: 1;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 24px 20px; width: 280px;
}
.dev-code-title {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 14px; text-align: center;
}
.dev-code-input {
    width: 100%; background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 12px; font-size: 14px;
    color: var(--text-primary); outline: none; box-sizing: border-box;
}
.dev-code-input:focus { border-color: var(--accent); }
.dev-code-error {
    font-size: 12px; color: #e05555; text-align: center; margin-top: 8px;
}
.dev-code-btns {
    display: flex; gap: 8px; margin-top: 16px;
}
.dev-code-btn-cancel, .dev-code-btn-confirm {
    flex: 1; padding: 10px; border-radius: 10px; font-size: 14px;
    font-weight: 600; cursor: pointer; border: none;
    transition: opacity 0.15s;
}
.dev-code-btn-cancel {
    background: var(--bg-secondary); color: var(--text-secondary);
}
.dev-code-btn-confirm {
    background: var(--accent); color: #fff;
}
.dev-code-btn-cancel:hover, .dev-code-btn-confirm:hover { opacity: 0.85; }

/* ========== PREMIUM GATE ========== */
.premium-gate {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.premium-gate-blur {
    pointer-events: none;
}
.premium-gate-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.premium-gate-overlay span {
    font-size: 13px; color: var(--text-secondary); font-weight: 600;
}
.premium-gate-btn {
    background: var(--accent); color: #fff;
    border: none; border-radius: 20px;
    padding: 8px 20px; font-size: 13px; font-weight: 700;
    cursor: pointer; margin-top: 2px;
    transition: opacity .15s;
}
.premium-gate-btn:active { opacity: 0.8; }

/* ========== PAYWALL MODAL ========== */
#paywall-modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: flex-end; justify-content: center;
}
#paywall-modal.hidden { display: none; }
#paywall-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65);
}
#paywall-content {
    position: relative; z-index: 1;
    background: var(--bg-card);
    border-radius: 24px 24px 0 0;
    padding: 28px 24px 40px;
    width: 100%; max-width: 480px;
    display: flex; flex-direction: column; align-items: center;
    gap: 10px;
}
#paywall-close {
    position: absolute; top: 16px; right: 16px;
    background: var(--bg-elevated); border: none;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); cursor: pointer;
}
.paywall-icon {
    width: 60px; height: 60px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 4px;
}
.paywall-title {
    font-size: 22px; font-weight: 800; color: var(--text-primary);
    margin: 0;
}
.paywall-feature-highlight {
    font-size: 13px; color: var(--accent); font-weight: 600;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    padding: 4px 12px; border-radius: 20px;
    min-height: 22px;
}
.paywall-features {
    list-style: none; padding: 0; margin: 4px 0;
    width: 100%;
}
.paywall-features li {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text-primary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.paywall-features li:last-child { border-bottom: none; }
.paywall-price {
    display: flex; align-items: baseline; gap: 4px;
    margin: 4px 0;
}
.paywall-amount {
    font-size: 32px; font-weight: 800; color: var(--text-primary);
}
.paywall-period {
    font-size: 15px; color: var(--text-secondary);
}
#paywall-cta {
    width: 100%;
    background: var(--accent); color: #fff;
    border: none; border-radius: 14px;
    padding: 15px; font-size: 16px; font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
#paywall-cta:active { opacity: 0.85; }
.paywall-note {
    font-size: 12px; color: var(--text-muted);
    margin: 0;
}
.notif-toast strong { color: var(--accent); }

/* ========== AUTH MODAL ========== */
#auth-modal {
    position: fixed; inset: 0; z-index: 210;
    display: flex; align-items: flex-end; justify-content: center;
}
#auth-modal.hidden { display: none; }
#auth-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65);
}
#auth-content {
    position: relative; z-index: 1;
    background: var(--bg-card);
    border-radius: 24px 24px 0 0;
    padding: 28px 24px 40px;
    width: 100%; max-width: 480px;
    display: flex; flex-direction: column; align-items: center;
    gap: 12px;
}
#auth-close {
    position: absolute; top: 16px; right: 16px;
    background: var(--bg-elevated); border: none;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); cursor: pointer;
}
.auth-logo {
    width: 60px; height: 60px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    display: flex; align-items: center; justify-content: center;
}
.auth-title {
    font-size: 22px; font-weight: 800; color: var(--text-primary);
    margin: 0;
}
.auth-subtitle {
    font-size: 13px; color: var(--text-secondary);
    text-align: center; margin: -4px 0 0;
    min-height: 16px;
}
.auth-fields {
    width: 100%; display: flex; flex-direction: column; gap: 10px;
}
.auth-fields input {
    width: 100%; padding: 13px 16px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px; font-family: inherit;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
.auth-fields input:focus { border-color: var(--accent); }
.auth-fields input::placeholder { color: var(--text-muted); }
.auth-error {
    font-size: 13px; color: var(--danger);
    min-height: 16px; margin: -4px 0 0; text-align: center;
}
.auth-submit-btn {
    width: 100%; background: var(--accent); color: #fff;
    border: none; border-radius: 14px;
    padding: 15px; font-size: 16px; font-weight: 700;
    cursor: pointer; transition: opacity .15s;
}
.auth-submit-btn:active { opacity: 0.85; }
.auth-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-toggle {
    font-size: 13px; color: var(--text-secondary);
    margin: -4px 0 0;
}
.auth-toggle a {
    color: var(--accent); cursor: pointer; font-weight: 600;
}
.auth-skip {
    background: none; border: none;
    font-size: 13px; color: var(--text-muted);
    cursor: pointer; text-decoration: underline;
    padding: 0; margin-top: -4px;
}

/* ========== ACCOUNT SECTION IN SETTINGS ========== */
.account-guest { display: flex; flex-direction: column; gap: 12px; }
.account-info {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: var(--bg-secondary);
    border-radius: 12px; margin-bottom: 10px;
}
.account-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent); font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.account-email { font-size: 14px; color: var(--text-primary); font-weight: 600; }
.account-status {
    font-size: 12px; font-weight: 700; margin-top: 2px;
}
.status-premium { color: var(--accent); }
.status-free { color: var(--text-muted); }
.account-btn {
    width: 100%; padding: 11px 16px;
    border-radius: 12px; font-size: 14px; font-weight: 600;
    cursor: pointer; border: none; margin-bottom: 8px;
    transition: opacity .15s;
}
.account-btn:active { opacity: 0.8; }
.account-btn-primary { background: var(--accent); color: #fff; }
.account-btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ========== LEGAL LINKS ========== */
.legal-links {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.legal-links a {
    font-size: 13px; color: var(--text-secondary);
    text-decoration: none;
}
.legal-links a:hover { color: var(--accent); }
.legal-links span { color: var(--text-muted); font-size: 12px; }

/* ========== ONBOARDING ========== */
#onboarding-screen {
    position: fixed; inset: 0; z-index: 300;
    background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .4s ease;
}
#onboarding-screen.hidden { display: none; }
#onboarding-screen.visible { opacity: 1; }
#onboarding-screen.ob-slide-out .ob-content { opacity: 0; transform: translateX(-30px); transition: opacity .2s, transform .2s; }
#onboarding-screen.ob-slide-in .ob-content { animation: obSlideIn .3s ease forwards; }
@keyframes obSlideIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
.ob-content {
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 32px 50px;
    max-width: 400px; width: 100%;
    text-align: center; gap: 16px;
    position: relative;
}
.ob-skip {
    position: absolute; top: 0; right: 0;
    background: none; border: none;
    font-size: 14px; color: var(--text-muted);
    cursor: pointer; padding: 4px 0;
}
.ob-icon {
    width: 100px; height: 100px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 8px;
}
.ob-title {
    font-size: 24px; font-weight: 800;
    color: var(--text-primary); margin: 0;
}
.ob-desc {
    font-size: 15px; color: var(--text-secondary);
    line-height: 1.6; margin: 0;
}
.ob-dots {
    display: flex; gap: 8px; align-items: center;
    margin: 4px 0;
}
.ob-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border); transition: all .3s;
}
.ob-dot.active {
    background: var(--accent);
    width: 24px; border-radius: 4px;
}
.ob-next {
    width: 100%; background: var(--accent); color: #fff;
    border: none; border-radius: 14px;
    padding: 15px; font-size: 16px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 6px;
    margin-top: 8px; transition: opacity .15s;
}
.ob-next:active { opacity: 0.85; }

/* ========== KI-KENNZEICHNUNG ========== */
.ki-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    text-transform: uppercase;
    opacity: 0.7;
}
.ki-badge svg { flex-shrink: 0; }
.ki-facts-label {
    display: flex; align-items: center; justify-content: flex-end;
    margin-bottom: 8px;
}
.detail-facts-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.detail-facts-title {
    font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
    text-transform: uppercase; color: var(--text-muted);
}

/* ========== OFFLINE BANNER ========== */
#offline-banner {
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px; z-index: 500;
    background: #2a1a1a;
    border-bottom: 1px solid #e0555540;
    color: #e05555;
    font-size: 12px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 7px;
}
#offline-banner.hidden { display: none; }
