.app {
    --bg: #f6f7fb;
    --card: #ffffff;
    --view-all: rgba(255, 255, 255, 0.3);
    --text: #0f1720;
    --muted: #6b7280;
    --accent: #e11d48;
    --header-blur: rgba(255,255,255,0.65);
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    min-height: 100vh;
    /*background: linear-gradient(180deg,var(--bg), #eef2f7);*/
    background: var(--bg);
}
#theme-toggle:checked ~ .app {
    /*--bg: #071022;*/
    --bg: #1a222c;
    --card: #0b1220;
    --view-all: rgba(11, 18, 32, 0.3);
    --text: #e6eef8;
    --muted: #98a3b3;
    --accent: #f43f5e;
    --header-blur: rgba(6,10,18,0.6);
    color-scheme: dark;
}
* { 
    box-sizing: border-box; 
}
body,html { 
    margin:0; 
    padding:0; 
    height:100%; 
}
.wrap { 
    max-width:1100px; 
    margin:0 auto; 
    padding:0 16px; 
}
#theme-toggle { 
    position: absolute; 
    left:-9999px; 
}
header {
    position: sticky; top:0; z-index:50;
    backdrop-filter: blur(8px);
    background: linear-gradient(180deg,var(--header-blur), transparent);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
header .header-inner { 
    display:flex; 
    align-items:center; 
    justify-content:space-between; 
    gap:16px; 
    padding:12px 12px; 
}
.brand { 
    display:flex; 
    align-items:center; 
    gap:12px; 
    text-decoration:none; 
    color:inherit; 
    cursor:pointer;
}
.brand:focus-visible { 
    outline:2px solid rgba(37,99,235,0.45); 
    outline-offset:3px; 
    border-radius:8px; 
}
.logo { width:44px; 
    height:44px;
    display:inline-grid; 
    place-items:center; 
    border-radius:10px; 
    background:linear-gradient(135deg,var(--accent), #ff7aa2); 
    color:white; 
    font-weight:700; 
}
.brand .title { 
    font-size:18px; 
    font-weight:700; 
    color:var(--text); 
}
.brand .subtitle { 
    display:block; 
    font-size:12px; 
    color:var(--muted); 
    margin-top:2px; 
}
.actions { 
    display:flex; 
    gap:10px; 
    align-items:center; 
}
.btn { 
    display:inline-flex; 
    align-items:center; 
    gap:8px; 
    padding:8px 12px; 
    border-radius:10px; 
    background:var(--card); 
    border:1px solid rgba(0,0,0,0.06); 
    box-shadow:0 1px 0 rgba(255,255,255,0.03) inset; 
    color:var(--text); 
    font-weight:600; 
    cursor:pointer; 
    text-decoration:none; 
    white-space:nowrap; 
}
@media (max-width:420px) {
    .btn { padding:7px 10px; font-size:14px; }
}
.btn.primary { 
    background: linear-gradient(90deg,var(--accent), #ff7aa2); 
    color:white; 
    border:0; 
}
.theme-toggle { 
    width:44px; 
    height:44px; 
    display:inline-grid; 
    place-items:center; 
    border-radius:10px; 
    background:var(--card); 
    cursor:pointer; 
    border:1px solid rgba(0,0,0,0.06); 
    transition: background-color .18s ease, color .18s ease; 
    background-color: rgba(255, 204, 133, 0.24); 
    color: #e5780b; 
}
.theme-toggle svg { 
    width:20px; 
    height:20px; 
    display:block; 
}
.theme-toggle .icon-sun, .theme-toggle svg.icon-sun { 
    display:inline-block; 
}
.theme-toggle .icon-moon, .theme-toggle svg.icon-moon { 
    display:none; 
}
#theme-toggle:checked ~ .app .theme-toggle .icon-sun { 
    display:none; 
}
#theme-toggle:checked ~ .app .theme-toggle .icon-moon { 
    display:inline-block; 
}
main { 
    padding:18px 0 60px; 
}
h1.page-title { 
    margin:8px 0 18px; 
    font-size:20px; 
    color:var(--text); 
}
.section { 
    margin:18px 0; 
}
.section h2 { 
    margin:0 0 12px; 
    font-size:16px; 
    color:var(--text); 
}
.grid {
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap:12px;
}
.card {
    background:var(--card);
    border-radius:12px;
    padding:12px;
    min-height:120px;
    display:flex; flex-direction:column; gap:8px;
    box-shadow: 0 6px 18px rgba(2,6,23,0.04);
    border:1px solid rgba(0,0,0,0.04);
    color:var(--text);
    text-decoration:none;
    overflow: hidden;
}
.card .thumb { 
    width:100%; 
    /*height:72px;*/ 
    border-radius:8px; 
    background:linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.02)); 
    display:block; 
}
.card .name { 
    font-weight:700; 
    font-size:14px; 
}
.card .meta { 
    font-size:12px; 
    color:var(--muted); 
}
.card .delta { 
    font-size:12px; 
    white-space: nowrap;
}
.delta.green {
    color: green;
}
.delta.red {
    color: red;
}
.delta.gray {
    color: gray;
}
.card.view-all { 
    display:flex; 
    align-items:center; 
    justify-content:center; 
    text-align:center; 
    font-weight:700; 
    color:var(--accent); 
    border:2px dashed rgba(0,0,0,0.06); 
    background: var(--view-all);
}
footer { 
    padding:20px 0; 
    border-top:1px solid rgba(0,0,0,0.04); 
    color:var(--muted); 
    font-size:14px; 
    text-align: center;
}
@media (max-width:520px) {
    .brand .title { 
        font-size:16px; 
    }
    .logo { 
        width:40px; 
        height:40px; 
    }
    .grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
}
.theme-toggle svg * { 
    stroke: currentColor; 
    fill: currentColor; 
}
#theme-toggle:checked ~ .app .theme-toggle { 
    background-color: rgba(56, 116, 255, 0.24); 
    color: #85a9ff; 
}
.chat-logo {
    background: radial-gradient(224.66% 112.22% at 34.26% 3.7%, #ff48b6, #ff8a35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 30px;
    line-height: 40px;
    width: 96px;
    height: 96px;
    margin: 0 auto;
    color: white;
}
.load-more {
    display:flex; 
    align-items:center; 
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}
.loader {
    display: none;
    margin-left: 10px;
}
.disabled {
    pointer-events: none;
    opacity: 0.5;
}
