/* TinyProof shared styles — unified with landing page */

:root {
  /* ── Core palette (matches index.php --lp-* tokens) ── */
  --bg:           #f5f0e8;   /* warm cream — same as landing */
  --surface:      #faf7f2;   /* card surface */
  --card:         #ffffff;
  --text:         #1a1a14;   /* deep warm black */
  --muted:        #6b6455;   /* warm stone */
  --line:         rgba(100,90,70,.18);  /* warm border */

  /* ── Brand green — slightly warmer/deeper than before ── */
  --green:        #2d5c38;   /* matches index --lp-accent */
  --green-dark:   #1f4428;
  --green-light:  #e8f0e4;   /* soft green surface */
  --soft:         #eef5eb;

  /* ── Gold accent — unchanged ── */
  --gold:         #c4882a;   /* matches index --lp-gold */

  /* ── Semantic ── */
  --danger:       #b42318;
  --success-bg:   #eef5eb;
  --success-text: #1f4428;
  --warn-bg:      #fff9ed;
  --warn-line:    #ecd39d;
  --warn-text:    #76531b;
  --empty:        #e0d8cc;
  --skip:         #b08030;

  /* ── Typography ── */
  --font-sans:  'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  /* ── Shape ── */
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --shadow:     0 4px 16px rgba(26,26,20,.07);
  --shadow-lg:  0 12px 36px rgba(26,26,20,.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--green-dark);
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.brand {
  color: var(--green);
  font-weight: 600;
  letter-spacing: -.02em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.nav a:hover,
.nav a.is-active {
  color: var(--green-dark);
}

.card,
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 22px;
}

.eyebrow {
  color: var(--gold);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.05;
  letter-spacing: -.03em;
}

h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -.02em;
}

h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin: 0 0 4px;
  font-size: 19px;
  letter-spacing: -.015em;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .75fr);
  gap: 22px;
  align-items: start;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.stat strong {
  display: block;
  font-size: 21px;
  letter-spacing: -.03em;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.flash {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 14px;
  background: #fff4f2;
  color: var(--danger);
  border: 1px solid #ffd6d1;
}

.flash.success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #ccebd2;
}

.empty {
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 12px;
}

.inline-btn,
.proof-btn,
button.pg-btn {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: all .15s;
}

.inline-btn:hover,
.proof-btn:hover,
button.pg-btn:hover {
  border-color: rgba(45,92,56,.4);
  color: var(--green-dark);
}

.inline-btn.primary,
.proof-btn.primary,
button.pg-btn.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.inline-btn.primary:hover,
.proof-btn.primary:hover,
button.pg-btn.primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.proof-btn.extra {
  background: var(--surface);
  color: var(--green-dark);
}

.proof-btn.warn {
  color: #76531b;
  background: #fff9ed;
  border-color: #ecd39d;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(45,92,56,.5);
  box-shadow: 0 0 0 3px rgba(45,92,56,.1);
}

label {
  display: block;
  font-weight: 780;
  font-size: 14px;
  margin: 16px 0 8px;
}

.pill {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  margin: 4px 4px 0 0;
}

.plant-wrap {
  display: grid;
  place-items: center;
  min-height: 250px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at center, rgba(47, 125, 77, .13), transparent 54%),
    linear-gradient(180deg, var(--surface), #f0eadf);
  border: 1px solid #eadfce;
  overflow: hidden;
}

.plant-img {
  width: min(270px, 74%);
  aspect-ratio: 1;
  object-fit: contain;
  animation: breathe 3.8s ease-in-out infinite;
}

.plant-img.complete {
  animation: bloom 1.2s ease-in-out infinite alternate;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.018); }
}

@keyframes bloom {
  0% { transform: translateY(-3px) scale(1.02); }
  100% { transform: translateY(-8px) scale(1.055); }
}

.progress {
  height: 12px;
  background: #e7ddcc;
  border-radius: 999px;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
}

