/* Runnerly RC1 planner visual parity — 2026-10-22.
   Only loaded by planner/app/layout.php on the website, after planner styles.
   This is deliberately NOT the shared mobile build stylesheet. */

:root {
  /* Main Athlete Calendar colours and neutral surfaces. */
  --ink: #1f2937;
  --secondary-text: #6b7280;
  --line: #e5e7eb;
  --paper: #fff;
  --bg: #f4f6f8;
  --surface-2: #f3f4f6;
  --surface-3: #e5e7eb;
  --surface-raised: #fff;
  --input-bg: #fff;
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-ink: #1e40af;
  --warm: #fff7ed;
  --good: #15803d;
  --good-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --violet: #7c3aed;
  --violet-soft: #f3e8ff;
  --shadow: 0 8px 24px rgba(15,23,42,.08);
  --shadow-raised: 0 18px 40px rgba(15,23,42,.16);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --content-max: 1280px;
}
/* Keep the existing optional dark theme usable, but use Runnerly blue
   (rather than a separate teal brand) when it is selected. */
html[data-theme="dark"] {
  --accent: #60a5fa;
  --accent2: #93c5fd;
  --accent-soft: #192c4b;
  --accent-ink: #bfdbfe;
  --secondary-text: #9ca3af;
  --line: #374151;
  --surface-2: #1f2937;
  --surface-3: #374151;
  --violet: #c4b5fd;
  --violet-soft: #2c2444;
}
html {
  /* Main Runnerly reserves stable scrollbar space; planner previously did not. */
  overflow-y: scroll;
  background: var(--bg);
}
@supports (scrollbar-gutter: stable) {
  html { overflow-y: auto; scrollbar-gutter: stable; }
}
body.runnerly-web-planner {
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}
body.runnerly-web-planner :is(button,input,select,textarea) {
  font-family: Arial, sans-serif;
}

/* Header width, vertical size and start position match .app-header-inner. */
body.runnerly-web-planner .runnerly-integrated-header.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #111827;
  color: #fff;
  padding: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
