/* g61 + g69 comparison and tool pages. Sits on top of /_style.css, /guide/guide.css, /seo.css and /level-preview.css.
   Theme tokens only; no state is shown by color alone (every badge and tile carries its words). */

/* Feature matrix */
.mx td, .mx th { vertical-align: top; }
.mx .tag { display: inline-block; margin: 0 6px 4px 0; padding: 3px 10px; border-radius: 999px; font: 700 .78rem/1.4 var(--font-body); white-space: nowrap; border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface-subtle); }
.mx .tag.yes { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.mx .tag.yes::before { content: "✓ "; }
.mx .tag.unk { border-style: dashed; color: var(--ink2); background: transparent; }
.mx .tag.unk::before { content: "? "; }
.mx td small { margin-top: 4px; }
.mx-key { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0 0; font-size: var(--text-sm); color: var(--ink2); }
.mx-key span { display: inline-flex; align-items: center; gap: 6px; }

/* Hero strip for tool pages */
.tool-lede { font-size: 1.12rem; line-height: 1.55; color: var(--ink2); margin: 10px 0 0; max-width: 62ch; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 12px; }
.steps li { counter-increment: s; position: relative; margin: 0; padding: 18px 18px 18px 58px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font: 800 .95rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.steps b { display: block; font-family: var(--font-display); color: var(--ink); }
.steps span { display: block; margin-top: 4px; font-size: var(--text-sm); line-height: 1.5; color: var(--ink2); }

/* Half-life visualizer (reuses the .lvl card) */
.lvl.hlv .g-area { fill: url(#hlvFill); }
.hlv .lvl-read { align-items: flex-start; }
.hlv-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin: 12px 0 0; }
.hlv-controls label, .tool-field { display: block; padding: 12px 14px; border-radius: 16px; background: var(--stat); font: 700 .85rem/1.3 var(--font-body); color: var(--ink2); }
.hlv-controls input[type="date"], .hlv-controls input[type="number"], .tool-field input { display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font: 600 1rem/1 var(--font-body); font-variant-numeric: tabular-nums; }
.hlv-controls input[type="range"] { display: block; width: 100%; min-height: 44px; margin-top: 2px; accent-color: var(--primary); }
.hlv-controls output { display: block; margin-top: 2px; font: 800 1.1rem/1.2 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.hlv-controls input:focus-visible, .tool-field input:focus-visible, .tool-btn:focus-visible, .rot button:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.tool-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: 600 .9rem/1 var(--font-body); cursor: pointer; }
.tool-btn.solid { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 700; }
.tool-btn:hover { border-color: var(--primary); }
.hlv-miles { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 10px; }
.hlv-miles li { margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--stat); max-width: none; }
.hlv-miles b { display: block; font: 800 1rem/1.25 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.hlv-miles span { display: block; margin-top: 4px; font-size: .85rem; line-height: 1.4; color: var(--ink2); font-variant-numeric: tabular-nums; }
.tool-private { margin: 10px 0 0; font-size: .85rem; color: var(--ink2); }

/* Tool card shared by the rotation helper, the freshness clock and the protein tally */
.tool { margin: 24px 0; padding: 22px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink);
  background: radial-gradient(120% 90% at 100% 0%, var(--frostbg) 0%, transparent 55%), var(--card); box-shadow: 0 1px 0 var(--line), 0 18px 40px -18px var(--pop-shadow); }
.tool * { box-sizing: border-box; }
.tool-k { margin: 0 0 12px; font: 700 .78rem/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.tool-k b { display: block; margin-top: 4px; font-size: 1.25rem; letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.tool-read { min-height: 44px; margin: 12px 0 0; font: 600 1rem/1.4 var(--font-body); color: var(--ink); font-variant-numeric: tabular-nums; }
.tool-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }

/* Site rotation helper: a 2 x 2 belly pad around a navel hub, then thighs and arms. No anatomy. */
.rot-pad { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 460px; margin: 0 auto; }
/* DOM order is the rotation order (1, 2, 3, 4 clockwise); the grid shows 4 under 1 and 3 under 2 */
.rot-pad .n1 { order: 1; } .rot-pad .n2 { order: 2; } .rot-pad .n4 { order: 3; } .rot-pad .n3 { order: 4; }
.rot-pad .n2, .rot-pad .n3 { text-align: right; }
.rot-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 460px; margin: 10px auto 0; }
.rot button { min-height: 92px; padding: 12px 14px; text-align: left; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .16s var(--ease-out), transform .16s var(--ease-out), box-shadow .16s var(--ease-out); }
.rot button:active { transform: scale(.98); }
.rot button em { font-style: normal; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--stat); color: var(--ink); font: 800 .85rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.rot button b { display: block; margin-top: 6px; font: 700 1rem/1.2 var(--font-display); }
.rot button .rot-state { display: block; margin-top: 4px; font-size: .85rem; color: var(--ink2); }
.rot button.is-next { border-color: var(--primary); box-shadow: 0 0 0 3px var(--frostbg); }
.rot button.is-next em { background: var(--primary); color: var(--on-primary); }
.rot button.is-next .rot-state { color: var(--primary); font-weight: 700; }
.rot-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 50%; border: 1.5px dashed var(--line-strong); background: var(--canvas); display: grid; place-items: center; font: 600 .8rem/1 var(--font-body); color: var(--ink2); pointer-events: none; }
.rot-cap { text-align: center; margin: 12px 0 0; font: 600 var(--text-sm)/1.4 var(--font-body); color: var(--ink2); max-width: none; }

/* Freshness clock */
.fresh-big { margin: 14px 0 6px; font: 800 clamp(1.6rem, 4vw, 2.1rem)/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fresh-bar { height: 12px; border-radius: 999px; background: var(--stat); overflow: hidden; }
.fresh-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--primary); transition: width .4s var(--ease-out); }
.fresh-nudge { margin: 6px 0 0; font-size: var(--text-sm); color: var(--ink2); }

/* Protein tally */
.tally { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; align-items: center; }
.tally-ring { width: 140px; height: 140px; transform: rotate(-90deg); }
.tally-ring circle { fill: none; stroke-width: 12; }
.tally-ring .bg { stroke: var(--stat); }
.tally-ring .fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease-out); }
.tally-big { margin: 0; font: 800 1.9rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.tally-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tally-list li { margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--stat); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Links between the ten pages */
.also { margin: 28px 0 0; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-subtle); font-size: var(--text-sm); line-height: 1.9; color: var(--ink2); }
.also b { display: block; font-family: var(--font-display); color: var(--ink); }
.also a { white-space: nowrap; }

@media (max-width: 560px) {
  .tool { padding: 18px 14px; border-radius: 20px; }
  .tally { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .rot button { min-height: 84px; padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .fresh-bar i, .tally-ring .fg, .rot button { transition: none; }
}
@media print {
  .tool, .lvl, .also { break-inside: avoid; }
}
