:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #233227;
  background: #f5f7f0;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  padding: 28px 16px;
}

.shell { width: min(100%, 920px); min-width: 0; }

.card {
  min-width: 0;
  padding: clamp(26px, 7vw, 44px);
  border: 1px solid #e1e7db;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 50px #263b2410;
}

#app:not(.tracker-page) { max-width: 460px; margin-inline: auto; }
#app.tracker-page { max-width: none; min-width: 0; }

.eyebrow {
  margin: 0 0 12px;
  color: #537b4b;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

h1 { margin: 0; font-size: clamp(1.8rem, 8vw, 2.45rem); letter-spacing: -0.045em; }
h2 { margin: 0 0 16px; font-size: 1.1rem; }
.intro { margin: 12px 0 26px; color: #647064; line-height: 1.55; }

form { display: grid; gap: 12px; }
label { margin-top: 6px; font-size: 0.9rem; font-weight: 650; }

input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd4c8;
  border-radius: 9px;
  color: inherit;
  background: #fff;
  font: inherit;
}

input:focus-visible, button:focus-visible {
  outline: 3px solid #88b378;
  outline-offset: 2px;
}

button {
  min-height: 46px;
  margin-top: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: 9px;
  background: #3e713e;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: #315d32; }
button:disabled { cursor: wait; opacity: 0.7; }
.secondary { background: #edf3e9; color: #315d32; }
.secondary:hover { background: #e2eddb; }
.text-button { padding: 8px 0; background: transparent; color: #537b4b; }
.text-button:hover { background: transparent; text-decoration: underline; }

.panel { margin-top: 24px; padding: 20px; border-radius: 12px; background: #f6f8f3; }
.tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid #e5eadf;
}
.tracker-header .eyebrow { margin-bottom: 8px; }
.week-note { margin: 8px 0 0; color: #647064; }
.tracker-header-tools { display: flex; align-items: center; gap: 12px; }
.language-switch { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #f1f4ee; }
.language-button {
  min-height: 34px;
  margin: 0;
  padding: 6px 9px;
  border-radius: 7px;
  background: transparent;
  color: #537b4b;
  font-size: 0.8rem;
}
.language-button:hover { background: #e5ecdf; }
.language-button[aria-pressed="true"] { background: #3e713e; color: #fff; }
.counter {
  display: grid;
  min-width: 154px;
  justify-items: center;
  padding: 12px 22px;
  border-radius: 16px;
  background: #edf3e9;
  color: #315d32;
  transition: background-color 160ms ease, color 160ms ease;
}
.counter-red { background: #fde8e7; color: #8d2925; }
.counter-orange { background: #fff0d6; color: #87500a; }
.counter-green { background: #e5f2e1; color: #285d2e; }
#week-count { font-size: 3.2rem; font-weight: 800; line-height: 1; }
.counter-label { margin-top: 6px; font-size: 0.9rem; font-weight: 700; }
.tracker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #647064;
}
.tracker-toolbar p { margin: 18px 0; }
.tracker-toolbar .text-button { flex: 0 0 auto; margin: 0; }
.plant-search { display: grid; gap: 7px; max-width: 620px; margin: 0 0 20px; }
.plant-search span, .year-selector span { color: #526252; font-size: 0.88rem; font-weight: 650; }
.plant-search input { margin: 0; }
.plant-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.no-results { color: #647064; }
.plant-group { padding: 20px; border: 1px solid #e1e7db; border-radius: 14px; background: #fbfcf9; }
.plant-group h2 { color: #315d32; }
.plant-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.plant-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 8px 2px;
  border-radius: 6px;
  color: #39483a;
  font-size: 0.95rem;
  font-weight: 450;
  cursor: pointer;
}
.plant-option:hover { background: #f0f4eb; }
.plant-option input {
  flex: 0 0 19px;
  width: 19px;
  min-height: 19px;
  height: 19px;
  margin: 0;
  accent-color: #3e713e;
}
.plant-option input:disabled { cursor: wait; }
.yearly-statistics { margin-top: 30px; padding: 22px; border: 1px solid #e1e7db; border-radius: 14px; background: #fff; }
.yearly-statistics-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.yearly-statistics-header .eyebrow { margin-bottom: 6px; }
.yearly-statistics-header h2 { margin: 0; }
.year-selector { display: grid; gap: 5px; margin: 0; }
.year-selector select { width: auto; min-width: 100px; min-height: 40px; padding: 7px 10px; }
.yearly-total { margin: 18px 0 22px; color: #647064; }
.yearly-total strong { margin-right: 5px; color: #315d32; font-size: 1.8rem; }
.yearly-statistics h3 { margin: 0 0 10px; color: #39483a; font-size: 0.95rem; }
.weekly-chart { display: flex; min-height: 116px; gap: 4px; overflow-x: auto; padding: 6px 2px 2px; }
.weekly-bar-item { display: flex; flex: 1 0 12px; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 12px; }
.weekly-bar-count { height: 14px; color: #647064; font-size: 0.65rem; line-height: 14px; }
.weekly-bar-track { display: block; width: 100%; height: 76px; border-radius: 4px 4px 0 0; background: #f1f4ee; }
.weekly-bar { fill: #5d9458; }
.weekly-bar-label { color: #647064; font-size: 0.6rem; }
.tracker-message { min-height: 1.4em; margin: 14px 0 0; color: #496744; }
.secret {
  overflow-wrap: anywhere;
  padding: 16px;
  border: 1px dashed #9eaf98;
  border-radius: 9px;
  background: #f6f8f3;
  color: #315d32;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-align: center;
}
.hint { color: #647064; font-size: 0.9rem; line-height: 1.5; }
#message { min-height: 1.4em; margin: 16px 0 0; color: #496744; }
#message.error { color: #a3312e; }
.tracker-message.error { color: #a3312e; }
footer { padding: 18px 0; color: #829080; text-align: center; font-size: 0.85rem; }

@media (max-width: 680px) {
  body { align-items: start; }
  .tracker-header { align-items: flex-start; }
  .counter { min-width: 110px; padding: 10px 14px; }
  #week-count { font-size: 2.6rem; }
  .plant-groups { grid-template-columns: 1fr; }
  .plant-group,
  .yearly-statistics { min-width: 0; }
}

@media (max-width: 440px) {
  body { padding: 12px 8px; }
  .card { padding: 18px; border-radius: 16px; }
  .tracker-header { flex-direction: column; }
  .tracker-header-tools { width: 100%; justify-content: space-between; }
  .week-note { overflow-wrap: anywhere; }
  .counter {
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
  }
  #week-count { font-size: 2.2rem; }
  .counter-label { margin: 0; }
  .language-button { min-width: 44px; min-height: 44px; }
  .tracker-toolbar { flex-direction: column; align-items: stretch; gap: 0; }
  .tracker-toolbar p { margin: 16px 0 0; }
  .tracker-toolbar .text-button { align-self: flex-end; min-height: 44px; }
  .plant-search { max-width: none; margin-bottom: 16px; }
  .plant-group { padding: 14px; }
  .plant-list { grid-template-columns: 1fr; }
  .plant-option { min-height: 44px; padding: 10px 4px; }
  .plant-option input { flex-basis: 22px; width: 22px; height: 22px; }
  .yearly-statistics { margin-top: 24px; padding: 16px; }
  .yearly-statistics-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .year-selector { display: flex; width: 100%; align-items: center; justify-content: space-between; }
  .year-selector select { min-width: 120px; min-height: 44px; }
  .weekly-chart { min-width: 0; min-height: 120px; overscroll-behavior-x: contain; }
  .weekly-bar-item { flex: 0 0 16px; min-width: 16px; }
  .weekly-bar-count { font-size: 0.7rem; }
  .weekly-bar-label { font-size: 0.68rem; }
}
