/* EquiCare
   Izkārtojums: telefonā augšējā josla + apakšējā navigācija; no 960px — kreisā sānjosla un divu kolonnu režģis.
   Krāsas: EquiCare olīvzaļā (akcents, no logo), segliņu āda (sekundārā), rozetes zelts (sasniegumi). */
:root {
  --bg: #F2F3EE; --surface: #FFFFFF; --surface-2: #E8EAE2; --ink: #1C231F; --ink-2: #56615A; --line: #D4D8CD;
  --accent: #556F28; --accent-ink: #FFFFFF; --accent-soft: #E6EDD5; --leather: #8A4B2A; --leather-soft: #F1E3D9;
  --gold: #9A7120; --gold-soft: #F3E8CC; --ok: #2E7D4F; --warn: #9A6200; --warn-soft: #FBEFD6; --bad: #B3261E; --bad-soft: #F9DEDC;
  --shadow: 0 1px 2px rgba(28,35,31,.06), 0 4px 16px rgba(28,35,31,.05);
  --f-display: "Literata", Georgia, "Times New Roman", serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 14px; --r-sm: 9px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111513; --surface: #191F1C; --surface-2: #222A26; --ink: #E7ECE7; --ink-2: #A2ADA6; --line: #2E3833;
    --accent: #A9C46A; --accent-ink: #141A0B; --accent-soft: #28331A; --leather: #D99A70; --leather-soft: #35261D;
    --gold: #DDB65E; --gold-soft: #352C17; --ok: #7ACB98; --warn: #E8B45A; --warn-soft: #332713; --bad: #F2948C; --bad-soft: #3A1F1D;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1, .display { font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.eyebrow { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.boot { min-height: 100dvh; display: grid; place-items: center; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .boot svg { animation: pulse 1.2s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- ikonas ---------- */
.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }

