:root {
    --bg:         #070d14;
    --card:       #0d1521;
    --card-alt:   #101c2c;
    --border:     rgba(255,255,255,0.07);
    --border-2:   rgba(255,255,255,0.04);
    --accent:     #ffc107;
    --accent-dim: rgba(255,193,7,0.12);
    --green:      #4ade80;
    --green-dim:  rgba(74,222,128,0.1);
    --blue:       #38bdf8;
    --blue-dim:   rgba(56,189,248,0.1);
    --red:        #f87171;
    --red-dim:    rgba(248,113,113,0.1);
    --orange:     #fb923c;
    --txt:        #dde6f0;
    --txt-mid:    #7d93ab;
    --txt-dim:    #3f566e;
    --r:          18px;
    --r-sm:       10px;
}

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

body {
    background: var(--bg);
    color: var(--txt);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px 16px 36px;
}

.wrap { width: 100%; max-width: 960px; }

/* ── HEADER ── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.header-left { display: flex; flex-direction: column; gap: 2px; }

.location {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; color: var(--txt-mid);
}

.date-txt { font-size: 0.78rem; color: var(--txt-dim); }

.live-badge {
    display: flex; align-items: center; gap: 6px;
    background: var(--green-dim);
    border: 1px solid rgba(74,222,128,0.2);
    color: var(--green);
    border-radius: 30px;
    padding: 5px 14px;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
}

.pulse-dot {
    width: 7px; height: 7px;
    background: var(--green); border-radius: 50%;
    animation: pulse 2s infinite;
}

/* ── FABRIC SELECTOR ── */
.fabric-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.fabric-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--txt-dim);
    white-space: nowrap;
}

.fabric-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fab-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 0.76rem;
    font-family: 'Outfit', sans-serif;
    color: var(--txt-dim);
    cursor: pointer;
    transition: all 0.18s ease;
}

.fab-pill:hover {
    border-color: rgba(255,255,255,0.18);
    color: var(--txt-mid);
}

.fab-pill.active {
    background: var(--green-dim);
    border-color: rgba(74,222,128,0.35);
    color: var(--green);
    font-weight: 600;
}

/* ── ROWS ── */
.row { display: grid; gap: 14px; margin-bottom: 14px; }

.row-1 { grid-template-columns: 1fr 1.1fr; }
.row-2 { grid-template-columns: 1.8fr 1fr; }

.row-weather3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

/* ── CARD BASE ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 22px 24px;
    animation: fadeUp 0.45s ease both;
}

.card-sm { padding: 16px 18px; }

.sect-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--txt-dim); margin-bottom: 10px;
}

/* ── RAIN STRIP ── */
.rain-strip {
    border-radius: var(--r-sm);
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.rain-strip.warn {
    background: rgba(251,146,60,0.12);
    border: 1px solid rgba(251,146,60,0.25);
    color: var(--orange);
}

.rain-strip.safe {
    background: var(--green-dim);
    border: 1px solid rgba(74,222,128,0.2);
    color: var(--green);
}

/* ── SCORE CARD ── */
.score-card {
    display: flex; flex-direction: column; gap: 14px;
    background: var(--card-alt);
}

.score-head { display: flex; align-items: center; gap: 16px; }

.ring-wrap { position: relative; width: 78px; height: 78px; flex-shrink: 0; }

.ring-svg { width: 78px; height: 78px; transform: rotate(-90deg); }

.ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 6; }

.ring-fg {
    fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke 0.4s;
}

.ring-inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    line-height: 1;
}

.ring-num { font-size: 1.55rem; font-weight: 800; }
.ring-sub { font-size: 0.6rem; color: var(--txt-dim); margin-top: 1px; }

.score-verdict { font-size: 1.1rem; font-weight: 700; margin-bottom: 5px; }
.score-desc { font-size: 0.8rem; color: var(--txt-mid); line-height: 1.55; }

.window-pill {
    display: flex; align-items: center; gap: 8px;
    background: var(--blue-dim);
    border: 1px solid rgba(56,189,248,0.18);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    font-size: 0.8rem; color: var(--blue); font-weight: 500;
}

.chips-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.chip {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 3px;
}

.chip-lbl { font-size: 0.67rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--txt-dim); }
.chip-val { font-size: 1.15rem; font-weight: 700; line-height: 1; }
.chip-val-big { font-size: 1.3rem; }

.chip-tag {
    font-size: 0.69rem; font-weight: 600;
    padding: 2px 8px; border-radius: 20px; width: fit-content;
}
.tag-good { background: var(--green-dim); color: var(--green); }
.tag-ok   { background: var(--accent-dim); color: var(--accent); }
.tag-bad  { background: var(--red-dim); color: var(--red); }

/* ── WEATHER CARD ── */
.weather-card {
    display: flex; flex-direction: column; justify-content: space-between;
    gap: 0;
}

