:root {
  --bg: #09110d;
  --bg-soft: #0f1a14;
  --panel: rgba(16, 27, 21, 0.9);
  --panel-strong: rgba(20, 35, 27, 0.96);
  --panel-alt: rgba(31, 47, 37, 0.88);
  --text: #edf6ef;
  --muted: #9bb3a3;
  --accent: #86ef98;
  --accent-strong: #4fd16e;
  --danger: #ff8e8e;
  --ring: rgba(134, 239, 152, 0.35);
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(74, 140, 94, 0.28) 0%, transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(21, 88, 56, 0.36) 0%, transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(63, 122, 84, 0.18) 0%, transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Manrope, Segoe UI, sans-serif;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.2;
  z-index: -1;
}
.orb-a { width: 360px; height: 360px; background: #67d37e; top: -100px; right: -40px; }
.orb-b { width: 320px; height: 320px; background: #265d3d; bottom: -90px; left: -50px; }

.screen { min-height: 100vh; }
.hidden { display: none !important; }

.screen-login {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.card,
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.login-card {
  width: min(560px, 100%);
  padding: 28px;
  animation: rise 0.5s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.brand-logo,
.side-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}
.brand h1,
.app-brand h2,
.content-header h3,
.card h4,
.panel h4,
.feature-tile h5,
.module-card h5,
.row strong {
  margin: 0;
  font-family: Space Grotesk, sans-serif;
}
.brand p,
.warning-box p,
.content-header p,
.card p,
.panel p,
.row small,
.muted {
  color: var(--muted);
}

.warning-box {
  border: 1px solid rgba(134, 239, 152, 0.2);
  background: rgba(134, 239, 152, 0.08);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 18px;
}
.warning-box p { margin: 6px 0 0; }

.stack { display: grid; gap: 12px; }
.social-login-stack {
  display: grid;
  gap: 8px;
}
.social-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 11px 14px;
  font-family: Space Grotesk, sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.social-login-link:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}
.social-login-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}
.social-login-icon svg {
  width: 100%;
  height: 100%;
}
.social-login-discord .social-login-icon {
  color: #9ca9ff;
}
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  border-radius: 13px;
  padding: 12px 13px;
  font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ring); border-color: transparent; }

button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #08200f;
  padding: 11px 14px;
  font-family: Space Grotesk, sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
button:hover { filter: brightness(1.04); transform: translateY(-1px); }
button.ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
}
button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #08200f;
  padding: 11px 14px;
  border-radius: 10px;
}
button.primary:hover { filter: brightness(1.08); }
button.primary-compact {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #08200f;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}
button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
}
button.secondary:hover { background: rgba(255, 255, 255, 0.12); }

.error { color: var(--danger); margin: 0; }

#app-screen {
  display: block;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(18px);
  background: rgba(9, 17, 13, 0.72);
  border-bottom: 1px solid var(--border);
  padding: 8px 18px;
}

.app-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 0;
}

.app-brand h2 {
  font-size: 1.65rem;
  line-height: 1.05;
}

.app-brand .app-kicker {
  margin-bottom: 2px;
  line-height: 1;
}

.app-brand small {
  display: block;
  line-height: 1.2;
}

.app-kicker,
.view-kicker,
.section-label,
.hero-copy small {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: #79d98f;
}

.app-brand small,
.hero-copy p,
.hero-stat span,
.feature-tile p,
.sync-meta,
.badge-inline {
  color: var(--muted);
}

.content {
  padding: 22px;
}

.app-body {
  padding-bottom: 108px;
}

.content-header {
  display: block;
}

.content-header h3 {
  font-size: clamp(1.45rem, 2vw, 1.9rem);
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  padding: 0;
}

.bell-icon {
  font-size: 16px;
  line-height: 1;
}

.bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff6b6b;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}

.notifications-panel {
  position: fixed;
  top: 64px;
  right: 18px;
  width: min(420px, calc(100vw - 24px));
  max-height: 70vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 40;
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.notifications-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.notification-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.notification-item h5 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.notification-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.notification-meta {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
}

#logout-btn {
  padding: 8px 12px;
}

