/* app.css — FeedReading stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400&display=swap');

/* --- CSS variables --- */
:root {
    --accent:         #1B7272;
    --accent-hover:   #155A5A;
    --text:           #1C1917;
    --muted:          #78716C;
    --border:         #E7E2DB;
    --surface:        #F0EBE3;
    --bg:             #FAFAF7;
    --white:          #FFFFFF;
    --green:          #2D6A4F;
    --green-hover:    #1B4332;
    --red:            #B91C1C;
    --red-hover:      #991B1B;
    --blue:           #2563eb;
    --radius:         6px;
    --font-ui:        'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-serif:     'Source Serif 4', Georgia, "Times New Roman", serif;
    --font-mono:      'JetBrains Mono', ui-monospace, "SFMono-Regular", Menlo, monospace;
    /* Component-level tokens that need dark overrides */
    --version-color:  #B8B0A8;
    --icon-dim-color: #D4CEC8;
}

/* ============================================================
   Dark mode
   ============================================================ */

[data-theme="dark"] {
    --accent:         #3AABAB;
    --accent-hover:   #2E8E8E;
    --text:           #EAE4DC;
    --muted:          #9C9490;
    --border:         #524E4A;
    --surface:        #363330;
    --bg:             #2D2A27;
    --white:          #403C39;
    --green:          #34D399;
    --green-hover:    #10B981;
    --red:            #F87171;
    --red-hover:      #EF4444;
    --version-color:  #7A7470;
    --icon-dim-color: #6A6460;
    color-scheme: dark;
}

/* --- Reset & base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Layout container --- */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Site header --- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header::before {
    content: '';
    display: block;
    height: 4px;
    background: var(--accent);
}

.header-logo {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-shrink: 0;
}

.header-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}

.site-logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
    flex-shrink: 0;
    font-style: italic;
}

.site-logo:hover {
    text-decoration: none;
    color: var(--accent);
}

.site-version {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--version-color);
    line-height: 1;
}

/* --- Navigation --- */
.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-left: auto;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
    padding: 0.15rem 0;
}

.site-nav a:hover {
    color: var(--text);
    text-decoration: none;
}

.site-nav a.active {
    color: var(--accent);
    text-decoration: none;
}

.nav-logout {
    margin-left: 0.25rem;
}

