/* ============================================================
   Plant Care — cozy-дизайн-система
   ============================================================ */
:root {
  --bg:            #F8F6F0;
  --card:          #FFFFFF;
  --accent:        #A9BFA5;
  --accent-soft:   rgba(169, 191, 165, 0.28);
  --green:         #4A6454;
  --green-dark:    #3F574A;
  --blue:          #CFE0E3;   /* полив */
  --sand:          #F0DFC8;   /* удобрение */
  --lilac:         #DDD6E8;   /* душ */
  --pink:          #EBD3CB;
  --text:          #2F3A33;
  --text-muted:    rgba(47, 58, 51, 0.66);
  --border:        rgba(74, 100, 84, 0.12);
  --danger:        #B4573F;
  --danger-soft:   #F6E3DC;

  --font-heading:  Georgia, 'Times New Roman', 'Lora', serif;
  --font-text:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Manrope', sans-serif;

  --radius:    20px;
  --radius-md: 16px;
  --radius-sm: 14px;

  --shadow:    0 10px 30px rgba(74, 100, 84, 0.08);
  --shadow-lg: 0 20px 50px rgba(74, 100, 84, 0.14);

  --nav-h: 66px;
  --maxw: 560px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--text);
}
.icon { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Приложение: контейнер ---------- */
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; position: relative; }
.view { display: block; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); }
.view[hidden] { display: none !important; }

.content { padding: 12px 16px 24px; }

/* ---------- Верхняя панель ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  padding-top: calc(16px + env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.6rem; }
.topbar__sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.topbar--sub h1 { font-size: 1.3rem; flex: 1; text-align: center; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }

/* Выпадающая кнопка сортировки */
.sort-dropdown { position: relative; margin-bottom: 16px; }
.sort-dropdown[hidden] { display: none; }
.sort-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow);
  transition: border-color .15s ease;
}
.sort-toggle:hover { border-color: var(--accent); }
.sort-toggle .icon { width: 16px; height: 16px; color: var(--text-muted); transition: transform .2s ease; }
.sort-dropdown.open .sort-toggle .icon { transform: rotate(180deg); }

.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 190px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex; flex-direction: column;
}
.sort-menu[hidden] { display: none; }
.sort-option {
  position: relative;
  display: flex; align-items: center;
  padding: 11px 14px 11px 34px;
  border-radius: 10px;
  text-align: left;
  font-size: 14.5px; font-weight: 600;
  color: var(--text);
  transition: background .15s ease;
}
.sort-option:hover { background: var(--accent-soft); }
.sort-option::before {
  content: "✓";
  position: absolute; left: 13px;
  color: var(--green); font-weight: 700;
  opacity: 0;
}
.sort-option.active { color: var(--green); }
.sort-option.active::before { opacity: 1; }

/* мобильная адаптация: крупнее тач-зона пунктов */
@media (max-width: 899px) {
  .sort-menu { min-width: 200px; }
  .sort-option { padding-top: 13px; padding-bottom: 13px; }
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--green);
  box-shadow: var(--shadow);
  transition: transform .15s ease, background .15s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn--add { background: var(--green); color: #fff; border-color: transparent; }
.icon-btn--confirm { background: var(--accent); color: var(--green); border-color: transparent; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--green); color: #fff; box-shadow: 0 10px 24px rgba(74, 100, 84, 0.28); }
.btn--primary:hover { background: var(--green-dark); }
.btn--ghost { background: transparent; color: var(--green); border-color: var(--border); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--danger { background: transparent; color: var(--danger); border-color: rgba(180, 87, 63, 0.3); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--block { width: 100%; }
.btn--sm { padding: 10px 16px; font-size: 13.5px; border-radius: 12px; }
.btn--lg { padding: 16px 24px; font-size: 16px; }

/* ---------- Навигация ---------- */
#bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  margin: 0 auto;
  max-width: var(--maxw);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(74, 100, 84, 0.06);
}
#bottom-nav[hidden] { display: none; }
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: color .15s ease;
}
.nav-item .icon { width: 24px; height: 24px; }
.nav-item.active { color: var(--green); }
.nav-item.active .icon { transform: translateY(-1px); }
.nav-brand { display: none; }

/* ---------- Карточки ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 14px; }

/* ---------- Чипы ---------- */
.chip {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.chip--sage  { background: var(--accent-soft); }
.chip--blue  { background: rgba(207, 224, 227, 0.8); }
.chip--sand  { background: rgba(240, 223, 200, 0.9); }
.chip--lilac { background: rgba(221, 214, 232, 0.85); }
.chip--pink  { background: rgba(235, 211, 203, 0.85); }
.chip--sm { width: 34px; height: 34px; border-radius: 11px; font-size: 16px; }

/* ============================================================
   ЭКРАН АВТОРИЗАЦИИ
   ============================================================ */
.view--auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}
.auth-shell { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo {
  width: 68px; height: 68px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.auth-logo .icon { width: 34px; height: 34px; }
.auth-brand h1 { font-size: 1.9rem; }
.auth-brand p { color: var(--text-muted); font-size: 14px; margin-top: 6px; }

.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 24px 20px; }
.auth-panel h2 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-hint { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; justify-content: center; }
.auth-links .link { color: var(--green); font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-error { min-height: 20px; margin: 10px 0; font-size: 13.5px; color: var(--danger); }
.auth-note { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 18px; }

/* Галочки согласий на регистрации */
.consents { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 6px; }
.consent {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; color: var(--text); cursor: pointer; line-height: 1.45;
}
.consent input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0;
  accent-color: var(--green);
}
.consent a { color: var(--green); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent); }

/* ============================================================
   Поля форм
   ============================================================ */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; }