.view {
  display: grid;
  gap: 18px;
}

.hero-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(8, 22, 17, 0.96), rgba(15, 43, 27, 0.94)),
    linear-gradient(135deg, #14271d, #173626);
}

.hero-main {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.overview-hero-main {
  justify-content: flex-start;
}

.hero-copy {
  display: grid;
  gap: 8px;
}

.hero-copy h4 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.hero-stats,
.grid,
.module-grid,
.icon-grid,
.mini-grid,
.grow-grid,
.split-grid {
  display: grid;
  gap: 12px;
}

.hero-stats,
.grid,
.mini-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.hero-stat,
.card,
.panel {
  padding: 16px;
}

.hero-stat {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 6px;
}

.hero-stat strong {
  font: 700 1.8rem Space Grotesk, sans-serif;
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-block {
  display: grid;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-marker {
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8df0a2, #43c064);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 112px));
  gap: 8px;
  justify-content: start;
}

.feature-grid.android-grid {
  grid-template-columns: repeat(auto-fill, minmax(92px, 112px));
}

.feature-grid.all-modules-grid {
  grid-template-columns: repeat(auto-fill, minmax(92px, 112px));
}

.feature-tile,
.module-card,
.icon-item,
.row,
.sync-pill {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 14px;
}

.feature-tile {
  width: 100%;
  min-height: 92px;
  aspect-ratio: auto;
  padding: 8px 6px;
  text-align: center;
  color: var(--text);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  border: 0;
  background: linear-gradient(135deg, var(--tile-a, #33483b), var(--tile-b, #223328));
}

.feature-tile img,
.module-card img,
.module-detail-head img,
.icon-item img,
.nav-item img {
  object-fit: contain;
}

.feature-tile img {
  width: 34px;
  height: 34px;
}

.feature-tile h5 {
  margin: 0;
  font-size: 0.67rem;
  line-height: 1.15;
}

.settings-group {
  display: grid;
  gap: 8px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
}

.settings-row-main {
  display: grid;
  gap: 2px;
}

.settings-row small {
  color: var(--muted);
  font-size: 0.76rem;
}

.settings-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.settings-row select {
  width: 145px;
  padding: 8px 10px;
}

.history-row {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.settings-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  font: 700 0.82rem Space Grotesk, sans-serif;
}

.grow-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  align-items: start;
}

.grow-header-panel {
  padding: 14px 16px;
}

.grow-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.grow-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grow-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  border-radius: 999px;
  font: 700 0.82rem Space Grotesk, sans-serif;
  background: rgba(134, 239, 152, 0.2);
  color: #b8f9c3;
  border: 1px solid rgba(134, 239, 152, 0.35);
}

.grow-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grow-header-actions img {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
}

.grow-list {
  display: grid;
  gap: 12px;
}

.grow-empty-state {
  min-height: 54vh;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 22px;
}

.grow-empty-logo-wrap {
  width: 100px;
  height: 100px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: rgba(134, 239, 152, 0.1);
  border: 1px solid rgba(134, 239, 152, 0.22);
}

.grow-empty-logo-wrap img {
  width: 64px;
  height: 64px;
}

.grow-plant-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 36, 28, 0.9), rgba(13, 21, 16, 0.95));
}

.grow-plant-top {
  height: 5px;
  background: linear-gradient(90deg, var(--m1), var(--m2), var(--m3));
}

.grow-plant-main {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.grow-plant-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
}

.grow-plant-avatar img {
  width: 36px;
  height: 36px;
}

.grow-plant-body {
  display: grid;
  gap: 6px;
}

.grow-plant-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.grow-phase {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  padding: 2px 7px 2px 4px;
  background: color-mix(in srgb, var(--phase) 18%, transparent);
  color: var(--phase);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.phase-pill-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--phase) 50%, transparent));
}