.extra-form {
  display: none;
  border: 1px solid #e9dfce;
  background: var(--surface);
  border-radius: 16px;
  padding: 12px;
  gap: 9px;
  animation: slideDown .18s ease-out;
}

.extra-form.is-open {
  display: grid;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  width: auto;
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.chip:hover {
  border-color: rgba(47, 125, 77, .5);
  color: var(--green-dark);
  background: #fbfdf9;
}

/* Shared footer */
.site-footer {
  margin-top: 44px;
  padding: 22px 0 30px;
  border-top: 1px solid rgba(231, 221, 204, .85);
  color: var(--muted);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}

.site-footer strong {
  display: block;
  color: var(--green-dark);
  margin-bottom: 3px;
}

.site-footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.site-footer-links a:hover {
  color: var(--green-dark);
}

/* Home */
.home-plant-hero {
  min-height: 535px;
  display: grid;
  align-content: space-between;
  gap: 24px;
}

.progress-wrap {
  margin-top: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.summary-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 76px;
}

.summary-stat strong {
  display: block;
  font-size: 22px;
  letter-spacing: -.03em;
}

.summary-stat span {
  color: var(--muted);
  font-size: 13px;
}

.slot-box {
  padding: 16px;
  border-radius: 22px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-text);
  margin-top: 12px;
}

.slot-box strong {
  display: block;
  color: #4c3410;
  margin-bottom: 4px;
}

.slot-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.slot-actions form {
  flex: 1;
  min-width: 180px;
}

.mini-garden {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.garden-dot {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.bloom-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #fff9ed;
  border: 1px solid #ecd39d;
  color: #62420f;
}

.bloom-box strong {
  display: block;
  margin-bottom: 5px;
  color: #4c3410;
}

.complete-form {
  margin-top: 12px;
}

.complete-form button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.complete-form button:hover {
  background: var(--green-dark);
}

.practice-section {
  margin-top: 22px;
}

.practice-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.practice-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--card);
}

.practice-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.week-mini {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  min-width: 96px;
}

.week-bar {
  height: 8px;
  background: #e7ddcc;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.week-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #74ad68);
  border-radius: 999px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

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

.btn-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.logged {
  margin-top: 12px;
  border-radius: 14px;
  background: #f7f3eb;
  border: 1px solid #e4d9c7;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.extra-form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.cancel-extra {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
  padding: 8px;
}

.cancel-extra:hover {
  color: var(--green-dark);
}

/* Review */
.review-page {
  display: grid;
  gap: 18px;
}

.review-overview-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
}

.review-section {
  margin-top: 0;
}

.review-practice-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.review-practice-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--card);
}

.review-practice-row strong {
  display: block;
  margin-bottom: 4px;
}

.practice-progress {
  height: 9px;
  background: #e7ddcc;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.practice-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #74ad68);
  border-radius: 999px;
}

.plant-progress {
  height: 12px;
  background: #e7ddcc;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.review-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.review-day {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 6px;
  text-align: center;
  background: var(--surface);
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.review-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin: 4px auto 0;
  background: var(--empty);
}

.review-day.done .review-dot {
  background: var(--green);
}

.review-day.extra .review-dot {
  background: var(--gold);
}

.review-day.skipped .review-dot {
  background: var(--skip);
}

.review-day small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.review-day strong {
  font-size: 15px;
}

.review-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.review-legend-item {
  display: flex;
  gap: 6px;
  align-items: center;
}

.review-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--empty);
}

.review-legend-dot.done {
  background: var(--green);
}

.review-legend-dot.extra {
  background: var(--gold);
}

.review-legend-dot.skipped {
  background: var(--skip);
}

