/* Projection Inside Pace — lecture coach premium, compacte et explicite. */
body:has(.pp-page) {
  --pp-v2-navy-0: #07132f;
  --pp-v2-navy-1: #0b1b3f;
  --pp-v2-navy-2: #12305d;
  --pp-v2-gold: #ffc447;
  --pp-v2-green: #42d889;
  --pp-v2-blue: #67b8ff;
  --pp-v2-red: #ff7185;
}

.pp-page.pp-premium-v2 {
  gap: 8px !important;
  padding-bottom: 18px !important;
}

.pp-premium-v2 .pp-toolbar,
.pp-premium-v2 .pp-overview,
.pp-premium-v2 .pp-main-chart,
.pp-premium-v2 .pp-objectives-section,
.pp-premium-v2 .pp-disclosure {
  position: relative;
  overflow: hidden;
  border-color: rgba(255,255,255,.11) !important;
  background:
    radial-gradient(320px 170px at 100% 0%, rgba(255,196,71,.09), transparent 72%),
    radial-gradient(320px 190px at 0% 100%, rgba(66,216,137,.075), transparent 74%),
    linear-gradient(145deg, rgba(7,19,47,.96), rgba(13,35,75,.91)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 14px 34px rgba(1,8,28,.18) !important;
}

.pp-premium-v2 .pp-toolbar::before,
.pp-premium-v2 .pp-main-chart::before,
.pp-premium-v2 .pp-overview::before {
  position:absolute;
  z-index:2;
  inset:0 0 auto;
  height:2px;
  background:linear-gradient(90deg,var(--pp-v2-green),rgba(66,216,137,.42) 42%,var(--pp-v2-gold));
  content:'';
}

.pp-premium-v2 .pp-toolbar {
  grid-template-columns:minmax(180px,1.25fr) minmax(210px,.95fr) minmax(210px,.95fr) auto !important;
  gap:6px !important;
  padding:8px 9px !important;
  border-radius:15px !important;
}

.pp-premium-v2 .pp-athlete-select,
.pp-premium-v2 .pp-segment-group { gap:3px !important; }
.pp-premium-v2 .pp-athlete-select select,
.pp-premium-v2 .pp-segment-group button,
.pp-premium-v2 .pp-refresh { min-height:31px !important; }

.pp-premium-v2 .pp-overview {
  grid-template-columns:auto minmax(205px,1.15fr) minmax(390px,2fr) auto !important;
  gap:10px !important;
  padding:10px 12px !important;
  border-radius:17px !important;
}
.pp-premium-v2 .pp-overview-score { width:62px !important; height:62px !important; }
.pp-premium-v2 .pp-overview-score strong { font-size:26px !important; }
.pp-premium-v2 .pp-metrics { gap:5px !important; }
.pp-premium-v2 .pp-metric { min-height:52px !important; padding:7px 8px !important; }
.pp-premium-v2 .pp-metric>strong { font-size:15px !important; }
.pp-premium-v2 .pp-ai-primary { min-height:38px !important; }
.pp-premium-v2 .pp-glance-row { gap:6px !important; }
.pp-premium-v2 .pp-next-objective,
.pp-premium-v2 .pp-alerts article { padding:7px 10px !important; }

.pp-premium-v2 .pp-main-chart {
  padding:10px !important;
  border-radius:18px !important;
}

.pp-premium-v2 .pp-main-chart>header {
  margin-bottom:6px !important;
  padding:1px 2px 0;
}
.pp-premium-v2 .pp-main-chart h2 {
  font-size:17px !important;
  letter-spacing:-.025em;
}
.pp-premium-v2 .pp-chart-controls { gap:5px !important; }
.pp-premium-v2 .pp-guide-controls,
.pp-premium-v2 .pp-series-controls { gap:3px !important; }
.pp-premium-v2 .pp-series-controls button { min-width:82px !important; min-height:29px !important; padding:4px 7px !important; }
.pp-premium-v2 .pp-guide-controls button { min-height:25px !important; }

.pp-chart-explainer {
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
  margin:0 0 7px;
  padding:6px 8px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:10px;
  background:rgba(255,255,255,.028);
  color:rgba(255,255,255,.58);
  font-size:8.5px;
  font-weight:720;
  white-space:nowrap;
}
.pp-chart-explainer strong { color:#fff; font-size:8.5px; font-weight:900; }
.pp-chart-explainer span { display:inline-flex; align-items:center; gap:4px; }
.pp-chart-explainer i { width:12px; height:3px; border-radius:999px; }
.pp-chart-explainer i.is-condition { background:var(--pp-v2-green); }
.pp-chart-explainer i.is-fatigue { background:var(--pp-v2-gold); }
.pp-chart-explainer i.is-freshness { background:var(--pp-v2-blue); }
.pp-chart-explainer small { margin-left:auto; overflow:hidden; color:rgba(255,255,255,.38); text-overflow:ellipsis; }

.pp-reading-strip {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  margin-bottom:7px;
}
.pp-reading-card {
  position:relative;
  min-width:0;
  min-height:92px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
  padding:9px 10px 8px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.09);
  border-radius:12px;
  background:linear-gradient(145deg,rgba(255,255,255,.055),rgba(255,255,255,.025));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.045);
}
.pp-reading-card::before {
  position:absolute;
  inset:0 auto 0 0;
  width:3px;
  border-radius:3px;
  background:rgba(255,255,255,.28);
  content:'';
}
.pp-reading-card>span {
  color:rgba(255,255,255,.36);
  font-size:7px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.pp-reading-card>strong {
  overflow:hidden;
  color:#fff;
  font-size:12px;
  font-weight:950;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pp-reading-card>b {
  overflow:hidden;
  color:rgba(255,255,255,.78);
  font-size:9px;
  font-weight:850;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pp-reading-card>p {
  display:-webkit-box;
  margin:2px 0 0;
  overflow:hidden;
  color:rgba(255,255,255,.48);
  font-size:8px;
  font-weight:620;
  line-height:1.35;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.pp-reading-card.is-good { border-color:rgba(66,216,137,.22); background:linear-gradient(145deg,rgba(66,216,137,.09),rgba(66,216,137,.025)); }
.pp-reading-card.is-good::before { background:var(--pp-v2-green); }
.pp-reading-card.is-good>strong { color:#a9f4c8; }
.pp-reading-card.is-watch { border-color:rgba(255,196,71,.24); background:linear-gradient(145deg,rgba(255,196,71,.095),rgba(255,196,71,.025)); }
.pp-reading-card.is-watch::before { background:var(--pp-v2-gold); }
.pp-reading-card.is-watch>strong { color:#ffe19a; }
.pp-reading-card.is-alert { border-color:rgba(255,113,133,.27); background:linear-gradient(145deg,rgba(255,113,133,.105),rgba(255,113,133,.025)); }
.pp-reading-card.is-alert::before { background:var(--pp-v2-red); }
.pp-reading-card.is-alert>strong { color:#ffadba; }
.pp-reading-card.is-neutral::before { background:var(--pp-v2-blue); }

.pp-premium-v2 .pp-chart-shell {
  border-color:rgba(255,255,255,.105) !important;
  border-radius:14px !important;
  background:
    radial-gradient(420px 230px at 100% 0%,rgba(255,196,71,.045),transparent 75%),
    linear-gradient(180deg,rgba(2,11,32,.72),rgba(5,17,42,.86)) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.pp-premium-v2 .pp-chart { min-width:850px !important; }
.pp-premium-v2 .pp-chart-series { filter:drop-shadow(0 2px 3px rgba(0,0,0,.26)); }
.pp-premium-v2 .pp-chart-series:not(.is-muted):not(.is-context) { opacity:1; }
.pp-premium-v2 .pp-chart-grid { stroke:rgba(255,255,255,.08) !important; }
.pp-premium-v2 .pp-chart-axis,
.pp-premium-v2 .pp-chart-date { fill:rgba(255,255,255,.47) !important; font-size:9px !important; }
.pp-premium-v2 .pp-threshold-caption>text { fill:rgba(255,255,255,.78) !important; font-size:8.5px !important; }
.pp-premium-v2 .pp-threshold-caption g text { font-size:7.5px !important; }
.pp-premium-v2 .pp-chart-load { opacity:.82; }

.pp-premium-v2 .pp-day-detail {
  grid-template-columns:minmax(125px,.65fr) minmax(330px,1.4fr) minmax(210px,1.2fr) minmax(220px,1fr) !important;
  gap:6px !important;
  padding:7px 9px !important;
  background:rgba(3,13,35,.68);
}
.pp-premium-v2 .pp-day-detail-values { gap:3px !important; }
.pp-premium-v2 .pp-day-detail-values span {
  position:relative;
  min-height:39px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:5px 6px !important;
  border:1px solid rgba(255,255,255,.055);
}
.pp-premium-v2 .pp-day-detail-values span::after {
  display:block;
  margin-top:1px;
  color:rgba(255,255,255,.55);
  font-size:6.5px;
  font-weight:800;
  letter-spacing:0;
  text-transform:none;
  content:attr(data-reading);
}
.pp-premium-v2 .pp-day-detail-values b { font-size:11.5px !important; }

.pp-day-coach-read {
  min-width:0;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:1px 6px;
  padding:6px 8px;
  border:1px solid rgba(66,216,137,.18);
  border-radius:9px;
  background:rgba(66,216,137,.055);
}
.pp-day-coach-read>span {
  grid-row:1 / 3;
  align-self:center;
  color:rgba(255,255,255,.36);
  font-size:6.5px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
  writing-mode:vertical-rl;
  transform:rotate(180deg);
}
.pp-day-coach-read>strong {
  overflow:hidden;
  color:#a9f4c8;
  font-size:9px;
  font-weight:950;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pp-day-coach-read>small {
  display:-webkit-box;
  overflow:hidden;
  color:rgba(255,255,255,.46);
  font-size:7px;
  font-weight:650;
  line-height:1.25;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.pp-day-coach-read.is-watch { border-color:rgba(255,196,71,.22); background:rgba(255,196,71,.06); }
.pp-day-coach-read.is-watch>strong { color:#ffe19a; }
.pp-day-coach-read.is-alert { border-color:rgba(255,113,133,.24); background:rgba(255,113,133,.065); }
.pp-day-coach-read.is-alert>strong { color:#ffadba; }

.pp-premium-v2 .pp-objectives-section { padding:9px 10px !important; }
.pp-premium-v2 .pp-compact-heading { margin-bottom:5px !important; }
.pp-premium-v2 .pp-objective-card { min-width:235px !important; padding:7px 9px !important; }
.pp-premium-v2 .pp-disclosure>summary { min-height:44px !important; padding:9px 12px !important; }
.pp-premium-v2 .pp-disclosure>summary>span { font-size:10.5px !important; }
.pp-premium-v2 .pp-method-note { margin:0 !important; padding-top:1px !important; }

@media (max-width:1100px) {
  .pp-reading-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pp-premium-v2 .pp-overview { grid-template-columns:auto minmax(190px,1fr) minmax(0,1.7fr) !important; }
  .pp-premium-v2 .pp-ai-primary { grid-column:3; justify-self:end; }
  .pp-premium-v2 .pp-day-detail { grid-template-columns:minmax(130px,.7fr) minmax(330px,1.4fr) minmax(220px,1fr) !important; }
  .pp-day-coach-read { grid-column:1 / -1; }
}

@media (max-width:780px) {
  .pp-page.pp-premium-v2 { gap:7px !important; }
  .pp-premium-v2 .pp-toolbar { grid-template-columns:1fr !important; }
  .pp-premium-v2 .pp-overview { grid-template-columns:auto 1fr !important; }
  .pp-premium-v2 .pp-metrics { grid-column:1 / -1; grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .pp-premium-v2 .pp-ai-primary { grid-column:1 / -1; width:100%; justify-self:stretch; }
  .pp-chart-explainer { overflow-x:auto; padding-bottom:7px; }
  .pp-chart-explainer small { display:none; }
  .pp-reading-strip {
    display:flex;
    overflow-x:auto;
    padding-bottom:2px;
    scroll-snap-type:x proximity;
  }
  .pp-reading-card { min-width:220px; scroll-snap-align:start; }
  .pp-premium-v2 .pp-chart-controls { display:grid !important; width:100%; }
  .pp-premium-v2 .pp-series-controls button { min-width:0 !important; flex:1 !important; }
  .pp-premium-v2 .pp-chart { min-width:820px !important; }
  .pp-premium-v2 .pp-day-detail { grid-template-columns:1fr !important; }
  .pp-premium-v2 .pp-day-detail-values { grid-template-columns:repeat(4,minmax(90px,1fr)); overflow-x:auto; }
  .pp-day-coach-read { grid-column:auto; }
}

@media (max-width:480px) {
  .pp-premium-v2 .pp-main-chart { padding:8px !important; }
  .pp-reading-card { min-width:205px; min-height:88px; }
  .pp-premium-v2 .pp-chart { min-width:780px !important; }
}

@media (prefers-reduced-motion:reduce) {
  .pp-premium-v2 * { transition:none !important; }
}
