:root {
  --black: #050505;
  --ink: #111111;
  --panel: #171717;
  --panel-2: #202020;
  --line: #303030;
  --muted: #a5a5a5;
  --white: #f7f7f2;
  --accent: #d7ff45;
  --accent-ink: #111800;
  --danger: #ff5d5d;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { background: var(--black); color-scheme: dark; }
body { margin: 0; min-height: 100vh; background: var(--black); color: var(--white); font-family: Inter, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 82% 12%, rgba(215, 255, 69, 0.17), transparent 24rem),
    linear-gradient(135deg, #050505 0%, #111 100%);
}

.login-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.login-card { width: min(100%, 470px); position: relative; z-index: 1; }
.login-logo { width: 106px; height: 106px; object-fit: cover; border-radius: 24px; margin-bottom: 30px; border: 1px solid #2d2d2d; }
.eyebrow { color: var(--accent); font-size: .72rem; letter-spacing: .18em; font-weight: 800; text-transform: uppercase; }
.login-card h1, .page-intro h1, .welcome-row h1 { font-family: "Space Grotesk", sans-serif; letter-spacing: -.045em; }
.login-card h1 { font-size: clamp(2.7rem, 9vw, 4.2rem); line-height: .94; margin: 14px 0 20px; }
.login-copy { color: #b9b9b9; line-height: 1.65; max-width: 38ch; margin-bottom: 30px; }
.stack { display: grid; gap: 11px; }
label { color: #cfcfcf; font-size: .82rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #121212;
  color: var(--white);
  border-radius: 12px;
  padding: 15px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(215,255,69,.1); }
textarea { resize: vertical; }
.code-field { position: relative; }
.code-field input { padding-right: 72px; font-size: 1rem; letter-spacing: .08em; }
.icon-button { position: absolute; right: 8px; top: 8px; bottom: 8px; border: 0; border-left: 1px solid var(--line); padding-left: 16px; background: transparent; color: var(--accent); font-weight: 800; font-size: .72rem; }
.primary-button, .light-button, .secondary-button {
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 800;
  letter-spacing: .025em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.primary-button { background: var(--accent); color: var(--accent-ink); margin-top: 5px; }
.primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.light-button { background: var(--white); color: var(--black); width: 100%; }
.secondary-button { border: 1px solid var(--line); background: transparent; color: var(--muted); justify-content: center; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: .8rem; }
.secure-note { margin-top: 24px; color: #777; font-size: .72rem; display: flex; align-items: center; gap: 8px; }
.secure-note span { color: var(--accent); font-size: .65rem; }

.app-shell { min-height: 100vh; padding-bottom: 98px; background: radial-gradient(circle at 20% -10%, rgba(215,255,69,.08), transparent 30rem), var(--black); }
.app-header { position: sticky; top: 0; z-index: 20; height: 74px; display: flex; justify-content: space-between; align-items: center; padding: 0 max(20px, calc((100vw - 1100px)/2)); background: rgba(5,5,5,.86); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: white; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--white); color: var(--black); font-family: "Space Grotesk"; font-weight: 800; }
.brand-button strong { display: block; font-family: "Space Grotesk"; font-size: .85rem; line-height: 1; }
.brand-button small { display: block; margin-top: 4px; color: var(--muted); font-size: .55rem; letter-spacing: .15em; }
.avatar-button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #414141; background: #202020; color: var(--accent); font-weight: 800; }
.content-shell { width: min(100% - 32px, 1040px); margin: 0 auto; }
.app-view { display: none; padding: 44px 0; animation: reveal .3s ease both; }
.app-view.active-view { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }

.welcome-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.welcome-row h1 { font-size: clamp(2.2rem, 7vw, 4.3rem); margin: 9px 0 8px; line-height: 1; }
.welcome-row p, .page-intro p { color: var(--muted); margin: 0; line-height: 1.55; }
.progress-ring { --progress: 0deg; width: 92px; height: 92px; flex: 0 0 92px; border-radius: 50%; display: grid; place-content: center; text-align: center; position: relative; background: conic-gradient(var(--accent) var(--progress), #242424 0); }
.progress-ring::before { content:""; position:absolute; inset: 6px; background: var(--black); border-radius: 50%; }
.progress-ring strong, .progress-ring span { position: relative; z-index: 1; }
.progress-ring strong { font-size: 1.2rem; }
.progress-ring span { font-size: .52rem; color: var(--muted); letter-spacing: .12em; }

.hero-session { padding: clamp(24px, 5vw, 45px); border-radius: 26px; color: #101400; background: linear-gradient(135deg, #d7ff45, #b9e62a); box-shadow: 0 30px 80px rgba(143,174,37,.14); position: relative; overflow: hidden; }
.hero-session::after { content:""; position:absolute; width: 260px; height: 260px; right:-90px; top:-100px; border: 1px solid rgba(0,0,0,.18); border-radius: 50%; box-shadow: 0 0 0 36px rgba(0,0,0,.04), 0 0 0 72px rgba(0,0,0,.035); }
.hero-session-top { display:flex; align-items:center; justify-content:space-between; gap: 14px; font-size:.7rem; font-weight:800; letter-spacing:.1em; position:relative; z-index:1; }
.status-pill { padding:8px 10px; border-radius:999px; background:rgba(0,0,0,.08); }
.session-icon { width: 54px; height:54px; margin: 42px 0 18px; display:grid; place-items:center; border-radius:50%; background:#0c0c0c; color:var(--accent); font-size:1.6rem; position:relative; z-index:1; }
.hero-session h2 { font-family:"Space Grotesk"; font-size:clamp(2rem,6vw,3.7rem); letter-spacing:-.04em; line-height:1; margin:0 0 10px; position:relative; z-index:1; }
.hero-session p { max-width:570px; line-height:1.55; opacity:.72; position:relative; z-index:1; }
.session-meta { display:flex; flex-wrap:wrap; gap:14px; margin:24px 0; position:relative; z-index:1; }
.session-meta span { padding-right:14px; border-right:1px solid rgba(0,0,0,.2); font-size:.77rem; }
.session-meta span:last-child { border:0; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:16px; margin:46px 0 18px; }
.section-heading h2 { font-family:"Space Grotesk"; margin:7px 0 0; letter-spacing:-.03em; }
.text-button { border:0; background:transparent; color:var(--accent); font-size:.7rem; font-weight:800; }
.week-list { display:grid; gap:10px; }
.week-item { display:grid; grid-template-columns:52px 1fr auto; gap:14px; align-items:center; border:1px solid var(--line); background:#121212; border-radius:16px; padding:15px; }
.week-day { display:grid; place-items:center; width:48px; height:48px; border-radius:12px; background:#202020; color:var(--muted); font-size:.7rem; font-weight:800; }
.week-item.done .week-day { background:var(--accent); color:var(--black); }
.week-item h3 { font-size:.93rem; margin:0 0 5px; }
.week-item p { color:var(--muted); font-size:.72rem; margin:0; }
.week-status { color:#7c7c7c; font-size:.7rem; font-weight:800; }
.week-item.done .week-status { color:var(--accent); }
.metric-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:24px; }
.metric-card { border:1px solid var(--line); border-radius:16px; padding:18px; background:#111; }
.metric-card.accent { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.metric-card span, .metric-card small { display:block; font-size:.62rem; letter-spacing:.08em; color:var(--muted); }
.metric-card.accent span, .metric-card.accent small { color:rgba(17,24,0,.65); }
.metric-card strong { display:block; margin:8px 0 3px; font-family:"Space Grotesk"; font-size:1.7rem; }

.page-intro { max-width:680px; margin-bottom:30px; }
.page-intro h1 { font-size:clamp(2.6rem,8vw,5rem); line-height:.98; margin:10px 0 13px; }
.plan-grid { display:grid; gap:14px; }
.plan-card { border:1px solid var(--line); background:#121212; border-radius:18px; padding:20px; display:grid; grid-template-columns:70px 1fr auto; gap:18px; align-items:center; }
.plan-card.completed { border-color:rgba(215,255,69,.4); }
.plan-index { color:#505050; font-family:"Space Grotesk"; font-size:2rem; font-weight:700; }
.plan-card h3 { margin:0 0 7px; }
.plan-card p { color:var(--muted); margin:0; font-size:.8rem; line-height:1.45; }
.plan-actions { display:grid; gap:8px; justify-items:end; }
.mini-button { border:1px solid var(--line); border-radius:999px; background:#1d1d1d; color:white; padding:9px 13px; font-size:.68rem; font-weight:800; }
.coach-note { margin-top:18px; border-left:3px solid var(--accent); background:#141414; padding:19px 22px; }
.coach-note span { color:var(--accent); font-size:.66rem; letter-spacing:.12em; font-weight:800; }
.coach-note p { margin:8px 0 0; color:#c9c9c9; line-height:1.6; }

.data-form { display:grid; gap:18px; max-width:720px; }
.data-form label { display:grid; gap:8px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.range-label output { justify-self:end; margin-top:-24px; color:var(--accent); }
input[type="range"] { padding:0; accent-color:var(--accent); height:25px; background:transparent; border:0; box-shadow:none; }
.success-message { min-height:22px; color:var(--accent); margin:0; font-size:.82rem; }
.history-list { display:grid; gap:12px; }
.history-card { border:1px solid var(--line); background:#121212; border-radius:16px; padding:18px; display:grid; grid-template-columns:auto 1fr auto; gap:14px; align-items:start; }
.history-icon { width:42px; height:42px; border-radius:11px; display:grid; place-items:center; background:#222; color:var(--accent); }
.history-card h3 { margin:0 0 5px; font-size:.9rem; }
.history-card p { margin:0; color:var(--muted); font-size:.75rem; line-height:1.5; }
.history-card time { color:#757575; font-size:.65rem; }
.empty-state { text-align:center; border:1px dashed #393939; border-radius:18px; padding:50px 20px; color:var(--muted); }
.empty-state strong { display:block; color:white; margin-bottom:8px; }

.bottom-nav { position:fixed; z-index:30; bottom:14px; left:50%; transform:translateX(-50%); width:min(calc(100% - 24px),720px); min-height:72px; border:1px solid rgba(255,255,255,.11); border-radius:22px; background:rgba(20,20,20,.94); backdrop-filter:blur(22px); box-shadow:var(--shadow); display:grid; grid-template-columns:repeat(5,1fr); padding:8px; }
.nav-item { border:0; background:transparent; color:#777; border-radius:15px; font-size:.58rem; font-weight:700; display:grid; place-content:center; gap:3px; }
.nav-item span { font-size:1.1rem; line-height:1; }
.nav-item.active { color:var(--accent); background:#252525; }
.nav-item.nav-primary { color:var(--black); background:var(--accent); }

.modal-backdrop { position:fixed; z-index:50; inset:0; background:rgba(0,0,0,.78); backdrop-filter:blur(8px); display:grid; place-items:center; padding:20px; }
.profile-modal { width:min(100%,520px); max-height:90vh; overflow:auto; background:#151515; border:1px solid #333; border-radius:22px; padding:28px; box-shadow:var(--shadow); position:relative; }
.profile-modal h2 { font-family:"Space Grotesk"; font-size:2rem; letter-spacing:-.04em; margin:10px 0 24px; }
.modal-close { position:absolute; right:16px; top:14px; width:38px; height:38px; border-radius:50%; border:1px solid #333; background:#222; color:white; font-size:1.4rem; }
.account-summary { display:grid; gap:8px; padding:20px; margin-bottom:20px; border:1px solid var(--line); border-radius:16px; background:#101010; }
.account-summary span { color:var(--muted); font-size:.62rem; letter-spacing:.12em; font-weight:800; }
.account-summary strong { margin-bottom:9px; font-family:"Space Grotesk"; font-size:1.2rem; }
.account-summary strong:last-child { margin-bottom:0; color:var(--accent); font-size:.9rem; }
.toast { position:fixed; z-index:70; left:50%; bottom:104px; transform:translate(-50%,20px); opacity:0; pointer-events:none; color:#111; background:var(--accent); padding:12px 18px; border-radius:999px; font-size:.78rem; font-weight:800; transition:.25s; }
.toast.show { opacity:1; transform:translate(-50%,0); }

.coach-shell { min-height:100vh; background:radial-gradient(circle at 82% 0,rgba(215,255,69,.09),transparent 31rem),var(--black); }
.coach-logout { border:1px solid var(--line); border-radius:999px; padding:10px 14px; background:#161616; color:#aaa; font-size:.68rem; font-weight:800; }
.coach-content { width:min(100% - 32px,1400px); margin:0 auto; padding:48px 0 80px; }
.coach-hero { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; padding-bottom:38px; }
.coach-hero h1 { margin:10px 0 12px; font-family:"Space Grotesk"; font-size:clamp(2.9rem,7vw,5.8rem); line-height:.88; letter-spacing:-.055em; }
.coach-hero p { max-width:620px; margin:0; color:var(--muted); line-height:1.6; }
.coach-count { width:150px; height:150px; flex:0 0 150px; display:grid; place-content:center; text-align:center; border-radius:50%; border:1px solid #39420f; background:rgba(215,255,69,.08); }
.coach-count strong { color:var(--accent); font-family:"Space Grotesk"; font-size:3.3rem; line-height:1; }
.coach-count span { margin-top:8px; color:#969c7a; font-size:.58rem; letter-spacing:.12em; font-weight:800; }
.coach-layout { display:grid; grid-template-columns:280px minmax(0,1fr); align-items:start; gap:18px; }
.athlete-sidebar, .coach-workspace { border:1px solid var(--line); border-radius:22px; background:#101010; }
.athlete-sidebar { position:sticky; top:92px; padding:13px; }
.sidebar-heading { display:flex; justify-content:space-between; padding:10px 8px 15px; color:#ddd; font-size:.7rem; font-weight:800; letter-spacing:.12em; }
.sidebar-heading small { color:#626262; font-size:.62rem; letter-spacing:0; }
.athlete-list { display:grid; gap:7px; }
.athlete-card { width:100%; border:1px solid transparent; border-radius:14px; padding:12px; display:grid; grid-template-columns:auto 1fr auto; gap:11px; align-items:center; text-align:left; background:#171717; color:white; }
.athlete-card:hover { border-color:#3a3a3a; }
.athlete-card.active { border-color:var(--accent); background:#22251a; }
.athlete-card > span:nth-child(2) { min-width:0; }
.athlete-card strong, .athlete-card small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.athlete-card strong { font-size:.8rem; }
.athlete-card small { margin-top:4px; color:#7f7f7f; font-size:.55rem; letter-spacing:.08em; }
.athlete-card b { color:#777; font-size:.65rem; }
.athlete-avatar { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; background:#272727; color:var(--accent); font-size:.72rem; font-weight:800; }
.coach-workspace { min-height:420px; padding:clamp(20px,3vw,34px); }
.coach-empty { min-height:350px; display:grid; place-content:center; gap:10px; text-align:center; color:#7e7e7e; }
.coach-empty strong { color:#ddd; }
.coach-empty.error strong { color:var(--danger); }
.loading-dot { width:12px; height:12px; margin:auto; border-radius:50%; background:var(--accent); box-shadow:0 0 0 8px rgba(215,255,69,.08); animation:pulse 1s ease infinite alternate; }
@keyframes pulse { to { opacity:.35; transform:scale(.72); } }
.athlete-overview { display:flex; justify-content:space-between; align-items:end; gap:20px; padding-bottom:28px; border-bottom:1px solid var(--line); }
.athlete-overview h2 { margin:8px 0 7px; font-family:"Space Grotesk"; font-size:clamp(2.2rem,5vw,4rem); line-height:1; letter-spacing:-.045em; }
.athlete-overview p { margin:0; color:var(--muted); font-size:.8rem; }
.coach-stat-grid { display:grid; grid-template-columns:repeat(2,100px); gap:8px; }
.coach-stat-grid article { border:1px solid var(--line); border-radius:14px; padding:14px; background:#171717; }
.coach-stat-grid span { display:block; color:#777; font-size:.55rem; letter-spacing:.1em; }
.coach-stat-grid strong { display:block; margin-top:7px; color:var(--accent); font-size:1.35rem; }
.coach-editor { padding-top:28px; }
.coach-section-title { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:15px; }
.coach-section-title h3 { margin:6px 0 0; font-family:"Space Grotesk"; font-size:1.35rem; }
.coach-section-title.compact { margin-top:28px; }
.secondary-action { border:1px solid #3b3b3b; border-radius:999px; padding:10px 13px; background:#191919; color:#ddd; font-size:.65rem; font-weight:800; }
.coach-plan-rows { display:grid; gap:10px; }
.coach-workout-row { position:relative; display:grid; grid-template-columns:140px minmax(180px,1fr) 76px 70px 76px; gap:9px; padding:15px 48px 15px 15px; border:1px solid var(--line); border-radius:16px; background:#151515; }
.coach-workout-row label { display:grid; gap:7px; color:#777; font-size:.6rem; letter-spacing:.07em; text-transform:uppercase; }
.coach-workout-row input, .coach-workout-row textarea { padding:11px 12px; border-radius:9px; font-size:.75rem; letter-spacing:0; text-transform:none; }
.coach-workout-row .detail-field { grid-column:1 / -1; }
.remove-workout { position:absolute; right:10px; top:12px; width:30px; height:30px; border:1px solid #373737; border-radius:50%; background:#202020; color:#999; font-size:1.2rem; }
.remove-workout:hover { border-color:var(--danger); color:var(--danger); }
.editor-footer { display:flex; justify-content:flex-end; align-items:center; gap:18px; margin-top:16px; }
.editor-footer > span { color:var(--accent); font-size:.72rem; }
.editor-footer .primary-button { width:230px; }
.coach-feedback-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.coach-feed { display:grid; gap:8px; }
.coach-feed article { display:grid; grid-template-columns:auto 1fr; gap:10px; padding:12px; border:1px solid var(--line); border-radius:13px; background:#151515; }
.coach-feed article > span { color:var(--accent); }
.coach-feed strong, .coach-feed small { display:block; }
.coach-feed strong { font-size:.74rem; }
.coach-feed small { margin-top:4px; color:#888; font-size:.64rem; line-height:1.45; }
.mini-empty { padding:24px; border:1px dashed #333; border-radius:14px; color:#777; font-size:.72rem; text-align:center; }

@media (max-width: 700px) {
  .app-header { padding:0 18px; }
  .content-shell { width:min(100% - 28px,1040px); }
  .app-view { padding:30px 0; }
  .welcome-row { align-items:center; }
  .welcome-row p { font-size:.83rem; max-width:26ch; }
  .progress-ring { width:76px; height:76px; flex-basis:76px; }
  .hero-session { border-radius:21px; }
  .hero-session::after { opacity:.45; }
  .session-icon { margin-top:34px; }
  .metric-grid { grid-template-columns:1fr 1fr; }
  .metric-card:first-child { grid-column:span 2; }
  .plan-card { grid-template-columns:48px 1fr; }
  .plan-index { font-size:1.5rem; }
  .plan-actions { grid-column:2; justify-items:start; }
  .form-row { grid-template-columns:1fr; }
  .bottom-nav { bottom:8px; min-height:66px; border-radius:19px; }
  .nav-item { font-size:.52rem; }
  .coach-content { width:min(100% - 24px,1400px); padding-top:30px; }
  .coach-hero { align-items:center; }
  .coach-count { width:94px; height:94px; flex-basis:94px; }
  .coach-count strong { font-size:2.2rem; }
  .coach-count span { max-width:70px; font-size:.48rem; }
  .coach-layout { grid-template-columns:1fr; }
  .athlete-sidebar { position:static; overflow:hidden; }
  .athlete-list { display:flex; overflow:auto; padding-bottom:3px; }
  .athlete-card { min-width:190px; }
  .athlete-overview { align-items:flex-start; flex-direction:column; }
  .coach-stat-grid { width:100%; grid-template-columns:1fr 1fr; }
  .coach-workout-row { grid-template-columns:1fr 1fr; padding-right:46px; }
  .coach-workout-row .grow, .coach-workout-row .detail-field { grid-column:1 / -1; }
  .editor-footer { align-items:stretch; flex-direction:column; }
  .editor-footer .primary-button { width:100%; }
  .coach-feedback-grid { grid-template-columns:1fr; }
}

@media (min-width: 900px) {
  .hero-session .light-button { width:260px; }
  .plan-grid { grid-template-columns:1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; } }
