:root {
    /* Paul Rand inspired palette - Aspen poster */
    --rand-coral: #E25B4E;
    --rand-coral-hover: #C94D42;
    --rand-charcoal: #3D3D3D;
    --rand-black: #1A1A1A;

    /* Base colors */
    --text-primary: #2A2A2A;
    --text-secondary: #4A4A4A;
    --text-muted: #6A6A6A;
    --bg-primary: #FFFEF9;
    --bg-secondary: #FAF9F4;
    --bg-tertiary: #F3F1EA;
    --bg-outer: #F3F1EA;
    --border-light: #E8E5DC;
    --border-medium: #D8D4C9;

    /* No shadows in Paul Rand style */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;

    /* Sharp or full pill - nothing in between */
    --radius-none: 0;
    --radius-pill: 50px;
}

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

html {
    background: var(--rand-coral);
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--rand-coral);
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    margin-top: env(safe-area-inset-top);
    background-color: var(--bg-secondary);
    min-height: calc(100vh - env(safe-area-inset-top));
    position: relative;
}

header {
    background: var(--rand-coral);
    color: #ededeb;
    text-align: center;
    padding: 28px 24px;
    padding-top: calc(28px + env(safe-area-inset-top));
    margin-top: calc(-1 * env(safe-area-inset-top));
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.03) 50%, transparent 51%);
    background-size: 20px 20px;
    pointer-events: none;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.logo {
    height: 64px;
    width: auto;
    margin-bottom: 2px;
}


header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
}

.header-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 4px;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 4px;
}

.header-icon:hover {
    color: rgba(255, 255, 255, 1);
}

.header-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.header-icon.refreshing svg {
    animation: spin 1s linear infinite;
}

.settings-icon:hover {
    color: rgba(255, 255, 255, 1);
}

.settings-icon svg {
    width: 22px;
    height: 22px;
}

.subtle-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.subtle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-icon {
    width: 12px;
    height: 12px;
    stroke-width: 2;
    vertical-align: middle;
}

.pull-icon {
    width: 13px;
    height: 13px;
    stroke-width: 2;
}

.subtle-btn.refreshing {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ededeb;
}

.subtle-btn.refreshing .btn-icon {
    animation: spin 1s linear infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

main {
    padding: 0;
    margin-top: 0;
}

.sites-list {
    margin-top: 0;
}

main#mainApp {
    position: relative;
    overflow: hidden;
}

.pull-to-refresh {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    z-index: 1;
}

