/*
 * LIVE_RACING_002BK — neutral Horse Form premium modal refinement.
 * Scope: #liveHorseFormModal.is-horse-form only.
 * Behaviour preserved: runner rail, breadcrumb/history, filters, sorting,
 * historical-result drilldown, fullscreen, context switching and modal stack.
 */

#liveHorseFormModal.is-horse-form{
  --hf-line:rgba(84,111,210,.18);
  --hf-line-strong:rgba(68,102,220,.28);
  --hf-text:#10213d;
  --hf-muted:#5d718c;
  --hf-blue:#2857cb;
  --hf-violet:#6f4bd8;
  padding:28px!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-backdrop{
  background:
    radial-gradient(circle at 15% 12%,rgba(42,111,230,.20),transparent 32%),
    radial-gradient(circle at 86% 8%,rgba(128,82,220,.18),transparent 34%),
    rgba(8,15,32,.68)!important;
  backdrop-filter:blur(12px) saturate(118%)!important;
  -webkit-backdrop-filter:blur(12px) saturate(118%)!important;
}
#liveHorseFormModal.is-horse-form:not(.fullscreen) .horse-drilldown-modal{
  width:min(1760px,calc(100vw - 56px))!important;
  height:auto!important;
  max-height:calc(100vh - 56px)!important;
  border:1px solid rgba(113,139,241,.34)!important;
  border-radius:28px!important;
  background:
    radial-gradient(circle at 3% 4%,rgba(34,211,238,.07),transparent 24%),
    radial-gradient(circle at 96% 5%,rgba(124,58,237,.08),transparent 27%),
    linear-gradient(180deg,#f9fbff 0%,#f3f7ff 54%,#f8fbff 100%)!important;
  box-shadow:0 36px 96px rgba(8,18,45,.36),inset 0 1px 0 rgba(255,255,255,.76)!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-content{
  flex:0 1 auto!important;
  height:auto!important;
  max-height:calc(100vh - 56px)!important;
  padding:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-gutter:stable!important;
  background:transparent!important;
}
#liveHorseFormModal.is-horse-form.fullscreen{
  padding:0!important;
}
#liveHorseFormModal.is-horse-form.fullscreen .horse-drilldown-modal{
  width:100vw!important;
  height:100vh!important;
  max-width:none!important;
  max-height:none!important;
  border:0!important;
  border-radius:0!important;
}
#liveHorseFormModal.is-horse-form.fullscreen .horse-drilldown-content{
  height:100%!important;
  max-height:100%!important;
}

/* Premium command header. */
#liveHorseFormModal.is-horse-form .horse-drilldown-modal-header{
  position:sticky!important;
  top:0!important;
  z-index:12!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:18px!important;
  margin:0!important;
  padding:18px 22px!important;
  color:#fff!important;
  border:0!important;
  border-bottom:1px solid rgba(151,193,255,.28)!important;
  background:
    radial-gradient(circle at 90% 0%,rgba(45,212,191,.22),transparent 34%),
    radial-gradient(circle at 30% 110%,rgba(99,102,241,.30),transparent 48%),
    linear-gradient(132deg,rgba(6,17,39,.99),rgba(25,51,145,.97) 54%,rgba(52,91,196,.94) 78%,rgba(42,177,190,.86))!important;
  box-shadow:0 18px 40px rgba(15,23,42,.24),inset 0 1px 0 rgba(255,255,255,.25)!important;
  backdrop-filter:blur(18px) saturate(145%)!important;
  -webkit-backdrop-filter:blur(18px) saturate(145%)!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-kicker{
  color:#74f0ff!important;
  font-size:10px!important;
  letter-spacing:.17em!important;
  font-weight:950!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-modal-header h2{
  margin:3px 0 2px!important;
  color:#fff!important;
  font-size:clamp(25px,2vw,36px)!important;
  line-height:1.02!important;
  letter-spacing:-.035em!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-modal-header p{
  color:rgba(226,239,255,.90)!important;
  font-size:13px!important;
  line-height:1.3!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:9px!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-actions .horse-drilldown-ghost{
  min-height:40px!important;
  padding:9px 14px!important;
  border:1px solid rgba(255,255,255,.22)!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.10)!important;
  color:#fff!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16)!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-actions .horse-drilldown-ghost:hover,
#liveHorseFormModal.is-horse-form .horse-drilldown-actions .horse-drilldown-ghost:focus-visible{
  transform:translateY(-1px)!important;
  border-color:rgba(255,255,255,.42)!important;
  background:rgba(255,255,255,.17)!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-close{
  width:42px!important;
  height:42px!important;
  border:1px solid rgba(255,255,255,.24)!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.11)!important;
  color:#fff!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15)!important;
}
#liveHorseFormModal.is-horse-form .horse-drilldown-close:hover,
#liveHorseFormModal.is-horse-form .horse-drilldown-close:focus-visible{
  background:rgba(255,255,255,.20)!important;
  border-color:rgba(255,255,255,.42)!important;
}

#liveHorseFormModal.is-horse-form .horse-drilldown-body{
  padding:16px 18px 18px!important;
  background:transparent!important;
}