.weather-top {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 24px; flex: 1;
}

.wt-left { display: flex; flex-direction: column; justify-content: center; }
.wt-right { display: flex; flex-direction: column; justify-content: center; }

.temp-num {
    font-size: 4.4rem; font-weight: 900;
    line-height: 1; letter-spacing: -3px;
    margin: 6px 0 10px;
}

.temp-unit { font-size: 1.8rem; font-weight: 300; color: var(--txt-mid); margin-left: 2px; }

.feels-badge {
    display: inline-flex; align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 30px;
    padding: 4px 12px;
    font-size: 0.82rem; color: var(--txt-mid);
    width: fit-content; margin-bottom: 10px;
}

.feels-badge b { color: var(--accent); margin: 0 3px; font-weight: 700; }

.temp-cond { font-size: 0.92rem; font-weight: 600; color: var(--txt); }

.hum-num {
    font-size: 3rem; font-weight: 800; line-height: 1;
    margin: 6px 0 12px;
}
.hum-unit { font-size: 1.3rem; color: var(--txt-mid); }

.prog-track {
    height: 6px; background: rgba(255,255,255,0.07);
    border-radius: 6px; overflow: hidden; margin-bottom: 5px;
}

.prog-fill {
    height: 100%; background: var(--accent); border-radius: 6px;
    transition: width 1.3s cubic-bezier(.4,0,.2,1), background 0.4s;
}

.prog-zones {
    display: flex; justify-content: space-between;
    font-size: 0.67rem; color: var(--txt-dim); margin-bottom: 10px;
}

.hum-note { font-size: 0.8rem; color: var(--txt-mid); line-height: 1.5; }

.weather-bottom {
    border-top: 1px solid var(--border);
    padding-top: 14px; margin-top: 16px;
}

.meta-row { display: flex; gap: 20px; flex-wrap: wrap; }

.meta-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.78rem; color: var(--txt-dim);
}

/* Jolly Vibe Hero Card */
.vibe-hero-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    background: linear-gradient(145deg, var(--card), var(--card-alt));
}

.vibe-hero-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    gap: 15px;
}

.vibe-icon-big {
    filter: drop-shadow(0 0 15px rgba(255, 193, 7, 0.2));
    transition: transform 0.3s ease;
}

.vibe-icon-big:hover {
    transform: scale(1.1) rotate(5deg);
}

.vibe-status-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--txt);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.vibe-status-note {
    font-size: 0.9rem;
    color: var(--txt-mid);
    line-height: 1.5;
    max-width: 240px;
    margin: 0 auto;
}

.row-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.weather-bottom .meta-row {
    justify-content: center;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

/* ── WEATHER EXTRA CARDS (UV, Wind, Rain) ── */
.weather-extra-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.extra-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin: 4px 0 2px;
}

.extra-unit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--txt-mid);
}

.extra-lbl {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--txt-mid);
    margin-bottom: 6px;
}

.mini-bar-track {
    height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 5px;
    overflow: hidden;
    margin: 4px 0 6px;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 1s ease;
}

.extra-hint {
    font-size: 0.7rem;
    color: var(--txt-dim);
}

/* ── TIMELINE CARD ── */
.timeline-card { margin-bottom: 14px; }

.timeline-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-slots {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 70px;
}

.tl-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.tl-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.8s ease;
    min-height: 4px;
}

.tl-bar.is-now {
    outline: 2px solid var(--green);
    outline-offset: 1px;
}

.tl-time {
    font-size: 0.62rem;
    color: var(--txt-dim);
    white-space: nowrap;
}

.tl-time.now { color: var(--green); font-weight: 700; }

.tl-rain-icon { font-size: 0.65rem; line-height: 1; }

.timeline-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.tl-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: var(--txt-dim);
}

.tl-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── LAUNDRY CARD ── */
.laundry-card { background: linear-gradient(135deg, #0c1e30, #080f1a); border-color: rgba(56,189,248,0.12); }

.laundry-grid { display: grid; grid-template-columns: 1.1fr 1fr 0.9fr; gap: 20px; align-items: center; }

.uniform-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--accent); color: #000;
    border-radius: 6px; padding: 3px 10px;
    font-size: 0.65rem; font-weight: 800;
    letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: 10px; width: fit-content;
}

.dry-status {
    font-size: 1.7rem; font-weight: 800;
    letter-spacing: -0.5px; line-height: 1.1; margin-bottom: 6px;
}

.dry-advice { font-size: 0.8rem; color: var(--txt-mid); line-height: 1.55; }

.tip-box {
    display: flex; align-items: flex-start; gap: 8px;
    background: var(--blue-dim);
    border-left: 3px solid var(--blue);
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    font-size: 0.8rem; color: var(--txt-mid); line-height: 1.55;
}

.tip-icon { color: var(--blue); flex-shrink: 0; margin-top: 1px; }

