:root {
  --bg: #f3f6f2;
  --card: #ffffff;
  --primary: #2d5a27;
  --primary-dark: #1f401b;
  --accent: #e8f1e6;
  --text: #1e2923;
  --muted: #5c6b62;
  --border: #dce4da;
  --rain: #1d6fa5;
  --cloud: #5f6f7a;
  --sun: #d9820b;
  --night: #2c3e66;
  --shadow: 0 2px 10px rgba(24, 42, 24, 0.06);
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: 76px;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  text-align: center;
}

.brand h1 {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.subtitle {
  display: block;
  font-size: 0.78rem;
  opacity: 0.9;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Drawer */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 275px;
  max-width: 82vw;
  background: var(--card);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  background: var(--primary);
  color: #fff;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-nav {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: var(--accent);
  border-color: var(--border);
  font-weight: 600;
  color: var(--primary-dark);
}

.drawer-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
}

/* Container & Cards */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: 1rem;
  color: var(--primary-dark);
}

.hint-text {
  font-size: 0.78rem;
  color: var(--muted);
}

.tag-pill {
  font-size: 0.75rem;
  background: var(--accent);
  color: var(--primary-dark);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* Location */
.location-row {
  display: flex;
  gap: 8px;
}

.search-wrap {
  position: relative;
  flex: 1;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fbfdfb;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  list-style: none;
  z-index: 25;
  max-height: 210px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.suggestions li {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.9rem;
}

.suggestions li:last-child {
  border-bottom: none;
}

.suggestions li:hover {
  background: var(--accent);
}

.location-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  color: var(--muted);
}

.badge {
  background: var(--accent);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
}

/* Nowcast 30 min */
.nowcast-summary {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.nowcast-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.nowcast-slot {
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  font-size: 0.82rem;
}

.nowcast-slot strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

/* 3-Day Grid */
.days-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.day-box {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  background: #fafcfa;
  cursor: pointer;
  transition: all 0.15s ease;
}

.day-box.selected {
  border-color: var(--primary);
  background: var(--accent);
}

.day-name {
  font-weight: 700;
  font-size: 0.88rem;
  display: block;
}

.day-icon {
  font-size: 1.55rem;
  margin: 4px 0;
  display: block;
}

.day-desc {
  font-size: 0.8rem;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.day-temps {
  font-size: 0.84rem;
  color: var(--text);
}

.day-rain {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--rain);
  font-weight: 600;
}

/* Hourly Panel */
.hourly-panel {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.hourly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.hourly-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 290px;
  overflow-y: auto;
}

.hour-row {
  display: grid;
  grid-template-columns: 48px 1.35fr 52px 88px 66px;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 10px;
  background: #f8faf7;
  border: 1px solid var(--border);
  font-size: 0.83rem;
}

.hour-row.night-row {
  background: #eef2f8;
  border-color: #d6dfec;
}

.hour-time {
  font-weight: 700;
}

.hour-sky {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.sky-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 20px;
  flex-shrink: 0;
}

.hour-temp {
  font-weight: 700;
  text-align: right;
}

.hour-precip {
  text-align: right;
  color: var(--rain);
  font-weight: 600;
  font-size: 0.78rem;
}

.hour-precip.dry {
  color: var(--muted);
  font-weight: 500;
}

.hour-wind {
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-box {
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
}

.metric-label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
}

.metric-box strong {
  display: block;
  font-size: 0.92rem;
  margin: 2px 0;
}

.metric-box small {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Challenge */
.challenge-text {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.signs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: var(--accent);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Map Tabs */
.map-tabs {
  display: flex;
  gap: 6px;
}

.map-tab {
  border: 1px solid var(--border);
  background: #f8faf7;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.map-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.map-frame-wrap {
  width: 100%;
  height: 250px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.map-caption {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-whatsapp {
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  margin-top: 10px;
}

.btn-secondary {
  background: var(--accent);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.btn-whatsapp {
  background: #1f8b4c;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* Guides & Lists */
.intro {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-item {
  background: #f8faf7;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.guide-item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--primary-dark);
}

.winds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.wind-btn {
  padding: 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8faf7;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.wind-btn.active {
  background: var(--accent);
  border-color: var(--primary);
}

.wind-detail-box,
.astro-box,
.analysis-result {
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8faf7;
  border: 1px solid var(--border);
  padding: 9px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.cricket-controls,
.cricket-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.timer-display {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-dark);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: #fff;
  border-radius: 14px;
  max-width: 440px;
  width: 100%;
  padding: 14px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-header .icon-btn {
  background: var(--accent);
  color: var(--text);
}

.modal-body p {
  font-size: 0.88rem;
  margin-bottom: 8px;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px;
  z-index: 30;
}

.bnav-btn {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 1.05rem;
  color: var(--muted);
  cursor: pointer;
}

.bnav-btn span {
  font-size: 0.72rem;
  font-weight: 600;
}

.bnav-btn.active {
  color: var(--primary);
}

.hidden {
  display: none !important;
}