/* ── Phase progress icon ───────────────────────────────────── */
.phase-step-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  opacity: 0.35;
  transition: opacity 0.2s, filter 0.2s;
}

.phase-step.done .phase-step-icon {
  opacity: 0.7;
  filter: drop-shadow(0 0 3px var(--ph));
}

.phase-step.active .phase-step-icon {
  opacity: 1;
  filter: drop-shadow(0 0 5px var(--ph));
}

/* ── Phase picker buttons ──────────────────────────────────── */
.phase-select-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.phase-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 10px 5px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-width: 52px;
  font-size: 0.65rem;
  color: var(--text);
}

.phase-pick-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.phase-pick-btn span {
  line-height: 1.1;
  text-align: center;
}

.phase-pick-btn--active {
  opacity: 1;
  border-color: var(--ph, var(--accent)) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ph, var(--accent)) 25%, transparent);
}

/* ── Manufacturer/Strain input wrapper ─────────────────────── */
.manu-field-wrap {
  position: relative;
}

.manu-field-wrap input {
  width: 100%;
}

/* ── Custom Searchable Select ──────────────────────────────── */
.ss-wrap {
  position: relative;
  width: 100%;
}

.ss-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 36px 9px 12px;
  font-size: 0.9rem;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  min-height: 40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ss-trigger:hover {
  border-color: rgba(134, 239, 152, 0.35);
}

.ss-wrap.open .ss-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(134, 239, 152, 0.18);
  outline: none;
}

.ss-chevron {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 0.75rem;
  transition: transform 0.15s;
}

.ss-wrap.open .ss-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 9999;
  background: #0e1c14;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.65);
  overflow: hidden;
}

.ss-filter-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.ss-filter {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.88rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.ss-filter:focus {
  border-color: var(--accent);
}

.ss-list {
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ss-option {
  padding: 10px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ss-option:last-child { border-bottom: none; }

.ss-option:hover {
  background: rgba(134, 239, 152, 0.1);
}

.ss-option.ss-selected {
  color: var(--accent);
  font-weight: 600;
}

.ss-option.ss-highlighted {
  background: rgba(134, 239, 152, 0.1);
}

.ss-empty {
  padding: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}



.grow-medium-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--dot);
}

.grow-overdue {
  border-radius: 6px;
  padding: 2px 6px;
  background: rgba(211, 47, 47, 0.14);
  color: #ff8f8f;
  font-size: 0.7rem;
  font-weight: 700;
}

.grow-plant-body h5 {
  margin: 0;
  font: 800 0.88rem Space Grotesk, sans-serif;
}

.grow-plant-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.grow-plant-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.grow-chip {
  display: inline-flex;
  border-radius: 7px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-right: 4px;
}

.chip-thc {
  background: rgba(233, 30, 99, 0.16);
  color: #ff7cab;
}

.chip-cbd {
  background: rgba(33, 150, 243, 0.16);
  color: #87cbff;
}

.grow-plant-actions {
  align-self: start;
}

.grow-fab {
  position: fixed;
  right: 22px;
  bottom: 95px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  font-size: 1.5rem;
  z-index: 30;
}

.grow-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 16px;
}

.grow-modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 18px;
}

.grow-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.grow-add-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.grow-modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Growbox cards ─────────────────────────────────────────── */
.growbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.growbox-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.growbox-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.growbox-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.growbox-card-info {
  display: grid;
  gap: 4px;
}

.growbox-card-info strong { font-size: 0.92rem; }
.growbox-card-info small { font-size: 0.75rem; color: var(--muted); }

.growbox-card-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.growbox-card-right small { font-size: 0.7rem; color: var(--muted); }

.growbox-add-row {
  padding: 6px 0 2px;
}

/* ── Plant / Box detail screens ────────────────────────────── */
.detail-header {
  padding: 14px 16px 16px;
}

.detail-back {
  font-size: 0.82rem;
  padding: 5px 10px;
  border-radius: 8px;
}

.detail-stripe {
  height: 5px;
  border-radius: 3px;
  margin: 10px 0 12px;
}

