/* SUV AI app — дизайн v2 по SUV-UI-Handoff (21.09.2026).
   Токены вынесены в :root и не размножаются по компонентам (ТЗ §4).
   Светлая тема — по умолчанию; тёмная — по настройке ОС или явному
   выбору пользователя ([data-theme]), не по классу презентации. */

:root {
  --bg: #FAFBF7;
  --surface-muted: #F0F2EB;
  --surface: #FFFFFF;
  --text: #252D21;
  --text-2: #626A59;           /* textSecondaryAccessible: 4.5:1 на bg */
  --text-2-soft: #7A8272;      /* прототипный, только на крупном */
  --border: #E4E7DD;
  --action: #566C3E;
  --on-action: #FFFFFF;
  --good: #7B945E;
  --mid: #BDA965;
  --low: #B88152;
  --warn-bg: #F1E9DB;
  --warn-text: #8C6541;
  --arc-low: #B68F63;
  --chip-active: #293725;
  --locate: #598DC6;
  --shadow: 0 6px 24px rgba(37, 45, 33, .10);

  --r-card: 24px; --r-panel: 25px; --r-metric: 18px; --r-tile: 17px;
  --r-btn: 18px; --r-btn-home: 16px; --r-search: 16px; --r-chip: 13px;
  --r-mapsheet: 28px; --r-sheet: 30px;

  --pad: 19px; --pad-home: 21px; --gap-pair: 10px;
  --nav-h: 64px;
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-t: env(safe-area-inset-top, 0px);
}
[data-theme="dark"] {
  --bg: #1E261E;
  --surface-muted: #293229;
  --surface: #2F392F;
  --text: #F2F5ED;
  --text-2: #BBC2B1;
  --text-2-soft: #BBC2B1;
  --border: #414E3E;
  --action: #BCCF94;
  --on-action: #20271C;
  --good: #A2BD77;
  --mid: #D3BD79;
  --low: #D8A47A;
  --warn-bg: #3A3327;
  --warn-text: #E4C9A6;
  --chip-active: #E9EFDD;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--text);
  font-family: "Golos Text", system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.45;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: var(--action); text-decoration: none; }
svg.i { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.6;
        fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 18px; height: 18px; }
[hidden] { display: none !important; }

#app { padding-bottom: calc(var(--nav-h) + var(--sa-b) + 14px); min-height: 100vh; }
.screen { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── нижняя навигация ─────────────────────────────────────── */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--sa-b));
  padding-bottom: var(--sa-b);
  background: var(--surface); border-top: 1px solid var(--border);
}
.nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-2); font-size: 12px; min-height: 48px;
}
.nav button.on { color: var(--text); }
.nav button.on .pill { background: var(--surface-muted); }
.nav .pill { display: flex; align-items: center; justify-content: center;
  width: 46px; height: 28px; border-radius: 14px; }
/* Пять ячеек — когда сервер открыл AI Agronom. Центральная кнопка
   приподнята над полосой: это главное действие, а не пятая вкладка. */
.nav.five { grid-template-columns: repeat(5, 1fr); }
.nav.five button { font-size: 11px; }
.nav button.center { justify-content: flex-end; padding-bottom: 7px; color: var(--text); }
.orb { display: flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%; margin-top: -24px;
  background: var(--action); color: var(--on-action);
  box-shadow: 0 0 0 5px var(--surface), var(--shadow); transition: transform .15s ease; }
.nav button.center:active .orb { transform: scale(.94); }
.orb .i { width: 25px; height: 25px; }
.orb.big { width: 84px; height: 84px; margin: 0 auto; box-shadow: var(--shadow); }
.orb.big .i { width: 36px; height: 36px; }

/* ── главная ──────────────────────────────────────────────── */
.hero {
  position: relative; height: calc(164px + var(--sa-t) + 46px);
  background: #4c5a43 url("img/landscape.jpg") center/cover no-repeat;
  color: #fff;
}
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,26,17,.45), rgba(20,26,17,.12) 45%, rgba(20,26,17,.38)); }
.hero > div { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between;
  padding: calc(var(--sa-t) + 14px) 22px 0; }
.hero-hi { font-size: 13px; opacity: .92; }
.hero-title { font-size: 29px; font-weight: 400; line-height: 1.12; margin-top: 2px; }
.hero-region { display: flex; align-items: center; gap: 5px; font-size: 12px; opacity: .92; margin-top: 6px; }
.bell { width: 40px; height: 40px; min-width: 48px; min-height: 48px;
  display: flex; align-items: center; justify-content: center; color: #fff; position: relative; }
.bell .dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px;
  border-radius: 4px; background: var(--mid); }