.refresh-indicator {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.refresh-indicator svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.pull-to-refresh.refreshing .refresh-indicator svg {
    animation: spin 0.8s linear infinite;
}


.settings-section {
    background: var(--bg-primary);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
    position: relative;
}

.settings-section:first-child {
    border-top: 1px solid var(--border-light);
}

.settings-section h2 {
    margin-bottom: 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-description {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 14px 0;
    line-height: 1.5;
}

.bookmarklet-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #ededeb;
    color: var(--text-primary);
    border: 2px dashed #bbb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: grab;
    transition: background 0.15s ease;
}

.bookmarklet-btn:hover {
    background: var(--bg-tertiary);
}

.bookmarklet-btn i,
.bookmarklet-btn svg {
    width: 15px !important;
    height: 15px !important;
    stroke-width: 2;
}

.login-form {
    background: var(--bg-primary);
    padding: 40px 32px;
    border-radius: var(--radius-none);
    max-width: 420px;
    margin: 60px auto;
    text-align: center;
}

.login-form h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-fields {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.login-fields input {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid var(--text-primary);
    border-radius: var(--radius-none);
    font-size: 14px;
    transition: border-color 0.15s ease;
    background: var(--bg-primary);
}

.login-fields input:focus {
    outline: none;
    border-color: var(--rand-coral);
}

.login-fields button {
    padding: 12px 24px;
    background: var(--rand-coral);
    color: #ededeb;
    border: none;
    border-radius: var(--radius-none);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s ease;
}

.login-fields button:hover {
    background: var(--rand-coral-hover);
}

.login-fields button:active {
    transform: translateY(0);
}

.controls {
    background: #ededeb;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.add-site {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.add-site input {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    border: 2px solid var(--text-primary);
    border-radius: var(--radius-none);
    font-size: 14px;
    transition: border-color 0.15s ease;
    background: var(--bg-primary);
}

.add-site input:focus {
    outline: none;
    border-color: var(--rand-coral);
}

.add-site button {
    padding: 12px 20px;
    background: var(--rand-coral);
    color: #ededeb;
    border: none;
    border-radius: var(--radius-none);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s ease;
}

.add-site button:hover {
    background: var(--rand-coral-hover);
}

.import-export-section {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.import-section,
.export-section {
    display: flex;
    gap: 8px;
}

.import-section button,
.export-section button {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

.import-section button:hover,
.export-section button:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}


.sites-list {
    background: var(--bg-primary);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.site-wrapper {
    border-bottom: 1px solid var(--border-light);
    contain: layout style;
    content-visibility: auto;
    contain-intrinsic-size: 0 72px;
}

.site-wrapper:last-child {
    border-bottom: none;
}

.site-item {
    display: flex;
    align-items: center;
    padding: 0;
    gap: 0;
    transition: background-color 0.2s ease;
}

.site-item:hover {
    background-color: var(--bg-secondary);
}

.site-main {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    padding-right: 0;
    gap: 14px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

.site-expand-btn {
    padding: 0 24px;
    min-width: 60px;
    background: var(--bg-primary);
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color 0.15s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

@media (hover: hover) {
    .site-expand-btn:hover {
        color: var(--rand-coral);
    }
}

.site-expand-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.site-wrapper.expanded .site-expand-btn svg {
    transform: rotate(180deg);
}

.site-items-panel {
    max-height: 0;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: max-height 0.25s ease;
}

.site-wrapper.expanded .site-items-panel {
    max-height: 500px;
    border-top: 1px solid var(--border-light);
}

.panel-loading,
.panel-empty {
    padding: 16px 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.panel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.15s ease;
}

.panel-item:last-child {
    border-bottom: none;
}

.panel-item:hover {
    background: var(--bg-tertiary);
}

.panel-item-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-item-time {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Swipe to mute */
.site-swipe-container {
    position: relative;
    overflow: hidden;
}

.site-mute-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 180px;
    display: none;
    align-items: stretch;
    z-index: 0;
}

/* Only show mute actions on touch devices */
@media (hover: none) and (pointer: coarse) {
    .site-mute-actions {
        display: flex;
    }
}

.mute-btn {
    flex: 1;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: white;
    transition: opacity 0.15s ease;
}

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

.mute-1day {
    background: #f59e0b;
}

.mute-1week {
    background: #f97316;
}

.mute-1month {
    background: #ef4444;
}

.unmute-btn {
    background: #22c55e;
}

/* Swipe to pin (left side) */
.site-pin-actions {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80px;
    display: none;
    align-items: stretch;
    z-index: 0;
}

/* Only show pin actions on touch devices */
@media (hover: none) and (pointer: coarse) {
    .site-pin-actions {
        display: flex;
    }
}

.pin-btn {
    flex: 1;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: white;
    transition: opacity 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

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

.pin-btn.pin {
    background: #3b82f6;
}

.pin-btn.unpin {
    background: #6b7280;
}

.pin-btn svg {
    width: 20px;
    height: 20px;
}

.pinned-section-header {
    padding: 12px 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.muted-section-header {
    padding: 12px 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

/* Pinned indicator */
.site-wrapper.is-pinned .site-info h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.site-item {
    position: relative;
    z-index: 2;
    background: var(--bg-primary);
}

.site-wrapper.is-muted .site-main {
    opacity: 0.5;
}

.site-wrapper.is-muted .site-expand-btn {
    opacity: 0.5;
}

.site-wrapper.is-muted .site-pin-actions {
    display: none;
}

.muted-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--text-tertiary);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

.site-favicon {
    flex-shrink: 0;
}

.site-favicon img {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 0;
    object-fit: cover;
}

.site-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 22px;
    line-height: 1;
}

.site-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-info h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
}

/* Main page - full clickable cards */
.clickable-card {
    color: inherit;
    text-decoration: none;
}

.clickable-card:hover {
    background-color: transparent;
}

.clickable-card:hover .site-info h3 {
    color: var(--rand-coral);
}

.clickable-card:visited {
    color: inherit;
}

.clickable-card .site-info h3 {
    color: var(--rand-charcoal);
    font-weight: 700;
}

/* Settings page - clickable content area */
.site-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    padding: 4px;
    margin: -4px;
    border-radius: 0;
}

.site-link:hover {
    background-color: transparent;
}

.site-link:visited {
    color: inherit;
}

.site-link .site-info h3 {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
}

.site-info p {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}

.clock-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.7;
    stroke-width: 2;
}

.site-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.site-item:hover .site-actions {
    opacity: 1;
}

.site-actions button {
    padding: 5px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-actions button i,
.site-actions button svg {
    width: 14px !important;
    height: 14px !important;
    stroke-width: 2;
}

.refresh-btn {
    color: rgba(5, 150, 105, 0.7);
}

.refresh-btn:hover {
    color: #047857;
    background: rgba(5, 150, 105, 0.1);
}

.edit-btn {
    color: var(--text-muted);
}

.edit-btn:hover {
    color: var(--rand-charcoal);
    background: rgba(61, 61, 61, 0.1);
}

.delete-btn {
    color: var(--text-muted);
}

.delete-btn:hover {
    color: var(--rand-coral);
    background: rgba(226, 91, 78, 0.1);
}

/* Settings page feed list */
.settings-site-item {
    padding: 10px 16px;
}

.settings-site-item:nth-child(odd) {
    background: var(--bg-secondary);
}

.settings-site-item:nth-child(even) {
    background: var(--bg-primary);
}

.settings-site-item .site-favicon img {
    width: 20px;
    height: 20px;
}

.settings-site-item .site-emoji {
    width: 20px;
    height: 20px;
    font-size: 16px;
}

.settings-site-item .site-info h3 {
    font-size: 0.95rem;
}

.settings-site-item .site-link {
    gap: 10px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

/* Enhanced Mobile Styles */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    header {
        width: 100%;
        margin-bottom: 0;
    }
    
    main {
        padding: 0 16px;
        margin-top: 0;
    }
    
    .logo {
        height: 55px;
    }
    
    .logo-link {
        display: inline-block;
    }
    
    .btn-icon {
        width: 15px;
        height: 15px;
    }
    
    header p {
        font-size: 1rem;
    }
    
        
    .subtle-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .login-form {
        margin: 30px auto;
        padding: 25px 20px;
    }
    
    .login-fields {
        flex-direction: column;
        gap: 15px;
    }
    
    .login-fields input,
    .login-fields button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    .add-site {
        flex-direction: column;
        gap: 15px;
    }
    
    .add-site input {
        min-width: auto;
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    .add-site button {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .import-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .import-section button,
    .export-section button {
        width: 100%;
        padding: 12px 20px;
        font-size: 12px;
    }
    
    .sites-list {
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
        margin: 0 -15px;
    }
    
.site-wrapper {
        background: var(--bg-primary);
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 0;
    }

    .site-wrapper:first-child {
        border-top: 1px solid var(--border-light);
    }

    .site-main {
        padding: 14px 16px;
        gap: 12px;
    }

    .site-expand-btn {
        padding: 0 16px;
        min-width: 60px;
    }

    .panel-item {
        padding: 12px 16px;
    }

    .site-favicon img {
        width: 32px;
        height: 32px;
    }

    .site-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .site-link {
        align-items: flex-start;
    }

    .site-info h3 {
        font-size: 1.1rem;
        line-height: 1.2;
    }

    .site-info p {
        font-size: 13px;
        margin-top: 0;
    }
    
    .clock-icon {
        width: 12px;
        height: 12px;
    }
    
    .site-actions {
        opacity: 1;
        gap: 2px;
    }

    .site-actions button {
        padding: 8px;
    }

    .site-actions button i,
    .site-actions button svg {
        width: 15px !important;
        height: 15px !important;
    }
    
    .settings-section {
        margin-bottom: 0;
        padding: 16px;
    }

    .settings-section h2 {
        font-size: 1.1rem;
        margin-bottom: 14px;
    }
}

/* Desktop enhancements */
@media (min-width: 769px) {
    body {
        background: var(--bg-outer);
        padding: 0;
    }
    
    .container {
        max-width: none;
        margin: 0;
        border-radius: 0;
        overflow: visible;
        border: none;
        background: transparent;
    }
    
    header {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        width: 100%;
        padding: 20px 24px;
    }

    main {
        max-width: 550px;
        margin: 0 auto;
        background: var(--bg-secondary);
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    
    .sites-list {
        border-radius: 0;
        box-shadow: none;
    }
    
    .subtle-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .logo {
        height: 72px;
    }

    /* Hide settings link in header on desktop - now in tab nav */
    #settingsLink {
        display: none;
    }
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    position: relative;
    z-index: 2;
    justify-content: space-around;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease;
    text-decoration: none;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--rand-coral);
}

.tab-btn svg {
    width: 22px;
    height: 22px;
}

.tab-btn span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Feed Items View */
.feed-list {
    background: var(--bg-primary);
    position: relative;
    z-index: 2;
}

.feed-item {
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    color: inherit;
    contain: layout style;
    content-visibility: auto;
    contain-intrinsic-size: 0 100px;
}

.feed-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.feed-item-link:hover .feed-item-title {
    color: var(--rand-coral);
}

.feed-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.feed-item-favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 0;
}

.feed-item-emoji {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.feed-item-source {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.feed-item-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.feed-item-title {
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--rand-charcoal);
    line-height: 1.3;
    margin: 0;
    transition: color 0.15s ease;
}

.feed-item-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Feed Item Content (full HTML content) */
.feed-item-content {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 10px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.feed-item-content p {
    margin: 0 0 0.75em 0;
}

.feed-item-content p:last-child {
    margin-bottom: 0;
}

/* Headings - smaller than article title, clean hierarchy */
.feed-item-content h1 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rand-charcoal);
    margin: 1.25em 0 0.5em 0;
    line-height: 1.3;
}

.feed-item-content h2 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--rand-charcoal);
    margin: 1.1em 0 0.4em 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.feed-item-content h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1em 0 0.35em 0;
    line-height: 1.3;
}

.feed-item-content h4,
.feed-item-content h5,
.feed-item-content h6 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.9em 0 0.3em 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.feed-item-content h1:first-child,
.feed-item-content h2:first-child,
.feed-item-content h3:first-child,
.feed-item-content h4:first-child {
    margin-top: 0;
}

.feed-item-content a {
    color: var(--rand-coral);
    text-decoration: none;
}

.feed-item-content a:hover {
    text-decoration: underline;
}

.feed-item-content strong,
.feed-item-content b {
    color: var(--text-primary);
    font-weight: 600;
}

.feed-item-content em,
.feed-item-content i {
    font-style: italic;
}

.feed-item-content blockquote {
    margin: 0.75em 0;
    padding: 10px 14px;
    border-left: 3px solid var(--rand-coral);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.95em;
}

.feed-item-content blockquote p:last-child {
    margin-bottom: 0;
}

.feed-item-content pre,
.feed-item-content code {
    background: var(--bg-tertiary);
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    font-size: 0.85em;
}

.feed-item-content code {
    padding: 2px 6px;
    border: 1px solid var(--border-light);
}

.feed-item-content pre {
    padding: 12px 14px;
    overflow-x: auto;
    margin: 0.75em 0;
    border: 1px solid var(--border-light);
}

.feed-item-content pre code {
    padding: 0;
    background: none;
    border: none;
}

.feed-item-content ul,
.feed-item-content ol {
    margin: 0.5em 0 0.75em 0;
    padding-left: 1.25em;
}

.feed-item-content li {
    margin: 0.15em 0;
    padding-left: 0.25em;
}

.feed-item-content li::marker {
    color: var(--text-muted);
}

.feed-item-content hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 1em 0;
}

/* Images in feed content */
.feed-item-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.75em 0;
    display: block;
}

.feed-item-content figure {
    margin: 0.75em 0;
}

.feed-item-content figcaption {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 0.5em;
    text-align: center;
}

/* Videos and iframes in feed content */
.feed-item-content iframe,
.feed-item-content video {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 4px;
    margin: 1em 0;
    display: block;
    background: var(--bg-tertiary);
}

.feed-item-content video {
    object-fit: contain;
}

/* Tables in feed content */
.feed-item-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.9em;
}

