:root{
    --radius-lg: 22px;
    --radius-md: 15px;
    --radius-sm: 10px;
    --ease: cubic-bezier(.22,.61,.36,1);
  }
  body[data-theme="dark"]{
    --bg: #0a0f1c;
    --bg-elev: #0f1830;
    --glass: rgba(255,255,255,0.045);
    --glass-strong: rgba(255,255,255,0.07);
    --glass-border: rgba(255,255,255,0.09);
    --text: #eaeff8;
    --text-muted: #8b95ab;
    --text-faint: #5c6480;
    --accent-sky: #4fc3f7;
    --accent-amber: #fbbf5b;
    --accent-violet: #b19dfb;
    --danger: #fb7d8b;
    --warn: #fbbf5b;
    --good: #4ade9c;
    --divider: rgba(255,255,255,0.07);
    --shadow: 0 20px 50px rgba(0,0,0,0.35);
  }
  body[data-theme="light"]{
    --bg: #eef1f7;
    --bg-elev: #ffffff;
    --glass: rgba(255,255,255,0.7);
    --glass-strong: rgba(255,255,255,0.9);
    --glass-border: rgba(16,24,40,0.08);
    --text: #121826;
    --text-muted: #5c6478;
    --text-faint: #949cb0;
    --accent-sky: #0b8fd1;
    --accent-amber: #c9820f;
    --accent-violet: #7d5fe0;
    --danger: #d3455a;
    --warn: #c9820f;
    --good: #1f9d6f;
    --divider: rgba(16,24,40,0.07);
    --shadow: 0 20px 50px rgba(16,24,40,0.10);
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  html,body{height:100%;}
  body{
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background .35s var(--ease), color .35s var(--ease);
    overflow-x:hidden;
  }
  body[data-theme="dark"]{
    background:
      radial-gradient(1100px 600px at 85% -10%, rgba(79,195,247,0.10), transparent 60%),
      radial-gradient(900px 500px at -10% 20%, rgba(177,157,251,0.08), transparent 60%),
      var(--bg);
  }
  ::selection{ background: var(--accent-sky); color:#04121e; }
  a, button{ font-family: inherit; }
  .mono{ font-family:'IBM Plex Mono', monospace; letter-spacing:.01em; }
  .display{ font-family:'Space Grotesk', sans-serif; }

  /* ---------- SCROLLBAR ---------- */
  ::-webkit-scrollbar{ height:8px; width:8px; }
  ::-webkit-scrollbar-thumb{ background: var(--glass-border); border-radius: 10px; }

  /* ---------- APP SHELL ---------- */
  .app{ display:flex; min-height:100vh; }

  /* ---------- SIDEBAR ---------- */
  .sidebar{
    width: 234px; flex-shrink:0;
    padding: 22px 14px;
    display:flex; flex-direction:column;
    border-right: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(20px);
    position: sticky; top:0; height:100vh;
    transition: width .3s var(--ease);
    z-index: 40;
  }
  .sidebar.collapsed{ width: 76px; }
  .brand{ display:flex; align-items:center; gap:10px; padding: 6px 8px 22px; }
  .brand-mark{
    width:34px; height:34px; border-radius:10px; flex-shrink:0;
    background: conic-gradient(from 220deg, var(--accent-sky), var(--accent-violet), var(--accent-amber), var(--accent-sky));
    display:flex; align-items:center; justify-content:center;
    box-shadow: 0 6px 18px rgba(79,195,247,0.25);
  }
  .brand-mark svg{ width:18px; height:18px; color:#0a0f1c; }
  .brand-name{ font-family:'Space Grotesk'; font-weight:600; font-size:17px; white-space:nowrap; overflow:hidden; }
  .sidebar.collapsed .brand-name, .sidebar.collapsed .nav-label, .sidebar.collapsed .side-foot-text{ display:none; }

  .nav-group{ display:flex; flex-direction:column; gap:2px; flex:1; }
  .nav-item{
    display:flex; align-items:center; gap:12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size:13.5px; font-weight:500;
    cursor:pointer; border:none; background:transparent; width:100%; text-align:left; text-decoration:none;
    transition: background .18s var(--ease), color .18s var(--ease);
    position:relative;
  }
  .nav-item svg{ width:17px; height:17px; flex-shrink:0; }
  .nav-item:hover{ background: var(--glass-strong); color: var(--text); }
  .nav-item.active{ background: linear-gradient(90deg, rgba(79,195,247,0.16), transparent); color: var(--accent-sky); }
  .nav-item.active::before{
    content:''; position:absolute; left:-14px; top:8px; bottom:8px; width:3px;
    background: var(--accent-sky); border-radius:4px;
  }
  .nav-badge{
    margin-left:auto; background: var(--danger); color:#fff; font-size:10px; font-weight:700;
    padding: 1px 6px; border-radius:20px;
  }
  .nav-divider{ height:1px; background: var(--divider); margin: 12px 4px; }

  .side-foot{ display:flex; flex-direction:column; gap:2px; padding-top:8px; border-top:1px solid var(--divider); }
  .side-foot .nav-item{ font-size:13px; }
  .theme-row{ display:flex; align-items:center; justify-content:space-between; padding: 8px 12px; }
  .theme-toggle{
    display:flex; background: var(--glass-strong); border-radius:20px; padding:3px; gap:2px; border:1px solid var(--glass-border);
  }
  .theme-toggle button{
    border:none; background:transparent; width:26px; height:22px; border-radius:16px; cursor:pointer;
    display:flex; align-items:center; justify-content:center; color:var(--text-muted);
  }
  .theme-toggle button svg{ width:13px; height:13px; }
  .theme-toggle button.active{ background: var(--accent-sky); color:#04121e; }
  .profile-row{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:var(--radius-sm); cursor:pointer; }
  .profile-row:hover{ background: var(--glass-strong); }
  .avatar{ width:32px; height:32px; border-radius:50%; background: linear-gradient(135deg,var(--accent-violet),var(--accent-sky)); flex-shrink:0; }
  .profile-meta{ line-height:1.25; overflow:hidden; }
  .profile-meta .name{ font-size:13px; font-weight:600; white-space:nowrap; }
  .profile-meta .role{ font-size:11px; color:var(--text-faint); white-space:nowrap; }

  /* ---------- MAIN ---------- */
  .main{ flex:1; min-width:0; display:flex; flex-direction:column; }

  /* ---------- TOPBAR ---------- */
  .topbar{
    position: sticky; top:0; z-index:30;
    display:flex; align-items:center; gap:16px;
    padding: 14px 28px;
    background: var(--glass); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
  }
  .icon-btn{
    width:38px; height:38px; border-radius:11px; border:1px solid var(--glass-border);
    background: var(--glass-strong); color: var(--text-muted); cursor:pointer;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
    transition: all .18s var(--ease);
  }
  .icon-btn:hover{ color:var(--text); border-color: var(--accent-sky); transform: translateY(-1px); }
  .icon-btn svg{ width:17px; height:17px; }
  .location-pill{ display:flex; flex-direction:column; line-height:1.15; margin-right:4px; }
  .location-pill .city{ font-family:'Space Grotesk'; font-weight:600; font-size:14.5px; display:flex; align-items:center; gap:5px; cursor:pointer;}
  .location-pill .city svg{ width:13px; height:13px; color:var(--text-faint); }
  .location-pill .sub{ font-size:11px; color:var(--text-faint); }

  .search-wrap{ position:relative; flex:1; max-width:420px; }
  .search-box{
    display:flex; align-items:center; gap:8px;
    background: var(--glass-strong); border:1px solid var(--glass-border);
    border-radius: 12px; padding: 9px 12px;
  }
  .search-box:focus-within{ border-color: var(--accent-sky); box-shadow: 0 0 0 3px rgba(79,195,247,0.12); }
  .search-box svg{ width:15px; height:15px; color:var(--text-faint); flex-shrink:0; }
  .search-box input{
    border:none; background:transparent; outline:none; color:var(--text); font-size:13px; width:100%;
  }
  .search-box input::placeholder{ color: var(--text-faint); }
  .search-dropdown{
    position:absolute; top:calc(100% + 8px); left:0; right:0;
    background: var(--bg-elev); border:1px solid var(--glass-border); border-radius: var(--radius-md);
    box-shadow: var(--shadow); padding:8px; display:none; z-index:50; max-height:340px; overflow:auto;
  }
  .search-wrap.open .search-dropdown{ display:block; }
  .search-section-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint); padding:8px 10px 4px; }
  .search-result{
    display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px; cursor:pointer;
  }
  .search-result:hover{ background: var(--glass-strong); }
  .search-result .ic{ width:30px; height:30px; border-radius:9px; background:var(--glass-strong); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
  .search-result .ic svg{ width:15px; height:15px; color: var(--accent-amber); }
  .search-result .meta{ flex:1; line-height:1.2; }
  .search-result .meta .n{ font-size:13px; font-weight:600; }
  .search-result .meta .c{ font-size:11px; color: var(--text-faint); }
  .search-result .temp{ font-size:13px; font-weight:600; color: var(--text-muted); }

  .topbar-right{ display:flex; align-items:center; gap:10px; margin-left:auto; }
  .datetime{ text-align:right; line-height:1.2; margin-right:2px; }
  .datetime .time{ font-family:'Space Grotesk'; font-weight:600; font-size:14px; }
  .datetime .date{ font-size:11px; color:var(--text-faint); }
  .units-toggle{
    display:flex; background: var(--glass-strong); border:1px solid var(--glass-border); border-radius:20px; padding:3px; font-size:11px; font-weight:600;
  }
  .units-toggle button{ border:none; background:transparent; padding:5px 9px; border-radius:16px; cursor:pointer; color:var(--text-muted); }
  .units-toggle button.active{ background: var(--accent-sky); color:#04121e; }
  .bell-wrap{ position:relative; }
  .bell-dot{ position:absolute; top:6px; right:7px; width:7px; height:7px; border-radius:50%; background:var(--danger); border:2px solid var(--bg-elev); }

  /* ---------- CONTENT ---------- */
  .content{ padding: 22px 28px 60px; display:flex; flex-direction:column; gap:20px; max-width:1500px; width:100%; margin:0 auto; }

  .glass-card{
    background: var(--glass); border:1px solid var(--glass-border); border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
  }
  .card-head{ display:flex; align-items:center; gap:10px; padding: 18px 20px 4px; }
  .card-head h3{ font-family:'Space Grotesk'; font-size:15px; font-weight:600; }
  .card-head .hint{ margin-left:auto; font-size:11.5px; color:var(--text-faint); }
  .tabs{ display:flex; gap:4px; background: var(--glass-strong); border:1px solid var(--glass-border); border-radius:20px; padding:3px; }
  .tabs button{ border:none; background:transparent; font-size:11.5px; font-weight:600; padding:6px 11px; border-radius:16px; cursor:pointer; color:var(--text-muted); }
  .tabs button.active{ background:var(--accent-sky); color:#04121e; }

  /* ---------- ALERT BANNER ---------- */
  .alert-banner{
    display:flex; align-items:center; gap:14px; padding:14px 18px; border-radius: var(--radius-md);
    background: linear-gradient(90deg, rgba(251,125,139,0.14), rgba(251,125,139,0.03));
    border:1px solid rgba(251,125,139,0.3); border-left: 4px solid var(--danger);
  }
  .alert-banner .aic{ width:38px; height:38px; border-radius:11px; background:rgba(251,125,139,0.18); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .alert-banner .aic svg{ width:19px; height:19px; color:var(--danger); }
  .alert-banner .abody{ flex:1; }
  .alert-banner .abody .t{ font-weight:700; font-size:13.5px; display:flex; align-items:center; gap:8px; }
  .sev-chip{ font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; background:var(--danger); color:#fff; padding:2px 7px; border-radius:20px; }
  .alert-banner .abody .d{ font-size:12px; color:var(--text-muted); margin-top:2px; }
  .alert-actions{ display:flex; gap:8px; }
  .btn-ghost{ border:1px solid var(--glass-border); background:var(--glass-strong); color:var(--text); font-size:12px; font-weight:600; padding:7px 13px; border-radius:9px; cursor:pointer; }
  .btn-ghost:hover{ border-color: var(--accent-sky); }
  .btn-x{ width:30px; height:30px; border-radius:9px; border:1px solid var(--glass-border); background:transparent; color:var(--text-faint); cursor:pointer; display:flex; align-items:center; justify-content:center; }

  /* ---------- HERO ---------- */
  .hero{
    position:relative; overflow:hidden; border-radius: var(--radius-lg);
    background: radial-gradient(1200px 500px at 15% -30%, rgba(79,195,247,0.25), transparent 60%),
                linear-gradient(160deg, #0d2140 0%, #0a1730 55%, #070f22 100%);
    border:1px solid var(--glass-border);
    padding: 30px 32px; min-height: 300px;
    display:flex; flex-direction:column; justify-content:space-between;
    box-shadow: var(--shadow);
  }
  body[data-theme="light"] .hero{
    background: radial-gradient(1200px 500px at 15% -30%, rgba(79,195,247,0.30), transparent 60%),
                linear-gradient(160deg, #1a3a63 0%, #12294a 55%, #0c1d38 100%);
  }
  .hero .stars{ position:absolute; inset:0; opacity:.5; }
  .hero .stars span{ position:absolute; width:2px; height:2px; background:#fff; border-radius:50%; animation: twinkle 3.5s ease-in-out infinite; }
  @keyframes twinkle{ 0%,100%{opacity:.15;} 50%{opacity:.9;} }
  .cloud{ position:absolute; border-radius:50%; background: rgba(255,255,255,0.05); filter: blur(2px); animation: drift 40s linear infinite; }
  @keyframes drift{ from{ transform: translateX(-60px);} to{ transform: translateX(60px);} }

  .hero-top{ display:flex; justify-content:space-between; align-items:flex-start; position:relative; z-index:2; }
  .hero-loc{ color:#f2f6fc; }
  .hero-loc .c{ font-family:'Space Grotesk'; font-size:20px; font-weight:600; display:flex; align-items:center; gap:8px; }
  .hero-loc .c svg{ width:15px; height:15px; opacity:.7; }
  .hero-loc .n{ font-size:12px; opacity:.6; margin-top:2px; }
  .updated-chip{
    font-size:11px; color: rgba(255,255,255,0.65); display:flex; align-items:center; gap:6px;
    background: rgba(255,255,255,0.08); padding:6px 11px; border-radius:20px; border:1px solid rgba(255,255,255,0.1);
  }
  .updated-chip svg{ width:12px; height:12px; }
  .updated-chip .dot{ width:6px; height:6px; border-radius:50%; background:var(--good); box-shadow:0 0 8px var(--good); }

  .hero-mid{ position:relative; z-index:2; display:flex; align-items:center; gap:26px; margin: 6px 0; }
  .instrument{ position:relative; width:150px; height:150px; flex-shrink:0; }
  .instrument svg{ width:100%; height:100%; transform: rotate(-90deg); }
  .ring-bg{ fill:none; stroke: rgba(255,255,255,0.08); stroke-width:3; }
  .ring-val{ fill:none; stroke-linecap:round; }
  .ring-outer{ stroke: var(--accent-amber); animation: spin 60s linear infinite; transform-origin:center; }
  @keyframes spin{ from{ transform: rotate(0deg);} to{ transform: rotate(360deg);} }
  .instrument-icon{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
  .instrument-icon svg{ width:52px; height:52px; color: var(--accent-amber); filter: drop-shadow(0 0 16px rgba(251,191,91,.5)); animation: float 5s ease-in-out infinite; }
  @keyframes float{ 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-6px);} }

  .hero-temp{ color:#fff; }
  .hero-temp .t{ font-family:'Space Grotesk'; font-weight:700; font-size:72px; line-height:1; display:flex; align-items:flex-start; }
  .hero-temp .t sup{ font-size:28px; font-weight:500; margin-top:8px; opacity:.75; }
  .hero-temp .cond{ font-size:16px; font-weight:500; margin-top:2px; }
  .hero-temp .feels{ font-size:12.5px; color: rgba(255,255,255,0.55); margin-top:6px; }

  .hero-bottom{ position:relative; z-index:2; display:flex; align-items:center; gap:26px; flex-wrap:wrap; margin-top:10px; padding-top:16px; border-top:1px solid rgba(255,255,255,0.09); }
  .hero-stat{ display:flex; align-items:center; gap:8px; color: rgba(255,255,255,0.85); }
  .hero-stat svg{ width:15px; height:15px; opacity:.6; }
  .hero-stat .lbl{ font-size:10.5px; color: rgba(255,255,255,0.45); display:block; }
  .hero-stat .val{ font-size:13px; font-weight:600; }

  /* ---------- METRICS GRID ---------- */
  .metrics-grid{ display:grid; grid-template-columns: repeat(6, 1fr); gap:12px; }
  .metric-card{
    background: var(--glass); border:1px solid var(--glass-border); border-radius: var(--radius-md);
    padding:14px 15px; cursor:pointer; transition: transform .18s var(--ease), border-color .18s var(--ease);
    position:relative;
  }
  .metric-card:hover{ transform: translateY(-3px); border-color: var(--accent-sky); }
  .metric-card .mtop{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
  .metric-card .mic{ width:28px; height:28px; border-radius:8px; background: var(--glass-strong); display:flex; align-items:center; justify-content:center; }
  .metric-card .mic svg{ width:14px; height:14px; color: var(--accent-sky); }
  .trend{ font-size:10px; font-weight:700; display:flex; align-items:center; gap:2px; }
  .trend svg{ width:11px; height:11px; }
  .trend.up{ color: var(--danger); } .trend.down{ color: var(--good); } .trend.flat{ color: var(--text-faint); }
  .metric-card .mval{ font-family:'Space Grotesk'; font-size:20px; font-weight:600; }
  .metric-card .mval span{ font-size:12px; font-weight:500; color: var(--text-faint); }
  .metric-card .mlabel{ font-size:11px; color: var(--text-muted); margin-top:2px; }
  .metric-card .mstatus{ font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; margin-top:8px; display:inline-block; padding:2px 7px; border-radius:20px; }
  .mstatus.good{ background: rgba(74,222,156,0.14); color: var(--good); }
  .mstatus.warn{ background: rgba(251,191,91,0.14); color: var(--warn); }
  .mstatus.bad{ background: rgba(251,125,139,0.14); color: var(--danger); }

  /* ---------- HOURLY ---------- */
  .hourly-scroll{ display:flex; gap:10px; overflow-x:auto; padding: 16px 20px 6px; scroll-snap-type:x proximity; }
  .hour-card{
    scroll-snap-align:start; flex-shrink:0; width:76px; text-align:center; padding:12px 6px;
    border-radius: var(--radius-sm); background: var(--glass-strong); border:1px solid transparent;
  }
  .hour-card.now{ border-color: var(--accent-sky); background: rgba(79,195,247,0.10); }
  .hour-card .h{ font-size:11px; color: var(--text-faint); font-weight:600; }
  .hour-card svg{ width:24px; height:24px; margin:8px auto; display:block; color: var(--accent-amber); }
  .hour-card .t{ font-family:'Space Grotesk'; font-weight:600; font-size:14px; }
  .hour-card .p{ font-size:10px; color: var(--accent-sky); margin-top:4px; font-weight:600; }
  .curve-wrap{ padding: 0 20px 20px; }
  .curve-wrap svg{ width:100%; height:70px; display:block; }

  /* ---------- FORECAST / RIGHT RAIL ---------- */
  .grid-2{ display:grid; grid-template-columns: 1.5fr 1fr; gap:20px; align-items:start; }
  .day-row{
    display:grid; grid-template-columns: 90px 30px 1fr auto auto auto 18px; align-items:center; gap:14px;
    padding: 13px 20px; border-top:1px solid var(--divider); cursor:pointer;
  }
  .day-row:first-child{ border-top:none; }
  .day-row:hover{ background: var(--glass-strong); }
  .day-row .dname{ font-size:13px; font-weight:600; }
  .day-row .ddate{ font-size:10.5px; color: var(--text-faint); }
  .day-row svg.wico{ width:20px; height:20px; color: var(--accent-amber); }
  .day-row .dcond{ font-size:12px; color: var(--text-muted); }
  .day-row .drain{ font-size:11.5px; color: var(--accent-sky); font-weight:600; display:flex; align-items:center; gap:4px; }
  .day-row .drain svg{ width:12px; height:12px; }
  .range-bar{ width:90px; height:4px; border-radius:4px; background: var(--divider); position:relative; }
  .range-bar i{ position:absolute; top:0; bottom:0; border-radius:4px; background: linear-gradient(90deg, var(--accent-sky), var(--accent-amber)); }
  .day-temps{ display:flex; gap:8px; font-size:12.5px; font-weight:600; }
  .day-temps .lo{ color: var(--text-faint); font-weight:500; }
  .day-row .chev{ width:16px; height:16px; color: var(--text-faint); transition: transform .2s; }
  .day-row.expanded .chev{ transform: rotate(180deg); }
  .day-detail{ display:none; padding: 4px 20px 18px 20px; }
  .day-row.expanded + .day-detail{ display:block; }
  .day-detail-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
  .day-detail-grid .dd{ background: var(--glass-strong); border-radius:10px; padding:10px; }
  .day-detail-grid .dd .l{ font-size:10px; color:var(--text-faint); }
  .day-detail-grid .dd .v{ font-size:13px; font-weight:600; font-family:'Space Grotesk'; margin-top:2px; }

  /* ---------- AI ASSISTANT ---------- */
  .ai-card{ display:flex; flex-direction:column; gap:12px; padding: 18px; }
  .ai-head{ display:flex; align-items:center; gap:10px; }
  .ai-avatar{
    width:34px; height:34px; border-radius:10px; background: conic-gradient(from 200deg, var(--accent-violet), var(--accent-sky), var(--accent-amber), var(--accent-violet));
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .ai-avatar svg{ width:17px; height:17px; color:#0a0f1c; }
  .ai-head .t{ font-family:'Space Grotesk'; font-weight:600; font-size:14px; }
  .ai-head .s{ font-size:10.5px; color: var(--good); display:flex; align-items:center; gap:4px; }
  .ai-head .s .dot{ width:5px; height:5px; border-radius:50%; background: var(--good); }
  .ai-answer{ background: var(--glass-strong); border:1px solid var(--glass-border); border-radius: var(--radius-sm); padding:13px 14px; font-size:13px; line-height:1.55; }
  .confidence{ display:flex; align-items:center; gap:6px; margin-top:10px; font-size:10.5px; color: var(--text-faint); }
  .conf-dots{ display:flex; gap:3px; }
  .conf-dots i{ width:5px; height:5px; border-radius:50%; background: var(--divider); }
  .conf-dots i.on{ background: var(--good); }
  .ai-chips{ display:flex; flex-wrap:wrap; gap:7px; }
  .ai-chip{
    border:1px solid var(--glass-border); background: var(--glass-strong); color: var(--text-muted);
    font-size:11.5px; font-weight:500; padding:6px 12px; border-radius:20px; cursor:pointer; transition:.15s;
  }
  .ai-chip:hover{ border-color: var(--accent-sky); color: var(--text); }
  .ai-input-row{ display:flex; gap:8px; margin-top:2px; }
  .ai-input-row input{
    flex:1; background: var(--glass-strong); border:1px solid var(--glass-border); border-radius:11px;
    padding:10px 13px; color:var(--text); font-size:12.5px; outline:none;
  }
  .ai-input-row input:focus{ border-color: var(--accent-sky); }
  .send-btn{
    width:40px; height:40px; border-radius:11px; border:none; background: var(--accent-sky); color:#04121e;
    cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .send-btn svg{ width:16px; height:16px; }

  /* ---------- SMALL WIDGETS ROW ---------- */
  .widget-mini{ padding:16px 18px; }
  .aqi-gauge-row{ display:flex; align-items:center; gap:16px; }
  .aqi-ring{ position:relative; width:80px; height:80px; flex-shrink:0; }
  .aqi-ring svg{ transform: rotate(-90deg); width:100%; height:100%; }
  .aqi-ring .val{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
  .aqi-ring .val b{ font-family:'Space Grotesk'; font-size:19px; }
  .aqi-ring .val span{ font-size:8.5px; color: var(--text-faint); }
  .aqi-meta .cat{ font-weight:700; font-size:13px; color: var(--warn); }
  .aqi-meta .txt{ font-size:11.5px; color: var(--text-muted); margin-top:3px; line-height:1.4; }

  .compass-row{ display:flex; align-items:center; gap:16px; margin-top:14px; }
  .compass{ width:66px; height:66px; border-radius:50%; border:1px solid var(--glass-border); position:relative; flex-shrink:0; background: var(--glass-strong);}
  .compass .n{ position:absolute; top:4px; left:50%; transform:translateX(-50%); font-size:8px; color:var(--text-faint); font-weight:700;}
  .compass .needle{ position:absolute; left:50%; top:50%; width:2px; height:24px; background: linear-gradient(var(--accent-sky), transparent); transform-origin: bottom center; transform: translate(-50%,-100%) rotate(-45deg); border-radius:2px; }
  .wind-meta .v{ font-family:'Space Grotesk'; font-size:18px; font-weight:600; }
  .wind-meta .l{ font-size:11px; color: var(--text-faint); }
  .beaufort{ font-size:10px; margin-top:6px; background:var(--glass-strong); display:inline-block; padding:3px 8px; border-radius:20px; color:var(--text-muted); }

  /* ---------- MAP PREVIEW ---------- */
  .map-preview{
    position:relative; height:280px; border-radius: var(--radius-md); overflow:hidden; margin: 0 18px 18px;
    background:
      radial-gradient(circle at 30% 30%, rgba(79,195,247,.35), transparent 45%),
      radial-gradient(circle at 70% 60%, rgba(251,191,91,.25), transparent 45%),
      radial-gradient(circle at 50% 85%, rgba(177,157,251,.3), transparent 45%),
      #0d1730;
  }
  body[data-theme="light"] .map-preview{ background:
      radial-gradient(circle at 30% 30%, rgba(79,195,247,.45), transparent 45%),
      radial-gradient(circle at 70% 60%, rgba(251,191,91,.35), transparent 45%),
      radial-gradient(circle at 50% 85%, rgba(177,157,251,.4), transparent 45%),
      #16243f; }
  .map-grid-lines{ position:absolute; inset:0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 26px 26px; }
  .map-pin{ position:absolute; left:48%; top:44%; width:12px; height:12px; }
  .map-pin::before{ content:''; position:absolute; inset:0; border-radius:50%; background: var(--accent-sky); box-shadow: 0 0 0 4px rgba(79,195,247,.25); }
  .map-pin::after{ content:''; position:absolute; inset:-10px; border-radius:50%; border:1px solid rgba(79,195,247,.5); animation: ping 2.2s ease-out infinite; }
  @keyframes ping{ 0%{ transform:scale(.5); opacity:1;} 100%{ transform:scale(1.8); opacity:0;} }
  .map-badges{ position:absolute; top:10px; left:10px; display:flex; gap:6px; }
  .map-badge{ font-size:10px; font-weight:600; background: rgba(0,0,0,0.35); backdrop-filter: blur(6px); color:#fff; padding:4px 9px; border-radius:20px; border:1px solid rgba(255,255,255,.15); }
  .map-expand{ position:absolute; bottom:10px; right:10px; font-size:11px; font-weight:600; background: rgba(255,255,255,.92); color:#111; padding:6px 12px; border-radius:9px; display:flex; align-items:center; gap:5px; cursor:pointer; }
  .map-expand svg{ width:12px; height:12px; }

  /* ---------- FAVORITES ---------- */
  .fav-scroll{ display:flex; gap:14px; overflow-x:auto; padding: 6px 4px 4px; }
  .fav-card{
    flex-shrink:0; width:200px; border-radius: var(--radius-md); padding:16px;
    background: var(--glass); border:1px solid var(--glass-border); position:relative; cursor:pointer;
    transition: transform .18s var(--ease);
  }
  .fav-card:hover{ transform: translateY(-3px); }
  .fav-card.default{ border-color: var(--accent-amber); }
  .fav-star{ position:absolute; top:14px; right:14px; width:15px; height:15px; color: var(--text-faint); cursor:pointer; }
  .fav-star.on{ color: var(--accent-amber); }
  .fav-card .fc{ font-family:'Space Grotesk'; font-weight:600; font-size:14.5px; }
  .fav-card .fn{ font-size:10.5px; color:var(--text-faint); margin-bottom:10px; }
  .fav-card .ft{ font-size:24px; font-weight:700; font-family:'Space Grotesk'; display:flex; align-items:center; gap:8px; }
  .fav-card .ft svg{ width:22px; height:22px; color: var(--accent-amber); }
  .fav-card .fcond{ font-size:11px; color:var(--text-muted); margin: 2px 0 10px; }
  .fav-foot{ display:flex; gap:12px; font-size:10.5px; color:var(--text-faint); border-top:1px solid var(--divider); padding-top:9px; }
  .fav-foot b{ color:var(--text-muted); font-weight:600; }
  .add-fav{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; border:1.5px dashed var(--glass-border); color: var(--text-faint); font-size:11.5px; font-weight:500; }
  .add-fav svg{ width:20px; height:20px; }

  /* ---------- SECTION LABEL ---------- */
  .section-title{ display:flex; align-items:center; gap:10px; padding: 4px 2px; }
  .section-title h2{ font-family:'Space Grotesk'; font-size:16px; font-weight:600; }
  .section-title .line{ flex:1; height:1px; background: var(--divider); }

  /* ---------- MODAL ---------- */
  .modal-overlay{ position:fixed; inset:0; background: rgba(4,8,16,0.6); backdrop-filter: blur(4px); display:none; align-items:center; justify-content:center; z-index:100; }
  .modal-overlay.open{ display:flex; }
  .modal{ width:380px; background: var(--bg-elev); border:1px solid var(--glass-border); border-radius: var(--radius-lg); padding:22px; box-shadow: var(--shadow); }
  .modal-head{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
  .modal-head .mic2{ width:36px; height:36px; border-radius:10px; background:var(--glass-strong); display:flex; align-items:center; justify-content:center; }
  .modal-head .mic2 svg{ width:17px; height:17px; color:var(--accent-sky); }
  .modal-head h4{ font-family:'Space Grotesk'; font-size:15px; }
  .modal-head span{ font-size:11px; color:var(--text-faint); display:block; }
  .modal-big{ font-family:'Space Grotesk'; font-size:34px; font-weight:700; margin: 10px 0 4px; }
  .modal svg.spark{ width:100%; height:60px; margin:10px 0; }
  .modal-close{ margin-left:auto; }

  .toast{
    position:fixed; bottom:24px; right:24px; background: var(--bg-elev); border:1px solid var(--glass-border);
    border-radius:12px; padding:12px 16px; display:flex; align-items:center; gap:10px; box-shadow: var(--shadow);
    font-size:12.5px; font-weight:500; transform: translateY(120%); opacity:0; transition: all .35s var(--ease); z-index:200;
  }
  .toast.show{ transform: translateY(0); opacity:1; }
  .toast svg{ width:16px; height:16px; color: var(--good); }

  /* ---------- PRELOADER ---------- */
  .preloader{
    position:fixed; inset:0; z-index:500; background: var(--bg);
    display:flex; align-items:center; justify-content:center; flex-direction:column; gap:16px;
    transition: opacity .5s var(--ease), visibility .5s var(--ease);
  }
  .preloader.hide{ opacity:0; visibility:hidden; pointer-events:none; }
  .pl-ring{ width:52px; height:52px; position:relative; }
  .pl-ring svg{ width:100%; height:100%; animation: spin-fast 1.1s linear infinite; }
  .pl-ring circle{ fill:none; stroke-width:3.5; stroke-linecap:round; stroke:#4fc3f7; stroke-dasharray:120; stroke-dashoffset:70; opacity:.85; }
  @keyframes spin-fast{ to{ transform: rotate(360deg); } }
  .pl-text{ font-family:'Space Grotesk'; font-size:12.5px; color: var(--text-faint); letter-spacing:.03em; }
  .pl-text span{ display:inline-block; animation: pulse-op 1.4s ease-in-out infinite; }

  /* ---------- REVEAL-IN ---------- */
  .reveal{ opacity:0; transform: translateY(14px); animation: revealUp .6s var(--ease) forwards; }
  @keyframes revealUp{ to{ opacity:1; transform: translateY(0); } }

  /* ---------- SHIMMER (loading skeleton) ---------- */
  .skeleton{
    background: linear-gradient(100deg, var(--glass-strong) 30%, rgba(255,255,255,0.14) 45%, var(--glass-strong) 60%);
    background-size: 250% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: 8px; color: transparent !important;
  }
  @keyframes shimmer{ 0%{ background-position: 200% 0; } 100%{ background-position: -50% 0; } }

  /* ---------- LIVE / SYNC STATUS ---------- */
  @keyframes pulse-op{ 0%,100%{ opacity:.35; } 50%{ opacity:1; } }
  .dot-live{ animation: pulse-op 1.8s ease-in-out infinite; }
  .updated-chip.syncing .dot{ background: var(--accent-amber); box-shadow:0 0 8px var(--accent-amber); animation: pulse-op .9s ease-in-out infinite; }
  .updated-chip .spin-ic{ width:11px; height:11px; display:none; animation: spin-fast .9s linear infinite; }
  .updated-chip.syncing .spin-ic{ display:inline-block; }
  .updated-chip.syncing .dot{ display:none; }

  /* ---------- RAIN / ATMOSPHERE PARTICLES ---------- */
  .rain-layer{ position:absolute; inset:0; overflow:hidden; opacity:0; transition: opacity .8s var(--ease); pointer-events:none; }
  .rain-layer.on{ opacity:1; }
  .drop{ position:absolute; top:-8%; width:1.5px; height:14px; background: linear-gradient(rgba(120,190,255,0), rgba(150,210,255,.65)); animation: fall linear infinite; }
  @keyframes fall{ to{ transform: translateY(340px); } }

  .sun-rays{ position:absolute; width:150px; height:150px; border-radius:50%; pointer-events:none; opacity:0; transition: opacity .8s var(--ease); }
  .sun-rays.on{ opacity:1; }
  .sun-rays::before{
    content:''; position:absolute; inset:0; border-radius:50%;
    background: radial-gradient(circle, rgba(251,191,91,.35) 0%, rgba(251,191,91,0) 70%);
    animation: pulse-op 2.6s ease-in-out infinite;
  }
  .sun-rays::after{
    content:''; position:absolute; inset:-30px; border-radius:50%;
    background: repeating-conic-gradient(rgba(251,191,91,.10) 0deg 4deg, transparent 4deg 18deg);
    animation: spin 30s linear infinite;
  }

  .lightning-layer{ position:absolute; inset:0; background:#fff; opacity:0; pointer-events:none; mix-blend-mode: overlay; }
  .lightning-layer.flash{ animation: flash .5s ease-out; }
  @keyframes flash{ 0%{opacity:0;} 8%{opacity:.55;} 16%{opacity:0;} 24%{opacity:.35;} 40%{opacity:0;} }

  /* ---------- LIVE METRIC PULSE ---------- */
  @keyframes live-flash{
    0%{ border-color: var(--glass-border); box-shadow:none; }
    30%{ border-color: var(--accent-sky); box-shadow: 0 0 0 3px rgba(79,195,247,0.14); }
    100%{ border-color: var(--glass-border); box-shadow:none; }
  }
  .metric-card.live-update{ animation: live-flash 1.4s var(--ease); }
  .metric-card.live-update .mval{ animation: valpop .4s var(--ease); }
  @keyframes valpop{ 0%{ transform: scale(1);} 40%{ transform: scale(1.08); color: var(--accent-sky);} 100%{ transform: scale(1);} }
  .live-refresh-tag{
    position:absolute; top:10px; right:12px; font-size:8.5px; font-weight:700; color: var(--accent-sky);
    opacity:0; display:flex; align-items:center; gap:3px; text-transform:uppercase; letter-spacing:.03em;
  }
  .metric-card.live-update .live-refresh-tag{ animation: tagshow 1.4s var(--ease); }
  @keyframes tagshow{ 0%{opacity:0; transform:translateY(-3px);} 20%{opacity:1; transform:translateY(0);} 75%{opacity:1;} 100%{opacity:0;} }
  .live-refresh-tag svg{ width:8px; height:8px; }

  /* ---------- AI THINKING ---------- */
  .ai-thinking{ display:flex; align-items:center; gap:5px; padding:4px 0; }
  .ai-thinking i{ width:6px; height:6px; border-radius:50%; background: var(--accent-sky); animation: think 1.1s ease-in-out infinite; }
  .ai-thinking i:nth-child(2){ animation-delay:.15s; }
  .ai-thinking i:nth-child(3){ animation-delay:.3s; }
  @keyframes think{ 0%,60%,100%{ transform: translateY(0); opacity:.4; } 30%{ transform: translateY(-5px); opacity:1; } }
  .ai-answer.updating{ opacity:.4; filter: blur(1px); transition: all .25s; }
  .ai-avatar.thinking{ animation: spin 3s linear infinite; }

  /* ---------- CHART DRAW-IN ---------- */
  .curve-line{ stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 1.8s var(--ease) forwards .3s; }
  @keyframes draw{ to{ stroke-dashoffset: 0; } }
  .curve-fill{ opacity:0; animation: fadeIn 1s ease forwards 1.4s; }
  @keyframes fadeIn{ to{ opacity:1; } }
  .ring-val{ transition: stroke-dashoffset 1.6s cubic-bezier(.22,.9,.3,1); }

  /* ---------- MAP SWEEP + SYNC ---------- */
  .map-sweep{
    position:absolute; inset:0; border-radius:50%; pointer-events:none;
    background: conic-gradient(from 0deg, rgba(79,195,247,0.35), transparent 25%);
    animation: spin 3.2s linear infinite; transform-origin:center;
    -webkit-mask-image: radial-gradient(circle, black 60%, transparent 100%);
    mask-image: radial-gradient(circle, black 60%, transparent 100%);
  }
  .map-loading{
    position:absolute; inset:0; background: rgba(5,10,20,0.55); display:none;
    align-items:center; justify-content:center; flex-direction:column; gap:8px; z-index:5;
    backdrop-filter: blur(2px);
  }
  .map-loading.show{ display:flex; }
  .map-loading .pl-ring{ width:30px; height:30px; }
  .map-loading span{ font-size:10.5px; color: rgba(255,255,255,.8); font-weight:600; }

  /* ---------- COMPASS NEEDLE TRANSITION ---------- */
  .compass .needle{ transition: transform 1.2s cubic-bezier(.34,1.4,.4,1); }

  /* ---------- BELL SHAKE ---------- */
  @keyframes shake{ 0%,100%{transform:rotate(0);} 20%{transform:rotate(-14deg);} 40%{transform:rotate(11deg);} 60%{transform:rotate(-7deg);} 80%{transform:rotate(4deg);} }
  .icon-btn.ring{ animation: shake .5s ease-in-out; color: var(--accent-amber); border-color: var(--accent-amber); }

  /* ---------- ALERT ENTRANCE ---------- */
  .alert-banner{ animation: slideDown .5s var(--ease); }
  @keyframes slideDown{ from{ opacity:0; transform: translateY(-10px);} to{ opacity:1; transform:translateY(0);} }
  .alert-banner .aic svg{ animation: pulse-op 1.8s ease-in-out infinite; }

  /* ---------- TOAST ---------- */
  .toast svg{ animation: checkPop .4s var(--ease) .1s both; }
  @keyframes checkPop{ from{ transform: scale(0); } to{ transform: scale(1); } }

  /* ---------- NAV ACTIVE SLIDE ---------- */
  .nav-item::before{ transition: opacity .2s var(--ease); }

  /* ---------- RESPONSIVE ---------- */
  @media (max-width: 1180px){
    .metrics-grid{ grid-template-columns: repeat(3,1fr); }
    .grid-2{ grid-template-columns: 1fr; }
  }
  @media (max-width: 900px){
    .sidebar{ position:fixed; left:0; top:0; transform: translateX(-100%); z-index:60; box-shadow: var(--shadow); }
    .sidebar.mobile-open{ transform: translateX(0); }
    .search-wrap{ display:none; }
    .datetime{ display:none; }
    .metrics-grid{ grid-template-columns: repeat(2,1fr); }
    .hero-mid{ flex-direction:column; align-items:flex-start; gap:10px; }
    .content{ padding: 16px 14px 90px; }
  }
  @media (max-width: 600px){
    .metrics-grid{ grid-template-columns: 1fr; }
    .hero-top{ flex-direction: column; align-items: flex-start; gap: 14px; }
    .hero{ padding: 24px 20px; }
    .day-row{ grid-template-columns: 75px 25px 1fr auto 16px; gap: 10px; padding: 12px 14px; }
    .day-row .range-bar, .day-row .dcond{ display: none; }
    .day-detail-grid{ grid-template-columns: repeat(2, 1fr); }
    .topbar{ padding: 10px 14px; }
    .content{ padding: 12px 10px 90px; }
    .day-temps{ font-size: 11.5px; gap: 6px; }
    .instrument{ width: 110px; height: 110px; }
    .instrument-icon svg{ width: 40px; height: 40px; }
    .hero-temp .t{ font-size: 58px; }
    .hero-temp .t sup{ font-size: 24px; }
  }
