/* ============================================================
   style.css — Weather Dashboard (Desktop + Mobile Responsive)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── THEME VARIABLES ── */
:root {
  --bg-grad:    radial-gradient(ellipse at 25% 15%, #4a90d9 0%, #2563b8 28%, #1a3a8a 58%, #162050 100%);
  --glass:      rgba(255,255,255,0.14);
  --glass2:     rgba(255,255,255,0.08);
  --gb:         rgba(255,255,255,0.24);
  --gb2:        rgba(255,255,255,0.12);
  --tw:         white;
  --td:         rgba(255,255,255,0.65);
  --tf:         rgba(255,255,255,0.38);
  --map-filter: hue-rotate(195deg) saturate(.75) brightness(.7);
  --cloud-op:   0.55;
  --sug-bg:     rgba(20,55,160,0.97);
  --badge-bg:   rgba(255,255,255,0.14);
  --pop-bg:     rgba(20,58,180,0.95);
}
body.t-morning {
  --bg-grad:    linear-gradient(160deg,#fde68a 0%,#fbbf24 20%,#fb923c 45%,#e8755a 65%,#c2607c 85%,#7c3c8a 100%);
  --glass:      rgba(255,255,255,0.18); --gb: rgba(255,255,255,0.32); --gb2: rgba(255,255,255,0.16);
  --td: rgba(255,255,255,0.78); --tf: rgba(255,255,255,0.46);
  --map-filter: hue-rotate(20deg) saturate(.9) brightness(.75);
  --sug-bg: rgba(160,70,30,0.97); --badge-bg: rgba(255,255,255,0.18); --pop-bg: rgba(160,70,30,0.95);
}
body.t-day {
  --bg-grad:    radial-gradient(ellipse at 30% 10%,#bfdbfe 0%,#93c5fd 20%,#60a5fa 40%,#3b82f6 65%,#1d4ed8 100%);
  --glass:      rgba(255,255,255,0.22); --gb: rgba(255,255,255,0.40); --gb2: rgba(255,255,255,0.18);
  --td: rgba(255,255,255,0.82); --tf: rgba(255,255,255,0.52);
  --map-filter: hue-rotate(180deg) saturate(.6) brightness(.8);
  --sug-bg: rgba(29,78,216,0.97); --badge-bg: rgba(255,255,255,0.22); --pop-bg: rgba(29,78,216,0.95);
}
body.t-sunset {
  --bg-grad:    linear-gradient(160deg,#1e1b4b 0%,#4c1d95 15%,#7c3aed 30%,#db2777 50%,#f97316 70%,#fbbf24 88%,#fde68a 100%);
  --glass:      rgba(255,255,255,0.12); --gb: rgba(255,255,255,0.22); --gb2: rgba(255,255,255,0.10);
  --td: rgba(255,255,255,0.70); --tf: rgba(255,255,255,0.40);
  --map-filter: hue-rotate(270deg) saturate(.8) brightness(.6);
  --sug-bg: rgba(76,29,149,0.97); --badge-bg: rgba(255,255,255,0.14); --pop-bg: rgba(76,29,149,0.95);
}
body.t-night {
  --bg-grad:    radial-gradient(ellipse at 30% 20%,#1e2d5a 0%,#0f172a 40%,#020617 100%);
  --glass:      rgba(255,255,255,0.07); --gb: rgba(255,255,255,0.14); --gb2: rgba(255,255,255,0.07);
  --td: rgba(255,255,255,0.55); --tf: rgba(255,255,255,0.28); --cloud-op: 0.15;
  --map-filter: hue-rotate(210deg) saturate(.5) brightness(.45);
  --sug-bg: rgba(8,12,35,0.98); --badge-bg: rgba(255,255,255,0.08); --pop-bg: rgba(8,12,35,0.95);
}

/* ── BASE ── */
html, body { width:100%; height:100%; font-family:'Nunito',sans-serif; overflow:hidden; background:#1a3e8a; }

/* ── BACKGROUND ── */
.bg { position:fixed; inset:0; z-index:0; background:var(--bg-grad); transition:background 2s ease; }

/* ── THEME OVERLAY FLASH ── */
#theme-overlay { position:fixed; inset:0; z-index:1; pointer-events:none; opacity:0; transition:opacity .6s; background:rgba(0,0,0,.25); }

/* ── SUN / MOON ── */
#sun  { position:fixed; z-index:2; pointer-events:none; top:6%; right:12%; width:80px; height:80px; opacity:0; transition:opacity 1.5s,top 2s,right 2s; }
#moon { position:fixed; z-index:2; pointer-events:none; top:8%; right:10%; width:60px; height:60px; opacity:0; transition:opacity 1.5s; }
.sun-core  { width:80px; height:80px; border-radius:50%; background:radial-gradient(circle,#fff9c4,#ffd700 40%,#ffb300 80%); box-shadow:0 0 40px 20px rgba(255,200,0,.45),0 0 80px 40px rgba(255,160,0,.2); }
.moon-core { width:60px; height:60px; border-radius:50%; background:radial-gradient(circle at 35% 35%,#f0f4ff,#c8d4f0 50%,#a0b0d8 100%); box-shadow:0 0 30px 12px rgba(180,200,255,.3); }

/* ── STARS ── */
#stars { position:fixed; inset:0; z-index:2; pointer-events:none; opacity:0; transition:opacity 2s; }

/* ── CLOUDS ── */
.cloud { position:fixed; z-index:3; pointer-events:none; transition:opacity 1.5s; }
.cloud svg ellipse { opacity:var(--cloud-op,0.55); }
.c1 { top:-18px; left:2%;  animation:fc 20s ease-in-out infinite; }
.c2 { top:-24px; right:5%; animation:fc 24s ease-in-out infinite reverse; animation-delay:-8s; }
.c3 { top:30px;  left:28%; animation:fc 28s ease-in-out infinite; animation-delay:-12s; }
@keyframes fc { 0%,100%{transform:translateY(0)} 50%{transform:translateY(12px)} }

/* ── THEME BADGE ── */
.theme-badge { position:fixed; bottom:16px; left:80px; z-index:600; background:var(--glass); border:1px solid var(--gb2); border-radius:20px; padding:5px 14px; font-size:11px; font-weight:600; color:var(--td); backdrop-filter:blur(12px); display:flex; align-items:center; gap:6px; letter-spacing:.3px; }

/* ── SIDEBAR — fixed, highest z ── */
.sidebar { position:fixed; left:0; top:0; bottom:0; width:64px; z-index:1000; display:flex; flex-direction:column; align-items:center; padding:18px 0; gap:6px; background:var(--glass2); border-right:1px solid var(--gb2); backdrop-filter:blur(24px); }
.s-logo  { width:38px; height:38px; border-radius:12px; background:var(--glass); border:1px solid var(--gb); display:flex; align-items:center; justify-content:center; margin-bottom:14px; flex-shrink:0; }
.nav-item { width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .2s,color .2s; color:var(--td); flex-shrink:0; user-select:none; }
.nav-item:hover { background:rgba(255,255,255,.15); color:white; }
.nav-item.active { background:rgba(255,255,255,.2); color:white; }
.s-bot { margin-top:auto; display:flex; flex-direction:column; align-items:center; gap:6px; }

/* ── SLIDE PANELS ── */
.nav-panel {
  position:fixed; top:0; left:64px; height:100vh; width:300px;
  z-index:900;
  background:rgba(12,25,80,.82);
  border-right:1px solid var(--gb2);
  backdrop-filter:blur(28px);
  transform:translateX(-110%);
  transition:transform .32s cubic-bezier(.22,1,.36,1);
  display:flex; flex-direction:column;
  padding:24px 20px;
  overflow-y:auto;
}
body.t-morning .nav-panel { background:rgba(120,45,10,.82); }
body.t-day     .nav-panel { background:rgba(15,45,140,.82); }
body.t-sunset  .nav-panel { background:rgba(55,12,95,.82); }
body.t-night   .nav-panel { background:rgba(5,8,28,.88); }
.nav-panel.open { transform:translateX(0); }

.nav-panel-title { font-size:11px; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; color:var(--tf); margin-bottom:20px; padding-bottom:12px; border-bottom:1px solid var(--gb2); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.nav-panel-close { width:26px; height:26px; border-radius:8px; background:var(--glass); border:1px solid var(--gb2); display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--td); transition:background .15s; flex-shrink:0; }
.nav-panel-close:hover { background:var(--gb); color:white; }

/* Stat tiles */
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.stat-tile { background:var(--glass); border:1px solid var(--gb2); border-radius:14px; padding:14px 12px; display:flex; flex-direction:column; gap:6px; transition:background .15s; }
.stat-tile:hover { background:var(--gb2); }
.stat-tile-icon { opacity:.7; }
.stat-tile-val  { font-size:20px; font-weight:300; color:var(--tw); }
.stat-tile-unit { font-size:11px; color:var(--td); }
.stat-tile-lbl  { font-size:10px; font-weight:700; color:var(--tf); letter-spacing:.8px; text-transform:uppercase; }

/* Fav */
.fav-empty { font-size:12px; color:var(--tf); text-align:center; margin-top:40px; line-height:1.8; }
.fav-item  { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:12px; background:var(--glass); border:1px solid var(--gb2); margin-bottom:8px; cursor:pointer; transition:background .15s; }
.fav-item:hover { background:var(--gb2); }
.fav-info  { flex:1; min-width:0; }
.fav-city  { font-size:13px; font-weight:600; color:var(--tw); }
.fav-temp  { font-size:11px; color:var(--tf); }
.fav-big   { font-size:18px; font-weight:300; color:var(--tw); flex-shrink:0; }
.fav-add-btn { display:flex; align-items:center; gap:8px; padding:10px 14px; border-radius:12px; background:var(--glass); border:1px solid var(--gb2); cursor:pointer; color:var(--td); font-size:12px; font-weight:600; transition:background .15s; margin-top:8px; flex-shrink:0; }
.fav-add-btn:hover { background:var(--gb2); color:white; }

/* Calendar */
.cal-day  { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:12px; background:var(--glass); border:1px solid var(--gb2); margin-bottom:8px; transition:background .15s; }
.cal-day:hover { background:var(--gb2); }
.cal-day.today { border-color:rgba(255,255,255,.3); background:rgba(255,255,255,.14); }
.cal-date { font-size:11px; font-weight:700; color:var(--tf); width:54px; flex-shrink:0; line-height:1.4; }
.cal-day.today .cal-date { color:var(--tw); }
.cal-temps { margin-left:auto; text-align:right; flex-shrink:0; }
.cal-hi { font-size:13px; font-weight:700; color:var(--tw); }
.cal-lo { font-size:10px; color:var(--tf); }

/* Settings */
.setting-row { display:flex; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid var(--gb2); }
.setting-row:last-child { border-bottom:none; }
.setting-label { font-size:13px; font-weight:600; color:var(--tw); }
.setting-sub   { font-size:11px; color:var(--tf); margin-top:2px; }
.toggle { width:40px; height:22px; border-radius:11px; background:var(--glass); border:1px solid var(--gb2); position:relative; cursor:pointer; transition:background .2s; flex-shrink:0; }
.toggle.on { background:rgba(74,222,128,.45); border-color:rgba(74,222,128,.35); }
.toggle::after { content:''; position:absolute; width:16px; height:16px; border-radius:50%; background:white; top:2px; left:2px; transition:transform .2s; }
.toggle.on::after { transform:translateX(18px); }
.theme-btn { padding:6px 14px; border-radius:20px; background:var(--glass); border:1px solid var(--gb2); font-size:11px; font-weight:600; color:var(--tw); cursor:pointer; transition:background .15s; }
.theme-btn:hover { background:var(--gb2); }

/* Info */
.info-block { background:var(--glass); border:1px solid var(--gb2); border-radius:14px; padding:14px 16px; margin-bottom:10px; }
.info-block-title { font-size:11px; font-weight:700; color:var(--tf); letter-spacing:.8px; text-transform:uppercase; margin-bottom:6px; }
.info-block p { font-size:12px; color:var(--td); line-height:1.7; }
.info-tag { display:inline-block; font-size:10px; font-weight:700; padding:3px 10px; border-radius:20px; background:rgba(99,179,237,.2); border:1px solid rgba(99,179,237,.3); color:rgba(180,220,255,.9); margin:3px 3px 0 0; }

/* ── BACKDROP ── */
.nav-backdrop { position:fixed; inset:0; z-index:800; display:none; }
.nav-backdrop.open { display:block; }

/* ── APP LAYOUT ── */
.app  { position:relative; z-index:4; display:flex; height:100vh; width:100vw; }
.main { flex:1; margin-left:64px; display:flex; flex-direction:column; padding:14px 14px 12px; min-height:0; }

/* ── TOPBAR ── */
.topbar { display:flex; align-items:center; gap:10px; margin-bottom:12px; flex-shrink:0; }
.search-wrap { flex:1; max-width:360px; position:relative; }
.search-box { display:flex; align-items:center; gap:8px; background:var(--glass); border:1px solid var(--gb); border-radius:50px; padding:8px 16px; backdrop-filter:blur(12px); transition:all .2s; }
.search-box:focus-within { background:rgba(255,255,255,.22); }
.search-box input { background:none; border:none; outline:none; color:white; font-family:'Nunito',sans-serif; font-size:13px; flex:1; min-width:0; }
.search-box input::placeholder { color:var(--tf); }
.suggestions { position:absolute; top:calc(100% + 6px); left:0; right:0; background:var(--sug-bg); border:1px solid var(--gb); border-radius:14px; overflow:hidden; display:none; z-index:5000; backdrop-filter:blur(20px); }
.suggestions.open { display:block; }
.sug-item { padding:10px 16px; font-size:12px; color:var(--td); cursor:pointer; transition:background .15s; display:flex; align-items:center; gap:8px; }
.sug-item:hover { background:rgba(255,255,255,.12); color:white; }
.topbar-right { margin-left:auto; display:flex; align-items:center; gap:8px; }
.clock-badge { background:var(--badge-bg); border:1px solid var(--gb); border-radius:50px; padding:6px 14px; font-size:12px; font-weight:700; color:white; backdrop-filter:blur(10px); letter-spacing:.5px; }
.avatar { width:34px; height:34px; border-radius:50%; background:var(--glass); border:1.5px solid var(--gb); display:flex; align-items:center; justify-content:center; cursor:pointer; }

/* ── CONTENT GRID ── */
.content { flex:1; min-height:0; display:grid; grid-template-columns:240px minmax(0,1fr) 280px; grid-template-rows:1fr 1fr; gap:10px; }

/* ── PANELS ── */
.panel { background:var(--glass); border:1px solid var(--gb2); border-radius:20px; backdrop-filter:blur(18px); transition:background 1.5s,border-color 1.5s; overflow:hidden; }
.panel-title { font-size:10px; font-weight:700; color:var(--tf); letter-spacing:1.2px; text-transform:uppercase; margin-bottom:8px; }

/* Current */
.current-panel { grid-column:1; grid-row:1; padding:18px; display:flex; flex-direction:column; position:relative; }
.cur-label  { font-size:10px; font-weight:700; color:var(--tf); letter-spacing:1.2px; text-transform:uppercase; }
.cur-date   { font-size:11px; color:var(--tf); margin-top:2px; margin-bottom:10px; }
.cur-top    { display:flex; align-items:center; gap:12px; }
.cur-temp-wrap { display:flex; align-items:flex-start; }
.cur-temp   { font-size:60px; font-weight:300; color:white; line-height:1; letter-spacing:-2px; }
.cur-unit   { font-size:22px; font-weight:400; color:var(--td); margin-top:8px; }
.cur-desc   { font-size:13px; color:var(--td); margin-top:6px; }
.cur-city   { font-size:16px; font-weight:700; color:white; margin-top:4px; }
.cur-stats  { display:flex; margin-top:14px; padding-top:14px; border-top:1px solid var(--gb2); }
.cs         { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; }
.cs svg     { opacity:.65; }
.cs-v       { font-size:12px; font-weight:700; color:white; }
.cs-l       { font-size:10px; color:var(--tf); }

/* Map */
.map-panel  { grid-column:2; grid-row:1/3; position:relative; }
#map        { height:100%; width:100%; }
.map-zoom   { position:absolute; top:10px; left:10px; z-index:500; display:flex; gap:5px; }
.mz-btn     { background:rgba(255,255,255,.88); border:none; border-radius:8px; width:28px; height:28px; font-size:16px; font-weight:700; color:#1a3e8a; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s; }
.mz-btn:hover { background:white; }
.map-coord  { position:absolute; bottom:10px; right:10px; z-index:500; background:var(--pop-bg); border:1px solid var(--gb2); border-radius:8px; padding:4px 10px; font-size:10px; font-weight:600; color:white; backdrop-filter:blur(8px); }

/* Popular */
.popular-panel { grid-column:3; grid-row:1; padding:16px 18px; display:flex; flex-direction:column; }
.pop-item   { display:flex; align-items:center; gap:10px; padding:8px 8px; border-radius:12px; cursor:pointer; transition:background .15s; }
.pop-item:hover { background:var(--glass); }
.pop-rank   { font-size:12px; font-weight:700; color:var(--tf); width:16px; text-align:center; flex-shrink:0; }
.pop-info   { flex:1; min-width:0; }
.pop-city   { font-size:13px; font-weight:600; color:white; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pop-cond   { font-size:11px; color:var(--tf); }
.pop-temp   { font-size:15px; font-weight:700; color:white; flex-shrink:0; }

/* Forecast */
.forecast-panel { grid-column:1; grid-row:2; padding:14px 16px; display:flex; flex-direction:column; overflow:hidden; }
.ftabs { display:flex; gap:5px; margin-bottom:8px; flex-shrink:0; }
.ftab  { font-size:11px; font-weight:600; padding:4px 12px; border-radius:20px; cursor:pointer; color:var(--td); transition:background .15s; }
.ftab.active { background:var(--glass); color:white; }
.fday  { display:flex; align-items:center; gap:8px; padding:6px 4px; border-radius:8px; transition:background .15s; flex-shrink:0; }
.fday:hover { background:var(--glass2); }
.fd-i  { width:28px; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.fd-t  { display:flex; flex-direction:column; }
.fd-hi { font-size:13px; font-weight:700; color:white; }
.fd-lo { font-size:10px; color:var(--tf); }
.fd-bar{ flex:1; height:3px; background:rgba(255,255,255,.12); border-radius:2px; overflow:hidden; margin:0 6px; }
.fd-bf { height:100%; border-radius:2px; background:linear-gradient(90deg,rgba(255,255,255,.3),rgba(255,255,255,.75)); transform-origin:left; animation:bIn .8s cubic-bezier(.22,1,.36,1) both; animation-delay:calc(var(--i)*.07s + .5s); }
@keyframes bIn { from{transform:scaleX(0)} to{transform:scaleX(1)} }
.fd-d  { font-size:10px; color:var(--tf); width:52px; text-align:right; flex-shrink:0; }

/* Chart */
.chart-panel { grid-column:3; grid-row:2; padding:16px 18px; display:flex; flex-direction:column; }
.sum-head    { display:flex; align-items:center; gap:8px; margin-bottom:12px; flex-shrink:0; }
.sum-tabs    { display:flex; gap:4px; margin-left:auto; }
.stab        { font-size:10px; font-weight:600; padding:3px 10px; border-radius:20px; cursor:pointer; color:var(--td); transition:background .15s; }
.stab.active { background:var(--glass); color:white; }
.chart-wrap  { flex:1; position:relative; min-height:0; }

/* ── LOADING ── */
.lov { position:absolute; inset:0; z-index:50; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.15); backdrop-filter:blur(6px); border-radius:20px; }
.spinner { width:26px; height:26px; border:3px solid rgba(255,255,255,.15); border-top-color:white; border-radius:50%; animation:spin .65s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
.hidden { display:none !important; }

/* ── LEAFLET ── */
.leaflet-tile               { filter:var(--map-filter); transition:filter 2s; }
.leaflet-container          { background:#1a3a7a !important; }
.leaflet-control-zoom       { display:none; }
.leaflet-popup-content-wrapper { background:var(--pop-bg) !important; color:white !important; border:1px solid var(--gb2) !important; border-radius:10px !important; box-shadow:none !important; font-family:'Nunito',sans-serif !important; }
.leaflet-popup-tip          { background:var(--pop-bg) !important; }
.leaflet-control-attribution { background:rgba(0,0,0,.3) !important; color:rgba(255,255,255,.4) !important; font-size:9px !important; }


/* ============================================================
   MOBILE RESPONSIVE STYLES
   ============================================================ */

/* ── MOBILE BOTTOM NAV (replaces sidebar on mobile) ── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  height: 64px;
  background: var(--glass2);
  border-top: 1px solid var(--gb2);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-item {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--td);
  transition: background .2s, color .2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item.active { color: white; }
.mobile-nav-item span  { font-size: 9px; font-weight: 700; letter-spacing: .3px; }

/* ── MOBILE TOPBAR ── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  height: 60px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: var(--glass2);
  border-bottom: 1px solid var(--gb2);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  align-items: center;
  justify-content: space-between;
}
.mobile-topbar-logo { display: flex; align-items: center; gap: 10px; }
.mobile-topbar-logo-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--glass); border: 1px solid var(--gb); display: flex; align-items: center; justify-content: center; }
.mobile-topbar-title { font-size: 15px; font-weight: 800; color: white; letter-spacing: -.3px; }
.mobile-topbar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--glass); border: 1px solid var(--gb2); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--td); -webkit-tap-highlight-color: transparent; }

/* ── MOBILE SEARCH BAR (below topbar) ── */
.mobile-search {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0;
  z-index: 850;
  padding: 10px 16px;
  background: var(--glass2);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gb2);
}
.mobile-search .search-box { max-width: 100%; border-radius: 14px; }

/* ── MOBILE SCROLL LAYOUT ── */
.mobile-scroll {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: 64px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: 5;
  padding-top: calc(60px + 54px + 12px);
  padding-bottom: 16px;
  padding-left: 14px;
  padding-right: 14px;
}

/* ── MOBILE HERO CARD (current weather) ── */
.mobile-hero {
  background: var(--glass);
  border: 1px solid var(--gb2);
  border-radius: 24px;
  padding: 24px 20px 20px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.mobile-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
  pointer-events: none;
}
.mh-location { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.mh-city { font-size: 16px; font-weight: 800; color: white; }
.mh-label { font-size: 10px; font-weight: 700; color: var(--tf); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px; }
.mh-main { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.mh-temp-wrap { display: flex; align-items: flex-start; }
.mh-temp { font-size: 80px; font-weight: 200; color: white; line-height: 1; letter-spacing: -4px; }
.mh-unit { font-size: 28px; font-weight: 400; color: var(--td); margin-top: 12px; }
.mh-icon { font-size: 64px; line-height: 1; opacity: .9; }
.mh-desc { font-size: 15px; color: var(--td); font-weight: 600; margin-bottom: 16px; }
.mh-stats { display: flex; gap: 0; padding-top: 16px; border-top: 1px solid var(--gb2); }
.mh-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.mh-stat + .mh-stat::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--gb2); }
.mh-stat-v { font-size: 14px; font-weight: 700; color: white; }
.mh-stat-l { font-size: 10px; color: var(--tf); }

/* ── MOBILE SECTION HEADER ── */
.m-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 2px; }
.m-section-title { font-size: 11px; font-weight: 800; color: var(--tf); letter-spacing: 1.2px; text-transform: uppercase; }
.m-section-more { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.45); }

/* ── MOBILE HOURLY STRIP ── */
.mobile-hourly-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.mobile-hourly-strip::-webkit-scrollbar { display: none; }
.mh-hour {
  flex-shrink: 0;
  width: 64px;
  background: var(--glass);
  border: 1px solid var(--gb2);
  border-radius: 16px;
  padding: 12px 8px;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
}
.mh-hour.active { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.3); }
.mh-hour-time { font-size: 10px; font-weight: 700; color: var(--tf); }
.mh-hour.active .mh-hour-time { color: var(--tw); }
.mh-hour-icon { font-size: 22px; }
.mh-hour-temp { font-size: 13px; font-weight: 700; color: white; }

/* ── MOBILE FORECAST CARDS ── */
.mobile-forecast-list { margin-bottom: 12px; }
.mfc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--gb2);
  border-radius: 16px;
  margin-bottom: 8px;
  transition: background .15s;
}
.mfc-item:active { background: var(--gb2); }
.mfc-day { font-size: 13px; font-weight: 700; color: white; width: 36px; flex-shrink: 0; }
.mfc-icon { font-size: 24px; flex-shrink: 0; }
.mfc-desc { font-size: 11px; color: var(--tf); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mfc-bar-wrap { flex: 1; display: flex; align-items: center; gap: 6px; }
.mfc-lo { font-size: 11px; color: var(--tf); flex-shrink: 0; }
.mfc-bar { flex: 1; height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
.mfc-bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, rgba(255,255,255,.3), rgba(255,255,255,.8)); }
.mfc-hi { font-size: 13px; font-weight: 700; color: white; flex-shrink: 0; }

/* ── MOBILE MAP ── */
.mobile-map-card {
  background: var(--glass);
  border: 1px solid var(--gb2);
  border-radius: 24px;
  overflow: hidden;
  height: 220px;
  position: relative;
  margin-bottom: 12px;
}
.mobile-map-card #map-mobile { height: 100%; width: 100%; }
.mobile-map-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 100%);
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.mmo-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.7); letter-spacing: .8px; text-transform: uppercase; }
.mmo-coords { font-size: 10px; color: rgba(255,255,255,.5); }

/* ── MOBILE POPULAR STRIP ── */
.mobile-popular-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.mobile-popular-strip::-webkit-scrollbar { display: none; }
.mps-card {
  flex-shrink: 0;
  width: 130px;
  background: var(--glass);
  border: 1px solid var(--gb2);
  border-radius: 18px;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.mps-card:active { background: var(--gb2); }
.mps-city { font-size: 12px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mps-cond { font-size: 10px; color: var(--tf); }
.mps-icon { font-size: 28px; }
.mps-temp { font-size: 24px; font-weight: 300; color: white; }

/* ── MOBILE STATS GRID ── */
.mobile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.mstat-card {
  background: var(--glass);
  border: 1px solid var(--gb2);
  border-radius: 18px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.mstat-icon { font-size: 20px; opacity: .7; }
.mstat-val { font-size: 24px; font-weight: 300; color: white; line-height: 1; }
.mstat-unit { font-size: 11px; color: var(--td); display: inline; }
.mstat-label { font-size: 10px; font-weight: 700; color: var(--tf); letter-spacing: .8px; text-transform: uppercase; }

/* ── MOBILE SLIDE PANEL (full screen on mobile) ── */
@media (max-width: 767px) {
  .nav-panel {
    left: 0;
    width: 100%;
    top: 0;
    height: 100vh;
    transform: translateY(110%);
    border-right: none;
    border-top: 1px solid var(--gb2);
    padding: 20px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .nav-panel.open {
    transform: translateY(0);
  }
}

/* ── MOBILE THEME BADGE (repositioned) ── */
@media (max-width: 767px) {
  .theme-badge {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(64px + 12px + env(safe-area-inset-bottom));
  }
}

/* ── TABLET (768px – 1023px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Collapse to 2-col layout */
  .content {
    grid-template-columns: 220px minmax(0,1fr);
    grid-template-rows: auto auto auto;
  }
  .map-panel    { grid-column: 2; grid-row: 1 / 3; }
  .popular-panel{ grid-column: 1; grid-row: 2; }
  .forecast-panel { grid-column: 1; grid-row: 3; }
  .chart-panel  { grid-column: 2; grid-row: 3; }

  /* Slightly narrower sidebar */
  .sidebar { width: 56px; }
  .main    { margin-left: 56px; }
}

/* ── MOBILE (≤767px) ── */
@media (max-width: 767px) {
  /* Hide desktop elements */
  .sidebar         { display: none; }
  .app             { display: block; }
  .main            { display: none; }
  .theme-badge     { display: flex; }

  /* Show mobile elements */
  .mobile-nav      { display: flex; }
  .mobile-topbar   { display: flex; }
  .mobile-search   { display: block; }
  .mobile-scroll   { display: block; }

  /* Clouds adjust */
  .c2 { display: none; }
  .c3 { display: none; }

  /* Suggestions full width */
  .suggestions {
    position: fixed;
    top: calc(60px + 54px + 6px);
    left: 14px; right: 14px;
    width: auto;
    border-radius: 18px;
  }
}

/* ── EXTRA SMALL (≤374px) ── */
@media (max-width: 374px) {
  .mh-temp { font-size: 64px; }
  .mh-icon { font-size: 48px; }
  .mobile-stats-grid { grid-template-columns: 1fr; }
}

/* ── LANDSCAPE PHONE ── */
@media (max-width: 767px) and (orientation: landscape) {
  .mobile-scroll {
    padding-top: calc(60px + 54px + 8px);
  }
  .mobile-hero { padding: 16px; }
  .mh-temp { font-size: 56px; }
  .mobile-map-card { height: 160px; }
  .mobile-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── TOUCH IMPROVEMENTS ── */
@media (hover: none) and (pointer: coarse) {
  .pop-item:hover,
  .fav-item:hover,
  .cal-day:hover,
  .stat-tile:hover { background: var(--glass); }

  .pop-item:active  { background: var(--glass); }
  .fav-item:active  { background: var(--gb2); }

  /* Larger tap targets */
  .nav-item, .mobile-nav-item { min-width: 44px; min-height: 44px; }
  .toggle { min-width: 44px; }
}

/* ── SAFE AREA (notch / home indicator) ── */
@supports (padding: max(0px)) {
  .mobile-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    height: calc(64px + env(safe-area-inset-bottom));
  }
  .mobile-scroll {
    padding-bottom: calc(16px + 64px + env(safe-area-inset-bottom));
  }
  .mobile-topbar {
    padding-top: max(0px, env(safe-area-inset-top));
    height: calc(60px + env(safe-area-inset-top));
  }
  .mobile-search {
    top: calc(60px + env(safe-area-inset-top));
  }
}