:root {
    color-scheme: dark;
    --bg: #0f1115;
    --bg-elev: #161a22;
    --border: #222;
    --border-soft: #1e222b;
    --fg: #e6e6e6;
    --fg-dim: #b8bcc4;
    --fg-mute: #8a8f98;
    --accent: #7dd3fc;
    --accent-2: #a7f3d0;
    --tab-bar: #0b0d12;
    --tab-active: #7dd3fc;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    padding-bottom: calc(64px + var(--safe-bottom));
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(10px + var(--safe-top)) 16px 10px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
}
.brand {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}
.search { flex: 1; }
.search input {
    width: 100%;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid #333;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 16px;
    min-height: 44px;
}

main {
    max-width: 880px;
    margin: 0 auto;
    padding: 18px 16px;
}
h1 {
    font-size: 20px;
    margin: 0 0 14px;
    color: var(--fg);
}

ul.articles { list-style: none; padding: 0; margin: 0; }
li.article {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
}
.title {
    display: block;
    color: var(--fg);
    text-decoration: none;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.35;
    min-height: 44px;
}
a.title:active { color: var(--accent); }
.meta {
    font-size: 12px;
    color: var(--fg-mute);
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.meta a.source { color: var(--accent-2); text-decoration: none; }
.category {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #1e2430;
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.category[data-cat="hackernews"] { background: #3a1e0b; color: #ff9a5a; }
.category[data-cat="cybersec"]   { background: #1d2b1f; color: #8fe3a6; }
.category[data-cat="tech"]       { background: #1a2130; color: #9bc8ff; }
.summary {
    margin: 8px 0 0;
    color: var(--fg-dim);
    font-size: 14.5px;
}
.pagination {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    color: var(--fg-mute);
}
.pagination a {
    color: var(--accent);
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
}
.empty { color: var(--fg-mute); padding: 20px 0; }

/* Bottom tab bar */
.tabs {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: var(--tab-bar);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-bottom);
    z-index: 20;
}
.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    color: var(--fg-mute);
    text-decoration: none;
    font-size: 11px;
    min-height: 56px;
}
.tab[aria-current="page"] { color: var(--tab-active); }
.tab-icon { font-size: 20px; line-height: 1; }
.tab-label { font-weight: 600; letter-spacing: 0.02em; }

@media (min-width: 720px) {
    main { padding: 24px 20px; }
    .tabs { max-width: 880px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
