/* ============================================================
   Cycling & Fitness category skin
   Loaded only by /cycling-*.html, /commute-cost-calculator.html,
   /bike-frame-size-calculator.html and /gear-ratio-calculator.html.
   Prefix every class with cy- so nothing leaks into other tools.
   ============================================================ */

.cy-page {
    --cy-brand: #0f7b6c;
    --cy-brand-dark: #0a5c50;
    --cy-ink: #101c30;
    --cy-ink-soft: #3c4c66;
    --cy-muted: #5f7089;
    --cy-line: #e1e9f3;
    --cy-surface: #f6faf9;
    --cy-shadow: 0 1px 2px rgba(16, 32, 56, 0.05), 0 18px 40px -30px rgba(16, 32, 56, 0.5);
}

/* ---------- card & fields ---------- */

.cy-page .dev-tool-card {
    position: relative;
    padding: 26px;
    border: 1px solid var(--cy-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--cy-shadow);
}
.cy-page .dev-tool-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, var(--cy-brand) 0%, #34a853 100%);
}

/* ---------- grouped inputs ---------- */

/* The three-column sidebar layout leaves ~486px for the form at 1280px, while the
   stacked layout at 1024px leaves ~910px. Fixed 3 columns crushed long labels in the
   narrow case, so each group now uses auto-fit columns and the fields are grouped by
   topic rather than presented as one flat list. */

.cy-inputs-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    margin-bottom: 16px;
}
.cy-inputs-head .cy-note { flex: 1 1 220px; margin: 0; }

/* Currency is a display preference, kept apart from the actual cost inputs. */
.cy-display-setting {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cy-ink-soft);
    white-space: nowrap;
}
.cy-display-setting select.dev-tool-input {
    width: auto;
    min-width: 92px;
    height: 38px;
    padding: 0 32px 0 11px;
    border: 1px solid #d9e2ee;
    border-radius: 9px;
    background-color: #fbfcfe;
    font-size: 13px;
    font-weight: 600;
    color: var(--cy-ink);
    cursor: pointer;
}

.cy-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.cy-field-group {
    min-width: 0;
    margin: 0;
    padding: 12px 15px 16px;
    border: 1px solid var(--cy-line);
    border-radius: 13px;
    background: var(--cy-surface);
}
.cy-field-group--full { grid-column: 1 / -1; }

/* Float + clear turns the legend into a plain block heading while keeping the
   fieldset/legend grouping that screen readers announce. */
.cy-field-group legend {
    display: block;
    float: left;
    width: 100%;
    box-sizing: border-box;
    padding: 0 0 10px;
    margin: 0 0 13px;
    border-bottom: 1px solid #e2eee9;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cy-brand-dark);
}
.cy-group-fields {
    clear: both;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 14px;
}
.cy-group-fields .dev-tool-label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cy-ink-soft);
}
/* Reserve two lines for every label so the inputs line up even when one wraps. */
.cy-group-fields .dev-tool-label > span:first-child {
    min-height: 2.5em;
    line-height: 1.3;
}
.cy-group-fields .dev-tool-input {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d9e2ee;
    border-radius: 10px;
    background-color: #fbfcfe;
    font-size: 15px;
    font-weight: 500;
    color: var(--cy-ink);
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.cy-group-fields .dev-tool-input:hover { border-color: #c3d2e5; background-color: #fff; }
.cy-group-fields .dev-tool-input:focus {
    outline: none;
    border-color: var(--cy-brand);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(15, 123, 108, 0.14);
}
.cy-group-fields select.dev-tool-input,
.cy-display-setting select.dev-tool-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%235f7089' d='M0 1h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
    padding-right: 34px;
    cursor: pointer;
}
[dir="rtl"] .cy-group-fields select.dev-tool-input,
[dir="rtl"] .cy-display-setting select.dev-tool-input {
    background-position: left 12px center;
    padding-right: 12px;
    padding-left: 34px;
}

.cy-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    padding: 9px 13px;
    border: 1px solid #d8ece7;
    border-radius: 10px;
    background: #f2faf8;
    font-size: 13px;
    line-height: 1.45;
    color: var(--cy-brand-dark);
}
.cy-note[hidden] { display: none; }
.cy-note::before {
    content: "i";
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1.5px #b6dcd4;
    color: var(--cy-brand);
    font: 700 11.5px/1 Georgia, serif;
}

/* Inline validation hint (role=status, shown only when inputs are invalid) */
.cy-hint {
    margin: 0 0 14px;
    padding: 9px 13px;
    border: 1px solid #f3d8a8;
    border-radius: 10px;
    background: #fdf7ea;
    font-size: 12.5px;
    line-height: 1.5;
    color: #8a5300;
}
.cy-hint[hidden] { display: none; }

/* Shown when JavaScript is disabled, before the tool card. */
.cy-noscript { margin-bottom: 14px; }

/* ---------- results ---------- */