@media (max-width: 940px) {
  .layout-2,
  .grid-2,
  .review-overview-grid {
    grid-template-columns: 1fr;
  }

  .home-plant-hero {
    min-height: auto;
  }

  .summary-grid,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .shell {
    width: min(100% - 24px, 1160px);
  }

  .btn-row {
    grid-template-columns: 1fr;
  }

  .extra-form-actions {
    grid-template-columns: 1fr;
  }

  .practice-head {
    display: block;
  }

  .week-mini {
    text-align: left;
    margin-top: 8px;
  }

  .review-days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Step 16 fix: no-overflow compact rhythm grid */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.review-days {
  display: grid !important;
  grid-template-columns: repeat(14, minmax(0, 1fr)) !important;
  gap: 6px;
  margin-top: 14px;
  overflow: visible !important;
  padding: 0 !important;
  scroll-snap-type: none !important;
}

.review-day {
  width: auto !important;
  min-width: 0 !important;
  flex: initial !important;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 7px 4px;
  text-align: center;
  background: var(--surface);
  display: grid;
  align-content: center;
  gap: 2px;
}

.review-day small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

.review-day strong {
  font-size: 14px;
  line-height: 1.05;
}

.review-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin: 3px auto 0;
  background: var(--empty);
}

.review-legend {
  margin-top: 10px;
}

@media (max-width: 640px) {
  .review-days {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  .review-day {
    min-height: 54px;
    border-radius: 13px;
    padding: 6px 3px;
  }

  .review-day small {
    font-size: 9px;
  }

  .review-day strong {
    font-size: 13px;
  }

  .review-dot {
    width: 8px;
    height: 8px;
  }
}


/* Step 17: Garden + Settings shared layout */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.collection-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.collection-visual {
  min-height: 130px;
  border-radius: 20px;
  background:
    radial-gradient(circle at center, rgba(47, 125, 77, .10), transparent 56%),
    linear-gradient(180deg, var(--surface), #f0eadf);
  border: 1px solid #eadfce;
  display: grid;
  place-items: center;
  font-size: 46px;
}

.collection-item h2 {
  margin-top: 14px;
}

.collection-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.settings-grid {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.settings-stack {
  display: grid;
  gap: 14px;
}

.settings-practice {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.settings-practice strong {
  display: block;
  margin-bottom: 4px;
}

.settings-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.settings-action-row > * {
  flex: 1 1 180px;
}

.settings-info-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.settings-info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}

.settings-info-card strong {
  display: block;
  font-size: 18px;
  letter-spacing: -.02em;
}

.settings-info-card span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .collection-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .collection-visual {
    min-height: 105px;
  }

  .settings-info-row {
    grid-template-columns: 1fr;
  }
}


/* Step 18: Onboarding + Seed + Add Practice */
.onboarding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 28px;
  align-items: center;
}

.onboarding-intro {
  padding: 8px;
}

.starter-card {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.stage-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-top: 18px;
}

.stage {
  height: 9px;
  border-radius: 999px;
  background: #e7ddcc;
}

.stage:first-child {
  background: var(--green);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.examples-title {
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.form-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.form-submit {
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.form-submit:hover {
  background: var(--green-dark);
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.seed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 12px;
  min-height: 225px;
  box-shadow: 0 18px 50px rgba(39, 55, 42, .06);
}

.seed-card.locked {
  opacity: .58;
  filter: grayscale(.2);
}

.seed-visual {
  min-height: 112px;
  border-radius: 20px;
  background:
    radial-gradient(circle at center, rgba(47, 125, 77, .10), transparent 56%),
    linear-gradient(180deg, var(--surface), #f0eadf);
  border: 1px solid #eadfce;
  display: grid;
  place-items: center;
  font-size: 42px;
}

.seed-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.seed-card button:disabled,
.form-submit:disabled {
  background: #ddd2c0;
  color: #7b7060;
  cursor: not-allowed;
}

.add-practice-wrap {
  width: min(920px, 100%);
  margin: 0 auto;
}

.onboarding-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.onboarding-topline a {
  color: var(--green-dark);
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 900px) {
  .onboarding-layout,
  .seed-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-intro {
    padding: 0;
  }
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .seed-visual {
    min-height: 98px;
  }
}


/* Step 19: Public + Auth pages */
.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .75fr);
  gap: 24px;
  align-items: center;
  min-height: 620px;
}

.public-hero-copy {
  padding: 12px 0;
}

.public-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.public-hero h1 {
  font-size: clamp(44px, 8vw, 86px);
}

.public-hero .lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 660px;
}

.public-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.public-actions .inline-btn {
  width: auto;
  min-width: 160px;
  padding: 13px 18px;
}

.public-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(39, 55, 42, .11);
}

.public-plant-preview {
  min-height: 260px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at center, rgba(47, 125, 77, .14), transparent 52%),
    linear-gradient(180deg, var(--surface), #f0eadf);
  border: 1px solid #eadfce;
  display: grid;
  place-items: center;
  font-size: 86px;
}

.public-step-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.public-step {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 14px;
}

.public-step strong {
  display: block;
  margin-bottom: 3px;
}

.public-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.public-section-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(39, 55, 42, .06);
}