.sun-block { display: flex; flex-direction: column; gap: 10px; }

.sun-item {
    display: flex; align-items: center; gap: 9px;
    color: var(--txt-dim); font-size: 0.78rem;
}

.sun-item i { flex-shrink: 0; }

.sun-lbl { display: block; font-size: 0.68rem; letter-spacing: 0.05em; color: var(--txt-dim); margin-bottom: 1px; }
.sun-val { display: block; font-size: 0.85rem; font-weight: 600; color: var(--txt-mid); }

/* ── INSIGHT CARD ── */
.insight-card { display: flex; flex-direction: column; gap: 14px; }

.insight-body { display: flex; align-items: center; gap: 12px; }

.insight-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 12px;
    background: var(--green-dim);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.4s;
}

.insight-icon i { color: var(--green); }

.insight-txt {
    font-size: 0.88rem; font-weight: 600;
    color: var(--green); line-height: 1.5;
    transition: color 0.4s;
}

/* ── SPARKLINE ── */
.sparkline-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--txt-dim);
    margin-top: 4px;
}

.sparkline-wrap {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 44px;
    margin-top: 6px;
}

.spark-bar {
    flex: 1;
    border-radius: 3px;
    transition: height 0.6s ease, background 0.4s;
    min-height: 3px;
}

/* ── NOTIFICATION BAR ── */
.notif-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--card);
    border: 1px solid rgba(56,189,248,0.15);
    border-radius: var(--r-sm);
    padding: 14px 18px;
    margin-bottom: 14px;
}

.notif-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notif-left i { color: var(--blue); flex-shrink: 0; }

.notif-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--txt);
}

.notif-sub {
    font-size: 0.75rem;
    color: var(--txt-dim);
    margin-top: 2px;
}

.notif-btn {
    background: var(--blue-dim);
    border: 1px solid rgba(56,189,248,0.3);
    border-radius: 8px;
    color: var(--blue);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 7px 18px;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.notif-btn:hover { background: rgba(56,189,248,0.2); }
.notif-btn.enabled {
    background: var(--green-dim);
    border-color: rgba(74,222,128,0.3);
    color: var(--green);
}

/* ── FOOTER ── */
.footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.78rem; color: var(--txt-dim); margin-top: 4px;
}

.footer-left { display: flex; align-items: center; gap: 7px; }

.upd-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green); display: inline-block;
    animation: pulse 2s infinite;
}

/* ── ICONS ── */
.icon-xs { width: 13px; height: 13px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }

/* ── ANIMATIONS ── */
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
    70%  { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.row-1 .score-card   { animation-delay: 0.05s; }
.row-1 .weather-card { animation-delay: 0.10s; }
.row-weather3 .weather-extra-card:nth-child(1) { animation-delay: 0.12s; }
.row-weather3 .weather-extra-card:nth-child(2) { animation-delay: 0.15s; }
.row-weather3 .weather-extra-card:nth-child(3) { animation-delay: 0.18s; }
.timeline-card { animation-delay: 0.20s; }
.row-2 .laundry-card { animation-delay: 0.22s; }
.row-2 .insight-card { animation-delay: 0.25s; }

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
    .row-1, .row-2 { grid-template-columns: 1fr; }
    .row-weather3 { grid-template-columns: 1fr 1fr; }
    .weather-top { grid-template-columns: 1fr; gap: 20px; }
    .laundry-grid { grid-template-columns: 1fr; gap: 16px; }
    .temp-num { font-size: 3.5rem; }
}

@media (max-width: 480px) {
    body { padding: 14px 12px 28px; }
    .card { padding: 18px; }
    .chips-row { grid-template-columns: 1fr 1fr; }
    .row-weather3 { grid-template-columns: 1fr; }
    .fabric-bar { flex-direction: column; align-items: flex-start; }
}

/* ── CSV DOWNLOAD BAR ── */
.csv-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--card);
    border: 1px solid rgba(74,222,128,0.15);
    border-radius: var(--r-sm);
    padding: 14px 18px;
    margin-bottom: 14px;
}

.csv-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.csv-left i { color: var(--green); flex-shrink: 0; }

.csv-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--txt);
}

.csv-sub {
    font-size: 0.75rem;
    color: var(--txt-dim);
    margin-top: 2px;
}

.csv-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.csv-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--txt-mid);
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    padding: 6px 10px;
    cursor: pointer;
    outline: none;
}

.csv-select:focus { border-color: rgba(74,222,128,0.4); }

.csv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--green-dim);
    border: 1px solid rgba(74,222,128,0.3);
    border-radius: 8px;
    color: var(--green);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.csv-btn:hover { background: rgba(74,222,128,0.2); }
.csv-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
    .csv-bar { flex-direction: column; align-items: flex-start; }
    .csv-controls { width: 100%; justify-content: space-between; }
    .csv-select { flex: 1; }
}