.cy-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border: 1px solid #dfeae7;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfefd, #f3faf8);
}
.cy-results > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cy-results b {
    font-size: 21px;
    font-weight: 700;
    color: var(--cy-ink);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.cy-results span { font-size: 11.5px; line-height: 1.35; color: var(--cy-muted); }

.cy-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px 18px;
    margin-top: 14px;
    border: 1px solid var(--cy-line);
    border-radius: 14px;
    background: #fff;
}
.cy-summary b {
    display: block;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cy-brand-dark);
    font-variant-numeric: tabular-nums;
}
.cy-summary span { font-size: 11.5px; color: var(--cy-muted); }

/* pure-CSS comparison bars */
.cy-bars { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.cy-bar {
    display: grid;
    grid-template-columns: minmax(78px, 110px) 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--cy-ink-soft);
}
.cy-bar-track {
    height: 12px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}
.cy-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.35s ease;
}
/* Traffic-light colours belong to comparison charts only. Rider-level bars define
   their own colours, so excluding .cy-levels keeps rows 4-7 from staying transparent. */
.cy-bars:not(.cy-levels) .cy-bar:nth-child(1) .cy-bar-fill { background: #e06666; }
.cy-bars:not(.cy-levels) .cy-bar:nth-child(2) .cy-bar-fill { background: #f2b135; }
.cy-bars:not(.cy-levels) .cy-bar:nth-child(3) .cy-bar-fill { background: var(--cy-brand); }
.cy-bar-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--cy-ink);
    white-space: nowrap;
}

/* ---------- shared output extras ---------- */

/* Small section heading used inside the tool card (food list, cassette table,
   rider levels). Keeps the card's own typography instead of borrowing .seo-* styles. */
.cy-subhead {
    margin: 20px 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cy-muted);
}

/* Food equivalence list: compact chips, not a table, so the card stays short. */
.cy-foods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cy-foods li {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 7px 12px;
    border: 1px solid #dbe8e4;
    border-radius: 999px;
    background: #fff;
    font-size: 12.5px;
    color: var(--cy-muted);
}
.cy-foods b {
    font-size: 14px;
    color: var(--cy-brand-dark);
    font-variant-numeric: tabular-nums;
}

/* Drinking-plan list (before / during / after). */
.cy-plan {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cy-plan li {
    padding: 10px 13px;
    border: 1px solid var(--cy-line);
    border-radius: 10px;
    background: #fbfdfc;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--cy-ink-soft);
}
.cy-plan strong {
    display: block;
    margin-bottom: 2px;
    font-size: 12.5px;
    color: var(--cy-brand-dark);
}
.cy-plan b {
    color: var(--cy-ink);
    font-variant-numeric: tabular-nums;
}

/* Tables inside the card: the cassette table can be wider than the column. */
.cy-page .seo-table-wrap { overflow-x: auto; margin: 12px 0; }
.cy-page .seo-table { margin: 0; font-size: 13px; }
.cy-page .seo-table th,
.cy-page .seo-table td { padding: 7px 9px; }

/* Rider level bars: the current band is highlighted without changing the
   traffic-light colours used by every other .cy-bars block. */
.cy-levels .cy-bar { grid-template-columns: minmax(96px, 130px) 1fr auto; }
/* Only the first three rows get a traffic-light colour from the shared rule; the
   rider-level rows beyond that would otherwise render a transparent fill. */
.cy-levels .cy-bar-fill { background: #d4e5e0; }

/* Arabic pages run right-to-left: without isolation the neutral space between a
   number and its Latin unit flips the pair, so "52.4 km/h" renders as "km/h 52.4".
   Values are isolated as a left-to-right run; the element keeps the inherited
   alignment, so the block stays where the RTL layout puts it. */
[dir="rtl"] .cy-results b,
[dir="rtl"] .cy-summary b,
[dir="rtl"] .cy-foods b,
[dir="rtl"] .cy-plan b,
[dir="rtl"] .cy-bar > span:last-child,
[dir="rtl"] .cy-calorie-hero b,
[dir="rtl"] .cy-calorie-meta b,
[dir="rtl"] .cy-food-chip b,
[dir="rtl"] .cy-hyd-hero b,
[dir="rtl"] .cy-pwr-hero b,
[dir="rtl"] .cy-pwr-gap b,
[dir="rtl"] .cy-gear-stats b,
[dir="rtl"] .cy-gear-pair,
[dir="rtl"] .cy-frame-dims dd,
[dir="rtl"] .cy-standover-text,
[dir="rtl"] .cy-payback-head b {
    direction: ltr;
    unicode-bidi: isolate;
}
.cy-levels .cy-bar.is-current span:first-child { color: var(--cy-brand-dark); font-weight: 700; }
.cy-levels .cy-bar-value { font-size: 12px; }

/* ---------- shared hero blocks ---------- */

/* The answer is the headline: one oversized number, then the supporting figures. */
.cy-calorie-hero,
.cy-hyd-hero,
.cy-pwr-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    padding: 20px;
    border: 1px solid #dfeae7;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfefd, #f3faf8);
}
.cy-calorie-hero b,
.cy-hyd-hero b,
.cy-pwr-hero b {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--cy-ink);
    font-variant-numeric: tabular-nums;
}
.cy-calorie-hero span,
.cy-hyd-hero > span,
.cy-pwr-unit {
    font-size: 13px;
    color: var(--cy-muted);
}
.cy-pwr-unit { font-size: 16px; color: var(--cy-brand-dark); font-weight: 600; }
.cy-pwr-level-name {
    flex-basis: 100%;
    font-size: 14px;
    font-weight: 700;
    color: var(--cy-brand-dark);
}
.cy-pwr-equiv {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--cy-muted);
}
.cy-pwr-equiv[hidden] { display: none; }

