:root {
  --green: #1f4d3a;
  --green-2: #2d6a4f;
  --green-soft: #e3efe8;
  --saddle: #a8693c;
  --saddle-soft: #f6eadf;
  --cream: #faf7f2;
  --card: #ffffff;
  --ink: #1d2420;
  --muted: #66706a;
  --line: #e6e1d8;
  --amber: #c98a12;
  --amber-soft: #fbf0d6;
  --ok: #2d6a4f;
  --ok-soft: #dcefe3;
  --danger: #b3412f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(31,77,58,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
a { color: var(--green-2); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* Top bar */
.topbar {
  background: var(--green);
  color: #fff;
  padding: 14px 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; display: block; line-height: 1.1; }
.brand span { font-size: .75rem; opacity: .8; }
.topbar .spacer { flex: 1; }
.role-pill { background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 12px; font-size: .8rem; white-space: nowrap; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 20px 16px 110px; }

/* Tabs (bottom nav on phones, top on desktop) */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  border: 0; background: none; padding: 6px 8px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .72rem; color: var(--muted); cursor: pointer; min-width: 64px;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--green); font-weight: 600; }
@media (min-width: 760px) {
  .tabs { position: static; border: 0; background: transparent; justify-content: flex-start; gap: 6px; padding: 0; margin-bottom: 18px; }
  .tab { flex-direction: row; font-size: .92rem; padding: 8px 14px; background: #fff; border: 1px solid var(--line); }
  .tab svg { width: 18px; height: 18px; }
  .tab.active { background: var(--green); color: #fff; border-color: var(--green); }
  .wrap { padding-bottom: 40px; }
}

/* Cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap-row { display: flex; flex-wrap: wrap; gap: 8px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.section-title h2 { margin: 0; }

/* Buttons */
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 14px; cursor: pointer; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: #cfc8bb; }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover { background: var(--green-2); }
.btn.saddle { background: var(--saddle); color: #fff; border-color: var(--saddle); }
.btn.big { padding: 14px 18px; font-size: 1.05rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn svg { width: 18px; height: 18px; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--cream); }

/* Avatars & badges */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600; color: #fff; font-size: .95rem;
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.badge.saddle { background: var(--saddle-soft); color: var(--saddle); }
.badge.amber { background: var(--amber-soft); color: #8a5d05; }
.badge.gray { background: #eee; color: #555; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-weight: 600; }
.clickable { cursor: pointer; }
.clickable:hover { background: #fcfbf8; }

/* Progress */
.bar { height: 8px; border-radius: 999px; background: #eee9e0; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), var(--green)); border-radius: 999px; }

/* Skill chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 9px 14px; cursor: pointer; font-size: .92rem; user-select: none;
  display: inline-flex; align-items: center; gap: 6px; transition: all .12s;
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #bbb; }
.chip.practicing { background: var(--amber-soft); border-color: var(--amber); }
.chip.practicing .dot { background: var(--amber); border-color: var(--amber); }
.chip.mastered { background: var(--ok-soft); border-color: var(--ok); color: var(--green); font-weight: 600; }
.chip.mastered .dot { background: var(--ok); border-color: var(--ok); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1.5px solid #bbb; }
.legend i.p { background: var(--amber); border-color: var(--amber); }
.legend i.m { background: var(--ok); border-color: var(--ok); }

/* Skill checklist (read-only) */
.skill-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.skill-row:last-child { border-bottom: 0; }
.skill-row .check { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 1.5px solid #ccc; }
.skill-row .check svg { width: 14px; height: 14px; }
.skill-row.mastered .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.skill-row.practicing .check { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.skill-row .grow { flex: 1; }
.skill-row .date { font-size: .78rem; color: var(--muted); }

/* Videos */
.clip { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.clip video, .clip .poster { width: 100%; aspect-ratio: 16/9; display: block; background: #20302a; object-fit: cover; }
.clip .poster { display: grid; place-items: center; color: #cfe3d8; text-align: center; font-size: .85rem;
  background: radial-gradient(circle at 30% 30%, #3b6b55, #1b3a2d); }
.clip .poster svg { width: 42px; height: 42px; opacity: .8; margin-bottom: 4px; }
.clip .body { padding: 10px 12px; }
.clips { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Sheet / modal */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20,30,25,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--cream); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet-head .grow { flex: 1; }

.drop {
  border: 2px dashed #cbbfa9; border-radius: 14px; padding: 22px 14px; text-align: center; background: #fff;
}
.drop video { width: 100%; border-radius: 10px; margin-top: 10px; max-height: 280px; background: #000; }

label.field { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
input[type=text], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
textarea { min-height: 70px; resize: vertical; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60;
  background: var(--green); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 500;
}

.notice { background: var(--saddle-soft); border: 1px solid #ecd6c2; border-radius: 12px; padding: 10px 14px; font-size: .88rem; }
.notice.green { background: var(--green-soft); border-color: #c7dfd1; }

.check-toggle { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid #c9c2b5; background: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.check-toggle.on { background: var(--green); border-color: var(--green); color: #fff; }
.check-toggle svg { width: 16px; height: 16px; }

/* Landing */
.hero { background: var(--green); color: #fff; padding: 48px 16px 70px; text-align: center; }
.hero h1 { font-size: 2.2rem; }
.hero p { opacity: .85; max-width: 560px; margin: 0 auto; }
.portal-grid { max-width: 940px; margin: -44px auto 0; padding: 0 16px 40px; display: grid; gap: 14px; }
@media (min-width: 760px) { .portal-grid { grid-template-columns: repeat(3, 1fr); } }
.portal { text-decoration: none; color: inherit; display: block; }
.portal:hover { transform: translateY(-2px); }
.portal .icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); margin-bottom: 10px; }
.portal .icon svg { width: 26px; height: 26px; }

.ring { --p: 0; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--green-2) calc(var(--p) * 1%), #eee9e0 0); }
.ring > div { width: 56px; height: 56px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; font-size: .95rem; }

.select-viewer { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 6px 10px; max-width: 220px; }
.select-viewer option { color: #000; }
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }
@media (max-width: 520px) {
  .brand span { display: none; }
  .brand b { font-size: 1rem; }
  .select-viewer { max-width: 150px; font-size: .85rem; }
}

/* ---------- Mulford brand (from their logo: black horse, green lettering) ---------- */
:root {
  --green: #2a6234;
  --green-2: #3f8a45;
  --lime: #71af56;
  --green-soft: #e6f2e2;
}
.topbar { background: #fff; color: var(--ink); border-bottom: 4px solid var(--lime); padding: 10px 16px; }
.brand img { display: block; height: 40px; width: auto; }
.role-pill { background: var(--green-soft); color: var(--green); font-weight: 600; }
.select-viewer { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.badge.red { background: #fbe4e0; color: #9a2f1f; }

.hero.photo {
  position: relative; color: #fff; text-align: center; padding: 56px 16px 84px;
  background: linear-gradient(180deg, rgba(10,25,12,.35), rgba(10,25,12,.75)), url('/img/hero.jpg') center 35% / cover no-repeat;
}
.hero .logo-card { display: inline-block; background: #fff; padding: 10px 16px; border-radius: 12px; margin-bottom: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.hero .logo-card img { display: block; height: 52px; width: auto; }
.hero .tag { display: inline-block; background: var(--lime); color: #10230f; font-weight: 700; font-size: .8rem; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }

.banner { display: flex; gap: 14px; align-items: center; background: linear-gradient(120deg, var(--green), var(--green-2)); color: #fff; border-radius: var(--radius); padding: 16px; }
.banner h3 { color: #fff; margin: 0 0 4px; }
.banner p { margin: 0; opacity: .9; font-size: .9rem; }
.banner .btn { background: var(--lime); border-color: var(--lime); color: #10230f; font-weight: 700; flex: none; }

.horses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .horses { grid-template-columns: repeat(6, 1fr); } }
.horse { text-align: center; font-weight: 600; font-size: .9rem; }
.horse img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 4px; }

.clip .poster.photo { background-size: cover; background-position: center; position: relative; }
.clip .poster.photo::after { content: ''; position: absolute; inset: 0; background: rgba(15,30,18,.45); }
.clip .poster.photo > div { position: relative; z-index: 1; color: #fff; }
.horse-chip { display: inline-flex; align-items: center; gap: 6px; }
.horse-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

.event-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.event-row:last-child { border-bottom: 0; }
.event-date { width: 48px; flex: none; text-align: center; border-radius: 10px; background: var(--cream); border: 1px solid var(--line); padding: 4px 0; line-height: 1.1; }
.event-date b { display: block; font-size: 1.15rem; }
.event-date span { font-size: .7rem; text-transform: uppercase; color: var(--muted); }
.event-date.closed { background: #fbe4e0; border-color: #f0c4bb; }

.session-pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.session-pick.on { border-color: var(--green-2); background: var(--green-soft); }
.session-pick.full { opacity: .5; cursor: not-allowed; }
.session-pick .grow { flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 40px; }
.footer a { color: var(--green); }
