/*
  Daptis design tokens. Every color in the app comes from here.
  Neutrals: cool, neutral greys (no warm tint), slightly darker than before. Data scale: red → orange → yellow → green,
  stepped in brightness too so it still reads for red-green colorblind users.
*/
:root {
  /* Phone bezel around screenshots on the landing page: near-black in both themes */
  --device: #0D0D0D;
  /* The navy the exercise demos are drawn on (setup's welcome cover blends the page into the clip) */
  --demo-bg: #0E0F20;
  /* Safe areas. Zeroed when the host page already pads for them (see main.tsx). */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* Under a button docked to the bottom of the screen: clear of the home indicator, without the full inset under it */
  --dock-b: max(12px, calc(var(--safe-b) - 14px));
  color-scheme: light;

  /* Neutrals */
  /* Behind photos and video (the workout cover): dark in both themes, with light text on it */
  --media-bg: #14161C;
  --on-media: #FFFFFF;
  --bg: #F3F3F3;
  --surface: #FFFFFF;
  --surface-2: #E9E9E9;
  --border: #DEDEDE;
  --border-strong: #C8C8C8;
  --text: #171717;
  --text-muted: #666666;
  --text-faint: #999999;

  /* Brand action (near-black on light, near-white on dark) */
  --action: #171717;
  --action-text: #F3F3F3;
  --focus: #3E9B5C; /* the brand green: focused inputs and the caret */

  /* Data scale, low → high */
  --data-0: #C8392E; /* red    0–24%  */
  --data-1: #E0712C; /* orange 25–49% */
  --data-2: #E3B23C; /* yellow 50–74% */
  --data-3: #3E9B5C; /* green  75–100% */
  --on-brand: #FFFFFF; /* icons on the red → green gradient */
  --chart: #3A6FD8; /* single-series charts (trends that aren't good/bad scales) */
  --chart-wash: rgb(58 111 216 / 0.10);
  /* Two-category charts (strength vs cardio), validated for colour-blind separation on this surface */
  --series-1: #3A6FD8;
  --series-2: #D9568B;
  --series-3: #1F9A8A;

  --danger: var(--data-0);
  --muscle: #C6C6C6; /* body map, untouched muscles */

  /* Type: system font (SF Pro on iOS) so the app feels native and loads nothing */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1C1C1C;
    --surface: #232323;
    --surface-2: #2B2B2B;
    --border: #2E2E2E;
    --border-strong: #3F3F3F;
    --text: #EDEDED;
    --text-muted: #A0A0A0;
    --text-faint: #6E6E6E;
    --action: #EDEDED;
    --action-text: #1C1C1C;
    --focus: #5BBF7C;
    --data-0: #E5564A;
    --data-1: #F08A45;
    --data-2: #F0C75A;
    --data-3: #5BBF7C;
    --chart: #7FA4F0;
    --chart-wash: rgb(127 164 240 / 0.12);
    --series-1: #5E8EEB;
    --series-2: #D55181;
    --series-3: #43B5A8;
    --muscle: #383838;
  }
}

:root[data-theme="dark"],
.theme-dark {
  color-scheme: dark;
  --bg: #1C1C1C;
  --surface: #232323;
  --surface-2: #2B2B2B;
  --border: #2E2E2E;
  --border-strong: #3F3F3F;
  --text: #EDEDED;
  --text-muted: #A0A0A0;
  --text-faint: #6E6E6E;
  --action: #EDEDED;
  --action-text: #1C1C1C;
  --focus: #5BBF7C;
  --data-0: #E5564A;
  --data-1: #F08A45;
  --data-2: #F0C75A;
  --data-3: #5BBF7C;
  --chart: #7FA4F0;
  --chart-wash: rgb(127 164 240 / 0.12);
  --series-1: #5E8EEB;
  --series-2: #D55181;
  --series-3: #43B5A8;
  --muscle: #383838;
}

:root[data-host-safe] { --safe-t: 0px; --safe-b: 0px; }