/* Breadcrumb/history and race-runner rail. */
#liveHorseFormModal.is-horse-form .horse-history-strip{
  margin:0 0 12px!important;
  padding:7px 9px!important;
  border:1px solid rgba(92,119,236,.15)!important;
  border-radius:14px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.88),rgba(241,246,255,.72))!important;
  box-shadow:0 9px 22px rgba(27,45,91,.055),inset 0 1px 0 rgba(255,255,255,.74)!important;
}
#liveHorseFormModal.is-horse-form .horse-history-list button{
  min-height:30px!important;
  padding:5px 9px!important;
  border-radius:9px!important;
}
#liveHorseFormModal.is-horse-form .horse-context-strip{
  grid-template-columns:auto auto minmax(0,1fr) auto!important;
  gap:8px!important;
  margin:0 0 12px!important;
  padding:8px 9px!important;
  border:1px solid var(--hf-line)!important;
  border-radius:16px!important;
  background:
    radial-gradient(circle at 1% 50%,rgba(34,211,238,.08),transparent 24%),
    linear-gradient(180deg,rgba(255,255,255,.90),rgba(237,244,255,.75))!important;
  box-shadow:0 12px 28px rgba(22,38,78,.07),inset 0 1px 0 rgba(255,255,255,.76)!important;
}
#liveHorseFormModal.is-horse-form .horse-context-strip > span{
  color:#2452b9!important;
  font-size:10px!important;
  letter-spacing:.15em!important;
}
#liveHorseFormModal.is-horse-form .horse-context-runner-list{
  gap:6px!important;
  overflow-x:auto!important;
  flex-wrap:nowrap!important;
  scrollbar-width:thin!important;
  scrollbar-color:rgba(82,104,194,.34) transparent!important;
}
#liveHorseFormModal.is-horse-form .horse-context-runner-list button{
  min-height:44px!important;
  padding:7px 11px!important;
  border:1px solid rgba(98,119,207,.17)!important;
  border-radius:11px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(244,248,255,.78))!important;
  color:#172554!important;
  box-shadow:0 7px 16px rgba(21,34,72,.04),inset 0 1px 0 rgba(255,255,255,.74)!important;
}
#liveHorseFormModal.is-horse-form .horse-context-runner-list button.active{
  background:linear-gradient(135deg,#315ed7,#7544e6)!important;
  border-color:transparent!important;
  color:#fff!important;
  box-shadow:0 10px 22px rgba(62,69,201,.25)!important;
}