.hero-weather { position: absolute; left: 22px; bottom: 40px; display: inline-flex;
  align-items: center; gap: 7px; padding: 7px 12px; border-radius: 12px;
  background: rgba(20,26,17,.42); backdrop-filter: blur(6px); font-size: 12px; }

.home-sheet {
  position: relative; margin-top: -28px; border-radius: 28px 28px 0 0;
  background: var(--bg); padding: 23px var(--pad-home) 8px; z-index: 2;
}
@media (max-width: 340px) { .home-sheet { padding-left: var(--pad); padding-right: var(--pad); } }

.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.h-section { font-size: 20px; font-weight: 500; }
.h-section.compact { font-size: 17px; }
.caption { font-size: 12px; color: var(--text-2); }
.chip-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  padding: 6px 10px; border-radius: var(--r-chip); background: var(--warn-bg);
  color: var(--warn-text); font-size: 12px; }
.chip-note.ok { background: var(--surface-muted); color: var(--text-2); }
.verdict { font-size: 29px; font-weight: 400; line-height: 1.14; margin: 10px 0 4px;
  overflow-wrap: anywhere; }
@media (max-width: 340px) { .verdict { font-size: 27px; } }
.verdict-sub { font-size: 15px; color: var(--text-2); }

.dose-row { display: flex; align-items: center; gap: 16px; margin: 16px 0 4px; }
.dose { font-size: 64px; font-weight: 400; line-height: 1; letter-spacing: -1px; }
@media (max-width: 340px) { .dose { font-size: 60px; } }
.dose .unit { font-size: 23px; margin-left: 2px; }
.dose-side { border-left: 1px solid var(--border); padding-left: 14px;
  font-size: 13px; color: var(--text-2); display: grid; gap: 3px; }
.calc-row { display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 14px; font-size: 12px; color: var(--text-2); }
.calc-row a { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; min-height: 48px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 18px; border-radius: var(--r-btn);
  background: var(--action); color: var(--on-action); font-size: 15px; font-weight: 500;
  width: 100%; transition: transform .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.charcoal { background: var(--text); color: var(--bg); border-radius: var(--r-btn-home); }
.btn.ghost { background: var(--surface-muted); color: var(--text); }
.btn.small { min-height: 48px; width: auto; font-size: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* поля-плитки */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-pair); margin-top: 12px; }
.tile {
  position: relative; border-radius: var(--r-tile); overflow: hidden; text-align: left;
  background: #46523d center/cover no-repeat; aspect-ratio: 16/11; color: #fff;
}
.tile::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,23,15,.06) 30%, rgba(18,23,15,.66)); }
.tile > div { position: absolute; left: 11px; right: 9px; bottom: 9px; z-index: 1; }
.tile .t-name { font-size: 15px; font-weight: 500; }
.tile .t-sub { font-size: 11.5px; opacity: .9; }
.tile .t-badge { position: absolute; top: 9px; left: 9px; z-index: 1; font-size: 11px;
  padding: 3px 8px; border-radius: 10px; background: rgba(20,26,17,.5); backdrop-filter: blur(4px); }
.frows { display: grid; gap: 8px; margin-top: 12px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--r-tile); background: var(--surface); border: 1px solid var(--border);
  text-align: left; min-height: 56px; }
.frow .st { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.frow .fr-main { flex: 1; min-width: 0; }
.frow .fr-name { font-weight: 500; }
.frow .fr-sub { font-size: 12px; color: var(--text-2); }
.add-tile { display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--border); border-radius: var(--r-tile); color: var(--text-2);
  aspect-ratio: 16/11; font-size: 14px; }

