/* PlantOs PWA — Bloom / Research-Design-Mobile tokens */
:root {
  --sage: #b8d4c8;
  --sage-deep: #6b8f7e;
  --sage-ink: #3d5c4a;
  --off-white: #f7f5f0;
  --cream: #f1eee6;
  --divider: #e2ddd4;
  --text: #2c3a34;
  --text-2: #5c6b64;
  --text-3: #8a968f;
  --quenched: #98d4bb;
  --satisfied: #b8d4c8;
  --thirsty: #f5d5c8;
  --parched: #e8b8c4;
  --danger: #a85a5a;
  --shadow: 0 8px 28px rgba(61, 92, 74, 0.08);
  --radius: 18px;
  --tab-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-display: "Nunito", "Avenir Next Rounded", "Segoe UI", sans-serif;
  --font-body: "Nunito", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--off-white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(120% 80% at 100% -10%, rgba(184, 212, 200, 0.45), transparent 55%),
    radial-gradient(90% 60% at -10% 20%, rgba(245, 213, 200, 0.28), transparent 50%),
    var(--off-white);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: var(--sage-ink);
}

#app {
  max-width: 440px;
  margin: 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
  overflow: hidden;
  box-sizing: border-box;
}

/* —— Header —— */
.app-header {
  padding: 1.15rem 1.25rem 0.35rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--sage-ink);
  line-height: 1.05;
}

.brand-sub {
  font-size: 0.92rem;
  color: var(--text-2);
  font-weight: 600;
  line-height: 1.35;
}

.brand-date {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.header-actions {
  display: flex;
  gap: 0.4rem;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid var(--divider);
  display: grid;
  place-items: center;
  color: var(--sage-ink);
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.96);
  background: var(--sage);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* —— Screens —— */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  animation: rise 0.35s ease both;
}

.screen.active {
  display: flex;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.screen-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.5rem 1.25rem 1.75rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* legacy Edge */
}

.screen-scroll::-webkit-scrollbar {
  display: none; /* Chrome / Safari / Android */
}

.detail-body,
.photo-row,
.akte-pre,
.lex-list {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.detail-body::-webkit-scrollbar,
.photo-row::-webkit-scrollbar,
.akte-pre::-webkit-scrollbar,
.lex-list::-webkit-scrollbar {
  display: none;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0.85rem 0 0.65rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.section-count {
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
  color: var(--sage-ink);
  background: color-mix(in srgb, var(--sage) 45%, white);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.hero-card {
  margin: 0.35rem 0 0.25rem;
  padding: 1.15rem 1.15rem 1.2rem;
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(184, 212, 200, 0.65), transparent 55%),
    radial-gradient(80% 100% at 0% 100%, rgba(245, 213, 200, 0.4), transparent 50%),
    linear-gradient(165deg, #eef5f0, var(--cream));
  border: 1px solid var(--divider);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -28px;
  width: 140px;
  height: 140px;
  background:
    radial-gradient(circle at 40% 40%, rgba(107, 143, 126, 0.22), transparent 62%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-card h2 {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--sage-ink);
  position: relative;
}

.hero-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.92rem;
  max-width: 16rem;
  position: relative;
}

/* —— Today empty —— */
.empty {
  text-align: center;
  padding: 3.5rem 1.5rem 2rem;
}

.empty-orb {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff8, transparent 45%),
    linear-gradient(145deg, var(--sage), var(--quenched));
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.empty-orb svg {
  width: 40px;
  height: 40px;
  color: var(--sage-ink);
}

.empty h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.empty p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
}

/* —— Task / plant rows —— */
.task-list,
.shelf-grid {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.task-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--cream);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: transform 0.15s ease;
}

.task-card:active {
  transform: scale(0.985);
}

.plant-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.plant-avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 25%, #fff6, transparent 40%),
    linear-gradient(160deg, var(--av-a, var(--sage)), var(--av-b, var(--sage-deep)));
}

