/* RACEPO v17.301: mobile-only visual refresh; preserves existing JS, APIs, selectors and desktop styling. */
@media screen and (max-width:900px) {
  :root {
    --mob-edge:#345b7a;
    --mob-ink:#eef5fb;
    --mob-muted:#b3c8db;
    --mob-gold:#e9c986;
    --mob-gold-soft:#f4e6bf;
    --mob-cyan:#7fdbfb;
    --mob-panel:#10273e;
    --mob-panel-2:#0a1a2c;
    --mob-line:#315575;
  }
  html {max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%;scroll-behavior:smooth;}
  body {
    position:relative;
    max-width:100%;
    overflow-x:clip;
    color:var(--mob-ink)!important;
    font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Yu Gothic UI',Meiryo,system-ui,sans-serif!important;
    line-height:1.56;
    background:
      radial-gradient(circle at 18% 10%,rgba(88,171,222,.18) 0, rgba(88,171,222,0) 28%),
      radial-gradient(circle at 86% 16%,rgba(255,209,127,.12) 0, rgba(255,209,127,0) 24%),
      linear-gradient(180deg,rgba(3,12,25,.16),rgba(3,12,25,.16)),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='1400' viewBox='0 0 900 1400'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='0' y1='0' y2='1'%3E%3Cstop stop-color='%2307192b'/%3E%3Cstop offset='1' stop-color='%23040c16'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='900' height='1400' fill='url(%23g)'/%3E%3Cg opacity='.14' stroke='%2363c6f4' stroke-width='2' fill='none'%3E%3Cpath d='M-50 250 C120 200 210 285 360 248 S630 205 950 255'/%3E%3Cpath d='M-50 315 C120 265 210 350 360 313 S630 270 950 320'/%3E%3Cpath d='M-50 940 C120 890 210 975 360 938 S630 895 950 945'/%3E%3Cpath d='M-50 1005 C120 955 210 1040 360 1003 S630 960 950 1010'/%3E%3C/g%3E%3Cg opacity='.10'%3E%3Cpath d='M610 168 l48 17 -29 13 -19 -30z' fill='%23f3d28f'/%3E%3Cpath d='M600 200 c44 -34 108 -25 142 8 -60 10 -108 9 -150 -8z' fill='%239ddffc'/%3E%3Cpath d='M650 150 v42' stroke='%23dfeef9' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
    background-size:cover;
    background-attachment:fixed;
    background-position:center top;
  }
  body::before {
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    background:linear-gradient(180deg,rgba(5,13,24,.25),rgba(5,13,24,.06) 26%,rgba(5,13,24,.18));
    z-index:0;
  }
  body * {box-sizing:border-box;}
  body > * {position:relative;z-index:1;}

  body>header {
    position:sticky!important;top:0!important;min-height:54px!important;display:flex!important;gap:9px!important;padding:8px 12px!important;
    background:linear-gradient(110deg,rgba(7,23,39,.95),rgba(11,39,63,.93) 72%,rgba(15,57,82,.92))!important;
    border-bottom:1px solid #496a86!important;box-shadow:0 8px 24px rgba(1,8,18,.45);backdrop-filter:blur(10px);z-index:60!important;
  }
  body>header .brand-home {
    min-width:0!important;font-size:18px!important;font-weight:800!important;color:var(--mob-gold-soft)!important;letter-spacing:.05em!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;
    font-family:Georgia,'Times New Roman','Yu Mincho','Hiragino Mincho ProN',serif!important;
  }
  body>header .brand-home .muted {
    display:block!important;font-size:9px!important;line-height:1.1!important;color:#9ac3e3!important;font-weight:600!important;letter-spacing:.14em!important;overflow:hidden;text-overflow:ellipsis;
    font-family:inherit!important;
  }
  body>header #api {margin-left:auto!important;max-width:38%;font-size:10px!important;padding:5px 7px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;flex:0 1 auto;border-radius:999px!important;background:rgba(255,255,255,.05)!important;border:1px solid rgba(126,203,245,.24)!important;}

  .left-sidebar {
    position:sticky!important;top:54px!important;bottom:auto!important;left:0!important;right:0!important;width:100%!important;max-width:100%!important;height:68px!important;
    padding:6px 8px!important;display:flex!important;flex-direction:row!important;align-items:stretch!important;gap:7px!important;justify-content:flex-start!important;
    overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;border:0!important;
    border-bottom:1px solid rgba(101,146,181,.35)!important;background:linear-gradient(180deg,rgba(10,27,44,.96),rgba(7,20,34,.94))!important;backdrop-filter:blur(10px);z-index:59!important;
  }
  .left-sidebar .side-btn {
    box-sizing:border-box!important;flex:0 0 77px!important;width:77px!important;min-width:77px!important;min-height:56px!important;height:56px!important;padding:5px 3px!important;
    display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;gap:3px!important;border:1px solid rgba(110,153,190,.2)!important;
    border-radius:12px!important;background:linear-gradient(160deg,rgba(18,41,66,.95),rgba(11,28,45,.96))!important;color:#d3e7f9!important;
    box-shadow:0 4px 12px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.03);
  }
  .left-sidebar .side-btn.active {
    border-color:#7ad3f9!important;background:linear-gradient(145deg,rgba(25,84,122,.95),rgba(18,60,93,.98))!important;
    box-shadow:0 8px 20px rgba(8,27,42,.35), inset 0 0 0 1px rgba(114,214,245,.22)!important;
  }
  .left-sidebar .side-icon {font-size:19px!important;line-height:1!important;flex:none!important;}
  .left-sidebar .side-label {display:block!important;font-size:10px!important;font-weight:700!important;white-space:nowrap!important;line-height:1.3!important;max-width:100%!important;overflow:hidden;text-overflow:ellipsis;color:#dbefff!important;}

  body>main {width:100%!important;max-width:100%!important;margin:0!important;padding:12px 10px 28px!important;min-width:0!important;}
  body>main>section {min-width:0;max-width:100%;}

  .racepo-hero {
    display:flex!important;min-height:124px!important;margin-bottom:12px!important;border-radius:16px!important;
    background:
      linear-gradient(90deg,rgba(6,18,31,.92) 0%,rgba(8,25,42,.84) 42%,rgba(8,25,42,.40) 68%,rgba(8,25,42,.16) 100%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='600' viewBox='0 0 1200 600'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' x2='1' y1='0' y2='1'%3E%3Cstop stop-color='%23081527'/%3E%3Cstop offset='.55' stop-color='%230c3150'/%3E%3Cstop offset='1' stop-color='%23104a68'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='1200' height='600' fill='url(%23bg)'/%3E%3Cg opacity='.28' stroke='%2378d7f5' stroke-width='3' fill='none'%3E%3Cpath d='M-20 370 C170 310 270 405 460 355 S820 312 1220 376'/%3E%3Cpath d='M-20 425 C170 365 270 460 460 410 S820 367 1220 431'/%3E%3C/g%3E%3Cg opacity='.86'%3E%3Cpath d='M765 282 c58 -48 132 -55 213 -11 -90 18 -158 23 -234 11z' fill='%23a9e5fb'/%3E%3Cpath d='M842 198 l53 20 -29 16 -24 -36z' fill='%23f2cc84'/%3E%3Crect x='885' y='170' width='6' height='73' rx='3' fill='%23f4f7fa'/%3E%3C/g%3E%3C/svg%3E");
    background-size:cover!important;background-position:center!important;border:1px solid #4f738d!important;box-shadow:0 10px 28px rgba(0,0,0,.24)!important;overflow:hidden;
  }
  .racepo-hero-content {padding:16px 15px!important;max-width:86%!important;}
  .racepo-kicker {
    font-size:9px!important;letter-spacing:.16em!important;text-transform:uppercase!important;color:#9ecbe7!important;
    font-family:Georgia,'Times New Roman','Yu Mincho','Hiragino Mincho ProN',serif!important;
  }
  .racepo-hero h2,
  body>main h2,
  body>main h3,
  .review-stats>summary,
  details>summary,
  .section-title,
  .card-title,
  .venue b {
    font-family:Georgia,'Times New Roman','Yu Mincho','Hiragino Mincho ProN',serif!important;
  }
  .racepo-hero h2 {font-size:clamp(20px,5.1vw,29px)!important;line-height:1.22!important;margin:4px 0!important;color:#f8e7c1!important;font-weight:800!important;letter-spacing:.03em!important;}
  .racepo-hero p {font-size:10px!important;line-height:1.6!important;color:#d6e9fa!important;max-width:19em;}
  .racepo-hero-corner {display:none!important;}

  body>main .card,body>main .panel,body>main .review-stats {
    background:linear-gradient(160deg,rgba(16,39,62,.94),rgba(10,26,44,.97) 90%)!important;
    border:1px solid rgba(90,129,160,.55)!important;border-radius:15px!important;box-shadow:0 8px 24px rgba(0,0,0,.2)!important;max-width:100%;min-width:0;
  }
  body>main .card.section,body>main .section {padding:12px!important;margin-bottom:12px!important;}
  body>main h2 {font-size:19px!important;font-weight:800!important;line-height:1.35!important;letter-spacing:.02em;color:#f1dfb8!important;}
  body>main h3 {font-size:16px!important;color:#d9ebfb!important;line-height:1.35;letter-spacing:.01em;}
  body>main p, body>main li, body>main td, body>main th, body>main label, body>main .muted, body>main .review-stats .muted, .left-sidebar .side-label {font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Yu Gothic UI',Meiryo,system-ui,sans-serif!important;}
  body>main .muted,body>main .review-stats .muted {color:var(--mob-muted)!important;line-height:1.5;}
  body>main button,body>main .btn {min-height:38px;touch-action:manipulation;font-family:inherit;font-weight:750;}
  body>main .btn,body>main button:not(.tab):not(.side-btn) {border-radius:10px;}
  body>main button:focus-visible,body>main a:focus-visible,body>main input:focus-visible,body>main select:focus-visible {outline:2px solid var(--mob-gold)!important;outline-offset:2px;}
  body>main input,body>main select,body>main textarea {max-width:100%;font-size:16px;border-radius:10px!important;}

  .top {flex-wrap:wrap;align-items:center;min-width:0;}
  .top>div:first-child {min-width:0;flex:1 1 185px;}
  .date-nav {display:flex;align-items:center;justify-content:space-between;gap:5px;max-width:100%;}
  .date-nav button {flex:0 0 auto;min-height:36px!important;padding:6px 8px!important;font-size:11px!important;white-space:nowrap;}
  .date-nav .global-date-center,.date-nav .date-display {flex:1 1 auto;min-width:0;text-align:center;font-size:12px!important;overflow-wrap:anywhere;}
  .tabs,.review-main-tabs,.result-mode-tabs,.game-tabs {display:flex!important;gap:6px!important;overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch;scrollbar-width:thin;}
  .tabs>.tab,.review-main-tabs>.btn,.result-mode-tabs>.btn {flex:0 0 auto!important;white-space:nowrap!important;min-height:40px!important;font-size:12px!important;padding:8px 11px!important;}

  .venue-grid,#vkVenueGrid {grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;}
  .venue {
    position:relative;min-width:0!important;min-height:82px!important;padding:8px 3px!important;text-align:center!important;border:1px solid rgba(90,135,168,.6)!important;border-radius:12px!important;
    background:
      linear-gradient(180deg,rgba(255,255,255,.02),rgba(255,255,255,0)),
      linear-gradient(155deg,rgba(18,57,87,.96),rgba(10,34,58,.98))!important;overflow:hidden;box-shadow:0 5px 16px rgba(0,0,0,.18);
  }
  .venue::after {
    content:"";position:absolute;left:-15%;right:-15%;bottom:10px;height:18px;opacity:.22;pointer-events:none;
    background:radial-gradient(ellipse at center,rgba(124,214,249,.65) 0, rgba(124,214,249,.18) 42%, rgba(124,214,249,0) 76%);
  }
  .venue b {font-size:clamp(11px,2.8vw,14px)!important;color:#f5e8cc!important;white-space:nowrap!important;letter-spacing:.02em;}
  .venue .muted {font-size:clamp(9px,2.25vw,11px)!important;overflow-wrap:anywhere!important;line-height:1.35!important;}
  .venue.closing {border-color:#ef777f!important;}

  #races.race-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;}
  #races .race {min-width:0!important;padding:8px 6px!important;border-radius:11px!important;border-color:#345b7b!important;background:linear-gradient(160deg,rgba(16,35,56,.95),rgba(9,24,41,.97))!important;}
  #races .race-head {font-size:12px!important;flex-wrap:wrap;}
  #races .mini {font-size:10px!important;gap:3px!important;}
  .race-grid:not(#races) {grid-template-columns:1fr!important;gap:8px!important;}
  .review-stage-columns,.review-detail-result,.stats-period-grid,.review-picks {grid-template-columns:1fr!important;}
  .review-stage-column,.review-pick-card,.review-stats {min-width:0!important;padding:10px!important;}
  .review-stats>summary,details>summary {
    padding:11px 8px!important;min-height:44px;line-height:1.45;overflow-wrap:anywhere;color:#f3e2bb!important;
    border-bottom:1px solid rgba(96,133,161,.22);font-size:15px!important;letter-spacing:.01em;
  }
  #reviewBody .review-stats,#reviewBody .daily-hit-list {max-width:100%;overflow:hidden;}
  .daily-hit-row {align-items:flex-start;gap:6px!important;}
  .review-stat-grid,.learning-summary {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;}
  .review-stat-card,.result-card {min-width:0;padding:10px!important;}
  .review-stats .big {font-size:clamp(17px,5vw,25px)!important;overflow-wrap:anywhere;color:var(--mob-cyan)!important;}

  .table-wrap,.odds-board,.game-official-odds,.course-history-table-wrap {max-width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;}
  table {max-width:none;}
  th,td {font-variant-numeric:tabular-nums;}
  .race-course-st-table {width:100%!important;min-width:0!important;}
  .race-course-st-table th,.race-course-st-table td {font-size:10px!important;padding:6px 2px!important;}
  .before-weather,.info-grid,.result-grid,.venue-stat-row {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;}
  .return-chart-tabs {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .return-chart-periods {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  #adminLoginForm input {box-sizing:border-box;width:100%!important;min-height:42px;}
  footer#boat-lens-legal-footer {margin-left:0!important;max-width:100%;overflow-wrap:anywhere;}
  @media (prefers-reduced-motion:reduce) {*,*:before,*:after {animation-duration:.01ms!important;transition-duration:.01ms!important;}}
}
@media screen and (max-width:360px) {
  body>main {padding:9px 6px 22px!important;}
  .left-sidebar .side-btn {flex-basis:69px!important;width:69px!important;min-width:69px!important;}
  .venue-grid {gap:4px!important;}
  .venue {padding:6px 2px!important;}
  .racepo-hero p {display:none;}
}

/* 17.302: same photographic hero asset on desktop and mobile. */
@media screen and (max-width:900px){
  body>main .racepo-hero, body>main .racepo-home-hero {
    display:flex!important;
    background:linear-gradient(90deg,rgba(5,18,32,.94),rgba(7,25,43,.82) 48%,rgba(7,27,43,.35)),url('/static/racepo-premium-hero.webp') right center / auto 165% no-repeat!important;
  }
}
