/* GTGF 19.33.7 | UI contract & planner readability
   Small, scoped improvement layer: do not change plan calculations or theme shell.
   Shared tokens are aliases of the existing GTGF palette, not a second palette.
*/
:root {
  --gtgf-ui-action: var(--gt-accent, #ff5400);
  --gtgf-ui-action-hover: var(--gt-accent-hover, #ff6b1f);
  --gtgf-ui-action-ink: var(--gt-ink, #111111);
  --gtgf-ui-focus: #a94008;
  --gtgf-ui-error: #a42821;
  --gtgf-ui-help: #57514b;
  --gtgf-ui-field: 16px;
  --gtgf-ui-label: 15px;
  --gtgf-ui-help-size: 14px;
  --gtgf-ui-control: 52px;
  --gtgf-ui-round-control: 12px;
  --gtgf-ui-round-panel: 20px;
}

/* GTGF's page CSS already uses these font and control tokens. Changing their
   values at the page scope fixes many tiny 9-12px labels at the source. */
body.gt-pages-training #main-content {
  --gt-fs-label: 14px;
  --gt-lh-label: 20px;
  --gt-fs-small: 15px;
  --gt-lh-small: 23px;
  --gt-fs-nav: 16px;
  --gt-radius-card: var(--gtgf-ui-round-panel);
  --gt-radius-field: var(--gtgf-ui-round-control);
  --gt-control-h: var(--gtgf-ui-control);
}
body.gt-pages-nutrition #main-content {
  --gt-fs-label: 14px;
  --gt-lh-label: 20px;
  --gt-fs-small: 15px;
  --gt-lh-small: 23px;
  --gt-fs-nav: 16px;
  --gt-control-h: var(--gtgf-ui-control);
}

/* Important: never reveal the original hidden inputs or previous wizard. */
body.gt-pages-training #gtgf-planner-form .training-guide159950__inline-error[hidden] { display: none !important; }
body.gt-pages-training #gtgf-planner-form .training-guide159950__inline-error:not([hidden]) {
  display: block !important;
  margin: 0 0 20px !important;
  padding: 14px 17px !important;
  border: 2px solid var(--gtgf-ui-error) !important;
  border-radius: var(--gtgf-ui-round-control) !important;
  background: #fff1ec !important;
  color: #79221c !important;
  -webkit-text-fill-color: currentColor !important;
  font: 700 15px/1.55 Inter,Arial,Helvetica,sans-serif !important;
  overflow-wrap: anywhere;
}
body.gt-pages-training #gtgf-planner-form .training-guide159950__inline-error::before {
  content: '!';
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin-right: 9px;
  vertical-align: middle;
  border-radius: 50%;
  color: #fff;
  background: var(--gtgf-ui-error);
  font-weight: 900;
}
body.gt-pages-training #gtgf-planner-form :is(.planner-primary-choice-grid, .planner-field select, .planner-field input)[aria-invalid="true"] {
  outline: 3px solid var(--gtgf-ui-error) !important;
  outline-offset: 2px !important;
}

/* Respect the compact white GTGF workspace created by pages-planner.css. */
body.gt-pages-training #gtgf-planner-form.training-form--guided159950 {
  color-scheme: light;
}
body.gt-pages-training #gtgf-planner-form .training-guide159950__progress > button,
body.gt-pages-training #gtgf-planner-form .training-guide159950__next,
body.gt-pages-training #gtgf-planner-form .training-guide159950__back {
  text-wrap: pretty;
}
body.gt-pages-training #gtgf-planner-form .training-guide159950__head > p:not(.eyebrow) {
  max-width: 64ch;
}
body.gt-pages-training #gtgf-planner-form .training-guide159950__glance-card {
  min-width: 0;
  overflow-wrap: anywhere;
}
body.gt-pages-training #gtgf-planner-form :is(.planner-primary-choice,.training-guide159950__next, .training-guide159950__back, .planner-calendar-mode button) {
  min-height: 48px;
}
body.gt-pages-training #gtgf-planner-form .planner-primary-choice small {
  line-height: 1.5 !important;
}

/* Repeated quick-summary cards above the questions compete with the input flow.
   The persistent sidebar already provides context on desktop; show the compact
   recap only when the athlete reaches Controle. */
body.gt-pages-training #gtgf-planner-form[data-guided-step]:not([data-guided-step="review"]) .training-guide159950__glance {
  display: none !important;
}
body.gt-pages-training #gtgf-planner-form .training-guide159950__head .eyebrow {
  display: none !important; /* Step numbering is already clear in the progress. */
}

/* The enhanced sport/goal/level cards are the actual control. Keep the native
   select as a no-JS fallback, but do not show both once cards exist. */
body.gt-pages-training #gtgf-planner-form :is(#planner-sport-choice-grid,#planner-goal-choice-grid,#planner-level-choice-grid):has(button) ~ select.planner-enhanced-fallback {
  display: none !important;
}

/* The long coaching explanations are available on demand instead of taking
   the space of a required answer on every step. Native details = keyboard safe. */
body.gt-pages-training #main-content #gtgf-planner-form .training-guide159950__coach > summary {
  display: list-item !important;
  margin: 0 !important;
  cursor: pointer;
  color: var(--gt-accent-text, #a94008) !important;
  -webkit-text-fill-color: currentColor !important;
  font: 800 14px/1.5 Inter,Arial,Helvetica,sans-serif !important;
}
body.gt-pages-training #main-content #gtgf-planner-form .training-guide159950__coach > summary:focus-visible {
  outline: 3px solid var(--gtgf-ui-focus) !important;
  outline-offset: 5px !important;
  border-radius: 4px;
}
body.gt-pages-training #main-content #gtgf-planner-form .training-guide159950__coach[open] > p {
  padding-top: 10px !important;
}