.detail-title-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.detail-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.detail-info-item {
  display: grid;
  gap: 2px;
}

.detail-info-item span {
  font-size: 0.72rem;
  color: var(--muted);
}

.detail-info-item strong {
  font-size: 0.88rem;
}

/* ── Phase progress bar ────────────────────────────────────── */
.phase-progress {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 14px 12px;
  scrollbar-width: none;
}

.phase-progress::-webkit-scrollbar { display: none; }

.phase-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 48px;
  position: relative;
}

.phase-step + .phase-step::before {
  content: '';
  position: absolute;
  left: -50%;
  top: 5px;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.phase-step.done + .phase-step::before,
.phase-step.done + .phase-step.done::before {
  background: var(--ph, var(--accent));
}

.phase-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  position: relative;
  z-index: 1;
  transition: background 0.2s, border-color 0.2s;
}

.phase-step.done .phase-dot {
  background: var(--ph);
  border-color: var(--ph);
}

.phase-step.active .phase-dot {
  background: var(--ph);
  border-color: var(--ph);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ph) 25%, transparent);
}

.phase-step span {
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.phase-step.done span,
.phase-step.active span {
  color: var(--ph);
  font-weight: 700;
}

/* ── Quick actions ─────────────────────────────────────────── */
.quick-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  min-width: 58px;
}

.quick-action img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* ── Phase change ──────────────────────────────────────────── */
.phase-change-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Entries list ──────────────────────────────────────────── */
.entries-list {
  display: grid;
  gap: 8px;
}

.entry-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.entry-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0.85;
}

.entry-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.entry-notes {
  color: var(--muted);
  font-size: 0.85rem;
}

.entry-body small {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Danger zone ───────────────────────────────────────────── */
.danger-zone {
  border-color: rgba(220, 70, 70, 0.2) !important;
}

.danger-btn {
  border-color: rgba(220, 70, 70, 0.35) !important;
  color: var(--danger) !important;
}

/* ── Inline form ───────────────────────────────────────────── */

.split-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.inline-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.inline-form button { align-self: end; }

.badge-inline {
  display: inline-flex;
  width: fit-content;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  margin-bottom: 8px;
}

.module-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.module-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: start;
}

.module-card img,
.module-detail-head img {
  width: 42px;
  height: 42px;
}

.module-card p {
  margin: 6px 0 12px;
  font-size: 0.9rem;
}

.module-detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.icon-grid {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.icon-item {
  padding: 10px;
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.icon-item img {
  width: 48px;
  height: 48px;
}

.icon-item small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  word-break: break-word;
}

.sync-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sync-pill {
  padding: 10px 12px;
  min-width: 140px;
}

.sync-pill strong {
  display: block;
  margin-bottom: 4px;
}

.bottom-nav {
  --nav-count: 4;
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(var(--nav-count), minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  background: rgba(10, 18, 13, 0.84);

  /* ---- Tool UIs ---- */
  .btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
  }
  .btn-row .ghost {
    padding: .28rem .75rem;
    font-size: .82rem;
    border-radius: .5rem;
    opacity: .7;
    transition: opacity .15s, border-color .15s;
  }
  .btn-row .ghost.active {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
  }

  .result-card {
    margin-top: .8rem;
    padding: .8rem 1rem;
    background: var(--panel-alt);
    border-radius: .6rem;
    border: 1px solid var(--border);
    text-align: center;
  }
  .result-big {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 .2rem;
  }
  .result-label {
    font-size: .95rem;
    font-weight: 600;
    margin: 0 0 .2rem;
  }
  .result-desc {
    font-size: .83rem;
    color: var(--muted);
    margin: 0;
  }

  .symptom-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
  }
  .symptom-chip {
    font-size: .8rem;
    padding: .28rem .65rem;
    border-radius: 1rem;
    opacity: .7;
    transition: opacity .15s, border-color .15s;
  }
  .symptom-chip.active {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
  }

/* ── Task rows ─────────────────────────────────────────────── */
.task-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: none; }
.task-row.task-done { opacity: .55; }
.task-icon { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; margin-top: .1rem; }
.task-body { flex: 1; display: flex; flex-direction: column; gap: .18rem; font-size: .86rem; }
.task-notes { color: var(--muted); font-size: .8rem; }
.task-plant { color: var(--accent); font-size: .78rem; }
.task-date { color: var(--muted); font-size: .72rem; }
.task-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--text); cursor: pointer; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn.done { color: var(--accent); border-color: var(--accent); }
.icon-btn.danger { color: var(--danger); border-color: rgba(255,142,142,.3); }
.icon-btn.danger:hover { background: rgba(255,142,142,.12); }
.task-check { font-size: 1rem; }