/* Small metric row under the hero number. */
.cy-calorie-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px 16px;
    margin-top: 12px;
    padding: 12px 16px;
    border: 1px solid var(--cy-line);
    border-radius: 12px;
    background: #fff;
}
.cy-calorie-meta > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cy-calorie-meta b { font-size: 18px; color: var(--cy-ink); font-variant-numeric: tabular-nums; }
.cy-calorie-meta em { font-style: normal; font-size: 11.5px; line-height: 1.35; color: var(--cy-muted); }

/* Food equivalents: horizontally scrollable chips with a large anchor emoji. */
.cy-food-chips {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}
.cy-food-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #dbe8e4;
    border-radius: 12px;
    background: #fff;
    scroll-snap-align: start;
}
.cy-food-chip > span[aria-hidden] { font-size: 18px; line-height: 1; }
.cy-food-chip b { font-size: 16px; color: var(--cy-brand-dark); font-variant-numeric: tabular-nums; }
.cy-food-chip > span:last-child { font-size: 12px; color: var(--cy-muted); }

/* Segmented radio group (terrain, intensity, duration, riding style). */
.cy-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--cy-line);
    border-radius: 11px;
    background: #f4f8f6;
}
.cy-segmented label { position: relative; display: inline-flex; }
.cy-segmented input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.cy-segmented span {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cy-ink-soft);
    white-space: nowrap;
}
.cy-segmented input:checked + span {
    background: #fff;
    color: var(--cy-brand-dark);
    box-shadow: 0 1px 3px rgba(16, 32, 56, 0.14);
}
.cy-segmented input:focus-visible + span { outline: 2px solid var(--cy-brand); outline-offset: 1px; }
.cy-segmented--block { display: flex; }

/* ---------- gear hero ---------- */
.cy-gear-hero {
    padding: 18px 20px;
    border: 1px solid #dfeae7;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfefd, #f3faf8);
}
.cy-gear-pair {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cy-ink);
    font-variant-numeric: tabular-nums;
}
.cy-gear-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.cy-gear-stats > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cy-gear-stats b { font-size: 20px; color: var(--cy-ink); font-variant-numeric: tabular-nums; }
.cy-gear-stats span { font-size: 11.5px; color: var(--cy-muted); }

/* Cassette table: the current sprocket follows the numbers you typed. */
.cy-cassette-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cy-cassette-table th,
.cy-cassette-table td { padding: 7px 9px; text-align: end; border-bottom: 1px solid #eef2f7; }
.cy-cassette-table th:first-child,
.cy-cassette-table td:first-child { text-align: start; }
.cy-cassette-table tr.is-current td { background: #eef8f4; font-weight: 700; color: var(--cy-brand-dark); }
.cy-cassette-table tr:nth-child(1) td,
.cy-cassette-table tr:last-child td { font-weight: 600; }

/* Tag input for the cassette. */
.cy-tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid #d9e2ee;
    border-radius: 10px;
    background: #fbfcfe;
}
.cy-tag-input:focus-within { border-color: var(--cy-brand); background: #fff; box-shadow: 0 0 0 4px rgba(15, 123, 108, 0.14); }
.cy-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 4px 3px 8px;
    border-radius: 7px;
    background: #eef6f3;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cy-brand-dark);
    font-variant-numeric: tabular-nums;
}
.cy-tag button {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #6b7c8f;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}
.cy-tag button:hover { background: #d9ece6; color: var(--cy-brand-dark); }
.cy-tag-field {
    flex: 1 1 90px;
    min-width: 80px;
    height: 30px;
    border: 0;
    background: transparent;
    font-size: 14px;
    color: var(--cy-ink);
    outline: none;
}
.cy-tag-hint { display: block; margin-top: 4px; font-size: 11px; line-height: 1.35; color: var(--cy-muted); }
.cy-tag-hint[hidden] { display: none; }
.cy-unit-hint { font-weight: 600; color: var(--cy-brand-dark); }
.dev-tool-input[readonly] { background: #f3f6fb; color: var(--cy-muted); cursor: default; }

/* ---------- frame size ---------- */
.cy-frame-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid #dfeae7;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfefd, #f3faf8);
}
.cy-frame-size-badge {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 96px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--cy-brand);
    color: #fff;
}
.cy-frame-size-badge b { font-size: 36px; line-height: 1; letter-spacing: -0.02em; }
.cy-frame-size-badge span { margin-top: 4px; font-size: 10.5px; text-align: center; opacity: 0.9; }
.cy-frame-dims { flex: 1 1 240px; display: grid; gap: 8px; margin: 0; }
.cy-frame-dims > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px dashed #e6eef7; padding-bottom: 6px; }
.cy-frame-dims > div:last-child { border-bottom: 0; padding-bottom: 0; }
.cy-frame-dims dt { font-size: 12px; color: var(--cy-muted); }
.cy-frame-dims dd { margin: 0; font-size: 16px; font-weight: 700; color: var(--cy-ink); font-variant-numeric: tabular-nums; }

.cy-standover-check { margin-top: 14px; }
.cy-standover-check > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--cy-ink-soft); }
.cy-standover-text { margin: 6px 0 0; font-size: 12.5px; color: var(--cy-ink-soft); font-variant-numeric: tabular-nums; }