.auth-wrap {
  width: min(480px, 100%);
  margin: 34px auto 0;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: clamp(34px, 6vw, 52px);
}

.auth-link {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.auth-link a {
  font-weight: 600;
  text-decoration: none;
}

.auth-small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .public-hero,
  .public-section-grid {
    grid-template-columns: 1fr;
  }

  .public-hero {
    min-height: auto;
  }

  .public-preview {
    order: -1;
  }

  .public-plant-preview {
    min-height: 200px;
  }
}

@media (max-width: 640px) {
  .public-actions .inline-btn {
    width: 100%;
  }

  .auth-card {
    padding: 22px;
    border-radius: 24px;
  }
}


/* Step 20: App Shell Header + Mobile Bottom Nav */

/* Global width safety */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* App shell spacing */
body.app-shell {
  padding-bottom: env(safe-area-inset-bottom);
}

body.app-shell .shell {
  padding-bottom: 24px;
}

/* Header refinements */
.topbar {
  min-height: 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  line-height: 1;
}

.brand-mark {
  font-size: 18px;
  line-height: 1;
}

.brand-text {
  display: inline-block;
}

.mobile-page-title {
  display: none;
}

.nav-cta {
  border: 1px solid var(--green);
  background: var(--green);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s;
}

.nav-cta:hover {
  background: var(--green-dark) !important;
}

/* App pages: no traditional visible footer */
body.app-shell .site-footer {
  display: none;
}

/* Public footer remains for landing/auth pages */
.public-footer {
  margin-top: 44px;
}

/* Mobile app shell */
@media (max-width: 760px) {
  body.app-shell .shell {
    width: min(100% - 24px, 1160px);
    padding-top: 16px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.app-shell .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 48px;
    margin: -16px -12px 16px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid rgba(231, 221, 204, .72);
    background:
      linear-gradient(180deg, rgba(245,240,232,.97), rgba(245,240,232,.88));
    backdrop-filter: blur(12px);
  }

  body.app-shell .brand {
    font-size: 15px;
    max-width: 48%;
  }

  body.app-shell .brand-mark {
    display: none;
  }

  body.app-shell .brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.app-shell .mobile-page-title {
    display: block;
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    max-width: 48%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.app-shell .desktop-nav {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(231, 221, 204, .92);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(39, 55, 42, .18);
    backdrop-filter: blur(16px);
  }

  .bottom-nav a {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 46px;
    border-radius: 18px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
  }

  .bottom-nav a.is-active {
    background: var(--green-light);
    color: var(--green-dark);
  }

  .bottom-nav-icon {
    font-size: 15px;
    line-height: 1;
  }

  /* Public pages keep simple top navigation */
  body.public-shell .topbar {
    align-items: center;
  }

  body.public-shell .brand {
    font-size: 15px;
  }

  body.public-shell .public-nav {
    gap: 8px;
  }

  body.public-shell .public-nav a {
    font-size: 13px;
  }
}

/* Desktop app shell */
@media (min-width: 761px) {
  .bottom-nav {
    display: none;
  }

  body.app-shell .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 10px 0;
    background:
      linear-gradient(180deg, rgba(245,240,232,.96), rgba(245,240,232,.80));
    backdrop-filter: blur(12px);
  }
}

