/* Potfolio — Terracotta Pot Cluster theme */

:root {
  --clay: #c97b4a;
  --clay-deep: #a95f34;
  --clay-pale: #f3e0d0;
  --clay-paper: #faf1e6;
  --basil: #4f6b3a;
  --basil-deep: #3c5229;
  --sage: #7a9159;
  --sun: #e3b448;
  --rain: #5b8fa8;
  --ink: #3a2c22;
  --ink-soft: #7a6656;
  --card: #fffaf3;
  --radius-slip: 22px 10px 10px 22px;
  --tabbar-h: 74px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(120% 60% at 50% 0%, #f6e3cf 0%, var(--clay-paper) 55%, #f4e6d5 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 20px);
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

/* ================= pot-cluster header (Today) ================= */

.potcluster {
  position: relative;
  margin: 0 -16px 18px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 26px;
  background: linear-gradient(160deg, var(--clay) 0%, var(--clay-deep) 90%);
  border-radius: 0 0 34px 8px;
  color: #fff7ee;
  overflow: hidden;
}

.potcluster__pots {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 64px;
}

.pot {
  display: block;
  background: rgba(255, 244, 230, 0.92);
  clip-path: polygon(12% 0, 88% 0, 100% 22%, 72% 100%, 28% 100%, 0 22%);
  position: relative;
}

.pot--l { width: 58px; height: 52px; opacity: 0.55; }
.pot--m { width: 74px; height: 62px; opacity: 0.75; }
.pot--s { width: 46px; height: 42px; opacity: 0.95; }

.pot--m::after {
  content: "";
  position: absolute;
  top: -26px;
  left: 50%;
  width: 20px;
  height: 26px;
  background: var(--basil);
  border-radius: 80% 90% 40% 60% / 90% 80% 40% 50%;
  transform: translateX(-40%) rotate(14deg);
}

.potcluster__medalwrap {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 34px);
  right: 20px;
}

.medallion {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--sun);
  border: 5px solid #fff3dd;
  box-shadow: 0 6px 14px rgba(58, 32, 12, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #5a3c14;
}

.medallion__num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.medallion__cap {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}

.potcluster__title {
  margin: 14px 0 2px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.potcluster__sub {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
}

/* ================= sage quick action ================= */

.sage-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px 6px 18px 6px;
  background: linear-gradient(140deg, var(--sage), var(--basil));
  color: #f4f8ec;
  box-shadow: 0 8px 18px rgba(63, 82, 41, 0.35);
  text-align: left;
  min-height: 64px;
}

.sage-strip:active { transform: scale(0.98); }

.sage-strip__leaf {
  flex: 0 0 auto;
  width: 26px;
  height: 34px;
  background: #e8f0d8;
  border-radius: 90% 10% 90% 10% / 90% 90% 10% 10%;
  transform: rotate(-8deg);
}

.sage-strip__text { display: flex; flex-direction: column; gap: 2px; }
.sage-strip__text strong { font-size: 18px; font-weight: 800; }
.sage-strip__text small { font-size: 13px; opacity: 0.85; }

/* ================= headings + slips ================= */

.slip-heading {
  margin: 26px 2px 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay-deep);
}

.nextcare__label {
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.slip {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-bottom: 12px;
  border-radius: var(--radius-slip);
  background: var(--card);
  box-shadow: 0 3px 10px rgba(90, 58, 30, 0.12);
  overflow: hidden;
}

.slip__body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 14px 14px 14px 0;
  text-align: left;
  min-height: 68px;
}