/* Identity / today's race / pedigree as one coordinated deck. */
#liveHorseFormModal.is-horse-form .horse-identity-panel,
#liveHorseFormModal.is-horse-form .horse-summary-section,
#liveHorseFormModal.is-horse-form .horse-form-section{
  margin:0 0 12px!important;
  border:1px solid var(--hf-line)!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.90),rgba(248,251,255,.76))!important;
  box-shadow:0 13px 30px rgba(18,32,70,.075),inset 0 1px 0 rgba(255,255,255,.78)!important;
  backdrop-filter:blur(14px) saturate(130%)!important;
  -webkit-backdrop-filter:blur(14px) saturate(130%)!important;
}
#liveHorseFormModal.is-horse-form .horse-identity-panel{
  padding:10px!important;
}
#liveHorseFormModal.is-horse-form .horse-identity-panel.has-source-race .horse-identity-main.compact{
  display:grid!important;
  grid-template-columns:52px minmax(230px,.82fr) minmax(360px,1.08fr) minmax(420px,1.22fr)!important;
  gap:10px!important;
  align-items:stretch!important;
  margin:0!important;
}
#liveHorseFormModal.is-horse-form .horse-silk-placeholder{
  width:52px!important;
  height:52px!important;
  align-self:center!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,#e1eaff,#eee7ff)!important;
  color:#4b54cf!important;
  box-shadow:inset 0 0 0 1px rgba(76,81,205,.13),0 8px 18px rgba(70,78,175,.08)!important;
}
#liveHorseFormModal.is-horse-form .horse-identity-title{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  min-width:0!important;
}
#liveHorseFormModal.is-horse-form .horse-identity-title h3{
  margin:0 0 4px!important;
  color:var(--hf-text)!important;
  font-size:19px!important;
  line-height:1.08!important;
}
#liveHorseFormModal.is-horse-form .horse-identity-title p{
  color:#425b79!important;
  font-size:12px!important;
  line-height:1.25!important;
}
#liveHorseFormModal.is-horse-form .horse-identity-muted{
  color:#71839a!important;
  font-size:10.5px!important;
}
#liveHorseFormModal.is-horse-form .horse-source-race-card,
#liveHorseFormModal.is-horse-form .horse-connections-card{
  min-width:0!important;
  min-height:92px!important;
  padding:10px 12px!important;
  border-radius:14px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72)!important;
}
#liveHorseFormModal.is-horse-form .horse-source-race-card{
  border:1px solid rgba(26,180,172,.22)!important;
  background:
    radial-gradient(circle at 96% 0%,rgba(34,211,238,.10),transparent 40%),
    linear-gradient(180deg,rgba(239,253,250,.96),rgba(250,255,255,.84))!important;
}
#liveHorseFormModal.is-horse-form .horse-source-race-card > span,
#liveHorseFormModal.is-horse-form .horse-connections-card > span{
  font-size:9px!important;
  letter-spacing:.14em!important;
  font-weight:950!important;
}
#liveHorseFormModal.is-horse-form .horse-source-race-card > strong{
  color:#0f2945!important;
  font-size:13px!important;
}
#liveHorseFormModal.is-horse-form .horse-source-race-card > small,
#liveHorseFormModal.is-horse-form .horse-source-race-card > p{
  font-size:10.5px!important;
  line-height:1.25!important;
}
#liveHorseFormModal.is-horse-form .horse-connections-card{
  border:1px solid rgba(88,108,199,.18)!important;
  background:
    radial-gradient(circle at 98% 0%,rgba(124,58,237,.08),transparent 38%),
    linear-gradient(180deg,rgba(250,250,255,.95),rgba(245,248,255,.82))!important;
}
#liveHorseFormModal.is-horse-form .horse-connections-card > div{
  gap:7px!important;
}
#liveHorseFormModal.is-horse-form .horse-connections-card p{
  padding:0 5px!important;
}
#liveHorseFormModal.is-horse-form .horse-connections-card em{
  color:#687b96!important;
  font-size:8.5px!important;
}
#liveHorseFormModal.is-horse-form .horse-connections-card strong{
  color:#172554!important;
  font-size:10.5px!important;
  line-height:1.14!important;
}

/* Lifetime and historical tables: compact, readable, locally scrollable. */
#liveHorseFormModal.is-horse-form .horse-summary-section,
#liveHorseFormModal.is-horse-form .horse-form-section{
  padding:10px!important;
}
#liveHorseFormModal.is-horse-form .horse-section-heading{
  margin:0 0 6px!important;
  color:#345078!important;
  font-size:9px!important;
  letter-spacing:.14em!important;
  font-weight:950!important;
  text-transform:uppercase!important;
}
#liveHorseFormModal.is-horse-form .horse-summary-table-wrap,
#liveHorseFormModal.is-horse-form .horse-form-table-wrap{
  overflow:auto!important;
  border:1px solid rgba(119,139,205,.20)!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.88)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72)!important;
}
#liveHorseFormModal.is-horse-form .horse-summary-table,
#liveHorseFormModal.is-horse-form .horse-form-table{
  background:rgba(255,255,255,.90)!important;
}
#liveHorseFormModal.is-horse-form .horse-summary-table th,
#liveHorseFormModal.is-horse-form .horse-summary-table td{
  padding:6px 8px!important;
  font-size:11px!important;
  line-height:1.15!important;
}
#liveHorseFormModal.is-horse-form .horse-summary-table thead th,
#liveHorseFormModal.is-horse-form .horse-form-table thead th{
  position:sticky!important;
  top:0!important;
  z-index:3!important;
  color:#f8fbff!important;
  background:linear-gradient(90deg,#173265,#3158b8 58%,#5650c9)!important;
  border-bottom:1px solid rgba(75,99,190,.34)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16)!important;
}
#liveHorseFormModal.is-horse-form .horse-form-table.compact th,
#liveHorseFormModal.is-horse-form .horse-form-table.compact td{
  padding:7px 8px!important;
  font-size:11px!important;
  line-height:1.18!important;
}
#liveHorseFormModal.is-horse-form .horse-form-table thead button{
  color:inherit!important;
  font-weight:950!important;
}
#liveHorseFormModal.is-horse-form .horse-form-table tbody tr:hover{
  background:rgba(235,243,255,.72)!important;
}
#liveHorseFormModal.is-horse-form .horse-form-date{
  font-size:11px!important;
}
#liveHorseFormModal.is-horse-form .horse-form-race strong{
  color:#10213d!important;
  font-size:11.5px!important;
}
#liveHorseFormModal.is-horse-form .horse-form-race small,
#liveHorseFormModal.is-horse-form .horse-form-result button{
  font-size:10px!important;
  line-height:1.15!important;
}
#liveHorseFormModal.is-horse-form .horse-form-toolbar{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:10px!important;
  margin:0 0 8px!important;
}
#liveHorseFormModal.is-horse-form .horse-form-filter-buttons{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
  margin:0!important;
}
#liveHorseFormModal.is-horse-form .horse-form-toolbar-meta{
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
  gap:6px!important;
  color:#526984!important;
  font-size:11px!important;
}
#liveHorseFormModal.is-horse-form .horse-form-filter-buttons button,
#liveHorseFormModal.is-horse-form .horse-form-toolbar-meta button{
  min-height:34px!important;
  padding:7px 11px!important;
  border:1px solid rgba(105,125,202,.20)!important;
  border-radius:10px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.95),rgba(241,246,255,.80))!important;
  color:#20395f!important;
  font-size:11px!important;
  box-shadow:0 6px 15px rgba(30,47,91,.045),inset 0 1px 0 rgba(255,255,255,.74)!important;
}
#liveHorseFormModal.is-horse-form .horse-form-filter-buttons button.active{
  color:#fff!important;
  border-color:transparent!important;
  background:linear-gradient(135deg,#315ed7,#7544e6)!important;
  box-shadow:0 9px 19px rgba(62,69,201,.22)!important;
}
#liveHorseFormModal.is-horse-form .horse-advanced-filter-panel{
  margin-bottom:9px!important;
  padding:10px!important;
  border:1px solid rgba(92,119,236,.16)!important;
  border-radius:13px!important;
  background:linear-gradient(180deg,rgba(244,248,255,.92),rgba(255,255,255,.80))!important;
}