/* Make footer cleaner on public pages */
.site-footer {
  margin-top: 44px;
  padding: 22px 0 30px;
  border-top: 1px solid rgba(231, 221, 204, .85);
  color: var(--muted);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}

.site-footer strong {
  display: block;
  color: var(--green-dark);
  margin-bottom: 3px;
}

.site-footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.site-footer-links a:hover {
  color: var(--green-dark);
}

@media (max-width: 640px) {
  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Step 31E: Gallery Mode layout rescue
   This block ensures gallery.php is styled even if older garden-specific CSS was cached or missing. */
.page-gallery-memory .garden-hero {
  text-align: center;
  margin: .9rem 0 1.05rem;
}

.page-gallery-memory .garden-hero h1 {
  margin: .25rem auto .5rem;
  max-width: 760px;
  color: var(--text);
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -.07em;
}

.page-gallery-memory .garden-hero p,
.page-gallery-memory .garden-stories-head p {
  margin: 0 auto;
  max-width: 650px;
  color: var(--muted);
  line-height: 1.55;
}

.page-gallery-memory .garden-kicker {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green);
}

.page-gallery-memory .garden-growing-section,
.page-gallery-memory .garden-bloom-card,
.page-gallery-memory .garden-story-card,
.page-gallery-memory .garden-story-empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 12px 30px rgba(37,48,39,.07);
}

.page-gallery-memory .garden-growing-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(280px, 1.1fr);
  gap: 1rem;
  align-items: stretch;
  padding: 1rem;
  margin: 1.2rem 0;
}

.page-gallery-memory .garden-growing-copy {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-gallery-memory .garden-growing-copy h2 {
  margin: .22rem 0 .35rem;
  color: var(--text);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -.055em;
}

.page-gallery-memory .garden-growing-copy p {
  color: var(--muted);
  line-height: 1.52;
  margin: 0 0 .85rem;
}

.page-gallery-memory .garden-progress {
  height: 12px;
  border-radius: 999px;
  background: #e6ded2;
  overflow: hidden;
  margin: .15rem 0 .78rem;
}

.page-gallery-memory .garden-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #75b47a);
}

.page-gallery-memory .garden-stage-dots {
  display: flex;
  gap: .35rem;
  margin-bottom: .85rem;
}

.page-gallery-memory .garden-stage-dots span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f2ede6;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
}

.page-gallery-memory .garden-stage-dots span.is-done {
  background: var(--green);
  color: #fff;
}

.page-gallery-memory .garden-stage-dots span.is-current {
  background: #fff7e4;
  color: #8a5b26;
  border: 1px solid #ead7a6;
}

.page-gallery-memory .garden-soft-note {
  font-size: .86rem;
}

.page-gallery-memory .garden-growing-visual {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: auto;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.75), transparent 32%),
    linear-gradient(180deg, #fff8ea 0%, #eef7e9 62%, #d8e8cd 100%);
  border: 1px solid rgba(230,224,214,.8);
  display: block;
  width: 100%;
  padding: 0;
  --anchor-left: 51.5%;
  --anchor-bottom: 1.5%;
  --anchor-width: 42%;
  --anchor-height: 64%;
}

.page-gallery-memory .garden-growing-visual.is-tree {
  --anchor-left: 50%;
  --anchor-bottom: -2%;
  --anchor-width: 48%;
  --anchor-height: 74%;
}

