:root {
  --green: #2E7D32;
  --green-dark: #1B5E20;
  --green-light: #E8F3E9;
  --green-soft: #F1F8F1;
  --orange: #FF6D00;
  --orange-soft: #FFF1E5;
  --cream: #FAFAF5;
  --cream-deep: #F3F2E8;
  --bg: #FFFFFF;
  --ink: #1A1F1A;
  --ink-2: #3F463F;
  --muted: #6E756E;
  --line: #E7E8E1;
  --line-2: #EFEFE7;
  --red: #D84343;
  --red-soft: #FDECEC;
  --yellow: #E8B528;
  --yellow-soft: #FBF3DA;
  --blue: #3E7BB4;
  --blue-soft: #E8F0F8;
  --shadow-sm: 0 1px 2px rgba(20, 30, 20, 0.04), 0 1px 1px rgba(20, 30, 20, 0.03);
  --shadow: 0 1px 3px rgba(20, 30, 20, 0.05), 0 4px 14px rgba(20, 30, 20, 0.05);
  --shadow-lg: 0 8px 28px rgba(20, 30, 20, 0.08), 0 2px 6px rgba(20, 30, 20, 0.04);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

body.dark {
  --bg: #131511;
  --ink: #F0F2EC;
  --ink-2: #C7CCC0;
  --muted: #8A9183;
  --cream: #1B1E18;
  --cream-deep: #232720;
  --line: #2A2E26;
  --line-2: #23261F;
  --green: #7FBE7E;
  --green-dark: #A6D6A4;
  --green-light: #1E2B1E;
  --green-soft: #1A241A;
  --orange: #FF8F3C;
  --orange-soft: #2B1F12;
  --red-soft: #2B1616;
  --yellow-soft: #2A2414;
  --blue-soft: #161E2A;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--green); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }

/* Layout */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--cream);
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 20px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--green);
  display: grid; place-items: center;
  color: #fff; font-weight: 700;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.12);
}
.brand-name {
  font-weight: 800; font-size: 19px; letter-spacing: -0.02em;
}
.brand-name .ii { color: var(--orange); }
.nav-group-label {
  font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 18px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 15px; font-weight: 500;
  color: var(--ink-2);
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--green-soft); color: var(--ink); }
.nav-item.active {
  background: var(--green);
  color: #fff;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.25); color: #fff; }
.nav-icon { width: 22px; display: grid; place-items: center; }
.nav-badge {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  background: var(--orange);
  color: #fff;
  padding: 1px 7px; border-radius: 999px;
  min-width: 20px; text-align: center;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}
.sidebar-profile:hover { background: var(--green-soft); }

/* Main */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 16px;
}
.topbar-title {
  font-size: 20px; font-weight: 700; letter-spacing: -0.015em;
}
.topbar-sub {
  color: var(--muted); font-size: 13px;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--cream); }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--orange);
  border: 2px solid var(--bg);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #7FBE7E, #2E7D32);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  border: 2px solid var(--bg);
  box-shadow: var(--shadow-sm);
}

.page {
  padding: 28px 28px 80px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  animation: fadeSlide 0.35s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-header {
  display: flex; align-items: end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 30px; letter-spacing: -0.02em; font-weight: 800;
}
.page-sub { color: var(--muted); margin-top: 4px; font-size: 15px; }

/* Cards */
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card-white { background: var(--bg); }
.card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
}
.card-sub { color: var(--muted); font-size: 13px; }
.card-link {
  margin-left: auto;
  color: var(--green); font-weight: 600; font-size: 13px;
}
.card-link:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 15px; font-weight: 600;
  transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  line-height: 1;
}
.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 2px rgba(46,125,50,0.2), inset 0 -2px 0 rgba(0,0,0,0.1);
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-accent {
  background: var(--orange); color: #fff;
  box-shadow: 0 1px 2px rgba(255,109,0,0.22), inset 0 -2px 0 rgba(0,0,0,0.1);
}
.btn-accent:hover { background: #e66300; }
.btn-ghost {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--cream-deep); }
.btn-quiet {
  background: transparent;
  color: var(--ink-2);
}
.btn-quiet:hover { background: var(--cream); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  font-size: 12px; font-weight: 600;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink-2);
}
.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-orange { background: var(--orange-soft); color: #C04E00; }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-yellow { background: var(--yellow-soft); color: #8A6818; }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
  display: inline-block;
}

/* Forms */
.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,125,50,0.15);
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.label {
  display: block;
  font-size: 13px; font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-2);
}

