/* ============================================================
   printrekm.com — global styles
   ============================================================ */

:root {
  --brand:      #1a73e8;
  --brand-dark: #1557b0;
  --accent:     #34a853;
  --bg:         #f8f9fa;
  --card:       #ffffff;
  --text:       #202124;
  --muted:      #5f6368;
  --border:     #dadce0;
  --radius:     8px;
  --max-w:      960px;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --brand-tint: #e8f0fe;
  --accent-tint:#e6f4ea;
  --danger:     #c0392b;
  --focus-ring: 0 0 0 3px hsla(217, 89%, 61%, .45);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.1);
  --ease:       cubic-bezier(.2, .7, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
p { text-wrap: pretty; }

/* visible keyboard focus everywhere, no ring on mouse click */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

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

/* ---- layout ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; }

section { padding: 3rem 0; }

/* ---- nav ---- */
nav {
  background:
    linear-gradient(90deg, hsla(0, 0%, 100%, .94) 0%, hsla(0, 0%, 100%, .82) 55%, hsla(0, 0%, 100%, .6) 100%),
    url(/images/banner.svg) center 40% / cover no-repeat;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  max-width: 1200px;
}
nav .logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--brand);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.01em;
}
nav .logo img { width: 32px; height: 32px; border-radius: 6px; transition: transform .2s var(--ease); }
nav .logo:hover { text-decoration: none; }
nav .logo:hover img { transform: rotate(-6deg) scale(1.05); }
nav .nav-links { display: flex; align-items: center; gap: 1.25rem; list-style: none; }
nav .nav-links > li { white-space: nowrap; }
nav .nav-links a { font-size: 0.9rem; color: var(--muted); transition: color .15s; }
nav .nav-links a:hover { color: var(--text); text-decoration: none; }

/* account / Garmin badge in the nav */
.prk-garmin { display: flex; align-items: center; gap: .4rem; flex-wrap: nowrap; }
.prk-garmin .btn-primary,
.prk-garmin .btn-outline { padding: .35rem .8rem; font-size: .8rem; line-height: 1.3; white-space: nowrap; }
.prk-garmin .prk-email {
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .8rem; color: var(--muted);
}
.prk-garmin .badge { white-space: nowrap; }
.prk-connect-card { white-space: normal; overflow-wrap: anywhere; }

/* Garmin card: password field with a reveal toggle (split control) */
.prk-pw-split {
  display: flex; align-items: stretch; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
}
.prk-pw-split input {
  flex: 1; min-width: 0; padding: .6rem .75rem; border: 0; background: none;
  font-size: .95rem; color: var(--text);
}
.prk-pw-split input:focus-visible { outline: none; box-shadow: none; }
.prk-pw-split:focus-within { border-color: var(--brand); box-shadow: var(--focus-ring); }
.prk-pw-split .prk-pw-eye {
  flex: none; display: grid; place-items: center; width: 2.6rem;
  border: 0; border-left: 1px solid var(--border); background: none; color: var(--muted);
  cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease);
}
.prk-pw-split .prk-pw-eye:hover { background: var(--brand-tint); color: var(--brand); }
.prk-pw-split .prk-pw-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.admin-tag { background: var(--brand); color: #fff; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }

/* Desktop: logo left, menu centred on the page, account controls pinned right.
   The account <li> is taken out of the menu's flow so signing in/out never
   changes the menu's width or position. */
@media (min-width: 1150px) {
  nav .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    position: relative;
  }
  nav .logo { justify-self: start; }
  nav .nav-links { grid-column: 2; }
  nav .nav-links > li:has(> #garmin-status) {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }
}

@media (min-width: 1150px) {
  nav .nav-links { gap: 1rem; }
  .prk-garmin .prk-email { display: none; }
}

/* dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: ' ▾'; font-size: .7rem; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: .5rem 0;
  z-index: 200;
}
.nav-dropdown-menu a { display: block; padding: .5rem 1rem; font-size: .85rem; color: var(--text); }
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible { background: var(--bg); text-decoration: none; }
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }

/* hamburger: 44px touch target */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 11px; margin-right: -11px; border-radius: var(--radius); }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 1px; }
.nav-toggle span:first-child { margin-top: 0; }
.nav-toggle span:last-child { margin-bottom: 0; }