.cy-bike-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cy-bike-type-grid label { position: relative; display: inline-flex; }
.cy-bike-type-grid input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cy-bike-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border: 1px solid #d9e2ee;
    border-radius: 10px;
    background: #fbfcfe;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cy-ink-soft);
}
.cy-bike-option > span[aria-hidden] { font-size: 15px; line-height: 1; }
.cy-bike-type-grid input:checked ~ .cy-bike-option {
    border-color: var(--cy-brand);
    background: #eef8f4;
    color: var(--cy-brand-dark);
}
.cy-bike-type-grid input:focus-visible ~ .cy-bike-option { outline: 2px solid var(--cy-brand); outline-offset: 1px; }

/* ---------- hydration timeline ---------- */
.cy-hyd-rate { flex-basis: 100%; font-size: 13px; color: var(--cy-ink-soft); }
.cy-hyd-rate b { font-size: 15px; font-weight: 700; color: var(--cy-brand-dark); }
.cy-hyd-timeline {
    position: relative;
    margin: 16px 0 0;
    padding: 0 0 0 16px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cy-hyd-timeline::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    inset-inline-start: 4px;
    width: 2px;
    border-radius: 2px;
    background: #dbeae5;
}
.cy-hyd-step {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 9px 12px;
    border: 1px solid var(--cy-line);
    border-radius: 10px;
    background: #fbfdfc;
}
.cy-hyd-step::before {
    content: "";
    position: absolute;
    inset-inline-start: -14px;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 2px #b6dcd4;
}
.cy-hyd-step--during::before { background: var(--cy-brand); box-shadow: inset 0 0 0 2px var(--cy-brand); }
.cy-hyd-when { font-size: 12px; font-weight: 700; color: var(--cy-brand-dark); white-space: nowrap; }
.cy-hyd-what { font-size: 12.5px; line-height: 1.5; color: var(--cy-ink-soft); }
.cy-hyd-detail { margin-inline-start: auto; font-size: 12.5px; color: var(--cy-ink-soft); }
.cy-hyd-detail b { font-size: 14px; color: var(--cy-ink); font-variant-numeric: tabular-nums; }

.cy-slider { width: 100%; accent-color: var(--cy-brand); height: 22px; }

/* ---------- commute payback timeline ---------- */
.cy-payback {
    margin-top: 14px;
    padding: 16px 18px;
    border: 1px solid var(--cy-line);
    border-radius: 14px;
    background: #fff;
}
.cy-payback-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cy-payback-head b { font-size: 26px; letter-spacing: -0.01em; color: var(--cy-brand-dark); font-variant-numeric: tabular-nums; }
.cy-payback-head span { font-size: 12px; color: var(--cy-muted); }
.cy-payback-track {
    position: relative;
    height: 10px;
    margin: 14px 0 6px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: visible;
}
.cy-payback-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #34a853, var(--cy-brand));
    transition: width 0.35s ease;
}
.cy-payback-marker {
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 2px var(--cy-brand);
    transition: left 0.35s ease;
}
.cy-payback-marker.is-over { box-shadow: 0 0 0 2px #e06666; }
.cy-payback-scale {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--cy-muted);
    font-variant-numeric: tabular-nums;
}
.cy-payback-text { margin: 8px 0 0; font-size: 13px; color: var(--cy-ink-soft); }

