:root {
  --bg: #f6fbf8;
  --paper: #ffffff;
  --ink: #17362c;
  --muted: #60786f;
  --line: #dbe8e1;
  --soft: #e9f4ee;
  --accent: #0d786b;
  --accent-dark: #095d53;
  --coral: #db694c;
  --gold: #d99a31;
  --shadow: 0 18px 45px rgba(23, 54, 44, 0.1);
  --radius: 8px;
  --max: 1280px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(13, 120, 107, 0.08), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 44%, #ffffff 100%);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 14px 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.topnav a {
  text-decoration: none;
}

.topnav a:hover {
  color: var(--accent-dark);
}

.header-controls {
  display: flex;
  align-items: end;
  gap: 10px;
}

.select-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

select:focus,
input:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 120, 107, 0.14);
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 14px;
  font-size: 0.9rem;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  background: var(--soft);
  color: var(--accent-dark);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.7fr);
  gap: 18px;
}

.month-panel,
.calendar-panel,
.weather-panel,
.staples-section,
.service-grid,
.chat-panel,
.source-panel,
.image-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.month-panel,
.calendar-panel,
.weather-panel,
.staples-section,
.service-grid,
.chat-panel,
.source-panel {
  padding: 22px;
}

.section-heading,
.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.overline {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(2.1rem, 4vw, 4.15rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.month-note,
.section-copy,
.service-intro p,
.chat-info p,
.source-panel p,
.image-panel-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.month-note {
  max-width: 270px;
  margin: 0;
  font-size: 0.94rem;
}

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

.guide-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
}

.guide-card[data-tone="plant"] {
  border-top: 4px solid var(--accent);
}

.guide-card[data-tone="start"] {
  border-top: 4px solid var(--gold);
}

.guide-card[data-tone="harvest"] {
  border-top: 4px solid var(--coral);
}

.guide-card[data-tone="watch"] {
  border-top: 4px solid #6c8a75;
}

.guide-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.guide-card h3,
.guide-card ul {
  margin-right: 16px;
  margin-left: 16px;
}

.guide-card h3 {
  margin-top: 14px;
}

.guide-card ul,
.source-panel ul {
  margin: 0;
  padding-left: 18px;
}

.guide-card li {
  margin: 0 0 9px;
  color: var(--muted);
  line-height: 1.35;
}

.guide-card li:last-child {
  margin-bottom: 16px;
}

.image-panel {
  position: relative;
  min-height: 100%;
  overflow: hidden;
}

.image-panel img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.image-panel-copy {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
  backdrop-filter: blur(8px);
}

.image-panel-copy h2 {
  font-size: 1.4rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
  gap: 18px;
  margin-top: 18px;
}

.task-list {
  display: grid;
  gap: 12px;
}

.week-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.week-label {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.task-items {
  display: grid;
  gap: 9px;
}

.task-item {
  display: flex;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.task-item input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.task-item span {
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.task-item input:checked + span {
  color: #93a59d;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(13, 120, 107, 0.35);
}

.weather-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.weather-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.guardrails {
  display: grid;
  gap: 8px;
}

.guardrails span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 10px;
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 800;
}

.staples-section,
.service-grid,
.chat-panel,
.source-panel {
  margin-top: 18px;
}

.staples-grid,
.service-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.staple-card,
.service-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 14px;
}

.staple-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.staple-card p,
.service-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.service-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1fr);
  gap: 18px;
}

.service-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card button {
  margin-top: 14px;
}

.chat-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
}

.prompt-buttons {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.prompt-buttons button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--accent-dark);
  padding: 11px 12px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 800;
}

.prompt-buttons button:hover {
  border-color: rgba(13, 120, 107, 0.45);
  background: var(--soft);
}

.chat-window {
  display: grid;
  min-height: 420px;
  grid-template-rows: 1fr auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fbfefc;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding: 16px;
}

.message {
  width: fit-content;
  max-width: min(620px, 92%);
  border-radius: var(--radius);
  padding: 12px 14px;
  line-height: 1.45;
}

.message.user {
  align-self: end;
  background: var(--accent);
  color: #ffffff;
}

.message.assistant {
  align-self: start;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.message small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: var(--paper);
}

.source-panel {
  box-shadow: none;
}

.source-panel li {
  margin: 8px 0;
}

.source-panel a {
  color: var(--accent-dark);
  font-weight: 800;
}

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

@media (max-width: 1080px) {
  .topbar,
  .hero-grid,
  .content-grid,
  .service-grid,
  .chat-panel {
    grid-template-columns: 1fr;
  }

  .topnav {
    justify-content: start;
  }

  .header-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .guide-grid,
  .staples-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    gap: 14px;
    padding-bottom: 18px;
  }

  .brand {
    align-items: start;
  }

  .topnav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-controls,
  .header-controls > *,
  .header-controls button,
  .chat-form {
    width: 100%;
  }

  .section-heading,
  .panel-header {
    flex-direction: column;
  }

  .month-panel,
  .calendar-panel,
  .weather-panel,
  .staples-section,
  .service-grid,
  .chat-panel,
  .source-panel {
    padding: 16px;
  }

  .guide-grid,
  .staples-grid,
  .service-cards,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .week-row {
    grid-template-columns: 1fr;
  }

  .image-panel img {
    min-height: 300px;
  }
}