.field__control {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field__control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field__control .icon { width: 18px; height: 18px; color: var(--text-muted); }
.field__control input { flex: 1; border: none; outline: none; padding: 13px 0; background: transparent; }
.field > input[type="text"], .field > input[type="email"], .field > input[type="password"],
.field > input[type="date"], .field > input[type="number"], .field > select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field > input:focus, .field > textarea:focus, .field > select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field > textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  background: #fff;
  resize: none;
  overflow: hidden;
  min-height: 56px;
  outline: none;
}
.field > select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234A6454' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field--inline { flex: 1; }
.field--inline > span { font-size: 12px; }

/* ---------- Кнопка очистки поля (крестик) ---------- */
.field { position: relative; }
.field-clear {
  display: none;
  align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%;
  background: rgba(74, 100, 84, 0.12);
  color: var(--text-muted);
  transition: background .15s ease, color .15s ease;
}
.field-clear.show { display: inline-flex; }
.field-clear:hover { background: rgba(74, 100, 84, 0.25); color: var(--text); }
.field-clear .icon { width: 13px; height: 13px; }
/* крестик внутри обёртки с иконкой — справа, как flex-элемент */
.field__control .field-clear { margin-right: -6px; }
/* крестик у прямых полей (input/textarea/select без обёртки) */
.field > .field-clear { position: absolute; top: 38px; right: 12px; z-index: 2; }
.field > textarea ~ .field-clear { top: 34px; }
.field > select ~ .field-clear { right: 38px; }
/* резерв места под крестик справа */
.field > input[type="text"], .field > input[type="date"], .field > input[type="number"],
.field > textarea, .field > select { padding-right: 40px; }

/* ---------- Выбор фото ---------- */
.photo-picker { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.photo-picker__preview {
  width: 92px; height: 92px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border);
  background: var(--accent-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--green); font-size: 11px; font-weight: 600;
  overflow: hidden;
  background-size: cover; background-position: center;
}
.photo-picker__preview .icon { width: 24px; height: 24px; }
.photo-picker__preview.has-photo { border-style: solid; }
.photo-picker__preview.has-photo .icon, .photo-picker__preview.has-photo span { display: none; }

