/* Garden's Pulse — the same brand tokens as the iPhone app (Theme.swift). */

@font-face {
  font-family: "Anton";
  src: url("../fonts/Anton-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --green: #2A4D2A; --green-deep: #1E3A1E; --moss: #DCE7D6; --soil: #523122; --parchment: #EAEAE4; --cream: #FDFFF5;
  --ink: #1A1A1A; --harvest: #C7862B; --alert: #DD1D1D;
  --muted: #5C5C56; --hairline: rgba(26, 26, 26, 0.10); --surface-2: #F4F4EE;
  --radius-button: 6px; --radius-card: 12px; --radius-sheet: 24px;
  --display: "Anton", "Arial Narrow", Impact, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 8px 24px rgba(30, 58, 30, 0.10);
  --tab-h: 62px; --header-h: 52px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --green: #7DB47D; --green-deep: #2A4D2A; --moss: #263426; --soil: #C9A27E; --parchment: #151614; --cream: #222420;
    --ink: #F2F2EC; --harvest: #E0A24A; --alert: #F26060; --muted: #A9A9A0; --hairline: rgba(242, 242, 236, 0.12); --surface-2: #2B2D28;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--parchment); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; min-height: 100vh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
body:not(.signed-in) { padding-bottom: 0; }
a { color: var(--green); }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.tint-green { color: var(--green); } .tint-greenDeep { color: var(--green-deep); } .tint-soil { color: var(--soil); }
.tint-harvest { color: var(--harvest); } .tint-alert { color: var(--alert); }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Display type: Anton, uppercase, a little tracking — like the storefront headings. */
.display { font-family: var(--display); font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.05; color: var(--ink); }
.screen-title { font-size: 30px; }
.card-title { font-size: 18px; }
.hero { font-size: 40px; }

/* Layout */
.header {
  position: sticky; top: 0; z-index: 20; height: var(--header-h); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--parchment) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 8px; }
.brand-name { font-family: var(--display); letter-spacing: 0.06em; font-size: 18px; }
.header-spacer { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--green); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; display: grid; place-items: center; }
.avatar.big { width: 48px; height: 48px; font-size: 16px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline); transition: background 0.3s; }
.sync-dot.busy { background: var(--harvest); animation: pulse 1s infinite; }
.sync-dot.error { background: var(--alert); }
@keyframes pulse { 50% { opacity: 0.3; } }
.main { max-width: 720px; margin: 0 auto; padding: 16px; min-height: 60vh; }
.page { display: flex; flex-direction: column; }
.page.narrow { max-width: 640px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.stack-l { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--hairline); z-index: 20;
}
body:not(.signed-in) .tabbar, body:not(.signed-in) .sidebar { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; }
.tab.active { color: var(--green); }
.tab .icon { width: 24px; height: 24px; }
.sidebar { display: none; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: fixed; top: var(--header-h); left: 0; bottom: 0; width: 220px; padding: 20px 12px; border-right: 1px solid var(--hairline); }
  .side-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); border: 0; background: none; cursor: pointer; font-size: 15px; }
  .side-link.active { background: var(--moss); color: var(--green); font-weight: 600; }
  .side-link .icon { width: 20px; height: 20px; }
  .side-spacer { flex: 1; }
  .main { margin-left: 220px; max-width: none; padding: 24px 32px; }
  .page { max-width: 760px; }
}
.icon { width: 18px; height: 18px; vertical-align: -3px; flex: none; }

/* Cards, rows, tags */
.card { background: var(--cream); border-radius: var(--radius-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 0 var(--hairline); }
.card.list-card { padding: 4px 0; gap: 0; }
.card-link { flex-direction: row; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; }
.card:not(.list-card) > .row { padding: 0; }
.row-button { width: 100%; background: none; border: 0; cursor: pointer; color: inherit; text-decoration: none; border-bottom: 1px solid var(--hairline); }
.list-card .row-button:last-child { border-bottom: 0; }
.row-button:hover { background: var(--surface-2); }
.row-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.row-icon.big { width: 56px; height: 56px; border-radius: 16px; }
.row-icon .icon { width: 20px; height: 20px; }
.row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; }
.row-subtitle { font-size: 13px; color: var(--muted); }
.row-trailing { flex: none; }
.row-chevron { color: var(--muted); width: 16px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 100px; background: color-mix(in srgb, currentColor 12%, transparent); white-space: nowrap; }
.tag .icon { width: 13px; height: 13px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-value { font-family: var(--display); font-size: 32px; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.divider { height: 1px; background: var(--hairline); }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.fact:last-child { border-bottom: 0; }
.fact-value { font-weight: 500; text-align: right; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.month-title { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 6px; }
.season-head { display: flex; gap: 12px; align-items: center; }
.detail-head { display: flex; flex-direction: column; gap: 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 500; }
.tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.diagnosis { font-weight: 600; color: var(--soil); }
.reply-summary { font-size: 17px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: var(--radius-button); border: 1px solid transparent; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; line-height: 1; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-deep); }
.btn-secondary { background: var(--moss); color: var(--green); }
.btn-ghost { background: transparent; color: var(--green); }
.btn-link { background: none; padding: 4px 0; color: var(--green); font-weight: 600; }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--alert); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--alert); }
.btn-hero { background: #fff; color: var(--green-deep); }
.btn-hero-outline { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.actions { display: flex; justify-content: space-between; gap: 12px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; padding: 9px 14px; border-radius: 100px; background: var(--cream); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; color: var(--ink); }
.chip-small { padding: 6px 11px; font-size: 13px; }
.chip:hover { border-color: var(--green); }
.segments { display: flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; }
.segment { flex: 1; text-align: center; padding: 7px 10px; border-radius: 6px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--muted); border: 0; background: none; cursor: pointer; }
.segment.active { background: var(--cream); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--muted); }
.input { width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--hairline); background: var(--surface-2); font-size: 16px; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--green) 45%, transparent); border-color: var(--green); }
textarea.input { resize: vertical; min-height: 56px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle input { width: 44px; height: 26px; appearance: none; background: var(--hairline); border-radius: 100px; position: relative; cursor: pointer; flex: none; transition: background 0.2s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.toggle input:checked { background: var(--green); }
.toggle input:checked::after { transform: translateX(18px); }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--green); background: none; color: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.check.on { background: var(--green); color: #fff; }
.check .icon { width: 16px; height: 16px; }
.task.done .row-title { text-decoration: line-through; color: var(--muted); }
.error { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--alert) 10%, transparent); color: var(--alert); font-size: 14px; }
.banner { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--harvest) 12%, transparent); color: var(--soil); font-size: 14px; }