/* Checkbox */
.check {
  display: flex; align-items: start; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.check:hover { background: var(--cream-deep); }
.check-box {
  width: 22px; height: 22px; border-radius: 7px;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all 0.15s;
  margin-top: 1px;
  background: var(--bg);
}
.check.done .check-box {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.check.done .check-label { color: var(--muted); text-decoration: line-through; }
.check-label { font-size: 15px; line-height: 1.4; }
.check-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Toggle */
.toggle {
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-radius: 999px;
  background: #fff;
  top: 3px; left: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.18s;
}
.toggle.on { background: var(--green); }
.toggle.on::after { left: 21px; }

/* Grid utilities */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Progress */
.progress {
  width: 100%; height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.4s;
}
.progress-fill.orange { background: var(--orange); }

/* Mobile tab bar */
.tabbar { display: none; }

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
}
.toast.success::before {
  content: '✓';
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 12px; font-weight: 700;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 30, 20, 0.45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  z-index: 150;
  padding: 20px;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted);
  float: right;
}
.modal-close:hover { background: var(--cream); color: var(--ink); }

/* Placeholder SVG */
.ph-img {
  background: repeating-linear-gradient(135deg,
    color-mix(in oklab, var(--green-light) 80%, var(--bg)) 0 14px,
    var(--bg) 14px 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  padding: 10px;
}

/* Chat */
.chat-page { display: flex; flex-direction: column; height: calc(100vh - 65px); }
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}
.msg { display: flex; gap: 10px; margin-bottom: 18px; max-width: 760px; }
.msg-me { margin-left: auto; flex-direction: row-reverse; }
.msg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 16px;
}
.msg-avatar.bot { background: var(--green-light); color: var(--green-dark); }
.msg-avatar.me { background: var(--orange-soft); color: var(--orange); font-weight: 700; }
.msg-bubble {
  background: var(--cream);
  padding: 12px 16px;
  border-radius: 16px;
  border-top-left-radius: 4px;
  font-size: 15px;
  line-height: 1.5;
  max-width: 640px;
  border: 1px solid var(--line);
}
.msg-me .msg-bubble {
  background: var(--green);
  color: #fff;
  border-top-right-radius: 4px;
  border-top-left-radius: 16px;
  border-color: transparent;
}
.msg-bubble ul { padding-left: 20px; margin: 8px 0; }
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble strong { font-weight: 700; }
.chat-composer {
  border-top: 1px solid var(--line);
  padding: 14px 28px 18px;
  background: var(--bg);
  display: flex; align-items: end; gap: 10px;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  min-height: 44px;
  max-height: 180px;
  resize: none;
  font-size: 15px;
  line-height: 1.4;
  background: var(--cream);
}
.chat-input:focus {
  outline: none;
  border-color: var(--green);
  background: var(--bg);
}
.chip {
  display: inline-flex; align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  transition: all 0.15s;
}
.chip:hover { background: var(--green-light); color: var(--green-dark); border-color: var(--green-light); }

/* Skeleton */
.skel {
  background: linear-gradient(90deg, var(--line-2) 0%, var(--line) 50%, var(--line-2) 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Moon calendar */
.moon-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.moon-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 8px;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  position: relative;
}
.moon-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.moon-cell.good { background: var(--green-light); border-color: transparent; }
.moon-cell.neutral { background: var(--yellow-soft); border-color: transparent; }
.moon-cell.bad { background: var(--red-soft); border-color: transparent; }
.moon-cell.today { outline: 2px solid var(--green); outline-offset: -2px; }
.moon-cell.other { opacity: 0.4; }
.moon-date { font-weight: 700; font-size: 15px; }
.moon-phase { margin-top: auto; font-size: 20px; }
.moon-weekday {
  text-align: center;
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  padding: 6px 0;
  letter-spacing: 0.06em;
}

/* Weather */
.wx-big {
  display: flex; align-items: center; gap: 24px;
  padding: 28px;
  background: linear-gradient(135deg, #E8F3E9, #F1F8F1);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
body.dark .wx-big { background: linear-gradient(135deg, #1A241A, #232720); }
.wx-temp { font-size: 64px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.wx-icon { font-size: 72px; line-height: 1; }

/* Photo timeline */
.timeline {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.timeline-item {
  flex-shrink: 0;
  width: 120px;
}
.timeline-ph {
  width: 120px; height: 120px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.timeline-date { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

/* Onboarding */
.onb {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: grid; place-items: center;
  padding: 24px;
}
.onb-card {
  max-width: 480px;
  text-align: center;
}
.onb-hero {
  width: 100%; max-width: 320px;
  aspect-ratio: 1;
  margin: 0 auto 24px;
  display: grid; place-items: center;
}
.onb-dots { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }
.onb-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--line);
}
.onb-dot.active { background: var(--green); width: 24px; }

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 24px;
}
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.6; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }

/* Dropzone */
.drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  background: var(--cream);
  transition: all 0.2s;
  cursor: pointer;
}
.drop:hover, .drop.drag {
  border-color: var(--green);
  background: var(--green-soft);
}

/* Spinner / analyzing */
.analyzing {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.analyzing::before {
  content: ''; position: absolute; inset: 0;
  border: 3px solid var(--green);
  border-radius: inherit;
  animation: pulse 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Mini chart */
.chart {
  display: flex; align-items: end;
  gap: 3px;
  height: 80px;
}
.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--green), var(--green-light));
  border-radius: 3px 3px 0 0;
  min-height: 3px;
}

/* Tabs */
.tabs {
  display: flex; gap: 4px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}
.tab-btn {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 14px; font-weight: 600;
  color: var(--muted);
}
.tab-btn.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Search */
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  max-width: 360px;
}
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; }

/* Responsive — mobile */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: color-mix(in oklab, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0));
    z-index: 50;
  }
  .tab-item {
    padding: 8px 4px 6px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10px; font-weight: 600;
    color: var(--muted);
    border-radius: 8px;
  }
  .tab-item.active { color: var(--green); }
  .tab-icon { font-size: 20px; line-height: 1; }
  .topbar { padding: 12px 16px; }
  .topbar-title { font-size: 17px; }
  .page { padding: 16px 16px 100px; }
  .page-title { font-size: 24px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .wx-big { padding: 20px; gap: 16px; }
  .wx-temp { font-size: 48px; }
  .wx-icon { font-size: 56px; }
  .chat-page { height: calc(100vh - 57px - 60px); }
  .chat-scroll { padding: 16px; }
  .chat-composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0)); }
  .modal { padding: 20px; }
}
@media (min-width: 821px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 820px) {
  .desktop-only { display: none !important; }
}

