:root {
  --ink: #16161a;
  --muted: #64646f;
  --soft: #f5f4f8;
  --line: #dedbe6;
  --purple: #4d288f;
  --purple-soft: #eee8fa;
  --green: #2f6f5e;
  --green-soft: #e9f3ef;
  --gold: #b68a2b;
  --danger: #a94747;
  --white: #ffffff;
  --shadow: 0 18px 42px rgba(37, 31, 54, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fbfafc;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--white);
  background: var(--purple);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.main-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav-button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.nav-button.active {
  color: var(--white);
  background: var(--green);
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.plants-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.search-panel,
.detail-panel,
.tool-card,
.lamp-grid article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 116px);
  overflow: hidden;
  padding: 18px;
}

.field-label,
.form-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input,
.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-box input:focus,
.form-grid input:focus,
.form-grid select:focus {
  outline: 2px solid rgba(77, 40, 143, 0.18);
  border-color: var(--purple);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}

.chip {
  min-height: 34px;
  padding: 0 12px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(47, 111, 94, 0.22);
  border-radius: 999px;
  font-weight: 700;
}

.chip.active {
  color: var(--white);
  background: var(--green);
}

.result-meta {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.plant-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 292px);
  overflow: auto;
  padding-right: 4px;
}

.plant-item {
  width: 100%;
  padding: 13px;
  text-align: left;
  background: #fbfbfd;
  border: 1px solid transparent;
  border-radius: 8px;
}

.plant-item:hover,
.plant-item.active {
  border-color: var(--purple);
  background: var(--purple-soft);
}

.plant-title {
  display: block;
  color: var(--ink);
  font-weight: 800;
}

.plant-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.detail-panel {
  min-height: 660px;
  padding: 0;
  overflow: hidden;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(90deg, #fff, #f7f1ff);
  border-bottom: 1px solid var(--line);
}

.detail-hero h1,
.section-head h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

.detail-hero p,
.section-head p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  padding: 7px 10px;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.feature-panel {
  align-self: stretch;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feature-panel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
}

.detail-body {
  padding: 22px 24px 26px;
}

.scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.scenario-button {
  min-height: 38px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.scenario-button.active {
  color: var(--white);
  background: var(--purple);
  border-color: var(--purple);
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rec-card {
  padding: 16px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rec-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.metric {
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
}

.rec-note {
  margin: 0;
  color: #3d3d46;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  padding: 20px;
}

.tool-card h2,
.lamp-grid h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label:nth-child(3):last-child,
.form-grid label:nth-child(1):last-child,
.form-grid label:nth-child(2):last-child {
  grid-column: 1 / -1;
}

.range-value {
  margin: 10px 0;
  color: var(--purple);
  font-weight: 800;
}

.result-box {
  margin-top: 14px;
  padding: 14px;
  background: var(--green-soft);
  border: 1px solid rgba(47, 111, 94, 0.22);
  border-radius: 8px;
}

.result-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 20px;
}

.result-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.lamps-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.lamp-photo {
  position: sticky;
  top: 94px;
  min-height: 560px;
  background-image: linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)), url("./assets/lamp-houseflow.jpg");
  background-position: center;
  background-size: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lamp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lamp-grid article {
  padding: 18px;
}

.lamp-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lamp-specs div {
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
}

.lamp-specs span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.lamp-specs strong {
  display: block;
  margin-top: 4px;
}

.lamp-note {
  margin: 12px 0 0;
  color: var(--muted);
}

.empty-state {
  padding: 26px;
  color: var(--muted);
  text-align: center;
  background: var(--soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 26px 22px 36px;
  color: var(--muted);
}

.footer a {
  color: var(--purple);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1120px) {
  .plants-layout,
  .lamps-layout {
    grid-template-columns: 1fr;
  }

  .search-panel,
  .lamp-photo {
    position: static;
    max-height: none;
  }

  .plant-list {
    max-height: 360px;
  }

  .calculator-grid,
  .recommendation-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .lamp-photo {
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    display: grid;
    padding: 14px;
  }

  .brand {
    min-width: 0;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
  }

  .nav-button {
    flex: 1 0 auto;
  }

  main {
    padding: 12px;
  }

  .detail-hero,
  .detail-body,
  .tool-card {
    padding: 16px;
  }

  .detail-hero h1,
  .section-head h1 {
    font-size: 28px;
  }

  .form-grid,
  .metric-grid,
  .lamp-grid,
  .lamp-specs {
    grid-template-columns: 1fr;
  }

  .search-panel {
    padding: 14px;
  }
}
