/* =====================================================
   Bloomprint — Futuristic Botanical-Tech Design System
   Light, luminous, glass HUD panels, huge display type.
   ===================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Color — semantic */
  --bg: #f4f8f4;
  --bg-raised: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(13, 27, 18, 0.08);
  --ink: #0d1b12;
  --ink-2: #3d4f43;
  --ink-3: #66786c;
  --primary: #15803d;
  --primary-strong: #116432;
  --primary-soft: #dcf3e3;
  --accent: #a3e635;
  --accent-ink: #2c3d0d;
  --danger: #d23c50;
  --danger-soft: #fde8eb;
  --warn: #b45309;
  --warn-soft: #fdf0dd;
  --good: #15803d;
  --good-soft: #dcf3e3;
  --link-good: #22c55e;
  --link-bad: #ef4444;

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Shape & depth */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-1: 0 1px 2px rgba(13,27,18,.05), 0 4px 16px rgba(13,27,18,.06);
  --shadow-2: 0 4px 8px rgba(13,27,18,.06), 0 12px 40px rgba(13,27,18,.12);
  --glow: 0 0 0 3px rgba(163,230,53,.35);

  /* Motion */
  --ease-out: cubic-bezier(.22,1,.36,1);
  --t-fast: 160ms;
  --t-med: 260ms;

  /* Z scale */
  --z-board-ui: 10;
  --z-header: 40;
  --z-dropdown: 60;
  --z-banner: 70;
  --z-modal: 100;
  --z-toast: 110;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
}
h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
input, select { font: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ---------- Screens ---------- */
.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; }
#screen-studio.active { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 22px;
  border: 1px solid transparent; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  cursor: pointer; text-decoration: none;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background var(--t-fast), opacity var(--t-fast);
  touch-action: manipulation;
  background: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #1a9d4b 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(21,128,61,.35), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(21,128,61,.45), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--glass-border); }