/* Named viewport matrix. */
@media(max-width:1600px){
  #liveHorseFormModal.is-horse-form:not(.fullscreen) .horse-drilldown-modal{
    width:calc(100vw - 40px)!important;
    max-height:calc(100vh - 40px)!important;
  }
  #liveHorseFormModal.is-horse-form .horse-drilldown-content{max-height:calc(100vh - 40px)!important;}
  #liveHorseFormModal.is-horse-form .horse-identity-panel.has-source-race .horse-identity-main.compact{
    grid-template-columns:50px minmax(205px,.75fr) minmax(320px,1fr) minmax(350px,1.08fr)!important;
  }
}
@media(max-width:1366px){
  #liveHorseFormModal.is-horse-form{padding:18px!important;}
  #liveHorseFormModal.is-horse-form:not(.fullscreen) .horse-drilldown-modal{
    width:calc(100vw - 36px)!important;
    max-height:calc(100vh - 36px)!important;
    border-radius:22px!important;
  }
  #liveHorseFormModal.is-horse-form .horse-drilldown-content{max-height:calc(100vh - 36px)!important;}
  #liveHorseFormModal.is-horse-form .horse-drilldown-modal-header{
    padding:15px 17px!important;
  }
  #liveHorseFormModal.is-horse-form .horse-drilldown-body{
    padding:12px!important;
  }
  #liveHorseFormModal.is-horse-form .horse-identity-panel.has-source-race .horse-identity-main.compact{
    grid-template-columns:50px minmax(0,1fr)!important;
  }
  #liveHorseFormModal.is-horse-form .horse-source-race-card,
  #liveHorseFormModal.is-horse-form .horse-connections-card{
    grid-column:1 / -1!important;
  }
  #liveHorseFormModal.is-horse-form .horse-form-toolbar{
    grid-template-columns:1fr!important;
  }
  #liveHorseFormModal.is-horse-form .horse-form-toolbar-meta{
    justify-content:flex-start!important;
  }
}
@media(max-width:900px){
  #liveHorseFormModal.is-horse-form{padding:8px!important;}
  #liveHorseFormModal.is-horse-form:not(.fullscreen) .horse-drilldown-modal{
    width:calc(100vw - 16px)!important;
    max-height:calc(100vh - 16px)!important;
    border-radius:18px!important;
  }
  #liveHorseFormModal.is-horse-form .horse-drilldown-content{max-height:calc(100vh - 16px)!important;}
  #liveHorseFormModal.is-horse-form .horse-drilldown-modal-header{
    grid-template-columns:1fr!important;
    align-items:start!important;
    gap:10px!important;
  }
  #liveHorseFormModal.is-horse-form .horse-drilldown-actions{
    justify-content:flex-start!important;
  }
  #liveHorseFormModal.is-horse-form .horse-context-strip{
    grid-template-columns:auto minmax(0,1fr)!important;
  }
  #liveHorseFormModal.is-horse-form .horse-context-arrow{display:none!important;}
  #liveHorseFormModal.is-horse-form .horse-connections-card > div{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #liveHorseFormModal.is-horse-form *{
    scroll-behavior:auto!important;
  }
  #liveHorseFormModal.is-horse-form .horse-drilldown-actions button,
  #liveHorseFormModal.is-horse-form .horse-context-runner-list button{
    transition:none!important;
  }
}