/* ---------- Секции формы ---------- */
.form-section { margin-top: 8px; }
.form-section__title { font-size: 1.15rem; margin-bottom: 4px; }
.form-section__hint { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

.care-form { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 12px; background: #fff; }
.care-form__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.care-form__name { font-weight: 700; font-size: 15px; }
.care-form__grid { display: flex; gap: 12px; }
.care-form__grid .field { margin-bottom: 0; }

/* ============================================================
   ЭКРАН «СЕГОДНЯ»
   ============================================================ */
.summary-card {
  background: linear-gradient(135deg, var(--green), #587561);
  color: #f4f6f2;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}
.summary-card__label { font-size: 13px; opacity: .8; }
.summary-card__title { font-family: var(--font-heading); font-size: 1.5rem; margin-top: 4px; color: #fff; }
.summary-card__hint { font-size: 13px; opacity: .8; margin-top: 6px; }

.group-card { padding: 0; overflow: hidden; }
.group-card__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.group-card__title { flex: 1; }
.group-card__title h2 { font-size: 1.1rem; }
.group-card__title .counter { font-size: 13px; color: var(--text-muted); }

.mark-all-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--green);
  font-weight: 700; font-size: 13px;
  border-radius: 999px; padding: 8px 14px;
  transition: background .15s ease;
}
.mark-all-btn:active { background: var(--accent); }

.task-list { list-style: none; border-top: 1px solid var(--border); }
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: none; }
.task-row__thumb {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background-size: cover; background-position: center;
}
.task-row__thumb .icon { width: 22px; height: 22px; }
.task-row__info { flex: 1; min-width: 0; }
.task-row__name { font-weight: 700; font-size: 15px; }
.task-row__meta { font-size: 12.5px; color: var(--text-muted); }
.task-row__meta .overdue { color: var(--danger); font-weight: 600; }

.done-btn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border); color: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.done-btn .icon { width: 20px; height: 20px; }
.done-btn:active { transform: scale(.9); }
.done-btn:hover { border-color: var(--accent); }

/* ---------- Пустые состояния ---------- */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty__icon { font-size: 46px; margin-bottom: 12px; }
.empty__title { font-family: var(--font-heading); font-size: 1.2rem; color: var(--text); margin-bottom: 6px; }
.empty__text { font-size: 14px; max-width: 30ch; margin: 0 auto 18px; }

/* ============================================================
   ЭКРАН «РАСТЕНИЯ»
   ============================================================ */
.plant-card { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; transition: transform .15s ease; }
.plant-card:active { transform: scale(.98); }
.plant-card > .icon { align-self: center; }
.plant-card__thumb {
  width: 64px; height: 64px; border-radius: 18px; flex-shrink: 0;
  align-self: center;
  background: var(--accent-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background-size: cover; background-position: center;
}
.plant-card__thumb .icon { width: 28px; height: 28px; }
.plant-card__info { flex: 1; min-width: 0; }
.plant-card__name { font-weight: 700; font-size: 16px; }
.plant-card__group { font-size: 12.5px; color: var(--text-muted); }
.plant-card__next { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.mini-tag { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 4px 9px; }
.mini-tag--due { background: var(--accent-soft); color: var(--green); }
.mini-tag--ok { background: rgba(74, 100, 84, 0.07); color: var(--text-muted); }

/* ============================================================
   КАРТОЧКА РАСТЕНИЯ (detail)
   ============================================================ */
.detail-hero { text-align: center; padding: 8px 0 4px; }
.detail-hero__photo {
  width: 128px; height: 128px; border-radius: 32px; margin: 0 auto 14px;
  background: var(--accent-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background-size: cover; background-position: center;
  box-shadow: var(--shadow);
}
.detail-hero__photo[data-action="view-photo"] { cursor: pointer; }
.detail-hero__photo .icon { width: 48px; height: 48px; }
.detail-hero h2 { font-size: 1.5rem; }
.detail-hero__group { font-size: 13.5px; color: var(--text-muted); margin-top: 4px; }
.detail-hero__desc { font-size: 14px; color: var(--text-muted); margin-top: 10px; }
.detail-hero__notes { font-size: 14px; color: var(--text); margin-top: 8px; font-style: italic; }

.section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin: 22px 4px 10px; }

.care-schedule-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.care-schedule-item + .care-schedule-item { border-top: 1px solid var(--border); }
.care-schedule-item__info { flex: 1; min-width: 0; }
.care-schedule-item__name { font-weight: 700; font-size: 15px; }
.care-schedule-item__sub { font-size: 12.5px; color: var(--text-muted); }
.care-schedule-item__sub .overdue { color: var(--danger); font-weight: 600; }

.mini-done-btn {
  flex-shrink: 0;
  background: var(--accent-soft); color: var(--green);
  font-weight: 700; font-size: 12.5px;
  border-radius: 999px; padding: 8px 13px;
}

.history-list { list-style: none; }
.history-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: none; }
.history-item__date { font-size: 13.5px; color: var(--text-muted); }
.history-item__name { flex: 1; font-weight: 600; font-size: 14.5px; }

/* Плашка «Пересадка» в карточке растения */
.repot-card { background: var(--accent-soft); border-color: transparent; }
.repot-date { font-weight: 700; color: var(--green); }
.repot-size { color: var(--text-muted); }

/* Карточка участника группы и её плашка пересадки */
.group-plant-card { display: block; }
.group-plant-card__head { display: flex; align-items: center; gap: 12px; }
.group-plant-card .plant-card__info { cursor: pointer; }
.repot-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border-radius: 12px;
  padding: 8px 12px; margin-top: 12px;
  font-size: 13px;
}
.repot-badge .repot-date { font-weight: 700; color: var(--green); }

/* ============================================================
   РАЗМНОЖЕНИЕ
   ============================================================ */
.prop-card { cursor: pointer; }
.prop-card__head { display: flex; align-items: center; gap: 12px; }
.prop-card__info { flex: 1; min-width: 0; }
.prop-card__name { font-weight: 700; font-size: 16px; }
.prop-card__sub { font-size: 12.5px; color: var(--text-muted); }
.prop-card__days {
  flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--green);
  background: var(--accent-soft); border-radius: 999px; padding: 6px 12px;
}
.prop-card__meta { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.prop-card__meta .progress-wrap { flex: 1; }
.progress { height: 7px; border-radius: 999px; background: rgba(74, 100, 84, 0.1); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* detail */
.prop-detail-hero { text-align: center; padding: 6px 0 2px; }
.prop-detail-hero .chip { margin: 0 auto 12px; width: 54px; height: 54px; font-size: 26px; border-radius: 18px; }
.prop-detail-hero h2 { font-size: 1.45rem; }
.prop-detail-hero__meta { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; }

.check-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; cursor: pointer;
}
.check-item + .check-item { border-top: 1px solid var(--border); }
.check-item__box {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: all .15s ease;
}
.check-item__box .icon { width: 15px; height: 15px; opacity: 0; }
.check-item.done .check-item__box { background: var(--green); border-color: var(--green); }
.check-item.done .check-item__box .icon { opacity: 1; }
.check-item.done .check-item__label { color: var(--text-muted); text-decoration: line-through; }
.check-item__label { font-weight: 600; font-size: 15px; }

/* фото-лента */
.photo-diary-controls {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.photo-diary-controls input[type="date"] {
  flex: 1; min-width: 140px; max-width: 220px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 12px; background: #fff; color: var(--text); font-size: 14px;
}
.photo-diary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-diary__add {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--green);
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.photo-diary__add .icon { width: 16px; height: 16px; }
.photo-diary__item { position: relative; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; background: #e9e6dd; }
.photo-diary__item img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.photo-diary__item .photo-date {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: 10.5px; padding: 14px 6px 5px;
}
.photo-diary__item .photo-del {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.photo-diary__item .photo-del .icon { width: 14px; height: 14px; }

/* ============================================================
   ПРОФИЛЬ
   ============================================================ */
.profile-card { text-align: center; padding: 26px 20px; }
.profile-card .chip { width: 64px; height: 64px; border-radius: 20px; font-size: 28px; margin: 0 auto 14px; }
.profile-card__name { font-size: 1.3rem; }
.profile-card__email { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* Выбор эмодзи-аватара */
.avatar-picker { text-align: center; margin-bottom: 20px; }
.avatar-picker__preview {
  width: 88px; height: 88px;
  margin: 0 auto 10px;
  border-radius: 26px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  box-shadow: var(--shadow);
}
.avatar-picker__hint { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.avatar-picker__grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  max-width: 360px;
  margin: 0 auto;
}
.avatar-picker__item {
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.avatar-picker__item:active { transform: scale(.92); }
.avatar-picker__item.active { border-color: var(--green); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 420px) {
  .avatar-picker__grid { grid-template-columns: repeat(6, 1fr); }
}

/* Поле только для чтения */
.field__control--readonly { background: rgba(74, 100, 84, 0.06); }
.field__control--readonly input { color: var(--text-muted); cursor: default; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.profile-stats { display: flex; gap: 10px; margin-top: 18px; }
.profile-stat { flex: 1; background: var(--bg); border-radius: var(--radius-md); padding: 14px 8px; }
.profile-stat__num { font-family: var(--font-heading); font-size: 1.4rem; color: var(--green); }
.profile-stat__label { font-size: 11.5px; color: var(--text-muted); }

.menu-list { list-style: none; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 15px 16px; text-align: left;
  font-size: 15px; font-weight: 600;
}
.menu-item + .menu-item { border-top: 1px solid var(--border); }
.menu-item .icon { width: 20px; height: 20px; color: var(--green); }
.menu-item--danger { color: var(--danger); }
.menu-item--danger .icon { color: var(--danger); }

/* ============================================================
   TOAST
   ============================================================ */
#toast {
  position: fixed;
  left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px);
  transform: translateX(-50%) translateY(20px);
  z-index: 60;
  background: var(--green); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); }

/* ============================================================
   МОДАЛЬНОЕ ОКНО
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(47, 58, 51, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 24px;
  text-align: center;
  animation: modal-in .2s ease;
}
.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.modal__close:hover { background: var(--accent); }
.modal__close .icon { width: 16px; height: 16px; }
.modal__title { font-size: 1.25rem; margin-bottom: 12px; }
.modal__text { font-size: 14.5px; color: var(--text); line-height: 1.6; }
.modal__text a { color: var(--green); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent); }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   COOKIE-БАННЕР
   ============================================================ */
.cookie-banner {
  position: fixed;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  z-index: 65;
  width: calc(100% - 32px);
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__text { font-size: 13.5px; color: var(--text); line-height: 1.5; }
.cookie-banner__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ============================================================
   ПРОСМОТР ФОТО (лайтбокс)
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 17, 0.88);
}
.lightbox__body {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__body img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__close .icon { width: 18px; height: 18px; }

/* ============================================================
   ШИРОКИЕ ЭКРАНЫ
   ============================================================ */
@media (min-width: 620px) {
  .content { padding: 16px 20px 28px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .care-form__grid { gap: 16px; }
}

/* ============================================================
   ДЕСКТОП (≥900px): боковой сайдбар + сетки
   ============================================================ */
@media (min-width: 900px) {
  /* навигация становится левым сайдбаром */
  #bottom-nav {
    top: 0; bottom: 0; left: 0; right: auto;
    width: 232px; height: 100vh; max-width: none; margin: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 6px;
    padding: 26px 14px;
    border-top: none; border-right: 1px solid var(--border);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.96);
  }
  .nav-brand {
    display: flex; align-items: center; gap: 11px;
    padding: 2px 10px 24px;
  }
  .nav-brand__logo {
    width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
    background: var(--accent-soft); color: var(--green);
    display: flex; align-items: center; justify-content: center;
  }
  .nav-brand__logo .icon { width: 22px; height: 22px; }
  .nav-brand__name {
    font-family: var(--font-heading); font-weight: 600; font-size: 17px;
    color: var(--text); letter-spacing: -0.01em;
  }
  .nav-item {
    flex: none;
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 13px; padding: 13px 16px; border-radius: 14px;
    font-size: 15px;
    transition: background .15s ease, color .15s ease;
  }
  .nav-item:hover { background: rgba(169, 191, 165, 0.14); }
  .nav-item.active { background: var(--accent-soft); color: var(--green); }
  .nav-item.active .icon { transform: none; }
  .nav-item .icon { width: 22px; height: 22px; }

  /* контент сдвигается вправо, когда сайдбар виден */
  body.has-nav #app { max-width: none; margin: 0 0 0 232px; }
  body.has-nav .view { padding-bottom: 56px; }
  body.has-nav .topbar,
  body.has-nav .content {
    max-width: 1040px; margin-left: auto; margin-right: auto;
  }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .content { padding: 20px 28px 40px; }

  /* сетки списков: 2 колонки */
  #plants-root, #prop-root {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  }
  #plants-root .card, #prop-root .card { margin: 0; }
  #plants-root .empty, #prop-root .empty { grid-column: 1 / -1; }
  #plants-root .section-label, #plants-root .sort-dropdown { grid-column: 1 / -1; }
  #plants-root .sort-dropdown { margin-bottom: 0; }

  /* формы и карточки — по центру, читаемая ширина */
  #view-plant-form .content, #view-prop-form .content,
  #view-plant-detail .content, #view-prop-detail .content {
    max-width: 800px; margin: 0 auto;
  }

  #toast { bottom: 32px; left: calc(50% + 116px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
