/* Lactisse — мобильная вёрстка в первую очередь, на компьютере колонка по центру. */
:root {
  --bg: #f4f4f2;
  --card: #ffffff;
  --tile: #f6f6f5;
  --line: #e7e7e4;
  --text: #1c1c1a;
  --muted: #6f6f6a;
  --accent: #3a2fd6;
  --accent-soft: #ecebff;
  --good: #3dbb82;
  --good-soft: #e3f6ec;
  --good-ink: #1d7a50;
  --warn: #e9a800;
  --warn-soft: #fdf3d6;
  --warn-ink: #8a5a00;
  --bad: #e0464e;
  --bad-soft: #fde8e8;
  --bad-ink: #a5262d;
  --radius: 14px;
  --tap: 48px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 8px rgba(0,0,0,.03);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: 84px;
}
a { color: var(--accent); }
h1 .count { font-size: .6em; color: var(--muted); font-weight: 650; vertical-align: middle; }
h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 14px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }

/* ---- шапка */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: #ececea; border-bottom: 1px solid var(--line);
}
.logo { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; flex: none; }
.today-date { margin: 0 auto 0 14px; font-size: 15px; color: var(--muted); white-space: nowrap; }
.search { display: flex; flex: 0 1 260px; position: relative; }
.search input {
  width: 100%; height: 40px; border: 1px solid #d6d6d2; border-radius: 10px;
  padding: 0 40px 0 12px; font-size: 16px; background: #fff;
}
.search input::-webkit-search-cancel-button { display: none; }
.search-go { position: absolute; right: 2px; top: 2px; width: 36px; height: 36px; border: 0; border-radius: 8px;
             background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.search-go svg { width: 20px; height: 20px; }
.suggest { position: absolute; top: 46px; right: 0; width: max(100%, 260px); margin: 0; padding: 4px; list-style: none;
           background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
           z-index: 30; max-height: 60vh; overflow-y: auto; }
.suggest a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.suggest a:hover, .suggest a.on { background: var(--tile); }
.suggest .tag { font-weight: 700; font-size: 16px; color: var(--text); }
.suggest .tag b { background: var(--warn-soft); border-radius: 3px; }
.suggest .hint { color: var(--muted); font-size: 13px; }
.suggest .empty { padding: 9px 10px; color: var(--muted); font-size: 14px; }
.topnav { display: none; gap: 4px; }
.topnav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.topnav a.on, .topnav a:hover { background: #fff; }

/* ---- нижняя навигация (телефон) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
}
.bottomnav a.on { color: var(--accent); }
.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8;
       stroke-linecap: round; stroke-linejoin: round; flex: none; }

main { max-width: 860px; margin: 0 auto; padding: 14px 14px 24px; }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .bottomnav { display: none; }
  .topnav { display: flex; }
  .top { padding: 10px 24px; }
  main { padding: 22px 24px 40px; }
  h1 { font-size: 30px; }
}

/* ---- карточки и плитки */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 16px; margin-bottom: 14px;
}
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.tiles.three { grid-template-columns: 1fr; }
.tiles.one { grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .tiles.three { grid-template-columns: repeat(3, 1fr); }
  .tiles.four { grid-template-columns: repeat(4, 1fr); }
  .tiles.six { grid-template-columns: repeat(3, 1fr); }
}
.tile {
  background: var(--tile); border-radius: 12px; padding: 12px 14px; min-height: 64px;
  color: var(--text); text-decoration: none; display: block;
}
a.tile:hover { background: #efefed; }
.tile .label { color: var(--muted); font-size: 14px; }
.tile .value { font-size: 20px; font-weight: 700; }
.tile .big { font-size: 18px; font-weight: 700; }
.tile .sub { color: var(--muted); font-size: 14px; }
h2 .h-note { color: var(--muted); font-weight: 500; font-size: .8em; margin-left: 4px; white-space: nowrap; }
.tile .norm { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile .norm.bad { color: var(--bad-ink); font-weight: 600; }
.tile .tasks { color: var(--warn-ink); font-size: 14px; font-weight: 600; margin-top: 4px; }

/* ---- индекс и шкалы */
.score { font-size: 40px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.score small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.bar { height: 8px; border-radius: 6px; background: var(--good-soft); overflow: hidden; margin: 10px 0 14px; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--good); }
.bar.warn { background: var(--warn-soft); } .bar.warn > i { background: var(--warn); }
.bar.bad { background: var(--bad-soft); } .bar.bad > i { background: var(--bad); }
.bar.thin { height: 6px; margin: 8px 0 0; }

/* ---- раскрывающиеся блоки */
details.fold { background: var(--tile); border-radius: 12px; margin-top: 10px; }
details.fold > summary {
  list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 650;
  display: flex; justify-content: space-between; align-items: center;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "⌄"; font-size: 18px; line-height: 1; transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(180deg); }
details.fold > .body { padding: 0 14px 14px; }
details.fold.card { background: var(--card); margin-top: 0; padding: 0; }
details.fold.card > summary { padding: 16px; }
details.fold.card > .body { padding: 0 16px 16px; }
.explain h3 { margin-top: 10px; }
.explain ul { margin: 0 0 6px; padding-left: 18px; }
.explain li { margin: 2px 0; }

.signals { list-style: none; margin: 0; padding: 0; }
.signals li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.signals .dot { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 2px;
                display: inline-flex; align-items: center; justify-content: center;
                color: #fff; font-size: 12px; font-weight: 800; }
.signals .red .dot { background: var(--bad); }
.signals .yellow .dot { background: var(--warn); }
.signals a { color: inherit; }
.callout { border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 15px; }
.callout.bad { background: var(--bad-soft); color: var(--bad-ink); }
.callout.warn { background: var(--warn-soft); color: var(--warn-ink); }
.callout.good { background: var(--good-soft); color: var(--good-ink); }
.callout.info { background: var(--accent-soft); color: #2a2196; }

/* ---- задачи */
.task { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.task-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; }
.tag { font-size: 24px; font-weight: 800; color: var(--accent); letter-spacing: -.01em; margin-right: 2px; }
.task-title { font-size: 17px; font-weight: 650; margin-bottom: 2px; }
.task-note { color: var(--muted); font-size: 14px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.task-actions .btn { flex: 1 1 auto; }
.task-actions.split { display: grid; grid-template-columns: 1fr 1fr; }
.task-actions.split .btn { padding-left: 8px; padding-right: 8px; line-height: 1.2; display: flex; align-items: center; justify-content: center; text-align: center; }
.btn.alt { background: #fff; border-color: var(--accent); color: var(--accent); }
.other-date { margin-top: 8px; font-size: 14px; }
.other-date summary { color: var(--muted); cursor: pointer; padding: 4px 0; }
.other-date .row { margin-top: 8px; }

.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px;
         font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.critical { background: var(--bad); color: #fff; }
.badge.high { background: var(--warn); color: #3b2a00; }
.badge.normal { background: var(--tile); color: var(--muted); }
.badge.impact { border: 1.5px solid var(--good); color: var(--good-ink); background: #fff; }
.badge.overdue { background: var(--bad-soft); color: var(--bad-ink); }
.badge.plan { background: var(--warn-soft); color: var(--warn-ink); }
.badge.soft { background: var(--tile); color: var(--text); font-weight: 600; }
.badge.watch { background: var(--accent-soft); color: var(--accent); }
.badge.sync { background: var(--accent); color: #fff; }
.item .t .badge + .badge { margin-left: 4px; }
.section-label { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
                 font-weight: 700; margin: 18px 2px 8px; }

/* ---- кнопки и формы */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--text);
  background: #fff; color: var(--text); font: inherit; font-weight: 650; font-size: 16px;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--good); border-color: var(--good); color: #0d3d27; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: #fff; border-color: var(--bad); color: var(--bad-ink); }
.btn.danger.solid { background: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: var(--tile); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }

label { display: block; font-weight: 600; font-size: 15px; margin: 12px 0 6px; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea, input[type=file] {
  width: 100%; min-height: var(--tap); border: 1.5px solid #d4d4cf; border-radius: 12px;
  padding: 10px 12px; font: inherit; font-size: 16px; background: #fff; color: var(--text);
}
input[type=file] { padding: 10px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(58,47,214,.25); outline-offset: 1px; border-color: var(--accent);
}
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 14px 0; }
.check input { width: 24px; height: 24px; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.row > .btn { flex: 0 0 auto; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.error { background: var(--bad-soft); color: var(--bad-ink); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }

/* ---- сообщения */
.flash { display: flex; align-items: center; gap: 10px; justify-content: space-between;
         border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 550; }
.flash.ok { background: var(--good-soft); color: var(--good-ink); }
.flash.warn { background: var(--warn-soft); color: var(--warn-ink); }
.flash.secret { background: var(--accent-soft); color: #241b8f; }
.flash form { margin: 0; flex: none; }
.flash .delta { font-weight: 500; font-size: 14px; margin-top: 4px; }
.flash .delta .chg { font-weight: 700; margin-left: 4px; white-space: nowrap; }
.flash .delta .chg.down { color: var(--bad-ink); }
.flash .delta .parts { opacity: .85; }

/* ---- динамика показателя */
.vh { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h2 { margin: 0; }
.hist-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
            border-radius: 11px; background: var(--tile); color: var(--text); cursor: pointer; user-select: none; }
.hist-btn svg { width: 22px; height: 22px; }
.card:has(#hist-toggle:checked) .hist-btn { background: var(--text); color: #fff; }
#hist-toggle:focus-visible ~ .card-head .hist-btn { outline: 2px solid var(--accent); }
.fei-history { display: none; margin: 10px 0 6px; padding: 12px; background: var(--tile); border-radius: 12px; }
#hist-toggle:checked ~ .fei-history { display: block; }
.hp-chips { display: flex; gap: 6px; margin-bottom: 8px; }
.hp-chips label { flex: 1; text-align: center; padding: 7px 4px; border-radius: 9px; background: #fff;
                  font-weight: 600; font-size: 14px; cursor: pointer; user-select: none; }
.hp-panel { display: none; }
.hp-sum { margin: 2px 0 4px; font-size: 14px; }
.hp-sum .chg { font-weight: 700; margin-left: 2px; }
.hp-sum .chg.up { color: var(--good-ink); } .hp-sum .chg.down { color: var(--bad-ink); }
.hchart { display: block; width: 100%; height: auto; }
.hchart .grid { stroke: var(--line); stroke-width: 1; }
.hchart .ax { fill: var(--muted); font-size: 10px; }
.hchart .nodata { fill: rgba(0,0,0,.04); }
.hchart .nodata-t { fill: var(--muted); font-size: 11px; }
.hchart .line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.hchart .area { fill: var(--accent); opacity: .08; }
.hchart .dot { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.hchart .val { fill: var(--text); font-size: 11px; font-weight: 700; }
#hp-week:checked ~ .hp-panel.hp-week { display: block; }
#hp-week:checked ~ .hp-chips label.hp-week { background: var(--text); color: #fff; }
#hp-week:focus-visible ~ .hp-chips label.hp-week { outline: 2px solid var(--accent); }
#hp-month:checked ~ .hp-panel.hp-month { display: block; }
#hp-month:checked ~ .hp-chips label.hp-month { background: var(--text); color: #fff; }
#hp-month:focus-visible ~ .hp-chips label.hp-month { outline: 2px solid var(--accent); }
#hp-quarter:checked ~ .hp-panel.hp-quarter { display: block; }
#hp-quarter:checked ~ .hp-chips label.hp-quarter { background: var(--text); color: #fff; }
#hp-quarter:focus-visible ~ .hp-chips label.hp-quarter { outline: 2px solid var(--accent); }
#hp-year:checked ~ .hp-panel.hp-year { display: block; }
#hp-year:checked ~ .hp-chips label.hp-year { background: var(--text); color: #fff; }
#hp-year:focus-visible ~ .hp-chips label.hp-year { outline: 2px solid var(--accent); }

/* ---- составляющие показателя: компактные строки */
.subscores { list-style: none; padding: 0; margin: 10px 0 4px; }
.subscores li { padding: 7px 0; }
.subscores .ss-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; margin-bottom: 5px; }
.subscores .ss-row span { color: var(--muted); }
.subscores .ss-row b { font-size: 17px; }
@media (min-width: 560px) {
  .subscores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
}

/* ---- вкладки и навигация по датам */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px;
          text-decoration: none; color: var(--text); font-weight: 650; font-size: 14px; background: #fff;
          border: 1px solid var(--line); }
.tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.datenav { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.datenav form { margin: 0; }
.datenav .day { text-align: center; font-weight: 700; }
.datenav .day small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.datenav input[type=date] { min-height: 44px; text-align: center; }
.filters { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 12px;
           padding: 0 14px 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters a { flex: none; }
.filters a { padding: 6px 12px; border-radius: 20px; background: var(--tile); color: var(--text);
             text-decoration: none; font-size: 14px; font-weight: 600; }
.filters a.on { background: var(--text); color: #fff; }

/* ---- списки коров и история */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a.item { display: flex; align-items: center; gap: 10px; padding: 12px 2px; color: var(--text);
               text-decoration: none; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item .t { font-weight: 700; }
.list .item .s { color: var(--muted); font-size: 14px; }
.chev { color: #b4b4ae; font-size: 20px; }

.history { list-style: none; padding: 0; margin: 0; }
.history li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
              display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.history .what { font-weight: 700; }
.history .note { color: var(--muted); font-size: 14px; }
.history .when { display: flex; align-items: center; gap: 6px; flex: none; }
.history .when a { color: var(--muted); padding: 4px; }

.cow-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cow-head h1 { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none;
        font-weight: 600; margin: 0 0 10px; padding: 6px 0; }

.table-wrap { overflow-x: auto; }
table.plain { border-collapse: collapse; width: 100%; font-size: 14px; }
table.plain th, table.plain td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line);
                                 vertical-align: top; }
table.plain th { color: var(--muted); font-weight: 600; border-top: 0; }

.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty .btn { margin-top: 12px; }
.center-page { max-width: 420px; margin: 8vh auto 0; }
.brand-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; color: var(--text);
          text-decoration: none; font-weight: 600; border-top: 1px solid var(--line); }
.menu a:first-child { border-top: 0; }
.menu form button { all: unset; display: flex; align-items: center; gap: 12px; padding: 14px 4px;
                    font-weight: 600; color: var(--bad-ink); cursor: pointer; width: 100%;
                    border-top: 1px solid var(--line); }

/* ---- переключатель «Задачи | Коровы» и счётчики */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #e6e6e2; padding: 4px;
       border-radius: 14px; margin: 4px 0 14px; }
.seg a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
         border-radius: 11px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 16px; }
.seg a.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.n { display: inline-flex; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; align-items: center;
     justify-content: center; font-size: 13px; font-weight: 700; background: rgba(0,0,0,.07); color: inherit; }
.seg a.on .n { background: var(--accent); color: #fff; }
.tabs a.on .n { background: rgba(255,255,255,.25); }

/* ---- экран отёла: выбор крупными плитками */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
       min-height: 60px; margin: 0; padding: 8px; border: 1.5px solid #d4d4cf; border-radius: 12px;
       background: #fff; font-weight: 650; font-size: 16px; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: #241b8f; }
.opt:has(input:focus-visible) { outline: 3px solid rgba(58,47,214,.25); }
.calf-tags { display: none; }
.calving:has(input[value=heifer]:checked) .calf1,
.calving:has(input[value=bull]:checked) .calf1,
.calving:has(input[value=mixed]:checked) .calf1,
.calving:has(input[value=heifers2]:checked) .calf1,
.calving:has(input[value=bulls2]:checked) .calf1,
.calving:has(input[value=mixed]:checked) .calf2,
.calving:has(input[value=heifers2]:checked) .calf2,
.calving:has(input[value=bulls2]:checked) .calf2 { display: block; }
.opt.big { min-height: 76px; font-size: 18px; }
.choice.three { grid-template-columns: 1fr 1fr 1fr; }
.calf-dest { display: none; }
.calving:has(input[value=heifer]:checked) .dest1-T,
.calving:has(input[value=heifers2]:checked) .dest1-T,
.calving:has(input[value=mixed]:checked) .dest1-T,
.calving:has(input[value=bull]:checked) .dest1-B,
.calving:has(input[value=bulls2]:checked) .dest1-B,
.calving:has(input[value=heifers2]:checked) .dest2-T,
.calving:has(input[value=mixed]:checked) .dest2-B,
.calving:has(input[value=bulls2]:checked) .dest2-B { display: block; }
/* переключатель стад — «ползунок»: белая плашка переезжает под выбранное стадо */
.herd-switch { position: relative; margin: 0 0 14px; isolation: isolate; }
.herd-switch::before { content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 6px); border-radius: 11px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: transform .26s cubic-bezier(.3,.7,.2,1); }
.herd-switch.at-beef::before { transform: translateX(calc(100% + 4px)); }
.herd-switch a, .herd-switch a.on { background: transparent; box-shadow: none; transition: color .26s; }
.herd-switch.at-dairy a[data-to=dairy], .herd-switch.at-beef a[data-to=beef] { color: var(--text); }
.herd-switch.at-dairy a[data-to=beef], .herd-switch.at-beef a[data-to=dairy] { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .herd-switch::before, .herd-switch a { transition: none; } }
.other-reason { display: none; }
.remove-form:has(input[value=other]:checked) .other-reason { display: block; }
.more-outcomes { margin-top: 12px; }
.more-outcomes summary { font-size: 15px; }
.more-outcomes:has(input:checked) > summary { color: var(--accent); font-weight: 650; }

/* ---- схемы синхронизации */
.sync-plan { list-style: none; margin: 4px 0 10px; padding: 0; counter-reset: none; }
.sync-plan li { display: grid; grid-template-columns: 118px 52px 1fr; gap: 8px; align-items: baseline;
                padding: 9px 0; border-top: 1px solid var(--line); }
.sync-plan li:first-child { border-top: 0; }
.sync-plan .sd { font-weight: 700; }
.sync-plan .sp { color: var(--muted); font-size: 14px; }
.sync-plan li.ai .sn { font-weight: 700; color: var(--good-ink); }
.sync-plan li.check { color: var(--muted); }
.sync-plan.compact li { padding: 6px 0; font-size: 15px; }
.sync-plan li.done { color: var(--muted); }
.sync-plan .sh { display: block; font-weight: 400; font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.sync-plan li.done .sp { color: var(--good-ink); font-weight: 700; }
.sync-plan li.next .sd, .sync-plan li.next .sn { color: var(--accent); }
.sync-box { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.sync-title { font-weight: 700; margin-bottom: 4px; }
.callout.warn-box { background: var(--warn-soft); color: var(--warn-ink); }
.callout.warn-box p { margin: 0 0 8px; }
.sync-link { display: block; color: var(--muted); text-decoration: none; margin-top: 4px; }
.opt small { font-weight: 500; color: var(--muted); }
.badge.daypart { background: var(--accent-soft); color: #241b8f; }
.explain .part { margin-bottom: 14px; }
.explain .part .ss-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; margin-bottom: 5px; }
.explain .part ul { margin: 8px 0 0; }
.explain .part .weight { margin: 4px 0 0; }
.sync-plan .sd small { color: var(--muted); font-weight: 600; }
.sync-plan li.heat { color: var(--muted); font-size: 14px; }
.sync-plan li.heat .sd { font-weight: 600; }
.sync-plan li.gate .sn { font-weight: 700; color: var(--warn-ink); }
.scheme-list { display: grid; gap: 6px; margin-bottom: 6px; }
.scheme-opt { display: block; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text);
              text-decoration: none; font-weight: 600; background: #fff; }
.scheme-opt.on { border-color: var(--accent); background: var(--accent-soft); color: #241b8f; }
.callout.info { margin-top: 8px; }

/* ---- кабинет владельца */
.owner-tabs { margin-bottom: 4px; }
.list a.farm-row { display: block; padding: 12px 2px; color: var(--text); text-decoration: none; }
.farm-row .t { font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.farm-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 4px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kv > div { display: flex; flex-direction: column; gap: 2px; background: var(--tile); border-radius: 10px; padding: 10px; }
.kv .muted { font-size: 13px; }
details.reply summary { cursor: pointer; margin-top: 4px; }
.pre { white-space: pre-wrap; background: var(--tile); border-radius: 10px; padding: 10px; margin-top: 6px; }
.viewbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
           gap: 10px; padding: 8px 14px; background: #241b8f; color: #fff; font-size: 14px; }
.viewbar form { margin: 0; flex: none; }
.viewbar button { background: #fff; color: #241b8f; border: 0; border-radius: 8px; padding: 6px 10px;
                  font-weight: 700; cursor: pointer; }
.add-person { margin-top: 12px; }
.add-person .inline { display: flex; gap: 8px; }
.add-person .inline input { flex: 1; min-width: 0; }
.new-pass { margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--accent-soft); color: #241b8f; }
.new-pass .inline { display: flex; align-items: center; gap: 10px; margin: 6px 0; flex-wrap: wrap; }
.new-pass code { font-size: 20px; font-weight: 700; letter-spacing: .02em; user-select: all; }
.inline-copy { display: flex; gap: 8px; align-items: center; }
.inline-copy input { flex: 1; min-width: 0; }
