:root{
  --parchment: #F7F0DE;
  --parchment-deep: #EEE3C4;
  --ink: #3A2E26;
  --barn: #8B3A2F;
  --barn-deep: #6E2C23;
  --sage: #6B8068;
  --sage-deep: #536354;
  --hay: #D4A24C;
  --hay-deep: #B7852F;
  --plum: #5C4B63;
  --cream-card: #FFFBF0;
  --water: #6E9CAE;
  --line: rgba(58,46,38,0.14);
}

body{
  background: var(--parchment);
  color: var(--ink);
  font-family: 'Nunito Sans', sans-serif;
}

h1, h2, h3, .brand-font{
  font-family: 'Fraunces', serif;
}

.mono{ font-family: 'JetBrains Mono', monospace; }

/* ---------- NAVBAR ---------- */
.navbar-pasturely{
  background: var(--barn) !important;
}
.navbar-pasturely .navbar-brand,
.navbar-pasturely .nav-link{
  color: #fff !important;
  font-weight: 700;
}
.navbar-pasturely .nav-link:hover{
  color: #F3D9D3 !important;
}
.badge-ribbons{
  background: var(--barn-deep);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* ---------- HERO ---------- */
.hero-panel{
  background: linear-gradient(180deg, #F2E7C9 0%, var(--parchment-deep) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.hero-panel h1{ color: var(--barn-deep); font-weight: 600; }
.eyebrow{
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sage-deep); font-weight: 700;
}

/* ---------- CARDS ---------- */
.card-cream{
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

/* ---------- HORSE CARD ---------- */
.ribbon-tag{
  z-index: 5;   /* name plate sits on top of the horse portrait */
  display: inline-block; padding: 6px 12px; border-radius: 0 0 8px 8px;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 15px; color: #fff;
}
.ribbon-tag .breed{
  display: block; font-family: 'Nunito Sans', sans-serif; font-weight: 600; font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase; opacity: .85;
}
.horse-art{ width: 100%; height: 108px; }
#detail-art .horse-art{ height:180px; }
#horse-details{ --bs-offcanvas-width:min(440px, 92vw); }
.profile-horse-art .horse-art{ height:240px; }
.profile-tabs .nav-link{ color:var(--barn-deep); font-weight:800; white-space:nowrap; }
.profile-tabs .nav-link.active{ background:var(--cream-card); color:var(--barn-deep); border-bottom-color:var(--cream-card); }
.profile-tabs{ scrollbar-width:none; -ms-overflow-style:none; }
.profile-tabs::-webkit-scrollbar{ display:none; }
@media (min-width:768px){ .profile-tabs{ overflow-x:visible !important; } }
.bonding-grid .btn{ background:rgba(255,255,255,.35); border-color:var(--line); color:var(--ink); }
.bonding-grid .btn:hover:not(:disabled){ background:var(--parchment-deep); border-color:var(--hay-deep); transform:translateY(-1px); }
.meta-row{ font-size: 11px; opacity: .55; font-family: 'JetBrains Mono', monospace; }
.mood-text{ font-size: 12px; font-weight: 700; opacity: .7; }

.stat-label{
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  opacity: .65;
}
.stat-num{ font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.potential{ opacity: .5; font-weight: 600; }

.progress{ background: var(--parchment-deep); height: 8px; }
.progress-bar{ transition:width .65s cubic-bezier(.22,.8,.35,1); }
.bg-hunger{ background: var(--hay-deep) !important; }
.bg-cleanliness{ background: var(--water) !important; }
.bg-trust{ background: var(--barn) !important; }
.bg-speed{ background: var(--hay-deep) !important; }
.bg-stamina{ background: var(--sage-deep) !important; }
.bg-agility{ background: var(--plum) !important; }
.bg-discipline{ background: var(--water) !important; }

/* ---------- BUTTONS ---------- */
.btn-groom{ background: var(--sage); border-color: var(--sage-deep); color: #fff; font-weight: 700; }
.btn-groom:hover{ background: var(--sage-deep); color: #fff; }
.btn-feed{ background: var(--hay); border-color: var(--hay-deep); color: var(--ink); font-weight: 700; }
.btn-feed:hover{ background: var(--hay-deep); color: var(--ink); }
.btn-treat{ background:#B84A3A; border-color:var(--barn-deep); color:#fff; font-weight:700; }
.btn-treat:hover{ background:var(--barn-deep); color:#fff; }
.btn-mint{ background:#F4F1EA; border-color:#C62828; color:#A32121; font-weight:700; }   /* peppermint: white with a red edge */
.btn-mint:hover{ background:#fff; border-color:#A32121; color:#8B1A1A; }
.btn-train{ background: var(--plum); border-color: #4A3B54; color: #fff; font-size: 12px; font-weight: 700; }
.btn-train:hover{ background: #6E5A79; color: #fff; }
.btn-train:disabled{ background: var(--parchment-deep); color: var(--ink); opacity: .7; border-color: var(--line); }
.btn-barn{ background: var(--barn); border-color: var(--barn-deep); color: #fff; font-weight: 700; }
.btn-barn:hover{ background: var(--barn-deep); color: #fff; }

/* ---------- SWATCH PICKER ---------- */
.swatch-grid{ display:flex; flex-wrap:wrap; gap:12px; }
.swatch-option{ text-align:center; cursor:pointer; }
.swatch{
  width:34px; height:34px; border-radius:50%;
  border:3px solid transparent; transition:border-color .15s ease, transform .1s ease;
}
.swatch:hover{ transform:scale(1.08); }
.swatch.selected{ border-color: var(--ink); }
.swatch-label{ font-size:10px; opacity:.65; }

/* ---------- FLOATIE ---------- */
.floatie{
  position:absolute; top:-6px; right:8px; font-family:'JetBrains Mono',monospace;
  font-weight:700; font-size:13px; color: var(--sage-deep);
  animation: float-up 1s ease forwards; pointer-events:none;
}
@keyframes float-up{
  0%{opacity:0; transform:translateY(6px);}
  20%{opacity:1;}
  100%{opacity:0; transform:translateY(-22px);}
}
.floatie-groom{ color:var(--water); }
.floatie-feed{ color:var(--hay-deep); }
.floatie-train{ color:var(--plum); }
.floatie-treat{ color:var(--barn); }
.card-action-groom{ animation:card-groom .65s ease; }
.card-action-feed{ animation:card-feed .65s ease; }
.card-action-train{ animation:card-train .65s ease; }
.card-action-treat{ animation:card-feed .65s ease; }
@keyframes card-groom{
  0%,100%{ box-shadow:none; }
  45%{ box-shadow:0 0 0 4px rgba(126,174,196,.22),0 10px 24px rgba(45,35,28,.12); }
}
@keyframes card-feed{
  0%,100%{ transform:scale(1); }
  45%{ transform:scale(1.012); }
}
@keyframes card-train{
  0%,100%{ transform:translateY(0); }
  45%{ transform:translateY(-4px); box-shadow:0 10px 24px rgba(45,35,28,.14); }
}

/* ---------- AUTH PAGES ---------- */
.auth-wrap{ max-width: 440px; }

#breed-preview .horse-art {
    display: block;
    width: 100%;
    max-width: 360px;
    height: 180px;
    margin-inline: auto;
}

.horse-profile-preview {
    flex: 0 1 180px;
    max-width: 180px;
}

.horse-profile-preview .horse-art {
    display: block;
    width: 100%;
    height: 120px;
    margin-inline: auto;
}

.horse-profile-preview p {
    width: 100%;
    text-align: center;
}


/* =====================================================================
   TACK ROOM THEME
   Barn boards, saddle leather, saddle stitching and brass fittings,
   drawn entirely in CSS (no images). Delete this section to go back
   to the plain look.
   ===================================================================== */
:root{
  --leather: #7A4A2A;
  --leather-deep: #55311C;
  --saddle: #9C6337;
  --brass: #C9A24A;
  --brass-light: #E8CF8A;
  --brass-deep: #8E6F2A;
  --wood: #5E3B22;
  --stitch-light: rgba(247, 232, 204, .55);   /* thread on dark leather */
  --stitch-dark: rgba(122, 74, 42, .32);       /* thread on cream */
  --rivet: radial-gradient(circle at 35% 35%, var(--brass-light) 0 1.4px, var(--brass) 2.2px, var(--brass-deep) 3.4px, transparent 4px);
}

/* ---------- PAGE: faint linen weave ---------- */
body{
  background-color: var(--parchment);
  background-image:
    repeating-linear-gradient(0deg, rgba(58,46,38,.025) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(58,46,38,.02) 0 1px, transparent 1px 5px);
}
::selection{ background: var(--brass-light); color: var(--ink); }
mark{ background: rgba(212,162,76,.38); color: inherit; border-radius: 3px; }
hr{ border: 0; border-top: 2px dashed var(--stitch-dark); opacity: 1; }

/* ---------- NAVBAR: barn boards with a brass rail ---------- */
.navbar-pasturely{
  background-color: var(--barn) !important;
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 2px, transparent 2px 140px),           /* board seams */
    repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 1px, transparent 1px 7px),      /* grain */
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.12)) !important;
  border-bottom: 4px solid var(--brass);
  box-shadow: 0 1px 0 var(--brass-deep), 0 6px 14px rgba(58,46,38,.18) !important;
}
.navbar-pasturely .nav-link{ border-radius: 8px; }
.navbar-pasturely .nav-link:hover,
.navbar-pasturely .nav-link.active{ background: rgba(0,0,0,.14); }

/* Balance badge: a leather tag with a brass edge */
.badge-ribbons{
  background: linear-gradient(180deg, var(--leather), var(--leather-deep));
  border: 1.5px solid var(--brass);
  box-shadow: inset 0 0 0 2px var(--leather-deep), inset 0 0 0 3px var(--stitch-light);
  letter-spacing: .02em;
}
a.badge-ribbons:hover{ filter: brightness(1.1); }

/* Small light badges (season, etc.): a stitched parchment tag */
.badge.text-bg-light{
  background: var(--cream-card) !important;
  color: var(--ink) !important;
  border: 1px solid var(--stitch-dark) !important;
  box-shadow: inset 0 0 0 2px var(--cream-card), inset 0 0 0 3px var(--stitch-dark);
  font-weight: 700;
}

/* ---------- HERO: a parchment notice pinned with brass tacks ---------- */
.hero-panel{
  position: relative;
  background-color: #F2E7C9;
  background-image:
    var(--rivet), var(--rivet), var(--rivet), var(--rivet),
    linear-gradient(180deg, #F4EBCF 0%, var(--parchment-deep) 100%);
  background-repeat: no-repeat;
  background-size: 10px 10px, 10px 10px, 10px 10px, 10px 10px, auto;
  background-position: 12px 12px, calc(100% - 12px) 12px, 12px calc(100% - 12px), calc(100% - 12px) calc(100% - 12px), 0 0;
  border: 1px solid rgba(122,74,42,.28);
  box-shadow: 0 2px 0 rgba(122,74,42,.12), 0 10px 24px rgba(58,46,38,.08);
}
.hero-panel::before{
  content: ""; position: absolute; inset: 7px; border-radius: 14px;
  border: 1.5px dashed var(--stitch-dark); pointer-events: none;
}

/* ---------- CARDS: cream leather with saddle stitching ---------- */
.card-cream{
  position: relative;
  border: 1px solid rgba(122,74,42,.22);
  box-shadow: 0 1px 0 rgba(122,74,42,.10), 0 6px 16px rgba(58,46,38,.06);
}
.card-cream::before{
  content: ""; position: absolute; inset: 6px; border-radius: 11px;
  border: 1.5px dashed var(--stitch-dark); pointer-events: none; z-index: 0;
}
.card-cream > *{ position: relative; z-index: 1; }
/* Cards that hold a full-bleed table skip the stitch; the table gets its own header strap */
.card-cream.overflow-hidden::before{ display: none; }

/* ---------- BUTTONS: tooled leather with a pressed edge ---------- */
.btn-groom, .btn-feed, .btn-treat, .btn-mint, .btn-train, .btn-barn{
  background-image: linear-gradient(180deg, rgba(255,255,255,.16), rgba(0,0,0,.08));
  border-width: 1px 1px 3px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.06);
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}
.btn-feed, .btn-mint{ text-shadow: none; }
.btn-groom:hover, .btn-feed:hover, .btn-treat:hover, .btn-mint:hover, .btn-train:hover:not(:disabled), .btn-barn:hover{
  filter: brightness(1.04);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.06), 0 3px 8px rgba(58,46,38,.18);
}
.btn-groom:active, .btn-feed:active, .btn-treat:active, .btn-mint:active, .btn-train:active, .btn-barn:active{
  transform: translateY(2px);
  border-bottom-width: 1px;
  margin-bottom: 2px;
}
.btn-train:disabled{ background-image: none; text-shadow: none; border-bottom-width: 1px; }

/* Secondary / outline buttons: a plain leather strap */
.btn-outline-secondary, .btn-outline-success{
  --bs-btn-color: var(--leather);
  --bs-btn-border-color: rgba(122,74,42,.45);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--leather);
  --bs-btn-hover-border-color: var(--leather-deep);
  --bs-btn-active-bg: var(--leather-deep);
  --bs-btn-active-border-color: var(--leather-deep);
  font-weight: 700;
  border-radius: 10px;
}
.btn-link{ color: var(--barn-deep); }

/* ---------- FORMS: parchment fields with a brass focus ring ---------- */
.form-control, .form-select{
  background-color: #FFFDF6;
  border: 1px solid rgba(122,74,42,.35);
  border-radius: 10px;
  color: var(--ink);
  box-shadow: inset 0 2px 3px rgba(58,46,38,.06);
}
.form-control::placeholder{ color: rgba(58,46,38,.45); }
.form-control:focus, .form-select:focus{
  background-color: #fff;
  border-color: var(--brass-deep);
  box-shadow: inset 0 2px 3px rgba(58,46,38,.06), 0 0 0 .22rem rgba(201,162,74,.35);
}
.form-label{ color: var(--leather-deep); }
.form-check-input:checked{ background-color: var(--leather); border-color: var(--leather-deep); }
.form-check-input:focus{ border-color: var(--brass-deep); box-shadow: 0 0 0 .2rem rgba(201,162,74,.35); }

/* ---------- TABLES: a saddle-leather header strap ---------- */
.table{
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-hover-bg: rgba(212,162,76,.12);
  --bs-table-border-color: rgba(122,74,42,.14);
}
.table > thead > tr > th{
  background: linear-gradient(180deg, var(--saddle), var(--leather));
  color: #FBEFD9;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 2px dashed var(--stitch-light);
  padding-top: .75rem; padding-bottom: .75rem;
}
.table > tbody > tr:nth-child(even) > td{ background: rgba(238,227,196,.28); }

/* ---------- PAGINATION: brass studs on a stitched leather strap ---------- */
.pagination{
  --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(201,162,74,.45);
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 8px 12px;
  gap: 6px;
  align-items: center;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,.03) 0 1px, transparent 1px 5px),   /* leather grain */
    linear-gradient(180deg, var(--saddle), var(--leather) 55%, var(--leather-deep));
  border: 1px solid var(--leather-deep);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 10px rgba(58,46,38,.22);
}
.pagination::before{            /* saddle stitching around the strap */
  content: ""; position: absolute; inset: 4px; border-radius: 999px;
  border: 1.5px dashed var(--stitch-light); pointer-events: none; z-index: 0;
}
.pagination .page-item{ position: relative; z-index: 1; }

/* Page numbers: aged brass studs */
.pagination .page-link{
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; gap: .3em;
  min-width: 34px; height: 34px; padding: 0 6px;
  margin: 0 !important;
  border-radius: 999px !important;
  border: 1px solid var(--brass-deep);
  background: radial-gradient(circle at 35% 30%, #EAD9A6, #BFA25A 58%, #8C7134);
  color: var(--leather-deep);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 13px; line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.35);
  text-decoration: none;
  transition: transform .1s ease, filter .15s ease;
}
.pagination .page-link:hover{
  filter: brightness(1.12) saturate(1.1);
  transform: translateY(-1px);
  color: var(--ink);
}

/* Current page: freshly polished, slightly raised */
.pagination .page-item.active .page-link{
  background: radial-gradient(circle at 35% 28%, #FFF4CF, var(--brass-light) 30%, var(--brass) 62%, var(--brass-deep));
  color: var(--ink);
  border-color: #F4DE9C;
  transform: scale(1.12);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.7),
              0 0 0 2px rgba(232,207,138,.35), 0 2px 6px rgba(0,0,0,.4);
}

/* Prev / Next: tooled leather tags at each end of the strap */
.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link{
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.24));
  border: 1px solid rgba(0,0,0,.25);
  color: #FBEFD9;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.pagination .page-item:first-child .page-link:hover,
.pagination .page-item:last-child .page-link:hover{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.14));
  color: #fff;
}

/* Ellipsis: just a few stitches */
.pagination .page-item.disabled:not(:first-child):not(:last-child) .page-link{
  background: none; border: 0; box-shadow: none;
  color: var(--stitch-light); min-width: 18px; padding: 0;
}

/* Disabled Prev / Next */
.pagination .page-item.disabled:first-child .page-link,
.pagination .page-item.disabled:last-child .page-link{
  opacity: .45; background: transparent;
}

/* Wrapped onto two lines on small screens: soften the pill */
@media (max-width: 575.98px){
  .pagination{ border-radius: 22px; padding: 8px; gap: 5px; }
  .pagination::before{ border-radius: 18px; }
  .pagination .page-link{ min-width: 30px; height: 30px; font-size: 12px; }
  .pagination .page-item:first-child .page-link,
  .pagination .page-item:last-child .page-link{ padding: 0 12px; font-size: 16px; }
  .pagination .page-item.page-far{ display: none; }   /* keep one neighbour each side on phones */
}
@media (prefers-reduced-motion: reduce){
  .pagination .page-link{ transition: none; }
  .pagination .page-link:hover{ transform: none; }
}

/* ---------- TABS: leather file tabs ---------- */
.nav-tabs{ border-bottom: 2px solid rgba(122,74,42,.25); }
.nav-tabs .nav-link{ border-radius: 10px 10px 0 0; }
.nav-tabs .nav-link:hover{ border-color: transparent; background: rgba(212,162,76,.15); }
.nav-tabs .nav-link.active{
  border-color: rgba(122,74,42,.25) rgba(122,74,42,.25) var(--cream-card);
  border-top: 3px solid var(--brass);
}

/* ---------- PROGRESS: a recessed leather channel ---------- */
.progress{
  border-radius: 99px;
  box-shadow: inset 0 1px 2px rgba(58,46,38,.18);
}
.progress-bar{ background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(0,0,0,.06)); }

/* ---------- ALERTS: parchment notes with a leather strap ---------- */
.alert{
  background: var(--cream-card);
  color: var(--ink);
  border: 1px solid rgba(122,74,42,.22);
  border-left: 6px solid var(--leather);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(58,46,38,.06);
}
.alert-success{ border-left-color: var(--sage-deep); }
.alert-danger { border-left-color: var(--barn); }
.alert-warning{ border-left-color: var(--hay-deep); }
.alert-info   { border-left-color: var(--water); }
.alert-heading{ color: var(--barn-deep); }

/* ---------- MODALS, OFFCANVAS, DROPDOWNS, TOOLTIPS ---------- */
.modal-content, .offcanvas, .dropdown-menu{
  background: var(--cream-card);
  color: var(--ink);
  border: 1px solid rgba(122,74,42,.25);
}
.modal-header, .offcanvas-header{ border-bottom: 2px dashed var(--stitch-dark); }
.modal-footer{ border-top: 2px dashed var(--stitch-dark); }
.dropdown-item:hover, .dropdown-item:focus{ background: rgba(212,162,76,.18); }
.tooltip{ --bs-tooltip-bg: var(--leather-deep); --bs-tooltip-color: #FBEFD9; }

/* ---------- KEYBOARD FOCUS: always visible ---------- */
.btn:focus-visible, .page-link:focus-visible, .nav-link:focus-visible, a.badge:focus-visible{
  outline: 2px solid var(--brass-deep);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  .btn-groom, .btn-feed, .btn-treat, .btn-mint, .btn-train, .btn-barn{ transition: none; }
  .btn-groom:active, .btn-feed:active, .btn-treat:active, .btn-mint:active, .btn-train:active, .btn-barn:active{ transform: none; }
}

/* ---------- DIVISIONS: leather tabs, colored chips, swatches ---------- */
.division-tabs{ gap: 6px; flex-wrap: wrap; }
.division-tabs .nav-link{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(122,74,42,.28);
  background: var(--cream-card);
  color: var(--leather-deep);
  font-weight: 800; font-size: 14px;
  box-shadow: 0 1px 0 rgba(122,74,42,.10);
}
.division-tabs .nav-link:hover{ background: rgba(212,162,76,.16); color: var(--ink); }
.division-tabs .nav-link.active{
  background: linear-gradient(180deg, var(--saddle), var(--leather));
  border-color: var(--leather-deep);
  color: #FBEFD9;
  box-shadow: inset 0 0 0 2px var(--leather), inset 0 0 0 3px var(--stitch-light);
}
.division-dot{
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--division-color, var(--sage));
  box-shadow: 0 0 0 2px rgba(255,255,255,.7);
}
.division-count{
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(122,74,42,.12);
}
.division-tabs .nav-link.active .division-count{ background: rgba(0,0,0,.22); }

.division-chip{
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--division-color, var(--sage));
  color: #fff; font-size: 12px; font-weight: 800;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28);
  text-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.division-move .form-select{ font-size: 13px; }
.division-card{ border-left: 6px solid var(--division-color, var(--sage)); }

.division-swatches{ display: flex; flex-wrap: wrap; gap: 8px; }
.division-swatch{
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  background: var(--division-color);
  border: 3px solid var(--cream-card);
  box-shadow: 0 0 0 1px rgba(122,74,42,.35);
  transition: transform .1s ease;
}
.division-swatch:hover{ transform: scale(1.08); }
.btn-check:checked + .division-swatch{ box-shadow: 0 0 0 2px var(--ink); }
.btn-check:focus-visible + .division-swatch{ outline: 2px solid var(--brass-deep); outline-offset: 3px; }

/* ---------- LOGIN & REGISTER: the barn door ---------- */
.auth-body{
  min-height: 100vh;
  background-color: #4A2E1B;
  background-image:
    radial-gradient(ellipse at 50% 35%, rgba(255,214,150,.18), transparent 60%),        /* lantern glow */
    repeating-linear-gradient(90deg, rgba(0,0,0,.28) 0 2px, transparent 2px 96px),        /* board seams */
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 9px),  /* grain */
    linear-gradient(180deg, #5E3B22, #3E2616);
}
.auth-shell{
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
}
.auth-card{
  width: 100%; max-width: 900px;
  display: grid; grid-template-columns: 1fr;
  border-radius: 22px; overflow: hidden;
  border: 2px solid var(--brass-deep);
  box-shadow: 0 0 0 5px rgba(0,0,0,.18), 0 24px 60px rgba(0,0,0,.45);
  background: var(--cream-card);
}
@media (min-width: 768px){ .auth-card{ grid-template-columns: 5fr 6fr; } }

/* Barn door: red boards, white trim and a cross brace */
.auth-door{
  position: relative;
  padding: 18px;
  background-color: var(--barn);
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 46px),
    repeating-linear-gradient(180deg, rgba(255,255,255,.03) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.18));
}
.auth-door-inner{
  position: relative; height: 100%; min-height: 200px;
  border: 10px solid #F3EAD7;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.12), 0 1px 0 rgba(255,255,255,.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 28px 18px; text-align: center;
  background:
    linear-gradient(to top right, transparent calc(50% - 7px), #F3EAD7 calc(50% - 7px), #F3EAD7 calc(50% + 7px), transparent calc(50% + 7px)),
    linear-gradient(to top left,  transparent calc(50% - 7px), #F3EAD7 calc(50% - 7px), #F3EAD7 calc(50% + 7px), transparent calc(50% + 7px));
}
.auth-horseshoe{ filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); position: relative; z-index: 1; }
.auth-plate{
  position: relative; z-index: 1;
  padding: 10px 26px;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 25%, #FFF4CF, var(--brass-light) 30%, var(--brass) 70%, var(--brass-deep));
  border: 1px solid var(--brass-deep);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.6), 0 6px 14px rgba(0,0,0,.35);
}
.auth-plate::before, .auth-plate::after{       /* screw heads */
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d8, #8E6F2A 70%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.auth-plate::before{ left: 8px; } .auth-plate::after{ right: 8px; }
.auth-plate-name{
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 30px; letter-spacing: .02em;
  color: #4A3410; text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.auth-door-line{
  position: relative; z-index: 1; margin: 0; max-width: 260px;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(62,38,22,.78);
  color: #FBEFD9; font-style: italic; font-size: 14px;
}

/* Form side: stitched parchment */
.auth-form{
  position: relative;
  padding: 36px 32px 28px;
  background: var(--cream-card);
}
.auth-form::before{
  content: ""; position: absolute; inset: 10px; border-radius: 14px;
  border: 1.5px dashed var(--stitch-dark); pointer-events: none;
}
.auth-form > *{ position: relative; }
.auth-form h1{ font-size: 30px; color: var(--barn-deep); font-weight: 600; }
@media (max-width: 767.98px){
  .auth-door-inner{ min-height: 0; padding: 18px; gap: 10px; }
  .auth-horseshoe{ width: 48px; height: 48px; }
  .auth-plate-name{ font-size: 24px; }
  .auth-door-line{ display: none; }
  .auth-form{ padding: 28px 22px 22px; }
}

/* Inputs with a leather icon cap */
.auth-input .input-group-text{
  background: linear-gradient(180deg, var(--saddle), var(--leather));
  border: 1px solid var(--leather-deep);
  color: #fff; border-radius: 10px 0 0 10px;
  min-width: 44px; justify-content: center;
}
.auth-input .form-control{ border-left: 0; }
.auth-input .form-control:not(:last-child){ border-right: 0; }
.auth-reveal{
  border: 1px solid rgba(122,74,42,.35); border-left: 0;
  background: #FFFDF6; color: var(--leather);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  border-radius: 0 10px 10px 0;
}
.auth-reveal:hover{ background: var(--parchment-deep); color: var(--leather-deep); }

.auth-divider{
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 14px; color: rgba(58,46,38,.55); font-size: 13px;
}
.auth-divider::before, .auth-divider::after{
  content: ""; flex: 1; border-top: 2px dashed var(--stitch-dark);
}
.auth-back{ color: var(--leather); text-decoration: none; font-weight: 700; }
.auth-back:hover{ color: var(--barn-deep); text-decoration: underline; }

/* ---------- PASTURELY ICONS (icons.php) ---------- */
.pi{ display: inline-block; flex-shrink: 0; vertical-align: -0.2em; }
.auth-input .input-group-text .pi{
  width: 20px; height: 20px;
  color: var(--brass-light);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.35));
}

