:root{--navy:#0b1220;--navy2:#131e33;--ink:#132039;--muted:#6d7890;--bg:#f5f7fb;--card:#fff;--line:#e7ebf2;--yellow:#ffb51b;--yellow2:#ffd45a;--blue:#4778ff;--green:#20bd78;--pink:#ff5d91;--purple:#8b67ff;--shadow:0 16px 45px rgba(18,31,55,.08);--radius:22px}*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:radial-gradient(circle at 85% 0,#fff4d6 0,transparent 23%),var(--bg);color:var(--ink)}button,input,select{font:inherit}button{cursor:pointer}.app-shell{display:flex;min-height:100vh}.sidebar{width:240px;background:linear-gradient(180deg,#0b1220,#101a2c);color:#fff;padding:28px 16px 18px;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;z-index:10}.brand{display:flex;align-items:center;gap:12px;padding:0 10px 24px}.brand-mark{width:40px;height:40px;border-radius:13px;background:var(--yellow);color:#0b1220;display:grid;place-items:center;font-size:23px;font-weight:900}.brand b{display:block;font-size:22px;letter-spacing:-.5px}.brand small{display:block;color:#9eabc1;font-size:9px;letter-spacing:3px;margin-top:2px}.side-athlete{padding:12px 10px 18px}.side-athlete .mini-profile{background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.06);border-radius:16px;padding:10px;display:flex;gap:10px;align-items:center}.mini-avatar{width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,#ffbd2d,#ff8c42);display:grid;place-items:center;color:#0b1220;font-weight:900}.side-athlete small{color:#9eabc1;display:block;font-size:10px;text-transform:uppercase;letter-spacing:1.5px}.sidebar nav{display:grid;gap:7px}.sidebar nav button{border:0;background:transparent;color:#b8c2d5;text-align:left;padding:13px 13px;border-radius:14px;display:flex;gap:12px;align-items:center;font-weight:700}.sidebar nav button span{width:22px;text-align:center;font-size:18px}.sidebar nav button.active,.sidebar nav button:hover{background:#26344d;color:#fff}.add-athlete{margin-top:auto;border:0;background:var(--yellow);color:#0b1220;border-radius:15px;padding:13px;font-weight:900}.sidebar-footer{font-size:10px;color:#77849a;text-align:center;padding:15px 4px 0}.main{margin-left:240px;width:calc(100% - 240px);padding:34px 42px 70px}.topbar{display:flex;justify-content:space-between;align-items:flex-start;max-width:1200px;margin:0 auto 26px}.eyebrow{font-size:10px;letter-spacing:2.5px;color:#7d879a;font-weight:900}.eyebrow span{color:var(--yellow)}h1{font-size:48px;line-height:1;margin:10px 0 10px;letter-spacing:-2.5px}h1 em{font-style:normal;color:#f29b00}h2,h3,p{margin-top:0}.topbar p{color:var(--muted);margin:0;font-weight:600}.athlete-picker{background:#fff;border:1px solid var(--line);border-radius:17px;padding:9px 14px;box-shadow:0 8px 22px rgba(18,31,55,.05);min-width:190px}.athlete-picker span{display:block;font-size:9px;letter-spacing:1.5px;color:#8892a6;font-weight:900}.athlete-picker select{border:0;outline:0;width:100%;font-weight:800;background:transparent;padding-top:4px}.tab{display:none;max-width:1200px;margin:auto}.tab.active{display:block}.hero{position:relative;overflow:hidden;background:linear-gradient(120deg,#101b2e 0%,#172844 62%,#263a5c 100%);color:#fff;border-radius:30px;padding:30px;display:grid;grid-template-columns:1fr 280px;gap:20px;box-shadow:var(--shadow);margin-bottom:18px}.hero:after{content:'⚡';position:absolute;right:24px;bottom:-45px;font-size:170px;opacity:.06;transform:rotate(-15deg)}.profile{display:flex;align-items:center;gap:18px;position:relative;z-index:1}.avatar{width:76px;height:76px;border-radius:24px;background:linear-gradient(135deg,var(--yellow),#ff8a3d);display:grid;place-items:center;color:#0b1220;font-size:38px;box-shadow:0 12px 25px rgba(255,181,27,.2)}.profile h2{font-size:30px;margin-bottom:5px}.profile p{color:#b8c4d9;margin:0}.level{position:relative;z-index:1;align-self:center}.level-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.level-row b{font-size:14px;letter-spacing:1px}.xp-ring{width:78px;height:78px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--yellow) calc(var(--xp)*1%),rgba(255,255,255,.12) 0);position:relative}.xp-ring:after{content:'';position:absolute;inset:7px;border-radius:50%;background:#172844}.xp-ring strong{position:relative;z-index:1;font-size:16px}.bar{height:9px;border-radius:99px;background:rgba(255,255,255,.12);overflow:hidden}.bar i{display:block;height:100%;background:linear-gradient(90deg,var(--yellow),#ff7c4c);border-radius:99px}.level small{color:#9daac0;display:block;margin-top:8px}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}.stat{background:#fff;border:1px solid var(--line);border-radius:20px;padding:18px;box-shadow:0 8px 28px rgba(18,31,55,.04);position:relative;overflow:hidden}.stat .icon{position:absolute;right:14px;top:12px;width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:#f4f6fb}.label{font-size:10px;text-transform:uppercase;letter-spacing:1.5px;color:#8791a5;font-weight:900}.big{font-size:32px;font-weight:950;letter-spacing:-1.5px;margin:10px 0 2px}.mini{font-size:11px;color:#7d8799;font-weight:650}.yellow{color:#f29b00}.blue{color:var(--blue)}.green{color:var(--green)}.pink{color:var(--pink)}.grid2{display:grid;grid-template-columns:1.35fr .9fr;gap:16px;margin-bottom:16px}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:22px;box-shadow:0 8px 28px rgba(18,31,55,.035)}.section{margin-bottom:16px}.sectionhead{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.sectionhead h2,.sectionhead h3{margin:0}.pill{background:#f1f4f9;color:#657087;padding:7px 10px;border-radius:99px;font-size:10px;font-weight:900}.chart{height:230px;position:relative}.chart svg{width:100%;height:100%;overflow:visible}.chart .gridline{stroke:#edf0f5;stroke-width:1}.chart .line{fill:none;stroke:var(--blue);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.chart .dot{fill:#fff;stroke:var(--blue);stroke-width:4}.chart-label{font-size:10px;fill:#8a94a7}.event-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.event-card{padding:16px;border-radius:18px;background:linear-gradient(145deg,#fff,#f7f9fc);border:1px solid var(--line);position:relative}.event-card .event-icon{font-size:20px}.event-card strong{font-size:25px;display:block;margin-top:8px}.trend{font-size:10px;color:var(--green);font-weight:900}.week{display:grid;gap:10px}.session{background:#f7f9fc;border:1px solid #edf0f5;border-radius:17px;padding:16px}.session.accent{border-color:#ffe0a0;background:linear-gradient(135deg,#fff9ea,#fff)}.session .day{font-size:10px;color:#f29b00;font-weight:950;letter-spacing:1px}.session h3{margin:6px 0 5px}.session p{color:#7a8598;font-size:12px;margin-bottom:9px}.session ul{margin:8px 0 0;padding-left:18px;color:#657087;font-size:12px;line-height:1.65}.rows{display:grid;gap:8px}.row{display:grid;grid-template-columns:1.2fr .9fr .8fr .6fr auto;gap:8px;align-items:center;background:#f8fafc;border-radius:13px;padding:11px 12px;font-size:12px}.pb{color:#e89000;font-weight:950}.empty{padding:42px 20px;text-align:center;color:#7d8799;font-weight:700}.btn{border:0;background:var(--yellow);color:#0b1220;padding:10px 14px;border-radius:12px;font-weight:900}.btn.secondary{background:#eef2f8;color:#3e4a60}.form{display:grid;grid-template-columns:1.2fr .8fr .9fr .9fr .8fr;gap:9px}.form input,.form select,.input{border:1px solid var(--line);background:#fff;padding:12px;border-radius:12px;outline:0;color:var(--ink)}.form input:focus,.form select:focus{border-color:#b6c6ed;box-shadow:0 0 0 3px #eef3ff}.racehero{background:linear-gradient(120deg,#111d31,#213a61);color:#fff;border-radius:25px;padding:25px;margin-bottom:16px;display:flex;justify-content:space-between;gap:20px;align-items:center}.racehero p{color:#b8c4d9;margin:5px 0 0}.racegrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.badgegrid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}.badge{text-align:center;padding:18px}.badgeicon{font-size:35px}.badge.locked{opacity:.42;filter:grayscale(1)}.badge p{color:#f29b00;font-size:12px}.progress-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.mobile-nav{display:none}.toast{position:fixed;right:24px;bottom:24px;background:#101b2e;color:#fff;border-radius:14px;padding:13px 17px;font-weight:800;box-shadow:var(--shadow);transform:translateY(20px);opacity:0;pointer-events:none;transition:.25s;z-index:50}.toast.show{transform:translateY(0);opacity:1}.celebrate{animation:pop .55s ease}.streak{display:flex;align-items:center;gap:8px;color:#ff7a35;font-weight:900}.goal{margin-top:12px;padding:12px;border-radius:14px;background:#fff8e8;color:#7b5a1c;font-size:12px;font-weight:750}@keyframes pop{0%{transform:scale(.96)}70%{transform:scale(1.02)}100%{transform:scale(1)}}
@media(max-width:1000px){.sidebar{width:200px}.main{margin-left:200px;width:calc(100% - 200px);padding:26px}.hero{grid-template-columns:1fr}.cards{grid-template-columns:repeat(2,1fr)}.event-grid,.badgegrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){body{padding-bottom:72px}.sidebar{display:none}.main{margin:0;width:100%;padding:20px 14px 40px}.topbar{display:block}.topbar h1{font-size:38px}.athlete-picker{margin-top:16px;width:100%}.hero{padding:20px;border-radius:24px}.profile{gap:12px}.avatar{width:62px;height:62px;font-size:30px}.profile h2{font-size:25px}.cards{grid-template-columns:repeat(2,1fr);gap:9px}.stat{padding:15px}.big{font-size:26px}.grid2{grid-template-columns:1fr}.event-grid,.racegrid,.badgegrid{grid-template-columns:1fr 1fr}.form{grid-template-columns:1fr 1fr}.form input:first-child{grid-column:1/-1}.rows{overflow-x:auto}.row{min-width:560px}.racehero{display:block}.racehero .btn{margin-top:14px}.mobile-nav{display:grid;grid-template-columns:repeat(4,1fr);position:fixed;bottom:0;left:0;right:0;background:rgba(11,18,32,.96);backdrop-filter:blur(15px);z-index:40;padding:8px 8px calc(8px + env(safe-area-inset-bottom));border-top:1px solid rgba(255,255,255,.08)}.mobile-nav button{border:0;background:transparent;color:#9aa7bc;border-radius:12px;padding:7px;font-size:18px}.mobile-nav button.active{background:#26344d;color:#fff}.mobile-nav small{display:block;font-size:9px;margin-top:2px}.chart{height:190px}.sectionhead{align-items:flex-start}.sectionhead h2{font-size:21px}}

/* ===== TRACKSTAR GRAPHICAL UPGRADE ===== */
:root{--deep:#06111f;--panel:#0c1b2d;--panel2:#10243b;--line2:rgba(255,255,255,.10);--glow:0 18px 60px rgba(0,0,0,.28)}
body{background:radial-gradient(circle at 12% 4%,rgba(34,118,255,.14),transparent 25%),radial-gradient(circle at 88% 18%,rgba(255,181,27,.12),transparent 23%),linear-gradient(180deg,#07111f 0%,#091827 55%,#07111f 100%);color:#eef5ff}
.main{padding-top:24px}.topbar{max-width:1380px;margin-bottom:18px}.topbar h1{color:#fff}.topbar p{color:#91a3bb}.athlete-picker{background:rgba(10,25,42,.86);border-color:rgba(255,255,255,.10);color:#fff}.athlete-picker span{color:#7f93ad}.athlete-picker select{color:#fff}.hero,.card,.stat{box-shadow:none}
.ai-hero{min-height:365px;border-radius:30px;overflow:hidden;position:relative;background:#081625;border:1px solid rgba(255,255,255,.10);box-shadow:var(--glow);margin-bottom:16px}.ai-hero-art{position:absolute;inset:0;background-image:linear-gradient(90deg,rgba(4,13,25,.93) 0%,rgba(4,13,25,.72) 32%,rgba(4,13,25,.15) 75%,rgba(4,13,25,.4)),url('/static/assets/hero-ai.jpg');background-size:cover;background-position:center}.ai-hero-glow{position:absolute;inset:auto -10% -45% 20%;height:180px;background:radial-gradient(circle,rgba(255,181,27,.28),transparent 65%);filter:blur(20px)}.ai-hero-content{position:relative;z-index:2;padding:45px 44px;width:60%}.hero-kicker{font-size:11px;font-weight:950;letter-spacing:2.5px;color:#ffd45a}.ai-hero-content h2{font-size:56px;line-height:.94;letter-spacing:-3px;margin:13px 0 16px;color:#fff}.ai-hero-content h2 em{font-style:normal;color:#ffd45a}.ai-hero-content p{font-size:16px;line-height:1.5;color:#c5d2e4;max-width:520px}.hero-actions{display:flex;align-items:center;gap:15px;margin-top:24px}.hero-btn{border:0;border-radius:14px;padding:13px 18px;background:linear-gradient(135deg,#ffd34f,#ff9e17);font-weight:950;color:#07111f;box-shadow:0 8px 28px rgba(255,181,27,.25)}.hero-link{border:0;background:rgba(255,255,255,.10);color:#fff;padding:13px 17px;border-radius:14px;font-weight:850}.hero-player{position:absolute;right:26px;bottom:24px;z-index:3;display:flex;align-items:center;gap:12px;background:rgba(4,14,26,.78);border:1px solid rgba(255,255,255,.13);backdrop-filter:blur(18px);padding:11px 13px;border-radius:18px;min-width:280px}.hero-avatar{width:48px;height:48px;border-radius:15px;background:linear-gradient(135deg,#ffd34f,#ff7b37);display:grid;place-items:center;color:#07111f;font-size:25px}.hero-player small,.hero-player span{display:block;color:#91a4bc;font-size:9px;letter-spacing:1.4px}.hero-player b{display:block;font-size:15px;color:#fff}.hero-ring{margin-left:auto;width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#ffd34f calc(var(--xp)*1%),rgba(255,255,255,.12) 0);position:relative}.hero-ring:after{content:'';position:absolute;inset:6px;border-radius:50%;background:#10243b}.hero-ring strong{position:relative;z-index:1;font-size:11px}
.neon-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:11px;margin-bottom:16px}.neon-stat{display:flex;gap:12px;align-items:center;border:1px solid rgba(255,255,255,.10);border-radius:18px;padding:13px 15px;background:linear-gradient(145deg,rgba(22,43,67,.98),rgba(9,23,39,.98));position:relative;overflow:hidden}.neon-stat:after{content:'';position:absolute;inset:auto -20px -30px auto;width:90px;height:90px;border-radius:50%;background:currentColor;opacity:.07;filter:blur(10px)}.neon-stat>span{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;font-size:21px;background:rgba(255,255,255,.09)}.neon-stat small{display:block;color:#8ea0b8;font-size:8px;font-weight:950;letter-spacing:1.4px}.neon-stat b{display:block;color:#fff;font-size:23px;line-height:1.05;margin:3px 0}.neon-stat em{font-style:normal;color:#9aacc2;font-size:9px}.neon-stat.blue{color:#39a0ff}.neon-stat.green{color:#27d88a}.neon-stat.gold{color:#ffd34f}.neon-stat.purple{color:#bd79ff}.neon-stat.red{color:#ff5e78}
.home-grid-top{display:grid;grid-template-columns:1.35fr .9fr;gap:14px;margin-bottom:14px}.home-grid-bottom{display:grid;grid-template-columns:1.35fr .9fr;gap:14px;margin-bottom:14px}.glass-panel{background:linear-gradient(145deg,rgba(14,32,52,.97),rgba(8,21,36,.97));border:1px solid rgba(255,255,255,.10);border-radius:23px;padding:19px;box-shadow:0 12px 40px rgba(0,0,0,.18)}.glass-panel h2{color:#fff}.label.bright{color:#ffd34f}.ghost-btn{border:1px solid rgba(255,255,255,.13);background:rgba(255,255,255,.06);color:#dbe7f7;border-radius:11px;padding:8px 11px;font-size:10px;font-weight:900}.athlete-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.athlete-tile{overflow:hidden;border:1px solid rgba(255,255,255,.09);border-radius:17px;background:#0b1a2c;transition:.22s;cursor:pointer}.athlete-tile:hover,.athlete-tile.selected{transform:translateY(-4px);border-color:rgba(255,211,79,.75);box-shadow:0 12px 30px rgba(0,0,0,.25)}.athlete-photo{height:150px;position:relative;overflow:hidden}.athlete-photo img{width:100%;height:100%;object-fit:cover;display:block}.level-chip{position:absolute;top:8px;right:8px;background:rgba(5,16,28,.82);color:#ffd34f;border:1px solid rgba(255,255,255,.12);padding:5px 7px;border-radius:9px;font-size:8px;font-weight:950}.athlete-tile-body{padding:11px}.athlete-name{display:flex;justify-content:space-between;color:#fff;font-size:15px}.athlete-name span{color:#ffd34f}.athlete-tile-body small{display:block;color:#8fa2bb;font-size:9px;margin:4px 0 9px}.xp-mini{height:6px;background:#182d45;border-radius:99px;overflow:hidden}.xp-mini i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#ffd34f,#ff7a42)}.xp-line{display:flex;justify-content:space-between;color:#7f94ad;font-size:8px;margin-top:5px;font-weight:850}.quest-stack{display:grid;gap:9px}.quest{display:flex;align-items:center;gap:10px;padding:12px;border-radius:15px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.07)}.quest.active{background:linear-gradient(135deg,rgba(255,183,27,.16),rgba(255,255,255,.04));border-color:rgba(255,211,79,.25)}.quest-icon{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;background:rgba(35,150,255,.17);font-size:17px}.quest-icon.pink{background:rgba(255,93,145,.15)}.quest-icon.gold{background:rgba(255,181,27,.15)}.quest div{flex:1}.quest b{display:block;color:#fff;font-size:12px}.quest small{display:block;color:#8fa2bb;font-size:9px;line-height:1.4;margin-top:3px}.quest button{border:0;background:#ffd34f;color:#07111f;width:30px;height:30px;border-radius:9px;font-weight:950}.quest-tag{font-size:8px;font-weight:950;color:#65d9a5;padding:6px 8px;border-radius:99px;background:rgba(32,189,120,.10)}.progress-panel{min-width:0}.big-chart{height:250px}.chart .line{stroke:#3aa8ff;filter:drop-shadow(0 0 7px rgba(58,168,255,.35))}.chart .gridline{stroke:rgba(255,255,255,.08)}.chart-label{fill:#7188a4}.chart .dot{fill:#0b1a2c;stroke:#56b6ff}.event-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.event-strip>div{display:grid;grid-template-columns:28px 1fr;column-gap:7px;padding:9px;border-radius:12px;background:rgba(255,255,255,.045)}.event-strip span{grid-row:1/3;font-size:17px}.event-strip small{color:#8298b0;font-size:8px}.event-strip b{color:#fff;font-size:12px}.ai-motivation{position:relative;min-height:320px;border-radius:23px;overflow:hidden;border:1px solid rgba(255,255,255,.10);background:#0b192a}.ai-motivation img{width:100%;height:100%;object-fit:cover;position:absolute;inset:0}.motivation-overlay{position:absolute;inset:0;padding:22px;display:flex;flex-direction:column;justify-content:flex-end;background:linear-gradient(180deg,transparent 25%,rgba(3,12,23,.90) 100%)}.motivation-overlay span{color:#ffd34f;font-size:9px;font-weight:950;letter-spacing:1.5px}.motivation-overlay b{font-size:23px;line-height:1.08;color:#fff;max-width:340px;margin:8px 0 12px}.motivation-overlay button{align-self:flex-start;border:0;background:#ffd34f;color:#07111f;border-radius:10px;padding:9px 12px;font-weight:950;font-size:10px}.wins-panel{margin-bottom:16px}.neon-rows .row{background:rgba(255,255,255,.045);color:#dce8f7;border:1px solid rgba(255,255,255,.05)}.neon-rows .row span{color:#94a8c0}.neon-rows .pb{color:#ffd34f}
.sidebar{background:linear-gradient(180deg,#06101e,#09182a);border-right:1px solid rgba(255,255,255,.08)}.brand-mark{box-shadow:0 0 22px rgba(255,181,27,.22)}.sidebar nav button.active,.sidebar nav button:hover{background:linear-gradient(90deg,#173a62,#10263f);box-shadow:inset 3px 0 #ffd34f}.add-athlete{box-shadow:0 10px 24px rgba(255,181,27,.15)}
@media(max-width:1150px){.neon-stats{grid-template-columns:repeat(3,1fr)}.athlete-grid{grid-template-columns:repeat(2,1fr)}.home-grid-top,.home-grid-bottom{grid-template-columns:1fr}.ai-motivation{min-height:260px}}
@media(max-width:720px){.main{padding:14px 12px 88px}.ai-hero{min-height:470px}.ai-hero-art{background-position:58% center}.ai-hero-content{padding:28px 22px;width:100%}.ai-hero-content h2{font-size:42px}.hero-player{left:16px;right:16px;bottom:16px;min-width:0}.neon-stats{grid-template-columns:repeat(2,1fr);gap:8px}.neon-stat{padding:11px}.neon-stat b{font-size:19px}.athlete-grid{grid-template-columns:1fr 1fr}.athlete-photo{height:125px}.event-strip{grid-template-columns:repeat(2,1fr)}.ai-motivation{min-height:250px}.big-chart{height:205px}}


/* ============================================================
   TRACKSTAR v0.7 — POLISHED VISUAL REBUILD
   Target: premium kids-sports dashboard / visual design mockup
   ============================================================ */

:root{
  --ts-navy:#071525;
  --ts-navy2:#10243b;
  --ts-blue:#4f7cff;
  --ts-cyan:#31c8ff;
  --ts-yellow:#ffc62e;
  --ts-orange:#ff8c42;
  --ts-pink:#ff5e93;
  --ts-purple:#8d68ff;
  --ts-green:#24c98a;
  --ts-bg:#f3f6fb;
  --ts-ink:#15253c;
  --ts-muted:#75839a;
  --ts-border:#e6ebf3;
  --ts-shadow:0 18px 55px rgba(17,34,58,.10);
}

body{
  background:
    radial-gradient(circle at 88% 2%,rgba(255,198,46,.20),transparent 20%),
    radial-gradient(circle at 20% 18%,rgba(79,124,255,.08),transparent 26%),
    var(--ts-bg);
  color:var(--ts-ink);
}

/* Sidebar */
.sidebar{
  width:226px;
  background:
    radial-gradient(circle at 70% 0%,rgba(79,124,255,.18),transparent 28%),
    linear-gradient(180deg,#071525 0%,#0a1a2b 55%,#07111e 100%);
  border-right:1px solid rgba(255,255,255,.08);
  padding:24px 14px 18px;
}
.brand{padding:0 10px 22px}
.brand-mark{
  width:44px;height:44px;border-radius:14px;
  background:linear-gradient(135deg,#ffe06b,#ff9e19);
  box-shadow:0 0 30px rgba(255,198,46,.25),0 8px 20px rgba(0,0,0,.2);
}
.brand b{font-size:23px}
.side-athlete{padding:10px 8px 20px}
.side-athlete .mini-profile{
  border-radius:18px;
  background:linear-gradient(135deg,rgba(255,255,255,.10),rgba(255,255,255,.035));
  box-shadow:inset 0 1px rgba(255,255,255,.08);
}
.sidebar nav{gap:5px}
.sidebar nav button{
  min-height:47px;
  border-radius:15px;
  transition:transform .18s,background .18s,box-shadow .18s;
}
.sidebar nav button span{font-size:19px}
.sidebar nav button.active,.sidebar nav button:hover{
  background:linear-gradient(90deg,rgba(79,124,255,.30),rgba(49,200,255,.07));
  box-shadow:inset 3px 0 var(--ts-yellow),0 8px 22px rgba(0,0,0,.12);
  transform:translateX(2px);
}
.add-athlete{
  border-radius:16px;
  background:linear-gradient(135deg,#ffd84c,#ff9d20);
  box-shadow:0 12px 30px rgba(255,174,30,.20);
}

/* Main header */
.main{
  margin-left:226px;
  width:calc(100% - 226px);
  padding:30px 38px 70px;
}
.topbar{
  max-width:1260px;
  margin:0 auto 22px;
  align-items:center;
}
.eyebrow{color:#8a96a9;letter-spacing:2.8px}
h1{
  font-size:42px;
  line-height:1.03;
  letter-spacing:-2.2px;
  margin:8px 0 8px;
}
h1 em{
  background:linear-gradient(90deg,#f09a00,#ff6b3d);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
.topbar p{font-size:14px}
.athlete-picker{
  border-radius:16px;
  border:1px solid var(--ts-border);
  box-shadow:0 10px 30px rgba(19,37,60,.07);
}

/* Hero — make it the visual centerpiece */
.ai-hero{
  min-height:390px;
  border-radius:30px;
  margin-bottom:17px;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 25px 70px rgba(8,22,40,.20);
  isolation:isolate;
}
.ai-hero-art{
  background-image:
    linear-gradient(90deg,rgba(5,15,28,.96) 0%,rgba(5,15,28,.84) 30%,rgba(5,15,28,.28) 66%,rgba(5,15,28,.18) 100%),
    linear-gradient(0deg,rgba(4,12,22,.30),transparent 48%),
    url('/static/assets/hero-ai.jpg');
  background-size:cover;
  background-position:center;
  transform:scale(1.01);
}
.ai-hero:before{
  content:"";
  position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    radial-gradient(circle at 82% 24%,rgba(49,200,255,.20),transparent 23%),
    radial-gradient(circle at 74% 100%,rgba(255,198,46,.20),transparent 25%);
}
.ai-hero-content{padding:48px 48px;width:63%}
.hero-kicker{
  display:inline-flex;align-items:center;gap:8px;
  padding:7px 10px;border-radius:999px;
  background:rgba(255,198,46,.12);
  border:1px solid rgba(255,198,46,.30);
  color:#ffe16c;
}
.ai-hero-content h2{
  font-size:60px;
  text-shadow:0 5px 24px rgba(0,0,0,.22);
}
.ai-hero-content h2 em{
  background:linear-gradient(90deg,#ffe26c,#ff9d27);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
.ai-hero-content p{font-size:16px;max-width:500px}
.hero-btn{
  padding:14px 20px;
  border-radius:15px;
  background:linear-gradient(135deg,#ffe16b,#ff9d20);
  box-shadow:0 14px 30px rgba(255,166,31,.28);
  transition:transform .18s,box-shadow .18s;
}
.hero-btn:hover{transform:translateY(-2px);box-shadow:0 18px 36px rgba(255,166,31,.36)}
.hero-link{
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.10);
  backdrop-filter:blur(12px);
}
.hero-player{
  border-radius:20px;
  background:rgba(4,14,26,.68);
  box-shadow:0 14px 40px rgba(0,0,0,.25);
  min-width:300px;
}
.hero-ring{
  width:58px!important;height:58px!important;
}

/* KPI strip */
.neon-stats{
  grid-template-columns:repeat(5,1fr);
  gap:12px;
  margin-bottom:17px;
}
.neon-stat{
  min-height:84px;
  border-radius:19px;
  padding:14px 15px;
  background:linear-gradient(145deg,#10243a,#091827);
  box-shadow:0 12px 28px rgba(10,25,42,.12);
  transition:transform .18s,box-shadow .18s;
}
.neon-stat:hover{transform:translateY(-3px);box-shadow:0 18px 36px rgba(10,25,42,.17)}
.neon-stat>span{
  width:45px;height:45px;border-radius:14px;
  box-shadow:inset 0 1px rgba(255,255,255,.10);
}
.neon-stat b{font-size:25px}

/* White premium cards — closer to the reference design */
.home-grid-top,.home-grid-bottom{
  gap:17px;
  margin-bottom:17px;
}
.glass-panel{
  background:rgba(255,255,255,.94);
  color:var(--ts-ink);
  border:1px solid rgba(225,231,241,.95);
  border-radius:24px;
  padding:21px;
  box-shadow:var(--ts-shadow);
}
.glass-panel h2{color:var(--ts-ink)}
.label.bright{color:#f09a00}
.sectionhead{margin-bottom:16px}
.sectionhead h2{font-size:23px;letter-spacing:-.7px}
.ghost-btn{
  color:#34435a;
  background:#f7f9fc;
  border-color:#e1e7ef;
  transition:.18s;
}
.ghost-btn:hover{background:#eef3fa;transform:translateY(-1px)}

/* Athlete cards */
.athlete-grid{gap:12px}
.athlete-tile{
  border:1px solid #e2e8f1;
  border-radius:19px;
  background:#fff;
  box-shadow:0 8px 24px rgba(20,38,63,.07);
  transition:transform .2s,box-shadow .2s,border-color .2s;
}
.athlete-tile:hover,.athlete-tile.selected{
  transform:translateY(-5px);
  border-color:#8aa8ff;
  box-shadow:0 17px 35px rgba(40,77,135,.15);
}
.athlete-photo{
  height:175px;
  background:linear-gradient(135deg,#dfe9ff,#fff3d4);
}
.athlete-photo:after{
  content:"";
  position:absolute;inset:0;
  background:linear-gradient(180deg,transparent 58%,rgba(6,20,36,.22));
  pointer-events:none;
}
.level-chip{
  top:10px;right:10px;
  background:rgba(7,21,37,.84);
  color:#ffe06a;
  backdrop-filter:blur(8px);
  border-radius:999px;
}
.athlete-tile-body{padding:13px}
.athlete-name{color:#16263d;font-size:16px}
.athlete-name span{color:#f6b900}
.athlete-tile-body small{color:#7d8aa0}
.xp-mini{background:#edf1f7;height:7px}
.xp-mini i{background:linear-gradient(90deg,#ffc62e,#ff7b4d,#ff5e93)}
.xp-line{color:#8591a4}

/* Quest panel */
.quest{background:#f8fafd;border-color:#e8edf4;transition:.18s}
.quest:hover{transform:translateX(3px);box-shadow:0 8px 22px rgba(20,40,70,.06)}
.quest.active{background:linear-gradient(135deg,#fff7dc,#f8fbff);border-color:#f1d273}
.quest b{color:#20314a}
.quest small{color:#7b889c}
.quest-tag{
  border-radius:999px;
  background:#eef7ff;
  color:#3974c9!important;
  padding:5px 8px;
  font-weight:900;
}

/* Progress / chart */
.progress-panel{overflow:hidden}
.big-chart{
  min-height:240px;
  border-radius:18px;
  background:linear-gradient(180deg,#f8fbff,#fff);
  border:1px solid #e9eef5;
  padding:8px;
}
.chart .line{stroke:#4f7cff;stroke-width:4;fill:none;filter:drop-shadow(0 3px 5px rgba(79,124,255,.25))}
.chart .dot{fill:#fff;stroke:#4f7cff;stroke-width:4}
.chart .gridline{stroke:#e8edf4}
.chart-label{fill:#8490a2;font-size:11px}
.event-strip{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin-top:12px;
}
.event-strip>div{
  padding:10px 12px;
  border:1px solid #e7ecf3;
  border-radius:15px;
  background:#fafbfd;
}
.event-strip small{color:#7f8ba0}
.event-strip b{display:block;color:#1a2a42;margin-top:3px}

/* Motivation image */
.ai-motivation{
  min-height:330px;
  border-radius:24px;
  box-shadow:var(--ts-shadow);
}
.ai-motivation:after{
  content:"";
  position:absolute;inset:0;pointer-events:none;
  border:1px solid rgba(255,255,255,.15);
  border-radius:24px;
}
.motivation-overlay{padding:24px}
.motivation-overlay b{font-size:27px;text-shadow:0 3px 15px rgba(0,0,0,.25)}

/* Recent results */
.wins-panel .row{
  border-radius:13px;
  background:#f8fafd;
  border-color:#e7ecf3;
  color:#26364e;
  margin-bottom:7px;
}
.neon-rows .row{background:#f8fafd;color:#26364e}
.neon-rows .row span{color:#8290a4}

/* Subtle motion */
.ai-hero,.glass-panel,.neon-stat,.athlete-tile,.ai-motivation{
  animation:ts-rise .45s ease both;
}
@keyframes ts-rise{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}
.athlete-tile:nth-child(2){animation-delay:.04s}
.athlete-tile:nth-child(3){animation-delay:.08s}
.athlete-tile:nth-child(4){animation-delay:.12s}

/* Mobile */
@media(max-width:1150px){
  .neon-stats{grid-template-columns:repeat(3,1fr)}
  .athlete-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:720px){
  .sidebar{display:none}
  .main{margin-left:0;width:100%;padding:15px 12px 90px}
  .topbar{display:block}
  h1{font-size:31px}
  .athlete-picker{margin-top:14px}
  .ai-hero{min-height:510px}
  .ai-hero-content{padding:30px 22px;width:100%}
  .ai-hero-content h2{font-size:43px}
  .hero-player{left:14px;right:14px;min-width:0}
  .neon-stats{grid-template-columns:repeat(2,1fr)}
  .neon-stat{min-height:76px}
  .neon-stat b{font-size:21px}
  .home-grid-top,.home-grid-bottom{grid-template-columns:1fr}
  .athlete-grid{grid-template-columns:repeat(2,1fr)}
  .athlete-photo{height:145px}
  .event-strip{grid-template-columns:repeat(2,1fr)}
}


/* TRACKSTAR v0.8 HIGH-IMPACT DASHBOARD */
.hero-v8{min-height:410px;position:relative}.hero-v8 .ai-hero-art{background-position:center 42%}.hero-v8 .ai-hero-content{z-index:3}.hero-v8 .hero-player{z-index:4}.hero-spark{position:absolute;z-index:3;color:#ffd34f;font-size:28px;filter:drop-shadow(0 0 10px rgba(255,211,79,.45));animation:floatSpark 3.5s ease-in-out infinite}.spark1{right:34%;top:15%}.spark2{right:9%;bottom:25%;animation-delay:1.2s}@keyframes floatSpark{50%{transform:translateY(-8px) rotate(12deg);opacity:.72}}
.hero-callout{position:absolute;right:28px;top:28px;z-index:4;display:flex;align-items:center;gap:10px;padding:11px 14px;border:1px solid rgba(255,255,255,.16);border-radius:16px;background:rgba(5,16,29,.60);backdrop-filter:blur(12px);color:#fff;box-shadow:0 14px 35px rgba(0,0,0,.22)}.hero-callout>span{font-size:25px}.hero-callout b,.hero-callout small{display:block}.hero-callout b{font-size:11px}.hero-callout small{font-size:9px;color:#b9c7da;margin-top:2px}
.stats-v8 .neon-stat{position:relative}.stats-v8 .neon-stat:after{content:'';position:absolute;inset:auto 12px 0;height:2px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.18),transparent)}
.dashboard-ribbon{display:flex;align-items:center;gap:13px;padding:13px 17px;margin:-2px 0 17px;border-radius:17px;background:linear-gradient(90deg,#fff7d9,#ffffff 48%,#eef7ff);border:1px solid #f0df9d;box-shadow:0 10px 24px rgba(32,45,65,.05)}.dashboard-ribbon>span{font-size:9px;letter-spacing:1.5px;font-weight:950;color:#df9100}.dashboard-ribbon>b{font-size:13px}.dashboard-ribbon>small{color:#78869a;flex:1}.dashboard-ribbon>button{border:0;background:#0b1b30;color:#fff;border-radius:10px;padding:8px 11px;font-size:10px;font-weight:900}
.v8-top{grid-template-columns:1.5fr .9fr}.team-v8 .athlete-grid{grid-template-columns:repeat(4,1fr)}.athlete-tile{overflow:hidden}.athlete-photo{position:relative}.photo-medal{position:absolute;left:10px;bottom:10px;width:29px;height:29px;border-radius:50%;display:grid;place-items:center;background:rgba(7,21,37,.78);backdrop-filter:blur(8px);font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,.22)}.athlete-meta{display:flex;justify-content:space-between;margin-top:9px;font-size:9px;color:#8a96a8;font-weight:850}.athlete-meta span:first-child{color:#df9900}.add-slot{border:2px dashed #dfe6f0;background:linear-gradient(180deg,#fff,#f7faff);cursor:pointer;display:flex;flex-direction:column;justify-content:center}.add-slot:hover{border-color:#ffc62e;background:#fffaf0}.add-art{height:175px;display:grid;place-items:center;font-size:50px;color:#c2cada;background:radial-gradient(circle,#fff6d4,transparent 60%)}.add-slot:hover .add-art{color:#ffb51b}.slot-cta{margin-top:9px;font-size:10px;font-weight:950;color:#4778ff}
.quest-v8 .quest-stack{gap:9px}.quest-v8 .quest{min-height:62px}.streak-quest{background:linear-gradient(90deg,#fff4df,#fff)!important;border-color:#ffe2ac!important}.streak-quest strong{font-size:11px;color:#e99000;margin-left:auto}
.v8-bottom{grid-template-columns:1.35fr .85fr}.progress-v8{min-height:390px}.progress-v8 .big-chart{height:230px}.results-v8{min-height:390px}.micro-results{display:grid;gap:8px}.micro-result{display:grid;grid-template-columns:32px 1fr auto auto;align-items:center;gap:8px;padding:10px 11px;border-radius:14px;background:#f7f9fc;border:1px solid #e9edf4}.micro-result>span{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;background:#eaf0ff}.micro-result b{font-size:11px}.micro-result strong{font-size:13px}.micro-result em{font-style:normal;font-size:8px;font-weight:950;color:#8290a3}.micro-result .pb{color:#e99000}.mini-callout{display:flex;gap:10px;align-items:center;margin-top:12px;padding:12px;border-radius:15px;background:#fff8e5;border:1px solid #f5dfab}.mini-callout>span{font-size:23px}.mini-callout b,.mini-callout small{display:block}.mini-callout b{font-size:11px}.mini-callout small{font-size:9px;color:#7d8799;margin-top:3px}.rewards-v8{margin-bottom:17px}.badge-row{display:grid;grid-template-columns:repeat(6,1fr);gap:9px}.badge-mini{min-height:92px;padding:10px;border-radius:16px;border:1px solid #e7ebf2;background:linear-gradient(145deg,#fff,#f7f9fc);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;transition:.18s}.badge-mini:hover{transform:translateY(-3px);box-shadow:0 10px 24px rgba(18,31,55,.08)}.badge-mini>div{font-size:27px}.badge-mini span{font-size:9px;font-weight:900;color:#59677c;text-align:center}.badge-mini.locked{opacity:.42;filter:grayscale(1)}.badge-mini.add-badge{border-style:dashed;cursor:pointer;background:#fbfcfe}.badge-mini.add-badge>div{font-size:25px;color:#a0adbf}.motivation-v8{margin-top:0;min-height:250px;border-radius:24px;overflow:hidden}.motivation-v8 .motivation-overlay{padding:26px}.quote-sticker{position:absolute;right:24px;top:22px;z-index:2;color:#fff;font-size:14px;font-weight:950;line-height:1.05;text-align:right;transform:rotate(-4deg);text-shadow:0 3px 12px rgba(0,0,0,.35)}.quote-sticker strong{color:#ffd34f;font-size:19px}
@media(max-width:1150px){.team-v8 .athlete-grid{grid-template-columns:repeat(2,1fr)}.badge-row{grid-template-columns:repeat(3,1fr)}.v8-top,.v8-bottom{grid-template-columns:1fr}}@media(max-width:720px){.hero-v8{min-height:500px}.hero-callout{right:16px;top:16px}.hero-spark{display:none}.dashboard-ribbon{display:grid;grid-template-columns:auto 1fr}.dashboard-ribbon>small{grid-column:1/-1}.dashboard-ribbon>button{grid-column:1/-1}.team-v8 .athlete-grid{grid-template-columns:repeat(2,1fr)}.add-art{height:125px}.badge-row{grid-template-columns:repeat(3,1fr)}.quote-sticker{display:none}.micro-result{grid-template-columns:28px 1fr auto}.micro-result em{display:none}}


/* ============================================================
   TRACKSTAR v0.9 — FULL-CANVAS DESKTOP COMPOSITION
   Removes the centred 1200px bottleneck visible in v0.8.
   ============================================================ */

@media(min-width:1151px){
  .main{
    margin-left:240px;
    width:calc(100% - 240px);
    padding:30px 34px 70px;
  }

  .topbar{
    max-width:none;
    width:100%;
    margin:0 0 22px;
  }

  .tab{
    display:none;
    max-width:none;
    width:100%;
    margin:0;
  }

  .tab.active{
    display:block;
  }

  .ai-hero{
    width:100%;
    min-height:390px;
  }

  .neon-stats{
    width:100%;
    grid-template-columns:repeat(5,minmax(0,1fr));
  }

  .home-grid-top,
  .home-grid-bottom{
    width:100%;
  }

  .glass-panel{
    width:100%;
  }
}

/* Make the large-screen composition feel closer to the reference:
   stronger horizontal rhythm, larger hero, less dead space. */
@media(min-width:1450px){
  .main{padding-left:38px;padding-right:38px}
  .ai-hero{min-height:420px}
  .ai-hero-content{padding:54px 56px}
  .ai-hero-content h2{font-size:64px}
  .neon-stat{min-height:92px}
  .sectionhead h2{font-size:25px}
}

/* Wide screens: use the available canvas instead of shrinking cards. */
@media(min-width:1800px){
  .main{padding-left:44px;padding-right:44px}
  .home-grid-top{grid-template-columns:1.55fr .95fr}
  .home-grid-bottom{grid-template-columns:1.55fr .95fr}
  .athlete-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* Give the single-athlete state visual weight while more athletes are added. */
.empty-athlete{
  min-height:245px;
  border:2px dashed #dbe4f0;
  border-radius:20px;
  background:
    radial-gradient(circle at 50% 45%,rgba(255,198,46,.13),transparent 30%),
    linear-gradient(180deg,#fbfcfe,#f6f9fd);
  transition:.2s;
}
.empty-athlete:hover{
  border-color:#ffc62e;
  transform:translateY(-2px);
  box-shadow:0 12px 30px rgba(255,198,46,.12);
}
.empty-athlete .plus{
  width:54px;height:54px;border-radius:18px;
  background:linear-gradient(135deg,#fff2b0,#ffc62e);
  color:#13243a;
  box-shadow:0 10px 25px rgba(255,198,46,.22);
  font-size:30px;
}

/* Make the dashboard feel alive even before data is entered. */
.empty-state{
  min-height:190px;
  display:grid;
  place-items:center;
  text-align:center;
  border-radius:20px;
  background:
    radial-gradient(circle at 50% 35%,rgba(79,124,255,.09),transparent 34%),
    linear-gradient(180deg,#fbfcff,#f7f9fc);
  border:1px solid #e7edf5;
}
.empty-state strong{font-size:18px;color:#263751}
.empty-state span{display:block;color:#8491a4;margin-top:6px}

/* Prevent desktop controls from becoming tiny when the viewport grows. */
@media(min-width:1450px){
  .athlete-picker{min-width:180px}
  .hero-player{min-width:320px}
}

/* Gender-aware athlete profile modal */
.athlete-modal-backdrop{
  position:fixed;inset:0;z-index:9999;display:grid;place-items:center;
  padding:20px;background:rgba(3,13,25,.72);backdrop-filter:blur(14px);
}
.athlete-modal{
  width:min(520px,100%);max-height:calc(100vh - 40px);overflow:auto;
  background:#fff;border:1px solid #e3e9f2;border-radius:28px;padding:28px;
  box-shadow:0 30px 100px rgba(0,0,0,.30);position:relative;
}
.athlete-modal h2{font-size:30px;letter-spacing:-1px;margin:5px 0 8px;color:#14253d}
.modal-sub{color:#77869a;font-size:13px;line-height:1.5;margin:0 0 18px}
.modal-close{
  position:absolute;right:17px;top:14px;border:0;background:#f2f5f9;
  width:38px;height:38px;border-radius:50%;font-size:25px;color:#3b4a60;cursor:pointer;
}
.athlete-modal label{display:block;font-weight:800;color:#26364d;font-size:13px;margin:12px 0}
.athlete-modal input,.athlete-modal select,.athlete-modal textarea{
  width:100%;margin-top:6px;padding:12px 13px;border:1px solid #dfe6ef;
  border-radius:13px;background:#f9fbfd;color:#182941;font:inherit;outline:none;
}
.athlete-modal input:focus,.athlete-modal select:focus,.athlete-modal textarea:focus{
  border-color:#7ea2ff;box-shadow:0 0 0 4px rgba(79,124,255,.10)
}
.gender-preview{
  display:flex;gap:13px;align-items:center;padding:10px;border-radius:17px;
  background:linear-gradient(135deg,#f7f9fd,#fff);border:1px solid #e7edf4;
}
.gender-preview img{width:72px;height:72px;object-fit:cover;border-radius:14px}
.gender-preview b{display:block;color:#243650}.gender-preview small{display:block;color:#7c899d;margin-top:3px}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}

.athlete-photo img{object-fit:cover;object-position:center top}


/* TrackStar v1.1 custom avatar builder */
.custom-avatar{
  width:100%;height:100%;display:block;
  filter:drop-shadow(0 12px 18px rgba(17,35,60,.12));
}
.custom-avatar-wrap{
  display:flex;align-items:flex-end;justify-content:center;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 28%,rgba(255,198,46,.18),transparent 33%),
    linear-gradient(135deg,#eaf2ff,#fff4d7);
}
.custom-avatar-wrap .custom-avatar{height:100%;width:100%}
.avatar-builder{
  display:flex;align-items:center;gap:18px;
  padding:12px;border-radius:20px;
  background:linear-gradient(135deg,#f7faff,#fff9e9);
  border:1px solid #e3eaf3;margin:14px 0 18px;
}
.avatar-live{
  width:120px;height:130px;border-radius:18px;overflow:hidden;
  background:#eaf2ff;box-shadow:0 10px 25px rgba(20,40,70,.10);
}
.avatar-live .custom-avatar{width:120px;height:136px}
.avatar-live-copy{display:flex;flex-direction:column;gap:5px}
.avatar-live-copy b{font-size:16px}
.avatar-live-copy small{color:#78869a;max-width:260px}
.form-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
}
.form-grid label{margin:0}
.appearance-modal{max-width:720px}
@media(max-width:700px){
  .form-grid{grid-template-columns:1fr}
  .appearance-modal{width:calc(100vw - 24px)}
}

.delete-athlete{
  width:100%;margin-top:8px;padding:7px 9px;
  border:1px solid #f0d4d4;border-radius:10px;
  background:#fff7f7;color:#a94a4a;
  font:inherit;font-size:11px;font-weight:800;
  cursor:pointer;transition:.18s;
}
.delete-athlete:hover{background:#fff0f0;border-color:#e8b8b8;transform:translateY(-1px)}

.logo-picker-trigger{
  display:flex;align-items:center;gap:7px;
  border:1px solid #dfe7f0;border-radius:12px;
  background:#fff;color:#20324b;padding:7px 10px;
  font:inherit;font-size:11px;font-weight:800;cursor:pointer;
  box-shadow:0 5px 16px rgba(20,40,70,.06);
}
.logo-picker-trigger svg{width:26px;height:26px}
.logo-brand-wrap{display:flex;align-items:center;gap:8px}
#brandLogoSlot,#brandLogo{width:46px;height:46px;display:block;flex:0 0 46px}
#brandLogoSlot svg,#brandLogo svg{width:100%;height:100%}
.logo-choice-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;
  margin:18px 0;
}
.logo-choice{
  border:2px solid #e2e9f2;border-radius:18px;background:#fbfcfe;
  padding:12px;display:flex;flex-direction:column;align-items:center;gap:7px;
  cursor:pointer;transition:.18s;font:inherit;color:#24364e;
}
.logo-choice svg{width:62px;height:62px}
.logo-choice:hover{transform:translateY(-2px);border-color:#ffc62e}
.logo-choice.selected{border-color:#ffc62e;box-shadow:0 0 0 4px rgba(255,198,46,.16);background:#fffaf0}
.logo-modal{max-width:680px}
@media(max-width:700px){.logo-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* =========================================================
   TrackStar Mobile App Experience
   ========================================================= */
@media(max-width:700px){

  html,body{
    width:100%;
    min-width:0;
    overflow-x:hidden;
  }

  body{
    padding-bottom:82px;
  }

  .sidebar{
    display:none !important;
  }

  .main{
    margin-left:0 !important;
    width:100% !important;
    padding:14px 14px 28px !important;
  }

  .topbar{
    position:sticky;
    top:0;
    z-index:100;
    margin:-14px -14px 16px;
    padding:12px 14px;
    background:rgba(247,249,252,.94);
    backdrop-filter:blur(18px);
  }

  .topbar h1{
    font-size:22px;
    line-height:1.1;
  }

  .topbar p{
    display:none;
  }

  .athlete-picker{
    min-width:0 !important;
    max-width:48%;
  }

  .athlete-picker select{
    max-width:100%;
  }

  .home-grid-top,
  .home-grid-bottom,
  .grid,
  .two-col,
  .three-col{
    grid-template-columns:1fr !important;
  }

  .hero{
    min-height:0 !important;
    padding:18px !important;
    border-radius:22px !important;
  }

  .hero-player{
    min-width:0 !important;
  }

  .hero h2{
    font-size:28px !important;
  }

  .hero-player img,
  .hero-player .custom-avatar-wrap{
    width:92px !important;
    height:92px !important;
  }

  .card{
    border-radius:20px !important;
    padding:16px !important;
  }

  .kpi-grid,
  .stats-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }

  .kpi{
    padding:13px !important;
    min-width:0;
  }

  .kpi strong{
    font-size:22px !important;
  }

  .athlete-grid{
    grid-template-columns:1fr !important;
  }

  .athlete-card{
    min-height:0 !important;
  }

  .mobile-nav{
    position:fixed !important;
    left:10px !important;
    right:10px !important;
    bottom:10px !important;
    z-index:9990 !important;
    height:66px !important;
    border-radius:22px !important;
    background:rgba(11,18,32,.96) !important;
    box-shadow:0 14px 40px rgba(0,0,0,.28) !important;
    display:grid !important;
    grid-template-columns:repeat(4,1fr);
    padding:5px !important;
    backdrop-filter:blur(18px);
  }

  .mobile-nav button{
    border:0 !important;
    background:transparent !important;
    color:#9eabc0 !important;
    border-radius:17px !important;
    font-size:21px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:2px !important;
    min-width:0 !important;
  }

  .mobile-nav button.active{
    background:#ffc62e !important;
    color:#101b2c !important;
  }

  .mobile-nav small{
    font-size:9px !important;
    font-weight:800 !important;
    letter-spacing:.2px;
  }

  .section-title{
    font-size:20px !important;
  }

  .avatar-builder{
    flex-direction:column;
    align-items:stretch;
  }

  .avatar-live{
    margin:auto;
  }

  .form-grid{
    grid-template-columns:1fr !important;
  }

  .logo-choice-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .athlete-modal-backdrop{
    padding:10px !important;
    align-items:end !important;
  }

  .athlete-modal{
    width:100% !important;
    max-height:92vh !important;
    border-radius:26px 26px 12px 12px !important;
    padding:20px !important;
  }

  .modal-actions{
    position:sticky;
    bottom:0;
    background:#fff;
    padding-top:10px;
  }

  button,
  select,
  input{
    min-height:44px;
  }

  .toast{
    bottom:88px !important;
    left:14px !important;
    right:14px !important;
    width:auto !important;
    text-align:center;
  }
}

/* Mobile Progress comparison fix */
@media(max-width:700px){
  .progress img,
  .progress canvas,
  .progress svg,
  .comparison img,
  .comparison canvas,
  .comparison svg{
    max-width:100% !important;
    width:100% !important;
    height:auto !important;
  }

  .progress,
  .comparison,
  .progress-card,
  .comparison-card{
    min-width:0 !important;
    max-width:100% !important;
    overflow:hidden !important;
  }

  .progress-grid,
  .comparison-grid{
    grid-template-columns:1fr !important;
    min-width:0 !important;
  }
}

/* Mobile hero / motivation card cleanup */
@media(max-width:700px){
  .hero{
    overflow:hidden !important;
  }

  .hero .motivation,
  .hero .motivation-card,
  .hero .motivation-corner,
  .motivation,
  .motivation-card,
  .motivation-corner{
    position:static !important;
    width:100% !important;
    max-width:100% !important;
    margin:12px 0 0 !important;
    box-sizing:border-box !important;
  }

  .hero > *,
  .hero-player,
  .hero-content{
    min-width:0 !important;
    max-width:100% !important;
  }

  .hero img{
    max-width:100% !important;
  }

  body,
  .main,
  .content,
  .section{
    overflow-x:hidden !important;
  }
}

/* FINAL MOBILE HERO CALLOUT FIX */
@media(max-width:700px){
  .hero-v8 .hero-callout{
    position:static !important;
    top:auto !important;
    right:auto !important;
    left:auto !important;
    bottom:auto !important;
    transform:none !important;
    width:calc(100% - 20px) !important;
    max-width:none !important;
    margin:12px auto 0 !important;
    box-sizing:border-box !important;
    z-index:5 !important;
  }
}

.event-manager-modal{
  max-width:820px;
}

.event-manager-current{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:14px 0 18px;
  padding:12px 15px;
  border-radius:14px;
  background:#f5f7fb;
  border:1px solid #e5e9f1;
}

.event-manager-current span{
  font-size:11px;
  color:#7d899b;
  font-weight:800;
}

.event-manager-group{
  margin-bottom:18px;
}

.event-manager-title{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:1.5px;
  font-weight:950;
  color:#8995a8;
  margin-bottom:8px;
}

.event-manager-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
}

.event-choice{
  display:flex;
  align-items:center;
  gap:7px;
  padding:11px 10px;
  border:1px solid #e4e9f1;
  border-radius:13px;
  background:#fff;
  cursor:pointer;
  transition:.15s;
}

.event-choice:hover{
  transform:translateY(-1px);
  border-color:#cbd5e4;
}

.event-choice.selected{
  border-color:#ffd34f;
  background:#fff9e7;
  box-shadow:0 0 0 1px rgba(255,211,79,.2);
}

.event-choice input{
  accent-color:#f5b800;
}

.event-choice span{
  font-size:18px;
}

.event-choice b{
  font-size:10px;
}

.custom-event-label{
  display:grid;
  gap:6px;
  margin-top:10px;
  font-size:10px;
  font-weight:900;
  color:#647287;
}

.custom-event-label input{
  padding:11px 12px;
  border:1px solid #dfe5ee;
  border-radius:11px;
  font:inherit;
  outline:none;
}

.custom-event-label input:focus{
  border-color:#f5c542;
  box-shadow:0 0 0 3px rgba(245,197,66,.12);
}

@media(max-width:720px){
  .event-manager-grid{
    grid-template-columns:repeat(2,1fr);
  }

  .event-manager-modal{
    max-height:90vh;
    overflow:auto;
  }

  .event-manager-current{
    gap:8px;
    align-items:flex-start;
    flex-direction:column;
  }
}


/* =========================================================
   TRACKSTAR MOBILE APP OVERRIDE
   ========================================================= */

@media (max-width:700px){

  html{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  body{
    width:100%;
    max-width:100%;
    min-width:0 !important;
    margin:0;
    padding:0;
    overflow-x:hidden !important;
    -webkit-text-size-adjust:100%;
  }

  .app,
  .main,
  .content,
  .section,
  .tab,
  .card{
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box;
  }

  .main{
    width:100% !important;
    margin:0 !important;
    padding-bottom:88px !important;
  }

  .content{
    width:100% !important;
    padding:12px !important;
  }

  /* Hide desktop sidebar */
  .sidebar{
    display:none !important;
  }

  /* Top bar */
  .topbar{
    position:sticky !important;
    top:0;
    z-index:100;
    width:100% !important;
    min-height:58px !important;
    padding:10px 12px !important;
    box-sizing:border-box;
  }

  .topbar > *{
    min-width:0;
  }

  /* Athlete selector */
  #athleteSelect{
    max-width:150px !important;
    min-width:0 !important;
    font-size:13px !important;
  }

  /* Hero */
  .hero,
  .hero-v8{
    width:100% !important;
    min-height:0 !important;
    padding:18px !important;
    border-radius:18px !important;
    box-sizing:border-box;
    overflow:hidden !important;
  }

  .hero h1,
  .hero-v8 h1{
    font-size:30px !important;
    line-height:1.05 !important;
    max-width:100% !important;
  }

  .hero p,
  .hero-v8 p{
    max-width:100% !important;
    font-size:13px !important;
  }

  .hero-callout{
    position:static !important;
    width:100% !important;
    max-width:100% !important;
    margin:14px 0 0 !important;
    transform:none !important;
  }

  /* Grids become phone friendly */
  .grid,
  .stats-grid,
  .kpi-grid,
  .racegrid,
  .badgegrid,
  .dashboard-grid{
    grid-template-columns:1fr !important;
    width:100% !important;
    min-width:0 !important;
  }

  .racegrid{
    gap:10px !important;
  }

  /* Cards */
  .card{
    width:100% !important;
    padding:14px !important;
    overflow:hidden;
  }

  .sectionhead{
    gap:8px;
    flex-wrap:wrap;
  }

  .sectionhead h2{
    font-size:20px !important;
  }

  /* Buttons */
  button,
  .btn,
  .hero-btn,
  .ghost-btn{
    min-height:44px;
    touch-action:manipulation;
  }

  .btn,
  .hero-btn,
  .ghost-btn{
    max-width:100%;
  }

  /* Race Day */
  .racehero{
    display:flex !important;
    flex-direction:column !important;
    gap:14px !important;
    padding:18px !important;
    width:100% !important;
    box-sizing:border-box;
  }

  .racehero h2{
    font-size:24px !important;
  }

  /* Forms */
  .form{
    grid-template-columns:1fr !important;
  }

  input,
  select,
  textarea{
    max-width:100% !important;
    box-sizing:border-box;
    font-size:16px !important;
  }

  /* Achievements */
  .badgegrid{
    grid-template-columns:1fr 1fr !important;
  }

  .badge{
    min-width:0 !important;
  }

  /* Event manager */
  .event-manager-modal{
    width:calc(100vw - 24px) !important;
    max-width:none !important;
    max-height:calc(100vh - 24px) !important;
    margin:12px !important;
    overflow-y:auto !important;
    box-sizing:border-box;
  }

  .event-manager-grid{
    grid-template-columns:1fr 1fr !important;
  }

  .event-choice{
    min-height:52px;
    box-sizing:border-box;
  }

  /* Bottom navigation */
  .mobile-nav{
    display:grid !important;
    grid-template-columns:repeat(4,1fr);
    position:fixed !important;
    left:0;
    right:0;
    bottom:0;
    z-index:9999;
    width:100% !important;
    height:72px !important;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    box-sizing:border-box;
    background:rgba(11,18,32,.96);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    border-top:1px solid rgba(255,255,255,.1);
  }

  .mobile-nav button{
    border:0 !important;
    background:transparent !important;
    color:#8793a7;
    font-size:22px;
    min-height:54px;
    border-radius:12px;
  }

  .mobile-nav button.active{
    color:#ffd34f !important;
    background:rgba(255,211,79,.1) !important;
  }

  .mobile-nav small{
    display:block;
    font-size:9px;
    margin-top:2px;
    font-weight:800;
  }

  /* Prevent long text from blowing out the viewport */
  h1,h2,h3,p,span,b,small{
    overflow-wrap:anywhere;
  }

  /* Modals */
  .athlete-modal-backdrop{
    padding:12px !important;
    box-sizing:border-box;
  }

  .athlete-modal{
    width:100% !important;
    max-width:100% !important;
    max-height:calc(100vh - 24px) !important;
    overflow-y:auto !important;
    box-sizing:border-box;
  }

  /* Tables/charts */
  .chart,
  canvas,
  svg{
    max-width:100% !important;
  }

}

/* Very small phones */
@media (max-width:390px){

  .content{
    padding:9px !important;
  }

  .hero,
  .hero-v8{
    padding:14px !important;
  }

  .hero h1,
  .hero-v8 h1{
    font-size:26px !important;
  }

  .badgegrid,
  .event-manager-grid{
    grid-template-columns:1fr !important;
  }

  .topbar{
    padding:8px !important;
  }

  #athleteSelect{
    max-width:125px !important;
  }
}

