/* SillTender — Terracotta Shelf + Leaf Tag
   primary #b85c38 · secondary #4f7a4a · accent #e2a93b · cream background */

:root {
  --primary: #b85c38;
  --primary-deep: #9a4526;
  --secondary: #4f7a4a;
  --secondary-deep: #3d6039;
  --accent: #e2a93b;
  --cream: #fdf6ec;
  --card: #fffdf8;
  --slate: #5c6b73;
  --ink: #3a2e26;
  --ink-soft: #8a7466;
  --line: #eadfd0;
  --danger: #a83a2a;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    linear-gradient(180deg, #f7e8d4 0%, var(--cream) 34%);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- main screen area ---------- */
#screen {
  flex: 1;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(var(--tab-h) + var(--safe-b) + 26px);
}

.panel { display: block; }

.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 4px 0 16px;
}
.today-panel .page-title { color: var(--primary-deep); }
.find-panel .page-title { color: var(--secondary-deep); }

/* ---------- Today: clay-pot focus card ---------- */
.focus-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  background: linear-gradient(165deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff7ee;
  border-radius: 6px 6px 26px 26px;
  padding: 30px 22px 24px;
  box-shadow: 0 10px 22px rgba(184, 92, 56, 0.32);
  font-family: inherit;
}
.focus-rim {
  position: absolute;
  top: 12px; left: 16px; right: 16px;
  height: 10px;
  border-radius: 8px 8px 2px 2px;
  background: rgba(255, 244, 230, 0.28);
}
.pebble {
  position: absolute;
  top: -14px; right: 14px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #4a3208;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(226, 169, 59, 0.45);
}
.pebble b { font-size: 1.05rem; line-height: 1; }
.pebble i { font-style: normal; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; }

.focus-kicker {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.82;
  margin: 8px 0 6px;
}
.focus-name {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.focus-loc {
  display: block;
  font-size: 0.95rem;
  opacity: 0.92;
  margin-top: 2px;
}
.focus-date {
  display: inline-block;
  margin-top: 12px;
  background: rgba(255, 244, 230, 0.18);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
}
.focus-hint {
  display: block;
  margin-top: 12px;
  font-size: 0.78rem;
  opacity: 0.7;
}

/* wide leaf-green Log strip */
.log-strip {
  display: block;
  width: 100%;
  margin-top: 18px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  color: #f4faf2;
  background: linear-gradient(180deg, var(--secondary) 0%, var(--secondary-deep) 100%);
  border-radius: 16px;
  padding: 17px 20px;
  min-height: 56px;
  box-shadow: 0 6px 14px rgba(79, 122, 74, 0.3);
}
.log-strip:active { transform: translateY(1px); }

.today-footnote {
  margin-top: 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------- row cards (Waterings / Find) ---------- */
.rows { display: flex; flex-direction: column; gap: 12px; }

.row-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px 14px 14px 6px;
  padding: 14px 14px 14px 20px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(90, 62, 42, 0.07);
}
.row-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
}
/* curved pot rim along the top */
.row-card::after {
  content: "";
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 5px;
  border-radius: 0 0 6px 6px;
  background: var(--line);
  opacity: 0.9;
}

.stripe-terracotta::before { background: var(--primary); }
.stripe-moss::before { background: var(--secondary); }
.stripe-sun::before { background: var(--accent); }
.stripe-slate::before { background: var(--slate); }