/* ---------- pwr gap cards ---------- */
.cy-pwr-gap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.cy-pwr-gap > div {
    padding: 12px 14px;
    border: 1px solid var(--cy-line);
    border-radius: 12px;
    background: #fff;
}
.cy-pwr-gap b { display: block; font-size: 22px; color: var(--cy-brand-dark); font-variant-numeric: tabular-nums; }
.cy-pwr-gap span { font-size: 11.5px; color: var(--cy-muted); }
.cy-pwr-climb { margin: 12px 0 0; font-size: 13px; color: var(--cy-ink-soft); }
.cy-pwr-climb b { font-size: 20px; color: var(--cy-ink); font-variant-numeric: tabular-nums; }
.cy-pwr-climb em { font-style: normal; color: var(--cy-muted); }

/* ---------- page blocks ---------- */

.cy-page .section-title {
    gap: 12px;
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cy-ink);
}
.cy-page .section-title svg {
    width: 22px;
    height: 22px;
    padding: 8px;
    box-sizing: content-box;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #17a08c, var(--cy-brand));
    flex: none;
}
.cy-page .section-subtitle {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--cy-muted);
}

.cy-formula {
    margin-top: 22px;
    border: 1px solid var(--cy-line);
    border-radius: 12px;
    background: #fbfcfe;
}
.cy-formula > summary {
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--cy-ink-soft);
}
.cy-formula > summary::-webkit-details-marker { display: none; }
.cy-formula > summary::before {
    content: "+";
    display: inline-block;
    width: 14px;
    color: var(--cy-brand);
    font-weight: 700;
}
.cy-formula[open] > summary::before { content: "−"; }
.cy-formula-body {
    padding: 0 16px 16px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--cy-muted);
}
.cy-formula-body code {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 5px;
    background: #eef4fb;
    color: var(--cy-ink-soft);
    font-size: 12px;
}

/* Worked example inside the formula disclosure */
.cy-worked {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cy-worked li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e6eef7;
    font-size: 12.5px;
    color: var(--cy-ink-soft);
}
.cy-worked li:last-child { border-bottom: 0; }
.cy-worked code {
    font-size: 12px;
    color: var(--cy-brand-dark);
    background: #eef6f3;
    padding: 2px 6px;
    border-radius: 5px;
    font-variant-numeric: tabular-nums;
}

/* Tools that are announced but not built yet: shown, not clickable */
.cy-related-soon li { display: inline-flex; align-items: center; gap: 7px; }
.cy-soon {
    padding: 7px 12px;
    border: 1px dashed #dbe8e4;
    border-radius: 999px;
    background: #fbfdfc;
    font-size: 12.5px;
    color: #6b7c8f;
    cursor: default;
}
.cy-soon-tag {
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef6f3;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--cy-brand-dark);
}

.cy-related {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid var(--cy-line);
    border-radius: 14px;
    background: #fbfdff;
}
.cy-related h2 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cy-muted);
}
.cy-related ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cy-related a {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid #dbe8e4;
    border-radius: 999px;
    background: #fff;
    font-size: 12.5px;
    color: var(--cy-brand-dark);
    text-decoration: none;
}
.cy-related a:hover { border-color: var(--cy-brand); background: #f1faf7; }

/* ---------- interpretation section ---------- */

.cy-why {
    margin-top: 26px;
    padding: 24px;
    border: 1px solid var(--cy-line);
    border-radius: 15px;
    background: #fbfdfc;
}
.cy-why-title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cy-ink);
}
.cy-why-intro {
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--cy-muted);
}
.cy-why h3 {
    margin: 18px 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cy-ink-soft);
}
.cy-why p {
    margin: 0;
    font-size: 13px;
    line-height: 1.75;
    color: #46536b;
}
/* Sections carry a lead paragraph plus a detail paragraph. */
.cy-why p + p { margin-top: 9px; }

/* ---------- how to use ---------- */

.cy-steps {
    margin-top: 26px;
    padding: 24px;
    border: 1px solid var(--cy-line);
    border-radius: 15px;
    background: #fff;
}
.cy-steps-title {
    margin: 0 0 14px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cy-ink);
}
.cy-steps-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: cy-step;
    display: grid;
    gap: 12px;
}
.cy-steps-list li {
    counter-increment: cy-step;
    position: relative;
    padding-inline-start: 38px;
    font-size: 13px;
    line-height: 1.7;
    color: #46536b;
}
/* Explicit counter: the visible order must match the HowTo positions in the JSON-LD. */
.cy-steps-list li::before {
    content: counter(cy-step);
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eef6f3;
    color: var(--cy-brand-dark);
    font-size: 12.5px;
    font-weight: 700;
}
.cy-steps-list strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cy-ink-soft);
}

/* ---------- GEO direct answer ---------- */
/* Base card lives in main.css (blue). The cycling skin uses the green brand accent,
   and the RTL override has to beat main.css's [dir="rtl"] .geo-direct-answer rule. */