/* Hero */
.hero { position: relative; border-radius: var(--radius-card); padding: 24px; color: #fff; background: linear-gradient(135deg, var(--green-deep), var(--green)); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.hero .hero-icon { width: 40px; height: 40px; stroke-width: 1.2; }
.hero .hero-title { color: #fff; font-size: 28px; }
.hero p { opacity: 0.92; font-size: 15px; }

/* Journal thumbs, blog cards */
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.thumb { flex: none; width: 140px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.thumb-img { width: 140px; height: 110px; border-radius: 10px; background: var(--moss); display: grid; place-items: center; overflow: hidden; color: var(--green); }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.thumb-caption { font-size: 13px; font-weight: 500; }
.thumb-date { font-size: 12px; color: var(--muted); }
.thumb-small { width: 48px; height: 48px; border-radius: 8px; background: var(--moss); display: grid; place-items: center; overflow: hidden; color: var(--green); flex: none; }
.thumb-small img { width: 100%; height: 100%; object-fit: cover; }
.blog-card { flex: none; width: 260px; background: var(--cream); border-radius: var(--radius-card); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; }
.blog-card img, .blog-placeholder { width: 100%; height: 140px; object-fit: cover; background: var(--moss); display: grid; place-items: center; color: var(--green); }
.blog-card > span { padding: 0 12px; }
.blog-title { font-weight: 600; font-size: 15px; margin-top: 6px; }
.blog-excerpt { font-size: 13px; color: var(--muted); }
.post-image { border-radius: var(--radius-card); }
.prose img { border-radius: 10px; }
.prose a { color: var(--green); }
.markdown h3 { font-size: 17px; margin: 10px 0 4px; }
.markdown p, .markdown ul, .markdown ol { margin: 0 0 10px; }
.pdf-frame { width: 100%; height: 75vh; border: 0; border-radius: var(--radius-card); background: var(--cream); }

/* Photo */
.photo-preview { position: relative; border-radius: var(--radius-card); overflow: hidden; background: var(--moss); }
.photo-preview img { width: 100%; max-height: 360px; object-fit: contain; }
.photo-change { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.5); color: #fff; }
.photo-empty { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Empty states, launch, sign-in, onboarding */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 16px; }
.empty-icon .icon { width: 40px; height: 40px; color: var(--green); }
.launch { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.launch .display { font-size: 24px; }
.signin { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }
.signin-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.signin-logo { border-radius: 22px; }
.tagline { font-size: 18px; color: var(--soil); }
.signin-card h2 { font-size: 18px; }
.onboarding { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding-top: 12px; }
.onboarding-progress { display: flex; gap: 6px; }
.onboarding-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--hairline); }
.onboarding-progress span.on { background: var(--green); }
.onboarding-head { display: flex; flex-direction: column; gap: 8px; }
.big-icon .icon { width: 36px; height: 36px; color: var(--green); }

/* Sheets */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.sheet-backdrop.open { opacity: 1; }
.sheet { background: var(--parchment); width: 100%; max-height: 92vh; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; display: flex; flex-direction: column; transform: translateY(20px); transition: transform 0.2s; }
.sheet-backdrop.open .sheet { transform: none; }
.sheet-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 8px 8px 4px; border-bottom: 1px solid var(--hairline); }
.sheet-title { font-weight: 600; text-align: center; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 6px; }
.sheet-body { padding: 16px; overflow-y: auto; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { max-width: 560px; border-radius: var(--radius-sheet); max-height: 88vh; }
  .sheet-wide { max-width: 680px; }
}
body.has-sheet { overflow: hidden; }
.membership .actions-row { margin-top: 4px; }
.locked { border: 1px solid color-mix(in srgb, var(--alert) 30%, transparent); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--parchment); padding: 10px 16px; border-radius: 100px; font-size: 14px; opacity: 0; transition: all 0.25s; z-index: 60; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--alert); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