/* App Store / Google Play badges: the public pages (src/seo) and the landing page share them */
.seo__stores { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seo__stores .seo__store { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px; border-radius: 12px; background: var(--action); color: var(--action-text); text-decoration: none; font-weight: 650; font-size: 17px; line-height: 1.05; }
.seo__stores .seo__store svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.seo__stores .seo__store small { display: block; font-size: 11px; font-weight: 500; opacity: 0.8; letter-spacing: 0.01em; }
.seo__stores .seo__store--soon { background: transparent; color: var(--text-muted); border: 1px solid var(--border-strong); cursor: default; }
.seo__stores .seo__store--web { background: transparent; color: var(--text); border: 1px solid var(--border-strong); padding-left: 18px; }


/* The public content pages (src/seo). Served after src/styles/tokens.css as one file; flat like the app:
   content on the page background, hairlines, fills only on controls, data colours only for data. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--text-muted); }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.seo { min-height: 100vh; display: flex; flex-direction: column; }
.seo__main { width: 100%; max-width: 860px; margin: 0 auto; padding: 8px 20px 40px; flex: 1; }

/* Header */
.seo__nav { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 20px; padding: 14px 20px; padding-top: max(14px, var(--safe-t)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.seo__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; }
.seo__logo { display: inline-grid; grid-template-columns: repeat(4, 1fr); gap: 2px; width: 24px; }
.seo__logo span { height: 4px; border-radius: 1.5px; }
.seo__links { display: flex; gap: 18px; flex: 1; font-size: 14px; color: var(--text-muted); overflow-x: auto; scrollbar-width: none; }
.seo__links::-webkit-scrollbar { display: none; }
.seo__links a { text-decoration: none; white-space: nowrap; }
.seo__links a:hover { color: var(--text); }
.seo__signin { font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (max-width: 720px) {
  .seo__nav { flex-wrap: wrap; row-gap: 8px; }
  .seo__links { order: 3; flex-basis: 100%; gap: 16px; }
  .seo__signin { margin-left: auto; }
}

.seo__crumbs { font-size: 13px; color: var(--text-muted); margin: 14px 0 0; }
.seo__crumbs a { text-decoration: none; }

/* Page head */
.seo__head { padding: 36px 0 28px; border-bottom: 1px solid var(--border); }
.seo__kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.seo__head h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 750; }
.seo__lede { font-size: 18px; color: var(--text-muted); margin-top: 14px; max-width: 640px; }
.seo__head .seo__stores { margin-top: 22px; }
.seo__muted { color: var(--text-muted); font-size: 14px; }
.seo__small { font-size: 13px; color: var(--text-faint); }

/* Sections */
.seo__section { padding: 28px 0; border-bottom: 1px solid var(--border); }
.seo__section > h2, .seo__proscons h2 { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.seo__section h3 { font-size: 16px; font-weight: 650; margin-bottom: 4px; }
.seo__section p + p { margin-top: 8px; }

.seo__ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.seo__ticks li { position: relative; padding-left: 22px; }
.seo__ticks li::before { content: ""; position: absolute; left: 2px; top: 0.58em; width: 8px; height: 8px; border-radius: 50%; background: var(--data-3); }
.seo__ticks--other li::before { background: var(--text-faint); }

.seo__steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 18px; }
.seo__steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.seo__steps li::before { content: counter(step); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.seo__steps p { color: var(--text-muted); }

.seo__numbered { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.seo__numbered li::marker { color: var(--text-muted); font-weight: 600; }

.seo__points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 28px; }
.seo__points p { color: var(--text-muted); }

/* Screenshot and exercise media */
.seo__shot { margin: 28px auto 4px; width: min(300px, 80%); border-radius: 36px; overflow: hidden; border: 8px solid var(--device); background: var(--device); }
.seo__shot img, .seo__shot video { display: block; width: 100%; height: auto; }
.seo__video { margin: 28px 0 4px; }
.seo__video .seo__shot { margin-top: 0; }
.seo__video figcaption { margin: 12px auto 0; max-width: 34ch; text-align: center; font-size: 14px; color: var(--text-muted); }
.seo__media { margin: 24px 0 0; width: min(420px, 100%); aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--media-bg); }
.seo__media video, .seo__media img { width: 100%; height: 100%; object-fit: cover; }
.seo__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.seo__facts .seo__kicker { margin-bottom: 4px; }
@media (max-width: 560px) { .seo__facts { grid-template-columns: 1fr 1fr; } }

.seo__mistakes { margin: 0; display: grid; gap: 14px; }
.seo__mistakes dt { font-weight: 650; }
.seo__mistakes dd { margin: 2px 0 0; color: var(--text-muted); }

/* FAQ */
.seo__faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.seo__faq details:first-child { border-top: 1px solid var(--border); }
.seo__faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.seo__faq summary::-webkit-details-marker { display: none; }
.seo__faq summary::after { content: "+"; color: var(--text-muted); font-weight: 400; font-size: 20px; line-height: 1; }
.seo__faq details[open] summary::after { content: "−"; }
.seo__faq details p { margin-top: 8px; color: var(--text-muted); }

.seo__sources ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--text-muted); }
.seo__related { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seo__related a { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); text-decoration: none; font-size: 14px; }

