/* Spoutly — Planter-Step Watering Rail theme
   clay #b65e3a · fern #3e7a5a · butter/cream #f3e7d3 */

:root {
  --clay: #b65e3a;
  --clay-deep: #8f4629;
  --fern: #3e7a5a;
  --fern-deep: #2e5c44;
  --cream: #f3e7d3;
  --cream-soft: #faf3e6;
  --clay-tint: #e7c9b4;
  --sky: #7fb4c9;
  --butter: #e9c96a;
  --ink: #3b2a20;
  --ink-soft: #6f5a4b;
  --card-shadow: 0 2px 8px rgba(59, 42, 32, 0.14);
  --radius: 18px;
  --tabbar-h: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 85% 4%, rgba(233, 201, 106, 0.22), transparent 42%),
    linear-gradient(180deg, #f0e0c8 0%, #e9d4bb 100%);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.45;
}

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

.app { max-width: 480px; margin: 0 auto; }

/* ---------- panels ---------- */

#panels { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px); }

.panel { padding: 18px 16px 8px; animation: rise 0.25s ease; }

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

.panel-head { margin-bottom: 16px; }

.brand {
  font-size: 1.7rem;
  letter-spacing: 0.5px;
  color: var(--clay-deep);
  font-weight: 800;
}
.brand::after {
  content: "";
  display: block;
  width: 44px; height: 5px;
  margin-top: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--fern), var(--butter));
}

.panel-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--clay-deep);
}

.brand-sub { color: var(--ink-soft); font-size: 0.9rem; margin-top: 4px; }

/* ---------- planter-step rail (Porch) ---------- */

.planter-rail {
  background: var(--cream);
  border-radius: 22px;
  padding: 14px 12px 14px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(182, 94, 58, 0.18);
}

.focus-card {
  background: linear-gradient(140deg, var(--clay) 0%, var(--clay-deep) 100%);
  color: var(--cream-soft);
  border-radius: 16px;
  padding: 16px 16px 14px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.focus-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--clay-tint);
  font-weight: 700;
}

.focus-name { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }

.focus-meta { font-size: 0.9rem; color: #f6e3d4; }

.focus-date { font-size: 0.8rem; color: var(--clay-tint); font-weight: 600; }

.focus-note {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #f6e8da;
  border-left: 3px solid var(--butter);
  padding-left: 8px;
}

.focus-empty .focus-name { font-size: 1.2rem; }
.focus-empty .focus-meta { color: var(--cream-soft); }

.pebble-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 4px;
}

.pebble {
  flex: 0 0 auto;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f6ead6, var(--cream) 62%);
  border: 2px solid var(--fern);
  box-shadow: inset 0 -4px 8px rgba(62, 122, 90, 0.16), var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pebble-num { font-size: 1.7rem; font-weight: 800; color: var(--fern-deep); line-height: 1; }

.pebble-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fern);
  font-weight: 700;
  margin-top: 3px;
  line-height: 1.25;
}

.pebble-note { font-size: 0.88rem; color: var(--ink-soft); }

.quick-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--fern);
  color: var(--cream-soft);
  font-size: 1.05rem;
  font-weight: 800;
  border: none;
  border-radius: 16px;
  padding: 16px 12px;
  min-height: 56px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(46, 92, 68, 0.32);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.quick-strip:active { transform: scale(0.97); box-shadow: 0 2px 5px rgba(46, 92, 68, 0.3); }

.strip-leaf {
  width: 16px; height: 16px;
  border-radius: 50% 0 50% 50%;
  background: var(--butter);
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.rail-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-soft);
  margin: 20px 2px 10px;
  font-weight: 700;
}

/* ---------- stacks & cards ---------- */

.stack { display: flex; flex-direction: column; gap: 12px; }

.pot-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  padding: 14px 12px 12px 18px;
}

/* slim left pot_location stripe */
.pot-card::before, .leaf-row::before, .mini-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
}
.stripe-fern::before { background: var(--fern); }
.stripe-clay::before { background: var(--clay); }
.stripe-sky::before { background: var(--sky); }
.stripe-butter::before { background: var(--butter); }

/* tiny circular watered_on date dot */
.date-dot {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--cream-soft);
  border: 2px dashed var(--clay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 2px;
}
.dot-m { font-size: 0.52rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--clay); font-weight: 700; }
.dot-d { font-size: 1rem; font-weight: 800; color: var(--clay-deep); line-height: 1; }
.dot-today { border-style: solid; border-color: var(--fern); }
.dot-today .dot-m { color: var(--fern); }
.dot-today .dot-d { color: var(--fern-deep); }

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

.pot-name, .leaf-name, .mini-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ink);
  word-wrap: break-word;
}

.pot-loc, .leaf-meta, .mini-meta {
  font-size: 0.8rem;
  color: var(--fern-deep);
  font-weight: 600;
  margin-top: 2px;
}