.cy-page .geo-direct-answer {
    margin: 0 0 22px;
    padding: 18px 20px;
    border: 1px solid #cfe9df;
    border-left: 5px solid var(--cy-brand);
    border-radius: 12px;
    background: linear-gradient(180deg, #f5fbf8, #eef8f4);
    color: #3c4c5d;
    font-size: 14px;
    line-height: 1.7;
}
.cy-page .geo-direct-answer p:first-child {
    font-size: 15px;
    color: var(--cy-ink);
}
.cy-page .geo-direct-answer strong { color: var(--cy-brand-dark); }

[dir="rtl"] .cy-page .geo-direct-answer {
    border-left: 1px solid #cfe9df;
    border-right: 5px solid var(--cy-brand);
}

/* ---------- responsive ---------- */

@media (max-width: 600px) {
    .cy-page .dev-tool-card { padding: 18px 16px; border-radius: 14px; }
    .cy-page .section-title { font-size: 21px; }
    /* The old flat grid is gone; .cy-groups below handles the single-column layout.
       16px is kept for iOS Safari, which zooms the page when a focused input
       is smaller than 16px. */
    .cy-group-fields .dev-tool-input,
    .cy-display-setting select.dev-tool-input { font-size: 16px; }
    .cy-results { grid-template-columns: 1fr 1fr; }
    .cy-results > div:first-child { grid-column: 1 / -1; }
    .cy-summary { grid-template-columns: 1fr; }
    .cy-calorie-hero b,
    .cy-hyd-hero b,
    .cy-pwr-hero b { font-size: 34px; }
    .cy-gear-stats { grid-template-columns: 1fr 1fr; }
    .cy-pwr-gap { grid-template-columns: 1fr; }
    .cy-frame-hero { flex-direction: column; }
    .cy-frame-size-badge { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; }
    .cy-frame-size-badge b { font-size: 28px; }
    .cy-bar { grid-template-columns: 74px 1fr auto; }
    .cy-levels .cy-bar { grid-template-columns: 84px 1fr auto; }
    .cy-groups { grid-template-columns: 1fr; }
    .cy-inputs-head { align-items: stretch; }
    .cy-display-setting select.dev-tool-input { min-width: 110px; }
    /* Single column needs no cross-row label alignment; drop the reserved height. */
    .cy-group-fields .dev-tool-label > span:first-child { min-height: 0; }
    .cy-page .geo-direct-answer { padding: 16px; font-size: 13.5px; }
    .cy-page .geo-direct-answer p:first-child { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .cy-bar-fill { transition: none; }
}

/* ---------- segmented ride rows (cycling calories) ---------- */
/* .cy-field-group floats its <legend> as a block heading, and .cy-group-fields
   normally clears it. The segments fieldset has a hint + a plain div instead,
   so those children must clear the float or they slide up under the heading. */
#calSegmentsWrap > .cy-hint,
#calSegmentsWrap > #calSegments,
#calSegmentsWrap > .dev-tool-actions {
    clear: both;
}

#calSegments {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Keep the shared .cy-group-fields input styling, but lay each row out as three
   equal fields plus a compact action, with everything bottom-aligned to the
   44px inputs. */
#calSegments .cy-segment {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    padding: 12px 14px;
    border: 1px solid var(--cy-line);
    border-radius: 12px;
    background: #fbfdff;
}

/* The remove action reuses the .dev-tool-label structure: an empty spacer of the
   same height as a field label, then the button where an input would sit. That
   keeps it bottom-aligned with the 44px inputs without magic offsets. */
#calSegments .cy-segment .seg-remove-cell {
    min-width: 0;
}
#calSegments .cy-segment .seg-remove-cell > span {
    min-height: 2.5em;
}

#calSegments .cy-segment .seg-remove {
    height: 44px;
    box-sizing: border-box;
    padding: 0 14px;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

#calSegments .cy-segment .seg-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    #calSegments .cy-segment {
        grid-template-columns: 1fr 1fr;
    }
    #calSegments .cy-segment > .dev-tool-label:nth-child(3),
    #calSegments .cy-segment > .seg-remove-cell {
        grid-column: 1 / -1;
    }
}

/* ---------- frame size extras (saddle mode, crank, standover bar, compare) ---------- */
.cy-saddle-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 4px 0 10px;
}
.cy-saddle-mode > span:first-child {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cy-ink-soft);
}

.cy-crank {
    padding: 12px 14px;
    margin: 4px 0 14px;
    border: 1px solid var(--cy-line);
    border-radius: 12px;
    background: var(--cy-surface);
}
.cy-crank-title {
    display: block;
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cy-ink-soft);
}
.cy-crank-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cy-crank-values > span { display: flex; flex-direction: column; gap: 2px; }
.cy-crank-values b { font-size: 16px; }
.cy-crank-values em { font-style: normal; font-size: 12px; color: var(--cy-ink-soft); }

