:root {
  --ink: #1f2a24; --ink-2: #3c4a42; --muted: #6b746e; --line: #e5e1d8; --bg: #f6f5f1; --card: #fff;
  --accent: #2f6b4f; --accent-d: #245640; --accent-soft: #e8f1ec; --sand: #b9874c; --sand-soft: #f6ede1;
  --ok: #1d7a4f; --ok-soft: #e3f4ea; --warn: #a15c07; --warn-soft: #fdf1df; --err: #b42318; --err-soft: #fdecea;
  --info: #1f5f8b; --info-soft: #e6f0f8; --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; }
.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=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(47,107,79,.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; gap: 2px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
.tabs::-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; }