@media (max-width: 1149px) {
  nav .nav-links { display: none; flex-direction: column; gap: .8rem; position: absolute; top: 56px; left: 0; right: 0; background: var(--card); padding: 1rem; border-bottom: 1px solid var(--border); }
  nav .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 1rem; }
  .nav-dropdown > a::after { content: ' ▸'; }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  nav .nav-links > li { white-space: normal; }
  .prk-garmin { flex-wrap: wrap; }
  .prk-garmin .prk-email { max-width: none; }
}

/* ---- hero ---- */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, var(--brand-tint) 0%, var(--bg) 100%);
}
.hero h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.4rem); margin-bottom: .5rem; letter-spacing: -.01em; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 540px; margin: 0 auto 1.5rem; }
.hero .btn { display: inline-block; padding: .75rem 1.5rem; background: var(--brand); color: #fff; border-radius: var(--radius); font-weight: 600; transition: background .2s var(--ease), transform .15s var(--ease); }
.hero .btn:active { transform: translateY(1px); }
.hero .btn:hover { background: var(--brand-dark); text-decoration: none; }
.hero-banner {
  width: min(320px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  box-shadow: 0 12px 40px hsla(217, 40%, 20%, .15);
  object-fit: cover;
}
@media (min-width: 860px) {
  .hero .container.hero-split { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3rem; text-align: left; }
  .hero-split p { margin-left: 0; }
  .hero-split .hero-banner { margin: 0; order: 2; }
}
.hero.hero-photo { position: relative; overflow: hidden; isolation: isolate; padding: clamp(3rem, 8vw, 6rem) 0; text-align: left; background: var(--bg); }
.hero.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, hsla(217, 60%, 12%, .55), hsla(217, 60%, 12%, .78)),
    url(/images/banner.svg) center / cover no-repeat;
}
.hero-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 2.25rem;
  text-align: center;
  color: #fff;
}
.hero-card h1 { text-shadow: 0 2px 16px hsla(217, 60%, 8%, .5); }
.hero-card p { margin: 0 auto 1.5rem; color: hsla(0, 0%, 100%, .88); }

/* ---- cards grid ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow .2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--muted); font-size: .9rem; }

/* plan picker: a podium, longest race tallest */
.plan-podium { grid-template-columns: repeat(4, 1fr); gap: .75rem; align-items: end; }
.plan-podium .card { display: flex; flex-direction: column; color: var(--text); border-top: 4px solid var(--brand); border-radius: 4px 4px var(--radius) var(--radius); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.plan-podium .card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-md); }
.plan-podium .card:nth-child(1) { min-height: 300px; background: linear-gradient(180deg, var(--brand-tint), var(--card) 60%); }
.plan-podium .card:nth-child(2) { min-height: 255px; }
.plan-podium .card:nth-child(3) { min-height: 215px; }
.plan-podium .card:nth-child(4) { min-height: 180px; }
.plan-podium .card h3 { font-size: 1.15rem; }
.plan-podium .card .badge { align-self: flex-start; order: -1; margin-bottom: .5rem; }
@media (max-width: 760px) {
  .plan-podium { grid-template-columns: 1fr 1fr; }
  .plan-podium .card:nth-child(n) { min-height: 0; }
}