.cy-standover-bar {
    height: 10px;
    margin: 8px 0 6px;
    border-radius: 999px;
    background: #e7eef9;
    overflow: hidden;
}
.cy-standover-bar-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--cy-brand);
    transition: width .2s ease;
}
.cy-standover-margin { margin: 0; }
.cy-standover-margin.is-comfort { color: #1e7e34; }
.cy-standover-margin.is-tight { color: #b26a00; }
.cy-standover-margin.is-low { color: #c5221f; }

.cy-compare { margin-top: 16px; }
.cy-compare > summary {
    padding: 10px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--cy-brand-dark);
}
.cy-compare-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 8px;
}
.cy-compare-body .dev-tool-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-size: 12.5px;
}
.cy-compare-body > .dev-tool-label { max-width: 200px; }
.cy-compare-body .dev-tool-input { height: 44px; }
.cy-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cy-compare-frame {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--cy-line);
    border-radius: 12px;
}
.cy-compare-frame legend {
    float: none;
    padding: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--cy-ink-soft);
}
.cy-compare-out {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
}
.cy-compare-out div { display: flex; flex-direction: column; gap: 2px; }
.cy-compare-out dt { font-size: 12px; color: var(--cy-ink-soft); }
.cy-compare-out dd { margin: 0; font-size: 18px; font-weight: 700; }

@media (max-width: 600px) {
    .cy-crank-values,
    .cy-compare-grid,
    .cy-compare-out { grid-template-columns: 1fr; }
}

/* Give the follow-up hint room to breathe under the reset button row. */
.dev-tool-actions + .cy-note {
    margin-top: 20px;
}

/* ---------- gear step chart (gear ratio tool) ---------- */
.cy-gear-steps:empty { display: none; }
.cy-gear-steps { margin: 10px 0 14px; }
.cy-steps-title {
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--cy-ink-soft);
}
.cy-steps-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 96px;
    padding: 8px;
    border: 1px solid var(--cy-line);
    border-radius: 10px;
    background: var(--cy-surface);
    overflow-x: auto;
}
.cy-steps-bar {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-width: 14px;
    height: 100%;
}
.cy-steps-bar > span {
    width: 100%;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: var(--cy-brand);
    transition: height .2s ease;
}
.cy-steps-bar > em {
    margin-top: 3px;
    font-style: normal;
    font-size: 9px;
    color: var(--cy-ink-soft);
    white-space: nowrap;
}

/* ---------- SEO matrix (gear ratio tool) ---------- */
.cy-matrix { margin-top: 22px; }
.cy-matrix-title { margin-bottom: 10px; font-size: 16px; }

/* ---------- power-to-weight: level pointer + target block ---------- */
.cy-bar-track { position: relative; }
.cy-bar-dot {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    margin-top: -5px;
    border-radius: 50%;
    background: #c5221f;
    box-shadow: 0 0 0 2px #fff;
}
.cy-bar-dot[hidden] { display: none; }
.cy-pwr-target { margin: 14px 0; }
.cy-pwr-target .dev-tool-label { max-width: 220px; margin-bottom: 8px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.seo-table tr.is-current-zone {
    background: #e8f5f2;
    font-weight: 600;
}
.cy-print-card:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: auto;
    background: #fff;
    padding: 1.5rem;
    display: block;
}

.cy-history-item .up { color: #0f7b6c; }
.cy-history-item .down { color: #b23b3b; }

.cy-profile-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid var(--cy-line);
    border-radius: 10px;
    background: var(--cy-surface);
}
.cy-profile-bar {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 2px;
}
.cy-profile-bar > span {
    width: 100%;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: var(--cy-brand);
}
.cy-profile-bar > em { font-style: normal; font-size: 10px; color: var(--cy-ink-soft); text-align: center; }
.cy-profile-bar > b { font-size: 11px; }
.cy-spark { position: relative; height: 48px; margin: 6px 0; }
.cy-spark:empty { display: none; }
.cy-spark svg { display: block; }
/* Dots are HTML so the stretched sparkline cannot turn them into ellipses. */
.cy-spark-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cy-brand);
    transform: translate(-50%, -50%);
}
.cy-spark-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 11px;
    color: var(--cy-ink-soft);
}
/* Marks the second where the W′ balance reaches zero. */
.cy-wbal-depleted {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #b23b3b;
    transform: translateX(-1px);
}
#pwrWbalChart, #pwrHistoryCpChart { height: 40px; }
/* Legend colours match the CP and W′ lines in the sparkline. */
.cy-trend-cp { color: #0f7b6c; }
.cy-trend-wp { color: #2f6fbd; }
.cy-pd-table { margin: 8px 0 4px; font-size: 13px; }
/* Seven columns now: tighten the type so the zone table still fits the column. */
.cy-page .seo-table.cy-zones-table th,
.cy-page .seo-table.cy-zones-table td,
#pwrPrintCard .cy-zones-table th,
#pwrPrintCard .cy-zones-table td {
    padding: 6px 6px;
    font-size: 12px;
}
/* On phones the table scrolls inside its wrapper instead of squeezing seven columns. */
@media screen {
    .cy-zones-table { min-width: 560px; }
}
/* W′bal verdict reads as a list of facts, one per line. */
.cy-wbal-out {
    margin: 4px 0 10px;
    padding-left: 18px;
    font-size: 13px;
    color: var(--cy-ink-soft);
}
.cy-wbal-out li { margin: 2px 0; }
/* Secondary collapsibles inside a tool section (P-D table, advice). */
.cy-formula.cy-nested {
    margin: 10px 0 0;
    border: 1px solid var(--cy-line);
    border-radius: 10px;
    background: #fff;
}
.cy-formula.cy-nested > summary { padding: 8px 12px; font-size: 13px; }
/* Delete affordance needs a real touch target on phones. */
.cy-history-del { min-width: 34px; min-height: 34px; }
/* Burn rate of the row the rider is actually on. */
.cy-burn-actual { font-weight: 700; color: var(--cy-brand-dark); }
/* Jump row under the answer: the sections exist, but nothing pointed at them. */
.cy-jump {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 10px 0 14px;
    font-size: 13px;
}
.cy-jump span { color: var(--cy-ink-soft); }
.cy-jump a {
    color: var(--cy-brand-dark);
    text-decoration: none;
    border-bottom: 1px solid rgba(15, 123, 108, .35);
}
.cy-jump a:hover,
.cy-jump a:focus-visible { border-bottom-color: currentColor; }
/* Zone name stays visible while the seven-column table scrolls sideways. */
.cy-zones-table th:first-child,
.cy-zones-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
}
.cy-zones-table tr.is-current-zone td:first-child { background: inherit; }
.cy-pd-table th, .cy-pd-table td { padding: 5px 8px; }
.cy-pd-table th:nth-child(n+2), .cy-pd-table td:nth-child(n+2) { text-align: right; }
#pwrHistoryStats .up { color: #0f7b6c; }
#pwrHistoryStats .down { color: #b23b3b; }