.btn-ghost:hover { background: rgba(13,27,18,.05); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b92e42; }
.btn-lg { min-height: 54px; padding: 14px 30px; font-size: 17px; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { min-width: 44px; min-height: 44px; padding: 8px; border-radius: 12px; background: transparent; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background var(--t-fast); }
.btn-icon:hover { background: rgba(13,27,18,.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* =====================================================
   LANDING
   ===================================================== */
#screen-landing { position: relative; overflow-x: clip; }
.landing-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.orb-1 { width: 560px; height: 560px; background: radial-gradient(circle, #b9f0c9, transparent 70%); top: -180px; right: -120px; }
.orb-2 { width: 480px; height: 480px; background: radial-gradient(circle, #e3f7a8, transparent 70%); top: 40%; left: -200px; }
.landing-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(21,128,61,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(21,128,61,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

.landing-nav {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 22px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand .icon { color: var(--primary); width: 26px; height: 26px; }
.brand-sm { font-size: 18px; }

.hero { position: relative; z-index: 1; text-align: center; padding: 56px 24px 40px; max-width: 900px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--primary-strong);
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 8px 16px; border-radius: 999px; margin-bottom: 28px;
}
.hero-title { font-size: clamp(52px, 9vw, 104px); font-weight: 700; letter-spacing: -0.03em; }
.grad-text {
  background: linear-gradient(100deg, var(--primary) 10%, #65a30d 50%, var(--primary-strong) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(17px, 2.2vw, 21px); color: var(--ink-2); max-width: 620px; margin: 24px auto 0; }
.hero-cta { margin-top: 36px; }
.hero-hint { margin-top: 14px; font-size: 14px; color: var(--ink-3); }

/* Hero animated board */
.hero-board { margin: 64px auto 0; max-width: 760px; perspective: 1200px; }
.hero-board-inner {
  position: relative; height: 300px;
  background: linear-gradient(160deg, #eaf6ec, #ddf0e2);
  border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  background-image:
    linear-gradient(rgba(21,128,61,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,128,61,.08) 1px, transparent 1px),
    linear-gradient(160deg, #eaf6ec, #ddf0e2);
  background-size: 40px 40px, 40px 40px, 100% 100%;
  transform: rotateX(14deg);
  overflow: hidden;
}
.hero-plant {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--c) 55%, #fff), var(--c));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--c) 45%, transparent);
  animation: float 5s ease-in-out infinite;
}
.hp-1 { width: 56px; height: 56px; left: 14%; top: 32%; }
.hp-2 { width: 40px; height: 40px; left: 43%; top: 55%; animation-delay: .8s; }
.hp-3 { width: 34px; height: 34px; left: 70%; top: 26%; animation-delay: 1.6s; }
.hp-4 { width: 46px; height: 46px; left: 82%; top: 58%; animation-delay: 2.4s; }
.hp-5 { width: 30px; height: 30px; left: 28%; top: 68%; animation-delay: 3.2s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-links line { stroke: var(--link-good); stroke-width: 2; stroke-dasharray: 6 6; opacity: .7; animation: dashmove 1.6s linear infinite; }
.hero-links { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes dashmove { to { stroke-dashoffset: -24; } }
.hero-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 7px;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: 999px;
  font-size: 13px; font-weight: 600; padding: 8px 14px; color: var(--ink);
  box-shadow: var(--shadow-1); white-space: nowrap;
}
.hero-chip .icon { color: var(--primary); }
.hero-chip-1 { left: 8%; bottom: 14%; }
.hero-chip-2 { right: 6%; top: 12%; }

/* Landing sections */
.features, .how { position: relative; z-index: 1; padding-top: 110px; }
.section-title { font-size: clamp(34px, 5vw, 56px); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 44px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature-card {
  background: var(--bg-raised); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  padding: 28px; box-shadow: var(--shadow-1);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.feature-icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.feature-card h3 { font-size: 20px; margin-bottom: 10px; }
.feature-card p { color: var(--ink-2); font-size: 15px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; counter-reset: step; }
.step { background: var(--bg-raised); border: 1px solid var(--glass-border); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-1); }
.step-num { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--primary); letter-spacing: .1em; }
.step h3 { font-size: 20px; margin: 10px 0; }
.step p { color: var(--ink-2); font-size: 15px; }
.how-cta { text-align: center; margin-top: 48px; }

.landing-footer {
  position: relative; z-index: 1; margin-top: 110px; padding: 40px 24px 48px;
  border-top: 1px solid var(--glass-border);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--ink-3); font-size: 14px; text-align: center;
}

/* =====================================================
   WIZARD
   ===================================================== */
#screen-onboarding.active { display: flex; align-items: flex-start; justify-content: center; padding: 24px; background:
  radial-gradient(900px 500px at 85% -10%, #dff2e2, transparent 60%),
  radial-gradient(700px 500px at -10% 100%, #eef7d8, transparent 60%),
  var(--bg);
}
.wizard {
  width: 100%; max-width: 560px; margin-top: 4vh;
  background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); padding: 28px clamp(20px, 5vw, 44px) 40px;
}
.wizard-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.wizard-progress { display: flex; gap: 8px; flex: 1; justify-content: center; }
.wizard-dot { width: 34px; height: 6px; border-radius: 3px; background: rgba(13,27,18,.12); transition: background var(--t-med); }
.wizard-dot.done { background: var(--primary); }
.wizard-dot.current { background: var(--accent); box-shadow: 0 0 8px rgba(163,230,53,.8); }
.wizard-step-label { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: stepIn var(--t-med) var(--ease-out); }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.wizard-title { font-size: clamp(30px, 5vw, 40px); letter-spacing: -0.02em; }
.wizard-sub { color: var(--ink-2); margin: 12px 0 30px; }

.field { margin-bottom: 22px; border: none; padding: 0; }
.field label, .field legend { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; font-family: var(--font-display); padding: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="number"], .field select, .palette-search input {
  width: 100%; min-height: 50px; padding: 12px 16px;
  border: 1.5px solid rgba(13,27,18,.15); border-radius: var(--r-md);
  background: var(--bg-raised); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: var(--glow); outline: none; }
.field input.invalid { border-color: var(--danger); }
.field-hint { font-size: 13.5px; color: var(--ink-3); margin-top: 7px; }
.field-error { font-size: 13.5px; color: var(--danger); margin-top: 7px; font-weight: 500; }
.hint-btn {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink-3);
  background: none; color: var(--ink-3); font-size: 13px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: 2px; margin-left: 6px;
}
.hint-btn:hover { border-color: var(--primary); color: var(--primary); }

.dim-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dim-preview-wrap { margin: 6px 0 26px; text-align: center; }
.dim-preview {
  margin: 0 auto; display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(rgba(21,128,61,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,128,61,.09) 1px, transparent 1px),
    linear-gradient(150deg, #e6f5e9, #d8eedd);
  background-size: 20px 20px, 20px 20px, 100% 100%;
  border: 2px solid var(--primary); border-radius: 12px;
  transition: width var(--t-med) var(--ease-out), height var(--t-med) var(--ease-out);
  width: 200px; height: 300px; max-width: 100%;
  font-family: var(--font-display); font-weight: 600; color: var(--primary-strong);
}
.dim-area { font-size: 14px; color: var(--ink-3); margin-top: 12px; }

.option-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.option-cards-4 { grid-template-columns: repeat(4, 1fr); }
.option-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px;
  background: var(--bg-raised); border: 1.5px solid rgba(13,27,18,.12); border-radius: var(--r-md);
  padding: 16px 8px 14px; cursor: pointer; min-height: 44px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.option-card:hover { transform: translateY(-2px); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card .icon { color: var(--ink-2); width: 26px; height: 26px; }
.option-card:has(input:checked) { border-color: var(--primary); box-shadow: var(--glow); background: var(--primary-soft); }
.option-card:has(input:checked) .icon { color: var(--primary-strong); }
.option-card:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.option-title { font-weight: 600; font-size: 14.5px; font-family: var(--font-display); }
.option-desc { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.soil-swatch { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--s) 55%, #fff), var(--s)); }

.ready-burst { width: 72px; height: 72px; margin: 6px auto 22px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-soft), #ecfccb); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 10px rgba(163,230,53,.15), 0 0 40px rgba(163,230,53,.4); }
.ready-burst .icon { width: 34px; height: 34px; color: var(--primary); }
.wizard-step[data-step="4"] { text-align: center; }
.ready-tips { list-style: none; margin: 26px 0 30px; padding: 0; text-align: left; display: grid; gap: 12px; }
.ready-tips li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.ready-tips .icon { color: var(--primary); margin-top: 4px; }

/* =====================================================
   STUDIO
   ===================================================== */
.studio-header {
  z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 18px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.studio-header-right { display: flex; align-items: center; gap: 10px; }
.save-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); transition: color var(--t-fast); }
.save-status.saving { color: var(--warn); }
.save-status .icon { color: var(--primary); }

.harmony { display: flex; align-items: center; gap: 10px; }
.harmony-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.harmony-track { fill: none; stroke: rgba(13,27,18,.1); stroke-width: 5; }
.harmony-fill { fill: none; stroke: var(--primary); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 119.4; transition: stroke-dashoffset .6s var(--ease-out), stroke .3s; }
.harmony-value { font-family: var(--font-display); font-weight: 700; font-size: 18px; min-width: 34px; }
.harmony-label { font-size: 12px; color: var(--ink-3); margin-left: -4px; }

.profile-menu { position: relative; }
.profile-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-dropdown);
  width: 240px; background: var(--bg-raised); border: 1px solid var(--glass-border);
  border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 14px;
}
.profile-name { font-weight: 700; font-family: var(--font-display); }
.profile-email { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.profile-dropdown hr { border: none; border-top: 1px solid var(--glass-border); margin: 12px 0; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 10px; padding: 10px 10px; min-height: 44px;
  font-size: 14.5px; font-weight: 500; cursor: pointer; transition: background var(--t-fast);
}
.dropdown-item:hover { background: rgba(13,27,18,.05); }
.dropdown-danger { color: var(--danger); }

.studio-body { flex: 1; display: flex; min-height: 0; }

/* Palette */
.palette {
  width: 280px; flex: none; display: flex; flex-direction: column; min-height: 0;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--glass-border);
}
.palette-search { position: relative; padding: 14px 14px 8px; }
.palette-search .icon { position: absolute; left: 30px; top: 50%; transform: translateY(-22%); color: var(--ink-3); pointer-events: none; }
.palette-search input { padding-left: 42px; min-height: 46px; border-radius: 999px; }
.palette-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 10px; }
.chip {
  border: 1px solid rgba(13,27,18,.14); background: var(--bg-raised); border-radius: 999px;
  font-size: 13px; font-weight: 600; padding: 7px 13px; min-height: 34px; cursor: pointer;
  transition: all var(--t-fast); font-family: var(--font-display);
}
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.palette-hint { font-size: 12.5px; color: var(--ink-3); padding: 0 16px 10px; }
.palette-list { flex: 1; overflow-y: auto; padding: 4px 10px 20px; min-height: 0; }
.palette-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 1.5px solid transparent; border-radius: var(--r-md);
  padding: 9px 10px; cursor: grab; min-height: 56px;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  touch-action: none;
}
.palette-item:hover { background: rgba(255,255,255,.9); border-color: var(--glass-border); }
.palette-item.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--glow); }
.palette-item:active { cursor: grabbing; }
.plant-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 30%, #fff), color-mix(in srgb, var(--c) 75%, #fff));
  color: color-mix(in srgb, var(--c) 80%, #000);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 50%, transparent);
}
.plant-avatar .icon { width: 21px; height: 21px; }
.palette-item-name { font-weight: 600; font-size: 14.5px; font-family: var(--font-display); display: block; line-height: 1.25; }
.palette-item-meta { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.palette-item-meta .icon { width: 12px; height: 12px; }
.fit-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-left: auto; }
.fit-dot.good { background: var(--link-good); box-shadow: 0 0 6px rgba(34,197,94,.7); }
.fit-dot.ok { background: #eab308; }
.fit-dot.bad { background: var(--link-bad); }
.palette-empty { text-align: center; color: var(--ink-3); font-size: 14px; padding: 30px 16px; }

/* Board */
.board-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background:
  radial-gradient(800px 400px at 70% -10%, rgba(223,242,226,.8), transparent 60%), var(--bg); }
.board-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; z-index: var(--z-board-ui);
}
.board-dims { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-2); background: var(--glass); border: 1px solid var(--glass-border); padding: 7px 14px; border-radius: 999px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.board-tools { display: flex; gap: 4px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 14px; padding: 3px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.board-tools .btn-icon.active { background: var(--primary-soft); color: var(--primary-strong); }

.board-scroll { flex: 1; overflow: auto; padding: 8px 24px 32px; min-height: 0; display: grid; place-items: center; }
.board {
  position: relative; flex: none;
  background:
    linear-gradient(rgba(21,128,61,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,128,61,.10) 1px, transparent 1px),
    linear-gradient(155deg, #ecf7ee 0%, #dff0e3 100%);
  border: 2px solid rgba(21,128,61,.5); border-radius: 18px;
  box-shadow: var(--shadow-2), inset 0 0 60px rgba(21,128,61,.06);
  cursor: default; touch-action: none;
}
.board.planting { cursor: copy; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(163,230,53,.25), var(--shadow-2); }
.board-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.board-links line { stroke-width: 2.5; stroke-linecap: round; }
.board-links .link-good { stroke: var(--link-good); stroke-dasharray: 7 7; opacity: .8; animation: dashmove 1.4s linear infinite; }
.board-links .link-bad { stroke: var(--link-bad); stroke-dasharray: 3 6; opacity: .85; }

.board-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--ink-3); text-align: center; font-size: 15px; padding: 20px; pointer-events: none;
}
.board-empty .icon { width: 44px; height: 44px; opacity: .5; }

.plant-node {
  position: absolute; transform: translate(-50%, -50%);
  border-radius: 50%; cursor: grab; touch-action: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 26%, #fff) 0%, color-mix(in srgb, var(--c) 62%, #fff) 75%, color-mix(in srgb, var(--c) 78%, #fff) 100%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent), 0 3px 10px color-mix(in srgb, var(--c) 30%, transparent);
  color: color-mix(in srgb, var(--c) 85%, #000);
  transition: box-shadow var(--t-fast);
  animation: plantIn .3s var(--ease-out);
}
@keyframes plantIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.5); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.plant-node:active { cursor: grabbing; }
.plant-node.selected { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 65%, transparent), 0 0 0 3.5px var(--accent), 0 4px 18px color-mix(in srgb, var(--c) 45%, transparent); z-index: 5; }
.plant-node.dragging { z-index: 6; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 65%, transparent), 0 0 0 3px rgba(163,230,53,.6), 0 14px 30px rgba(13,27,18,.25); }
.plant-node.conflict { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent), 0 0 0 3px rgba(239,68,68,.65), 0 3px 12px rgba(239,68,68,.35); }
.plant-node .icon { width: 45%; height: 45%; max-width: 26px; max-height: 26px; min-width: 12px; min-height: 12px; pointer-events: none; }
.plant-node-label {
  position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; font-family: var(--font-display); color: var(--ink-2);
  background: rgba(255,255,255,.82); border-radius: 6px; padding: 1px 7px; white-space: nowrap; pointer-events: none;
}
.board-ghost {
  position: absolute; transform: translate(-50%, -50%); border-radius: 50%;
  border: 2.5px dashed var(--primary); background: rgba(163,230,53,.18); pointer-events: none; z-index: 4;
}

.planting-banner {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: var(--z-banner);
  display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 12px 10px 22px;
  font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-2); white-space: nowrap; max-width: calc(100% - 32px);
}
.planting-banner .btn-ghost { color: var(--accent); border-color: rgba(255,255,255,.25); }
.planting-banner .btn-ghost:hover { background: rgba(255,255,255,.12); }

/* Advisor */
.advisor {
  width: 330px; flex: none; display: flex; flex-direction: column; min-height: 0;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid var(--glass-border);
}
.advisor-tabs { display: flex; gap: 6px; padding: 12px 14px 0; }
.advisor-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: none; border: none; border-bottom: 2.5px solid transparent;
  font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--ink-3);
  padding: 10px 6px; min-height: 44px; cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast);
}
.advisor-tab.active { color: var(--primary-strong); border-bottom-color: var(--primary); }
.advisor-panel { display: none; flex: 1; overflow-y: auto; padding: 16px 16px 28px; min-height: 0; }
.advisor-panel.active { display: block; }
.advisor-empty { text-align: center; color: var(--ink-3); padding: 46px 18px; font-size: 14.5px; }
.advisor-empty .icon { width: 36px; height: 36px; opacity: .45; margin-bottom: 10px; }

