:root {
  --ink: #1c2430; --ink-2: #3a4556; --muted: #687385; --line: #e2e6ec; --bg: #f5f7fa; --card: #fff;
  --accent: #2f6b2f; --accent-d: #224f22; --accent-soft: #e8f2e3; --sand: #b9874c; --sand-soft: #f6ede1;
  --ok: #1d7a4f; --ok-soft: #e3f4ea; --warn: #a15c07; --warn-soft: #fdf1df; --err: #b42318; --err-soft: #fdecea;
  --info: #2d5f7c; --info-soft: #e7f1f6; --r: 14px; --shadow: 0 1px 2px rgba(31,42,36,.05), 0 8px 24px -12px rgba(31,42,36,.18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-d); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 12px; }
h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 12px; }
img { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
/* form + list layouts (two uneven columns on desktop, one on phones) */
.split-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
.split-list { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .split-form, .split-list { grid-template-columns: 1fr; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px 16px;
  font: inherit; font-weight: 600; font-size: 14px; background: var(--accent); color: #fff; cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background .15s; }
.btn:hover { background: var(--accent-d); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: 12px; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: #fff; color: var(--err); border: 1px solid #f3c7c2; }
.btn-danger:hover { background: var(--err-soft); }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent-d); font: inherit; cursor: pointer; text-decoration: underline; }
.btn-link:hover, .btn.btn-link:hover { background: none; color: var(--accent); text-decoration-thickness: 2px; }
.inline { display: inline; }

/* cards, tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-body { padding: 18px 20px; }
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfaf7; white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.link-row { cursor: pointer; }
table.t tr.link-row:hover td { background: #fbfaf7; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.kpi .l { font-size: 13px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; white-space: pre-line; }
@media (max-width: 640px) { dl.kv { grid-template-columns: 1fr; gap: 2px; } dl.kv dd { margin-bottom: 8px; } }

/* badges, flashes */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe5cf; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #f4d7ab; }
.badge.err { background: var(--err-soft); color: var(--err); border-color: #f3c7c2; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: #c4dcee; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; border: 1px solid var(--line); background: #fff; }
.flash.ok { background: var(--ok-soft); border-color: #bfe5cf; color: #14532d; }
.flash.warn { background: var(--warn-soft); border-color: #f4d7ab; color: #7a4504; }
.flash.err { background: var(--err-soft); border-color: #f3c7c2; color: #7f1d1d; }
.banner { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.banner.info { background: var(--info-soft); color: #123e5c; }
.banner.warn { background: var(--warn-soft); color: #7a4504; }
.banner.err { background: var(--err-soft); color: #7f1d1d; }

/* forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
input[type=time], input[type=search], input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], select, textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #d8d3c7; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31,78,140,.25); border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { font-size: 13px; max-width: 100%; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.check input { margin-top: 3px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 700; font-size: 14px; padding: 0 6px; }

/* app shell */
.app-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.app-top .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.brand svg { flex-shrink: 0; }
.brand small { font-weight: 600; color: var(--muted); font-size: 13px; }
.tabs { display: flex; align-items: center; border-top: 1px solid var(--line); }
.tab-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tab-links::-webkit-scrollbar { display: none; }
.tabs a { padding: 11px 13px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--accent-d); border-bottom-color: var(--accent); }
.tabs a .count { background: var(--err); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; margin-left: 4px; }
.app-main { padding-top: 24px; padding-bottom: 60px; }   /* top/bottom only: .wrap keeps the side gutter */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.who { font-size: 13px; color: var(--muted); display: flex; gap: 12px; align-items: center; }
@media (max-width: 640px) { .who .email { display: none; } .app-main { padding-top: 16px; } }

/* horse */
.horse-head { display: flex; gap: 18px; align-items: center; }
.avatar { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; background: var(--sand-soft); display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 26px; color: var(--sand); flex-shrink: 0; }
.avatar.sm { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 14px; }
.subtabs a { padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); background: #fff; border: 1px solid var(--line); }
.subtabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.due { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.entry { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.entry img { border-radius: 10px; max-height: 320px; margin-top: 8px; display: block; }

/* messages */
.msgs { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 14px; white-space: pre-line; }
.msg .meta { font-size: 11px; opacity: .75; margin-top: 4px; white-space: normal; }
.msg.in { background: #f1efe9; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.out a { color: #fff; }
.msg.all { background: var(--sand-soft); align-self: center; max-width: 92%; border: 1px dashed #e0c79f; }
@media (max-width: 640px) { .msg { max-width: 92%; } }

/* feeding board (print) */
.feed td { font-size: 13px; }
@media print {
  .app-top, .no-print, .flash, .banner { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .card { box-shadow: none; border: 0; }
  table.t th, table.t td { padding: 6px 8px; border: 1px solid #ccc; }
  .app-main { padding: 0; }
}

/* public site */
.site-top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-top .bar { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.site-nav a.btn { color: #fff; }
@media (max-width: 760px) { .site-nav a:not(.btn) { display: none; } }
.hero { padding: 72px 0 56px; background:
  radial-gradient(800px 380px at 0% 0%, rgba(47,107,79,.13), transparent 70%),
  radial-gradient(700px 340px at 100% 10%, rgba(185,135,76,.14), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 40px 0; } }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); margin-bottom: 18px; }
.lead { font-size: 18px; color: var(--ink-2); margin-bottom: 24px; max-width: 600px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: var(--accent-d); background: var(--accent-soft);
  border-radius: 999px; padding: 5px 12px; margin-bottom: 16px; }
.ticks { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; color: var(--ink-2); }
.ticks span::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 6px; }
.mock { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(31,42,36,.35); overflow: hidden; }
.mock-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; }
.mock-head i { width: 9px; height: 9px; border-radius: 50%; background: #e2ddd2; display: block; }
.section { padding: 72px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; text-align: center; margin-bottom: 10px; }
.section-lead { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 40px; font-size: 16px; }
.feature { padding: 22px; }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-d); display: flex; align-items: center;
  justify-content: center; font-size: 21px; margin-bottom: 12px; }
.feature p { color: var(--ink-2); font-size: 14px; margin: 0; }
.price-card { max-width: 460px; margin: 0 auto; padding: 32px; text-align: center; }
.price { font-size: 48px; font-weight: 800; letter-spacing: -0.03em; }
.price small { font-size: 17px; font-weight: 600; color: var(--muted); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 15px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { color: var(--ink-2); margin: 0 0 16px; }
.site-foot { border-top: 1px solid var(--line); background: #fff; padding: 32px 0; font-size: 14px; color: var(--muted); }
.site-foot a { color: var(--muted); }
.auth-box { max-width: 420px; margin: 60px auto; padding: 28px; }
.prose { max-width: 780px; }
.prose h2 { margin-top: 28px; }
.prose li { margin-bottom: 6px; }

/* narrow screens: long badges and buttons wrap instead of widening the page */
.due .badge { white-space: normal; }
.horse-head > div { min-width: 0; }
@media (max-width: 640px) {
  .btn-lg { white-space: normal; text-align: center; }
  .row > form, .row > .btn { max-width: 100%; }
}

.brand > span { line-height: 1.15; }
.brand small { display: inline-block; max-width: 62vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }

/* grid/flex children may shrink below their content (wide tables scroll inside .table-wrap instead of widening the page) */
.split-form > *, .split-list > *, .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.list li { flex-wrap: wrap; }
.list li > span { min-width: 0; }

/* mojakwatera: bed schedule */
.sched { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
.sched th, .sched td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; height: 30px; text-align: center; }
.sched th { background: #f0f3f8; font-weight: 600; position: sticky; top: 0; z-index: 1; padding: 4px 2px; min-width: 34px; }
.sched th.bedcol, .sched td.bedcol { text-align: left; padding: 0 8px; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 2; min-width: 110px; }
.sched th.today, .sched td.today { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.sched th.we { background: #e8edf5; }
.sched td.free a { display: block; height: 100%; color: transparent; text-decoration: none; }
.sched td.free a:hover { background: var(--accent-soft); color: var(--accent-d); }
.sched td.busy { background: #dbe6f6; }
.sched td.busy.self { background: #fde9cf; }
.sched td.busy a { display: block; padding: 0 4px; color: var(--ink); text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 120px; font-weight: 600; }
.sched td.start { border-left: 3px solid var(--accent); }
.legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin: 0 4px 0 12px; }
/* printouts (agreement, registration card, KP, statement) */
.doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 36px 44px; color: #000; font-size: 13.5px; line-height: 1.5; box-shadow: var(--shadow); }
.doc h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.doc .sub { text-align: center; margin-bottom: 18px; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.doc td, .doc th { border: 1px solid #999; padding: 5px 7px; text-align: left; vertical-align: top; }
.doc .sign { display: flex; justify-content: space-between; gap: 40px; margin-top: 50px; }
.doc .sign div { flex: 1; border-top: 1px solid #000; padding-top: 4px; text-align: center; font-size: 12px; }
.print-bar { max-width: 820px; margin: 0 auto 12px; display: flex; gap: 8px; }
@media print { body { background: #fff; } .app-top, .site-foot, .print-bar, .banner, .flash, .no-print { display: none !important; }
  .doc { box-shadow: none; padding: 0; } .app-main { padding: 0 !important; } }
.money-pos { color: var(--ok); font-weight: 600; } .money-neg { color: var(--err); font-weight: 600; }

/* hotel switcher */
.hotel-pick { position: relative; } .hotel-pick summary { list-style: none; cursor: pointer; } .hotel-pick summary::-webkit-details-marker { display: none; }
.hotel-menu { position: absolute; right: 0; top: 40px; z-index: 30; min-width: 280px; padding: 10px 12px; }
.hotel-menu .btn-link { display: block; text-decoration: none; padding: 4px 0; text-align: left; } .hotel-menu .btn-link.on { font-weight: 700; }
/* price calculator */
.calc { max-width: 520px; margin: 0 auto; } .calc input[type=range] { width: 100%; accent-color: var(--accent); }
.calc .beds { font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; }

/* phones: the header keeps logo + hotel picker + logout on one line, printable documents scroll inside their card */
.print-bar { flex-wrap: wrap; }
.app-top .bar > * { min-width: 0; }
.hotel-menu { min-width: min(280px, calc(100vw - 32px)); }
@media (max-width: 640px) {
  .brand small { display: none; }
  .who { gap: 8px; }
  .hotel-pick summary { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .doc { padding: 18px 14px; font-size: 12.5px; overflow-x: auto; }
  .doc td, .doc th { padding: 4px 5px; }
  .doc .sign { gap: 16px; }
}
@media (max-width: 420px) { .brand > span { display: none; } }
@media (max-width: 640px) {
  table.t th, table.t td { padding: 9px 10px; }
  table.t td:first-child, table.t th:first-child { padding-left: 14px; }
  table.t td:last-child, table.t th:last-child { padding-right: 14px; }
}
@media (max-width: 640px) { .kpi { padding: 14px; } .kpi .v { font-size: 21px; white-space: nowrap; } }

/* setup wizard */
.setup { max-width: 760px; margin: 0 auto; }
.setup h1 { font-size: 24px; margin-bottom: 6px; }
.setup-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.setup-steps li { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.setup-steps li span { width: 22px; height: 22px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.setup-steps li.on { color: var(--ink); font-weight: 700; border-color: var(--accent); }
.setup-steps li.on span { background: var(--accent); color: #fff; }
.setup-steps li.done span { background: var(--ok, #16a34a); color: #fff; }
.setup-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.setup-row { display: flex; gap: 8px; align-items: center; }
.setup-row > input[type=text] { flex: 1; min-width: 0; }
.setup-row .setup-sm { flex: 0 0 130px; }
.setup-beds { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.setup-beds input { width: 76px; }
.res-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf8; }
.res-row .res-payer { grid-column: span 2; }
.res-since { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.res-private { display: flex; gap: 8px; grid-column: span 2; } .res-private[hidden] { display: none; }
.res-private select { max-width: 140px; }
.pill-choice { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 600; }
.pill-choice:has(input:checked) { border-color: var(--accent); background: var(--info-soft); }
.setup-skip { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 22px 0 4px; }
@media (max-width: 640px) {
  .setup-row { flex-wrap: wrap; } .setup-row .setup-sm { flex: 1 1 120px; }
  .res-row { grid-template-columns: 1fr 1fr; } .res-row select[name="bed[]"], .res-row .res-payer, .res-private { grid-column: 1 / -1; }
}
.res-row > * { min-width: 0; }
/* to-do list on the dashboard / admin */
.todo-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); border-left: 4px solid transparent; }
.todo-item.todo-err { border-left-color: var(--err); } .todo-item.todo-warn { border-left-color: #f59e0b; } .todo-item.todo-info { border-left-color: var(--accent); }
.todo-text { min-width: 0; } .todo-text ul { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); } .todo-text li { margin: 2px 0; }
.todo-item .btn { flex-shrink: 0; }
@media (max-width: 640px) { .todo-item { padding: 12px 14px; } }
/* agreements: numbered sections, annexes, handover record */
.doc.agreement h3 { font-size: 14px; margin: 16px 0 6px; }
.doc.agreement ol { margin: 0 0 8px; padding-left: 20px; } .doc.agreement li { margin: 0 0 5px; }
.doc.agreement + .doc.agreement { margin-top: 18px; }
.doc.handover td { height: 26px; }
.page-break { height: 0; }
@media print { .page-break { break-before: page; } .doc.agreement + .doc.agreement { margin-top: 0; break-before: page; } .doc.agreement h3 { break-after: avoid; } }
.money-form { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf8; } .money-form h3 { margin: 0 0 2px; font-size: 15px; }
/* document camera */
.cam-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.cam-dialog::backdrop { background: rgba(15, 23, 42, .6); }
.cam-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cam-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-frame { position: absolute; inset: 9% 7%; border: 2px dashed rgba(255,255,255,.75); border-radius: 10px; pointer-events: none; }
.cam-dialog.flash-shot .cam-stage { outline: 4px solid #fff; }
.cam-tip { margin: 8px 0; }
.cam-shots { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cam-shots div { position: relative; } .cam-shots img { width: 84px; height: 63px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.cam-shots button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--err); color: #fff; font-size: 12px; cursor: pointer; }
.cam-actions { justify-content: space-between; }
@media (max-width: 640px) { .cam-stage { aspect-ratio: 3 / 4; } .cam-actions .btn { flex: 1 1 auto; } }
/* landing: phone mockup for document photos */
.phone-mock { display: flex; justify-content: center; }
.phone { width: 260px; border-radius: 34px; background: #0f172a; padding: 14px 12px 18px; box-shadow: var(--shadow); color: #e2e8f0; font-size: 12px; }
.phone-bar { text-align: center; padding: 6px 0 10px; font-weight: 600; }
.phone-cam { position: relative; background: #1e293b; border-radius: 18px; aspect-ratio: 3 / 4; display: grid; place-items: center; }
.phone-cam::after { content: ""; position: absolute; inset: 10% 8%; border: 2px dashed rgba(255,255,255,.6); border-radius: 12px; }
.phone-doc { width: 70%; aspect-ratio: 5 / 7; background: #7f1d1d; border-radius: 8px; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; color: #fde68a; transform: rotate(-4deg); }
.phone-doc b { letter-spacing: .12em; font-size: 13px; } .phone-doc span { font-size: 10px; opacity: .85; }
.phone-doc i { display: block; height: 5px; border-radius: 3px; background: rgba(253,230,138,.35); } .phone-doc i:nth-of-type(2) { width: 70%; } .phone-doc i:nth-of-type(3) { width: 45%; }
.phone-shots { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; } .phone-shots span { background: #134e4a; color: #99f6e4; border-radius: 999px; padding: 3px 9px; }
.phone-btn { background: var(--accent); color: #fff; text-align: center; border-radius: 12px; padding: 10px; font-weight: 700; font-size: 14px; }
@media (max-width: 900px) { #dokumenty .grid-2 > .phone-mock { order: 2; } }
/* agreement editing in place */
.agreement-body.editing .doc { outline: 2px dashed var(--accent); outline-offset: 4px; cursor: text; }
.agreement-body.editing .doc:focus { outline-style: solid; }
.agreement-edit-bar { align-items: center; flex-wrap: wrap; }

/* farmdesk */
.map { height: 420px; border-radius: 12px; border: 1px solid var(--line); z-index: 0; }
.map.tall { height: 520px; }
.crop-chip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-d); font-size: 12.5px; font-weight: 600; margin: 0 4px 4px 0; }
.kind-oprysk { color: #8a3b12; } .kind-nawozenie { color: #2f6b2f; } .kind-siew { color: #6b4f1d; } .kind-zbior { color: #7a5b00; }
.parcel-results { display: grid; gap: 6px; margin-top: 8px; } .parcel-results button { text-align: left; }
.field-pick { display: grid; gap: 8px; } .field-pick .fp-row { display: grid; grid-template-columns: auto 1fr 1fr 110px; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fcfbf8; }
.field-pick .fp-row.off { opacity: .55; } .field-pick .fp-row b { white-space: nowrap; }
@media (max-width: 640px) { .field-pick .fp-row { grid-template-columns: auto 1fr; } .field-pick .fp-row select, .field-pick .fp-row input[type=text] { grid-column: 1 / -1; } .map { height: 340px; } }
.crew td input { max-width: 110px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.doc table td, .doc table th { font-size: 11.5px; }

.calc-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; margin-bottom: 8px; }
.calc-label b { font-size: 22px; }
@media (max-width: 640px) {
  .todo-item { flex-direction: column; gap: 8px; }
  .todo-item > .row { align-self: flex-start; }
}

.setup-steps li a { display: flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.setup-steps li:hover { border-color: var(--accent); }
/* place suggestions */
.suggest { position: absolute; z-index: 1000; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; font: inherit; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest button:last-child { border-bottom: 0; } .suggest button:hover, .suggest button.on { background: var(--accent-soft); }
.suggest button span { display: block; font-size: 12px; color: var(--muted); }
.suggest-title { padding: 8px 12px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); background: #fbfaf7; }
input.chosen { border-color: var(--accent); background: var(--accent-soft); }
.area-label { background: rgba(255,255,255,.85); border: 0; box-shadow: none; font-weight: 700; color: #7a5b00; }
.finder { display: grid; grid-template-columns: 1fr 190px auto; gap: 8px; }
@media (max-width: 640px) { .finder { grid-template-columns: 1fr 1fr; } .finder > :first-child { grid-column: 1 / -1; } }
/* dashboard map */
.field-list { margin-top: 10px; } .field-list summary { cursor: pointer; padding: 6px 4px; }
.field-list-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-top: 6px; }
.fl-item { display: block; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer; text-decoration: none; color: inherit; }
.fl-item:hover { border-color: var(--accent); background: var(--accent-soft); } .fl-item span { display: block; font-size: 12px; color: var(--muted); }
.fl-group { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.fpop h3 { margin: 0 0 4px; font-size: 16px; } .fpop h4 { margin: 10px 0 2px; font-size: 13px; } .fpop .small { line-height: 1.45; }
.leaflet-popup-content { margin: 12px 14px; }

.field-map-big { height: 62vh; min-height: 420px; }
@media (max-width: 640px) { .field-map-big { height: 70vh; min-height: 360px; } }

/* cadastre overlays (GUGiK KIEG): thin pale lines recoloured / thickened so they read on the map and the photo */
.kieg-lines { filter: brightness(0) invert(24%) sepia(96%) saturate(2400%) hue-rotate(336deg) drop-shadow(.6px 0 0 #9a3412) drop-shadow(0 .6px 0 #9a3412); opacity: .9; }
.on-orto .kieg-lines { filter: brightness(0) invert(1) drop-shadow(.6px 0 0 #fff) drop-shadow(0 0 1.5px #000); opacity: 1; }
.kieg-obreby { filter: drop-shadow(1px 0 0 #db2777) drop-shadow(0 1px 0 #db2777); }
.on-orto .kieg-obreby { filter: brightness(0) invert(1) sepia(1) saturate(30) hue-rotate(300deg) drop-shadow(1px 0 0 #f0abfc) drop-shadow(0 0 2px #000); }
.kieg-kontury { filter: saturate(4) brightness(.55) drop-shadow(.6px 0 0 #166534); }
.on-orto .kieg-kontury { filter: brightness(0) invert(1) sepia(1) saturate(20) hue-rotate(50deg) drop-shadow(0 0 1.5px #000); }
.leaflet-tooltip.parcel-label { background: #fff; border: 2px solid #c2410c; color: #7c2d12; font-weight: 800; font-size: 13px; padding: 1px 6px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.leaflet-tooltip.parcel-label::before, .leaflet-tooltip.hover-label::before { display: none; }
.leaflet-tooltip.hover-label { background: #1e3a8a; color: #fff; border: 0; font-size: 12.5px; line-height: 1.35; padding: 5px 9px; border-radius: 7px; }
.parcel-table { margin-top: 10px; overflow-x: auto; }
.parcel-table table { width: 100%; }
.parcel-table td, .parcel-table th { vertical-align: top; }
.soil-chip { display: inline-block; background: #ecfccb; color: #3f6212; border: 1px solid #bef264; border-radius: 5px; padding: 0 5px; margin: 1px 0; font-size: 12px; font-weight: 600; cursor: help; }
/* Chrome draws a focus rectangle around a clicked SVG shape – that looked like a wrong "rectangle" outline of a parcel */
.leaflet-container path.leaflet-interactive:focus, .leaflet-container .leaflet-interactive:focus { outline: none; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .choice-row { grid-template-columns: 1fr; } }
.choice { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: pointer; font-weight: 400; }
.choice:has(input:checked) { border-color: var(--green, #2f6b2f); background: #f3f8ef; }
.choice input { margin-top: 3px; }
.choice small { display: block; color: var(--muted, #6b7280); font-size: 12.5px; line-height: 1.35; }
.badge.perennial { background: #ecfccb; color: #3f6212; }
.crop-bar { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcfa; }
.cp-head { margin-bottom: 8px; }
.cp-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-sum { margin-top: 8px; }
.cp-rest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-weight: 400; }
.cp-rest select { width: auto; padding: 4px 8px; }
/* Leaflet colours every link inside the map (.leaflet-container a) – keep our buttons in popups readable */
.leaflet-container a.btn { color: #fff; text-decoration: none; }
.leaflet-container a.btn-ghost { color: var(--ink); }
.leaflet-container a.btn-danger { color: var(--err); }
.leaflet-container a.btn-link { color: var(--accent-d); }
.cp-handle { border-radius: 50%; background: #fff; border: 3px solid #b45309; box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: grab; }
.cp-handle.first { border-color: #16a34a; background: #dcfce7; }
.cp-handle.mid { background: rgba(255,255,255,.85); border: 2px solid #b45309; opacity: .8; }
.cp-handle.mid::after { content: '+'; display: block; text-align: center; font: 700 11px/10px sans-serif; color: #b45309; }
#field-map.map-editing { height: 68vh; min-height: 420px; }
.tp-map { height: 46vh; min-height: 320px; margin-top: 4px; }
.fp-row.flash-row { animation: flashrow 1.2s ease; }
@keyframes flashrow { 0% { background: #fef3c7; } 100% { background: transparent; } }
.cl-handle { display: flex !important; align-items: center; justify-content: center; background: #dc2626; color: #fff; border: 2px solid #fff; border-radius: 50%;
  font: 700 16px/1 sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: grab; }
.cl-table { margin-top: 8px; }
.cl-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.cl-row b { flex: 1; }
.cl-row input { width: 80px; padding: 5px 8px; }
.cl-sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #111827; }
.cd-list { margin-top: 6px; }
.cd-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cd-main { flex: 1; }
.cd-row select, .cd-row input { width: auto; padding: 5px 8px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #cbd5e1; border-top-color: #2f6b2f; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.fpop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .fpop-actions form { margin: 0; }
.season-sw { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 5px 0 5px 10px; flex-shrink: 0; }
.season-sw select { width: auto; padding: 5px 8px; font-size: 13.5px; font-weight: 600; border-radius: 8px; }
.ss-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 28px; height: 30px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink); }
.ss-btn:disabled { opacity: .35; cursor: default; }
.ss-now { border: 0; background: #fef3c7; color: #92400e; border-radius: 8px; padding: 5px 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
@media (max-width: 860px) { .tabs { flex-direction: column; align-items: stretch; } .season-sw { margin: 0; padding: 6px 0; border-top: 1px solid var(--line); } .season-sw select { flex: 1; } }
.ai-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; background: #f0f7ec; border-bottom: 1px solid var(--line); }
.cd-prog { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.cd-prog-in { height: 100%; background: linear-gradient(90deg, #4d8f3a, #2f6b2f); border-radius: 999px; transition: width .25s linear; }
.cd-stages { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.cd-stages li.now { color: var(--ink); font-weight: 600; }
.cd-stages li.done { color: #15803d; }
.cd-row.on { background: #fff7ed; border-radius: 8px; }