.slip__body:active { background: #fdf3e7; }

.slip__strip {
  flex: 0 0 10px;
  align-self: stretch;
  margin-right: 2px;
}

.slip--basil .slip__strip   { background: var(--basil); }
.slip--clay  .slip__strip   { background: var(--clay); }
.slip--sun   .slip__strip   { background: var(--sun); }
.slip--rain  .slip__strip   { background: var(--rain); }

.slip__notch {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--clay-pale);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.slip__notch b { font-size: 16px; font-weight: 800; color: var(--ink); }
.slip__notch i {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
}

.slip__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.slip__plant {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slip__meta { font-size: 13px; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; }

.slip__type {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
}

.slip__type--basil { background: #e2ebd6; color: var(--basil-deep); }
.slip__type--clay  { background: #f6ddc9; color: var(--clay-deep); }
.slip__type--sun   { background: #f8ebc8; color: #7a5a12; }
.slip__type--rain  { background: #dcebf2; color: #2f5a70; }

.slip__note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.slip__del {
  flex: 0 0 auto;
  align-self: center;
  margin-right: 10px;
  padding: 10px 12px;
  border-radius: 14px 4px 4px 14px;
  background: #f7e4da;
  color: #8f3d1c;
  font-size: 13px;
  font-weight: 800;
  min-height: 44px;
}

.slip__del[data-arm="1"] {
  background: #b34724;
  color: #fff2e8;
}

/* ================= view heads ================= */

.view-head { padding: calc(env(safe-area-inset-top, 0px) + 22px) 2px 14px; }

.view-head__title {
  margin: 0 0 4px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--clay-deep);
}

.view-head--plants .view-head__title { color: var(--basil-deep); }
.view-head--log .view-head__title { color: var(--clay-deep); }
.view-head--find .view-head__title { color: #2f5a70; }

.view-head__sub { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ================= plants groups ================= */

.plantgroup { margin-bottom: 22px; }

.plantgroup__name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--basil-deep);
}

.plantgroup__name small {
  font-size: 12px;
  font-weight: 800;
  background: #e2ebd6;
  color: var(--basil-deep);
  border-radius: 999px;
  padding: 2px 9px;
}

.plantgroup__leaf {
  width: 16px;
  height: 22px;
  background: var(--basil);
  border-radius: 90% 10% 90% 10% / 90% 90% 10% 10%;
  transform: rotate(-10deg);
}

/* ================= Log form (potting bench) ================= */

.bench {
  background: var(--card);
  border: 2px solid var(--clay-pale);
  border-radius: 26px 12px 12px 26px;
  padding: 20px 18px 24px;
  box-shadow: 0 6px 16px rgba(90, 58, 30, 0.1);
}

.bench__field { margin-bottom: 18px; }

.bench__field label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}

.bench__field label em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--clay-deep);
  background: var(--clay-pale);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
}

.bench__field input,
.bench__field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid #ead9c5;
  border-radius: 14px;
  padding: 13px 14px;
  min-height: 50px;
  outline: none;
}

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

.bench__field input:focus,
.bench__field textarea:focus {
  border-color: var(--basil);
  box-shadow: 0 0 0 3px rgba(122, 145, 89, 0.2);
}

.bench__err {
  margin: 7px 2px 0;
  font-size: 13px;
  font-weight: 700;
  color: #a33a18;
}

.chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 10px 15px;
  min-height: 44px;
  border-radius: 999px;
  background: #f2e4d3;
  border: 2px solid transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.chip--on {
  background: var(--basil);
  border-color: var(--basil-deep);
  color: #eef4e2;
}

.bench__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.bench__save {
  min-height: 54px;
  border-radius: 18px 8px 18px 8px;
  background: var(--clay);
  color: #fff6ec;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(169, 95, 52, 0.35);
}

.bench__save:active { transform: scale(0.98); }

.bench__cancel {
  min-height: 48px;
  border-radius: 14px;
  border: 2px solid #ead9c5;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
}

.bench__ok {
  margin: 14px 2px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--basil-deep);
}

/* ================= Find ================= */

.findbox { padding: 0 0 4px; }

.findbox input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 13px 16px;
  min-height: 52px;
  border-radius: 999px 12px 12px 999px;
  border: 2px solid #cfe0e6;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.findbox input:focus {
  border-color: var(--rain);
  box-shadow: 0 0 0 3px rgba(91, 143, 168, 0.18);
}

.find-count {
  margin: 12px 2px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #2f5a70;
}

/* ================= empty states ================= */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 34px 20px;
  border: 2px dashed #e0c4ab;
  border-radius: 24px 10px 10px 24px;
  background: rgba(255, 250, 243, 0.7);
}

.empty strong { font-size: 17px; color: var(--ink); }
.empty span { font-size: 14px; color: var(--ink-soft); }

.empty__pot {
  width: 56px;
  height: 44px;
  background: var(--clay);
  clip-path: polygon(12% 0, 88% 0, 100% 22%, 72% 100%, 28% 100%, 0 22%);
  position: relative;
  margin-bottom: 6px;
}

.empty__pot::after {
  content: "";
  position: absolute;
  top: -24px;
  left: 50%;
  width: 18px;
  height: 24px;
  background: var(--sage);
  border-radius: 90% 10% 90% 10% / 90% 90% 10% 10%;
  transform: translateX(-40%) rotate(12deg);
}

/* ================= bottom tab bar (clay pots) ================= */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 6px);
  background: linear-gradient(180deg, #5c3a22, #4a2d1a);
  box-shadow: 0 -6px 18px rgba(40, 24, 12, 0.4);
  max-width: 480px;
  margin: 0 auto;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 4px 0;
}

.tab__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #c9a888;
}

.tab__pot {
  width: 30px;
  height: 24px;
  background: #a8815f;
  clip-path: polygon(10% 0, 90% 0, 100% 24%, 70% 100%, 30% 100%, 0 24%);
  transform-origin: 50% 100%;
  transition: transform 0.18s ease, background 0.18s ease;
}

.tab--active .tab__pot {
  background: var(--sun);
  transform: rotate(-8deg) translateY(-3px);
}

.tab--active .tab__pot::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 30px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
}

.tab__pot { position: relative; }

.tab--active .tab__label { color: var(--sun); }

/* ================= small screens ================= */

@media (max-width: 360px) {
  .medallion { width: 72px; height: 72px; }
  .medallion__num { font-size: 25px; }
  .potcluster__title { font-size: 26px; }
}