/* calculators: race pace featured full-width, the rest in a row */
.calc-feature { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.calc-feature .card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.calc-feature .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.calc-feature .card > a { color: var(--text); text-decoration: none; }
.calc-feature .card > a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.calc-feature .card:has(> a:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.calc-feature .card > a:focus-visible { outline: none; }
.calc-feature > .card:first-child { grid-column: 1 / -1; min-height: 220px; padding: 2.25rem; border: 0; color: #fff; background: linear-gradient(120deg, hsla(217, 70%, 22%, .92), hsla(217, 89%, 51%, .75)), url(/images/banner.svg) center / cover no-repeat; }
.calc-feature > .card:first-child > a { color: #fff; }
.calc-feature > .card:first-child h3 { font-size: 1.75rem; }
.calc-feature > .card:first-child p { color: hsla(0, 0%, 100%, .85); font-size: 1rem; }
.calc-feature > .calc-gate { grid-column: 1 / -1; }
.calc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 760px) { .calc-feature, .calc-row { grid-template-columns: 1fr; } }

/* How it works: numbered pins along a dashed route */
.route { list-style: none; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.route::before { content: ""; position: absolute; top: 22px; left: 16.6%; right: 16.6%; border-top: 3px dashed hsla(217, 89%, 51%, .45); }
.route li { position: relative; text-align: center; padding: 0 .5rem; }
.route .pin { position: relative; z-index: 1; display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 1rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 0 0 6px var(--bg), var(--shadow-md); }
.route li:last-child .pin { background: var(--accent); }
.route h3 { margin-bottom: .35rem; }
.route p { color: var(--muted); font-size: .9rem; }
@media (max-width: 720px) {
  .route { grid-template-columns: 1fr; gap: 1.75rem; }
  .route::before { top: 23px; bottom: 23px; left: 22px; right: auto; border-top: 0; border-left: 3px dashed hsla(217, 89%, 51%, .45); }
  .route li { display: grid; grid-template-columns: 46px 1fr; column-gap: 1rem; text-align: left; padding: 0; }
  .route .pin { grid-row: 1 / 3; margin: 0; }
}

/* ---- form ---- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--card);
  font-family: inherit;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group select:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.form-group input[aria-invalid="true"],
.form-group select[aria-invalid="true"] { border-color: var(--danger); }
.form-group select:disabled,
.form-group input:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.form-group textarea { resize: vertical; min-height: 140px; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
@media (max-width: 600px) { .form-row { flex-direction: column; } }

/* ---- target time: scroll wheels for hours, minutes, optional seconds ---- */
.form-group .form-label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.time-label-row { display: flex; align-items: baseline; gap: .45rem; margin-bottom: .3rem; }
.time-label-row .form-label { margin-bottom: 0; }
.time-format { font-size: .75rem; font-weight: 600; letter-spacing: .05em; color: var(--muted); }
.time-split { display: flex; align-items: center; gap: .2rem; }
.time-wheel-col { flex: 1 1 0; min-width: 0; }
.time-wheel { position: relative; height: 2.5rem; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.time-wheel::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 1.25rem; transform: translateY(-50%); background: var(--brand-tint); border-radius: 4px; pointer-events: none; }
.time-wheel-track { position: relative; z-index: 1; height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; padding: .625rem 0; }
.time-wheel-track::-webkit-scrollbar { display: none; }
.time-wheel-opt { height: 1.25rem; line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); scroll-snap-align: center; }
.time-wheel-opt.is-on { color: var(--brand-dark); font-weight: 700; }
.time-colon { color: var(--muted); font-weight: 600; }

/* ---- Garmin danger zone ---- */
.danger-card { margin-top: 1.5rem; padding: 1.25rem 1.5rem; border: 1px solid hsla(6, 63%, 46%, .35); border-left: 4px solid var(--danger); background: hsl(6, 70%, 98.5%); }
.danger-card:hover { box-shadow: none; }
.danger-eyebrow { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--danger); margin-bottom: .35rem; }
.danger-card h2 { font-size: 1.05rem; margin: 0 0 .35rem; }
.danger-card p { font-size: .85rem; margin-bottom: 1rem; }
.danger-row { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; }
.danger-row .form-group { margin: 0; }
.danger-row input { max-width: 110px; }
.btn-danger { padding: .6rem 1.2rem; border: 1px solid var(--danger); border-radius: var(--radius); background: transparent; color: var(--danger); font: inherit; font-weight: 600; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* ---- plan wizard ---- */
.plan-wizard .wizard-step { border: 0; min-width: 0; animation: wizard-in .25s var(--ease); }
.plan-wizard .wizard-step[hidden] { display: none; }
.plan-wizard legend { font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; }
@keyframes wizard-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.wizard-progress { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1.75rem; counter-reset: none; }
.wizard-progress li { position: relative; }
.wizard-progress li::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--border); margin-bottom: .6rem; transition: background .3s var(--ease); }
.wizard-progress li.is-done::before, .wizard-progress li.is-current::before { background: var(--brand); }
.wizard-progress button { display: inline-flex; align-items: center; gap: .5rem; background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; }
.wizard-progress .wizard-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; transition: all .2s var(--ease); }
.wizard-progress .is-current button { color: var(--text); font-weight: 600; }
.wizard-progress .is-current .wizard-num { border-color: var(--brand); color: var(--brand); }
.wizard-progress .is-done .wizard-num { background: var(--brand); border-color: var(--brand); color: #fff; }
/* sign-in notice at the top of the goal / schedule steps */
.wiz-signin-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem 1.25rem; flex-wrap: wrap;
  margin-bottom: 1.25rem; padding: .8rem 1rem;
  background: var(--brand-tint); border: 1px solid hsla(217, 89%, 51%, .16);
  border-radius: var(--radius);
}
.wiz-signin-strip[hidden] { display: none; }
.wiz-signin-text { margin: 0; font-size: .9rem; color: var(--text); max-width: 48ch; }
.wiz-signin-text strong { font-weight: 600; }
.wiz-signin-btn { flex: none; }

