/*
 * PADDOCK SQUARE dedicated-theme pilot corrections.
 * Page-specific layout remains owned by each public page; this file only
 * protects migrated pages from legacy/common CSS collisions.
 */

/* --- Top: paddock flash -------------------------------------------------- */
body.ps-theme.ps-view-top .flash-section > .wrap{
  width:min(1200px,calc(100% - 64px))!important;
  max-width:1200px!important;
  margin-inline:auto!important;
  padding-inline:0!important;
}
body.ps-theme.ps-view-top .flash-section .flash-grid{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-flow:row!important;
  gap:16px!important;
  align-items:stretch!important;
}
body.ps-theme.ps-view-top .flash-section .flash-grid > .race-card{
  position:static!important;
  float:none!important;
  display:block!important;
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
  transform:none!important;
  overflow:hidden!important;
  padding:18px!important;
  border:1px solid var(--border,var(--ps-line))!important;
  border-radius:12px!important;
  background:#fff!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .race-head{
  position:static!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
  padding:0 0 12px!important;
  border:0!important;
  border-bottom:1px solid #EDF0ED!important;
  background:transparent!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .race-head > div:first-child{
  min-width:0!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .venue-pill{
  display:inline-flex!important;
  align-items:center!important;
  width:auto!important;
  max-width:100%!important;
  min-height:0!important;
  padding:4px 8px!important;
  border-radius:6px!important;
  background:var(--main,var(--ps-main))!important;
  color:#fff!important;
  font-size:14px!important;
  font-weight:800!important;
  line-height:1.4!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .race-name{
  display:block!important;
  width:auto!important;
  min-width:0!important;
  margin:5px 0 0!important;
  color:#3C4842!important;
  font-size:13px!important;
  font-weight:700!important;
  line-height:1.45!important;
  white-space:normal!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .post-time{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  margin:0!important;
  color:var(--text,var(--ps-text))!important;
  font-size:14px!important;
  font-weight:800!important;
  line-height:1.4!important;
  white-space:nowrap!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .horse-row{
  position:static!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:11px 0!important;
  border-bottom:1px solid #EEF1EE!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .horse-row:last-of-type{
  border-bottom:0!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .horse-main{
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:28px minmax(0,1fr) auto auto!important;
  grid-auto-flow:row!important;
  gap:8px!important;
  align-items:center!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .horse-name{
  min-width:0!important;
  width:auto!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .eval,
body.ps-theme.ps-view-top .flash-section .race-card .compare{
  position:static!important;
  float:none!important;
  width:auto!important;
  max-width:none!important;
  margin:0!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .short{
  display:block!important;
  width:auto!important;
  max-width:calc(100% - 36px)!important;
  margin:4px 0 0 36px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
body.ps-theme.ps-view-top .flash-section .race-card .card-link{
  position:static!important;
  float:none!important;
  display:block!important;
  width:100%!important;
  margin:9px 0 0!important;
  text-align:right!important;
}

/* --- Race results: venue/race selector --------------------------------- */
body.ps-theme.ps-view-race-results main .selector{
  position:static!important;
  float:none!important;
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  margin:0 0 14px!important;
  padding:16px!important;
  overflow:visible!important;
  border:1px solid var(--border,var(--line,var(--ps-line)))!important;
  border-radius:12px!important;
  background:#fff!important;
}
body.ps-theme.ps-view-race-results main .selector > .venues{
  position:static!important;
  float:none!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  margin:0 0 14px!important;
  padding:0!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-flow:row!important;
  gap:0!important;
  align-items:stretch!important;
}
body.ps-theme.ps-view-race-results main .selector > .venues > a,
body.ps-theme.ps-view-race-results main .selector > .venues > button{
  position:static!important;
  float:none!important;
  grid-column:auto!important;
  grid-row:auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  height:48px!important;
  margin:0!important;
  padding:0 12px!important;
}
body.ps-theme.ps-view-race-results main .selector > .venues > :only-child{
  grid-column:1 / -1!important;
}
body.ps-theme.ps-view-race-results main .selector > .races{
  position:static!important;
  float:none!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  grid-auto-flow:row!important;
  grid-auto-columns:auto!important;
  grid-auto-rows:auto!important;
  gap:6px!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  overflow:visible!important;
}
body.ps-theme.ps-view-race-results main .selector > .races > a,
body.ps-theme.ps-view-race-results main .selector > .races > button{
  position:static!important;
  float:none!important;
  grid-column:auto!important;
  grid-row:auto!important;
  align-self:stretch!important;
  justify-self:stretch!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  height:48px!important;
  margin:0!important;
  padding:3px!important;
  overflow:hidden!important;
  white-space:normal!important;
}
body.ps-theme.ps-view-race-results main .selector > .races > a small,
body.ps-theme.ps-view-race-results main .selector > .races > button small{
  display:block!important;
  margin-top:3px!important;
  white-space:nowrap!important;
}

@media(max-width:1099px) and (min-width:768px){
  body.ps-theme.ps-view-top .flash-section .flash-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body.ps-theme.ps-view-race-results main .selector > .races{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
  }
}

@media(max-width:767px){
  body.ps-theme.ps-view-top .flash-section > .wrap{
    width:100%!important;
    padding-inline:16px!important;
  }
  body.ps-theme.ps-view-top .flash-section .flash-grid{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  body.ps-theme.ps-view-top .flash-section .flash-grid > .race-card{
    padding:14px!important;
  }
  body.ps-theme.ps-view-race-results main .selector{
    width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
    padding:12px 16px!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
  }
  body.ps-theme.ps-view-race-results main .selector > .venues{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body.ps-theme.ps-view-race-results main .selector > .races{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:6px!important;
  }
  body.ps-theme.ps-view-race-results main .selector > .races > a,
  body.ps-theme.ps-view-race-results main .selector > .races > button{
    height:48px!important;
    padding:2px 1px!important;
    font-size:12px!important;
  }
}

/* --- Race entry / recent evaluation: preserve approved page-local shell ------- */
body.ps-theme.page-race main,
body.ps-theme.page-recent main{
  width:min(1200px,calc(100% - 48px))!important;
  max-width:1200px!important;
  margin-inline:auto!important;
}
body.ps-theme.page-race .race-selector,
body.ps-theme.page-recent .race-selector{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
@media(max-width:900px){
  body.ps-theme.page-race main,
  body.ps-theme.page-recent main{
    width:100%!important;
    max-width:none!important;
    padding-left:16px!important;
    padding-right:16px!important;
  }
}

/* === v0.1.5 shell lock ==================================================
 * Migrated pages still load legacy page CSS for their approved body UI.
 * These ID-scoped rules make the theme shell authoritative even when a legacy
 * selector is more specific and uses !important.
 */
body.ps-theme #ps-site-header.ps-site-header{position:sticky!important;top:0!important;z-index:100!important;height:72px!important;margin:0!important;background:#fff!important;border:0!important;border-bottom:1px solid var(--ps-line)!important}
body.ps-theme #ps-site-header .ps-header-inner{width:min(var(--ps-content),calc(100% - 64px))!important;max-width:var(--ps-content)!important;height:100%!important;margin:0 auto!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:24px!important}
body.ps-theme #ps-site-header .ps-brand{width:190px!important;min-width:190px!important;height:48px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;flex:0 0 190px!important;overflow:visible!important}
body.ps-theme #ps-site-header .ps-brand img{display:block!important;width:178px!important;max-width:178px!important;height:auto!important;max-height:46px!important;object-fit:contain!important;object-position:left center!important}
body.ps-theme #ps-site-header .ps-global-nav{height:100%!important;display:flex!important;align-items:stretch!important;gap:2px!important}
body.ps-theme #ps-site-header .ps-global-nav a{position:relative!important;height:100%!important;padding:0 14px!important;display:flex!important;align-items:center!important;justify-content:center!important;color:var(--ps-text)!important;font-size:14px!important;font-weight:700!important;letter-spacing:0!important;white-space:nowrap!important;background:transparent!important}
body.ps-theme #ps-site-header .ps-global-nav a.active,body.ps-theme #ps-site-header .ps-global-nav a[aria-current="page"]{color:var(--ps-main)!important;font-weight:850!important}
body.ps-theme #ps-site-header .ps-global-nav a.active:after,body.ps-theme #ps-site-header .ps-global-nav a[aria-current="page"]:after{content:""!important;position:absolute!important;left:14px!important;right:14px!important;bottom:0!important;height:3px!important;background:var(--ps-main)!important;border-radius:3px 3px 0 0!important}
body.ps-theme #ps-site-header .ps-menu-button{display:none!important;width:44px!important;height:44px!important;min-width:44px!important;padding:0!important;border:0!important;border-radius:8px!important;background:#fff!important;color:var(--ps-main)!important;align-items:center!important;justify-content:center!important}
body.ps-theme #ps-mobile-nav.ps-mobile-nav{display:none!important;position:fixed!important;top:58px!important;left:0!important;right:0!important;z-index:99!important;padding:8px 16px 14px!important;background:#fff!important;border-bottom:1px solid var(--ps-line)!important}
body.ps-theme #ps-mobile-nav.ps-mobile-nav.open{display:grid!important}
body.ps-theme #ps-mobile-nav.ps-mobile-nav a{min-height:44px!important;display:flex!important;align-items:center!important;border-bottom:1px solid #EEF2F0!important;color:var(--ps-text)!important;font-size:14px!important;font-weight:700!important}

body.ps-theme #ps-mode-bar.ps-mode-bar{height:48px!important;margin:0!important;padding:0!important;background:#F5F7F6!important;border:0!important;border-bottom:1px solid var(--ps-line)!important;color:var(--ps-text)!important}
body.ps-theme #ps-mode-bar .ps-mode-inner{width:min(520px,100%)!important;max-width:520px!important;height:48px!important;margin:0 auto!important;padding:0!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0!important;border-left:1px solid var(--ps-line)!important;border-right:1px solid var(--ps-line)!important}
body.ps-theme #ps-mode-bar .ps-mode-inner>a,body.ps-theme #ps-mode-bar .ps-mode-inner>button{position:relative!important;width:100%!important;min-width:0!important;height:48px!important;margin:0!important;padding:0 12px!important;border:0!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;color:#52615B!important;font-family:inherit!important;font-size:14px!important;font-weight:750!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important}
body.ps-theme #ps-mode-bar .ps-mode-inner>*+*{border-left:1px solid var(--ps-line)!important}
body.ps-theme #ps-mode-bar .ps-mode-inner>.active,body.ps-theme #ps-mode-bar .ps-mode-inner>[aria-selected="true"],body.ps-theme #ps-mode-bar .ps-mode-inner>[aria-current="page"]{background:var(--ps-main)!important;color:#fff!important;font-weight:850!important}

body.ps-theme #ps-site-footer.ps-footer{margin-top:48px!important;background:var(--ps-dark)!important;color:#fff!important}
body.ps-theme #ps-site-footer .ps-footer-inner{width:min(var(--ps-content),calc(100% - 64px))!important;margin:0 auto!important}
body.ps-theme #ps-site-footer .ps-footer-desktop{display:grid!important;grid-template-columns:1.3fr repeat(3,minmax(0,1fr))!important;gap:44px!important;padding:48px 0 38px!important}
body.ps-theme #ps-site-footer .ps-footer-brand img{display:block!important;width:250px!important;max-width:100%!important;height:auto!important}
body.ps-theme #ps-site-footer .ps-footer-group h2{margin:0 0 13px!important;padding:0 0 9px!important;border-bottom:1px solid rgba(255,255,255,.24)!important;background:none!important;color:#fff!important;font-size:14px!important;line-height:1.4!important}
body.ps-theme #ps-site-footer .ps-footer-group a{display:flex!important;align-items:center!important;min-height:34px!important;padding:4px 0!important;color:rgba(255,255,255,.84)!important;font-size:12px!important}
body.ps-theme #ps-site-footer .ps-footer-mobile{display:none!important}
body.ps-theme #ps-site-footer .ps-footer-copyright{padding:17px 0!important;border-top:1px solid rgba(255,255,255,.19)!important;color:rgba(255,255,255,.68)!important;font-size:12px!important;text-align:center!important}

@media(max-width:900px){
  body.ps-theme #ps-site-header.ps-site-header{height:58px!important}
  body.ps-theme #ps-site-header .ps-header-inner{width:calc(100% - 24px)!important;gap:12px!important}
  body.ps-theme #ps-site-header .ps-brand{width:174px!important;min-width:174px!important;height:44px!important;flex-basis:174px!important}
  body.ps-theme #ps-site-header .ps-brand img{width:166px!important;max-width:166px!important;max-height:42px!important}
  body.ps-theme #ps-site-header .ps-global-nav{display:none!important}
  body.ps-theme #ps-site-header .ps-menu-button{display:flex!important}
  body.ps-theme #ps-mode-bar.ps-mode-bar{position:sticky!important;top:58px!important;z-index:90!important;height:48px!important}
  body.ps-theme #ps-mode-bar .ps-mode-inner{width:100%!important;max-width:none!important;height:48px!important}
}
@media(max-width:767px){
  body.ps-theme #ps-site-footer.ps-footer{margin-top:36px!important}
  body.ps-theme #ps-site-footer .ps-footer-inner{width:100%!important;padding:0 20px!important}
  body.ps-theme #ps-site-footer .ps-footer-desktop{display:none!important}
  body.ps-theme #ps-site-footer .ps-footer-mobile{display:block!important;padding:32px 0 24px!important}
  body.ps-theme #ps-site-footer .ps-footer-mobile-logo{display:flex!important;justify-content:center!important;padding-bottom:25px!important}
  body.ps-theme #ps-site-footer .ps-footer-mobile-logo img{display:block!important;width:218px!important;max-width:82%!important;height:auto!important}
  body.ps-theme #ps-site-footer .ps-footer-primary{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;border-top:1px solid rgba(255,255,255,.22)!important;border-left:1px solid rgba(255,255,255,.22)!important}
  body.ps-theme #ps-site-footer .ps-footer-primary a{display:flex!important;align-items:center!important;justify-content:center!important;min-height:48px!important;padding:8px 6px!important;border-right:1px solid rgba(255,255,255,.22)!important;border-bottom:1px solid rgba(255,255,255,.22)!important;color:#fff!important;font-size:13px!important;font-weight:700!important;text-align:center!important}
  body.ps-theme #ps-site-footer .ps-footer-details{border-bottom:1px solid rgba(255,255,255,.22)!important}
  body.ps-theme #ps-site-footer .ps-footer-details summary{position:relative!important;display:flex!important;align-items:center!important;min-height:48px!important;padding:8px 34px 8px 4px!important;border-top:1px solid rgba(255,255,255,.22)!important;color:#fff!important;font-size:13px!important;font-weight:700!important;cursor:pointer!important;list-style:none!important}
  body.ps-theme #ps-site-footer .ps-footer-details-links a{display:flex!important;align-items:center!important;min-height:44px!important;padding:7px 10px!important;border-top:1px solid rgba(255,255,255,.12)!important;color:rgba(255,255,255,.84)!important;font-size:12px!important}
  body.ps-theme #ps-site-footer .ps-footer-copyright{padding:17px 0 20px!important;font-size:11px!important}
}

/* v0.1.8 common header lock. Legacy page classes cannot style the theme header. */
body.ps-theme #ps-site-header.ps-site-header,body.ps-theme #ps-mobile-nav.ps-mobile-nav{font-family:"Noto Sans JP","Hiragino Kaku Gothic ProN",Meiryo,sans-serif!important;font-size:16px!important;line-height:1.65!important;color:var(--ps-text)!important}
body.ps-theme #ps-site-header .ps-menu-button{appearance:none!important;display:none!important;width:44px!important;height:44px!important;min-width:44px!important;flex:0 0 44px!important;flex-direction:row!important;gap:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:8px!important;background:#fff!important;box-shadow:none!important;color:var(--ps-main)!important;font-size:0!important;line-height:1!important;align-items:center!important;justify-content:center!important}
body.ps-theme #ps-site-header .ps-menu-button b{display:block!important;margin:0!important;padding:0!important;font-family:Arial,"Noto Sans JP",sans-serif!important;font-size:25px!important;font-weight:700!important;line-height:1!important}
body.ps-theme #ps-mobile-nav.ps-mobile-nav{display:none!important;position:fixed!important;top:58px!important;left:0!important;right:0!important;width:100%!important;max-width:none!important;margin:0!important;padding:8px 16px 14px!important;z-index:99!important;grid-template-columns:1fr!important;gap:0!important;background:#fff!important;border:0!important;border-bottom:1px solid var(--ps-line)!important;border-radius:0!important;box-shadow:0 10px 22px rgba(20,34,29,.08)!important}
body.ps-theme #ps-mobile-nav.ps-mobile-nav.open{display:grid!important;grid-template-columns:1fr!important;gap:0!important}
body.ps-theme #ps-mobile-nav.ps-mobile-nav a{box-sizing:border-box!important;width:100%!important;min-height:44px!important;margin:0!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;border:0!important;border-bottom:1px solid #EEF2F0!important;border-radius:0!important;background:#fff!important;color:var(--ps-text)!important;font-size:14px!important;font-weight:700!important;line-height:1.4!important;text-align:left!important}
body.ps-theme #ps-mobile-nav.ps-mobile-nav a:last-child{border-bottom:0!important}
body.ps-theme #ps-mobile-nav.ps-mobile-nav a.active,body.ps-theme #ps-mobile-nav.ps-mobile-nav a[aria-current="page"]{background:#fff!important;color:var(--ps-main)!important;font-weight:850!important}
@media(max-width:900px){body.ps-theme #ps-site-header .ps-menu-button{display:flex!important}}
