:root {
  --ink: #10281d;
  --ink-soft: #516159;
  --green: #123f2d;
  --green-light: #dfe8d2;
  --sage: #a9ba91;
  --cream: #f7f5ef;
  --paper: #fffefa;
  --sand: #e9e4d9;
  --terracotta: #a65029;
  --danger: #9c3d2f;
  --line: rgba(16, 40, 29, 0.12);
  --shadow: 0 20px 55px rgba(28, 43, 34, 0.10);
  --radius: 24px;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 2%, rgba(192, 207, 169, 0.19), transparent 28rem),
    var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-loader {
  display: grid;
  place-content: center;
  min-height: 100vh;
  text-align: center;
  color: var(--ink-soft);
}

.brand-seed {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: auto;
  border-radius: 50% 50% 50% 12px;
  background: var(--green);
  color: white;
  font: 700 24px Georgia, serif;
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe { 50% { transform: scale(1.08) rotate(-2deg); } }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.7px;
}

.brand > span:last-child > span { color: #537862; }
.brand__mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px 18px 18px 18px; color: var(--cream); background: var(--green); transform: rotate(-4deg); }
.brand__mark svg { width: 17px; height: 17px; transform: rotate(4deg); }
.brand--compact { font-size: 17px; letter-spacing: -0.45px; }
.brand--compact .brand__mark { width: 27px; height: 27px; border-radius: 8px 15px 15px 15px; }

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: 0.65; }
.button svg { width: 19px; height: 19px; }
.button--wide { width: 100%; }
.button--primary { background: var(--green); color: white; box-shadow: 0 10px 25px rgba(18, 63, 45, 0.17); }
.button--primary:hover { background: #0d3425; box-shadow: 0 13px 30px rgba(18, 63, 45, 0.23); }
.button--secondary { border: 1px solid var(--line); background: var(--paper); color: var(--green); }
.button--cream { color: var(--green); background: #f7f1df; white-space: nowrap; }
.button--text, .button--danger-text { min-height: 42px; background: transparent; box-shadow: none; }
.button--text { color: var(--ink-soft); }
.button--danger-text { color: var(--danger); }

.icon-button {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(16, 40, 29, 0.08);
  border-radius: 50%;
  background: rgba(255, 254, 250, 0.92);
  color: var(--ink);
  box-shadow: 0 5px 18px rgba(28, 43, 34, 0.1);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.icon-button:hover { transform: translateY(-1px); background: white; }

.eyebrow {
  margin: 0 0 7px;
  color: #5d7768;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.public-app { min-height: 100vh; overflow-x: clip; }

.garden-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 24px 0;
}

.public-nav, .studio-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.preview-link {
  font-size: 13px;
  font-weight: 650;
  color: #426451;
  border-bottom: 1px solid #a5b7a4;
}

.profile-header {
  position: relative;
  padding: 27px 14px 28px;
  text-align: center;
}

.profile-share { position: absolute; top: 18px; right: 0; }

.avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
  border: 5px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 15px 35px rgba(33, 57, 43, 0.16);
}

.profile-header h1 {
  margin: 0;
  font: 500 clamp(34px, 10vw, 48px)/1.05 Georgia, "Times New Roman", serif;
  letter-spacing: -1.8px;
}

.profile-bio { max-width: 390px; margin: 13px auto 17px; color: var(--ink-soft); line-height: 1.55; }

.plant-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.plant-count svg { width: 17px; height: 17px; color: var(--green); }
.plant-count strong { color: var(--green); }

.collection { padding: 6px 0 42px; }

.plant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }

.plant-card {
  overflow: hidden;
  border: 1px solid rgba(16, 40, 29, 0.07);
  border-radius: 19px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: 0 8px 24px rgba(38, 53, 44, 0.07);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.plant-card:hover { transform: translateY(-3px); box-shadow: 0 13px 30px rgba(38, 53, 44, 0.12); }
.plant-card__image-wrap { overflow: hidden; aspect-ratio: 1 / 1.05; background: #e7e2d5; }
.plant-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.plant-card:hover img { transform: scale(1.025); }
.plant-card__body { min-height: 78px; padding: 12px 13px 13px; }
.plant-card h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.15; letter-spacing: -0.35px; }
.plant-card p { margin: 0; color: var(--ink-soft); font-size: 12px; }

.reveal { animation: reveal 450ms both; animation-delay: var(--delay, 0ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }

.home-cta {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  margin: 18px 0 46px;
  padding: 30px;
  border-radius: 27px;
  background: var(--green);
  color: white;
}

.home-cta__leaf { position: absolute; right: -35px; top: -32px; opacity: 0.08; transform: rotate(-22deg); }
.home-cta__leaf svg { width: 170px; height: 170px; }
.home-cta .eyebrow { color: #bbd0ae; }
.home-cta h2 { max-width: 380px; margin: 0; font: 500 28px/1.12 Georgia, serif; letter-spacing: -0.8px; }
.home-cta p:not(.eyebrow) { max-width: 420px; margin: 12px 0 0; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.5; }

.public-footer { padding: 34px 0 max(40px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; }
.public-footer > a:first-child { display: inline-flex; }
.public-footer p { margin: 10px 0 17px; color: var(--ink-soft); font: italic 14px Georgia, serif; }
.text-link { display: inline-flex; align-items: center; gap: 3px; color: var(--green); font-size: 13px; font-weight: 700; }
.text-link svg { width: 16px; height: 16px; }

.empty-garden { grid-column: 1/-1; padding: 55px 25px; border: 1px dashed #bdc8bc; border-radius: 22px; text-align: center; color: var(--ink-soft); }
.empty-garden h3 { margin: 14px 0 7px; color: var(--ink); font: 500 24px Georgia, serif; }
.empty-garden p { margin: 0; line-height: 1.5; }

.owner-garden-shell { padding-bottom: max(112px, calc(env(safe-area-inset-bottom) + 92px)); }
.owner-garden-nav__actions { display: flex; align-items: center; gap: 12px; }
.owner-mini-avatar {
  appearance: none;
  position: relative;
  width: 45px;
  height: 45px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 6px 18px rgba(28,43,34,.14);
  cursor: pointer;
}
.owner-mini-avatar > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.owner-mini-avatar > span { position: absolute; right: -4px; bottom: -3px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--paper); border-radius: 50%; background: var(--green); color: white; }
.owner-mini-avatar svg { width: 11px; height: 11px; stroke-width: 2.2; }
.owner-profile-edit { top: 18px; }
.owner-profile-avatar { appearance: none; display: block; margin: 0 auto; padding: 0; border: 0; background: transparent; cursor: pointer; }
.owner-profile-avatar .avatar { transition: transform 160ms ease, box-shadow 160ms ease; }
.owner-profile-avatar:hover .avatar { transform: translateY(-2px); box-shadow: 0 18px 39px rgba(33,57,43,.21); }
.owner-profile-header .profile-bio:empty { color: #7a867f; font-style: italic; }
.owner-collection { padding-bottom: 0; }
.owner-garden-search { margin: 0 0 13px; }
.owner-plant-card { position: relative; }
.owner-plant-card__main { appearance: none; display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.owner-plant-card__main .plant-card__image-wrap, .owner-plant-card__main .plant-card__body { display: block; }
.owner-plant-card__main .plant-card__body strong { display: block; margin: 0 0 4px; font-size: 17px; line-height: 1.15; letter-spacing: -.35px; }
.owner-plant-card__main .plant-card__body small { display: block; color: var(--ink-soft); font-size: 12px; }
.owner-card-edit { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-color: rgba(255,255,255,.6); background: rgba(255,254,250,.94); box-shadow: 0 5px 16px rgba(12,35,22,.2); }
.owner-card-edit svg { width: 17px; height: 17px; }
.add-plant-button.owner-add-plant { position: static; width: 100%; margin: -3px 0 18px; transform: none; }
.add-plant-button.owner-add-plant:hover { transform: translateY(-1px); }
.empty-garden svg { width: 35px; height: 35px; color: var(--sage); }
.empty-garden h3 { margin: 12px 0 6px; color: var(--ink); font: 500 23px Georgia, serif; }
.empty-garden p { margin: 0; }

.plant-story { position: relative; z-index: 2; width: min(100%, 720px); min-height: 100vh; margin: 0 auto; border-radius: var(--story-swipe-radius, 0); background: var(--paper); box-shadow: var(--shadow); transform: translate3d(var(--story-swipe-x, 0), 0, 0); touch-action: pan-y pinch-zoom; }
.plant-story.is-swiping { overflow: hidden; box-shadow: 0 18px 55px rgba(2,14,8,.28); will-change: transform, border-radius; }
.plant-story.is-swipe-settling { transition: transform 240ms cubic-bezier(.2,.72,.2,1), border-radius 240ms ease, box-shadow 240ms ease; }
.plant-story.is-swipe-leaving { border-radius: 22px; box-shadow: 0 20px 60px rgba(2,14,8,.32); transition: transform 230ms cubic-bezier(.2,.72,.2,1); will-change: transform; }
body.is-story-swiping { overflow-x: hidden; overscroll-behavior-x: none; }
.story-swipe-preview { --swipe-reveal: 0; --swipe-preview-x: 0px; position: fixed; z-index: 1; top: 0; bottom: 0; left: 50%; display: none; width: min(100%, 720px); overflow: hidden; background: var(--green); color: white; opacity: var(--swipe-reveal); transform: translateX(-50%); }
.story-swipe-preview.is-back, .story-swipe-preview.is-next { display: block; }
.story-swipe-preview > img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.025); }
.story-swipe-preview__veil { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(5,22,13,.82), rgba(5,22,13,.28) 60%, rgba(5,22,13,.58)); }
.story-swipe-preview__label { position: absolute; top: 50%; display: grid; gap: 4px; max-width: min(72%, 340px); transform: translateY(-50%) translateX(var(--swipe-preview-x)); }
.story-swipe-preview.is-back .story-swipe-preview__label { left: 25px; text-align: left; }
.story-swipe-preview.is-next .story-swipe-preview__label { right: 25px; justify-items: end; text-align: right; }
.story-swipe-preview__label > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 6px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: rgba(7,31,19,.3); backdrop-filter: blur(8px); }
.story-swipe-preview__label svg { width: 20px; height: 20px; }
.story-swipe-preview__label p { margin: 0; color: rgba(255,255,255,.76); font-size: 10px; font-weight: 750; letter-spacing: 1.5px; text-transform: uppercase; }
.story-swipe-preview__label strong { font: 500 clamp(27px, 8vw, 42px)/1.05 Georgia, serif; letter-spacing: -1px; }
.plant-hero { position: relative; overflow: hidden; height: min(66vh, 590px); min-height: 430px; background: #dfe2d6; overscroll-behavior-y: contain; }
.plant-hero > img { width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--hero-pull, 0)) scale(var(--hero-scale, 1)); transform-origin: center top; will-change: transform; }
.plant-hero::after { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(to bottom, rgba(7,24,15,.18), transparent 25%, transparent 67%, rgba(6,23,13,.13)); pointer-events: none; }
.hero-photo-open { appearance: none; position: absolute; z-index: 2; inset: 0; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.hero-photo-open:focus-visible { outline: 3px solid white; outline-offset: -7px; }
.hero-photo-cue { position: absolute; z-index: 3; left: 50%; bottom: 61px; display: flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.38); border-radius: 18px; background: rgba(8,30,19,.48); color: white; box-shadow: 0 5px 18px rgba(7,21,13,.12); pointer-events: none; transform: translateX(-50%); transition: transform 150ms ease, background 150ms ease; backdrop-filter: blur(8px); white-space: nowrap; }
.hero-photo-cue span { display: grid; place-items: center; }
.hero-photo-cue svg { width: 15px; height: 15px; }
.hero-photo-cue small { font-size: 10px; font-weight: 650; }
.hero-photo-cue.is-pulling { transform: translateX(-50%) translateY(8px); }
.hero-photo-cue.is-ready { background: rgba(18,63,45,.9); transform: translateX(-50%) translateY(10px) scale(1.04); }
.story-back, .story-share { position: absolute; z-index: 4; top: max(20px, env(safe-area-inset-top)); }
.story-back { left: 20px; }
.story-share { right: 20px; }
.hero-brand { position: absolute; z-index: 4; left: 50%; top: max(27px, calc(env(safe-area-inset-top) + 7px)); transform: translateX(-50%); filter: drop-shadow(0 2px 5px rgba(255,255,255,.5)); }

body.is-viewing-photo { overflow: hidden; }
.photo-viewer { --viewer-opacity: 1; position: fixed; z-index: 300; inset: 0; overflow: hidden; background: rgba(5,14,9,var(--viewer-opacity)); color: white; opacity: 0; transition: opacity 180ms ease, background 80ms linear; }
.photo-viewer.is-open { opacity: 1; }
.photo-viewer__header { position: absolute; z-index: 3; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; min-height: calc(68px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 18px 0 22px; background: linear-gradient(to bottom, rgba(2,10,6,.72), transparent); pointer-events: none; }
.photo-viewer__header strong { overflow: hidden; max-width: calc(100% - 75px); font: 500 18px Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.photo-viewer__close { appearance: none; display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(255,255,255,.12); color: white; cursor: pointer; pointer-events: auto; backdrop-filter: blur(10px); }
.photo-viewer__close svg { width: 21px; height: 21px; }
.photo-viewer__stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; cursor: grab; touch-action: none; }
.photo-viewer__stage:active { cursor: grabbing; }
.photo-viewer__stage img { width: auto; height: auto; max-width: 100vw; max-height: 100dvh; object-fit: contain; user-select: none; -webkit-user-drag: none; will-change: transform; }
.photo-viewer__hint { position: absolute; z-index: 2; right: 18px; bottom: max(91px, calc(env(safe-area-inset-bottom) + 79px)); left: 18px; margin: 0; color: rgba(255,255,255,.62); font-size: 10px; font-weight: 600; text-align: center; pointer-events: none; }
.photo-viewer__controls { position: absolute; z-index: 3; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; display: grid; grid-template-columns: 48px 74px 48px; gap: 3px; padding: 4px; border: 1px solid rgba(255,255,255,.18); border-radius: 28px; background: rgba(10,27,18,.72); box-shadow: 0 9px 30px rgba(0,0,0,.22); transform: translateX(-50%); backdrop-filter: blur(12px); }
.photo-viewer__controls button { appearance: none; min-height: 44px; padding: 0; border: 0; border-radius: 22px; background: transparent; color: white; font-size: 23px; cursor: pointer; }
.photo-viewer__controls button:active { background: rgba(255,255,255,.12); }
.photo-viewer__controls button:nth-child(2) { font-size: 11px; font-weight: 700; }

.story-sheet {
  position: relative;
  z-index: 3;
  margin-top: -42px;
  padding: 39px 28px 0;
  border-radius: 34px 34px 0 0;
  background: var(--paper);
}

.story-sheet > h1 { margin: 0; font: 500 clamp(38px, 10vw, 54px)/1.04 Georgia, serif; letter-spacing: -1.8px; }
.since-line { margin: 11px 0 0; color: #536259; font-size: 14px; }
.since-line span { padding: 0 4px; color: #97a198; }
.plant-note { max-width: 550px; margin: 24px 0 0; padding-left: 17px; border-left: 2px solid var(--sage); color: var(--ink-soft); font: italic 17px/1.55 Georgia, serif; }
.timeline { padding: 48px 0 32px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font: 500 28px/1.1 Georgia, serif; letter-spacing: -0.7px; }
.section-heading > span { display: grid; place-items: center; min-width: 31px; height: 31px; border-radius: 50%; background: var(--green-light); color: var(--green); font-size: 12px; font-weight: 700; }

.timeline-list { position: relative; }
.timeline-list::before { content: ""; position: absolute; top: 23px; bottom: 15px; left: 72px; width: 1px; background: #ccd5c7; }
.timeline-entry { position: relative; display: grid; grid-template-columns: 56px 18px 1fr; gap: 9px; padding-bottom: 27px; }
.timeline-entry time { padding-top: 2px; color: #5f6e65; line-height: 1.05; text-align: right; }
.timeline-entry time strong { display: block; color: var(--ink); font: 500 23px Georgia, serif; }
.timeline-entry time span { font-size: 10px; line-height: 1.25; text-transform: uppercase; }
.timeline-dot { z-index: 1; width: 9px; height: 9px; margin: 9px auto 0; border: 2px solid var(--paper); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.timeline-content { overflow: hidden; border-radius: 17px; background: #f1eee6; }
.timeline-content img { width: 100%; aspect-ratio: 1.55; object-fit: cover; }
.timeline-content p { margin: 0; padding: 15px; font-size: 14px; line-height: 1.45; }
.empty-timeline { padding: 35px 20px; border: 1px dashed #c8d0c3; border-radius: 18px; color: var(--ink-soft); text-align: center; }
.empty-timeline svg { color: var(--sage); }
.back-to-garden { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 42px; color: var(--green); font-size: 13px; font-weight: 700; }
.back-to-garden svg { width: 17px; }

.studio-app { min-height: 100vh; }
.studio-shell, .editor-shell { width: min(100%, 720px); min-height: 100vh; margin: 0 auto; padding: 0 24px max(112px, calc(env(safe-area-inset-bottom) + 92px)); }
.studio-nav { border-bottom: 1px solid var(--line); }
.studio-nav > div { display: flex; align-items: center; gap: 14px; }
.studio-nav .icon-button { width: 40px; height: 40px; flex-basis: 40px; }
.studio-heading { padding: 36px 0 24px; }
.studio-heading h1 { margin: 0 0 8px; font: 500 clamp(36px, 8vw, 48px)/1 Georgia, serif; letter-spacing: -1.5px; }
.studio-heading > p:last-child { margin: 0; color: #4f6a5a; font-size: 13px; }

.search-field {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 0 17px;
  margin-bottom: 14px;
  border: 1px solid rgba(16, 40, 29, 0.06);
  border-radius: 17px;
  background: #ebe8e1;
  color: #6a746d;
}

.search-field svg { width: 19px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-field input::placeholder { color: #7b817d; }

.studio-list { display: grid; gap: 8px; }
.studio-plant { display: grid; grid-template-columns: 92px 1fr 46px; align-items: center; gap: 13px; min-height: 108px; padding: 8px; border-bottom: 1px solid var(--line); }
.studio-plant > img { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; }
.studio-plant__main { display: flex; flex-direction: column; align-items: flex-start; align-self: stretch; justify-content: center; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.studio-plant__main strong { overflow: hidden; max-width: 100%; margin-bottom: 3px; font-size: 18px; letter-spacing: -0.35px; text-overflow: ellipsis; white-space: nowrap; }
.studio-plant__main span { color: var(--ink-soft); font-size: 13px; }
.studio-plant__main small { margin-top: 8px; color: #718078; font-size: 10px; font-weight: 650; letter-spacing: .55px; text-transform: uppercase; }
.edit-button { width: 40px; height: 40px; flex-basis: 40px; box-shadow: none; }

.add-plant-button {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(calc(100% - 48px), 672px);
  transform: translateX(-50%);
}
.add-plant-button:hover { transform: translateX(-50%) translateY(-1px); }

.studio-empty { padding: 68px 25px; text-align: center; color: var(--ink-soft); }
.studio-empty svg { width: 39px; height: 39px; color: var(--sage); }
.studio-empty h2, .studio-empty h3 { margin: 14px 0 7px; color: var(--ink); font: 500 25px Georgia, serif; }
.studio-empty p { max-width: 340px; margin: 0 auto; line-height: 1.5; }
.studio-empty--small { padding: 40px 15px; }
.studio-empty--small h3 { font-size: 21px; }

.editor-shell { padding-bottom: 60px; background: var(--paper); box-shadow: 0 0 55px rgba(28,43,34,.06); }
.editor-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 72px; border-bottom: 1px solid var(--line); }
.editor-nav strong { text-align: center; font-size: 15px; }
.editor-nav .icon-button { box-shadow: none; }
.editor-form { display: grid; gap: 23px; padding: 24px 0; }
.editor-form--compact { padding-top: 7px; }

.photo-field {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 330px;
  border: 1px dashed #aeb9ac;
  border-radius: 23px;
  background: #ebe9df;
}

.photo-field > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { text-align: center; color: var(--ink-soft); }
.photo-placeholder svg { width: 47px; height: 47px; color: #8aa07e; }
.photo-placeholder p { margin: 12px 0 3px; color: var(--ink); font: 500 21px Georgia, serif; }
.photo-placeholder span { font-size: 11px; }
.photo-actions { position: absolute; z-index: 2; left: 50%; bottom: 17px; display: flex; justify-content: center; gap: 8px; transform: translateX(-50%); }
.photo-action { appearance: none; display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 15px; border: 0; border-radius: 22px; background: rgba(255,254,250,.95); box-shadow: 0 7px 18px rgba(12,35,22,.17); color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.photo-action svg { width: 19px; }
.photo-field.is-processing::after { content: "Ottimizzo la foto…"; position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; background: rgba(247,245,239,.82); color: var(--green); font-weight: 700; }

body.is-editing-photo { overflow: hidden; }
.photo-editor {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(8, 25, 17, .72);
  opacity: 0;
  transition: opacity 160ms ease;
}
.photo-editor.is-open { opacity: 1; }
.photo-editor__sheet { width: min(100%, 480px); max-height: calc(100dvh - 36px); overflow-y: auto; padding: 0 20px 20px; border-radius: 26px; background: var(--paper); box-shadow: 0 28px 80px rgba(5,18,11,.35); }
.photo-editor__sheet > header { position: sticky; z-index: 2; top: 0; display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; min-height: 60px; margin: 0 -4px; background: var(--paper); text-align: center; }
.photo-editor__sheet > header strong { font-size: 14px; }
.photo-editor__cancel { padding: 10px 4px; border: 0; background: transparent; color: var(--ink-soft); font-size: 13px; cursor: pointer; text-align: left; }
.photo-editor__hint { margin: 2px 0 10px; color: var(--ink-soft); font-size: 11px; text-align: center; }
.photo-editor__stage { position: relative; overflow: hidden; border-radius: 17px; background: #d8d7cf; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.photo-editor__stage canvas { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; user-select: none; }
.photo-editor__stage canvas:active { cursor: grabbing; }
.photo-editor__grid { position: absolute; pointer-events: none; inset: 0; background: linear-gradient(90deg, transparent 33.1%, rgba(255,255,255,.52) 33.25%, rgba(255,255,255,.52) 33.6%, transparent 33.75%, transparent 66.25%, rgba(255,255,255,.52) 66.4%, rgba(255,255,255,.52) 66.75%, transparent 66.9%), linear-gradient(0deg, transparent 33.1%, rgba(255,255,255,.52) 33.25%, rgba(255,255,255,.52) 33.6%, transparent 33.75%, transparent 66.25%, rgba(255,255,255,.52) 66.4%, rgba(255,255,255,.52) 66.75%, transparent 66.9%); opacity: .55; }
.photo-editor__zoom { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; margin: 16px 2px 13px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.photo-editor__zoom input { width: 100%; accent-color: var(--green); }
.photo-editor__tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-editor__tools button { appearance: none; display: grid; place-items: center; gap: 3px; min-height: 59px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: #f7f5ef; color: var(--green); font-size: 10px; font-weight: 700; cursor: pointer; }
.photo-editor__tools button span { font-size: 22px; font-weight: 400; line-height: 1; }
.photo-editor__privacy { margin: 13px 4px; color: #68766e; font-size: 10px; line-height: 1.4; text-align: center; }
.photo-editor__apply { min-height: 48px; }

.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; font-weight: 700; }
.field > span small { color: #77837b; font-weight: 500; }
.field input, .field textarea, .slug-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fbfaf6;
  color: var(--ink);
  transition: border 150ms ease, box-shadow 150ms ease;
}
.field input { height: 52px; padding: 0 15px; }
.field textarea { resize: vertical; min-height: 95px; padding: 14px 15px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .slug-field:focus-within { border-color: #78917f; box-shadow: 0 0 0 3px rgba(109,143,118,.12); }
.field-hint { margin-top: -3px; color: #78817c; font-size: 11px; line-height: 1.35; }
.slug-field { display: flex; align-items: center; overflow: hidden; padding-left: 14px; color: #66736b; font-size: 13px; }
.slug-field input { min-width: 0; padding-left: 2px; border: 0; background: transparent; box-shadow: none !important; }
.form-error { padding: 13px 15px; border: 1px solid rgba(156,61,47,.22); border-radius: 13px; background: #fff2ee; color: var(--danger); font-size: 13px; line-height: 1.4; }

.event-picker { min-width: 0; padding: 0; border: 0; }
.event-picker legend { margin-bottom: 11px; padding: 0; font-size: 13px; font-weight: 700; }
.event-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.event-option {
  position: relative;
  display: grid;
  grid-template-columns: 29px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbfaf6;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.event-option:hover { transform: translateY(-1px); border-color: #91a390; }
.event-option:has(input:checked) { border-color: var(--green); background: #edf2e7; box-shadow: 0 0 0 2px rgba(18,63,45,.08); }
.event-option:has(input:focus-visible) { outline: 3px solid rgba(109,143,118,.2); outline-offset: 2px; }
.event-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.event-option__mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #e7eadf; color: #738970; }
.event-option__mark svg { width: 15px; height: 15px; }
.event-option:has(input:checked) .event-option__mark { background: var(--green); color: white; }
.event-option strong { font-size: 12px; line-height: 1.28; letter-spacing: -.1px; }

.editor-plant-hero { position: relative; overflow: hidden; height: 340px; margin: 24px 0 0; border-radius: 24px; }
.editor-plant-hero > img { width: 100%; height: 100%; object-fit: cover; }
.button--floating { position: absolute; right: 14px; bottom: 14px; min-height: 43px; border-radius: 22px; background: rgba(255,254,250,.94); color: var(--green); box-shadow: 0 7px 18px rgba(12,35,22,.17); }
.editor-plant-title { padding: 26px 2px 34px; }
.editor-plant-title h1 { margin: 0; font: 500 40px/1.08 Georgia, serif; letter-spacing: -1.2px; }
.editor-plant-title > p:last-child { max-width: 530px; margin: 12px 0 0; color: var(--ink-soft); line-height: 1.5; }
.owner-diary { padding-top: 28px; border-top: 1px solid var(--line); }
.owner-entry-list { display: grid; gap: 11px; margin-top: 16px; }
.owner-entry { position: relative; display: grid; grid-template-columns: 94px 1fr 38px; grid-template-areas: "date text trash"; align-items: center; gap: 12px; min-height: 80px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: #faf8f2; }
.owner-entry:has(img) { grid-template-columns: 78px 1fr 38px; grid-template-areas: "image text trash" "date text trash"; }
.owner-entry time { grid-area: date; color: #627068; font-size: 11px; font-weight: 700; }
.owner-entry img { grid-area: image; width: 78px; height: 64px; border-radius: 11px; object-fit: cover; }
.owner-entry p { grid-area: text; margin: 0; font-size: 13px; line-height: 1.4; }
.owner-entry .danger-icon { grid-area: trash; width: 36px; height: 36px; color: var(--danger); box-shadow: none; }
.compact-form-heading { padding: 31px 0 17px; }
.compact-form-heading h1 { margin: 0; font: 500 36px Georgia, serif; }
.compact-form-heading > p:last-child { margin: 9px 0 0; color: var(--ink-soft); }

.auth-app { min-height: 100vh; background: var(--paper); }
.auth-layout { display: grid; grid-template-columns: minmax(360px, .92fr) minmax(480px, 1.08fr); min-height: 100vh; }
.auth-visual { position: relative; overflow: hidden; min-height: 100vh; }
.auth-visual > img { width: 100%; height: 100%; object-fit: cover; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(6,31,19,.2), rgba(6,31,19,.66)); }
.auth-visual__overlay { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 42px; color: white; }
.auth-visual__overlay .brand__mark { color: var(--green); background: white; }
.auth-visual__overlay .brand > span:last-child > span { color: #cadcbf; }
.auth-visual__overlay > p { margin: 0; font: 500 clamp(45px, 5.5vw, 72px)/.98 Georgia, serif; letter-spacing: -2px; }
.auth-visual__overlay em { color: #dce8cb; font-weight: 400; }
.auth-panel { display: grid; place-items: center; padding: 50px 32px; }
.auth-card { width: min(100%, 440px); }
.auth-card > h1 { margin: 0; font: 500 41px/1.08 Georgia, serif; letter-spacing: -1.3px; }
.auth-card > p:not(.eyebrow) { margin: 12px 0 24px; color: var(--ink-soft); line-height: 1.5; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 24px; border-radius: 14px; background: #ece9e1; }
.auth-tabs button { min-height: 41px; border: 0; border-radius: 11px; background: transparent; color: #647069; font-size: 13px; font-weight: 650; cursor: pointer; }
.auth-tabs button.is-active { background: var(--paper); color: var(--green); box-shadow: 0 4px 12px rgba(31,45,37,.08); }
#auth-form { display: grid; gap: 17px; }
.auth-mobile-brand { display: none; }
.auth-back { display: inline-flex; align-items: center; gap: 5px; margin-top: 24px; color: #5e6e64; font-size: 12px; font-weight: 650; }
.auth-back svg { width: 16px; }

.state-page { display: grid; place-items: center; align-content: center; min-height: 100vh; padding: 32px; text-align: center; }
.state-page > .brand { position: absolute; top: 28px; left: 32px; }
.state-illustration { display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 27px; border-radius: 50%; background: var(--green-light); color: var(--green); }
.state-illustration svg { width: 47px; height: 47px; }
.state-page h1 { max-width: 480px; margin: 0 0 25px; font: 500 37px/1.15 Georgia, serif; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: calc(100% - 34px);
  padding: 12px 18px;
  border-radius: 24px;
  background: var(--ink);
  color: white;
  box-shadow: 0 10px 30px rgba(9,27,16,.25);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

@media (max-width: 760px) {
  .garden-shell { padding-right: 17px; padding-left: 17px; }
  .public-nav { height: 65px; }
  .profile-header { padding-top: 20px; }
  .profile-share { top: 10px; }
  .avatar { width: 100px; height: 100px; margin-bottom: 21px; }
  .profile-header h1 { font-size: 39px; }
  .plant-card__body { min-height: 73px; padding: 11px 10px 12px; }
  .plant-card h3 { font-size: 16px; }
  .home-cta { grid-template-columns: 1fr; align-items: start; padding: 26px 23px; }
  .home-cta .button { justify-self: start; }
  .story-sheet { padding-right: 20px; padding-left: 20px; }
  .hero-brand { display: none; }
  .studio-shell, .editor-shell { padding-right: 17px; padding-left: 17px; }
  .preview-link { display: none; }
  .photo-field { min-height: 300px; }
  .photo-editor { display: block; padding: 0; background: var(--paper); }
  .photo-editor__sheet { width: 100%; min-height: 100dvh; max-height: none; padding: env(safe-area-inset-top) 17px max(20px, env(safe-area-inset-bottom)); border-radius: 0; box-shadow: none; }
  .photo-editor__sheet > header { min-height: 58px; }
  .auth-layout { display: block; min-height: 100vh; }
  .auth-visual { display: none; }
  .auth-panel { display: block; padding: max(28px, env(safe-area-inset-top)) 22px 45px; }
  .auth-mobile-brand { display: block; margin-bottom: 48px; }
  .auth-card { margin: 0 auto; }
  .auth-card > h1 { font-size: 37px; }
}

@media (max-width: 390px) {
  .garden-shell { padding-right: 14px; padding-left: 14px; }
  .plant-card h3 { font-size: 15px; }
  .plant-card p { font-size: 11px; }
  .story-sheet { padding-right: 17px; padding-left: 17px; }
  .plant-hero { min-height: 400px; }
  .timeline-entry { grid-template-columns: 51px 16px 1fr; gap: 7px; }
  .timeline-list::before { left: 66px; }
  .studio-plant { grid-template-columns: 82px 1fr 42px; gap: 10px; }
  .studio-plant > img { width: 82px; height: 86px; }
  .photo-field { min-height: 270px; }
  .owner-entry { grid-template-columns: 1fr 38px; grid-template-areas: "date trash" "text text"; }
  .owner-entry:has(img) { grid-template-columns: 70px 1fr 38px; grid-template-areas: "image date trash" "text text text"; }
  .owner-entry img { width: 70px; height: 58px; }
  .event-grid { grid-template-columns: 1fr; }
  .event-option { min-height: 59px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(16, 40, 29, 0.32); }
  .field input, .field textarea, .slug-field { border-width: 2px; }
}