/* ── страницы с шапкой ────────────────────────────────────── */
.page { padding: calc(var(--sa-t) + 10px) var(--pad) 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.topbar .tb-title { font-size: 15px; color: var(--text-2); }
.icon-btn { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  color: var(--text); border-radius: 14px; }
.icon-btn:active { background: var(--surface-muted); }
.h-screen { font-size: 27px; font-weight: 500; margin: 8px 0 2px; }
.h-field { font-size: 31px; font-weight: 500; margin: 4px 0 2px; overflow-wrap: anywhere; }
.sub-line { color: var(--text-2); font-size: 14px; }

/* карточка запаса влаги */
.panel { background: var(--surface); border-radius: var(--r-panel); padding: 18px;
  margin-top: 16px; border: 1px solid var(--border); }
.panel .p-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.status-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.status-lbl .st { width: 8px; height: 8px; border-radius: 4px; }
.st.g { background: var(--good); } .st.m { background: var(--mid); }
.st.l { background: var(--low); } .st.n { background: var(--border); }
.gauge-wrap { display: flex; justify-content: center; padding: 8px 0 0; }
/* Кольцо — контейнер: SVG и стопка «капля + число + подпись» лежат в
   одних координатах, стопка центрируется на центре дуги (y=80 из 152,
   отсюда компенсация 8px). Никаких отрицательных отступов. */
.gauge { position: relative; width: 170px; height: 152px; }
/* Только прямой потомок — кольцо; капля внутри .gauge-stack — обычный
   flex-ребёнок, и абсолютным ей быть нельзя. */
.gauge > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gauge-stack { position: absolute; inset: 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  padding-top: 4px; gap: 2px; }
.gauge-stack .i { color: var(--text-2); }
.gauge-num { font-size: 52px; font-weight: 400; line-height: 1; }
.gauge-num .unit { font-size: 24px; }
.gauge-cap { font-size: 12px; color: var(--text-2); }
.panel .p-note { text-align: center; font-size: 14px; color: var(--text-2);
  margin-top: 6px; line-height: 1.4; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-pair); margin-top: var(--gap-pair); }
@media (max-width: 330px) { .pair { grid-template-columns: 1fr; } }
.metric { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-metric); padding: 14px; }
.metric .m-num { font-size: 21px; margin-top: 6px; }
.metric .m-cap { font-size: 12px; color: var(--text-2); }

.chart-card { margin-top: 18px; }
.chart-box { height: 145px; margin-top: 10px; }
.chart-box svg { width: 100%; height: 100%; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.linkrow { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; border-bottom: 1px solid var(--border); font-size: 15px; width: 100%; text-align: left; }
.linkrow:last-child { border-bottom: 0; }
.linkrow .lr-sub { font-size: 12px; color: var(--text-2); }
.card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 6px 16px; margin-top: 14px; }
.card.pad { padding: 16px; }