/* ---------- hydration extras (bottles, sodium, weight loss) ---------- */
.cy-hyd-extra {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 12px 0 14px;
}
.cy-hyd-extra > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--cy-line);
    border-radius: 10px;
    background: var(--cy-surface);
}
.cy-hyd-extra b { font-size: 15px; }
.cy-hyd-extra span { font-size: 11.5px; color: var(--cy-ink-soft); }
.cy-dehydration {
    border-color: #f0d3a8;
    background: #fff8ee;
    color: #8a5a00;
}
.cy-hyd-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e6f4ea;
    color: #1e7e34;
    font-size: 11px;
    font-weight: 600;
}
.cy-hyd-badge[hidden] { display: none; }

.cy-hyd-compare {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin: 6px 0 14px;
    padding: 10px 12px;
    border: 1px dashed var(--cy-line);
    border-radius: 10px;
    font-size: 13px;
    color: var(--cy-ink-soft);
}
.cy-hyd-compare-label { font-weight: 600; }

.cy-print-card { display: none; }

.cy-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}
.cy-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border: 1px solid var(--cy-line);
    border-radius: 10px;
    background: var(--cy-surface);
}
.cy-history-text {
    flex: 1 1 200px;
    font-size: 13px;
}
/* The row itself is the restore control, so it is a button with the text styling kept. */
.cy-history-main {
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: inherit;
    text-align: start;
    cursor: pointer;
}
.cy-history-main:hover { color: var(--cy-brand-dark); text-decoration: underline; }
.cy-history-main:disabled { cursor: default; text-decoration: none; opacity: .75; }
.cy-history-item .dev-tool-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.cy-onboard {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .45);
}
[hidden] { display: none !important; }
.cy-onboard[hidden] { display: none; }
.cy-onboard-card {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.cy-onboard-card h2 { margin: 0 0 8px; font-size: 18px; }
.cy-onboard-card .cy-group-fields { margin: 12px 0; }

.cy-bottle-marker td {
    font-size: 12px;
    font-weight: 600;
    color: var(--cy-brand-dark);
    background: #f3f8ff;
}

@media print {
    /* Hide every body-level sibling instead of using visibility:hidden, which
       keeps the page's full height and produces blank pages. Both print cards
       are body-level, so one rule covers every tool page. */
    body > *:not(#hydPrintCard):not(#pwrPrintCard) { display: none !important; }
    #hydPrintCard, #pwrPrintCard {
        display: block !important;
        position: static;
        width: 100%;
        margin: 0;
        padding: 0;
        font-size: 12px;
        color: #000;
    }
    #hydPrintCard h2, #pwrPrintCard h2 { margin: 0 0 6px; font-size: 16px; }
    #hydPrintCard table, #pwrPrintCard table { width: 100%; border-collapse: collapse; margin-top: 6px; }
    #hydPrintCard th, #hydPrintCard td,
    #pwrPrintCard th, #pwrPrintCard td { padding: 3px 5px; border: 1px solid #999; text-align: left; }
    /* Browsers drop backgrounds when printing unless asked to keep them. */
    #pwrPrintCard tr.is-current-zone {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-weight: 600;
    }
}