.plant-avatar svg {
  position: relative;
  width: 28px;
  height: 28px;
  color: #fff;
  opacity: 0.92;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-name {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.chip.quenched {
  background: color-mix(in srgb, var(--quenched) 55%, white);
  color: #1f5c45;
}
.chip.satisfied {
  background: color-mix(in srgb, var(--satisfied) 55%, white);
  color: var(--sage-ink);
}
.chip.thirsty {
  background: color-mix(in srgb, var(--thirsty) 70%, white);
  color: #8a4e3a;
}
.chip.parched {
  background: color-mix(in srgb, var(--parched) 70%, white);
  color: #7a3d4e;
}

.meta-muted {
  font-size: 0.78rem;
  color: var(--text-3);
}

.water-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--sage-deep);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(61, 92, 74, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}

.water-btn:active {
  transform: scale(0.94);
  background: var(--sage-ink);
}

.water-btn svg {
  width: 22px;
  height: 22px;
}

.water-btn.done {
  background: var(--quenched);
  color: var(--sage-ink);
  box-shadow: none;
}

/* —— Locations —— */
.loc-toolbar {
  margin-bottom: 0.75rem;
}
.loc-heading {
  margin: 0.25rem 0 0.15rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.loc-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--sage-deep);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.15rem 0;
  margin-bottom: 0.15rem;
  cursor: pointer;
}
.loc-back.hidden,
.hidden {
  display: none !important;
}
.loc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.loc-card {
  background: var(--cream);
  border: 1px solid var(--divider);
  border-radius: 20px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.loc-card:active {
  transform: scale(0.98);
}
.loc-hero {
  height: 110px;
  position: relative;
  background:
    radial-gradient(circle at 70% 20%, #fff6, transparent 40%),
    linear-gradient(155deg, var(--av-a, var(--sage)), var(--av-b, var(--sage-deep)));
}
.loc-hero .botany {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image:
    radial-gradient(circle at 22% 70%, #fff8 0 2px, transparent 3px),
    radial-gradient(circle at 70% 40%, #fff6 0 1.5px, transparent 3px);
}
.loc-hero svg {
  position: absolute;
  right: 10px;
  bottom: 6px;
  width: 52px;
  height: 52px;
  color: #fff9;
}
.loc-count {
  position: absolute;
  left: 10px;
  top: 10px;
  background: #0006;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.loc-hero-add {
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, #e8f0ea, #c5d4b8);
}
.loc-plus {
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--sage-deep);
  line-height: 1;
}
.loc-hero-muted {
  background: linear-gradient(155deg, #e4e4e0, #c8c8c2);
}
.loc-info {
  padding: 0.65rem 0.75rem 0.8rem;
}
.loc-card-add {
  border-style: dashed;
}
.loc-detail-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.loc-cover-btn {
  margin: 0;
}

.id-results {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.id-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--divider);
  border-radius: 14px;
  background: var(--cream);
}
.id-score {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--sage-deep);
  min-width: 2.6rem;
}
.id-body .task-name {
  font-size: 0.95rem;
}
.id-card .secondary-btn {
  margin: 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.id-attr {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.25rem 0.1rem;
}
.chat-bubble {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--sage);
  color: var(--sage-ink, #1e3329);
}
.chat-bubble.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--divider);
}
.chat-tools {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  opacity: 0.7;
}
.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}
.chat-compose input {
  width: 100%;
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
}
.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.chat-actions .secondary-btn {
  margin: 0;
}

/* —— Shelf grid —— */
.shelf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.shelf-card {
  background: var(--cream);
  border: 1px solid var(--divider);
  border-radius: 20px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  transition: transform 0.15s ease;
}

.shelf-card:active {
  transform: scale(0.98);
}

.shelf-hero {
  height: 118px;
  position: relative;
  background:
    radial-gradient(circle at 70% 20%, #fff6, transparent 40%),
    radial-gradient(circle at 20% 90%, rgba(0, 0, 0, 0.08), transparent 45%),
    linear-gradient(155deg, var(--av-a, var(--sage)), var(--av-b, var(--sage-deep)));
}

.shelf-hero .botany {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 22% 70%, #fff8 0 2px, transparent 3px),
    radial-gradient(circle at 70% 40%, #fff6 0 1.5px, transparent 3px);
}

.shelf-hero svg {
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: 72px;
  height: 72px;
  color: #fff;
  opacity: 0.92;
  filter: drop-shadow(0 4px 10px rgba(44, 58, 52, 0.18));
}

.shelf-chip {
  position: absolute;
  left: 10px;
  top: 10px;
}

.shelf-info {
  padding: 0.75rem 0.8rem 0.9rem;
}

.shelf-info .task-name {
  font-size: 0.95rem;
}

/* —— FAB —— */
.fab {
  position: fixed;
  right: max(1.25rem, calc(50% - 220px + 1.25rem));
  bottom: calc(var(--tab-h) + var(--safe-b) + 0.85rem);
  width: 56px;
  height: 56px;
  border-radius: 20px;
  background: var(--sage-deep);
  color: #fff;
  display: none;
  place-items: center;
  box-shadow: 0 10px 28px rgba(61, 92, 74, 0.35);
  z-index: 210;
}

.fab.visible {
  display: grid;
}

.fab svg {
  width: 26px;
  height: 26px;
}

/* —— Scan / Lux —— */
.lux-panel {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 1.25rem 1.1rem 1.35rem;
  background: var(--cream);
  border: 1px solid var(--divider);
  border-radius: 24px;
  text-align: center;
}

.detail-lux .lux-value {
  font-size: 3.4rem;
}

.lux-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4.2rem;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--sage-ink);
  margin: 0.5rem 0 0.35rem;
}