/* ---------- PERSONALITY: temperament badges, quirks, journal ---------- */
.temperament-badge{
  display: inline-flex; align-items: center; gap: 4px;
  padding: .35em .65em; border-radius: 999px;
  font-size: .75em; font-weight: 800; line-height: 1;
  border: 1px solid transparent;
  vertical-align: middle;
}
.temperament-shy        { background: #E6E2F0; color: #4A3F63; border-color: #CFC7E2; }
.temperament-bold       { background: #F7DDD3; color: #8B3A2F; border-color: #EBC0B1; }
.temperament-moochy     { background: #F6E3C4; color: #7A4A2A; border-color: #E8CB98; }
.temperament-velcro     { background: #F5DCE4; color: #7E3450; border-color: #E9BFCD; }
.temperament-independent{ background: #DFE8DA; color: #3F5A3B; border-color: #C5D5BE; }
.temperament-easygoing  { background: #DCE9F2; color: #2F5470; border-color: #BFD6E6; }

.personality-card{
  padding: 14px 16px; border-radius: 12px;
  background: rgba(238,227,196,.35);
  border: 1px dashed var(--stitch-dark);
}

.quirk-slot{
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 12px;
  border: 1px solid rgba(122,74,42,.18);
}
.quirk-icon{ font-size: 22px; line-height: 1; width: 28px; text-align: center; }
.quirk-revealed{ background: #FFFDF6; box-shadow: 0 1px 0 rgba(122,74,42,.08); }
.quirk-hidden{ background: repeating-linear-gradient(135deg, rgba(122,74,42,.04) 0 8px, transparent 8px 16px); }
.quirk-hidden .quirk-icon{ opacity: .6; }

/* Journal: a stitched timeline down the left edge */
.journal{ list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.journal::before{
  content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px;
  border-left: 2px dashed var(--stitch-dark);
}
.journal-entry{ position: relative; display: flex; gap: 14px; padding: 8px 0; }
.journal-icon{
  position: relative; z-index: 1; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px;
  background: var(--cream-card);
  border: 2px solid rgba(122,74,42,.25);
}
.journal-quirk .journal-icon,
.journal-show .journal-icon,
.journal-arrival .journal-icon,
.journal-birth .journal-icon{
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(201,162,74,.18);
}
.journal-body{ padding-top: 2px; }
.journal-date{
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--sage-deep);
}
.journal-quirk .journal-body > div:last-child,
.journal-show .journal-body > div:last-child,
.journal-arrival .journal-body > div:last-child,
.journal-birth .journal-body > div:last-child{ font-weight: 700; }

/* ---------- LINKS: barn red with a stitched-thread underline ---------- */
/* Bootstrap reads these variables for every plain link, .link-* helper and .btn-link. */
:root{
  --bs-link-color: #8B3A2F;            /* --barn */
  --bs-link-color-rgb: 139, 58, 47;
  --bs-link-hover-color: #6E2C23;      /* --barn-deep */
  --bs-link-hover-color-rgb: 110, 44, 35;
}

/* Plain text links only. Buttons, nav, badges and pagination keep their own styles. */
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.page-link):not(.badge):not(.dropdown-item):not(.list-group-item){
  color: var(--barn);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-style: dashed;               /* reads like saddle stitching */
  text-decoration-color: rgba(139, 58, 47, .4);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.page-link):not(.badge):not(.dropdown-item):not(.list-group-item):hover{
  color: var(--barn-deep);
  text-decoration-style: solid;
  text-decoration-color: var(--brass);
}
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.page-link):not(.badge):focus-visible{
  outline: 2px solid var(--brass-deep);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Links that already set text-decoration-none (e.g. "← Back to your herd") stay clean */
a.text-decoration-none:not(.btn){ text-decoration: none !important; }
a.text-decoration-none:not(.btn):hover{ text-decoration: underline !important; text-decoration-color: var(--brass) !important; }

/* Links inside table rows (Player Directory, etc.) */
.table a:not(.btn){ color: var(--leather-deep); }
.table a:not(.btn):hover{ color: var(--barn); }

/* ---------- RESCUE CENTER & REHAB ---------- */
.rescue-badge{
  display: inline-flex; align-items: center; gap: 4px;
  padding: .35em .65em; border-radius: 999px;
  font-size: .75em; font-weight: 800; line-height: 1;
  vertical-align: middle; border: 1px solid transparent;
}
.rescue-rehab{ background: #FBE7D6; color: #8A4A1F; border-color: #F0CBA9; }
.rescue-done{
  background: radial-gradient(circle at 35% 30%, #FFF4CF, var(--brass-light) 45%, var(--brass));
  color: #4A3410; border-color: var(--brass-deep);
}
.rescue-story{
  font-size: 14px; color: rgba(58,46,38,.8);
  padding-left: 10px; border-left: 3px solid rgba(200,100,43,.35);
}
.rescue-card .horse-art{ height: 110px; }
.rescue-progress-row + .rescue-progress-row{ border-top: 1px dashed var(--stitch-dark); }
.rehab-strip{
  padding: 12px 14px; border-radius: 12px;
  background: #FFF6EC; border: 1px solid #F0CBA9;
}

/* ---------- GUIDE PAGE ---------- */
.guide{ font-size: .9375rem; line-height: 1.6; }
/* Guide explanations, notes and tables share one readable body size. */
.guide section :is(p, ul, ol, li, table, td, th, small, .small){ font-size: .9375rem; }
.guide section table.table th{
  font-family: inherit; font-size: .875rem; font-weight: 600; line-height: 1.4;
  letter-spacing: .02em; text-transform: none; padding-top: .5rem; padding-bottom: .5rem;
}
.guide h2{ font-size: 22px; color: var(--barn-deep); margin-bottom: .75rem; }
.guide section{ scroll-margin-top: 16px; }
.guide-toc a{ display: block; padding: 3px 0; font-weight: 700; text-decoration: none !important; color: var(--leather-deep) !important; }
.guide-toc a:hover{ color: var(--barn) !important; }
.guide-tile{
  padding: 12px 14px; border-radius: 12px;
  background: rgba(238,227,196,.3); border: 1px dashed var(--stitch-dark);
}
.guide-toc.sticky-top{ position: sticky; }   /* .card-cream sets position: relative; keep the contents sticky */

/* ---------- PASTURELY ICON SET (game_icons.php) ---------- */
.gi{ display: inline-block; vertical-align: -0.24em; flex-shrink: 0; overflow: visible; }
/* Inside buttons, badges and chips, icons take the text color so they stay readable */
.btn .gi, .badge .gi, .temperament-badge .gi, .rescue-badge .gi, .division-chip .gi,
.division-tabs .nav-link.active .gi, .navbar-pasturely .gi, .auth-door .gi{ color: inherit !important; }
.fs-3 > .gi, .fs-4 > .gi, .quirk-icon > .gi, .journal-icon > .gi{ vertical-align: middle; }
.stat-label .gi{ width: 1.35em; height: 1.35em; vertical-align: -0.35em; margin-right: 2px; }
.toast .gi, .floatie .gi{ color: inherit !important; }   /* icons in toasts and floating messages match their text */

/* ---- Pasture (pasture.php, herd cards, horse profile) ---- */
.location-chip{ font-weight:700; border:1px solid var(--line); }
.location-chip.location-out, .badge.location-chip:not(.location-in){ background:#E3EBDD; color:var(--sage-deep); }
.location-chip.location-in{ background:#F2E2DA; color:var(--barn-deep); }
.location-chip:hover{ filter:brightness(.96); }
.weather-badge .gi{ width:1.35em; height:1.35em; vertical-align:-0.35em; }

.paddock-card{ overflow:hidden; }
.paddock-card .card-body{ display:flex; flex-direction:column; }
.paddock-field{
  height:46px; margin:-1px -1px 0; border-bottom:3px solid var(--leather);
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(85,49,28,.55) 46px 49px),
    linear-gradient(180deg, transparent 0 10px, rgba(85,49,28,.45) 10px 13px, transparent 13px 24px, rgba(85,49,28,.45) 24px 27px, transparent 27px),
    linear-gradient(0deg, var(--field) 0 var(--grass), var(--field-bare) var(--grass) 100%);
  --field:#7FA16A; --field-bare:#CDB98F;
}
.season-summer .paddock-field{ --field:#9AAE5A; }
.season-autumn .paddock-field{ --field:#A8A05A; --field-bare:#C9A779; }
.season-winter .paddock-field{ --field:#A9B9A6; --field-bare:#EEF1F2; }
.paddock-resting .paddock-field{ opacity:.7; }
.bg-grass{ background:linear-gradient(90deg, #8DB06F, #6B8068) !important; }
.season-autumn .bg-grass{ background:linear-gradient(90deg, #C3A55A, #8E8A4A) !important; }
.season-winter .bg-grass{ background:linear-gradient(90deg, #B7C6B4, #7F948B) !important; }
.paddock-chip{ background:var(--parchment-deep); color:var(--ink); font-weight:700; }
.paddock-chip-rest{ background:#E3EBDD; color:var(--sage-deep); }

.pasture-horse{ padding:8px 0; border-top:1px dashed var(--line); }
.pasture-horse:first-child{ border-top:0; }
.gear-chip{ margin-left:2px; }
.gear-btn{ background:#FFFDF6; border:1px solid var(--line); color:var(--ink); font-size:12px; font-weight:700; padding:2px 8px; }
.gear-btn:hover{ border-color:var(--hay-deep); }
.gear-btn.gear-on{ background:#E3EBDD; border-color:var(--sage); color:var(--sage-deep); }
.today-card ul li{ margin-bottom:2px; }

/* ---- Navbar menus (nav.php) ---- */
.navbar-pasturely .nav-link{ font-weight: 700; }
.navbar-pasturely .dropdown-menu{ border-radius: 10px; padding: 6px; box-shadow: 0 10px 24px rgba(58,46,38,.18); min-width: 13rem; }
.navbar-pasturely .dropdown-item{ border-radius: 6px; font-weight: 600; padding: 6px 10px; }
.navbar-pasturely .dropdown-item.active, .navbar-pasturely .dropdown-item:active{ background: var(--sage); color: #fff; }
.navbar-pasturely .dropdown-divider{ margin: 6px 4px; }
.nav-item-icon{ display: inline-block; width: 1.4em; text-align: center; }
/* Account button: a leather tag to match the Coppers badge beside it */
.navbar-pasturely .nav-user{
  font-weight: 800; color: #fff; border-radius: 999px; padding: 5px 14px 5px 12px;
  background: linear-gradient(180deg, var(--leather), var(--leather-deep));
  border: 1.5px solid var(--brass);
  box-shadow: inset 0 0 0 2px var(--leather-deep), inset 0 0 0 3px var(--stitch-light);
  transition: filter .15s ease, background .15s ease;
}
.navbar-pasturely .nav-user:hover,
.navbar-pasturely .nav-user:focus-visible{ color: #fff; filter: brightness(1.12); }
.navbar-pasturely .nav-user:focus-visible{ outline: 2px solid var(--brass-light); outline-offset: 2px; }
.navbar-pasturely .nav-user::after{ border-top-color: var(--brass-light); }
/* On Stable settings, the ledger or Admin (and while the menu is open): polished brass */
.navbar-pasturely .nav-user.active,
.navbar-pasturely .nav-user.show{
  color: var(--leather-deep);
  background: linear-gradient(180deg, var(--brass-light), var(--brass));
  border-color: var(--brass-deep);
  box-shadow: inset 0 0 0 2px var(--brass), inset 0 0 0 3px var(--stitch-dark);
}
.navbar-pasturely .nav-user.active::after,
.navbar-pasturely .nav-user.show::after{ border-top-color: var(--leather-deep); }
@media (max-width: 1199.98px){   /* the menu folds into the ☰ button below xl (navbar-expand-xl in nav.php) */
  .navbar-pasturely .navbar-collapse{ padding: 8px 0 4px; }
  .navbar-pasturely .dropdown-menu{ box-shadow: none; margin: 2px 0 6px; }
  .navbar-pasturely .nav-right{ justify-content: space-between; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,.25); }
}
@media (min-width: 1200px){ .navbar-pasturely .nav-link{ padding-left: .6rem; padding-right: .6rem; } }

/* ---- Announcements (Herd page, admin.php) ---- */
.announcement{ background: var(--cream-card); border: 1px solid rgba(122,74,42,.25); border-left: 6px solid var(--sage); color: var(--ink); box-shadow: 0 4px 12px rgba(58,46,38,.08); }
.announcement-event{ border-left-color: var(--barn); }
.announcement-update{ border-left-color: var(--hay-deep); }
.announcement-maintenance{ border-left-color: var(--plum); }
.announcement-meta{ font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sage-deep); }
.announcement-body{ white-space: normal; }
/* Discord-style formatting in announcements */
.announcement-body .md-h{ font-family: 'Fraunces', serif; font-weight: 700; color: var(--barn-deep); margin: 4px 0 2px; }
.announcement-body .md-h1{ font-size: 1.25rem; }
.announcement-body .md-h2{ font-size: 1.1rem; }
.announcement-body .md-h3{ font-size: 1rem; }
.announcement-body .md-gap{ height: .6em; }
.announcement-body .md-list{ margin: 2px 0 4px; padding-left: 1.3rem; }
.announcement-body .md-quote{ margin: 4px 0; padding: 4px 10px; border-left: 4px solid var(--hay); background: rgba(212,162,76,.12); border-radius: 0 6px 6px 0; }
.announcement-body code{ background: var(--parchment-deep); color: var(--leather-deep); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.md-spoiler{ background: var(--ink); color: transparent; border-radius: 4px; padding: 0 3px; cursor: pointer; transition: color .15s, background .15s; }
.md-spoiler:focus{ background: var(--parchment-deep); color: inherit; outline: none; }
.md-help summary{ cursor: pointer; color: var(--leather); font-weight: 700; }

/* ---- Coat picker groups (Find a Horse) ---- */
.coat-group-label{ font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sage-deep); margin: 10px 0 4px; }
.coat-group-label:first-of-type{ margin-top: 2px; }
.swatch-grid .swatch-option{ width: 62px; }
.swatch-option .swatch-label{ line-height: 1.15; margin-top: 2px; }
.swatch:focus-visible{ outline: 2px solid var(--leather); outline-offset: 2px; }
.coat-picked{ text-transform: none; letter-spacing: 0; }
.swatch{ box-shadow: inset 0 0 0 1px rgba(58,46,38,.18); }
/* Find a Horse: wider two-column card */
.adopt-card{ max-width: 980px; }
.adopt-preview{ min-height: 170px; display: flex; align-items: center; justify-content: center; background: rgba(238,227,196,.35); border-radius: 12px; padding: 10px; }
.adopt-preview .preview-shape svg{ width: 100%; max-width: 260px; height: auto; }
@media (min-width: 992px){ .adopt-coats{ border-left: 2px dashed var(--line); } }

/* ---- Horse portraits in the game (horse_look.php) ---- */
.horse-art-wrap{ display: block; width: 100%; }
.horse-art-wrap .hp{ margin: 0 auto; }
.card .horse-art-wrap .hp--card{ border: 2px solid rgba(122,74,42,.18); }
.profile-horse-art .hp--profile{ border: 3px solid rgba(122,74,42,.22); box-shadow: 0 6px 18px rgba(58,46,38,.12); }
/* Foals use their own proportions; stage scaling keeps their height below adults.
   Youngstock have their own adolescent proportions from ages 1 to under 3. */
.hp-stage-foal  .hp-horse{ transform: scale(calc(var(--hp-scale, 1) * .62)); }
.hp-stage-young .hp-horse{ transform: scale(calc(var(--hp-scale, 1) * .84)); }
.pasture-thumb{ display: block; width: 72px; flex: none; }
.pasture-thumb .hp{ border-radius: 8px; }
/* Look picker (Find a Horse, free makeover) */
.look-preview{ min-height: 180px; display: flex; align-items: center; justify-content: center; background: rgba(238,227,196,.35); border-radius: 12px; transition: opacity .15s; }
.look-preview.is-loading{ opacity: .55; }
.look-preview .hp{ max-width: 100%; }
.look-makeover{ border: 2px dashed var(--hay); }

/* ---------- Clipping (horse profile, Pasture tab) ---------- */
.clip-option{ cursor: pointer; background: #FFFDF6; border-color: rgba(122,74,42,.25) !important; transition: border-color .15s, box-shadow .15s; }
.clip-option:hover{ border-color: var(--brass) !important; }
.clip-option:has(input:checked){ border-color: var(--brass-deep) !important; box-shadow: 0 0 0 .2rem rgba(201,162,74,.3); background: #fff; }
.coat-card{ background: rgba(255,251,240,.6); border-color: rgba(122,74,42,.2) !important; }

/* ---------- Gear: stable color picker ---------- */
.gear-swatch-none{ background: repeating-linear-gradient(45deg, #e8e0cf 0 5px, #fffbf0 5px 10px) !important; }

/* ---------- HORSE PAGE: care & training ---------- */
.care-fx{ position: relative; }
.quick-care .btn{ white-space: nowrap; }
.hero-needs .stat-label{ font-size: 12px; }
.care-option{
  position: relative; height: 100%; display: flex; flex-direction: column;
  background: rgba(255,255,255,.55); border: 1px solid rgba(60,40,20,.12); border-radius: 14px; padding: 14px;
}
.care-option .care-icon{ font-size: 1.7rem; line-height: 1; }
.care-option p{ flex-grow: 1; }
.care-option .btn > .small{ display: block; }   /* supply count under the label in the narrow care cards */
.train-block{
  position: relative; background: rgba(255,255,255,.55);
  border: 1px solid rgba(60,40,20,.12); border-radius: 12px; padding: 12px 14px;
}

/* ---------- SCROLLING LISTS (horse page: recent activity, journal) ---------- */
.scroll-box{
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--leather, #7A4A2A) transparent;
}
.scroll-box-tall{ max-height: 520px; }
.scroll-box::-webkit-scrollbar{ width: 6px; }
.scroll-box::-webkit-scrollbar-thumb{ background: var(--leather, #7A4A2A); border-radius: 3px; }
.scroll-box:focus-visible{ outline: 2px solid var(--brass-deep, #8E6F2A); outline-offset: 2px; }

/* Tables in a scroll box: the header row stays put while the rows scroll */
.table-scroll{ padding-right: 0; overflow-x: auto; }
.table-scroll thead th{
  position: sticky; top: 0; z-index: 1;
  background: var(--parchment, #FFF8EC);        /* same as the card, so rows don't show through */
  box-shadow: inset 0 -1px 0 rgba(60,40,20,.15);  /* keeps the line under the header while scrolling */
}

/* ---------- NEWS: "Read more" previews and the archive ---------- */
.news-clamp.is-long{
  max-height: 8.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
          mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.news-more{ display: inline-block; margin-top: 4px; font-weight: 800; font-size: .9rem; color: var(--barn); text-decoration: none; }
.news-more:hover{ text-decoration: underline; }
.news-filter .btn{ border-radius: 999px; }
.news-post{ scroll-margin-top: 80px; }
.news-post + .news-post{ margin-top: 1rem; }
.news-post h2 a{ color: inherit; text-decoration: none; }
.news-post h2 a:hover{ text-decoration: underline; }
.news-past{ font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--parchment-deep); color: var(--ink); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 1px; }

/* News comments */
.news-comment{ padding: 12px 0; border-top: 1px solid rgba(60,40,20,.12); scroll-margin-top: 80px; }
.news-comment:first-of-type{ border-top: 0; padding-top: 4px; }
.news-comment:target{ background: rgba(201,162,74,.12); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.news-comment-body{ margin-top: 4px; overflow-wrap: anywhere; }
.news-comment-tools{ display: flex; gap: 12px; align-items: baseline; }
.news-comment-tools a{ text-decoration: none; font-weight: 700; }
.news-comment-badge{
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  padding: 3px 11px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.4;
  background: rgba(107,128,104,.14); color: var(--sage-deep); border: 1px solid rgba(107,128,104,.35);
  text-decoration: none !important; vertical-align: middle; transition: background .15s ease;
  align-self: flex-start; width: fit-content;   /* cards are flex columns: don't stretch */
}
.news-comment-badge:hover{ background: rgba(107,128,104,.26); color: var(--sage-deep); }
.news-comment-badge .news-comment-num{ font-family: 'JetBrains Mono', monospace; }
.news-comment-badge.is-empty{ background: transparent; border-style: dashed; opacity: .8; }
.news-comment-badge.is-static{ margin: 0 0 0 4px; padding: 1px 9px; font-family: 'Nunito Sans', sans-serif; }

/* ---------- SITE FOOTER (layout.php adds it to every page) ---------- */
body.has-footer{ min-height: 100vh; display: flex; flex-direction: column; }
body.has-footer > .site-footer{ margin-top: auto; }   /* sits at the bottom even on short pages */
.site-footer{
  margin-top: 3rem; padding: 26px 0 22px; color: #F7E8CC;
  background: linear-gradient(180deg, var(--barn), var(--barn-deep));
  border-top: 4px solid var(--brass);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.08);
}
.site-footer .container{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.site-footer-brand{ display: flex; flex-direction: column; line-height: 1.2; }
.site-footer-brand .brand-font{ font-size: 1.35rem; color: #fff; }
.site-footer-tag{ font-size: 13px; opacity: .8; }
.site-footer-links{ list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a{ color: #F7E8CC !important; font-weight: 700; text-decoration: none !important; }
.site-footer a:hover{ color: var(--brass-light) !important; text-decoration: underline !important; }
.site-footer-small{ width: 100%; font-size: 12px; opacity: .75; border-top: 1px dashed rgba(247,232,204,.3); padding-top: 12px; }
@media (max-width: 575.98px){
  .site-footer .container{ flex-direction: column; align-items: flex-start; }
}

/* ---------- STABLE THEMES (theme_lib.php, stable_themes.php) ---------- */
/* Bar at the bottom of every page while a theme is being previewed. */
.theme-preview-bar{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080;
  padding: 10px 0; color: #fff; font-size: 14px;
  background: linear-gradient(180deg, var(--leather), var(--leather-deep));
  border-top: 3px solid var(--brass); box-shadow: 0 -6px 18px rgba(0,0,0,.18);
}
body:has(.theme-preview-bar){ padding-bottom: 64px; }
/* Small picture of a theme: nav bar, header, card and two buttons in the theme's own colors. */
.theme-mini{
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: var(--parchment); box-shadow: 0 2px 8px rgba(58,46,38,.08);
}
.theme-mini .tm-nav{ height: 22px; background: var(--barn); border-bottom: 3px solid var(--brass); display: flex; gap: 6px; align-items: center; padding: 0 10px; }
.theme-mini .tm-nav span{ width: 22px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.75); }
.theme-mini .tm-body{ padding: 10px; display: grid; gap: 8px; }
.theme-mini .tm-hero{ height: 22px; border-radius: 7px; background: linear-gradient(180deg, var(--hero-top, var(--parchment-deep)), var(--parchment-deep)); border: 1px dashed var(--stitch-dark); }
.theme-mini .tm-card{ position: relative; height: 54px; border-radius: 8px; background: var(--cream-card); border: 1px dashed var(--stitch-dark); padding: 8px 10px; }
.theme-mini .tm-card i{ display: block; height: 5px; width: 60%; border-radius: 3px; background: var(--ink); opacity: .55; margin-bottom: 5px; }
.theme-mini .tm-card i + i{ width: 40%; opacity: .3; }
.theme-mini .tm-btn{ position: absolute; bottom: 8px; width: 34px; height: 12px; border-radius: 5px; }
.theme-mini .tm-btn-a{ right: 52px; background: var(--sage); }
.theme-mini .tm-btn-b{ right: 10px; background: var(--hay); }
.theme-card.is-current{ box-shadow: 0 0 0 3px var(--brass), 0 6px 16px rgba(58,46,38,.08); }
.theme-swatches{ display: flex; gap: 4px; }
.theme-swatches span{ width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }

/* ---------- SUPPORTER BADGES (supporter_perks.php) ---------- */
.supporter-badge{
  display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; vertical-align: 2px;
  font-family: 'Nunito Sans', sans-serif; font-style: normal; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.supporter-hedgerow{ background: #E3EBDD; color: #3F5A3B; border: 1px solid #C5D5BE; }
.supporter-patron{
  background: radial-gradient(circle at 35% 30%, #FFF4CF, var(--brass-light) 45%, var(--brass));
  color: #4A3410; border: 1px solid var(--brass-deep);
}

/* ---------- DECOR (decor_lib.php, stable_decor.php) ---------- */
/* Decor sits in a 5:4 box anchored to the bottom, the same shape as the scene art, so pieces
   line up with the backdrop's fence line in portraits and in wider paddock pictures alike. */
/* The scene is its own stacking layer, so decor (z-index 1–4 inside it) always stays behind the horse. */
.hp-scene{ z-index: 0; }
.decor-layer{ position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 5 / 4; pointer-events: none; }
.decor-piece{ position: absolute; height: auto; pointer-events: none; user-select: none; }
.paddock-scene{
  position: relative; overflow: hidden; aspect-ratio: 5 / 4; border-radius: 12px; width: 100%;   /* its pieces are absolute, so it needs a width or it collapses */
  background: #cfe0b8 center bottom / cover no-repeat; border: 1px solid var(--line);
}
.paddock-scene-card{ aspect-ratio: 16 / 9; }
a:hover > .paddock-scene-card{ filter: brightness(1.04); }
.paddock-scene.season-winter{ background-color: #e3e9ee; }

/* Stable header: a banner along the top, a companion peeking over the edge. */
.stable-hero.has-decor{ padding-top: 3.8rem !important; margin-top: 2.4rem; }
.stable-banner{
  position: absolute; left: 12px; right: 12px; top: 8px; height: 50px; z-index: 1; pointer-events: none;
  background-repeat: repeat-x; background-size: auto 100%; background-position: center top;
}
.stable-companion{
  position: absolute; right: 26px; top: -46px; width: 92px; height: auto; z-index: 2; pointer-events: none;
  filter: drop-shadow(0 4px 4px rgba(58,46,38,.18));
}
@media (max-width: 575.98px){ .stable-companion{ width: 70px; top: -36px; right: 14px; } }

/* Nameplates: the stable name on a little sign (no art files needed). */
.nameplate{ display: inline-block; padding: .06em .55em .14em; border-radius: 10px; line-height: 1.15; position: relative; }
.nameplate-wood{
  color: #FFF7E6; text-shadow: 0 1px 0 rgba(0,0,0,.35);
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.05) 0 2px, transparent 2px 7px), linear-gradient(180deg, #B08055, #8C6038);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.14), 0 3px 0 #5E3F22;
}
.nameplate-brass{
  color: #4A3410; text-shadow: 0 1px 0 rgba(255,255,255,.5); padding-left: .9em; padding-right: .9em;
  background: radial-gradient(circle at 35% 25%, #FFF4CF, #E8CF8A 30%, #C9A24A 70%, #8E6F2A);
  border: 1px solid #8E6F2A; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.6), 0 3px 8px rgba(58,46,38,.18);
}
.nameplate-brass::before, .nameplate-brass::after{
  content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d8, #8E6F2A 70%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.nameplate-brass::before{ left: .3em; } .nameplate-brass::after{ right: .3em; }
.nameplate-chalk{
  color: #F4F1E8; font-style: italic; letter-spacing: .02em; background: #2F3A33;
  border: 5px solid #8A6A48; border-radius: 6px; text-shadow: 0 0 1px rgba(255,255,255,.6);
}
.nameplate-blossom{
  color: #7A2E3E; background: #FFF6F8; border: 2px solid #E7A9B9; padding-left: 1.1em; padding-right: 1.1em;
  box-shadow: 0 3px 8px rgba(122,46,62,.12);
}
.nameplate-blossom::before, .nameplate-blossom::after{
  content: ""; position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: radial-gradient(circle, #E2B33A 0 2px, transparent 2.5px), radial-gradient(circle at 50% 0, #F2A6BD 0 3px, transparent 3.5px),
              radial-gradient(circle at 100% 50%, #F2A6BD 0 3px, transparent 3.5px), radial-gradient(circle at 50% 100%, #F2A6BD 0 3px, transparent 3.5px),
              radial-gradient(circle at 0 50%, #F2A6BD 0 3px, transparent 3.5px);
}
.nameplate-blossom::before{ left: .25em; } .nameplate-blossom::after{ right: .25em; }

/* ---------- KO-FI PACKS (shop_lib.php) ---------- */
/* Founder's Plaque nameplate (decor plate_founder) */
.nameplate-founder{
  color: #F3D27A; letter-spacing: .02em; padding-left: 1.2em; padding-right: .7em;
  text-shadow: 0 1px 0 rgba(0,0,0,.45), 0 0 6px rgba(243,210,122,.25);
  background: linear-gradient(180deg, #2F5A45, #1F4433);
  border: 2px solid #C9A24A; box-shadow: inset 0 0 0 2px rgba(0,0,0,.18), 0 3px 8px rgba(31,68,51,.25);
}
.nameplate-founder::before{
  content: "★"; position: absolute; left: .3em; top: 50%; transform: translateY(-52%);
  font-size: .62em; color: #F3D27A; text-shadow: 0 0 4px rgba(243,210,122,.6);
}
/* Founder badge next to stable names */
.founder-badge{ background: linear-gradient(180deg, #FFF4CF, #EBCB78); color: #5A3E0E; border: 1px solid #C9A24A; }
/* The Founder's Star on a horse's forehead (horse_portrait.php, class hp-founder) */
.hp-founder{
  background-color: #E8C455 !important;
  background-image: linear-gradient(115deg, #C9962E 0%, #F7DC86 35%, #FFF6D2 48%, #E8C455 60%, #B9882A 100%);
}
/* Support page pack cards */
.pack-card{ height: 100%; display: flex; flex-direction: column; }
.pack-card .pack-icon{ font-size: 30px; line-height: 1; }
.pack-card ul{ padding-left: 1.1rem; margin-bottom: .75rem; }
.pack-card.is-owned{ box-shadow: 0 0 0 3px var(--brass); }
.pack-card .pack-foot{ margin-top: auto; }

/* ---------- OLD AGE (aging_lib.php) ---------- */
.frail-badge{ background: #ECE6F2; color: #5B4A6E; font-weight: 700; border: 1px solid #D6CCE2; }
.memorial-notice{ background: #FBF8F2; border-color: var(--line) !important; }

/* ---------- GUIDE SEARCH (guide.php) ---------- */
.guide-search-box{ position: relative; }
.guide-search-box .form-control{ padding-left: 38px; padding-right: 38px; border-radius: 999px; font-size: 1.05rem; }
.guide-search-icon{ position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--leather); pointer-events: none; }
.guide-search-clear{ position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--leather); text-decoration: none; font-weight: 800; }
.guide-search-box input[type=search]::-webkit-search-cancel-button{ display: none; }
mark.guide-hit{ background: rgba(201,162,74,.38); color: inherit; padding: 0 1px; border-radius: 3px; }
.guide-toc li.guide-toc-off{ opacity: .35; }

li::marker {
  color: color-mix(in oklab, var(--barn), white 30%);
}
.last-active{ font-size: .85rem; white-space: nowrap; color: var(--bs-secondary-color); }
.last-active::before{
  content: ""; display: inline-block; width: .5em; height: .5em; border-radius: 50%;
  margin-right: .4em; vertical-align: .1em; background: currentColor; opacity: .5;
}
.last-active.la-now{ color: #3f7d3a; font-weight: 700; }
.last-active.la-now::before{ opacity: 1; box-shadow: 0 0 0 3px rgba(63,125,58,.18); }
.last-active.la-today{ color: #5f7a3c; }
.last-active.la-recent{ color: var(--leather, #7a5a3a); }
.last-active.la-away,
.last-active.la-never{ opacity: .7; }
