:root {
  --cream: #f8f1de;
  --paper: #fffdf6;
  --forest: #425a35;
  --deep: #193c2e;
  --gold: #e7c44b;
  --lime: #d9ff57;
  --earth: #4b3926;
  --ink: #171b20;
  --muted: #6f746b;
  --danger: #8d3f35;
  --line: rgba(25, 60, 46, 0.16);
  --shadow: 0 22px 60px rgba(25, 60, 46, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #e9e6da;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #e9e6da; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 5% 0%, rgba(231, 196, 75, 0.26), transparent 28rem),
    radial-gradient(circle at 98% 22%, rgba(66, 90, 53, 0.2), transparent 30rem),
    #e9e6da;
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(217, 255, 87, 0.62);
  outline-offset: 2px;
}
a { color: inherit; }

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  box-shadow: var(--shadow);
}
.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 36px);
  color: var(--cream);
  background: rgba(25, 60, 46, 0.97);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}
.brand img { width: 52px; height: 42px; object-fit: contain; border-radius: 8px; background: var(--cream); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: 0.02em; }
.brand small { margin-top: 1px; color: rgba(248, 241, 222, 0.66); font-size: 10px; text-transform: uppercase; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.offline-badge, .install-button {
  padding: 7px 10px;
  border: 1px solid rgba(248, 241, 222, 0.18);
  border-radius: 999px;
  color: rgba(248, 241, 222, 0.78);
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
  font-weight: 750;
}
.offline-badge[data-online="false"] { color: var(--deep); background: var(--gold); }
.install-button { cursor: pointer; color: var(--deep); border-color: var(--lime); background: var(--lime); }

main { min-height: calc(100vh - 76px); padding: clamp(18px, 4vw, 42px) clamp(16px, 4vw, 40px) 112px; }
.screen { width: min(920px, 100%); margin: 0 auto; animation: screen-in 180ms ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }
.eyebrow { margin: 0 0 7px; color: var(--forest); font-size: 11px; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { color: var(--deep); font-family: "Arial Narrow", "DIN Condensed", sans-serif; text-transform: uppercase; }
h1 { max-width: 780px; margin-bottom: 10px; font-size: clamp(38px, 7vw, 70px); line-height: 0.96; letter-spacing: -0.035em; }
h2 { margin-bottom: 8px; font-size: clamp(28px, 5vw, 44px); line-height: 1; }
.lead { max-width: 720px; color: var(--muted); font-size: 15px; line-height: 1.58; }
.screen-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 22px; }
.screen-head > div { min-width: 0; }
.screen-head .eyebrow { margin-bottom: 12px; line-height: 1.4; }
.screen-head h1 { margin-top: 0; overflow-wrap: anywhere; }
.screen-head .lead { margin-top: 14px; }
.screen-head p { margin-bottom: 0; }
.head-chip { flex: 0 0 auto; padding: 8px 11px; border-radius: 999px; color: var(--deep); background: var(--gold); font-size: 10px; font-weight: 850; text-transform: uppercase; }

.card, .hero-card, .garden-card, .course-card, .lesson-card, .notice, .stat {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 246, 0.91);
  box-shadow: 0 12px 34px rgba(75, 57, 38, 0.07);
}
.card { padding: clamp(18px, 3vw, 28px); }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 6px; color: var(--deep); font-size: 11px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
}
textarea { min-height: 110px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.4; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.primary, .secondary, .quiet, .danger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 850;
  text-decoration: none;
}
.primary { color: var(--deep); background: var(--lime); }
.secondary { color: var(--cream); background: var(--deep); }
.quiet { color: var(--deep); border-color: var(--line); background: var(--paper); }
.danger { color: var(--danger); border-color: rgba(141,63,53,0.24); background: #fff7f4; }
.primary:hover, .secondary:hover, .quiet:hover, .danger:hover { transform: translateY(-1px); }

.login-layout { display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(300px, 0.72fr); gap: 20px; align-items: stretch; }
.login-hero { position: relative; min-height: 560px; overflow: hidden; border-radius: 24px; color: var(--cream); background: var(--deep); }
.login-hero img { width: 100%; height: 100%; object-fit: cover; opacity: 0.58; }
.login-copy { position: absolute; inset: auto 0 0; padding: 28px; background: linear-gradient(transparent, rgba(10,28,20,0.96)); }
.login-copy h1 { color: var(--cream); }
.login-copy p { max-width: 560px; margin-bottom: 0; color: rgba(248,241,222,0.76); line-height: 1.55; }
.login-form { align-self: center; }
.local-warning { margin-top: 14px; padding: 11px 13px; border-left: 4px solid var(--gold); border-radius: 0 12px 12px 0; color: var(--earth); background: #f4e9be; font-size: 11px; line-height: 1.48; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.stat { padding: 14px; }
.stat strong, .stat span { display: block; }
.stat strong { color: var(--deep); font-size: 22px; }
.stat span { margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.garden-grid, .course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.garden-card, .course-card { overflow: hidden; }
.garden-card > div, .course-card > div { padding: 18px; }
.garden-card h3, .course-card h3 { margin-bottom: 6px; color: var(--deep); }
.garden-card p, .course-card p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.card-meta, .pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.card-meta span, .pill { padding: 6px 8px; border-radius: 999px; color: var(--deep); background: #edf0e5; font-size: 9px; font-weight: 780; }
.course-cover { height: 220px; background: var(--deep); }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }

.today-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(250px, 0.6fr); gap: 16px; padding: clamp(20px, 4vw, 34px); color: var(--cream); background: linear-gradient(135deg, var(--deep), #294936); }
.today-hero h1 { color: var(--cream); }
.today-hero .eyebrow { color: var(--gold); }
.today-hero .lead { color: rgba(248,241,222,0.74); }
.day-orb { display: grid; place-items: center; min-height: 210px; border: 1px solid rgba(248,241,222,0.16); border-radius: 50%; background: radial-gradient(circle, rgba(231,196,75,0.25), rgba(255,255,255,0.03) 60%); text-align: center; }
.day-orb strong, .day-orb span { display: block; }
.day-orb strong { color: var(--lime); font-size: 56px; line-height: 1; }
.day-orb span { margin-top: 5px; color: rgba(248,241,222,0.72); font-size: 11px; text-transform: uppercase; }
.parameter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.parameter { min-width: 0; padding: 14px; border-radius: 15px; color: var(--deep); background: #edf0e5; }
.parameter.gold { background: #f5ecc9; }
.parameter strong, .parameter span { display: block; }
.parameter strong { font-size: 15px; line-height: 1.25; }
.parameter span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; text-transform: uppercase; }
.truth-note { margin-top: 14px; padding: 13px 15px; border-left: 4px solid var(--gold); border-radius: 0 14px 14px 0; color: var(--earth); background: #f5ecc9; font-size: 12px; line-height: 1.5; }

.intro-card { display: grid; grid-template-columns: minmax(280px, 0.84fr) minmax(0, 1.16fr); overflow: hidden; }
.intro-image { min-height: 620px; background: var(--deep); }
.intro-image img { width: 100%; height: 100%; object-fit: cover; }
.intro-copy { padding: clamp(22px, 4vw, 44px); }
.intro-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 20px 0; }
.intro-point { padding: 13px; border-radius: 14px; background: #edf0e5; }
.intro-point strong, .intro-point span { display: block; }
.intro-point strong { color: var(--deep); font-size: 12px; }
.intro-point span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.phase-list { display: grid; gap: 10px; }
.phase-button { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 74px; padding: 12px; cursor: pointer; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--paper); text-align: left; }
.phase-button .phase-number { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: var(--deep); background: var(--gold); font-weight: 900; }
.phase-button strong, .phase-button small { display: block; }
.phase-button strong { color: var(--deep); }
.phase-button small { margin-top: 3px; color: var(--muted); }
.phase-button > span:last-child { color: var(--forest); font-size: 10px; font-weight: 800; }

.lesson-card { overflow: hidden; }
.lesson-image { height: 300px; background: var(--deep); }
.lesson-image img { width: 100%; height: 100%; object-fit: cover; }
.lesson-body { padding: clamp(18px, 3vw, 28px); }
.nutrition-box { margin-top: 14px; padding: 15px; border: 1px solid rgba(66,90,53,0.2); border-radius: 15px; background: #f7f3e7; }
.nutrition-box > span, .nutrition-box strong, .nutrition-box small { display: block; }
.nutrition-box > span { color: var(--forest); font-size: 9px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.nutrition-box strong { margin-top: 4px; color: var(--deep); }
.nutrition-box small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.checklist { display: grid; gap: 8px; margin: 16px 0 0; }
.lesson-note { margin-top: 14px; }
.check-item { display: flex; gap: 9px; align-items: start; padding: 11px; border-radius: 12px; background: #edf0e5; color: #353a34; font-size: 12px; line-height: 1.45; }
.check-item input { width: 18px; min-height: 18px; margin-top: 1px; accent-color: var(--forest); }
.xp-line { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 14px; color: var(--cream); background: var(--deep); }
.xp-line strong { color: var(--lime); }

.timeline { display: grid; gap: 10px; }
.diary-form { margin-bottom: 20px; }
.legacy-records { margin-top: 24px; color: var(--muted); font-size: 12px; }
.legacy-records summary { cursor: pointer; margin-bottom: 12px; }
.timeline p, .stat strong { overflow-wrap: anywhere; }
.timeline p { white-space: pre-wrap; }
.timeline article { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.timeline time { color: var(--forest); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.timeline p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.empty { padding: 26px; border: 1px dashed rgba(25,60,46,0.3); border-radius: 18px; color: var(--muted); text-align: center; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(640px, calc(100% - 20px));
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid rgba(248,241,222,0.16);
  border-radius: 18px;
  background: rgba(25,60,46,0.97);
  box-shadow: 0 16px 48px rgba(9,28,19,0.28);
  backdrop-filter: blur(16px);
}
.bottom-nav button { display: grid; gap: 2px; place-items: center; min-height: 60px; cursor: pointer; border: 0; color: rgba(248,241,222,0.62); background: transparent; font-size: 9px; }
.bottom-nav button span { font-size: 15px; }
.bottom-nav button[aria-current="page"] { color: var(--lime); background: rgba(255,255,255,0.06); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 92px; width: min(420px, calc(100% - 28px)); padding: 13px 15px; transform: translateX(-50%); border-radius: 13px; color: var(--cream); background: var(--deep); box-shadow: var(--shadow); font-size: 12px; text-align: center; }

@media (max-width: 760px) {
  .app-header { min-height: 66px; }
  .brand img { width: 42px; height: 34px; }
  .offline-badge { display: none; }
  .login-layout, .intro-card, .today-hero { grid-template-columns: 1fr; }
  .login-hero { min-height: 380px; }
  .intro-image { min-height: 360px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parameter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .garden-grid, .course-grid { grid-template-columns: 1fr; }
  .screen-head { align-items: start; flex-direction: column; }
}

@media (max-width: 480px) {
  main { padding-inline: 13px; }
  .form-grid.two, .intro-points { grid-template-columns: 1fr; }
  .login-hero { min-height: 330px; }
  .login-copy { padding: 20px; }
  .parameter-grid { grid-template-columns: 1fr 1fr; }
  .phase-button { grid-template-columns: 42px minmax(0,1fr); }
  .phase-button > span:last-child { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