.lux-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
}

.lux-hint {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: var(--text-2);
}

.lux-slider {
  width: 100%;
  margin: 1.25rem 0 0.5rem;
  accent-color: var(--sage-deep);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  border-radius: 14px;
  background: var(--sage-deep);
  color: #fff;
  font-weight: 700;
  width: 100%;
  margin-top: 0.75rem;
}

.primary-btn:active {
  background: var(--sage-ink);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--divider);
  color: var(--sage-ink);
  font-weight: 650;
  width: 100%;
  margin-top: 0.5rem;
}

.scan-placeholder {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: 20px;
  border: 1.5px dashed var(--divider);
  color: var(--text-2);
  font-size: 0.9rem;
  text-align: center;
}

/* —— More —— */
.more-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  background: var(--cream);
  border: 1px solid var(--divider);
  border-radius: 16px;
  text-align: left;
  width: 100%;
}

.more-item:active {
  background: color-mix(in srgb, var(--sage) 35%, var(--cream));
}

.more-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sage) 45%, white);
  color: var(--sage-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.more-icon svg {
  width: 20px;
  height: 20px;
}

.more-text {
  flex: 1;
  min-width: 0;
}

.more-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.more-desc {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 0.1rem;
}

.more-chevron {
  color: var(--text-3);
}

.dev-note {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--thirsty) 40%, white);
  font-size: 0.8rem;
  color: var(--text-2);
}

/* —— Tab bar —— */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 0.45rem 0.5rem var(--safe-b);
  background: rgba(247, 245, 240, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 200;
  /* no transform — breaks position:fixed on mobile scroll */
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 14px;
  padding: 0.35rem;
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab.active {
  color: var(--sage-ink);
}

.tab.active svg {
  transform: translateY(-1px);
}

/* —— Sheet / modal —— */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 58, 52, 0.35);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(110%);
  bottom: 0;
  width: min(440px, 100%);
  background: var(--off-white);
  border-radius: 24px 24px 0 0;
  padding: 0.75rem 1.25rem calc(1.25rem + var(--safe-b));
  z-index: 90;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
  box-shadow: 0 -12px 40px rgba(44, 58, 52, 0.12);
}

.sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: var(--divider);
  margin: 0.2rem auto 1rem;
}

.sheet h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.field label:not(.file-btn) {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 0.35rem;
}
.field .file-btn {
  margin-bottom: 0.9rem;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--divider);
  background: #fff;
  margin-bottom: 0.9rem;
}

.field input:focus {
  outline: 2px solid color-mix(in srgb, var(--sage) 70%, transparent);
  border-color: var(--sage-deep);
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--tab-h) + var(--safe-b) + 1rem);
  background: var(--sage-ink);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(360px, calc(100% - 2rem));
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.detail-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--off-white);
  max-width: 440px;
  margin: 0 auto;
  flex-direction: column;
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
  animation: rise 0.3s ease both;
}

.detail-panel.open {
  display: flex;
}

.detail-hero {
  height: 220px;
  position: relative;
  background:
    radial-gradient(circle at 30% 20%, #fff5, transparent 45%),
    linear-gradient(160deg, var(--av-a, var(--sage)), var(--av-b, var(--sage-deep)));
  flex-shrink: 0;
}

.detail-hero svg.leaf {
  position: absolute;
  right: 24px;
  bottom: 28px;
  width: 96px;
  height: 96px;
  color: #fff;
  opacity: 0.9;
}

.detail-back {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  color: var(--sage-ink);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  margin-top: -24px;
  background: var(--off-white);
  border-radius: 24px 24px 0 0;
  position: relative;
}

.detail-body h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 1.1rem 0;
}

.action-row .primary-btn,
.action-row .secondary-btn {
  margin: 0;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.event-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--divider);
  font-size: 0.9rem;
}