/* ── Phase stat row ───────────────────────────────────────── */
.phase-stat-row, .entry-stat-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem 0; border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.phase-stat-row:last-child, .entry-stat-row:last-child { border-bottom: none; }
.stat-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.stat-bar { height: 100%; border-radius: 3px; min-width: 4px; transition: width .4s; }

/* ── Achievement rows ──────────────────────────────────────── */
.achievement-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.achievement-row:last-child { border-bottom: none; }
.achievement-row.locked { opacity: .4; }
.ach-icon { font-size: 1.4rem; flex-shrink: 0; }
.ach-body { flex: 1; display: flex; flex-direction: column; gap: .1rem; font-size: .86rem; }
.ach-body small { font-size: .76rem; color: var(--muted); }
.ach-badge { font-size: .9rem; }
.ach-progress-bar { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; margin: .4rem 0 .2rem; }

/* ── Diary plant header ─────────────────────────────────────── */
.diary-plant-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem .8rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Gallery ─────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .5rem;
  padding: .5rem;
}
.gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: .4rem;
  background: var(--surface2, #1a2a1f);
  position: relative;
}
.gallery-thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .65rem;
  padding: .15rem .3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-lightbox { display: flex !important; }
.gallery-lightbox.hidden { display: none !important; }



  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
  }
  .data-table th {
    text-align: left;
    padding: .4rem .5rem;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
  }
  .data-table td {
    padding: .4rem .5rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
    vertical-align: top;
  }
  .data-table tr:last-child td {
    border-bottom: none;
  }
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  z-index: 20;
}

.nav {
  display: grid;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  padding: 7px 6px;
  font-size: .72rem;
}

.nav-item img {
  width: 14px;
  height: 14px;
  display: block;
  margin: 0 auto;
}

.nav-item.active {
  background: rgba(134, 239, 152, 0.12);
  border-color: rgba(134, 239, 152, 0.25);
}

.status-note {
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 980px) {
  .grow-grid,
  .split-grid,
  .hero-main {
    grid-template-columns: 1fr;
    display: grid;
  }

  .content-header {
    display: block;
  }

  .app-topbar,
  .content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .feature-grid.android-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 104px));
  }
}

@media (max-width: 640px) {
  .hero-stats,
  .grid,
  .feature-grid,
  .split-grid,
  .module-grid,
  .icon-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    bottom: 12px;
    width: calc(100% - 16px);
    padding: 8px;
  }

  .feature-grid.android-grid,
  .grow-add-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid,
  .feature-grid.all-modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-row {
    grid-template-columns: 1fr;
  }

  .settings-row select {
    width: 100%;
  }

  .grow-plant-main {
    grid-template-columns: 56px 1fr;
  }

  .grow-plant-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .grow-fab {
    right: 16px;
    bottom: 88px;
  }

  .nav-item {
    font-size: 0.7rem;
    padding: 6px 4px;
  }

  .hero-logo {
    width: 70px;
    height: 70px;
  }

  .app-topbar {
    padding: 8px 14px;
  }

  .app-brand h2 {
    font-size: 1.35rem;
  }

  .side-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  #logout-btn {
    padding: 7px 10px;
    font-size: 0.82rem;
  }
}