/* --- Feed URL bar --- */
.feed-url-bar {
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.feed-label {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.feed-url {
    color: var(--muted);
    font-family: monospace;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-url:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* --- Save form --- */
.save-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.25rem 0 1.5rem;
}

.save-form input[type="url"] {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.875rem;
    font-family: var(--font-ui);
    color: var(--text);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 0;
}

.save-form input[type="url"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(27, 114, 114, 0.12);
}

.loading-indicator {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

.save-error {
    font-size: 0.825rem;
    color: var(--red);
    padding: 0.3rem 0;
}

/* --- Main content --- */
main.container {
    padding-top: 2rem;
    padding-bottom: 5rem;
}

/* --- Page heading --- */
.page-heading-section {
    margin-bottom: 1.75rem;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
}

.page-subtitle {
    margin-top: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
}

/* --- List header --- */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.list-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: 0.775rem;
    font-family: var(--font-ui);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
    line-height: 1.4;
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    color: var(--text);
    text-decoration: none;
    background: transparent;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--white);
    border: none;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

.btn-settings {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.btn-outline {
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    font-weight: 500;
    font-size: 0.875rem;
    border: 1.5px solid var(--border);
    color: var(--text);
    background: transparent;
    transition: border-color 0.15s, color 0.15s;
}

.btn-outline:hover {
    border-color: var(--muted);
    color: var(--text);
    background: transparent;
}

.btn-danger {
    color: var(--red);
}

.btn-danger:hover {
    color: var(--red-hover);
    background: transparent;
}

/* --- Article list --- */
#article-list {
    margin-top: 0;
}

.article {
    padding: 0.85rem 0;
    margin-bottom: 0.5rem;
}

.article:last-child {
    border-bottom: none;
}

.article-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

/* --- Circular play button --- */
.play-btn {
    display: flex;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    font-size: 0.6rem;
    padding: 0;
    user-select: none;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.play-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg);
}

.play-btn.is-playing {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.play-icon {
    line-height: 1;
    display: flex;
    align-items: center;
    padding-left: 0.1rem; /* optical center for play triangle */
}

.play-btn.is-playing .play-icon {
    padding-left: 0;
}

/* Placeholder for articles with no audio yet */
.play-btn-placeholder {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Article content area --- */
.article-content {
    flex: 1;
    min-width: 0;
}

.article-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-title a {
    color: var(--text);
    text-decoration: none;
}

.article-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* --- Article meta (domain · date · duration · progress · archive) --- */
.article-meta {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--muted);
}

a.article-source {
    color: var(--muted);
    text-decoration: none;
    width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
a.article-source:hover {
    color: var(--accent);
    text-decoration: none;
}

.article-date {
    width: 4rem;
    flex-shrink: 0;
}

.article-duration {
    width: 3rem;
    flex-shrink: 0;
}

/* --- Article progress bar (inline, fills available space) --- */
.article-progress-wrap {
    flex: 1;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 0.2rem;
}

.article-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s linear;
}

/* --- Inline action icons in meta row --- */
.archive-btn,
.restore-btn,
.perm-delete-btn {
    color: var(--icon-dim-color);
    cursor: pointer;
    transition: color 0.15s;
    flex-shrink: 0;
    font-size: 0.72rem;
    line-height: 1;
}

.archive-btn:hover    { color: var(--muted); }
.restore-btn:hover    { color: var(--green); }
.perm-delete-btn:hover { color: var(--red); }

/* --- Mobile: stack article row --- */
@media (max-width: 600px) {
    .article-title {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}

/* --- Converting badge --- */
.converting-badge {
    font-size: 0.75rem;
    color: var(--muted);
    font-style: italic;
    font-family: var(--font-ui);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.converting-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: badge-pulse 1.6s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
    font-size: 0.925rem;
}

/* --- Settings panel --- */
.settings-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.settings-panel[hidden] {
    display: none;
}

.settings-inner {
    padding: 1.25rem 1.5rem;
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.settings-section {
    min-width: 160px;
}

.settings-heading {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.settings-subtext {
    font-size: 0.825rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.voice-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 360px;
}

.voice-item {
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.775rem;
    cursor: pointer;
    background: var(--bg);
    color: var(--muted);
    transition: all 0.15s;
    user-select: none;
}

.voice-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.voice-item--active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.voice-item--active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--white);
}

/* --- Toggle checkbox --- */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

/* --- Auth pages --- */
.auth-page {
    background: var(--surface);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5rem 1rem 2rem;
    min-height: 100vh;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.25rem 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo a {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 600;
    font-style: italic;
    color: var(--text);
    text-decoration: none;
}

.auth-logo a:hover {
    color: var(--accent);
    text-decoration: none;
}

.auth-title {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--muted);
}

.auth-error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: var(--red);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-ui);
    color: var(--text);
    background: var(--white);
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(27, 114, 114, 0.12);
}

.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

/* --- Article reader page --- */
.article-page {
    padding-top: 0;
}

.reader-bar {
    position: sticky;
    top: 67px;
    z-index: 90;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
}

.reader-bar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reader-back {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.825rem;
    flex-shrink: 0;
    transition: color 0.15s;
}

.reader-back:hover {
    color: var(--text);
    text-decoration: none;
}

.reader-bar-title {
    flex: 1;
    font-size: 0.825rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
    font-family: var(--font-serif);
    min-width: 0;
}

/* --- Reader audio player --- */
.reader-player {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.reader-play-btn {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.15s;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.reader-play-btn:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}

.reader-play-btn.is-playing {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.reader-progress-wrap {
    width: 120px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.reader-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s linear;
}

.reader-time {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.reader-orig-btn {
    color: var(--muted);
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: color 0.15s;
    text-decoration: none;
}

.reader-orig-btn:hover {
    color: var(--accent);
    text-decoration: none;
}

.reader-flag-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: .3rem .45rem;
    color: var(--muted);
    font-size: 0.8rem;
    border-radius: var(--radius);
    flex-shrink: 0;
    transition: color 0.15s;
    line-height: 1;
}
.reader-flag-btn:hover { color: var(--text); }
.reader-flag-btn.flagged { color: #dc2626; }

.star-btn { color: var(--muted); cursor: pointer; flex-shrink: 0; }
.star-btn:hover { color: #f59e0b; }
.star-btn--on { color: #f59e0b; }
.save-btn { color: var(--muted); cursor: pointer; flex-shrink: 0; }
.save-btn:hover { color: var(--accent); }
.save-btn--on { color: var(--accent); cursor: default; }

/* --- Article reader content --- */
.article-reader {
    max-width: 680px;
    padding-top: 2.5rem;
    padding-bottom: 5rem;
}

.yt-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: var(--radius);
    display: block;
    margin-bottom: 1.5rem;
}

.yt-watch-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.yt-watch-link:hover {
    border-color: #FF0000;
    color: #FF0000;
    text-decoration: none;
}

.article-reader-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 2rem;
    color: var(--text);
}

.article-body {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--text);
}

.article-body p {
    margin-bottom: 1.3em;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    margin: 2em 0 0.6em;
    color: var(--text);
}

.article-body h1 { font-size: 1.5rem; }
.article-body h2 { font-size: 1.3rem; }
.article-body h3 { font-size: 1.1rem; }

.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 1.5rem;
    margin: 1.5em 0;
    color: var(--muted);
    font-style: italic;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1.5em 0;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.3em;
}

.article-body li {
    margin-bottom: 0.4em;
}

.article-body pre,
.article-body code {
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 0.875rem;
}

.article-body pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.3em;
}

.article-body code {
    background: var(--surface);
    padding: 0.15em 0.35em;
    border-radius: 3px;
    font-size: 0.875em;
}

.article-body pre code {
    background: none;
    padding: 0;
}

.article-original-link {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--muted);
}