.event-list .ev-type {
  font-weight: 700;
  text-transform: capitalize;
}

.event-list .ev-when {
  color: var(--text-3);
  font-size: 0.8rem;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage-deep);
  display: inline-block;
}

.status-dot.offline {
  background: var(--parched);
}

.status-dot.ok {
  background: var(--quenched);
}

.filter-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.25rem;
}

.filter-chip {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-chip.active {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: #fff;
}

.panel {
  background: var(--cream);
  border: 1px solid var(--divider);
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.panel.hidden {
  display: none;
}

.care-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.care-btn {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--sage-ink);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 0.5rem;
}

.care-btn.primary {
  grid-column: 1 / -1;
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: #fff;
}

.care-btn:active {
  transform: scale(0.98);
}

.field select {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--divider);
  background: #fff;
  margin-bottom: 0.5rem;
}

.invite-code {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--sage-ink);
  padding: 0.75rem 0;
}

.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--divider);
}

.device-row:last-child {
  border-bottom: 0;
}

.secondary-btn.compact {
  width: auto;
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  margin: 0;
  font-size: 0.78rem;
}

.danger-outline {
  color: var(--danger) !important;
  border-color: color-mix(in srgb, var(--danger) 35%, var(--divider)) !important;
}

.err-text {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0;
}

.event-list.compact li {
  padding: 0.55rem 0;
  font-size: 0.86rem;
}

.detail-body .panel .primary-btn {
  margin-top: 0.25rem;
}

.lex-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.75rem 0 1.25rem;
}

.lex-card {
  text-align: left;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--divider);
  background: var(--cream);
}

.lex-card:active {
  background: color-mix(in srgb, var(--sage) 30%, var(--cream));
}

.lex-card .task-name {
  margin-bottom: 0.15rem;
}

.lex-sci {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-3);
}

.lex-blurb {
  margin: 0.45rem 0 0;
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lex-sheet-body {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  margin: 0.75rem 0 1rem;
  scrollbar-width: none;
}

.lex-sheet-body::-webkit-scrollbar {
  display: none;
}

.lex-block {
  margin-bottom: 0.85rem;
}

.lex-block h4 {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.lex-block p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}

.lex-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.lex-actions .secondary-btn,
.lex-actions .primary-btn {
  margin: 0;
  min-height: 38px;
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
}

.photo-row {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.55rem;
  -webkit-overflow-scrolling: touch;
}

.photo-thumb {
  width: 112px;
  height: 112px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--divider);
  background: var(--cream);
}

.photo-thumb.selected {
  outline: 3px solid var(--sage-deep);
}

.photo-actions {
  margin-bottom: 0.75rem;
}
.photo-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.photo-actions-row .file-btn,
.photo-actions-row .secondary-btn {
  width: 100%;
  margin: 0;
}
.photo-lib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  margin: 0.75rem 0 1rem;
  -webkit-overflow-scrolling: touch;
}
.photo-lib-card {
  position: relative;
  border: 1px solid var(--divider);
  border-radius: 16px;
  overflow: hidden;
  background: var(--cream);
  padding: 0;
  text-align: left;
}
.photo-lib-card.selected {
  outline: 3px solid var(--sage-deep);
}
.photo-lib-pick {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.photo-lib-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.photo-lib-meta {
  padding: 0.45rem 0.55rem 0.55rem;
  font-size: 0.72rem;
  color: var(--text-2, #666);
}
.photo-lib-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #000a;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.photo-lib-del:active {
  transform: scale(0.94);
}
.sheet-tall {
  max-height: min(88vh, 720px);
}

.file-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}
.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink, inherit);
}
.loc-file-btn {
  margin: 0;
}

.care-card {
  margin: 0.75rem 0 0;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--divider);
  text-align: left;
}

.care-card h4 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sage-ink);
}

.care-card .care-summary {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.45;
}

.care-card ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-2);
  font-size: 0.88rem;
}

.care-card li {
  margin-bottom: 0.4rem;
}

.care-card .care-section {
  margin-top: 0.75rem;
}
.care-card .care-sec-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 0.25rem;
}
.care-card .care-note {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--text-3);
}

.tech-box {
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--divider);
}

.detail-hero.has-photo {
  background-size: cover !important;
  background-position: center !important;
}

.detail-hero.has-photo .leaf {
  display: none;
}

@media (min-width: 480px) {
  #app {
    box-shadow: var(--shadow);
    border-left: 1px solid var(--divider);
    border-right: 1px solid var(--divider);
  }
}