.page-gallery-memory .garden-growing-visual.is-legacy {
  --anchor-left: 50%;
  --anchor-bottom: 10%;
  --anchor-width: 54%;
  --anchor-height: 80%;
}

.page-gallery-memory .garden-growing-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}

.page-gallery-memory .garden-growing-light {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 44% 26%, rgba(255,232,166,.16), transparent 34%),
    radial-gradient(ellipse at 50% 92%, rgba(80,122,75,.08), transparent 45%);
  pointer-events: none;
}

.page-gallery-memory .garden-growing-plant-anchor {
  position: absolute;
  left: var(--anchor-left);
  bottom: var(--anchor-bottom);
  z-index: 3;
  width: var(--anchor-width);
  height: var(--anchor-height);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.page-gallery-memory .garden-growing-plant-img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(var(--growing-scale));
  transform-origin: bottom center;
  filter:
    drop-shadow(0 18px 20px rgba(46, 36, 23, .18))
    drop-shadow(0 0 18px rgba(255, 226, 144, .12));
  animation: gardenGrowingBreathe 4.5s ease-in-out infinite;
}

.page-gallery-memory .garden-bloom-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  background: linear-gradient(135deg, #fff9ea, #f5fbf1);
}

.page-gallery-memory .garden-bloom-card button,
.page-gallery-memory .garden-story-empty a {
  border: 0;
  border-radius: 999px;
  padding: .68rem .95rem;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.page-gallery-memory .garden-stories-head {
  margin: 1.55rem 0 .75rem;
}

.page-gallery-memory .garden-stories-head h2 {
  margin: .22rem 0 .3rem;
  color: var(--text);
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1.1;
  letter-spacing: -.055em;
}

.page-gallery-memory .garden-scene-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
  margin: .85rem 0 1rem;
}

.page-gallery-memory .garden-scene-footer span {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  border-radius: 999px;
  padding: .38rem .68rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.page-gallery-memory .garden-story-empty {
  text-align: center;
  padding: 1.5rem;
}

.page-gallery-memory .garden-story-list {
  display: grid;
  gap: .9rem;
  margin-bottom: 6rem;
}

.page-gallery-memory .garden-story-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  align-items: center;
}

.page-gallery-memory .garden-story-visual {
  min-height: 104px;
  border-radius: 20px;
  background:
    radial-gradient(circle at center, rgba(47,125,91,.12), transparent 55%),
    linear-gradient(180deg, #fbfaf7, #f0eadf);
  border: 1px solid #eadfce;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.page-gallery-memory .garden-story-plant-img {
  width: min(88px, 82%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(55,83,63,.16));
}

.page-gallery-memory .garden-story-content h3 {
  margin: .12rem 0 .28rem;
  color: var(--text);
  font-size: 1.22rem;
  line-height: 1.1;
  letter-spacing: -.04em;
}

.page-gallery-memory .garden-story-meta,
.page-gallery-memory .garden-story-meaning,
.page-gallery-memory .garden-story-proof-row em {
  color: var(--muted);
}

.page-gallery-memory .garden-story-proof-list {
  display: grid;
  gap: .45rem;
}

.page-gallery-memory .garden-story-proof-row,
.page-gallery-memory .garden-story-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .55rem;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: .45rem;
  font-size: .84rem;
}

.page-gallery-memory .garden-story-proof-row span,
.page-gallery-memory .garden-story-total span {
  color: var(--muted);
}

.page-gallery-memory .garden-story-proof-row strong,
.page-gallery-memory .garden-story-total strong {
  color: var(--green-dark);
}

.page-gallery-memory .garden-story-total {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: .55rem;
}

