/* HerdBook — rugged field UI: high contrast for sunlight, big touch targets for gloves. */
:root {
  --bg: #f1f4f8;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --ink: #17202b;
  --muted: #556170;
  --line: #d5dce5;
  --accent: #1f5fa8;
  --accent-2: #2b74c4;
  --accent-ink: #ffffff;
  --accent-soft: #e2ecf8;
  --due: #b42318;
  --due-soft: #fde8e6;
  --soon: #9a5b00;
  --soon-soft: #fdf1dc;
  --info: #1f5f8b;
  --info-soft: #e3eef6;
  --ok: #2f7d4a;
  --ok-soft: #e1f2e6;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --radius: 10px;
  --tap: 48px;
  --nav-w: 216px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141a; --surface: #181d25; --surface-2: #1f252f; --ink: #e6ebf1; --muted: #a0abb9; --line: #313a47;
    --accent: #6ea8e6; --accent-2: #8bbcf0; --accent-ink: #0d1724; --accent-soft: #1c2c40;
    --due: #ff8a7f; --due-soft: #3d1f1c; --soon: #f0b357; --soon-soft: #3a2c16; --info: #7fb6e0; --info-soft: #1b2c3a;
    --ok: #79c58f; --ok-soft: #1d3324; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10141a; --surface: #181d25; --surface-2: #1f252f; --ink: #e6ebf1; --muted: #a0abb9; --line: #313a47;
  --accent: #6ea8e6; --accent-2: #8bbcf0; --accent-ink: #0d1724; --accent-soft: #1c2c40;
  --due: #ff8a7f; --due-soft: #3d1f1c; --soon: #f0b357; --soon-soft: #3a2c16; --info: #7fb6e0; --info-soft: #1b2c3a;
  --ok: #79c58f; --ok-soft: #1d3324; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: .4em 0; }
.muted { color: var(--muted); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* ---- layout ---- */
#app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--accent); color: var(--accent-ink);
}
.brand { color: inherit; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: .02em; min-width: calc(var(--nav-w) - 28px); }
.btn.menu-btn { display: none; }
.topbar .btn.ghost { color: var(--accent-ink); }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.16); border-radius: 999px; padding: 0 14px; }
.search input { flex: 1; background: transparent; border: 0; color: inherit; font: inherit; height: 44px; outline: none; min-width: 0; }
.search input::placeholder { color: inherit; opacity: .75; }
.sync-chip {
  margin-left: auto; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 0 14px; height: 40px;
  background: rgba(255,255,255,.16); color: inherit; font: inherit; font-size: .88rem; cursor: pointer; white-space: nowrap;
}
.sync-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: #9ad3a8; }
.sync-chip.warn .dot { background: #f5c26b; }
.sync-chip.bad .dot { background: #ff8f84; }
.sync-chip.busy .dot { animation: pulse 1s infinite alternate; }
.sync-chip.stale .dot { background: #e5261b; box-shadow: 0 0 0 3px rgba(229,38,27,.35); animation: stalepulse .9s steps(2, start) infinite; }
.sync-chip.stale .label { color: #ffb4ad; font-weight: 650; }
@keyframes stalepulse { 50% { opacity: .15; } }
@keyframes pulse { to { opacity: .3; } }
/* Farm map: satellite photo with the panel beside it (under it on phones) */
.fm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.fm-wrap { position: relative; height: min(70vh, 640px); border-radius: 12px; overflow: hidden; background: #2a2e33; }
.fm-wrap > .fm-map { position: absolute; inset: 0; } /* beats maplibre-gl.css (.maplibregl-map is position: relative) */
.fm-map > .empty { color: #fff; padding: 24px; }
/* Scale box (2.38): live weight from a connected scale */
.animal-crumb { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.animal-steps { display: inline-flex; align-items: center; gap: 8px; }
.scale-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.scale-on { display: none; align-items: center; gap: 10px; flex-wrap: wrap; }
.scale-bar.on .scale-on { display: flex; }
.scale-live { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 6.5ch; padding: 2px 10px; border-radius: 10px; background: var(--surface-2); border: 2px solid var(--soon, #e6a100); }
.scale-live.steady { border-color: var(--ok, #2e9e5b); }
.scale-auto { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.scale-note { font-size: .85rem; }
.scale-rawbox { flex-basis: 100%; font-size: .85rem; }
.scale-raw { margin: 4px 0 0; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); font-family: ui-monospace, Consolas, monospace; white-space: pre-wrap; }
/* Big zoom buttons and the Fine adjust box (2.46) */
.fm-zoom { position: absolute; z-index: 3; right: 10px; top: 10px; display: grid; gap: 8px; }
.fm-zoom-btn { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.7rem; font-weight: 700; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer; }
.fm-zoom-btn:active { background: var(--accent-soft); }
.fm-fine { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.fm-fine-h { margin: 0 0 4px; font-size: .95rem; }
.fm-pad { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; justify-content: center; margin: 8px 0; }
.fm-nudge { min-height: 48px; font-size: 1.2rem; padding: 0; }
/* While marking, the map shows the plain arrow pointer instead of the hand (Bobby, 2.47) */
.fm-drawing .maplibregl-canvas-container.maplibregl-interactive, .fm-drawing .maplibregl-canvas-container.maplibregl-interactive:active, .fm-drawing .maplibregl-canvas { cursor: default !important; }
.fm-side { display: grid; gap: 12px; align-content: start; }
.fm-add { display: grid; gap: 10px; }
.fm-add-title { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fm-add-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fm-add-btn { display: flex; align-items: center; gap: 8px; min-height: var(--tap, 40px); padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.fm-add-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.fm-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); }
.fm-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fm-size { font-size: 1.6rem; font-weight: 800; margin: 6px 0; }
.fm-label { pointer-events: none; color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; }
.fm-label.farm { font-size: 14px; color: #ffe066; }
.fm-list { display: grid; gap: 10px; }
.fm-group { display: grid; gap: 2px; }
.fm-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; }
.fm-row:hover, .fm-row.on { background: var(--accent-soft); }
@media (max-width: 900px) { .fm-layout { grid-template-columns: minmax(0, 1fr); } .fm-wrap { height: 60vh; } }
/* The version, next to the name; amber when the server and the page don't match. */
.ver-chip { flex: none; font-size: .78rem; font-weight: 650; white-space: nowrap; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.16); }
.ver-chip.warn { background: #f5c26b; color: #2b2100; cursor: pointer; }
/* Trial / code days left (1.70) */
.lic-chip { cursor: pointer; }
.lic-chip.bad { background: #d9534f; color: #fff; }
.locked { max-width: 640px; margin: 24px auto; }
.locked h1 { margin-top: 0; }
.stack-sm { display: grid; gap: 8px; margin: 10px 0; }
.code-box { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.farm-id { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; }
@media (max-width: 600px) { .topbar .brand-text, .ver-more { display: none; } }

.sidenav { background: var(--surface); border-right: 1px solid var(--line); padding: 10px 8px; position: sticky; top: var(--top-h, 60px); height: calc(100vh - var(--top-h, 60px)); overflow-y: auto; }
.sidenav a {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 550;
}
.sidenav a:hover { background: var(--surface-2); }
.sidenav a.on { background: var(--accent-soft); color: var(--accent); }
/* Menu width handle and Expand / Collapse all (1.99) */
.nav-resize { position: fixed; top: var(--top-h, 60px); bottom: 0; left: calc(var(--nav-w) - 4px); width: 8px; cursor: col-resize; z-index: 30; touch-action: none; }
.nav-resize:hover, .nav-resize.on, .nav-resize:focus-visible { background: var(--accent); opacity: .35; outline: none; }
.nav-foldall { display: flex; gap: 6px; margin: 0 6px 8px; }
.nav-foldall button { flex: 1; border: 1px solid var(--line); background: var(--surface-2, var(--surface)); color: var(--muted); border-radius: 8px; padding: 6px 4px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.nav-foldall button:hover { color: var(--ink); border-color: var(--accent); }
/* Owner picker (1.86) */
.nav-owner { display: grid; gap: 4px; margin: 2px 6px 10px; padding: 6px 6px; border: 1px solid var(--line); border-radius: var(--radius); font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.nav-owner select { width: 100%; min-width: 0; padding-left: 6px; padding-right: 4px; text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 600; color: var(--ink); }
.nav-owner.picked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.nav-owner .pick-many > summary { max-width: none; text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 600; }
.nav-owner .pick-many-list { position: static; min-width: 0; max-height: none; margin-top: 4px; box-shadow: none; text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 600; color: var(--ink); }
.owner-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 8px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); }
.owner-bar .btn { margin-left: auto; }
.nav-version { margin: 14px 12px 4px; color: var(--muted); font-size: .8rem; }
.sidenav .badge { margin-left: auto; background: var(--due); color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 8px; font-weight: 700; }
.sidenav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 4px; }
/* menu sections, one per part of the farm; the heading folds the section */
.nav-sec { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 6px; padding: 10px 12px 4px; border: 0; background: none; color: var(--muted);
  font: inherit; font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; cursor: pointer; }
.nav-sec:hover { color: var(--ink); }
.feat-label .pill { margin-left: 8px; vertical-align: middle; font-size: .72rem; }
.planned-list { margin: 0; padding-left: 20px; line-height: 1.7; }
main { padding: 20px 24px 80px; max-width: 1280px; width: 100%; outline: none; min-width: 0; }

@media (max-width: 900px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .btn.menu-btn { display: inline-flex; }
  .brand { min-width: 0; }
  .sidenav { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); padding-top: max(10px, env(safe-area-inset-top)); }
  .sidenav.open { transform: none; }
  .nav-resize { display: none; }
  main { padding: 16px 16px 80px; }
}
@media (max-width: 600px) {
  .brand { display: none; }
  .sync-chip .label { display: none; }
}

/* ---- page parts ---- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.page-head .sub { flex-basis: 100%; color: var(--muted); margin-top: -6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: .9rem; margin-bottom: 6px; }
.crumb a { text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--due); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(127,127,127,.12); }
.btn.icon { padding: 0; width: var(--tap); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: .92rem; }
.btn:disabled { opacity: .5; cursor: default; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
@media (max-width: 500px) { .grid, .grid.two { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); } /* charts and wide tables shrink with the page */

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-align: left; font: inherit; color: inherit; box-shadow: var(--shadow); }
button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--accent); }
.stat { position: relative; padding-right: 56px; }
.stat-ic { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.stat-ic .ic { width: 20px; height: 20px; }
.stat-v { font-size: 1.8rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-l { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.stat-s { font-size: .82rem; color: var(--muted); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 650; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.due { background: var(--due-soft); color: var(--due); border-color: transparent; }
.pill.soon { background: var(--soon-soft); color: var(--soon); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* One line a row (2.15): long text is cut with … (whole text on hover / long-press). */
td { white-space: nowrap; }
td.clip { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
td.clip > * { white-space: nowrap; }
@media (max-width: 600px) { th, td { padding: 6px 6px; } td.clip { max-width: 130px; } }
th { font-size: .85rem; color: var(--muted); font-weight: 650; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
td.num, th.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters select, .filters input { min-height: 44px; }
/* Tick lists for several farms or owners (2.26) */
.pick-many { position: relative; }
.pick-many > summary { list-style: none; display: flex; align-items: center; min-height: 44px; padding: 6px 30px 6px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; position: relative; }
.pick-many > summary::-webkit-details-marker { display: none; }
.pick-many > summary::after { content: '▾'; position: absolute; right: 10px; color: var(--muted); }
.pick-many.on > summary { border-color: var(--accent); background: var(--accent-soft); }
.pick-many-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 220px; max-height: 340px; overflow-y: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.pick-many-list .btn { margin: 4px 6px; }
:root:not([data-size="roomy"]) .pick-many > summary { min-height: 36px; padding: 4px 28px 4px 10px; }

/* ---- forms ---- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  min-height: var(--tap); padding: 8px 12px; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--accent); }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.form-h { grid-column: 1 / -1; margin-top: 8px; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label { font-weight: 600; font-size: .92rem; }
.field.check { justify-content: flex-end; }
.field.check label { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 600; }
.field .help { font-size: .85rem; color: var(--muted); }
.req { color: var(--due); }
.shares { display: grid; gap: 8px; margin-bottom: 6px; }
.share-row { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; align-items: center; }
.share-row .pct { display: flex; align-items: center; gap: 4px; }
.multi-wrap { border: 1px solid var(--line); border-radius: 8px; }
.multi-tools { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.multi-tools input { flex: 1; min-width: 140px; }
.multi { max-height: 300px; overflow-y: auto; padding: 4px; }
.multi-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border-radius: 6px; cursor: pointer; }
.multi-row:hover { background: var(--surface-2); }
.multi-row small { margin-left: auto; }
.cost-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; margin-bottom: 8px; }
.line-row { display: grid; grid-template-columns: 1fr 120px 140px auto; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 600px) { .line-row { grid-template-columns: 1fr 1fr; } .share-row { grid-template-columns: 1fr 100px auto; } }

/* ---- sheets ---- */
.scrim { position: fixed; inset: 0; background: rgba(10,14,12,.5); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; opacity: 0; transition: opacity .15s; }
.scrim.show { opacity: 1; }
.sheet { background: var(--surface); border-radius: 14px; width: min(720px, 100%); max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.sheet.wide { width: min(1000px, 100%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 16px 20px; overflow-y: auto; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet-error { width: 100%; color: var(--due); font-weight: 650; }
.signin-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin: 12px 16px 0; padding: 10px 14px; border-radius: 10px; background: var(--soon-soft); color: var(--ink); }
.signin-banner[hidden] { display: none; }
@media (max-width: 600px) { .scrim { padding: 0; align-items: flex-end; } .sheet { border-radius: 14px 14px 0 0; max-height: 94%; } }
/* Tablets: start the window near the top, so the keyboard never covers its Save button (2.34) */
@media (min-width: 601px) and (max-width: 1300px) { .scrim { align-items: flex-start; padding-top: 10px; } .sheet { max-height: calc(100% - 10px); } }

.toast-wrap, #toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; opacity: 0; transform: translateY(10px); transition: all .2s; max-width: 90vw; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: var(--due); color: #fff; }
.toast { display: flex; align-items: center; gap: 14px; }
.show-pw { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; cursor: pointer; }
.toast-act { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 8px; padding: 6px 14px; font: inherit; font-weight: 650; cursor: pointer; }

/* ---- domain bits ---- */
.animal-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.animal-photo { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: none; }
.animal-photo .ic { width: 48px; height: 48px; }
.animal-photo.add { cursor: pointer; border-style: dashed; font: inherit; font-size: .85rem; align-content: center; gap: 4px; }
.animal-photo.add .ic { width: 36px; height: 36px; }
.row-photo { display: block; width: 160px; height: 120px; margin: 2px 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.row-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tagline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.more-grid .btn { justify-content: flex-start; }
.big-answer { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 16px 0; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: var(--tap); padding: 0 14px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .d { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; }
.timeline .t { font-weight: 650; }
.timeline .x { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li a { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.alert-list li a:hover { background: var(--surface-2); }
.alert-list .bar { width: 5px; align-self: stretch; border-radius: 3px; background: var(--info); flex: none; }
.alert-list .due .bar { background: var(--due); }
.alert-list .soon .bar { background: var(--soon); }
.alert-ic { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--info-soft); color: var(--info); }
.alert-ic .ic { width: 18px; height: 18px; }
.alert-list .due .alert-ic { background: var(--due-soft); color: var(--due); }
.alert-list .soon .alert-ic { background: var(--soon-soft); color: var(--soon); }
.alert-list .t { font-weight: 650; }
.alert-list .x { color: var(--muted); font-size: .9rem; }
.why { display: flex; flex-wrap: wrap; gap: 4px; }
/* charts (chart.js): reference palette slots 1-3 (validated together), stepped for each theme */
.viz { margin: 0; --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; --viz-5: #e87ba4; --viz-surface: var(--surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .viz { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-5: #d55181; } }
:root[data-theme="dark"] .viz { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-5: #d55181; }
/* Herd mix (2.7) */
.herd-mix { display: grid; gap: 12px; }
.mix-bar { display: flex; gap: 2px; height: 26px; border-radius: 4px; overflow: hidden; background: var(--viz-surface); }
.mix-seg { border: 0; padding: 0; min-width: 6px; cursor: pointer; }
.mix-seg:hover, .mix-seg:focus-visible { filter: brightness(1.08); outline: 2px solid var(--ink); outline-offset: -2px; }
.mix-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mix-legend button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.mix-legend button:hover span:nth-child(2) { text-decoration: underline; }
.mix-sw { width: 12px; height: 12px; border-radius: 3px; }
/* Voice (2.9) */
.voice-box { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 8px 0; }
.voice-dot { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); animation: voicePulse 1.2s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { transform: scale(.85); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .voice-dot { animation: none; } }
.voice-meter { width: 220px; max-width: 80%; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.voice-meter > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .05s; }
.voice-heard { font-size: 1.3rem; font-weight: 700; min-height: 1.6em; }
.voice-help { margin: 0; padding-left: 18px; line-height: 1.8; }
/* Machine page header (2.8) */
.mach-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 16px; }
.mach-pic img { width: 170px; max-height: 200px; object-fit: contain; display: block; }
.mach-id { font-weight: 700; margin-bottom: 10px; }
.mg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); border-top: 4px solid var(--accent); }
.mg.ok { border-top-color: var(--ok); } .mg.soon { border-top-color: var(--soon); } .mg.due { border-top-color: var(--due); }
.mg-top { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.mg-top .ic { width: 16px; height: 16px; color: var(--accent); }
.mg-v { font-size: 1.6rem; font-weight: 800; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mg-s { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.mg-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.mg-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.mg-bar.ok > span { background: var(--ok); } .mg-bar.soon > span { background: var(--soon); } .mg-bar.due > span { background: var(--due); }
.due-cell { min-width: 150px; } .due-cell .mg-bar { height: 6px; margin-top: 4px; }
.mach-where { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: .9rem; }
.mach-where .ic { width: 16px; height: 16px; }
@media (max-width: 600px) { .mach-top { grid-template-columns: minmax(0, 1fr); } .mach-pic img { width: 140px; max-height: 150px; margin: 0 auto; } }
/* Machine pictures and hay gauges (2.7) */
.mach-hero { float: right; margin: 0 0 8px 16px; }
.mach-hero img { max-height: 170px; max-width: 200px; object-fit: contain; }
.mach-thumb { width: 44px; height: 44px; object-fit: contain; display: block; }
.mach-thumb.none { border-radius: 8px; background: var(--surface-2, var(--line)); }
.hay-ic { color: var(--muted); margin-right: 6px; }
.hay-gauge { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 2px 0 8px; }
.hay-gauge > span { display: block; height: 100%; background: var(--ok); }
.hay-num.soon .hay-gauge > span { background: var(--soon); } .hay-num.due .hay-gauge > span { background: var(--due); }
@media (max-width: 600px) { .mach-hero { float: none; margin: 0 0 8px; } .mach-hero img { max-height: 140px; } }
.viz figcaption { margin-bottom: 6px; }
.viz-title { font-weight: 650; }
.viz-sub { color: var(--muted); font-size: .85rem; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; color: var(--muted); font-size: .85rem; }
.viz .key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 6px; }
.viz-plot { position: relative; touch-action: pan-y; border-radius: 6px; }
.viz-plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.viz-plot svg { display: block; }
.viz-plot .grid { stroke: var(--line); stroke-width: 1; }
.viz-plot .tick { fill: var(--muted); font-size: 11px; }
.viz-plot .end { fill: var(--ink); font-size: 12px; font-weight: 600; }
.viz-plot .cross { stroke: var(--muted); stroke-width: 1; }
.viz-tip { position: absolute; top: 2px; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: .85rem; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.viz-tip-h { color: var(--muted); margin-bottom: 2px; }
.viz-tip .row strong { margin-right: 6px; }
.viz-tip .row span { color: var(--muted); }
.viz-tip-x { color: var(--muted); font-size: .8rem; white-space: normal; width: max-content; max-width: 260px; margin-top: 2px; }
/* forecasting: sales-a-year buttons and the pickable comparison rows */
.seg { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg-label { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-size: .9rem; border-right: 1px solid var(--line); }
.seg button { min-height: var(--tap); min-width: 52px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.pick-rows tr.on td { background: var(--accent-soft); }
.pick-rows tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* breeding: a summary box that is filtering the table below */
button.stat.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.scroll-target { scroll-margin-top: 72px; }
.usda-key { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.usda-key input { flex: 1 1 220px; width: auto; }
.usda-saved { margin: 6px 0; }
.usda-saved summary { cursor: pointer; }
/* Norwood Farms branding: the NF tag on a white tile, farm name over HerdBook */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 36px; height: 36px; border-radius: 8px; background: #fff; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
#brandFarm { font-size: .78rem; font-weight: 650; letter-spacing: .03em; opacity: .92; }
#brandFarm:empty { display: none; }
.brand-app { font-size: 1.15rem; }
/* health: who's had which shots */
.vx-sum { margin: 0 0 14px; padding-left: 20px; line-height: 1.6; }
.vx-cell > div { white-space: nowrap; }
.vx-cell .pill { margin-top: 3px; }
.vx-ok { color: var(--ok); font-weight: 800; }
.vx-late { color: var(--due); font-weight: 650; }
.vx-all { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
/* reports page groups */
.report-group { margin-bottom: 24px; }
.report-group > h2 { margin: 0 0 10px; }
/* forecasting's section tabs are links */
.tabs a { display: flex; align-items: center; min-height: var(--tap); padding: 0 14px; border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 650; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.viz-table summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-top: 6px; }
a.pill { text-decoration: none; color: inherit; }
.price-grid { width: 100%; border-collapse: collapse; }
.price-grid th, .price-grid td { padding: 4px 6px; }
.price-grid input { width: 100%; }
.alert-list li a > div { flex: 1; min-width: 0; }
.alert-list .where { display: flex; align-items: center; gap: 4px; max-width: 45%; color: var(--muted); font-size: .85rem; text-align: right; }
.alert-list .where .ic { width: 16px; height: 16px; flex: none; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; aspect-ratio: 1; padding: 0; font: inherit; color: inherit; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .cap { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; font-size: .78rem; padding: 14px 8px 6px; text-align: left; }
.photo.doc { display: grid; place-items: center; text-align: center; padding: 8px; }
.photo.doc .ic { width: 40px; height: 40px; color: var(--muted); }
.viewer img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 8px; }
/* Photo viewer that zooms (2.79) */
.zoom-wrap { position: relative; }
.zoom-box { overflow: hidden; height: min(72vh, 760px); display: grid; place-items: center; background: var(--surface-2); border-radius: 8px; touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; outline-offset: 2px; }
.zoom-box.zoomed { cursor: grab; }
.viewer .zoom-box img { max-width: 100%; max-height: 100%; width: auto; height: auto; margin: 0; border-radius: 0; transform-origin: center; will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.zoom-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.zoom-tools .btn.on { background: var(--accent); color: var(--accent-ink); }
.zoom-tools .btn { min-width: 40px; background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 56px; gap: 10px; align-items: center; margin: 6px 0; font-size: .95rem; }
.bar-row .track { display: block; height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.bar-row .fill { display: block; height: 100%; background: var(--accent); border-radius: 7px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.map-wrap { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); touch-action: manipulation; }
.map-wrap img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.map-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-wrap polygon { fill: rgba(63,122,77,.28); stroke: #fff; stroke-width: .4; cursor: pointer; vector-effect: non-scaling-stroke; }
.map-wrap polygon.sel { fill: rgba(240,179,87,.4); }
.map-wrap .lbl { font-size: 2.6px; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.7); stroke-width: .5px; font-weight: 700; pointer-events: none; }
.map-pt { position: absolute; transform: translate(-50%, -50%); background: var(--surface); color: var(--ink); border: 2px solid var(--accent); border-radius: 999px; padding: 2px 8px; font-size: .78rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.map-hint { padding: 8px 12px; background: var(--soon-soft); color: var(--soon); border-radius: 8px; margin-bottom: 10px; font-weight: 600; }

.scan-video { width: 100%; max-height: 60vh; background: #000; border-radius: 10px; }
.welcome { max-width: 560px; margin: 6vh auto; }
.welcome .card { padding: 24px; }
.list-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.list-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.list-card:hover { border-color: var(--accent); }
.list-card .t { font-weight: 700; font-size: 1.05rem; }
.list-card .x { color: var(--muted); font-size: .92rem; margin-top: 4px; }
/* Farms & fields: each farm a bucket of its fields; drag fields between them (1.64) */
.bucket-help { margin: -4px 0 10px; }
.farm-buckets { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.farm-bucket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); min-width: 0; transition: border-color .12s, background .12s; user-select: none; -webkit-user-select: none; }
.farm-bucket.drop-on { border-color: var(--accent); background: var(--accent-soft); }
.farm-bucket.new-farm { border-style: dashed; box-shadow: none; background: transparent; display: flex; align-items: center; justify-content: center; min-height: 90px; }
.farm-bucket.new-farm.drop-on { background: var(--accent-soft); }
.bucket-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 4px 6px 6px; text-decoration: none; color: inherit; border-radius: 8px; }
.bucket-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.bucket-head .t { font-weight: 700; font-size: 1.08rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bucket-head .x { color: var(--muted); font-size: .9rem; font-weight: 400; }
.bucket-head .x.land { grid-column: 2; }
.bucket-num { min-width: 0; }
.bucket-num strong { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bucket-bar { height: 6px; margin: 4px 6px 10px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bucket-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bucket-fields { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px; }
.field-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 600; min-height: 40px; }
.field-chip:hover, .bucket-head:hover { border-color: var(--accent); }
.field-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-chip .x { color: var(--muted); font-weight: 400; font-size: .85rem; white-space: nowrap; }
.field-chip .grip { color: var(--muted); font-size: .9rem; line-height: 1; }
.drag { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.drag.dragging { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: .92; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: grabbing; background: var(--surface); border-radius: 999px; }
a.bucket-head.drag-ghost { border-radius: 10px; border: 2px solid var(--accent); }
/* Fields as rows under each farm (2.30); dashed while rearranging */
.field-rows { display: grid; gap: 4px; padding: 0 2px 2px; }
.field-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.field-row:hover { border-color: var(--accent); }
.field-row > .ic { width: 18px; height: 18px; color: var(--accent); }
.field-row .nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-row .x { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.field-row .grip { color: var(--muted); }
.field-rows > .btn { justify-self: start; }
.arranging .farm-bucket { border-style: dashed; border-width: 2px; }
.arranging .field-row { background: var(--surface); border: 1px dashed var(--line); }
.arranging .bucket-head { cursor: grab; }
.bucket-empty { color: var(--muted); font-size: .92rem; padding: 6px; text-align: center; }
.sel-bar { position: sticky; bottom: 12px; display: flex; gap: 8px; align-items: center; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 8px 8px 8px 16px; margin-top: 12px; flex-wrap: wrap; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.sel-bar .btn { background: transparent; color: inherit; border-color: rgba(255,255,255,.3); }
.sel-bar .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
/* Selling: farm and field buttons, and the tick tools (2.88) */
.place-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.chip small { padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.chip.farm { font-weight: 700; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.on small { background: rgba(255,255,255,.25); color: inherit; }
.sel-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.sel-slot { position: sticky; bottom: 12px; z-index: 5; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history .when { font-size: .85rem; color: var(--muted); }
.history .what, .history .when { grid-column: 1; }
.history li > .btn { grid-column: 2; grid-row: 1 / span 2; }
.sel-slot > .sel-bar { position: static; }
.inline-pick { width: auto; min-height: 0; padding: 2px 6px; font-size: .85rem; }
label.pick { display: flex; align-items: center; justify-content: center; margin: -8px; padding: 8px; cursor: pointer; }
.callout { padding: 12px 14px; border-radius: 8px; background: var(--info-soft); color: var(--ink); margin: 10px 0; }
.callout.warn { background: var(--soon-soft); }
.callout.bad { background: var(--due-soft); }
.split { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }

/* ---- print (reports) ---- */
/* ---- Compact screen size (2.17, Bobby: "make everything smaller to better fit on a tablet") ----
   The default. Settings > Display > Screen size "Roomy" (html[data-size="roomy"]) keeps the bigger glove-friendly sizes.
   The chute and Feed hay keep their big buttons either way. */
:root:not([data-size="roomy"]) { --tap: 40px; --radius: 8px; --top-h: 52px; }
:root:not([data-size="roomy"]) body { font-size: 15px; line-height: 1.4; }
:root:not([data-size="roomy"]) h1 { font-size: 1.35rem; }
:root:not([data-size="roomy"]) h2 { font-size: 1.05rem; }
:root:not([data-size="roomy"]) .ic { width: 19px; height: 19px; }
:root:not([data-size="roomy"]) .topbar { padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); gap: 8px; }
:root:not([data-size="roomy"]) .brand { font-size: 1.05rem; }
:root:not([data-size="roomy"]) .search input { height: 36px; }
:root:not([data-size="roomy"]) .sidenav { padding: 8px 6px; }
:root:not([data-size="roomy"]) .sidenav a { min-height: 36px; gap: 10px; padding: 0 10px; }
:root:not([data-size="roomy"]) .nav-sec { padding: 8px 10px 3px; margin-top: 4px; }
:root:not([data-size="roomy"]) main { padding: 14px 18px 60px; }
:root:not([data-size="roomy"]) .page-head { gap: 8px; margin-bottom: 10px; }
:root:not([data-size="roomy"]) .page-head .sub { margin-top: -4px; font-size: .92rem; }
:root:not([data-size="roomy"]) .owner-bar { padding: 5px 10px; margin-bottom: 10px; }
:root:not([data-size="roomy"]) .btn { padding: 0 14px; gap: 6px; }
:root:not([data-size="roomy"]) .btn.icon { padding: 0; }
:root:not([data-size="roomy"]) .btn.small { min-height: 32px; padding: 0 10px; font-size: .88rem; }
:root:not([data-size="roomy"]) .card { padding: 12px; }
:root:not([data-size="roomy"]) .card-head { margin-bottom: 8px; }
:root:not([data-size="roomy"]) .grid { gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
:root:not([data-size="roomy"]) .grid.two { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
:root:not([data-size="roomy"]) .stack { gap: 12px; }
:root:not([data-size="roomy"]) .stats { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); margin-bottom: 12px; }
:root:not([data-size="roomy"]) .stat { padding: 9px 44px 9px 12px; }
:root:not([data-size="roomy"]) .stat-ic { top: 9px; right: 9px; width: 28px; height: 28px; border-radius: 8px; }
:root:not([data-size="roomy"]) .stat-ic .ic { width: 16px; height: 16px; }
:root:not([data-size="roomy"]) .stat-v { font-size: 1.4rem; }
:root:not([data-size="roomy"]) .stat-l { font-size: .82rem; }
:root:not([data-size="roomy"]) .pill { padding: 1px 8px; font-size: .78rem; }
:root:not([data-size="roomy"]) .kv { gap: 4px 12px; }
:root:not([data-size="roomy"]) th, :root:not([data-size="roomy"]) td { padding: 5px 7px; }
:root:not([data-size="roomy"]) th { font-size: .8rem; }
:root:not([data-size="roomy"]) .filters { gap: 6px; margin-bottom: 10px; }
:root:not([data-size="roomy"]) .filters select, :root:not([data-size="roomy"]) .filters input { min-height: 36px; padding: 4px 8px; }
:root:not([data-size="roomy"]) input, :root:not([data-size="roomy"]) select, :root:not([data-size="roomy"]) textarea { padding: 6px 10px; }
:root:not([data-size="roomy"]) input[type=checkbox] { width: 20px; height: 20px; padding: 0; }
:root:not([data-size="roomy"]) .form { gap: 10px 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
:root:not([data-size="roomy"]) .multi-row { min-height: 36px; }
:root:not([data-size="roomy"]) .sheet-head { padding: 6px 8px 6px 16px; }
:root:not([data-size="roomy"]) .sheet-body { padding: 12px 16px; }
:root:not([data-size="roomy"]) .sheet-foot { padding: 8px 16px; }
:root:not([data-size="roomy"]) .mg-v { font-size: 1.35rem; }
:root:not([data-size="roomy"]) .hay-n { font-size: 2.1rem; }
:root:not([data-size="roomy"]) .tank-v { font-size: 1.5rem; }
:root:not([data-size="roomy"]) .list-card .t, :root:not([data-size="roomy"]) .bucket-head .t { font-size: 1rem; }
:root:not([data-size="roomy"]) .alert-list .x { font-size: .85rem; }
/* Phones: the top bar shows just the logo, and the version and trial pills only when they're warning (the menu shows the version). */
@media (max-width: 600px) {
  .topbar .brand { display: flex; flex: none; min-width: 0; }
  .topbar .ver-chip:not(.warn):not(.bad) { display: none; }
}

@media print {
  .topbar, .sidenav, .actions, .quick, .tabs, .filters, .no-print, #toasts { display: none !important; }
  #app { display: block; }
  main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { box-shadow: none; border: 0; padding: 0; }
  th, td { padding: 4px 6px; }
  td, td.clip { white-space: normal; max-width: none; overflow: visible; }
  .table-wrap { overflow: visible; }
}

/* ---- admin › features ---- */
.feature-grid { columns: 2 340px; column-gap: 16px; }
.feature-grid > .card { break-inside: avoid; margin-bottom: 16px; }
.feat-row label { display: flex; gap: 12px; align-items: flex-start; min-height: var(--tap); padding: 10px 4px; cursor: pointer; }
.feat-row input[type=checkbox] { margin-top: 1px; flex: none; }
.feat-row + .feat-row { border-top: 1px solid var(--line); }
.feat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feat-label { font-weight: 600; }
.feat-label.top { font-weight: 750; font-size: 1.05rem; }
.feat-text small { color: var(--muted); font-size: .85rem; }
.feat-row.is-off .feat-label { color: var(--muted); }
.feat-text small.feat-why { color: var(--soon); font-weight: 600; }
.line-row.no-weight { grid-template-columns: 1fr 140px auto; }
@media (max-width: 600px) { .line-row.no-weight { grid-template-columns: 1fr 1fr; } }
.photo.pending { cursor: default; border-style: dashed; border-color: var(--accent); }
.photo.pending .btn { position: absolute; top: 4px; right: 4px; background: var(--surface); }
.photo.pending.doc > div { padding: 8px; }
.tax-table td.amt, .tax-table th.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tax-table tr.total td { font-weight: 750; border-top: 2px solid var(--ink); }
.tax-table td.line { color: var(--muted); white-space: nowrap; width: 3.5em; }

/* ---- work cattle (chute side) ---- */
.shot-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.shot-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.shot-head { display: flex; align-items: center; gap: 8px; }
.shot-name { flex: 1 1 auto; font-size: 1.05em; }
.shot-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.shot-body[hidden] { display: none; }
.shot-body > * { flex: 1 1 110px; width: auto; min-width: 0; }
.shot-body > input[list] { flex: 3 1 220px; }
.shot-body > .btn { flex: none; }
.shot-body > .shot-weeks { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; font-size: .92rem; color: var(--muted); }
.shot-weeks input { width: 72px; flex: none; }
.chute-tag { font-size: 1.6rem; font-weight: 700; min-height: 60px; }
.chute-found { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chute-chip { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: var(--tap); min-width: 96px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.chute-chip:hover { border-color: var(--accent); }
.chute-chip small { color: var(--muted); font-size: .8rem; }
.chute-chip.done { opacity: .6; }
.chute-animal { border: 2px solid var(--accent); display: grid; gap: 10px; scroll-margin-top: 72px; }
.chute-name { font-size: 1.8rem; }
.chute-ticks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.chute-tick { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.chute-tick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chute-tick input { width: 28px; height: 28px; flex: none; }
.chute-tick span { display: flex; flex-direction: column; min-width: 0; }
.chute-tick small { color: var(--muted); font-size: .82rem; }
.chute-tick > span { align-items: flex-start; text-align: left; gap: 2px; }
.chute-tick .chute-tick-t { display: flex; flex-direction: row; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.chute-tick-t strong { font-size: 1.05rem; }
.chute-weight { display: flex; gap: 8px; }
.chute-weight input { max-width: 160px; font-size: 1.3rem; font-weight: 700; }
.chute-weight select { width: auto; }
.chute-go { display: flex; gap: 8px; flex-wrap: wrap; }
/* Scale, Camera and Tag boxes at the chute (1.93) */
.chute-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 8px; }
.chute-box-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.chute-box-h strong { font-size: 1.05rem; }
.chute-scale { align-items: center; }
.chute-scale input { max-width: 200px; font-size: 2rem; min-height: 60px; text-align: right; }
.chute-lb { font-size: 1.3rem; font-weight: 700; color: var(--muted); }
.chute-gain:empty { display: none; }
.chute-photos { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.chute-photos:empty { display: none; }
.chute-go .btn.primary { flex: 1 1 220px; min-height: 60px; font-size: 1.15rem; }
.chute-go a.btn { text-decoration: none; }
.chute-done { list-style: none; margin: 0; padding: 0; }
.chute-done li { display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.chute-done li:last-child { border-bottom: 0; }
.btn.spin .ic { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Accounts: the parts of the app a person may open */
.part-picks { display: grid; gap: 8px; }
.field .part-pick { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer; }
.part-pick input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
/* Equipment: service due list with a Done button on each row */
.svc-due li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.svc-due li a { flex: 1; min-width: 0; border-bottom: 0; }
.svc-due li .btn { flex: none; margin-right: 4px; }
/* Expenses: every saved receipt as a picture, with its expense under it (1.68) */
.receipt-wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.receipt-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.receipt-cap { text-align: left; background: none; border: 0; padding: 2px; color: var(--ink); font: inherit; font-size: .85rem; line-height: 1.3; cursor: pointer; overflow-wrap: anywhere; }
.receipt-cap:hover { color: var(--accent); }
/* Import animals (1.69): the three steps, and matching columns */
.steps { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 14px; padding: 0; color: var(--muted); font-weight: 600; }
.steps li.on { color: var(--accent); border-bottom: 3px solid var(--accent); }
.match-grid { display: grid; gap: 0; }
.match-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(160px, 1.2fr) 2fr; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.match-row.set .match-l { font-weight: 700; }
.match-s { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .match-row { grid-template-columns: 1fr 1fr; } .match-s { grid-column: 1 / -1; white-space: normal; } }
/* Farm calendar (1.73): month grid on wide screens, day-by-day list on phones */
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-bar h2 { margin: 0; min-width: 170px; text-align: center; font-size: 1.25rem; }
.cal-arrow { font-size: 1.6rem; line-height: 1; padding: 2px 14px; }
.cal-others { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: .9rem; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-height: 96px; padding: 4px; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; cursor: pointer; overflow: hidden; }
.cal-day:hover { border-color: var(--accent); }
.cal-day.out { opacity: .45; }
.cal-day.today { border: 2px solid var(--accent); }
.cal-n { font-weight: 700; font-size: .85rem; }
.cal-day.today .cal-n { color: var(--accent); }
.cal-item { display: block; font-size: .74rem; line-height: 1.25; padding: 1px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--accent-soft); color: var(--ink); }
.cal-item.note { background: var(--surface-2); font-style: italic; }
.cal-item.done { text-decoration: line-through; opacity: .6; }
.cal-item.late { background: #f8d7d4; color: #5a1410; }
.cal-item.other { background: transparent; color: var(--muted); border-left: 3px solid var(--line); border-radius: 0; }
.cal-item.other.calving { border-left-color: #c2408a; } .cal-item.other.shot { border-left-color: #2b8a3e; } .cal-item.other.service { border-left-color: #b8860b; }
.cal-item.other.wean { border-left-color: #6f42c1; } .cal-item.other.rent { border-left-color: #1f5fa8; }
.cal-more { font-size: .72rem; color: var(--muted); }
.cal-list { display: none; }
.cal-lday { margin-bottom: 12px; }
.cal-ldate { display: block; width: 100%; text-align: left; font: inherit; font-weight: 700; padding: 6px 2px; background: none; border: 0; border-bottom: 2px solid var(--line); color: var(--ink); }
.cal-lday.today .cal-ldate { color: var(--accent); border-bottom-color: var(--accent); }
.cal-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; cursor: pointer; flex-wrap: wrap; }
.cal-row:hover { background: var(--surface-2); }
.cal-row input[type=checkbox] { width: 22px; height: 22px; flex: none; }
.cal-row .cal-t { flex: 1; min-width: 140px; font-weight: 600; }
.cal-row .cal-x { color: var(--muted); font-size: .85rem; font-weight: 400; }
.cal-row.done .cal-t { text-decoration: line-through; color: var(--muted); }
.cal-row.late .cal-t { color: #b42318; }
.cal-row.note .cal-t { font-weight: 400; }
.cal-row.other .cal-t { font-weight: 400; color: var(--muted); }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; margin: 0 6px; }
.cal-note-ic .ic { width: 18px; height: 18px; color: var(--muted); }
.cal-sub { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 0 2px; }
.cal-sub.due { color: #b42318; }
:root[data-theme="dark"] .cal-item.late { background: #5a1f1a; color: #ffd9d4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal-item.late { background: #5a1f1a; color: #ffd9d4; } }
@media (max-width: 700px) { .cal-grid { display: none; } .cal-list { display: block; } .cal-others { margin-left: 0; } }
/* Hay (1.76): big on-hand numbers and big feeding buttons */
.hay-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hay-num { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ok, #2b8a3e); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.hay-num.soon { border-left-color: var(--soon); } .hay-num.due { border-left-color: var(--due); }
.hay-n { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.hay-l { font-weight: 700; margin-top: 4px; }
.hay-s { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.hay-where { font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }
.hay-num .hay-n + .hay-l + .hay-s + .hay-n { margin-top: 12px; }
.hay-total { margin: 8px 0 0; }
.hay-stock { margin-top: 16px; }
.hay-stock-h { margin: 0 0 10px; font-size: 1.15rem; }
.hay-spots { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; }
.hay-spots > div { display: flex; justify-content: space-between; gap: 8px; }
.hay-feed { display: grid; gap: 12px; }
.hay-feed .field { margin: 0; }
.hay-btns { display: flex; gap: 10px; flex-wrap: wrap; }
/* Farm map search and roads (1.80) */
.fm-find { display: inline-flex; gap: 6px; align-items: center; flex: 1 1 260px; min-width: 0; }
.fm-search { flex: 1; min-width: 0; }
.fm-roads { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
/* Machine lists and checklists (2.6) */
.mach-list { margin: 0; padding-left: 20px; columns: 2 260px; line-height: 1.7; }
.part-picks.checklist { margin: 8px 0 14px; }
/* Inventory (2.0) */
.inv-btns { display: inline-flex; gap: 6px; }
.inv-take { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.inv-take-pick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inv-take-pick select { width: auto; max-width: 200px; }
@media (max-width: 600px) { .inv-take { grid-template-columns: 1fr; } }
/* Fuel (1.84): a tile per farm tank with a gauge */
.tank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tank { border: 1px solid var(--line); border-left: 6px solid var(--ok, #2e7d32); border-radius: 10px; padding: 12px; display: grid; gap: 6px; }
.tank.soon { border-left-color: var(--soon, #e0a100); } .tank.due { border-left-color: var(--due, #c62828); }
.tank-name { all: unset; cursor: pointer; font-weight: 800; font-size: 1.1rem; }
.tank-name:hover, .tank-name:focus-visible { text-decoration: underline; }
.tank-v { font-size: 1.8rem; font-weight: 800; }
.tank-bar { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.tank-bar > span { display: block; height: 100%; background: var(--ok, #2e7d32); }
.tank.soon .tank-bar > span { background: var(--soon, #e0a100); } .tank.due .tank-bar > span { background: var(--due, #c62828); }
.tank .actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* Land (1.79): picking several fields, and the fence & water walk */
.land-picks { max-height: 260px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 8px; }
.walk-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.walk-row:last-child { border-bottom: 0; }
.walk-what { flex: 1; min-width: 180px; }
.walk-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.walk-btns .btn.on.walk-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.walk-btns .btn.on.walk-soon { background: var(--soon); color: #2b2100; border-color: var(--soon); }
.walk-btns .btn.on.walk-due { background: var(--due); color: #fff; border-color: var(--due); }
/* First-time setup (1.77) */
.setup { max-width: 760px; }
.setup h2 { margin-top: 0; }
.steps .linklike { background: none; border: 0; padding: 0 0 2px; font: inherit; color: inherit; cursor: pointer; }
.setup-logo { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; border: 1px dashed var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; }
.setup-logo img { max-width: 110px; max-height: 110px; }
.setup-rows { display: grid; gap: 8px; }
.setup-row { display: flex; gap: 8px; align-items: center; }
.setup-row input { flex: 1; min-width: 0; }
.setup-row input[type=number] { flex: 0 0 110px; }
.setup-next li { margin-bottom: 8px; }
.brand-logo { object-fit: contain; }
.hay-amt { width: 96px; min-height: 64px; font-size: 1.6rem; font-weight: 800; text-align: center; }
.hay-go { min-height: 64px; font-size: 1.3rem; font-weight: 800; padding: 0 22px; flex: 1 1 200px; justify-content: center; }
.hay-plus { min-width: 84px; min-height: 64px; font-size: 1.5rem; font-weight: 800; justify-content: center; }

/* Owner app colors (2.4): the picked owner's color takes the place of the blue. */
:root[data-owner-color="red"] { --accent: #b42318; --accent-2: #d0453a; --accent-ink: #ffffff; --accent-soft: #fde8e6; }
:root[data-owner-color="orange"] { --accent: #c2560c; --accent-2: #e06d1d; --accent-ink: #ffffff; --accent-soft: #fdecdc; }
:root[data-owner-color="green"] { --accent: #2f7d4a; --accent-2: #3d9a5c; --accent-ink: #ffffff; --accent-soft: #e1f2e6; }
:root[data-owner-color="purple"] { --accent: #6b3fa0; --accent-2: #8456bf; --accent-ink: #ffffff; --accent-soft: #efe6f8; }
:root[data-owner-color="brown"] { --accent: #7a4a22; --accent-2: #96602f; --accent-ink: #ffffff; --accent-soft: #f3e9df; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-owner-color="red"] { --accent: #ff8a7f; --accent-2: #ffa79f; --accent-ink: #2a0d0a; --accent-soft: #3d1f1c; }
  :root:not([data-theme="light"])[data-owner-color="orange"] { --accent: #f5a35c; --accent-2: #f8b97f; --accent-ink: #2a1505; --accent-soft: #3a2a16; }
  :root:not([data-theme="light"])[data-owner-color="green"] { --accent: #79c58f; --accent-2: #96d4a8; --accent-ink: #0c2214; --accent-soft: #1d3324; }
  :root:not([data-theme="light"])[data-owner-color="purple"] { --accent: #b99be6; --accent-2: #cbb3ee; --accent-ink: #1c1030; --accent-soft: #2c2140; }
  :root:not([data-theme="light"])[data-owner-color="brown"] { --accent: #d2a47a; --accent-2: #dfb994; --accent-ink: #24170b; --accent-soft: #3a2b1d; }
}
:root[data-theme="dark"][data-owner-color="red"] { --accent: #ff8a7f; --accent-2: #ffa79f; --accent-ink: #2a0d0a; --accent-soft: #3d1f1c; }
:root[data-theme="dark"][data-owner-color="orange"] { --accent: #f5a35c; --accent-2: #f8b97f; --accent-ink: #2a1505; --accent-soft: #3a2a16; }
:root[data-theme="dark"][data-owner-color="green"] { --accent: #79c58f; --accent-2: #96d4a8; --accent-ink: #0c2214; --accent-soft: #1d3324; }
:root[data-theme="dark"][data-owner-color="purple"] { --accent: #b99be6; --accent-2: #cbb3ee; --accent-ink: #1c1030; --accent-soft: #2c2140; }
:root[data-theme="dark"][data-owner-color="brown"] { --accent: #d2a47a; --accent-2: #dfb994; --accent-ink: #24170b; --accent-soft: #3a2b1d; }

/* Uploads page (2.51) */
.upload-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.upload-pic { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; flex: none; }
.upload-fields { display: grid; gap: 6px; flex: 1; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.upload-fields label, .upload-all label { display: grid; gap: 2px; font-size: .85rem; }
.upload-name { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-all { margin-top: 12px; max-width: 420px; }
@media (max-width: 600px) { .upload-pic { width: 80px; height: 80px; } .upload-row { flex-wrap: wrap; } }
.read-box { display: grid; gap: 4px; }
.read-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .88rem; }
.inline-note { width: 100%; min-width: 160px; min-height: 0; padding: 3px 6px; font-size: .85rem; }
.ug-wrap { overflow-x: auto; margin-top: 8px; }
.ug { border-collapse: collapse; min-width: 1500px; }
.ug th { text-align: left; font-size: .8rem; padding: 4px 6px; white-space: nowrap; }
.ug td { padding: 3px 4px; vertical-align: middle; }
.ug input, .ug select { min-height: 0; padding: 4px 6px; font-size: .85rem; }
.ug-n { color: var(--muted, #888); font-size: .8rem; }
.ug-photo { display: flex; align-items: center; gap: 4px; }
.ug-photo img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.ug-defaults { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.ug-defaults label { display: grid; gap: 2px; font-size: .85rem; }
.ug-dup { border-color: #d33 !important; background: #fdecec; }
.ug-dupmsg { color: #d33; font-size: .72rem; max-width: 150px; }
.pick-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.upload-pickone { grid-column: 1 / -1; display: grid; gap: 4px; font-size: .85rem; }
.up-big { display: flex; gap: 10px; flex-wrap: wrap; }
.up-big .btn, .up-big button { min-height: 56px; font-size: 1.05rem; padding: 0 24px; }
.up-defaults { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.up-items { display: grid; gap: 14px; }
.up-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.up-pic { width: 150px; flex: none; display: grid; gap: 4px; }
.up-body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.up-wait { font-weight: 650; }
.up-list { display: grid; gap: 8px; }
.up-animal { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.up-animal.bad { border-color: #d33; }
.up-what { display: grid; gap: 4px; }
.up-btns, .up-more { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 600px) { .up-item { flex-direction: column; } .up-pic { width: 100%; } }

/* Feeding: bale dots */
.nav-where select { width: 100%; }
.views-row { margin: 0 0 10px; align-items: center; }
.chip-x { margin-left: -8px; min-height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 0 999px 999px 0; background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer; }
.fed-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.fed-dots span { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); }
/* phone: one column for cards even at compact size, charts shrink to fit (2.95) */
@media (max-width: 500px) {
  :root:not([data-size="roomy"]) .grid, :root:not([data-size="roomy"]) .grid.two { grid-template-columns: 1fr; }
  .grid > * { min-width: 0; }
  .viz-plot svg { max-width: 100%; height: auto; }
}
.pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Count cattle (2.98) */
.count-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.count-box { display: grid; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.count-name { font-weight: 800; font-size: 1.1em; }
.count-books { color: var(--muted); display: flex; gap: 8px; align-items: center; }
.count-list { display: grid; gap: 6px; }
.count-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.count-row[hidden] { display: none; }
.count-row.seen { background: var(--accent-soft); border-color: var(--accent); }
.count-row input[type=checkbox] { width: 26px; height: 26px; flex: none; }
.count-who { display: grid; flex: 1 1 auto; min-width: 0; }
.count-who small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count-acts { display: flex; gap: 6px; flex: none; }
.row-photo.none { display: inline-block; width: 44px; height: 44px; border-radius: 8px; background: var(--surface-2); flex: none; }
.count-past { display: grid; gap: 6px; }
label.field > span { font-weight: 600; font-size: .92rem; }
.acres-in { width: 5.5rem; text-align: right; }
.count-search { width: 100%; min-height: 52px; font-size: 1.2rem; }
.hay-feed > *, .count-grid > *, .count-box { min-width: 0; }
.count-box .hay-btns { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; }
.count-box .hay-btns > * { min-width: 0; width: 100%; }
.count-actions { display: grid; gap: 8px; }
.count-actions .btn { width: 100%; min-height: 52px; justify-content: center; border: 1px solid var(--line); }
.count-actions .btn.primary { border-color: var(--accent); }
.count-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.count-tools .btn { min-height: 46px; justify-content: center; border: 1px solid var(--line); }
.count-tools .btn:last-child { grid-column: 1 / -1; }
@media (max-width: 500px) { .count-row { flex-wrap: wrap; } .count-acts { width: 100%; } }

/* ---- Farm journal look, pass 1 (2.108, Bobby: "go thru all pages and make things more graphical", then Mix of the warm journal, gauges and photo-first) ----
   Warm paper colors, serif numbers and headings, and a colored chip and edge on every number tile by what it counts.
   Only colors and type here: layouts are untouched. The top bar keeps each owner's accent color. */
:root {
  --bg: #f5f0e4; --surface: #fffdf7; --surface-2: #f8f3e7; --ink: #2b2518; --muted: #6a5f49; --line: #e2d8c0;
  --due: #a63a26; --due-soft: #f8e1d9; --soon: #8f5a0a; --soon-soft: #faecd0; --info: #2e5f7a; --info-soft: #e0ecee;
  --ok: #3d7a28; --ok-soft: #e3efd6;
  --shadow: 0 1px 2px rgba(70,50,20,.06), 0 2px 8px rgba(70,50,20,.05);
  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130e; --surface: #1e1b14; --surface-2: #26221a; --ink: #ece6d6; --muted: #aea28a; --line: #3a3426;
    --due: #ff9a85; --due-soft: #402018; --soon: #f0b357; --soon-soft: #3a2c16; --info: #86b8c8; --info-soft: #1b2e35;
    --ok: #8ccf72; --ok-soft: #1f3319;
  }
}
:root[data-theme="dark"] {
  --bg: #15130e; --surface: #1e1b14; --surface-2: #26221a; --ink: #ece6d6; --muted: #aea28a; --line: #3a3426;
  --due: #ff9a85; --due-soft: #402018; --soon: #f0b357; --soon-soft: #3a2c16; --info: #86b8c8; --info-soft: #1b2e35;
  --ok: #8ccf72; --ok-soft: #1f3319;
}
h1, .stat-v, .card-head h2, .card > h2:first-child { font-family: var(--serif); }
h1 { font-weight: 700; letter-spacing: -.01em; }
.stat-v { font-weight: 700; }
/* a number tile's color follows what it counts: animals blue, hay and stock amber, health red, money green, land green, time teal */
.stat { --chip-bg: var(--accent-soft); --chip-ink: var(--accent); border-bottom: 3px solid var(--chip-ink); }
.stat-ic { background: var(--chip-bg); color: var(--chip-ink); }
.stat[data-ic="hay"], .stat[data-ic="box"], .stat[data-ic="tractor"] { --chip-bg: var(--soon-soft); --chip-ink: var(--soon); }
.stat[data-ic="syringe"], .stat[data-ic="heart"], .stat[data-ic="bell"] { --chip-bg: var(--due-soft); --chip-ink: var(--due); }
.stat[data-ic="dollar"], .stat[data-ic="map"] { --chip-bg: var(--ok-soft); --chip-ink: var(--ok); }
.stat[data-ic="scale"], .stat[data-ic="spray"], .stat[data-ic="calendar"] { --chip-bg: var(--info-soft); --chip-ink: var(--info); }
button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--chip-ink); }
.card { border-radius: 12px; }
th { background: var(--surface-2); }
tbody tr:hover td { background: var(--surface-2); }
.nav-sec { letter-spacing: .06em; }

/* ---- Details as a picture grid (2.109) ---- */
.agrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); }
.acard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.acard:hover, .acard:focus-visible { border-color: var(--accent); }
.acard.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.acard-pic { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.acard-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acard-none { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); background: var(--accent-soft); }
.acard-none .ic { width: 44px; height: 44px; opacity: .55; }
.acard-kind { position: absolute; left: 8px; top: 8px; background: rgba(20,16,8,.62); color: #fff; font-size: .76rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; }
.acard[data-cat="bull"] .acard-kind { background: rgba(31,95,168,.85); }
.acard[data-cat="calf"] .acard-kind { background: rgba(143,90,10,.85); }
.acard-pick { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; display: grid; place-items: center; background: rgba(255,255,255,.88); border-radius: 8px; }
.acard-pick input { width: 18px; height: 18px; margin: 0; }
.acard-cam { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.acard-cam .ic { width: 18px; height: 18px; }
.acard-body { padding: 9px 11px 11px; display: grid; gap: 2px; }
.acard-tag { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.15; overflow-wrap: anywhere; }
.acard-sub { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.acard-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
@media (max-width: 560px) { .agrid { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
/* Larger pictures on an animal's page (2.148) */
.photos.big { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.photos.big .photo:not(.doc) { aspect-ratio: 4 / 3; }
.photo.animal-pic { width: 260px; max-width: 100%; aspect-ratio: 4 / 3; flex: none; }
@media (max-width: 560px) { .photos.big { grid-template-columns: minmax(0, 1fr); } .photo.animal-pic { width: 100%; } }
/* Sign-in screen (2.150) */
:root[data-gate] #app { grid-template-columns: minmax(0, 1fr); }
:root[data-gate] #sidenav, :root[data-gate] #menuBtn, :root[data-gate] .search, :root[data-gate] #voiceBtn, :root[data-gate] #refreshBtn, :root[data-gate] #syncChip, :root[data-gate] #verChip, :root[data-gate] #licChip, :root[data-gate] .nav-resize { display: none !important; }
.gate { max-width: 380px; margin: 8vh auto 0; display: grid; gap: 6px; }
.gate-logo { width: 64px; height: 64px; border-radius: 14px; background: #fff; justify-self: center; object-fit: contain; }
.gate h1 { text-align: center; margin: 6px 0 0; font-family: var(--serif); }
.gate > .muted { text-align: center; margin: 0 0 10px; }
.gate-msg { background: var(--soon-soft); color: var(--ink); border-radius: 10px; padding: 10px 14px; margin: 6px 0; }
.gate-msg[hidden] { display: none; }
.gate .actions .btn { width: 100%; }

/* ---- farm cards with a drawing of the farm (2.110) ---- */
.bucket-ic.plat { width: 84px; height: 62px; padding: 0; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; border-radius: 10px; }
.bucket-ic.plat svg { width: 100%; height: 100%; display: block; }
.bucket-head:has(.plat) { grid-template-columns: 84px minmax(0, 1fr); }

/* ---- hay and money charts (2.111) ---- */
.chart-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 16px; }
.ring-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.ring-tile { display: grid; justify-items: center; gap: 2px; min-width: 104px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.rt-name { font-weight: 650; font-size: .9rem; text-align: center; }
.rt-sub { font-size: .78rem; text-align: center; }
.hbars { display: grid; gap: 7px; margin-top: 8px; }
.hb { display: grid; grid-template-columns: minmax(70px, 30%) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .9rem; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; display: block; }
.hb-fill { display: block; height: 100%; border-radius: 5px; }
.hb-v { font-variant-numeric: tabular-nums; font-weight: 650; }
@media (max-width: 500px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- gauges and lines in number tiles (2.112) ---- */
.stat-ic .stat-ring { width: 100%; height: 100%; display: block; }
.stat-ring .track { stroke: currentColor; opacity: .22; }
.stat-ring .arc { stroke: currentColor; }
.stat-ic:has(.stat-ring) { width: 40px; height: 40px; background: transparent; }
:root:not([data-size="roomy"]) .stat-ic:has(.stat-ring) { width: 34px; height: 34px; top: 6px; right: 6px; }
.stat-sparkwrap { margin-top: 6px; height: 22px; }
.stat-spark { width: 100%; height: 22px; display: block; }
.stat-spark polyline { stroke: var(--chip-ink); }
.stat-spark.neg polyline { stroke: var(--due); }

/* ---- one search, quick look and at-a-glance tiles (2.113) ---- */
.search { position: relative; }
.search-pop { position: absolute; left: 0; right: 0; top: calc(100% + 8px); min-width: min(440px, 92vw); max-height: 72vh; overflow: auto; z-index: 60; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(40,30,10,.25); padding: 6px; }
.sr-h { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 3px; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: inherit; text-decoration: none; min-height: 40px; }
.sr-item:hover, .sr-item.on { background: var(--accent-soft); }
.sr-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; flex: none; }
.sr-ic .ic { width: 16px; height: 16px; }
.sr-t { display: grid; min-width: 0; flex: 1; }
.sr-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-sub { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-more { display: block; padding: 6px 10px 8px 48px; font-size: .88rem; color: var(--accent); text-decoration: none; font-weight: 650; }
.sr-none { padding: 14px; color: var(--muted); }
@media (max-width: 700px) { .search-pop { position: fixed; left: 8px; right: 8px; top: calc(var(--top-h, 56px) + 4px); min-width: 0; } }
.peek-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; padding: 0; vertical-align: middle; flex: none; }
.peek-btn:hover { color: var(--accent); border-color: var(--accent); }
.peek-btn .ic { width: 16px; height: 16px; }
.tag-cell { display: inline-flex; align-items: center; gap: 8px; }
.acard-eye { position: absolute; left: 8px; bottom: 8px; width: 32px; height: 32px; background: rgba(255,255,255,.9); color: #3b3322; }
.glance { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 4px 0 14px; }
.gl { text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 8px 12px; display: block; min-width: 0; }
button.gl { cursor: pointer; }
button.gl:hover { border-color: var(--accent); }
.gl.ok { border-left-color: var(--ok); }
.gl.due { border-left-color: var(--due); }
.gl.soon { border-left-color: var(--soon); }
.gl-l { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gl-v { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; line-height: 1.2; overflow-wrap: anywhere; margin-top: 1px; }
.gl-s { font-size: .82rem; color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.peek-top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.peek-photo { width: 120px; height: 120px; flex: none; border-radius: 10px; overflow: hidden; padding: 0; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.peek-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.peek-photo.none .ic { width: 44px; height: 44px; opacity: .6; }
.peek-id { display: grid; gap: 6px; min-width: 0; }
.peek-notes { font-size: .9rem; color: var(--ink); overflow-wrap: anywhere; }

/* ---- Details filters and sorting (2.114) ---- */
.dt-bar { margin-bottom: 12px; }
.dt-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dt-controls select { width: auto; max-width: 100%; }
.dt-switch { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; margin-left: 4px; }
.dt-switch input { width: 18px; height: 18px; margin: 0; }
.dt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tagchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .88rem; font-weight: 650; }
.tagchip button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 1.1rem; line-height: 1; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
.tagchip button:hover { background: rgba(0,0,0,.12); }
.dt-quick-l { margin: 10px 0 2px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dt-bar .views-row { margin-top: 0; }
.dt-panel .form-h { margin: 12px 0 2px; }
.dt-panel .form-h:first-child { margin-top: 0; }

/* ---- Reminders page (2.117) ---- */
.rem-list { display: grid; }
.rem-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.rem-row:last-child { border-bottom: 0; }
.rem-when { display: grid; gap: 1px; }
.rem-w { font-weight: 700; }
.rem-w.due { color: var(--due); }
.rem-w.soon { color: var(--soon); }
.rem-t { font-size: .84rem; }
.rem-main { text-align: left; font: inherit; color: inherit; background: transparent; border: 0; padding: 4px 0; cursor: pointer; display: grid; gap: 1px; min-width: 0; }
.rem-main strong { overflow-wrap: anywhere; }
.rem-main .muted { font-size: .88rem; overflow-wrap: anywhere; }
.rem-acts { display: flex; gap: 6px; }
@media (max-width: 600px) { .rem-row { grid-template-columns: minmax(0, 1fr) auto; } .rem-when { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; } }

/* Simple mode (2.129): big text and buttons, a short menu, a home page of large tiles. */
:root[data-simple] { font-size: 120%; --tap: 56px; }
:root[data-simple] body { font-size: 1rem; }
:root[data-simple] .btn { min-height: 52px; font-size: 1.05rem; padding: 0 18px; }
:root[data-simple] .sidenav a { min-height: 60px; font-size: 1.15rem; gap: 14px; padding: 0 16px; }
:root[data-simple] .sidenav .btn { margin: 10px 12px; width: calc(100% - 24px); }
:root[data-simple] .nav-resize, :root[data-simple] .nav-version, :root[data-simple] #verChip:not(.warn) { display: none; }
:root[data-simple] input, :root[data-simple] select, :root[data-simple] textarea { min-height: 52px; font-size: 1.05rem; }
:root[data-simple] td, :root[data-simple] th { padding: 12px 10px; }
.simple-home h1 { font-size: 2.1rem; margin: 6px 0 14px; }
.simple-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 18px; }
.simple-find { width: 100%; }
.simple-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.simple-tile { display: grid; gap: 6px; align-content: center; justify-items: start; min-height: 130px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--line); color: var(--ink); text-decoration: none; }
.simple-tile:hover, .simple-tile:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.simple-tile strong { font-size: 1.35rem; font-family: var(--serif, inherit); }
.simple-tile.due { border-color: var(--bad, #b3261e); }
.simple-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.simple-ic .ic { width: 30px; height: 30px; }
.simple-foot { margin-top: 28px; }
@media (max-width: 600px) { .simple-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .simple-tile { min-height: 120px; padding: 14px; } .simple-tile strong { font-size: 1.15rem; } .simple-tile .muted { font-size: .85rem; } }
.pie { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 8px; }
.pie svg { flex: none; max-width: 100%; height: auto; }
.pie-key { display: grid; gap: 6px; flex: 1; min-width: 170px; font-size: .9rem; }
.pie-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 40px; gap: 8px; align-items: center; }
.pie-dot { width: 12px; height: 12px; border-radius: 3px; }
.pie-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-p { text-align: right; }
.budget { display: grid; gap: 8px; }
.bud-row { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .9rem; }
.bud-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bud-v { white-space: nowrap; }
@media (max-width: 500px) { .bud-row { grid-template-columns: 1fr; gap: 3px; } }

/* Pick a mother by her picture (2.136) */
.mom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.mom { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; min-width: 0; font: inherit; color: inherit; }
.mom.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.mom img, .mom-none { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--bg); display: grid; place-items: center; font-size: .8rem; color: var(--muted); }
.mom strong, .mom .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.mom-calf { display: flex; gap: 10px; align-items: center; }
.mom-calf img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }

/* Uploads: a picture still being prepared (2.137) */
.up-pending .up-pic .up-spin { height: 90px; border-radius: var(--radius, 10px); background: var(--surface-2, var(--line)); display: grid; place-items: center; }
.up-pending .up-spin::after { content: ''; width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: upspin .8s linear infinite; }
@keyframes upspin { to { transform: rotate(360deg); } }

/* Cattle highlighted by owner (2.141): a stripe down the row (or across the top of a picture card) and a light tint, in each owner's color. */
:root { --hue-blue: #1f5fa8; --hue-red: #b42318; --hue-orange: #c2560c; --hue-green: #2f7d4a; --hue-purple: #6b3fa0; --hue-brown: #7a4a22; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --hue-blue: #6ea8e6; --hue-red: #ff8a7f; --hue-orange: #f5a35c; --hue-green: #79c58f; --hue-purple: #b99be6; --hue-brown: #d2a47a; }
}
:root[data-theme="dark"] { --hue-blue: #6ea8e6; --hue-red: #ff8a7f; --hue-orange: #f5a35c; --hue-green: #79c58f; --hue-purple: #b99be6; --hue-brown: #d2a47a; }
[data-oc="blue"] { --oc: var(--hue-blue); } [data-oc="red"] { --oc: var(--hue-red); } [data-oc="orange"] { --oc: var(--hue-orange); }
[data-oc="green"] { --oc: var(--hue-green); } [data-oc="purple"] { --oc: var(--hue-purple); } [data-oc="brown"] { --oc: var(--hue-brown); }
[data-oc2="blue"] { --oc2: var(--hue-blue); } [data-oc2="red"] { --oc2: var(--hue-red); } [data-oc2="orange"] { --oc2: var(--hue-orange); }
[data-oc2="green"] { --oc2: var(--hue-green); } [data-oc2="purple"] { --oc2: var(--hue-purple); } [data-oc2="brown"] { --oc2: var(--hue-brown); }
tr[data-oc] > td { background-color: color-mix(in srgb, var(--oc) 9%, transparent); }
tr[data-oc].click:hover > td { background-color: color-mix(in srgb, var(--oc) 18%, var(--surface-2)); }
tr[data-oc] > td:first-child { background-image: linear-gradient(to bottom, var(--oc) 0 50%, var(--oc2, var(--oc)) 50% 100%); background-size: 6px 100%; background-repeat: no-repeat; padding-left: 12px; }
.acard[data-oc] { background-color: color-mix(in srgb, var(--oc) 8%, var(--surface)); border: 2px solid var(--oc); }
.acard[data-oc] .acard-body { background-image: linear-gradient(to right, var(--oc) 0 50%, var(--oc2, var(--oc)) 50% 100%); background-size: 100% 6px; background-repeat: no-repeat; padding-top: 14px; }
.owner-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 10px; font-size: .9rem; }
.owner-key-item { display: inline-flex; align-items: center; gap: 6px; }
.owner-key-item i { width: 14px; height: 14px; border-radius: 4px; background: var(--oc); display: inline-block; }

/* Settings › Colors by owner (2.142) */
.owner-color-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; background: var(--oc); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 2px var(--surface); }
.swatch.on { border-color: var(--ink); }
.swatch:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.check-row { display: flex; align-items: center; gap: 8px; }
