:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #203126;
  --muted: #687567;
  --panel: #ffffff;
  --line: #dfe7d7;
  --leaf: #9bc54b;
  --leaf-dark: #7fa838;
  --leaf-soft: #e2efd9;
  --alert: #a45222;
  --shadow: 0 18px 50px rgba(30, 56, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--leaf);
  color: #ffffff;
  cursor: pointer;
  font-weight: 750;
  min-height: 44px;
  padding: 0.75rem 1rem;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

button:hover {
  background: var(--leaf-dark);
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
.photo-picker:focus-within {
  outline: 3px solid rgba(47, 107, 69, 0.28);
  outline-offset: 2px;
}

.app {
  margin: 0 auto;
  max-width: 1180px;
  padding: 2rem;
}

.hero {
  align-items: end;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 2rem 0 1.5rem;
}

.brand {
  margin: 0 0 1rem;
  max-width: 620px;
}

.brand-logo {
  display: block;
  height: auto;
  max-height: 138px;
  max-width: min(100%, 620px);
  object-fit: contain;
  object-position: left center;
  width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.96;
  margin-bottom: 1rem;
  max-width: 830px;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 0;
}

.human-name,
.common-name,
.last-repotted,
.soil-type {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0;
  margin-top: 0.18rem;
}

.intro,
.form-header p,
.list-header p {
  color: var(--muted);
}

.intro {
  font-size: 1.08rem;
  line-height: 1.55;
  margin-bottom: 0;
  max-width: 560px;
}

.hero-stat {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  min-width: 145px;
  padding: 1rem;
  text-align: center;
}

.hero-stat span {
  color: var(--leaf);
  font-size: 2.7rem;
  font-weight: 850;
  line-height: 1;
}

.hero-stat small {
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.account-panel {
  align-items: end;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  margin-bottom: 1.25rem;
  padding: 1rem;
}

.account-panel p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.account-panel p.error {
  color: var(--alert);
}

.auth-form {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.auth-actions {
  display: flex;
  gap: 0.5rem;
  grid-column: 1 / -1;
}

.auth-actions button {
  flex: 1;
}

.plant-form,
.plant-list,
.boneyard-section {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.plant-form {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.form-header p,
.list-header p {
  line-height: 1.45;
  margin-bottom: 0;
}

label {
  color: var(--ink);
  display: grid;
  font-size: 0.9rem;
  font-weight: 780;
  gap: 0.45rem;
}

input {
  background: #fbfdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  padding: 0.75rem;
  width: 100%;
}

.photo-picker {
  align-items: center;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(47, 107, 69, 0.12), rgba(217, 233, 200, 0.55)),
    #eef6e7;
  border: 1px dashed #9cb68f;
  border-radius: 8px;
  color: var(--leaf-dark);
  cursor: pointer;
  display: grid;
  font-size: 1rem;
  font-weight: 850;
  justify-items: center;
  overflow: hidden;
  padding: 1rem;
  position: relative;
  text-align: center;
}

.photo-picker input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.photo-picker img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.photo-picker span {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  position: relative;
}

.schedule-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.input-with-unit {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
}

.input-with-unit input {
  padding-right: 4rem;
}

.input-with-unit span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  pointer-events: none;
  position: absolute;
  right: 0.75rem;
}

.plant-list {
  min-height: 540px;
  padding: 1rem;
}

.boneyard-section {
  margin-top: 1.25rem;
  padding: 1rem;
}

.list-header {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.secondary {
  background: #edf4e6;
  color: var(--leaf-dark);
}

.secondary:hover {
  background: #dcebd2;
}

.card-actions,
.boneyard-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.move-to-boneyard {
  background: #f5ebe6;
  color: var(--alert);
  min-height: 38px;
  padding: 0.55rem 0.75rem;
}

.move-to-boneyard:hover {
  background: #efd8ce;
}

.plants {
  display: grid;
  gap: 0.85rem;
}

.plant-card {
  background: #fbfdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 150px;
  overflow: hidden;
}

.plant-image {
  background: var(--leaf-soft);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.placeholder-image {
  background: #ffffff;
  object-fit: contain;
  padding: 1.5rem;
}

.plant-content {
  display: grid;
  gap: 1rem;
  padding: 1rem 1rem 1rem 0;
}

.plant-topline {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  font-size: 1.5rem;
  height: 38px;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  width: 38px;
}

.icon-button:hover {
  background: #f5ebe6;
  color: var(--alert);
}

.care-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.care-pill {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
}

.care-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.care-pill strong {
  font-size: 1rem;
}

.care-pill small {
  color: var(--muted);
  line-height: 1.35;
}

.care-pill button {
  margin-top: 0.4rem;
  min-height: 38px;
  padding: 0.55rem 0.75rem;
}

.due-now {
  color: var(--alert);
}

.boneyard-count {
  align-items: center;
  background: #f5ebe6;
  border: 1px solid #efd8ce;
  border-radius: 8px;
  color: var(--alert);
  display: grid;
  min-width: 132px;
  padding: 0.75rem;
  text-align: center;
}

.boneyard-count span {
  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
}

.boneyard-count small {
  color: #7d442b;
  font-weight: 750;
}

.boneyard-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.boneyard-card {
  background: #fffaf7;
  border: 1px solid #efd8ce;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 116px;
  overflow: hidden;
}

.boneyard-image {
  filter: grayscale(0.45) sepia(0.12);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.boneyard-image.placeholder-image {
  object-fit: contain;
  padding: 1.25rem;
}

.boneyard-content {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.boneyard-date {
  color: #7d442b;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.25rem 0 0;
}

.empty-state {
  align-items: center;
  border: 1px dashed #b9c8af;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  min-height: 340px;
  padding: 2rem;
  text-align: center;
}

@media (max-width: 860px) {
  .app {
    padding: 1rem;
  }

  .hero,
  .workspace,
  .account-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: start;
  }

  .hero-stat {
    justify-self: start;
  }

  .plant-form {
    position: static;
  }
}

@media (max-width: 620px) {
  .brand {
    margin-bottom: 0.85rem;
  }

  .brand-logo {
    max-height: 94px;
  }

  .schedule-grid,
  .auth-form,
  .care-row,
  .plant-card {
    grid-template-columns: 1fr;
  }

  .auth-actions {
    flex-direction: column;
  }

  .plant-card {
    min-height: 0;
  }

  .plant-image {
    aspect-ratio: 16 / 10;
  }

  .plant-content {
    padding: 0 1rem 1rem;
  }

  .list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions,
  .boneyard-actions {
    justify-content: flex-start;
  }

  .boneyard-card {
    grid-template-columns: 1fr;
  }

  .boneyard-image {
    aspect-ratio: 16 / 9;
  }
}