/* fitness step: connect Garmin or enter the numbers by hand */
.fit-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem;
  margin-bottom: 1rem; padding: .7rem .9rem;
  background: var(--brand-tint); border: 1px solid hsla(217, 89%, 51%, .16);
  border-radius: var(--radius);
}
.fit-strip-text { margin: 0; font-size: .85rem; color: var(--muted); }
.fit-strip-btn { flex: none; padding: .45rem .9rem; font-size: .82rem; }
.note-link {
  margin-left: .35rem; padding: 0; background: none; border: none;
  font-size: .8rem; color: var(--brand); text-decoration: underline; cursor: pointer;
}
.note-link:hover { color: var(--brand-dark); }
.note-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fit-strip-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; flex: none; margin-left: auto;
  background: none; border: 1px solid transparent; border-radius: 50%;
  color: var(--muted); cursor: pointer;
  transition: transform .18s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.fit-strip-arrow:hover { background: hsla(0, 0%, 0%, .05); color: var(--text); }
.fit-strip-arrow:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fit-strip-arrow .fit-arrow-icon { transition: transform .18s var(--ease); }
.fit-strip-arrow.is-open .fit-arrow-icon { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .fit-strip-arrow, .fit-strip-arrow .fit-arrow-icon { transition: none; }
}

/* hover help shown to the right of a select (workout targets) */
.hr-help { position: relative; margin: 0; }
.hr-tip {
  position: absolute; left: calc(100% + .75rem); top: -1.25rem; bottom: auto;
  z-index: 30; transform: translateY(-50%);
  width: max-content; max-width: 30ch;
  padding-left: .7rem;
  font-size: .85rem; line-height: 1.5; color: var(--text);
  opacity: 0; visibility: hidden; transition: opacity .15s var(--ease);
}
.hr-tip::before {
  content: ""; position: absolute; left: 0; top: .1rem; bottom: .1rem;
  width: 1px; background: var(--border);
}
.has-help:hover ~ .hr-help .hr-tip,
.has-help:focus-visible ~ .hr-help .hr-tip,
.hr-help:hover .hr-tip { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .hr-tip { transition: none; } }
.wizard-nav { display: flex; gap: .75rem; justify-content: space-between; margin-top: .5rem; }
.wizard-nav [hidden] { display: none !important; }
.wizard-nav #wizard-next, .wizard-nav button[type=submit] { margin-left: auto; width: auto !important; min-width: 180px; }
@media (max-width: 480px) { .wizard-progress .wizard-label { display: none; } }

.contact-links { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.contact-links a:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }

.btn-primary {
  display: inline-block;
  padding: .75rem 2rem;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background .2s var(--ease), transform .15s var(--ease);
}
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-outline {
  display: inline-block;
  padding: .6rem 1.2rem;
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.btn-outline:hover { background: var(--brand-tint); text-decoration: none; }
.btn-outline:active:not(:disabled) { transform: translateY(1px); }
.btn-outline:disabled { opacity: .5; cursor: not-allowed; }

/* ---- results / output ---- */
.result-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.result-box h2,
.result-box h3 { margin-bottom: .5rem; }
.result-box > h2 { font-size: 1.17rem; }
.result-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.result-table th, .result-table td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.result-table th { font-weight: 600; background: var(--bg); }
.result-table tr:last-child td { border-bottom: none; }

/* ---- heart rate zone chart ---- */
.zones-chart { display: flex; height: 46px; border-radius: var(--radius); overflow: hidden; margin: .75rem 0 1rem; }
.zc-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem; font-weight: 700;
          min-width: 0; white-space: nowrap; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,.35); }