.page-gallery-memory .garden-story-practices {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.page-gallery-memory .garden-story-practices span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem .5rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

@keyframes gardenGrowingBreathe {
  0%, 100% {
    transform: scale(var(--growing-scale)) translateY(0);
  }
  50% {
    transform: scale(calc(var(--growing-scale) * 1.015)) translateY(-3px);
  }
}

@media (max-width: 760px) {
  .page-gallery-memory .garden-growing-section {
    grid-template-columns: 1fr;
    padding: .85rem;
  }

  .page-gallery-memory .garden-growing-copy {
    padding: .7rem .65rem .2rem;
  }

  .page-gallery-memory .garden-story-card {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: .8rem;
  }

  .page-gallery-memory .garden-story-visual {
    min-height: 84px;
    border-radius: 18px;
  }

  .page-gallery-memory .garden-story-proof-row {
    grid-template-columns: 1fr;
    gap: .1rem;
  }
}

@media (max-width: 420px) {
  .page-gallery-memory .garden-hero h1 {
    font-size: 2.2rem;
  }

  .page-gallery-memory .garden-growing-visual {
    --anchor-width: 44%;
  }

  .page-gallery-memory .garden-stage-dots span {
    width: 24px;
    height: 24px;
  }
}

/* Step 37D: Growing Space Debug Preview
   Debug-only layout. Normal Gallery layout is unchanged. */
.growing-debug-panel {
  margin: 1rem 0 1.1rem;
  padding: 1rem;
  border: 1px dashed rgba(100,90,70,.28);
  border-radius: 22px;
  background: rgba(255,255,255,.68);
}

.growing-debug-panel h1 {
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  margin: .2rem 0 .35rem;
  letter-spacing: -.055em;
}

.growing-debug-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .75rem;
}

.growing-debug-controls a,
.growing-debug-controls span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .38rem .65rem;
  background: rgba(255,255,255,.82);
  color: var(--muted);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
}

.growing-debug-controls a.is-active,
.growing-debug-controls span.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.growing-debug-section {
  margin: 1.2rem 0;
}

.growing-debug-section h2 {
  margin: 0 0 .7rem;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.growing-debug-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: .9rem !important;
}

.growing-debug-card,
.growing-debug-stage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(37,48,39,.06);
}

.growing-debug-card {
  border-radius: 20px;
  padding: .75rem;
}

.growing-debug-card h3 {
  margin: 0 0 .45rem;
  font-size: .92rem;
  letter-spacing: -.02em;
}

.growing-debug-stage-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(150px, 1fr)) !important;
  gap: .75rem !important;
  overflow-x: auto !important;
  padding-bottom: .35rem;
}

.growing-debug-stage-card {
  min-width: 150px;
  border-radius: 18px;
  padding: .6rem;
}

.growing-debug-stage-card h3 {
  margin: 0 0 .45rem;
  font-size: .82rem;
  color: var(--muted);
}

.growing-debug-card .garden-growing-visual,
.growing-debug-stage-card .garden-growing-visual {
  aspect-ratio: 16 / 9 !important;
  min-height: auto !important;
  width: 100% !important;
  margin: 0 !important;
}

.growing-debug-stage-card .garden-growing-visual {
  border-radius: 14px !important;
}

.growing-debug-card .garden-growing-bg,
.growing-debug-stage-card .garden-growing-bg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.growing-debug-card .garden-growing-plant-anchor,
.growing-debug-stage-card .garden-growing-plant-anchor {
  position: absolute !important;
  left: var(--anchor-left) !important;
  bottom: var(--anchor-bottom) !important;
  width: var(--anchor-width) !important;
  height: var(--anchor-height) !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
}

.growing-debug-card .garden-growing-plant-img,
.growing-debug-stage-card .garden-growing-plant-img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  object-fit: contain !important;
}

.growing-debug-note {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.55;
  margin-top: .45rem;
}

@media (max-width: 760px) {
  .growing-debug-grid {
    grid-template-columns: 1fr !important;
  }

  .growing-debug-stage-grid {
    grid-template-columns: repeat(7, minmax(126px, 1fr)) !important;
  }
}