/* Utilities */
.mt-4 { margin-top: 16px; } .mt-2 { margin-top: 8px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.flex { display: flex; } .flex-1 { flex: 1; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.between { justify-content: space-between; }
.small { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }
.ink-muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Route fade-in */
.page, .chat-page {
  animation: pageIn 0.22s ease;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile toast offset — above bottom tab bar */
@media (max-width: 760px) {
  .toast-stack { bottom: 80px; }
}

/* Selected card */
.card-white.selected {
  border-color: var(--green) !important;
  background: var(--green-soft);
}

/* Upgrade modal banner */
.upgrade-banner {
  background: linear-gradient(135deg, #2E7D32, #4CAF50);
  color: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

/* Chip active override */
.chip.chip-active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ── Responsive 2-column grid helpers ────────────────────────────────────── */
/* Use these classes instead of inline gridTemplateColumns so mobile can override */
.grid-aside        { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 20px; align-items: start; }
.grid-main         { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 16px; }
.grid-diag         { display: grid; grid-template-columns: minmax(0,320px) 1fr; gap: 20px; align-items: start; }
.grid-plant-detail { display: grid; grid-template-columns: minmax(0,340px) 1fr; gap: 24px; align-items: start; }
.grid-profile-cols { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 20px; align-items: start; }
.grid-community    { display: grid; grid-template-columns: 1fr 320px; gap: 18px; }
.grid-extras-side  { display: grid; grid-template-columns: 1fr 360px; gap: 18px; }
.grid-extras-1-15  { display: grid; grid-template-columns: 1fr 1.5fr; gap: 18px; }
.grid-beds-side    { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.grid-halves       { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Auth: full-screen 2-panel layout */
.auth-layout {
  position: fixed; inset: 0; z-index: 500;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}

/* Weather forecast row: always grid on desktop */
.wx-forecast-wrap { width: 100%; }

@media (max-width: 820px) {
  /* All responsive 2-col grids collapse to 1 col */
  .grid-aside, .grid-main, .grid-diag, .grid-plant-detail, .grid-profile-cols,
  .grid-community, .grid-extras-side, .grid-extras-1-15, .grid-beds-side, .grid-halves {
    grid-template-columns: 1fr;
  }

  /* Auth: hide decorative hero panel, show only form */
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { display: none !important; }

  /* Weather forecast: horizontal scroll */
  .wx-forecast-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin: 0 -4px;
    padding: 0 4px 6px;
  }
  .wx-forecast-wrap > .grid {
    grid-template-columns: repeat(7, minmax(90px, 1fr)) !important;
    flex-wrap: nowrap;
  }

  /* Moon calendar: compact cells on small screens */
  .moon-cell { padding: 5px 3px; }
  .moon-date { font-size: 12px; }

  /* Page header: allow wrapping on mobile */
  .page-header { gap: 10px; }
  .page-title { font-size: 22px; }

  /* Notifications panel: sheet from bottom on mobile */
  .notif-panel {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    left: 0 !important;
    bottom: 60px !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 18px 18px 0 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--line) !important;
    box-shadow: var(--shadow-lg) !important;
  }
}