/* —— Motion system (calm, intentional) —— */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.water-splash { z-index: 250; pointer-events: none; }
.detail-panel { z-index: 260; }
/* Sheets (Bibliothek, …) must sit above full-screen detail */
.sheet-backdrop { z-index: 270; }
.sheet { z-index: 280; }
.toast { z-index: 290; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  animation: drift 18s ease-in-out infinite;
}

.orb-a {
  width: 220px;
  height: 220px;
  left: -60px;
  top: 12%;
  background: rgba(184, 212, 200, 0.7);
}

.orb-b {
  width: 180px;
  height: 180px;
  right: -40px;
  top: 42%;
  background: rgba(245, 213, 200, 0.55);
  animation-delay: -6s;
  animation-duration: 22s;
}

.orb-c {
  width: 160px;
  height: 160px;
  left: 30%;
  bottom: 8%;
  background: rgba(152, 212, 187, 0.4);
  animation-delay: -11s;
  animation-duration: 26s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  40% {
    transform: translate(18px, -24px) scale(1.08);
  }
  70% {
    transform: translate(-12px, 14px) scale(0.96);
  }
}

.brand-mark {
  animation: brandIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes brandIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.screen {
  animation: none;
}

.screen.active {
  animation: screenIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.3s; }
.stagger > *:nth-child(n + 9) { animation-delay: 0.34s; }

.stagger > .task-card,
.stagger > .shelf-card,
.stagger > .lex-card,
.stagger > .hero-card,
.stagger > .empty,
.stagger > .section-label {
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-card {
  animation: heroSoft 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes heroSoft {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chip.parched {
  animation: softPulse 2.4s ease-in-out infinite;
}

@keyframes softPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(232, 184, 196, 0.35);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 6px rgba(232, 184, 196, 0);
  }
}

.water-btn {
  position: relative;
  overflow: visible;
}

.water-btn.splash {
  animation: waterPop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes waterPop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(0.86);
  }
  70% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.water-splash {
  position: fixed;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.water-splash.go {
  animation: splashBurst 0.7s ease-out forwards;
  background: radial-gradient(circle, rgba(107, 143, 126, 0.55) 0%, transparent 70%);
  box-shadow:
    0 0 0 0 rgba(152, 212, 187, 0.5),
    18px -10px 0 -2px rgba(107, 143, 126, 0.35),
    -16px -8px 0 -3px rgba(152, 212, 187, 0.4),
    8px 16px 0 -2px rgba(184, 212, 200, 0.45),
    -12px 14px 0 -4px rgba(107, 143, 126, 0.3);
}

@keyframes splashBurst {
  0% {
    opacity: 0.9;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(4.5);
  }
}

.fab {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
  animation: fabIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fab:active {
  transform: scale(0.92) rotate(90deg);
}

@keyframes fabIn {
  from {
    opacity: 0;
    transform: scale(0.6) translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tab {
  transition: color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.tab.active {
  animation: tabSelect 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab.active::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sage-deep);
  animation: dotPop 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tabSelect {
  0% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes dotPop {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.detail-panel {
  animation: none;
  transform: translateX(8%);
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.detail-panel.open {
  transform: none;
  opacity: 1;
  animation: none;
}

.detail-hero .leaf {
  animation: leafSway 5s ease-in-out infinite;
  transform-origin: 70% 90%;
}

@keyframes leafSway {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

.photo-thumb {
  transition: transform 0.2s ease, outline 0.2s ease;
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.photo-thumb:active {
  transform: scale(0.96);
}

.toast {
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show {
  animation: toastSpring 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.toast-cute {
  max-width: min(92vw, 340px);
  padding: 0.85rem 1.15rem;
  text-align: center;
  font-weight: 700;
  line-height: 1.35;
  background: linear-gradient(145deg, #fff8f2 0%, #eef6f1 55%, #f3eef8 100%);
  color: #2f463c;
  border: 1px solid rgba(107, 143, 126, 0.35);
  box-shadow: 0 12px 28px rgba(47, 70, 60, 0.16);
}

@keyframes toastSpring {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) scale(0.94);
  }
  70% {
    transform: translateX(-50%) translateY(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.care-btn {
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.care-btn:active {
  transform: scale(0.96);
}

.care-btn.primary:active {
  box-shadow: 0 0 0 6px rgba(107, 143, 126, 0.2);
}

.lux-value {
  transition: transform 0.15s ease;
}

.lux-value.tick {
  animation: luxTick 0.2s ease;
}

@keyframes luxTick {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

.lex-card,
.shelf-card,
.task-card {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.lex-card:hover,
.shelf-card:hover,
.task-card:hover {
  box-shadow: 0 10px 28px rgba(61, 92, 74, 0.1);
}

.proton-hero h2 {
  font-size: 1.25rem;
}

.proton-steps {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.proton-steps li {
  margin-bottom: 0.45rem;
}

.proton-steps code {
  font-size: 0.85em;
  background: #fff;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--divider);
}

.step-lead {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-2);
}

.session-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

.invite-inline {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--divider);
}

.link-btn {
  display: flex;
  text-decoration: none;
  margin-top: 0.5rem;
}

/* —— Cute décor —— */
.deco {
  position: absolute;
  font-size: 1.15rem;
  opacity: 0.35;
  filter: saturate(0.9);
  animation: decoFloat 10s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

.deco.l1 { left: 8%; top: 18%; animation-delay: 0s; font-size: 1.35rem; }
.deco.l2 { right: 10%; top: 28%; animation-delay: -2.5s; }
.deco.l3 { left: 14%; bottom: 22%; animation-delay: -5s; font-size: 1.25rem; }
.deco.d1 { right: 16%; top: 58%; animation-delay: -1.2s; animation-duration: 7s; }
.deco.d2 { left: 42%; top: 12%; animation-delay: -3.8s; animation-duration: 8s; opacity: 0.28; }
.deco.h1 { right: 22%; bottom: 18%; animation-delay: -6s; color: #e8b8c4; opacity: 0.4; font-size: 1.4rem; }

@keyframes decoFloat {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

.brand-sprout {
  display: inline-block;
  font-size: 0.85em;
  animation: sproutWiggle 3.2s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes sproutWiggle {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.08); }
}

.sprout-wrap {
  background: linear-gradient(145deg, #e8f5ee, #f5d5c8) !important;
  box-shadow: 0 10px 28px rgba(107, 143, 126, 0.18);
}

.sprout-buddy {
  width: 64px;
  height: 64px;
  animation: buddyBounce 2.8s ease-in-out infinite;
}

@keyframes buddyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.sprout-buddy .blink {
  animation: blink 4.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes blink {
  0%, 42%, 48%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(0.15); }
}

.cute-empty h2 {
  animation: softPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes softPop {
  from { opacity: 0; transform: scale(0.92) translateY(6px); }
  to { opacity: 1; transform: none; }
}

.sparkle-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 1.15rem;
}

.sparkle-row span {
  display: inline-block;
  animation: sparkleHop 1.8s ease-in-out infinite;
}

.sparkle-row span:nth-child(2) { animation-delay: 0.2s; }
.sparkle-row span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sparkleHop {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
  50% { transform: translateY(-8px) scale(1.15); opacity: 1; }
}

.chip.quenched {
  animation: happyShine 3s ease-in-out infinite;
}

@keyframes happyShine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.06); }
}

.cute-bit {
  position: fixed;
  z-index: 260;
  pointer-events: none;
  font-size: 1.05rem;
  animation: bitFly 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
}

@keyframes bitFly {
  0% { opacity: 1; transform: translate(0, 0) scale(0.6); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.15); }
}

.plant-avatar {
  animation: avatarIdle 5s ease-in-out infinite;
}

@keyframes avatarIdle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2deg); }
}

.tab.active svg {
  animation: tabWiggle 0.55s ease;
}

@keyframes tabWiggle {
  0%, 100% { transform: translateY(-1px) rotate(0); }
  30% { transform: translateY(-3px) rotate(-8deg); }
  60% { transform: translateY(-2px) rotate(6deg); }
}

.hero-card::before {
  content: "✿";
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-size: 1rem;
  color: var(--sage-deep);
  opacity: 0.35;
  animation: decoFloat 9s ease-in-out infinite;
}

.lock-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(165deg, #e8f0ea 0%, var(--off-white) 45%, #f1eee6 100%);
}
.lock-gate[hidden] {
  display: none !important;
}
.lock-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--divider);
}
.lock-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--sage-deep);
  letter-spacing: 0.02em;
}
.lock-title {
  margin: 0.65rem 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--sage-ink);
}
.lock-lead {
  margin: 0 0 1rem;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.4;
}
.lock-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 6.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  line-height: 1.45;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--divider);
  background: var(--cream);
  color: var(--text);
}
#lockError {
  color: var(--danger);
  margin: 0.5rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ambient {
    display: none;
  }
  .cute-bit {
    display: none;
  }
}
