/* WaterWise — Scout Guide civic design system */

:root {
  --white:      #ffffff;
  --off-white:  #f8f7f4;
  --charcoal:   #1a1a1a;
  --mid:        #4a4a4a;
  --muted:      #8a8a8a;
  --border:     #e8e4dc;
  --water-blue: #2a6b8a;
  --water-light:#e8f4f8;
  --alert-gold: #c9a84c;
  --alert-red:  #c0392b;
  --status-ok:  #2d7d4e;

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--off-white);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

img, svg { max-width: 100%; display: block; }

/* ---------- Header / Nav ---------- */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px 10px;
  text-align: center;
}

.wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--charcoal);
}

.tagline {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  padding: 14px 8px 0;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.site-nav a.active {
  color: var(--water-blue);
  border-bottom-color: var(--water-blue);
}

/* ---------- Layout ---------- */

main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.page-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  margin: 4px 0 18px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ---------- Weather strip ---------- */

.weather-strip {
  background: var(--water-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.weather-strip__location {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--water-blue);
  margin-bottom: 8px;
}

.weather-strip__row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 15px;
  color: var(--charcoal);
  flex-wrap: wrap;
}

.weather-strip__temp {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  font-style: italic;
}

.weather-strip__note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--mid);
  font-style: italic;
}

.weather-strip__note.is-alert { color: var(--alert-red); font-weight: 500; font-style: normal; }
.weather-strip__note.is-caution { color: var(--alert-gold); font-weight: 500; font-style: normal; }

/* ---------- Status card ---------- */

.status-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 20px;
  margin-bottom: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.status-pill__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-pill.status-normal { background: rgba(45,125,78,0.1); color: var(--status-ok); }
.status-pill.status-normal .status-pill__dot { background: var(--status-ok); }

.status-pill.status-leak { background: rgba(201,168,76,0.15); color: #8a6d1f; }
.status-pill.status-leak .status-pill__dot { background: var(--alert-gold); }

.status-pill.status-check { background: rgba(192,57,43,0.1); color: var(--alert-red); }
.status-pill.status-check .status-pill__dot { background: var(--alert-red); }

.status-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--mid);
}

.status-row:last-of-type { border-bottom: none; }
.status-row span:last-child { color: var(--charcoal); font-weight: 500; }

.status-bill {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 28px;
  font-style: italic;
  font-weight: 600;
  color: var(--water-blue);
}

.status-bill small {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ---------- Block average ---------- */

.block-avg__bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  margin: 12px 0 10px;
}

.block-avg__bar-fill {
  height: 100%;
  background: var(--water-blue);
  border-radius: 4px;
}

.block-avg__numbers {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--mid);
}

.block-avg__numbers strong { color: var(--charcoal); }

.disclaimer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  font-style: italic;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.15s ease;
}

.btn:active { opacity: 0.85; }

.btn-primary { background: var(--water-blue); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--charcoal); border: 1px solid var(--border); }
.btn-gold { background: var(--alert-gold); color: var(--white); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.quick-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"], input[type="number"], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--charcoal);
  background: var(--white);
  margin-bottom: 16px;
}

input[type="file"] { margin-bottom: 16px; }

/* ---------- Reading history table ---------- */

.reading-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.reading-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}

.reading-table td {
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--mid);
}

.reading-table td:first-child { color: var(--charcoal); font-weight: 500; }

/* ---------- Bill screen ---------- */

.read-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.read-compare__col {
  padding: 16px;
  text-align: center;
}

.read-compare__col:first-child { border-right: 1px solid var(--border); }

.read-compare__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.read-compare__value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--charcoal);
}

.read-compare__date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.read-compare__diff {
  text-align: center;
  font-size: 12px;
  color: var(--mid);
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

/* ---------- Diagnostic checklist ---------- */

.checklist-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--water-blue);
}

.checklist-item__body strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--charcoal);
  margin-bottom: 3px;
}

.checklist-item__body span {
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--mid);
  line-height: 1.5;
}

.tier-header {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  font-weight: 600;
  margin: 26px 0 4px;
  color: var(--water-blue);
}

.tier-intro {
  font-size: 13px;
  color: var(--mid);
  margin-bottom: 4px;
  line-height: 1.6;
}

.callout {
  background: var(--water-light);
  border-radius: 8px;
  padding: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--charcoal);
  margin: 16px 0;
}

.callout.callout-alert { background: rgba(192,57,43,0.08); }
.callout.callout-ok { background: rgba(45,125,78,0.08); }

.summary-box {
  background: var(--charcoal);
  color: var(--off-white);
  border-radius: 10px;
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 16px 0;
}

/* ---------- Willa chat ---------- */

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 200px;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-bubble.from-willa {
  background: var(--water-light);
  color: var(--charcoal);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.chat-bubble.from-user {
  background: var(--water-blue);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: 12px;
}

.chat-input-row input {
  flex: 1;
  margin-bottom: 0;
}

.chat-input-row button {
  width: auto;
  padding: 12px 20px;
  margin-bottom: 0;
}

.chat-typing {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  align-self: flex-start;
}

/* ---------- Modal (onboarding) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-sheet {
  background: var(--white);
  width: 100%;
  max-width: 480px;
  border-radius: 16px 16px 0 0;
  padding: 28px 22px 24px;
}

@media (min-width: 540px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: 16px; }
}

.modal-sheet h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  margin: 0 0 8px;
}

.modal-sheet p {
  font-size: 13.5px;
  color: var(--mid);
  line-height: 1.5;
  margin: 0 0 18px;
}

/* ---------- Offline banner ---------- */

.offline-banner {
  background: var(--alert-gold);
  color: var(--white);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  display: none;
}

.offline-banner.is-visible { display: block; }

/* ---------- Utility ---------- */

.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