/* --- Stats page --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stats-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.25rem 1rem;
    text-align: center;
}

.stats-value {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.stats-label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.85rem;
}

.stats-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.stats-table th {
    text-align: left;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--surface);
    white-space: nowrap;
}

.stats-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table tr:hover td {
    background: var(--surface);
}

.stats-title-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-date {
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.8rem;
}

.stats-progress-wrap {
    width: 60px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.stats-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}


.status-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: #D1FAE5;
    color: #065F46;
}

.status-archived {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
}


/* --- Subscriptions page --- */
.page-heading {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 1.75rem 0 0.35rem;
}

.page-subtext {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

/* --- Responsive: mobile --- */
@media (max-width: 600px) {
    .container {
        padding: 0 1.25rem;
    }

    .header-top {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .site-nav {
        gap: 1.1rem;
        flex-wrap: wrap;
    }

    .feed-url {
        font-size: 0.75rem;
    }

    .save-form {
        flex-wrap: wrap;
    }

    .save-form input[type="url"] {
        width: 100%;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .settings-inner {
        flex-direction: column;
        gap: 1.25rem;
    }

    .article-reader {
        padding-top: 1.5rem;
    }

    .article-reader-title {
        font-size: 1.5rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .reader-progress-wrap {
        width: 70px;
    }

    .reader-bar-title {
        display: none;
    }

}

/* ============================================================
   Dark mode component overrides (hardcoded colors)
   ============================================================ */

[data-theme="dark"] .auth-error {
    background: #3D2020;
    border-color: #7A3030;
}

[data-theme="dark"] .auth-page {
    background: var(--surface);
}

[data-theme="dark"] .auth-card {
    background: var(--white);
}

[data-theme="dark"] .status-active {
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
}

[data-theme="dark"] .stats-card {
    background: var(--surface);
}

[data-theme="dark"] .settings-panel {
    background: var(--surface);
}

[data-theme="dark"] .site-header {
    background: var(--bg);
}