.pot-note, .leaf-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

.pot-date { font-size: 0.74rem; color: var(--ink-soft); margin-top: 8px; }

.pot-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.leaf-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

/* ---------- chips ---------- */

.chip {
  border: none;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  min-height: 34px;
  cursor: pointer;
}
.chip-edit { background: var(--fern); color: var(--cream-soft); }
.chip-del { background: transparent; color: var(--clay-deep); border: 1.5px solid var(--clay); }
.chip:active { transform: scale(0.94); }

/* ---------- Find ---------- */

.leaf-row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: var(--cream-soft);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 12px 10px 12px 18px;
  overflow: hidden;
}

.leaf-main { flex: 1 1 auto; min-width: 0; }

.leaf-row .leaf-note { font-size: 0.82rem; }

.mini-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 12px 10px 12px 18px;
  overflow: hidden;
}

.mini-main { flex: 1 1 auto; min-width: 0; }

/* ---------- search ---------- */

.search-wrap { margin-bottom: 10px; }

.search-input {
  width: 100%;
  font-size: 1rem;
  padding: 14px 16px;
  border-radius: 999px;
  border: 2px solid var(--fern);
  background: var(--cream-soft);
  color: var(--ink);
  min-height: 50px;
  appearance: none;
  -webkit-appearance: none;
}
.search-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(62, 122, 90, 0.28); }

.find-count {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fern-deep);
  margin: 4px 2px 10px;
}

/* ---------- empty states ---------- */

.empty-state {
  background: var(--cream);
  border: 1.5px dashed var(--clay-tint);
  border-radius: var(--radius);
  padding: 30px 18px;
  text-align: left;
}
.empty-title { font-weight: 800; font-size: 1.05rem; color: var(--clay-deep); }
.empty-sub { font-size: 0.88rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Water form ---------- */

.garden-form {
  background: var(--cream);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.marker-field { display: flex; flex-direction: column; gap: 6px; }

.marker-field label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fern-deep);
}

.opt { color: var(--ink-soft); font-weight: 600; text-transform: none; letter-spacing: 0; }

.marker-field input,
.marker-field textarea {
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--cream-soft);
  border: 2px solid var(--clay-tint);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
}

.marker-field textarea { resize: vertical; min-height: 84px; }

.marker-field input:focus,
.marker-field textarea:focus {
  outline: none;
  border-color: var(--fern);
  box-shadow: 0 0 0 3px rgba(62, 122, 90, 0.22);
}

/* date input keeps its native picker; text stays legible */
.marker-field input[type="date"] { min-height: 48px; }

.form-error {
  background: #f7e3dc;
  border-left: 4px solid var(--clay);
  color: var(--clay-deep);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 12px;
}

.form-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }

.btn {
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  padding: 15px 14px;
  min-height: 54px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--fern); color: var(--cream-soft); box-shadow: 0 4px 10px rgba(46, 92, 68, 0.3); }
.btn-ghost { background: transparent; color: var(--clay-deep); border: 2px solid var(--clay); }

/* ---------- flash ---------- */

.flash {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%);
  background: var(--fern-deep);
  color: var(--cream-soft);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 6px 16px rgba(46, 92, 68, 0.4);
  z-index: 40;
  max-width: 88vw;
  text-align: center;
}

/* ---------- seed-packet bottom tab bar ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: linear-gradient(180deg, var(--cream) 0%, #ecdcbd 100%);
  border-top: 2px solid var(--clay-tint);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  max-width: 480px;
  margin: 0 auto;
}

.packet-tab {
  flex: 1 1 0;
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  justify-content: center;
}

.packet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 58px;
  height: 46px;
  background: linear-gradient(160deg, #e0b08f 0%, var(--clay) 100%);
  border-radius: 6px 6px 10px 10px;
  clip-path: polygon(50% 0%, 88% 10%, 100% 40%, 100% 100%, 0% 100%, 0% 40%, 12% 10%);
  box-shadow: 0 1px 3px rgba(59, 42, 32, 0.25);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

/* serrated top edge detail inside the packet silhouette */
.packet-serrate {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 7px;
  border-radius: 4px;
  background: rgba(243, 231, 211, 0.45);
}

.packet-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--cream-soft);
  padding-bottom: 5px;
}

.packet-tab.active .packet {
  transform: translateY(-3px) rotate(-6deg);
  box-shadow: 0 6px 10px rgba(59, 42, 32, 0.35);
  filter: brightness(1.06);
}

.packet-tab.active .packet-label { color: #fff7ea; }

/* ---------- small screens ---------- */

@media (max-width: 360px) {
  .panel { padding: 14px 12px 8px; }
  .pebble { width: 74px; height: 74px; }
  .focus-name { font-size: 1.15rem; }
}