.seed-dot {
  flex: 0 0 auto;
  width: 10px; height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--secondary);
  opacity: 0.55;
}
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta { font-size: 0.85rem; color: var(--ink-soft); }
.row-note {
  margin-top: 5px;
  font-size: 0.83rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-date {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---------- empty states ---------- */
.empty {
  text-align: center;
  padding: 44px 18px;
  border: 1.5px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.6);
}
.empty-dot {
  display: block;
  width: 26px; height: 26px;
  margin: 0 auto 12px;
  border-radius: 50% 50% 50% 4px;
  background: var(--accent);
  opacity: 0.65;
}
.empty-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.empty-body { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Log form (leaf-tag panel) ---------- */
.log-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 8px solid var(--secondary);
  border-radius: 8px 20px 20px 8px;
  padding: 20px 16px 16px 16px;
  box-shadow: 0 4px 12px rgba(90, 62, 42, 0.08);
}
.log-panel .page-title { margin-top: 0; }

.field { display: block; margin-bottom: 15px; }
.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--secondary-deep);
  margin-bottom: 6px;
}
.field-label em {
  font-style: normal;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
}
.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  min-height: 48px;
  outline: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus,
.field textarea:focus {
  border-color: var(--secondary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 122, 74, 0.16);
}
.field-error {
  display: block;
  margin-top: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn {
  flex: 1;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  min-height: 52px;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: #fff7ee;
  box-shadow: 0 4px 10px rgba(184, 92, 56, 0.3);
}
.btn-primary:active { background: var(--primary-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.btn-ghost:active { background: var(--cream); }

/* ---------- Find: search + about ---------- */
.search-wrap { margin-bottom: 16px; }
.search-field {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--secondary);
  border-radius: 999px;
  padding: 13px 18px;
  min-height: 50px;
  outline: none;
}
.search-field:focus {
  box-shadow: 0 0 0 3px rgba(79, 122, 74, 0.16);
}
.search-field::-webkit-search-cancel-button { -webkit-appearance: none; }

.about {
  margin-top: 30px;
  padding: 16px 4px 6px;
  border-top: 1.5px solid var(--line);
}
.about-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-deep);
  margin-bottom: 8px;
}
.about-line { font-size: 0.9rem; color: var(--ink); }
.about-note { margin-top: 6px; font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- action sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58, 46, 38, 0.42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  animation: fade-in 0.15s ease-out;
}
.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + var(--safe-b));
  box-shadow: 0 -8px 28px rgba(58, 46, 38, 0.25);
  animation: slide-up 0.18s ease-out;
}
.sheet-grip {
  width: 44px; height: 5px;
  border-radius: 3px;
  background: var(--line);
  margin: 6px auto 12px;
}
.sheet-title { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.sheet-sub { font-size: 0.85rem; color: var(--ink-soft); margin: 2px 0 14px; }
.sheet-btn {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  background: var(--cream);
  border: none;
  border-radius: 12px;
  padding: 15px 16px;
  min-height: 50px;
  margin-bottom: 9px;
  cursor: pointer;
  color: var(--ink);
}
.sheet-edit { color: var(--secondary-deep); }
.sheet-delete { color: var(--danger); }
.sheet-close { text-align: center; color: var(--ink-soft); margin-bottom: 0; }
.sheet-btn:active { filter: brightness(0.95); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(30%); } to { transform: translateY(0); } }

/* ---------- bottom tab bar: flat watering-can silhouettes ---------- */
#tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: #fff8ef;
  border-top: 1.5px solid var(--line);
  box-shadow: 0 -4px 14px rgba(90, 62, 42, 0.08);
  z-index: 30;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  min-height: 48px;
}
.can-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.can {
  width: 26px; height: 26px;
  fill: #b7a294;           /* matte inactive */
  transition: transform 0.18s ease, fill 0.18s ease;
  transform-origin: 80% 90%;
}
.tab.active .can { fill: var(--primary); transform: rotate(-14deg); }
.can-wrap::after {
  content: "";
  width: 18px; height: 3px;
  border-radius: 50%;
  background: transparent;
}
.tab.active .can-wrap::after {
  background: rgba(184, 92, 56, 0.28);  /* short shadow under the tilted can */
}
.tab-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #a08b7c;
}
.tab.active .tab-label { color: var(--primary-deep); font-weight: 700; }

/* ---------- small screens ---------- */
@media (max-width: 360px) {
  .page-title { font-size: 1.45rem; }
  .focus-name { font-size: 1.4rem; }
}