.advice-card {
  border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px;
  background: var(--bg-raised); border: 1px solid var(--glass-border); box-shadow: var(--shadow-1);
  animation: adviceIn .3s var(--ease-out);
}
@keyframes adviceIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.advice-card h4 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.advice-card p { font-size: 13.5px; color: var(--ink-2); }
.advice-card .icon { flex: none; }
.advice-good { border-left: 4px solid var(--link-good); }
.advice-good h4 .icon { color: var(--good); }
.advice-warn { border-left: 4px solid #eab308; }
.advice-warn h4 .icon { color: var(--warn); }
.advice-bad { border-left: 4px solid var(--link-bad); }
.advice-bad h4 .icon { color: var(--danger); }
.advice-info { border-left: 4px solid #38bdf8; }
.advice-info h4 .icon { color: #0284c7; }
.advice-section-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.advice-section-title:first-child { margin-top: 2px; }

.suggest-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: var(--bg-raised); border: 1.5px solid var(--glass-border); border-radius: var(--r-md);
  padding: 9px 12px; margin-bottom: 9px; cursor: pointer; min-height: 56px;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.suggest-row:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.suggest-row .plant-avatar { width: 36px; height: 36px; }
.suggest-name { font-weight: 600; font-size: 14px; font-family: var(--font-display); display: block; }
.suggest-why { font-size: 12px; color: var(--ink-3); display: block; }
.suggest-add { margin-left: auto; color: var(--primary); flex: none; }

/* Plant detail panel */
.pd-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.pd-head .plant-avatar { width: 54px; height: 54px; }
.pd-head .plant-avatar .icon { width: 28px; height: 28px; }
.pd-name { font-size: 21px; }
.pd-latin { font-size: 13px; color: var(--ink-3); font-style: italic; }
.pd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.pd-fact { background: var(--bg-raised); border: 1px solid var(--glass-border); border-radius: 12px; padding: 10px 12px; }
.pd-fact-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.pd-fact-label .icon { width: 13px; height: 13px; }
.pd-fact-value { font-size: 14px; font-weight: 600; font-family: var(--font-display); margin-top: 3px; }
.pd-tip { background: var(--primary-soft); border-radius: var(--r-md); padding: 13px 15px; font-size: 13.5px; color: var(--primary-strong); margin: 14px 0; }
.pd-lists { display: grid; gap: 10px; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pd-tag { font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; }
.pd-tag.good { background: var(--good-soft); color: var(--primary-strong); }
.pd-tag.bad { background: var(--danger-soft); color: var(--danger); }
.pd-months { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.pd-month { font-size: 10.5px; font-weight: 600; width: 26px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(13,27,18,.06); color: var(--ink-3); }
.pd-month.on { background: var(--primary); color: #fff; }
.pd-actions { display: flex; gap: 8px; margin-top: 16px; }

/* Mobile nav */
.studio-mobilenav { display: none; }
.mnav-badge {
  position: absolute; top: 4px; right: calc(50% - 22px);
  min-width: 18px; height: 18px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* =====================================================
   TOASTS & MODAL
   ===================================================== */
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 20px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-2);
  animation: toastIn .28s var(--ease-out); max-width: 100%;
}
.toast.out { animation: toastOut .22s ease-in forwards; }
.toast .icon { flex: none; }
.toast-good .icon { color: var(--accent); }
.toast-bad .icon { color: #fda4af; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.95); } }

.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(13,27,18,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--bg-raised); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  max-width: 420px; width: 100%; padding: 28px;
  animation: modalIn .26s var(--ease-out);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 22px; margin-bottom: 10px; }
.modal p { color: var(--ink-2); font-size: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1023px) {
  .advisor { width: 300px; }
  .palette { width: 250px; }
}

@media (max-width: 820px) {
  .studio-body { position: relative; }
  .palette, .advisor {
    position: absolute; inset: 0; width: 100%; z-index: 20;
    border: none; display: none; background: var(--bg);
  }
  .palette.mobile-open, .advisor.mobile-open { display: flex; }
  .studio-mobilenav {
    display: flex; z-index: var(--z-header);
    background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--glass-border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .mnav-item {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; border-radius: 12px; padding: 7px 4px; min-height: 52px;
    font-size: 11.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; font-family: var(--font-display);
  }
  .mnav-item.active { color: var(--primary-strong); background: var(--primary-soft); }
  .harmony-label { display: none; }
  .brand-name { display: none; }
  .save-status span { display: none; }
  .board-scroll { padding: 4px 12px 20px; }
  .hero-chip-1 { left: 3%; }
  .hero-chip-2 { right: 2%; }
  .option-cards-4 { grid-template-columns: repeat(2, 1fr); }
  .planting-banner { bottom: 12px; font-size: 13px; padding-left: 16px; }
}

@media (max-width: 480px) {
  .option-cards { grid-template-columns: 1fr 1fr; }
  .dim-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .wizard { margin-top: 0; padding-bottom: 30px; }
  #screen-onboarding.active { padding: 12px; }
  .hero-board-inner { height: 220px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-links line, .board-links .link-good { animation: none; }
}