/* секции состояния */
.sec { padding: 12px 0; border-bottom: 1px solid var(--border); }
.sec:last-child { border-bottom: 0; }
.sec .s-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 500; }
.sec .s-line { margin-top: 3px; font-size: 14px; }
.sec .s-hint { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* баннеры состояний данных (ТЗ §12) */
.banner { display: flex; align-items: center; gap: 10px; margin: 12px 0 0;
  padding: 10px 14px; border-radius: 14px; font-size: 13px;
  background: var(--warn-bg); color: var(--warn-text); }
.banner.info { background: var(--surface-muted); color: var(--text-2); }
.banner button { margin-left: auto; font-weight: 500; text-decoration: underline; min-height: 40px; }

/* ── карта ────────────────────────────────────────────────── */
.map-screen { position: fixed; inset: 0 0 calc(var(--nav-h) + var(--sa-b)) 0; }
#map { position: absolute; inset: 0; background: var(--surface-muted); }
.map-top { position: absolute; top: calc(var(--sa-t) + 10px); left: 17px; right: 17px; z-index: 401; }
.map-search { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px;
  border-radius: var(--r-search); background: var(--surface); box-shadow: var(--shadow); }
.map-search input { flex: 1; border: 0; outline: 0; background: none; font-size: 15px; min-width: 0; }
.map-chips { display: flex; gap: 8px; margin-top: 10px; }
.chip { padding: 9px 14px; min-height: 40px; border-radius: var(--r-chip); font-size: 13px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.chip.on { background: var(--chip-active); color: var(--bg); }
[data-theme="dark"] .chip.on { color: #1E261E; }
.map-fabs { position: absolute; right: 14px; bottom: 190px; z-index: 401; display: grid; gap: 10px; }
.fab { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 21px; background: var(--surface); box-shadow: var(--shadow); }
.fab .inner { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; }
.map-card { position: absolute; left: 0; right: 0; bottom: 0; z-index: 402;
  background: var(--surface); border-radius: var(--r-mapsheet) var(--r-mapsheet) 0 0;
  padding: 8px 21px calc(14px + var(--sa-b)); box-shadow: var(--shadow); }
.map-card .grip { width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 10px; }
.mc-head { display: flex; align-items: center; gap: 12px; }
.mc-thumb { width: 52px; height: 52px; border-radius: 14px; background: #46523d center/cover; flex: none; }
.mc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.mc-cols .c-cap { font-size: 12px; color: var(--text-2); }
.mc-cols .c-val { font-size: 21px; }
.leaflet-container { font: inherit; }
.field-label { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 3px 8px; font-size: 11.5px; color: var(--text); white-space: nowrap; box-shadow: var(--shadow); }

/* ── нижний лист ──────────────────────────────────────────── */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(20, 26, 17, .42);
  animation: fade .25s ease-out; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 10px 23px calc(16px + var(--sa-b)); max-height: 88vh; overflow: auto;
  animation: rise .25s ease-out; }
@keyframes rise { from { transform: translateY(28px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .grip { width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 2px auto 12px; }
.sheet h2 { font-size: 20px; font-weight: 500; margin: 0 0 2px; }
.sheet .s-sub { color: var(--text-2); font-size: 14px; margin-bottom: 12px; }
.fgroup { margin: 14px 0; }
.fgroup .f-cap { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { padding: 10px 14px; min-height: 44px; border-radius: var(--r-chip);
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.seg button.on { background: var(--chip-active); color: var(--bg); border-color: var(--chip-active); }
[data-theme="dark"] .seg button.on { color: #1E261E; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper .sv { font-size: 34px; min-width: 96px; text-align: center; }
.stepper .sv .unit { font-size: 16px; color: var(--text-2); }
.stepper button { width: 48px; height: 48px; border-radius: 16px; background: var(--surface-muted);
  font-size: 22px; display: flex; align-items: center; justify-content: center; }
.form-err { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn-text); font-size: 13.5px; }
input[type="date"], input[type="text"], textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); outline: none;
}
textarea { min-height: 96px; resize: vertical; }

/* снекбар с отменой */
.snack { position: fixed; left: 14px; right: 14px; z-index: 70;
  bottom: calc(var(--nav-h) + var(--sa-b) + 14px);
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  background: var(--text); color: var(--bg); border-radius: 16px; box-shadow: var(--shadow);
  font-size: 14px; animation: rise .2s ease-out; }
.snack button { color: inherit; font-weight: 600; margin-left: auto; min-height: 40px; text-decoration: underline; }

/* журнал */
.jrow { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.jrow:last-child { border-bottom: 0; }
.jrow .j-ic { width: 36px; height: 36px; border-radius: 12px; background: var(--surface-muted);
  display: flex; align-items: center; justify-content: center; flex: none; color: var(--text-2); }
.jrow .j-main { flex: 1; min-width: 0; }
.jrow .j-t { font-size: 14.5px; }
.jrow .j-s { font-size: 12px; color: var(--text-2); }
.jrow.voided .j-t { text-decoration: line-through; color: var(--text-2); }
.j-day { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 14px 0 2px; }
.j-sync { font-size: 11px; padding: 2px 7px; border-radius: 8px; background: var(--surface-muted); color: var(--text-2); }
.j-sync.q { background: var(--warn-bg); color: var(--warn-text); }

/* скелетон */
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--surface-muted) 25%, var(--surface) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%; animation: shim 1.2s linear infinite; }
@keyframes shim { to { background-position: -200% 0; } }

/* welcome */
.welcome { min-height: 100vh; display: flex; flex-direction: column; }
.welcome .w-photo { flex: 1; min-height: 300px; background: #46523d url("img/landscape.jpg") center/cover;
  position: relative; }
.welcome .w-photo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,26,17,.25), rgba(20,26,17,.05) 40%, var(--bg) 96%); }
.welcome .w-mark { position: absolute; top: calc(var(--sa-t) + 26px); left: 24px; z-index: 1;
  font-size: 30px; font-weight: 600; color: #fff; letter-spacing: .5px; }
.welcome .w-mark i { color: var(--mid); font-style: normal; }
.welcome .w-body { padding: 6px 24px calc(26px + var(--sa-b)); }
.welcome h1 { font-size: 27px; font-weight: 500; margin: 6px 0 6px; }
.welcome p { color: var(--text-2); margin: 0 0 18px; }

/* снимки (S-22) */
.scene-strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scene-strip::-webkit-scrollbar { display: none; }
.scene-strip button { flex: none; padding: 9px 13px; min-height: 40px;
  border-radius: var(--r-chip); font-size: 13px; background: var(--surface);
  border: 1px solid var(--border); }
.scene-strip button.on { background: var(--chip-active); color: var(--bg);
  border-color: var(--chip-active); }
[data-theme="dark"] .scene-strip button.on { color: #1E261E; }
.scene-img { width: 100%; border-radius: 14px; display: block; }
.scene-cap { text-align: left; font-size: 12.5px; color: var(--text-2);
  margin-top: 10px; white-space: pre-line; }
.cmp-wrap { position: relative; border-radius: 14px; overflow: hidden; }
.cmp-wrap img { width: 100%; display: block; }
/* Верхний кадр НЕ сжимается, а клипается: оба кадра одного размера,
   двигается только граница — иначе сравнение разъезжалось бы. */
.cmp-top { position: absolute; inset: 0; }
.cmp-line { position: absolute; top: 0; bottom: 0; width: 2px;
  background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.5); }
.cmp-tag { position: absolute; top: 8px; padding: 3px 8px; font-size: 11px;
  border-radius: 8px; background: rgba(20,26,17,.55); color: #fff; }

/* болезни: свёрнутые карточки — заголовок + строка сути */
details.dz { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-metric); margin-top: 10px; }
details.dz summary { list-style: none; display: grid;
  grid-template-columns: 1fr 18px; align-items: center; gap: 4px 10px;
  padding: 13px 14px; min-height: 48px; cursor: pointer; }
details.dz summary::-webkit-details-marker { display: none; }
.dz-head { font-weight: 500; font-size: 14.5px; }
.dz-prev { grid-column: 1; font-size: 13px; color: var(--text-2);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; }
details.dz[open] .dz-prev { display: none; }
details.dz summary .i { grid-column: 2; grid-row: 1; color: var(--text-2);
  transition: transform .15s ease; }
details.dz[open] summary .i { transform: rotate(90deg); }
.dz-body { padding: 0 14px 14px; white-space: pre-line; font-size: 14px; }
.dzp-strip { display: flex; gap: 10px; overflow-x: auto; padding: 10px 2px 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.dzp-strip::-webkit-scrollbar { display: none; }
.dzp-card { flex: none; width: 172px; text-align: left; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-metric);
  overflow: hidden; padding-bottom: 10px; }
.dzp-card img { width: 100%; height: 118px; object-fit: cover; display: block; }
.dzp-name { display: block; font-weight: 500; font-size: 13.5px; padding: 8px 10px 0; }
.dzp-det { display: block; font-size: 11.5px; color: var(--text-2); padding: 2px 10px 0; }

/* ── AI Agronom: чат ──────────────────────────────────────── */
/* Экран закреплён, как карта: шапка и поле ввода стоят на месте,
   прокручивается только переписка. Высота — по видимой области
   (--vvh ставит app.js), чтобы клавиатура не закрывала ввод. */
.chat { position: fixed; left: 0; right: 0; top: 0; height: var(--vvh, 100dvh);
  display: flex; flex-direction: column; background: var(--bg); z-index: 30; }
.chat-top { padding: calc(var(--sa-t) + 6px) var(--pad) 8px;
  border-bottom: 1px solid var(--border); background: var(--bg); }
.chat-field { display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  min-height: 40px; padding: 7px 12px; border-radius: var(--r-chip);
  background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; }
.chat-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-field .i:last-child { transform: rotate(90deg); color: var(--text-2); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px var(--pad) 14px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.chat-note { font-size: 11.5px; color: var(--text-2); text-align: center;
  margin: 2px 8px 12px; line-height: 1.4; }
.chat-foot { padding: 6px 12px calc(10px + var(--sa-b));
  border-top: 1px solid var(--border); background: var(--surface); }
.chat-foot .caption { text-align: center; min-height: 0; }
.chat-foot .caption:not(:empty) { margin-bottom: 6px; }
.chat-compose { display: flex; align-items: flex-end; gap: 6px; }
.chat-compose textarea { flex: 1; min-height: 46px; max-height: 120px; resize: none;
  padding: 12px 14px; border-radius: 20px; line-height: 1.35; font: inherit;
  color: inherit; border: 1px solid var(--border); background: var(--bg); outline: none; }
.chat-compose textarea:focus { border-color: var(--action); }
.chat-send { width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--action); color: var(--on-action); }
.chat-send:active { transform: scale(.94); }

.msg { display: flex; flex-direction: column; margin-top: 10px; max-width: 100%; }
.msg.u { align-items: flex-end; }
.msg.a { align-items: flex-start; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 20px; font-size: 15px;
  overflow-wrap: anywhere; }
.msg.u .bubble { background: var(--chip-active); color: var(--bg); border-bottom-right-radius: 6px; }
[data-theme="dark"] .msg.u .bubble { color: #1E261E; }
.msg.a .bubble { background: var(--surface); border: 1px solid var(--border);
  border-bottom-left-radius: 6px; }
.bubble.wide { max-width: 100%; width: 100%; padding: 14px; }
.bubble.fail { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.b-text { white-space: pre-line; }
.b-photo { display: block; width: 210px; max-width: 100%; min-height: 60px; border-radius: 14px;
  background: var(--surface-muted); object-fit: cover; }
.b-photo + .b-text { margin-top: 8px; }
.msg-src { display: inline-flex; align-items: center; gap: 5px; margin: 5px 4px 0;
  font-size: 11.5px; color: var(--text-2); }
.msg-err { margin-top: 5px; font-size: 12.5px; color: var(--warn-text); }
.msg-err button { font-weight: 500; text-decoration: underline; min-height: 36px; }
.typing { display: inline-flex; gap: 4px; margin-right: 8px; vertical-align: middle; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2);
  animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.votes { display: flex; gap: 8px; margin-top: 6px; }
.votes button { min-height: 36px; padding: 6px 12px; border-radius: var(--r-chip);
  font-size: 12.5px; color: var(--text-2); background: var(--surface-muted); }
.votes button.on { background: var(--chip-active); color: var(--bg); }
[data-theme="dark"] .votes button.on { color: #1E261E; }
.chips-q { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips-q.center { justify-content: center; }
.chip-q { display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  padding: 8px 14px; border-radius: 20px; font-size: 13.5px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.chip-q.cam { border-color: var(--action); color: var(--action); }
.chip-q:active { background: var(--surface-muted); }

.ag-intro { text-align: center; padding: 26px 6px 8px; }
.ag-hero { padding: 26px 0 14px; }

/* разбор фото: вывод с уверенностью, проверка на месте */
.ph-lead { font-size: 12.5px; color: var(--text-2); }
.verdict { margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-muted); }
.v-k { font-size: 12px; color: var(--text-2); }
.verdict .hyp { padding: 2px 0 0; border-bottom: 0; }
.verdict .hyp-head { font-size: 16.5px; }
.verdict .hyp-head b { font-weight: 600; }
.verdict .hyp-l { font-size: 14px; margin-top: 4px; }
details.ph-more { margin-top: 10px; border-top: 1px solid var(--border); }
details.ph-more summary { list-style: none; display: flex; align-items: center;
  justify-content: space-between; min-height: 44px; font-size: 13.5px;
  color: var(--text-2); cursor: pointer; }
details.ph-more summary::-webkit-details-marker { display: none; }
details.ph-more summary .i { transition: transform .15s ease; }
details.ph-more[open] summary .i { transform: rotate(90deg); }
.ph-h { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 12px 0 4px; }
.ph-ul { margin: 0; padding-left: 18px; font-size: 14.5px; }
.ph-ul li { margin: 2px 0; }
.ph-row { font-size: 14.5px; margin-top: 10px; }
.hyp { padding: 10px 0; border-bottom: 1px solid var(--border); }
.hyp:last-child { border-bottom: 0; }
.hyp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 15px; }
.hyp-head b { font-weight: 500; }
.conf { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.conf .st { width: 8px; height: 8px; border-radius: 4px; }
.hyp-l { font-size: 14px; margin-top: 4px; }
.hyp-l i { font-style: normal; color: var(--text-2); }
.ph-note { display: flex; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-muted); font-size: 14px; }
.ph-note .i { margin-top: 2px; color: var(--text-2); }
.ph-disc { margin-top: 12px; font-size: 12px; color: var(--text-2); }
.ph-preview { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 14px;
  background: var(--surface-muted); display: block; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.center-note { text-align: center; color: var(--text-2); font-size: 13px; padding: 26px 10px; }
.readonly-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 10px; background: var(--surface-muted); color: var(--text-2); font-size: 12px; }