/* ---------- pogas ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .92rem;
  text-decoration: none; color: var(--ink); touch-action: manipulation; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 999px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }

/* ---------- karkass ---------- */
.shell { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.sidebar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; flex: none; display: block; }
.brand-sub { display: block; font-family: var(--f-body); font-weight: 500; font-size: .72rem; letter-spacing: .02em; color: var(--ink-2); }
.auth-logo { display: flex; justify-content: center; }
.auth-logo img { width: 168px; height: auto; display: block; }
@media (prefers-color-scheme: dark) { .auth-logo img { width: 96px; border-radius: 22px; } }
.passport-edit { position: absolute; top: 10px; right: 8px; }
.boot img { width: 88px; height: 88px; border-radius: 20px; }
.field-err { font-size: .8rem; }
.horse-switch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px; border-radius: 12px; cursor: pointer; text-align: left; }
.horse-switch:hover { background: var(--surface-2); }
.horse-switch .name { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--leather-soft); color: var(--leather);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.8rem; }
main { padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(var(--nav-h) + 32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  max-width: 1180px; margin: 0 auto; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.bottomnav a, .bottomnav button { min-height: var(--nav-h); display: grid; place-items: center; align-content: center; gap: 3px;
  font-size: .7rem; font-weight: 600; color: var(--ink-2); text-decoration: none; border: 0; background: none; cursor: pointer; }
.bottomnav [aria-current="page"] { color: var(--accent); }
.bottomnav [aria-current="page"] .i { stroke-width: 2.2; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head h1 { font-size: 1.6rem; }

@media (min-width: 960px) {
  .topbar { display: none; }
  .bottomnav { display: none; }
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; padding: 20px 14px;
    border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
  .sidebar .brand { padding: 0 8px 14px; }
  .sidebar .horse-switch { flex: none; border: 1px solid var(--line); margin-bottom: 10px; padding: 8px; }
  .navlink { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
  .navlink:hover { background: var(--surface-2); color: var(--ink); }
  .navlink[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .sidebar .foot { margin-top: auto; display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
  main { padding: 28px 32px 48px; }
  .page-head h1 { font-size: 2rem; }
}

/* ---------- kartītes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: 1 / -1; } }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 2px; min-width: 0; }
.kpi .v { font-family: var(--f-mono); font-size: 1.45rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .v small { font-size: .8rem; color: var(--ink-2); margin-left: 3px; }
.kpi .l { font-size: .8rem; color: var(--ink-2); }

/* zirga "pase" */
.passport { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: relative; overflow: hidden; }
.passport::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: repeating-linear-gradient(90deg, var(--accent) 0 18px, var(--leather) 18px 24px); }
.passport h1 { font-size: 1.7rem; line-height: 1.15; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; color: var(--ink-2); margin-top: 4px; }
.facts b { color: var(--ink); font-weight: 600; }

/* saraksti */
.list { display: grid; }
.li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; padding-top: 0; }
.li .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.li .meta { font-size: .82rem; color: var(--ink-2); }
.dot { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.dot.med { background: var(--accent-soft); color: var(--accent); }
.dot.vet { background: var(--leather-soft); color: var(--leather); }
.dot.gold { background: var(--gold-soft); color: var(--gold); }
.dot.warn { background: var(--warn-soft); color: var(--warn); }
.dot.bad { background: var(--bad-soft); color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.leather { background: var(--leather-soft); color: var(--leather); }
.pre { white-space: pre-wrap; }
.empty { text-align: center; padding: 28px 12px; color: var(--ink-2); display: grid; gap: 10px; justify-items: center; }
.empty .dot { width: 48px; height: 48px; border-radius: 14px; }

/* devu atzīmes */
.dose { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); width: 100%; text-align: left; min-height: 56px; }
.dose:hover { border-color: var(--accent); }
.dose .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.dose[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; }
.dose[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dose[aria-pressed="true"] .what { text-decoration: line-through; color: var(--ink-2); }
.dose.late:not([aria-pressed="true"]) .box { border-color: var(--warn); }
.dose:disabled { cursor: default; }

/* progresa josla */
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.leather > span { background: var(--leather); }

/* cilnes */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs button { flex: 1 0 auto; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* kalendārs */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .wd { font-size: .72rem; text-align: center; color: var(--ink-2); font-weight: 600; padding-bottom: 4px; }
.cal button { aspect-ratio: 1 / 1; max-width: 100%; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); cursor: pointer;
  display: grid; align-content: space-between; justify-items: center; padding: 5px 2px; font-family: var(--f-mono); font-size: .82rem; min-height: 40px; }
.cal button.out { background: transparent; color: var(--ink-2); opacity: .5; }
.cal button.today { border-color: var(--accent); font-weight: 700; color: var(--accent); }
.cal button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.cal .marks { display: flex; gap: 2px; height: 6px; }
.cal .marks i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.m-med { background: var(--accent); } .m-vet { background: var(--leather); } .m-tr { background: var(--ink-2); } .m-care { background: var(--gold); }
.cal button[aria-selected="true"] .marks i { background: var(--accent-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* nedēļa */
.week { display: grid; gap: 10px; }
.day { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start; }
.day .d { text-align: center; padding-top: 6px; }
.day .d b { display: block; font-family: var(--f-mono); font-size: 1.2rem; font-weight: 500; }
.day .d span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 600; }
.day.is-today .d b { color: var(--accent); }
.sessions { display: grid; gap: 8px; min-width: 0; }
.session { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); background: var(--surface); min-width: 0; }
.session.done { border-style: solid; }
.session .body { flex: 1; min-width: 0; }
.session .t { font-weight: 600; overflow-wrap: anywhere; }
.intensity { display: inline-flex; gap: 2px; vertical-align: middle; }
.intensity i { width: 6px; height: 12px; border-radius: 2px; background: var(--line); display: block; }
.intensity i.on { background: var(--leather); }
.add-slot { border: 1px dashed var(--line); border-radius: 12px; background: transparent; color: var(--ink-2); min-height: 44px; cursor: pointer; font-size: .85rem; }
.add-slot:hover { border-color: var(--accent); color: var(--accent); }

/* diagrammas */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-2); font-family: var(--f-mono); font-size: 10px; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .bar-r { fill: color-mix(in srgb, var(--accent) 45%, var(--surface-2)); }
.chart .bar-r.hi { fill: var(--accent); }
.chart .val { fill: var(--ink); font-weight: 500; }
.chart .ln { fill: none; stroke: var(--leather); stroke-width: 2; }
.chart .area { fill: color-mix(in srgb, var(--leather) 14%, transparent); }
.chart .pt { fill: var(--surface); stroke: var(--leather); stroke-width: 2; }
.chart .pt.hi { fill: var(--leather); }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.hbar .bar { height: 10px; }
.hbar .num { font-size: .82rem; }

/* ēdienkarte */
.meal { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.meal:first-child { border-top: 0; }
.meal h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--leather); padding-top: 2px; }
.meal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.meal li { display: flex; justify-content: space-between; gap: 10px; }
.meal li .num { white-space: nowrap; }
.feed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.feed-row .full { grid-column: 1 / -1; }
@media (min-width: 640px) { .feed-row { grid-template-columns: 120px 1fr 90px 80px 44px; align-items: end; } .feed-row .full { grid-column: auto; } }

/* mediji */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1 / 1; max-width: 100%; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .cap { position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; font-size: .75rem; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .doc { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--ink-2); font-size: .8rem; padding: 8px; text-align: center; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs .tile { width: 64px; height: 64px; aspect-ratio: auto; }
.viewer { display: grid; gap: 12px; }
.viewer img, .viewer video { max-height: 70vh; margin: 0 auto; border-radius: 10px; }
.viewer audio { width: 100%; }

/* ieteikumi */
.tip { display: grid; gap: 6px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.tip .src { font-size: .78rem; color: var(--ink-2); }
.tip .src a { color: inherit; }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 16px 1fr; gap: 12px; }
.tl .rail { position: relative; display: flex; justify-content: center; }
.tl .rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl .rail i { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); margin-top: 6px; box-shadow: 0 0 0 3px var(--surface); }
.tl .c { padding-bottom: 18px; min-width: 0; }

/* formas */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; }
.scrim { position: absolute; inset: 0; background: rgba(10,14,12,.45); }
.sheet { position: relative; background: var(--surface); border-radius: 20px 20px 0 0; max-height: 92dvh; display: flex; flex-direction: column; width: 100%; box-shadow: 0 -8px 32px rgba(0,0,0,.2); }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .22s cubic-bezier(.2,.8,.2,1); } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.sheet > header h2 { font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; }
.sheet .sheet-body { padding: 16px 20px; overflow-y: auto; display: grid; gap: 14px; }
.sheet > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
@media (min-width: 720px) {
  .sheet-wrap { align-items: center; justify-items: center; padding: 24px; }
  .sheet { border-radius: 20px; max-width: 620px; max-height: 88dvh; }
  .sheet.wide { max-width: 860px; }
}
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: .85rem; font-weight: 600; }
.field .hint { font-size: .78rem; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); font-size: 16px; }
/* iOS Safari: datuma/laika lauki citādi ir platāki par kolonnu, augstāki un centrēti */
input.input[type="date"], input.input[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%;
  height: 46px; line-height: 24px; text-align: left; }