/* ---- blog ---- */
.blog-post { max-width: 720px; margin: 0 auto; }
.blog-post h1 { margin-bottom: .5rem; }
.blog-post .meta { color: var(--muted); font-size: .85rem; margin-bottom: 1.5rem; }
.blog-post p { margin-bottom: 1rem; }
.blog-post h2 { margin: 1.5rem 0 .5rem; }
.blog-post ul { margin: 0 0 1rem 1.5rem; }
.blog-post li { margin-bottom: .3rem; }

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
footer a { color: var(--muted); }

/* ---- admin console ---- */
.admin-gate {
  position: fixed; inset: 0; z-index: 1000; padding: 1rem;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, hsla(217, 89%, 95%, .96), hsla(210, 17%, 98%, .96));
}
.admin-gate-card { max-width: 380px; width: 100%; padding: 1.75rem; box-shadow: 0 12px 40px hsla(217, 40%, 20%, .15); }
.admin-gate-card h2 { margin-bottom: .25rem; }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-full { width: 100%; margin-top: .5rem; }
.admin-small { font-size: .85rem; }
.admin-tiny { font-size: .75rem; }
.admin-error { color: hsl(6, 63%, 46%); font-size: .85rem; margin: .5rem 0; }
.admin-inline { display: inline-flex; align-items: center; gap: .35rem; margin: 0 .75rem; }
.admin-scroll { overflow-x: auto; }
.admin-card-tight { padding: 1rem; margin: 0; }
.admin-card-tight h4 { font-size: .9rem; margin: .25rem 0 .5rem; }
.admin-bands { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.admin-boards { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 1rem; }
.admin-notes { margin-top: 1rem; font-size: .85rem; }
.admin-notes summary { cursor: pointer; }
.admin-notes ul { margin: .5rem 0 0 1.25rem; color: var(--muted); }
#admin-app h3 { font-size: 1rem; margin: .75rem 0 .5rem; }
#admin-app h4 { font-size: .9rem; margin: .75rem 0 .25rem; }
#admin-app .result-table td code { font-size: .7rem; }
.purpose-badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; color: #fff; background: hsl(220, 9%, 46%); }
.purpose-race { background: hsl(217, 82%, 51%); }
.purpose-tempo { background: hsl(28, 92%, 47%); }
.purpose-daily { background: hsl(137, 65%, 30%); }

/* ---- utility ---- */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.required-mark { color: var(--danger); font-weight: 600; }
.badge { display: inline-block; padding: .2rem .6rem; background: var(--brand-tint); color: var(--brand); border-radius: 12px; font-size: .75rem; font-weight: 600; }
.badge.green { background: var(--accent-tint); color: hsl(137, 65%, 30%); }

/* ---- gated content ---- */
.gated-content {
  position: relative;
  overflow: hidden;      /* clip overlay so it can never spill outside the block */
  min-height: 270px;     /* roomy enough for the unlock overlay to fit fully */
  pointer-events: none;
  user-select: none;
}
.gate-overlay {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(1px);
  border-radius: inherit;   /* match the parent card's radius */
  z-index: 10;
  text-align: center;
  padding: 1.5rem;
  pointer-events: auto;
}
.gate-overlay h2,
.gate-overlay h3 { margin-bottom: .5rem; font-size: 1.17rem; }
.gate-overlay p { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; max-width: 360px; }
.gate-overlay .btn-yt {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.2rem;
  background: #ff0000;
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  transition: background .2s;
}
.gate-overlay .btn-yt:hover { background: #cc0000; text-decoration: none; }
.gate-overlay .btn-verify {
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
}
.gated-unlocked { filter: none; pointer-events: auto; }
.gate-overlay .btn-yt:focus-visible,
.gate-overlay .btn-verify:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.gate-overlay .btn-verify { min-height: 44px; padding: .5rem .75rem; font-family: inherit; }

/* home page: one lock over the three locked calculators; the Race Pace
   calculator sits outside the gated block and stays open */
.calc-gate { border-radius: var(--radius); min-height: 0; }
.calc-gate .gate-overlay { background: hsla(210, 17%, 98%, .45); backdrop-filter: blur(2px); }
.calc-gate .gate-overlay.gate-panel {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1rem;
}
.calc-gate .gate-panel-card {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  max-width: 680px;
  padding: .9rem 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  text-align: left;
}
.calc-gate .gate-panel-lock {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand);
}
.calc-gate .gate-panel-copy { min-width: 0; }
.calc-gate .gate-panel h3 { margin: 0 0 .1rem; font-size: 1.02rem; letter-spacing: -.01em; }
.calc-gate .gate-panel p { margin: 0; font-size: .82rem; max-width: 36ch; }
.calc-gate .gate-panel .btn-yt { margin: 0; flex: none; }
.calc-gate .gate-panel .btn-verify { margin-top: 0; flex: none; }
@media (max-width: 760px) {
  .calc-gate .gate-panel-card { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .calc-gate .gate-panel .btn-verify { align-self: flex-start; }
}

/* ---- "Already subscribed?" sign-in dialog ---- */
.signin-dialog {
  width: min(400px, calc(100vw - 2rem));
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 50px hsla(217, 40%, 15%, .25);
}
.signin-dialog[open] { animation: signin-in .2s var(--ease); }
.signin-dialog::backdrop { background: hsla(217, 40%, 12%, .45); backdrop-filter: blur(2px); }
@keyframes signin-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .signin-dialog[open] { animation-name: signin-fade; } }
@keyframes signin-fade { from { opacity: 0; } to { opacity: 1; } }
.signin-dialog-form { position: relative; display: flex; flex-direction: column; padding: 1.75rem 1.5rem 1.5rem; }
.signin-dialog-form h2 { font-size: 1.25rem; margin: 0 2rem .35rem 0; }
.signin-dialog-form > p.text-muted { font-size: .9rem; margin-bottom: 1.25rem; }
.signin-dialog-form [hidden] { display: none !important; }
.signin-dialog-close {
  position: absolute; top: .5rem; right: .5rem;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.signin-dialog-close:hover { background: var(--bg); color: var(--text); }
.signin-dialog-msg { font-size: .875rem; margin-bottom: 1rem; color: var(--muted); }
.signin-dialog-msg.is-error { color: var(--danger); }
.signin-dialog .btn-yt {
  display: inline-flex; justify-content: center; margin-bottom: .75rem; padding: .7rem 1.2rem;
  background: #cc0000; color: #fff; border-radius: var(--radius); font-weight: 600; text-decoration: none;
}
.signin-dialog .btn-yt:hover { background: #a80000; text-decoration: none; }
.signin-dialog .btn-primary { width: 100%; }

/* ---- yt section ---- */
.yt-section { background: var(--card); }
.yt-head { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; border-radius: 16px; color: #fff; background: linear-gradient(110deg, hsl(0, 80%, 42%), hsl(350, 75%, 30%)); box-shadow: 0 10px 30px hsla(0, 70%, 30%, .25); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.yt-head:hover { transform: translateY(-2px); box-shadow: 0 14px 36px hsla(0, 70%, 30%, .32); }
.yt-head-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: hsla(0, 0%, 100%, .16); }
.yt-head h2 { color: #fff; margin: 0; }
.yt-head p { color: hsla(0, 0%, 100%, .85); margin: .2rem 0 0; }
.yt-head-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.2rem; border-radius: 999px; background: #fff; color: hsl(0, 80%, 40%); font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform .2s var(--ease); }
.yt-head-link:hover { text-decoration: none; transform: scale(1.04); }
.yt-head-cover { color: inherit; }
.yt-head-cover:hover { text-decoration: none; }
.yt-head-cover::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.yt-head-cover:focus-visible, .yt-head-link:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (max-width: 640px) {
  .yt-head { grid-template-columns: auto 1fr; }
  .yt-head-link { grid-column: 1 / -1; justify-content: center; }
}
.yt-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.yt-frame { position: relative; border-radius: 12px; overflow: hidden; background: hsl(217, 30%, 12%); box-shadow: var(--shadow-sm); }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-wide { aspect-ratio: 16 / 9; }
.yt-tall { aspect-ratio: 9 / 16; }
.yt-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 1rem; margin-top: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.yt-strip .yt-frame { scroll-snap-align: start; }
@media (max-width: 760px) {
  .yt-feature { grid-template-columns: 1fr; }
}