/* Calendar-day selection remains understandable without relying on orange. */
body.gt-pages-training #gtgf-planner-form .planner-v159987-day label:has(input:focus-visible),
body.gt-pages-training #gtgf-planner-form .planner-v15-choice:has(input:focus-visible) > span {
  outline: 3px solid var(--gtgf-ui-focus) !important;
  outline-offset: 2px !important;
}

/* Focus and touch affordance on the public planning routes; never theme hidden controls. */
body:is(.gt-pages-training,.gt-pages-nutrition) #main-content :is(button,a,summary,input:not([type="hidden"]),select,textarea):focus-visible,
body:is(.gt-pages-training,.gt-pages-nutrition) .planner-dialog :is(button,a):focus-visible {
  outline: 3px solid var(--gtgf-ui-focus) !important;
  outline-offset: 3px !important;
}
body:is(.gt-pages-training,.gt-pages-nutrition) #main-content :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),select,textarea) {
  font-size: max(16px, 1em); /* iOS will not zoom inputs below 16px. */
}

/* The account, download and nutrition actions must not be visually quieter
   than tertiary metadata or become tiny on phones. */
body.gt-pages-training #planner-results :is(.planner-results__actions button, .planner-edit-plan, .planner-day__open, .planner-google-link),
body.gt-pages-nutrition #main-content :is(.nutrition-planner button,.nutrition-results button) {
  min-height: 44px;
  font-size: max(14px, 1em);
  line-height: 1.35;
}
body.gt-pages-training #planner-results :is(.planner-day__date,.planner-week-heading__metrics small,.planner-summary__stats small),
body.gt-pages-training #planner-results :is(.planner-session__signals span,.planner-day__meta) {
  font-size: max(13px, .95em);
  line-height: 1.45;
}

/* Separate public pages should retain the same interaction language. */
body.gt-pages-nutrition #main-content :is(.nutrition-form, .nutrition-planner) :is(label, legend) {
  line-height: 1.5;
}
body.gt-pages-nutrition #main-content :is(.nutrition-form,.nutrition-planner) small {
  line-height: 1.5;
}

/* Coach & profile controls belong to the ordinary document, not the shadow root. */
html body.gtgf-v190500-dash main#main-content:not(#x) #coach .gtgf19335-coach-path__intro span,
html body.gtgf-v190500-dash main#main-content:not(#x) #coach .gtgf19335-coach-path__items button span {
  font-size: 13px !important;
  line-height: 1.5 !important;
}
html body.gtgf-v190500-dash main#main-content:not(#x) #coach .gtgf19335-coach-path__items button strong {
  font-size: 16px !important;
  line-height: 1.4 !important;
}
html body.gtgf-v190500-dash main#main-content:not(#x) #coach .gtgf19335-coach-path__items button small {
  font-size: 14px !important;
  line-height: 1.5 !important;
}
html body.gtgf-v190500-dash main#main-content:not(#x) #profiel .gtgf19335-profile-nav button {
  min-height: 48px !important;
  font-size: 15px !important;
}
html body.gtgf-v190500-dash main#main-content:not(#x) #profiel :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
  font-size: 16px !important;
  line-height: 1.5;
}
html body.gtgf-v190500-dash main#main-content:not(#x) #profiel :is(button,a,input,select,textarea,summary):focus-visible,
html body.gtgf-v190500-dash main#main-content:not(#x) #coach :is(button,a,input,select,textarea,summary):focus-visible {
  outline: 3px solid #ff9a5a !important;
  outline-offset: 3px !important;
}

@media (max-width: 760px) {
  /* The first step should show choices, not four marketing assurances. */
  body.gt-pages-training #main-content .gtgf19327-planner-promises {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  body.gt-pages-training #main-content .gtgf19327-planner-promises > span:nth-child(2),
  body.gt-pages-training #main-content .gtgf19327-planner-promises > span:nth-child(3) {
    display: none !important;
  }
  body.gt-pages-training #gtgf-planner-form .training-guide159950__head .eyebrow {
    display: none !important; /* Step number already appears in the progress band. */
  }
  /* Five full-width sport cards make the first decision unnecessarily long.
     Other goals and experience cards keep their roomier original layout. */
  body.gt-pages-training #main-content #gtgf-planner-form #planner-sport-choice-grid {
    --gt-card-min: 126px;
  }
  /* Four summary cards BEFORE the first decision make onboarding needlessly long.
     Keep the summary visible at review, where it genuinely helps. */
  body.gt-pages-training #gtgf-planner-form[data-guided-step]:not([data-guided-step="review"]) .training-guide159950__glance { display: none !important; }
  body.gt-pages-training #gtgf-planner-form[data-guided-step="review"] .training-guide159950__glance {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 8px !important;
    padding: 12px !important;
  }
  body.gt-pages-training #gtgf-planner-form .training-guide159950__glance-note { display: none !important; }
  body.gt-pages-training #gtgf-planner-form .training-guide159950__glance-card { padding: 12px !important; }
  body.gt-pages-training #gtgf-planner-form .training-guide159950__actions .training-guide159950__next,
  body.gt-pages-training #gtgf-planner-form .training-guide159950__actions #planner-build-plan {
    min-height: 52px !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
  }
}
@media (max-width: 380px) {
  body.gt-pages-training #gtgf-planner-form .training-guide159950__glance {
    grid-template-columns: 1fr !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body:is(.gt-pages-training,.gt-pages-nutrition) #main-content :is(button,a,summary) {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