input.input[type="date"]::-webkit-date-and-time-value, input.input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 24px; }
input.input[type="date"]::-webkit-datetime-edit, input.input[type="time"]::-webkit-datetime-edit { padding: 0; }
select.input { -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.f2 > *, .f3 > * { min-width: 0; align-self: start; }
.seg.seg-scale { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.seg.seg-scale label { min-width: 0; padding: 0; min-height: 44px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.f2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.f3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 420px) { .f3 { grid-template-columns: 1fr 1fr; } }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { min-width: 44px; min-height: 40px; padding: 0 12px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .88rem; }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.ta-wrap { position: relative; }
.ta-wrap .mic { position: absolute; right: 6px; bottom: 6px; }
.mic.rec { background: var(--bad); color: #fff; }
@media (prefers-reduced-motion: no-preference) { .mic.rec { animation: pulse 1s infinite; } }
.ai-box { border: 1px dashed var(--accent); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.med-row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 12px; position: relative; }
.med-row .full { grid-column: 1 / -1; }
@media (min-width: 640px) { .med-row { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; } }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: .85rem; font-weight: 600; padding: 0; margin-bottom: 6px; }
.err { color: var(--bad); font-size: .85rem; }

/* pieteikšanās */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 18px; }
.auth-card h1 { font-size: 2rem; line-height: 1.1; }
.auth-card .lead { color: var(--ink-2); }
.auth-head { text-align: center; justify-items: center; }
.auth-brand { display: grid; justify-items: center; gap: 10px; }
.auth-word { display: none; font-family: var(--f-body); font-weight: 600; font-size: 1.6rem; letter-spacing: .01em; }
@media (prefers-color-scheme: dark) { .auth-word { display: block; } }
.auth-card form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 14px; }