/* Sample week */
.seo__week { display: grid; gap: 0; margin-top: 16px; }
.seo__day { padding: 16px 0; border-top: 1px solid var(--border); }
.seo__day header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.seo__day h3 { font-size: 16px; min-width: 92px; }
.seo__day header p { color: var(--text-muted); font-size: 14px; }
.seo__day--rest header { margin: 0; }
.seo__day--rest h3, .seo__day--rest header p { color: var(--text-faint); }
.seo__day table, .seo__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.seo__day table { table-layout: fixed; }
.seo__day th:first-child { width: 58%; }
.seo__day th:nth-child(2) { width: 12%; }
.seo__day th { text-align: left; font-weight: 500; color: var(--text-faint); font-size: 12px; padding: 4px 8px 4px 0; }
.seo__day td { padding: 8px 8px 8px 0; border-top: 1px solid var(--border); vertical-align: top; }
.seo__day td:not(:first-child) { white-space: nowrap; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.seo__day td small, .tool__name small, .tool__dose small { display: block; color: var(--text-muted); font-size: 12px; }
.seo__daynote { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* Comparison */
.seo__verdict { padding: 24px 0; border-bottom: 1px solid var(--border); font-size: 17px; }
.seo__verdict .seo__muted { margin-top: 10px; }
.seo__tablewrap { overflow-x: auto; }
.seo__table th, .seo__table td { text-align: left; padding: 10px 10px 10px 0; border-top: 1px solid var(--border); vertical-align: top; }
.seo__table thead th { border-top: 0; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.seo__table tbody th { font-weight: 600; width: 28%; }
.seo__table td:nth-child(2) { width: 36%; }
.seo__proscons { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.seo__apps { list-style: none; padding: 0; margin: 0; display: grid; }
.seo__apps > li { padding: 20px 0; border-top: 1px solid var(--border); }
.seo__apps h3 { font-size: 19px; }
.seo__apps .seo__proscons { margin-top: 12px; font-size: 15px; }
.seo__apps ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-muted); display: grid; gap: 4px; }
.seo__pc { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px; }
.seo__pc::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.seo__pc--good::before { background: var(--data-3); }
.seo__pc--bad::before { background: var(--data-1); }

/* Hubs */
.seo__cards { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; }
.seo__cards > li { border-bottom: 1px solid var(--border); }
.seo__cards a { display: flex; gap: 14px; align-items: center; padding: 16px 0; text-decoration: none; }
.seo__cards strong { display: block; font-weight: 650; }
.seo__cards small { display: block; color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.seo__cards img { width: 64px; height: 64px; border-radius: var(--radius-md); object-fit: cover; background: var(--media-bg); flex: none; }
.seo__cards a:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* Call to action and store badges */
.seo__cta { margin: 32px 0 8px; padding: 32px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.seo__cta h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 750; }
.seo__cta p { color: var(--text-muted); margin: 10px 0 20px; max-width: 560px; }
/* Buttons */
.seo__btn { appearance: none; border: 0; border-radius: 12px; padding: 13px 18px; font: inherit; font-weight: 650; cursor: pointer; background: var(--action); color: var(--action-text); }
.seo__btn--secondary { background: var(--surface-2); color: var(--text); }
.seo__btn:disabled { opacity: 0.6; cursor: default; }

/* The free tool */
.seo__toolbox { padding-top: 8px; }
.tool__form { display: grid; gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.tool__q { border: 0; margin: 0; padding: 0; min-width: 0; }
.tool__q legend { font-weight: 650; font-size: 15px; margin-bottom: 8px; padding: 0; }
.tool__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tool__chip { appearance: none; border: 1px solid var(--border-strong); background: transparent; color: var(--text); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 15px; cursor: pointer; }
.tool__chip[aria-checked="true"] { background: var(--action); border-color: var(--action); color: var(--action-text); }
.tool__result { padding: 24px 0; border-bottom: 1px solid var(--border); }
.tool__result h2 { font-size: 28px; font-weight: 750; }
.tool__facts { display: flex; gap: 14px; color: var(--text-muted); font-size: 14px; margin-top: 8px; }
.tool__facts span + span::before { content: "·"; margin-right: 14px; }
.tool__why { margin: 16px 0 0; padding-left: 18px; color: var(--text-muted); display: grid; gap: 6px; }
.tool__warm { margin-top: 16px; font-size: 15px; }
.tool__list { list-style: none; margin: 16px 0 0; padding: 0; }
.tool__ex { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--border); }
.tool__n { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 14px; }
.tool__name a { font-weight: 600; }
.tool__name { font-weight: 600; }
.tool__dose { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tool__ai { padding: 20px 0 0; display: grid; gap: 10px; justify-items: start; }
.tool__check:empty { display: none; }
.small { font-size: 14px; }
.muted { color: var(--text-muted); }

/* Footer */
.seo__footer { border-top: 1px solid var(--border); padding: 32px 20px calc(32px + var(--safe-b)); }
.seo__footcols { max-width: 860px; margin: 0 auto 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 24px; }
.seo__footcols div { display: grid; gap: 6px; align-content: start; font-size: 14px; color: var(--text-muted); }
.seo__footcols a { text-decoration: none; }
.seo__footcols a:hover { color: var(--text); }
.seo__foothead { font-weight: 650; color: var(--text); margin-bottom: 4px; }
.seo__footer > .seo__small { max-width: 860px; margin: 0 auto; }

/* Blog */
.seo__prose p { max-width: 680px; }
.seo__prose p + p { margin-top: 12px; }
.seo__bullets { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; max-width: 680px; }
.seo__bullets li::marker { color: var(--text-faint); }
.seo__prose .seo__tablewrap { margin-top: 16px; }
.seo__table--data th, .seo__table--data td { font-size: 14px; }
.seo__table--data td:nth-child(2) { width: auto; }
.seo__table--data td { color: var(--text-muted); }
.seo__table--data td:first-child { color: var(--text); }
.seo__posts { list-style: none; margin: 8px 0 0; padding: 0; }
.seo__posts li { border-bottom: 1px solid var(--border); }
.seo__posts a { display: grid; gap: 4px; padding: 20px 0; text-decoration: none; }
.seo__posts small { font-size: 13px; color: var(--text-faint); }
.seo__posts strong { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.seo__posts span { color: var(--text-muted); font-size: 15px; }
.seo__posts a:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* Glossary hub */
.seo__az { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 18px 0; border-bottom: 1px solid var(--border); font-weight: 600; }
.seo__az a { text-decoration: none; color: var(--text-muted); }
.seo__az a:hover { color: var(--text); }
.seo__glossary { margin: 0; display: grid; gap: 16px; }
.seo__glossary dt { font-weight: 650; }
.seo__glossary dd { margin: 2px 0 0; color: var(--text-muted); max-width: 680px; }

/* Auto-linked terms: a dotted underline says "there's more here"; the popover floats, so it may have a shadow */
a.term { text-decoration: underline dotted; text-decoration-color: var(--text-faint); text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: help; }
a.term:hover, a.term[aria-expanded="true"] { text-decoration-color: var(--text); }
.tpop { position: absolute; z-index: 20; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 8px 28px color-mix(in srgb, var(--device) 22%, transparent); font-size: 14px; line-height: 1.45; }
.tpop img { width: 72px; height: 72px; flex: none; border-radius: var(--radius-sm); object-fit: cover; background: var(--media-bg); }
.tpop p { margin: 0; }
.tpop__k { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.tpop__t { font-weight: 650; font-size: 15px; margin-top: 2px !important; }
.tpop__d { color: var(--text-muted); margin-top: 4px !important; }
.tpop__m { color: var(--text-muted); font-size: 13px; margin-top: 6px !important; }
.tpop__more { display: inline-block; margin-top: 8px; font-weight: 600; text-decoration: none; padding: 4px 0; }
.tpop__more:hover { text-decoration: underline; }

/* Calculators (/tools/*: src/seo/calc) */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; padding: 8px 0 28px; border-bottom: 1px solid var(--border); }
@media (max-width: 720px) { .calc { grid-template-columns: 1fr; } }
.calc__fields { display: grid; gap: 12px; }
.calc__f { display: flex; flex-direction: column; gap: 6px; }
.calc__f span { font-size: 14px; color: var(--text-muted); }
.calc__f input, .calc__f select { font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-md); padding: 11px 12px; width: 100%; box-sizing: border-box; }
.calc__f input:focus-visible, .calc__f select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.calc__out { min-width: 0; }
.calc__big { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.calc__big b { font-size: clamp(36px, 6vw, 52px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.calc__big span { font-size: 15px; color: var(--text-muted); }
.calc__sub { margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: var(--text-muted); }
.calc__none { margin: 0; color: var(--text-muted); }
.calc__plates { list-style: none; margin: 8px 0 0; padding: 0; }
.calc__plates li { padding: 8px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.calc__table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.calc__table th, .calc__table td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); }
.calc__table thead th { font-weight: 600; color: var(--text-muted); }
.calc__scroll { overflow-x: auto; }
.calc__chart { min-width: 560px; }
.calc__chart tbody th { font-weight: 650; }
