:root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --important: #f85149;
    --sweden: #fecc00;
    --us: #3b82f6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.back-link:hover {
    color: var(--text);
    background: var(--border);
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f85149;
}

.status-dot.online {
    background: #3fb950;
}

/* Ticker */
.ticker {
    background: #0d1117;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    height: 2.2rem;
    line-height: 2.2rem;
}

.ticker-content {
    white-space: nowrap;
    will-change: transform;
    display: block;
    height: 2.2rem;
    line-height: 2.2rem;
}

.ticker-item {
    font-size: 0.8rem;
    white-space: nowrap;
    display: inline;
    line-height: 2.2rem;
}

.ticker-name {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticker-price {
    color: var(--text);
    font-weight: 500;
}

.ticker-change {
    font-weight: 600;
    font-size: 0.75rem;
}

.ticker-change.up {
    color: #3fb950;
}

.ticker-change.down {
    color: #f85149;
}

.filters {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filters a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.filters a:hover {
    color: var(--text);
    background: var(--border);
}

.filters a.active {
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}

.divider {
    color: var(--border);
}

.refresh-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: auto;
}

.refresh-btn:hover {
    opacity: 0.9;
}

.refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.news-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.news-item:hover {
    border-color: var(--text-muted);
}

.news-item.important {
    border-left: 3px solid var(--important);
}

.news-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.source {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.region {
    font-size: 0.625rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

.region-sweden {
    background: var(--sweden);
    color: #000;
}

.region-us {
    background: var(--us);
    color: #fff;
}

.badge {
    font-size: 0.625rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

.important-badge {
    background: var(--important);
    color: #fff;
}

.news-item h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.news-item h2 a {
    color: var(--text);
    text-decoration: none;
}

.news-item h2 a:hover {
    color: var(--accent);
}

.reason {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
}

time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.no-news {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 600px) {
    header, .filters {
        padding: 1rem;
    }

    main {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.25rem;
    }
}