/* paziņojumi */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem; font-weight: 500; max-width: calc(100vw - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
@media (min-width: 960px) { #toast { bottom: 24px; } }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: .88rem; margin-bottom: 14px; }
.menu-list { display: grid; gap: 4px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 0; background: none; cursor: pointer; font-weight: 500; text-align: left; width: 100%; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.horse-opt[aria-current="true"] { background: var(--accent-soft); }

a.kpi-link { color: inherit; text-decoration: none; transition: border-color .15s; }
a.kpi-link:hover { border-color: var(--accent); }
.kpi .l .chip { font-size: .68rem; padding: 1px 7px; }

/* ciltsraksts */
.ped-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.ped { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(8, auto); gap: 6px; min-width: 470px; }
.ped-cell { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; background: var(--surface); font: inherit; color: inherit; text-align: left; text-decoration: none; }
button.ped-cell { cursor: pointer; }
button.ped-cell:hover, a.ped-cell:hover { border-color: var(--accent); }
.ped-cell.is-empty .ped-meta { color: var(--accent); font-weight: 600; }
.ped-cell.is-sire { background: var(--accent-soft); border-color: transparent; }
.ped-cell.is-empty { border-style: dashed; background: transparent; }
.ped-rel { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.ped-name { font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.ped-name:hover { text-decoration: underline; }
.ped-meta { font-size: .76rem; color: var(--ink-2); }
.parents { display: block; color: var(--ink-2); text-decoration: none; margin-top: 2px; }
.parents b { color: var(--ink); font-weight: 600; }

/* imports */
.imp-table { border-collapse: collapse; font-size: .8rem; min-width: 100%; }
.imp-table th, .imp-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.imp-table th { background: var(--surface-2); font-weight: 600; }
.imp-li { flex-wrap: wrap; align-items: center; }
.imp-li .body { flex: 1 1 140px; }
.imp-sel { flex: 1 1 220px; max-width: 300px; }
@media (max-width: 520px) { .imp-sel { max-width: none; } }

/* laikapstākļi */
.wx-now { display: flex; align-items: center; gap: 14px; }
.wx-big { width: 52px; height: 52px; color: var(--accent); stroke-width: 1.5; }
.wx-temp { font-size: 2.4rem; line-height: 1; font-weight: 500; }
.wx-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.wx-day { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--surface-2); text-align: center; border: 1px solid transparent; }
.wx-day .i { width: 26px; height: 26px; color: var(--ink-2); }
.wx-day.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.wx-day.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.wx-flag { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); margin-top: 2px; }
.wx-flag.bad { background: var(--bad-soft); color: var(--bad); }

/* arhīvs */
.arch-month { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 14px 0 4px; text-transform: capitalize; }
.arch-item { display: grid; grid-template-columns: 74px 1fr; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 0; font: inherit; color: inherit; cursor: pointer; }
.arch-item:hover strong { text-decoration: underline; }
.arch-date { font-size: .8rem; color: var(--ink-2); padding-top: 2px; }
.arch-main { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.arch-text { font-size: .88rem; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.fei-box { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; }
.fei-box.bad { background: var(--bad-soft); color: var(--bad); }
.fei-box.warn { background: var(--warn-soft); color: var(--warn); }
.fei-box.ok { background: var(--accent-soft); color: var(--accent); }
.fei-box .small { color: var(--ink); }
