/* Standard Telegram-style presentation. Theme values come from the Mini App SDK. */
:root {
  color-scheme: light;
  --fallback-bg: #efeff4;
  --fallback-surface: #ffffff;
  --fallback-text: #000000;
  --fallback-muted: #707579;
  --fallback-line: #d9d9dc;
  --fallback-accent: #007aff;
  --bg: var(--tg-theme-secondary-bg-color, var(--fallback-bg));
  --surface: var(
    --tg-theme-section-bg-color,
    var(--tg-theme-bg-color, var(--fallback-surface))
  );
  --text: var(--tg-theme-text-color, var(--fallback-text));
  --muted: var(
    --tg-theme-subtitle-text-color,
    var(--tg-theme-hint-color, var(--fallback-muted))
  );
  --line: var(--tg-theme-section-separator-color, var(--fallback-line));
  --accent: var(--tg-theme-button-color, var(--fallback-accent));
  --link: var(--tg-theme-link-color, var(--fallback-accent));
  --on-accent: var(--tg-theme-button-text-color, #ffffff);
  --soft: var(--bg);
  --warm: var(--surface);
  --destructive: var(--tg-theme-destructive-text-color, #d70015);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fallback-bg: #0f0f0f;
  --fallback-surface: #1c1c1e;
  --fallback-text: #ffffff;
  --fallback-muted: #98989e;
  --fallback-line: #38383a;
  --fallback-accent: #3e88f7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fallback-bg: #0f0f0f;
    --fallback-surface: #1c1c1e;
    --fallback-text: #ffffff;
    --fallback-muted: #98989e;
    --fallback-line: #38383a;
    --fallback-accent: #3e88f7;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}
a {
  color: var(--link);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
summary {
  cursor: pointer;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}
.app {
  max-width: 720px;
  margin: auto;
  padding: max(
      env(safe-area-inset-top),
      var(--tg-content-safe-area-inset-top, 0px)
    )
    16px 110px;
}
.topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
}
.brand {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.connection {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 8px;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 12px;
}
h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}
p {
  margin: 0 0 12px;
}
.intro {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 16px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 10px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.button.secondary {
  background: var(--surface);
  color: var(--link);
}
.button:active,
.chip:active,
.plant-card:active {
  opacity: 0.75;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.actions h2 {
  margin: 0 auto 0 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 24px 0;
}
.metric {
  background: var(--surface);
  padding: 16px 8px;
  text-align: center;
}
.metric b {
  display: block;
  font-size: 24px;
  font-weight: 600;
}
.metric span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.note {
  font-size: 14px;
  color: var(--muted);
  margin: 16px 0;
}
.empty,
.care-overview {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
}
.empty p {
  color: var(--muted);
  font-size: 15px;
}
.empty svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.navigation {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 720px);
  z-index: 4;
  background: var(--tg-theme-bottom-bar-bg-color, var(--surface));
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px 4px
    calc(
      6px +
        max(
          env(safe-area-inset-bottom),
          var(--tg-content-safe-area-inset-bottom, 0px)
        )
    );
}
.navigation a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  min-height: 52px;
  padding: 4px 0;
  text-decoration: none;
  font-size: 10px;
  color: var(--muted);
}
.navigation a[aria-current="page"] {
  color: var(--link);
  font-weight: 600;
}
.navigation svg {
  height: 24px;
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.plant-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.plant-card {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 80px;
  text-decoration: none;
}
.plant-card .monogram {
  font-size: 17px;
  font-weight: 600;
  background: var(--bg);
  color: var(--link);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.plant-card .plant-avatar,
.plant-card .monogram.plant-avatar {
  width: 44px;
  height: 44px;
  object-fit: cover;
  flex-shrink: 0;
}
.plant-card > span:nth-child(2) {
  min-width: 0;
}
.plant-card strong {
  display: block;
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.plant-card small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.plant-card .arrow {
  margin-left: auto;
  color: var(--muted);
}
.next-task {
  color: var(--link) !important;
}
.room-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 8px 0 4px;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.room-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
}
.chip.is-active {
  background: var(--accent);
  color: var(--on-accent);
}
.room-tools { min-height: 0; }
.catalog-row {
  background: var(--surface);
  border-radius: 12px;
  padding-bottom: 12px;
}
.catalog-row .button {
  margin-left: 16px;
  padding: 8px 12px;
  min-height: 44px;
  background: var(--bg);
}
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
  color: var(--link);
  text-decoration: none;
  font-size: 15px;
}
.latin {
  font-size: 15px;
  color: var(--muted);
}
.tag {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.fact {
  padding: 16px;
  margin: 8px 0;
  background: var(--surface);
  border-radius: 12px;
}
.fact h2 {
  font-size: 17px;
  margin-bottom: 8px;
}
.fact p {
  font-size: 15px;
  margin-bottom: 8px;
}
.fact small {
  font-size: 12px;
  color: var(--muted);
}
details {
  font-size: 14px;
  color: var(--muted);
}
summary {
  min-height: 44px;
  padding: 12px 0;
}
.source {
  display: block;
  padding: 12px 0;
  font-size: 14px;
}
.setting {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.setting p {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 0;
  white-space: pre-wrap;
}
.skip {
  position: absolute;
  top: -80px;
}
.skip:focus {
  top: 4px;
  z-index: 10;
  background: var(--surface);
  padding: 12px;
}
#content:focus {
  outline: none;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin: 20px 0;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
}
.field textarea {
  resize: vertical;
  line-height: 1.45;
}
.field input[type="file"] {
  font-size: 13px;
  overflow: hidden;
}
.field input::file-selector-button {
  font: inherit;
  border: 0;
  border-radius: 6px;
  padding: 7px;
  margin-right: 8px;
  color: var(--link);
  background: var(--bg);
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  text-decoration: none;
  background: var(--surface);
  color: var(--link);
}
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--link);
  text-decoration: none;
}
.text-button {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--destructive);
  font-size: 14px;
}
.form-section {
  margin: 20px 0;
  padding: 4px 16px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}
.form-section summary {
  font-size: 16px;
  font-weight: 500;
}
.form-section .setting {
  padding-left: 0;
  padding-right: 0;
}
.form-section .setting:last-child {
  border-bottom: 0;
}
.inline-status {
  font-size: 14px;
  color: var(--muted);
  margin: 16px 0;
}
.form-status {
  font-size: 14px;
  color: var(--destructive);
  white-space: pre-wrap;
}
.form-status:not(:empty) {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--destructive);
  border-radius: 10px;
}
.editor {
  padding-bottom: 16px;
}
.editor > h2 {
  margin-top: 28px;
}
.editor input,
.editor select,
.editor textarea {
  scroll-margin-block: 90px;
}
.photo-section {
  margin: 20px 0;
}
.specimen-photo {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface);
}
.timeline {
  margin: 20px 0;
}
.event {
  padding: 16px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--surface);
}
.event time {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.event p {
  font-size: 14px;
  margin-bottom: 6px;
  white-space: pre-wrap;
}
.toast {
  position: fixed;
  z-index: 20;
  bottom: calc(
    82px +
      max(
        env(safe-area-inset-bottom),
        var(--tg-content-safe-area-inset-bottom, 0px)
      )
  );
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  padding: 12px 16px;
  background: var(--text);
  color: var(--surface);
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 2px 12px #0002;
  pointer-events: none;
}
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: default;
}
.attention-label {
  font-weight: 600;
  color: var(--link);
}
.care-task {
  padding: 16px;
  margin: 12px 0;
  background: var(--surface);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.care-task h3 {
  margin: 8px 0;
  font-size: 18px;
}
.care-task p {
  font-size: 15px;
}
.care-task .eyebrow,
.care-task .task-date {
  font-size: 12px;
  color: var(--muted);
}
.care-task .actions {
  margin-bottom: 0;
}
.care-task .button.secondary {
  background: var(--bg);
}
.task-plant {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-plant .text-link {
  min-height: 32px;
  font-weight: 600;
}
.task-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
  background: var(--bg);
  color: var(--link);
  font-size: 13px;
  font-weight: 600;
}
.wet-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.wet-choices .button { min-height: 40px; }
.care-grid {
  margin-top: 20px;
}
.specimen-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
}
.care-settings { margin: 4px 0; }
.reminder-prompt, .attention-actions {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
.reminder-prompt .note { margin: 8px 0 12px; }
.reminder-prompt .inline-status:empty { display: none; }
.specimen-tab {
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
}
.specimen-tab.is-active {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}
.condition-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.condition-tile {
  min-width: 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
}
.condition-icon {
  display: block;
  font-size: 20px;
  line-height: 1;
}
.condition-tile h2 {
  margin: 8px 0 4px;
  font-size: 14px;
}
.condition-tile p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 14px;
}
[hidden] {
  display: none !important;
}
.guide-section {
  margin: 12px 0;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.guide-section > summary {
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}
.guide .fact h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.guide li { margin-bottom: 8px; }
.guide small { display: block; color: var(--muted); }
.calculator { margin-top: 20px; }
.calculator-result:not(:empty) { margin: 16px 0; }
.calculator .button { white-space: normal; }
.care-brief { margin: 24px 0; }
.nutrient-range { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; min-width: 0; }
.nutrient-range .field { margin: 0; min-width: 0; }
.nutrient-range input { min-width: 0; }
.recipe-dose { font-weight: 600; }
.care-brief p { font-size: 15px; }
.care-task .form-section { margin: 4px 0 0; padding: 0; }
.care-task .inline-status:empty { display: none; }
.toast-action {
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  font: inherit;
  font-weight: 600;
  padding: 10px;
  pointer-events: auto;
}
@media (max-width: 380px) {
  .app {
    padding-left: 12px;
    padding-right: 12px;
  }
  .navigation a {
    font-size: 9px;
  }
  .button {
    padding-left: 12px;
    padding-right: 12px;
  }
}