.feed-item-content th,
.feed-item-content td {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    text-align: left;
}

.feed-item-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Mobile tab adjustments */
@media (max-width: 768px) {
    .tab-nav {
        display: none; /* Hide tab nav on mobile, replaced by bottom nav */
    }

    .feed-item {
        padding: 14px 16px;
    }

    .feed-item-title {
        font-size: 1.4rem;
    }

    .feed-item-source,
    .feed-item-time {
        font-size: 13px;
    }

    .feed-item-description {
        font-size: 15px;
    }

    .feed-list {
        margin: 0 -16px;
    }

    .feed-item-content {
        font-size: 15.5px;
        line-height: 1.5;
    }

    .feed-item-content iframe,
    .feed-item-content video {
        border-radius: 0;
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
        max-width: none;
    }

    .feed-item-content img {
        border-radius: 0;
    }

    /* Add bottom padding to content to account for bottom nav */
    .sites-list,
    .feed-list {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    /* Hide settings, refresh, and back icons in header on mobile */
    #settingsLink,
    #refreshBtn,
    .header-actions a[href="index.html"] {
        display: none;
    }

    /* Add bottom padding to settings sections for bottom nav */
    .settings-section:last-child {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }
}

/* Skip to Next Post Button */
.skip-post-btn {
    display: none;
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    z-index: 50;
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.skip-post-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
}

.skip-post-btn svg {
    width: 24px;
    height: 24px;
    color: var(--rand-charcoal);
    position: relative;
    z-index: 1;
}

.skip-post-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.35);
}

.skip-post-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .skip-post-btn.visible {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Image Viewer Overlay */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.image-viewer.active {
    opacity: 1;
    visibility: visible;
}

.image-viewer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    top: calc(16px + env(safe-area-inset-top));
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.image-viewer-close:active {
    background: rgba(255, 255, 255, 0.25);
}

.image-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
}

.image-viewer-hint {
    position: absolute;
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Bottom Navigation Bar */
.bottom-nav {
    display: none; /* Hidden by default (desktop) */
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-light);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        z-index: 100;
        justify-content: space-around;
        align-items: stretch;
        transition: transform 0.25s ease;
    }

    .bottom-nav.hidden {
        transform: translateY(100%);
    }

    .bottom-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 10px 8px;
        background: none;
        border: none;
        color: var(--text-muted);
        text-decoration: none;
        cursor: pointer;
        transition: color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-btn:hover,
    .bottom-nav-btn:active {
        color: var(--text-primary);
    }

    .bottom-nav-btn.active {
        color: var(--rand-coral);
    }

    .bottom-nav-btn svg {
        width: 24px;
        height: 24px;
    }

    .bottom-nav-btn span {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
}