body.runnerly-web-planner .runnerly-integrated-header .header-inner {
  width: 100%;
  max-width: 1600px;
  min-height: 74px;
  padding: 14px 24px;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
body.runnerly-web-planner .runnerly-integrated-header .brand {
  flex: 0 0 auto;
  margin: 0;
  gap: 0;
  line-height: 1;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo {
  height: auto;
  max-width: 180px;
  min-height: 0;
  flex: 0 0 auto;
  overflow: visible;
  border-radius: 0;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img {
  display: block;
  max-width: min(180px, 42vw);
  max-height: 46px;
  height: auto;
  width: auto;
  object-fit: contain;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate {
  background: #fff;
  border-radius: 8px;
  padding: 5px 9px;
  min-height: 0;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img {
  max-height: 38px;
}
body.runnerly-web-planner .runnerly-integrated-header .site-menu {
  flex: 0 1 auto;
  margin: 0 0 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
body.runnerly-web-planner .runnerly-integrated-header .topnav,
body.runnerly-web-planner .runnerly-integrated-header .utility-nav {
  margin: 0;
  padding: 0;
  width: auto;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}
body.runnerly-web-planner .runnerly-integrated-header .platform-topnav {
  border: 0;
  margin: 0;
  padding: 0;
}
body.runnerly-web-planner .runnerly-integrated-header .topnav a,
body.runnerly-web-planner .runnerly-integrated-header .utility-nav a,
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  margin: 0;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: transparent;
  font: 700 14px/1.25 Arial,sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}
body.runnerly-web-planner .runnerly-integrated-header :is(.topnav a,.utility-nav a,.planner-nav-group > summary):hover,
body.runnerly-web-planner .runnerly-integrated-header :is(.topnav a,.utility-nav a,.planner-nav-group > summary):focus-visible {
  color: #fff;
  background: rgba(255,255,255,.12);
}
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group {
  position: relative;
  flex: 0 0 auto;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary {
  list-style: none;
  gap: 7px;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary::-webkit-details-marker { display: none; }
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-chevron { font-size: 12px; opacity: .8; }
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group[open] > summary {
  background: rgba(255,255,255,.12);
}
body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1020;
  display: grid;
  gap: 4px;
  min-width: 200px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15,23,42,.18);
}
body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a {
  color: #111827;
  font: 700 14px/1.35 Arial,sans-serif;
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  white-space: nowrap;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a:hover,
body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a:focus-visible,
body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a[aria-current="page"] {
  color: #111827;
  background: #f3f4f6;
}
/* A consistent body content width; this does not affect the full-width header. */
body.runnerly-web-planner > main.shell,
body.runnerly-web-planner > .site-footer .shell {
  width: min(var(--content-max), calc(100% - 48px));
  max-width: 100%;
}
body.runnerly-web-planner > main.shell {
  padding-top: 32px;
  padding-bottom: 72px;
}
body.runnerly-web-planner :is(h1,h2,h3,h4) {
  color: var(--ink);
  letter-spacing: normal;
  font-family: Arial,sans-serif;
}
body.runnerly-web-planner h1 { font-size: clamp(25px,2.1vw,32px); line-height: 1.2; font-weight: 700; }
body.runnerly-web-planner h2 { font-size: clamp(19px,1.55vw,24px); line-height: 1.25; font-weight: 700; }
body.runnerly-web-planner h3 { font-size: 17px; line-height: 1.3; font-weight: 700; }
body.runnerly-web-planner .lead { color: var(--secondary-text); }
body.runnerly-web-planner .card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
body.runnerly-web-planner .grid { gap: 18px; }
body.runnerly-web-planner :is(.button,button:not(.menu-toggle):not(.theme-toggle)) {
  background: #2563eb;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 42px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}
body.runnerly-web-planner :is(.button,button:not(.menu-toggle):not(.theme-toggle)):hover {
  background: #1d4ed8;
  color: #fff;
}
body.runnerly-web-planner .button.secondary {
  background: #4b5563 !important;
  color: #fff;
  border-color: #4b5563;
}
body.runnerly-web-planner .button.secondary:hover { background: #374151 !important; }
body.runnerly-web-planner .button.danger,
body.runnerly-web-planner .button.danger:hover { background: #dc2626 !important; color:#fff; }
body.runnerly-web-planner :is(input,select,textarea) {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: var(--ink);
  background: var(--input-bg);
  min-height: 42px;
  font-size: 15px;
  padding: 10px 12px;
}
body.runnerly-web-planner :is(input,select,textarea):focus-visible {
  border-color: #2563eb;
  outline: 2px solid rgba(37,99,235,.22);
  outline-offset: 1px;
}
body.runnerly-web-planner :is(input[type="checkbox"],input[type="radio"]) {
  min-height: 0;
  accent-color: #2563eb;
}
body.runnerly-web-planner :is(.table-wrap,.card .table,.card .quality-table) { border-color: var(--line); }
body.runnerly-web-planner :is(.table,.quality-table) th { color: #4b5563; background:#f9fafb; }
body.runnerly-web-planner .stage-band { background:#f3f4f6; border-color:#e5e7eb; }
body.runnerly-web-planner :is(.badge,.check,.stat-label,.hint) { border-color: var(--line); }
body.runnerly-web-planner .decision { border-left-color:#2563eb; background:#eff6ff; }
body.runnerly-web-planner .callout,
body.runnerly-web-planner .card.callout { background: #f9fafb; }
body.runnerly-web-planner .runnerly-chart { border-color:var(--line); background:var(--paper); }
body.runnerly-web-planner .site-footer { background:var(--paper); border-color:var(--line); }
body.runnerly-web-planner .footer-links a { color: #2563eb; }

/* Responsive parity: do not let long planner navigation wrap the desktop header.
   Use the same single-line logo-and-menu arrangement as main Runnerly. */
@media (max-width: 960px) {
  body.runnerly-web-planner .runnerly-integrated-header .header-inner {
    min-height: 68px;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: nowrap;
  }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img {
    max-height: 44px;
    max-width: min(180px, 42vw);
  }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img { max-height: 34px; }
  body.runnerly-web-planner .runnerly-integrated-header .menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 84px;
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.24);
    background:rgba(255,255,255,.10);
    border-radius: 10px;
    font:700 13px/1.25 Arial,sans-serif;
  }
  body.runnerly-web-planner .runnerly-integrated-header .menu-toggle-text { font-size:13px; }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu {
    display: flex;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 1020;
    width: 100%;
    max-height: calc(100dvh - 76px - env(safe-area-inset-bottom));
    margin: 0;
    padding: 12px 16px 18px;
    border-radius: 0 0 14px 14px;
    border-top: 1px solid rgba(255,255,255,.12);
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    overflow-y: auto;
    background: #111827;
    box-shadow: 0 18px 40px rgba(15,23,42,.25);
  }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu[hidden] { display: none !important; }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu .topnav,
  body.runnerly-web-planner .runnerly-integrated-header .site-menu .utility-nav {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border: 0;
    margin: 0;
    padding: 0;
  }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu .utility-nav {
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  body.runnerly-web-planner .runnerly-integrated-header .topnav a,
  body.runnerly-web-planner .runnerly-integrated-header .utility-nav a,
  body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary {
    display: flex;
    min-height: 44px;
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
  }
  body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group {
    display: block;
    width: 100%;
    padding: 0;
  }
  body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown {
    position: static;
    display: grid;
    box-shadow: none;
    min-width: 0;
    margin: 4px 0 8px 12px;
    padding: 5px;
    border: 0;
    border-left: 2px solid rgba(255,255,255,.18);
    border-radius: 4px;
    background: #1f2937;
  }
  body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a {
    color: #fff;
    font-size: 14px;
    padding: 9px 12px;
  }
  body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a:hover,
  body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a[aria-current="page"] {
    color: #fff;
    background: rgba(255,255,255,.12);
  }
}
@media (max-width: 800px) {
  body.runnerly-web-planner > main.shell,
  body.runnerly-web-planner > .site-footer .shell { width: calc(100% - 32px); }
  body.runnerly-web-planner > main.shell { padding: 24px 0 90px; }
  body.runnerly-web-planner .card { padding: 18px; }
  body.runnerly-web-planner .site-menu { bottom: auto; }
  body.runnerly-web-planner .page-head { margin-bottom: 18px; }
}
@media (max-width: 430px) {
  body.runnerly-web-planner .runnerly-integrated-header .header-inner { padding: 12px 16px; }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img { max-width: min(180px, 43vw); }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate { padding: 4px 7px; }
  body.runnerly-web-planner > main.shell { width: calc(100% - 24px); }
  body.runnerly-web-planner .card { padding: 16px; }
}
@media print {
  body.runnerly-web-planner .runnerly-integrated-header .site-menu { display: none !important; }
}

/* RUNNERLY SHARED HEADER PARITY V4 BEGIN
   Adapt the installed Planner header to the Coach/Athlete/standard Runnerly
   navigation treatment, without changing Planner markup or behaviour.
   This is intentionally in the last-loaded Planner stylesheet. */
body.runnerly-web-planner {
  --runnerly-stable-header-height: 76px;
}

body.runnerly-web-planner .runnerly-integrated-header.site-header {
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--runnerly-stable-header-height);
  min-height: var(--runnerly-stable-header-height);
  max-height: var(--runnerly-stable-header-height);
  padding: 0;
  background: #111827;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
body.runnerly-web-planner .runnerly-integrated-header .header-inner {
  box-sizing: border-box;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
  min-height: 0;
  max-height: none;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}
body.runnerly-web-planner .runnerly-integrated-header .brand {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: auto;
  max-width: 180px;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  gap: 0;
  line-height: 1;
  text-decoration: none;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: auto;
  max-width: 180px;
  min-height: 0;
  height: auto;
  overflow: visible;
  border-radius: 0;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img {
  display: block;
  height: auto;
  width: auto;
  max-height: 44px;
  max-width: 180px;
  object-fit: contain;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate {
  border-radius: 8px;
  background: #fff;
  padding: 5px 9px;
  max-width: 180px;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img {
  max-height: 34px;
  max-width: 162px;
}
body.runnerly-web-planner .runnerly-integrated-header .site-menu {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: auto;
  min-width: 0;
  margin: 0 0 0 auto;
  padding: 0;
  background: transparent;
}
body.runnerly-web-planner .runnerly-integrated-header .topnav,
body.runnerly-web-planner .runnerly-integrated-header .utility-nav {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  width: auto;
  padding: 0;
  margin: 0;
}
body.runnerly-web-planner .runnerly-integrated-header .platform-topnav {
  border: 0;
  padding: 0;
  margin: 0;
}
body.runnerly-web-planner .runnerly-integrated-header .topnav a,
body.runnerly-web-planner .runnerly-integrated-header .utility-nav a,
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font: 700 15px/1.2 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}
body.runnerly-web-planner .runnerly-integrated-header :is(.topnav a,.utility-nav a,.planner-nav-group > summary):is(:hover,:focus-visible),
body.runnerly-web-planner .runnerly-integrated-header .topnav a[aria-current="page"],
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group[open] > summary {
  background: rgba(255,255,255,.12);
  color: #fff;
}
body.runnerly-web-planner .runnerly-integrated-header :is(.brand,.topnav a,.utility-nav a,.planner-nav-group > summary,.menu-toggle):focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group {
  position: relative;
  display: block;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary {
  list-style: none;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary::-webkit-details-marker {
  display: none;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-nav-chevron {
  display: inline-flex;
  font-size: 12px;
  line-height: 1;
  opacity: .8;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1020;
  display: grid;
  min-width: 230px;
  gap: 4px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15,23,42,.18);
}
body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a {
  color: #111827;
  font: 700 14px/1.35 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
}
body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a:is(:hover,:focus-visible,[aria-current="page"]) {
  color: #111827;
  background: #f3f4f6;
}

/* Fit a full Coach navigation into compact desktop widths without overlapping
   the logo. The JS still opens the mobile menu at 960px, so don't force an
   earlier CSS-only mobile layout. */
@media (min-width: 961px) and (max-width: 1150px) {
  body.runnerly-web-planner .runnerly-integrated-header .header-inner { gap: 10px; padding: 0 16px; }
  body.runnerly-web-planner .runnerly-integrated-header .brand { max-width: 150px; }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img { max-width: 140px; max-height: 38px; }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate { padding: 4px 7px; }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img { max-width: 126px; max-height: 32px; }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu { gap: 3px; }
  body.runnerly-web-planner .runnerly-integrated-header .topnav,
  body.runnerly-web-planner .runnerly-integrated-header .utility-nav { gap: 0; }
  body.runnerly-web-planner .runnerly-integrated-header .topnav a,
  body.runnerly-web-planner .runnerly-integrated-header .utility-nav a,
  body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary { font-size: 13px; padding: 0 7px; }
}

/* The same point at which the Planner menu's existing JS goes mobile. */
@media (max-width: 960px) {
  body.runnerly-web-planner { --runnerly-stable-header-height: 68px; }
  body.runnerly-web-planner .runnerly-integrated-header .header-inner {
    padding: 0 16px;
    gap: 12px;
  }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img {
    max-height: 40px;
    max-width: min(170px, 42vw);
  }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img {
    max-height: 32px;
  }
  body.runnerly-web-planner .runnerly-integrated-header .menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 84px;
    height: 44px;
    min-height: 44px;
    padding: 8px 12px;
    margin: 0 0 0 auto;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 10px;
    background: rgba(255,255,255,.10);
    color: #fff;
    font: 700 13px/1.2 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu {
    position: fixed;
    top: var(--runnerly-stable-header-height);
    bottom: auto;
    left: 0;
    right: 0;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 7px;
    width: 100%;
    max-height: calc(100dvh - var(--runnerly-stable-header-height) - env(safe-area-inset-bottom));
    margin: 0;
    padding: 12px 16px 18px;
    border-top: 1px solid rgba(255,255,255,.12);
    border-radius: 0 0 14px 14px;
    background: #111827;
    box-shadow: 0 18px 40px rgba(15,23,42,.25);
    overflow-y: auto;
  }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu[hidden] {
    display: none !important;
  }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu .topnav,
  body.runnerly-web-planner .runnerly-integrated-header .site-menu .utility-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    gap: 2px;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
  }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu .utility-nav {
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  body.runnerly-web-planner .runnerly-integrated-header .site-menu .topnav a,
  body.runnerly-web-planner .runnerly-integrated-header .site-menu .utility-nav a,
  body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group > summary {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-height: 46px;
    height: auto;
    padding: 11px 12px;
    font-size: 14px;
    line-height: 1.3;
    white-space: normal;
  }
  body.runnerly-web-planner .runnerly-integrated-header .planner-nav-group {
    display: block;
    width: 100%;
  }
  body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown {
    position: static;
    display: grid;
    width: calc(100% - 12px);
    min-width: 0;
    margin: 4px 0 8px 12px;
    padding: 5px;
    border: 0;
    border-left: 2px solid rgba(255,255,255,.18);
    border-radius: 4px;
    background: #1f2937;
    box-shadow: none;
  }
  body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a {
    color: #fff;
    white-space: normal;
    font-size: 14px;
    padding: 9px 12px;
  }
  body.runnerly-web-planner .runnerly-integrated-header .planner-dropdown a:is(:hover,:focus-visible,[aria-current="page"]) {
    background: rgba(255,255,255,.12);
    color: #fff;
  }
}

/* Keep compact phones consistent with the Coach/Athlete 64px header. */
@media (max-width: 420px) {
  body.runnerly-web-planner { --runnerly-stable-header-height: 64px; }
  body.runnerly-web-planner .runnerly-integrated-header .header-inner { padding: 0 12px; }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img { max-width: min(160px, 42vw); }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate { padding: 4px 7px; }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img { max-height: 30px; }
}

/* RUNNERLY SHARED HEADER PARITY V4 END */

/* RUNNERLY PLANNER PAGE PARITY V5 BEGIN
   Apply the dashboard's page-body visual language to every Planner route.
   The already-approved V4 header is intentionally untouched. All selectors
   are scoped to the Planner body; no changes to JS or PHP rendering logic.
   Reference: shared Runnerly assets/css/app.css coach/athlete dashboard panels.
*/

/* Match the neutral Athlete workspace and shared dashboard text scale. */
body.runnerly-web-planner {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: #f4f6f8;
  color: #1f2937;
}
body.runnerly-web-planner :is(button, input, select, textarea) {
  font-family: Arial, sans-serif;
}
body.runnerly-web-planner a:not(.brand):not(.topnav a):not(.utility-nav a):not(.planner-dropdown a):not(.button) {
  text-underline-offset: 2px;
}

/* Same 1280px content width and flush title-panel positioning as Dashboard. */
body.runnerly-web-planner > main.shell {
  box-sizing: border-box;
  width: min(1280px, calc(100% - 32px));
  max-width: 1280px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 0 72px;
}
body.runnerly-web-planner > main.shell > #page-root {
  min-width: 0;
}

/* Planner page headings become the shared white dashboard heading panel.
   Only the top-level page-head is selected; nested cards retain their layout. */
body.runnerly-web-planner > main.shell > .page-head,
body.runnerly-web-planner > main.shell > #page-root > .page-head,
body.runnerly-web-planner > main.shell > #page-root[data-server-strength] > .page-head {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  width: 100%;
  min-height: 92px;
  margin: 0 0 18px;
  padding: 22px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 0 0 20px 20px;
  background: var(--paper, #fff);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}
body.runnerly-web-planner > main.shell > :is(.page-head, #page-root > .page-head) > div:first-child,
body.runnerly-web-planner > main.shell > #page-root[data-server-strength] > .page-head > div:first-child {
  min-width: 0;
  flex: 1 1 300px;
}
body.runnerly-web-planner > main.shell > .page-head h1,
body.runnerly-web-planner > main.shell > #page-root > .page-head h1,
body.runnerly-web-planner > main.shell > #page-root[data-server-strength] > .page-head h1 {
  margin: 0;
  font-size: clamp(27px, 2.2vw, 32px);
  font-weight: 700;
  line-height: 1.12;
}
body.runnerly-web-planner > main.shell > .page-head .lead,
body.runnerly-web-planner > main.shell > #page-root > .page-head .lead,
body.runnerly-web-planner > main.shell > #page-root[data-server-strength] > .page-head .lead {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
}
body.runnerly-web-planner > main.shell > .page-head > :is(.actions, .button),
body.runnerly-web-planner > main.shell > #page-root > .page-head > :is(.actions, .button) {
  margin-top: 0;
}

/* Typographic hierarchy and spacing shared by the dashboard panels. */
body.runnerly-web-planner > main.shell :is(h1, h2, h3, h4) {
  font-family: Arial, sans-serif;
  color: var(--ink, #1f2937);
  letter-spacing: normal;
}
body.runnerly-web-planner > main.shell h1 {
  font-size: clamp(27px, 2.2vw, 32px);
  line-height: 1.12;
  font-weight: 700;
}
body.runnerly-web-planner > main.shell h2 {
  font-size: clamp(20px, 1.55vw, 24px);
  line-height: 1.25;
  font-weight: 700;
}
body.runnerly-web-planner > main.shell h3 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}
body.runnerly-web-planner > main.shell :is(.lead, .muted) {
  color: var(--secondary-text, #6b7280);
}
body.runnerly-web-planner > main.shell .lead { font-size: 16px; }
body.runnerly-web-planner > main.shell :is(.hint, .stat-label, .backup-note) {
  font-size: 12px;
  line-height: 1.45;
  color: var(--secondary-text, #6b7280);
}

/* Shared dashboard panel/card treatment, without altering grid spans or charts. */
body.runnerly-web-planner > main.shell .card {
  box-sizing: border-box;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 18px;
  background: var(--paper, #fff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}
body.runnerly-web-planner > main.shell .card :is(h2, h3):first-child {
  margin-top: 0;
}

/* Preserve the meaning of Runnerly's decision, warning and success panels. */
body.runnerly-web-planner > main.shell .card.warning {
  background: var(--warn-soft, #fff7ed);
  border-left: 5px solid var(--warn, #b45309);
}
body.runnerly-web-planner > main.shell .card.decision {
  background: var(--accent-soft, #eff6ff);
  border-left: 5px solid var(--accent, #2563eb);
}
body.runnerly-web-planner > main.shell .card.success {
  background: var(--good-soft, #dcfce7);
  border-left: 5px solid var(--good, #15803d);
}
body.runnerly-web-planner > main.shell .card.danger-card {
  background: var(--bad-soft, #fee2e2);
  border-left: 5px solid var(--bad, #dc2626);
}

body.runnerly-web-planner > main.shell .grid { gap: 18px; }
body.runnerly-web-planner > main.shell .stat {
  font-size: clamp(27px, 2.25vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
body.runnerly-web-planner > main.shell .stat-label {
  margin-top: 5px;
  font-weight: 700;
}
body.runnerly-web-planner > main.shell .strength-exercise {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 18px;
  background: var(--paper, #fff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
  padding: 20px;
}
body.runnerly-web-planner > main.shell .strength-meta div,
body.runnerly-web-planner > main.shell .callout {
  border-radius: 12px;
  background: var(--surface-2, #f3f4f6);
}

/* The shared Runnerly button shape and neutral secondary treatment. */
body.runnerly-web-planner > main.shell :is(.button, button:not(.menu-toggle):not(.theme-toggle)) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}
body.runnerly-web-planner > main.shell :is(.button, button:not(.menu-toggle):not(.theme-toggle)):hover {
  background: #1d4ed8;
  color: #fff;
}
body.runnerly-web-planner > main.shell :is(.button.secondary, .button.button-secondary, button.secondary) {
  background: var(--surface-2, #f3f4f6) !important;
  color: var(--ink, #1f2937) !important;
  border-color: var(--line, #e5e7eb) !important;
}
body.runnerly-web-planner > main.shell :is(.button.secondary, .button.button-secondary, button.secondary):hover {
  background: var(--surface-3, #e5e7eb) !important;
  color: var(--ink, #1f2937) !important;
}
body.runnerly-web-planner > main.shell :is(.button.danger, button.danger) {
  background: #dc2626 !important;
  color: #fff;
}
body.runnerly-web-planner > main.shell :is(.button.danger, button.danger):hover {
  background: #b91c1c !important;
}
body.runnerly-web-planner > main.shell :is(button, .button):disabled {
  opacity: .55;
  cursor: not-allowed;
}
body.runnerly-web-planner > main.shell .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
body.runnerly-web-planner > main.shell .actions .button,
body.runnerly-web-planner > main.shell .actions button { margin: 0; }

/* Forms follow the shared Athlete/Coach fields, preserving functional layout. */
body.runnerly-web-planner > main.shell label {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink, #1f2937);
}
body.runnerly-web-planner > main.shell :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink, #1f2937);
  background: var(--input-bg, #fff);
  font-size: 15px;
  line-height: 1.4;
}
body.runnerly-web-planner > main.shell :is(input,select,textarea):focus-visible {
  outline: 3px solid rgba(37,99,235,.25);
  border-color: #2563eb;
  outline-offset: 1px;
}
body.runnerly-web-planner > main.shell :is(input[type="checkbox"],input[type="radio"]) {
  width: auto;
  min-height: 0;
  accent-color: #2563eb;
}
body.runnerly-web-planner > main.shell .check {
  border-color: var(--line, #e5e7eb);
  border-radius: 10px;
  background: var(--paper, #fff);
}

/* Table outlines and scrolling align with dashboard table cards. */
body.runnerly-web-planner > main.shell .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  background: var(--paper, #fff);
}
body.runnerly-web-planner > main.shell :is(.table, .quality-table) {
  background: var(--paper, #fff);
}
body.runnerly-web-planner > main.shell :is(.table, .quality-table) th {
  background: var(--surface-2, #f3f4f6);
  color: var(--secondary-text, #6b7280);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .055em;
  text-transform: uppercase;
}
body.runnerly-web-planner > main.shell :is(.table, .quality-table) th,
body.runnerly-web-planner > main.shell :is(.table, .quality-table) td {
  border-bottom: 1px solid var(--line, #e5e7eb);
  padding: 12px;
}
body.runnerly-web-planner > main.shell .plan-numbered-week-row td {
  background: #111827;
  color: #fff;
}
body.runnerly-web-planner > main.shell .stage-band {
  border-radius: 10px;
  background: var(--surface-2, #f3f4f6);
}

/* Clearer dashboard-style alerts and in-page information panels. */
body.runnerly-web-planner > main.shell .flash {
  padding: 13px 16px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  background: var(--surface-2, #f3f4f6);
}
body.runnerly-web-planner > main.shell .flash.error {
  background: var(--bad-soft, #fee2e2);
  color: var(--bad, #dc2626);
}
body.runnerly-web-planner > main.shell .flash.success {
  background: var(--good-soft, #dcfce7);
  color: var(--good, #15803d);
}

/* Restore a readable dark-mode version without changing its controls. */
html[data-theme="dark"] body.runnerly-web-planner {
  background: var(--bg, #0e1721);
  color: var(--ink, #f3f4f6);
}

@media (max-width: 800px) {
  body.runnerly-web-planner > main.shell {
    width: min(1280px, calc(100% - 24px));
    padding: 0 0 90px;
  }
  body.runnerly-web-planner > main.shell .card { padding: 18px; }
  body.runnerly-web-planner > main.shell .strength-exercise { padding: 16px; }
}
@media (max-width: 760px) {
  body.runnerly-web-planner > main.shell > .page-head,
  body.runnerly-web-planner > main.shell > #page-root > .page-head,
  body.runnerly-web-planner > main.shell > #page-root[data-server-strength] > .page-head {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    align-items: center;
    min-height: 86px;
    gap: 12px;
    margin-bottom: 14px;
    padding: 16px;
    border-radius: 0 0 18px 18px;
  }
  body.runnerly-web-planner > main.shell > .page-head > .button,
  body.runnerly-web-planner > main.shell > #page-root > .page-head > .button {
    width: 100%;
  }
  body.runnerly-web-planner > main.shell > #page-root > .page-head .actions {
    width: 100%;
    margin: 0;
  }
  body.runnerly-web-planner > main.shell > #page-root > .page-head .actions :is(.button,button) {
    flex: 1 1 140px;
  }
}
@media (max-width: 480px) {
  body.runnerly-web-planner > main.shell { width: calc(100% - 20px); }
  body.runnerly-web-planner > main.shell .card { padding: 16px; }
  body.runnerly-web-planner > main.shell .table-wrap { overflow-x: auto; }
}

@media (max-width: 680px) {
  /* The Plan's compact card rows must retain their existing mobile layout. */
  body.runnerly-web-planner > main.shell .table-wrap:has(.plan-table) {
    border: 0;
    background: transparent;
    overflow: visible;
  }
}

/* RUNNERLY PLANNER PAGE PARITY V5 END */


/* RUNNERLY PLANNER PAGE TITLE V6 BEGIN
   The title belongs to the navigation section, just like the Athlete/Coach
   page-header. Existing dynamic runner/race details remain visible beneath it.
   Only Planner pages use these selectors. No PHP-embedded presentation CSS. */
body.runnerly-web-planner > main.shell > .planner-page-title-banner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 92px;
  margin: 0 0 18px;
  padding: 19px 24px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 0 0 20px 20px;
  background: var(--paper, #fff);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}
body.runnerly-web-planner > main.shell > .planner-page-title-banner .planner-page-title-eyebrow {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--secondary-text, #6b7280);
}
body.runnerly-web-planner > main.shell > .planner-page-title-banner h1 {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: clamp(27px, 2.2vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink, #1f2937);
}

/* The existing contextual heading is not a second white title banner.
   It still shows runner name, race name, explanatory text and actions. */
body.runnerly-web-planner > main.shell > .page-head,
body.runnerly-web-planner > main.shell > #page-root > .page-head,
body.runnerly-web-planner > main.shell > #page-root[data-server-strength] > .page-head {
  min-height: 0;
  margin: 0 0 18px;
  padding: 2px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.runnerly-web-planner > main.shell > .page-head h1,
body.runnerly-web-planner > main.shell > #page-root > .page-head h1,
body.runnerly-web-planner > main.shell > #page-root[data-server-strength] > .page-head h1 {
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.25;
}

@media (max-width: 760px) {
  body.runnerly-web-planner > main.shell > .planner-page-title-banner {
    min-height: 84px;
    padding: 16px 18px;
    border-radius: 0 0 18px 18px;
    margin-bottom: 16px;
  }
  body.runnerly-web-planner > main.shell > .page-head,
  body.runnerly-web-planner > main.shell > #page-root > .page-head,
  body.runnerly-web-planner > main.shell > #page-root[data-server-strength] > .page-head {
    min-height: 0;
    display: flex;
    gap: 12px;
    padding: 0 0 8px;
    border-radius: 0;
  }
}
@media (max-width: 480px) {
  body.runnerly-web-planner > main.shell > .planner-page-title-banner {
    padding: 15px 16px;
  }
}
/* RUNNERLY PLANNER PAGE TITLE V6 END */


/* RUNNERLY PLANNER ALIGNMENT V7 BEGIN
   Retain the approved V4 navigation and V6 title banner. Earlier parity styles
   used !important widths on the logo and slot, which override the later header
   sizing. Normalise those exact declarations and let the dashboard-width main
   content stay centred instead of applying pixel transforms to the whole page. */

/* The other Runnerly dashboards do not reserve an additional stable scrollbar
   gutter. Consistent scrollbar sizing prevents a small perceived horizontal
   shift when moving between the dashboard and Planner on shorter pages. */
html:has(> body.runnerly-web-planner) {
  overflow-y: auto;
  scrollbar-gutter: auto;
}

/* Replace the old fixed 180px logo slot with content-based dimensions. */
body.runnerly-web-planner .runnerly-integrated-header .brand {
  width: auto !important;
  max-width: 170px !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo {
  width: auto !important;
  max-width: 170px !important;
  height: auto !important;
  min-height: 0 !important;
  flex: 0 0 auto !important;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img {
  width: auto !important;
  height: 36px !important;
  max-width: 154px !important;
  max-height: 36px !important;
  object-fit: contain !important;
}
/* Account for the plate's existing left inset, which otherwise shifts the
   visible logo several pixels to the right of the shared header's left edge. */
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate {
  margin-left: -6px !important;
  height: auto !important;
  padding: 5px 6px !important;
  max-width: 170px !important;
}
body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img {
  height: 36px !important;
  max-height: 36px !important;
  max-width: 154px !important;
}

/* Match the coach / athlete dashboard's centred 1,280px page container. */
body.runnerly-web-planner > main.shell {
  box-sizing: border-box;
  width: min(1280px, calc(100% - 32px));
  max-width: 1280px;
  margin-inline: auto !important;
  left: auto;
  right: auto;
  transform: none;
}
@media (max-width: 960px) {
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img,
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img {
    height: 34px !important;
    max-height: 34px !important;
    max-width: 146px !important;
  }
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate {
    padding: 4px 6px !important;
    margin-left: -6px !important;
  }
}
@media (max-width: 800px) {
  body.runnerly-web-planner > main.shell {
    width: min(1280px, calc(100% - 24px));
  }
}
@media (max-width: 480px) {
  body.runnerly-web-planner > main.shell {
    width: min(1280px, calc(100% - 20px));
  }
}
@media (max-width: 420px) {
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.has-logo img,
  body.runnerly-web-planner .runnerly-integrated-header .brand-logo-slot.runnerly-logo-light-plate img {
    height: 30px !important;
    max-height: 30px !important;
    max-width: 136px !important;
  }
}
/* RUNNERLY PLANNER ALIGNMENT V7 END */
