@font-face {
  font-family: 'Golos Text';
  src: url('./type/golos.woff') format('woff');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Exo 2';
  src: url('./type/exo.woff') format('woff');
  font-weight: 100 900;
  font-display: swap;
}
.pref-icon{position:relative;display:grid;place-items:center;cursor:pointer;width:44px;height:44px;background:#192b43;color:white;border:1px solid #aec4cf;border-radius:8px;box-sizing:border-box;margin:0}
.pref-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.pref-icon select{cursor:pointer;position:absolute;inset:0;opacity:0;width:100%;height:100%;padding:0;margin:0}
.pref-icon:focus-within{outline:3px solid #f4b451;outline-offset:2px}

:root {
  --snow: #f3f6fb;
  --navy: #192b43;
  --blue: #2059aa;
  --amber: #f4b451;
  --ice-blue: #a7caff;
  --paper: var(--snow);
  --surface: #fff;
  --inset: #edf2f9;
  --selected: #dfeaff;
  --ink: var(--navy);
  --secondary: #465a72;
  --rule: #c6d1df;
  --action: var(--blue);
  --control: #8293a8;
  --heading: 'Exo 2', sans-serif;
  --body: 'Golos Text', system-ui, sans-serif;
  --space: clamp(16px, 1.8vw, 24px);
  --shell: min(1320px, calc(100% - 2 * var(--space)));
  --bg: var(--paper); --bg2: var(--paper); --panel: var(--surface);
  --panel2: var(--inset); --panel3: var(--inset);
  --line: var(--rule); --line2: var(--rule); --text: var(--ink);
  --muted: var(--secondary); --soft: var(--ink);
  --ice: var(--action); --ice2: var(--action);
  --atlas-paper: var(--paper); --atlas-ink: var(--ink); --atlas-blue: var(--action);
  --atlas-line: var(--rule); --atlas-muted: var(--secondary);
  --shadow: none;
}
@media screen {
  html[data-theme=dark] {
    color-scheme: dark;
    --paper: #101b2c;
    --surface: var(--navy);
    --inset: #233650;
    --selected: #293f63;
    --ink: var(--snow);
    --secondary: #c6d2e3;
    --rule: #495e77;
    --action: var(--ice-blue);
    --warm: var(--amber);
    --control: #8195ae;
  }
}
body {font: 400 1rem/1.5 var(--body); color: var(--ink); background: var(--paper)}
.app-shell, .mast-inner {width: var(--shell); margin-inline: auto}
body :is(button,input,textarea,select,summary,label,.overline,.kicker) {font-family: var(--body)}
body :is(h1,h2,h3,h4), .page-intro h1, .stage-head h2, .panel-title h2, .weatherhead h2, #startDesk h2 {
  font-family: var(--heading); font-weight: 600; line-height: 1.17; letter-spacing: -.025em; color: var(--ink);
}
.app-shell .page-intro h1 {font-size: clamp(1.75rem, 3vw, 2.45rem)}
.app-shell .stage-head h2 {font-size: clamp(1.35rem, 2.1vw, 1.75rem)}
body :is(.primary,.ghost,.mobile-nav-btn,.result-tab,.view-btn,.textbtn,.small,.start-mode button,.admin-tabs button,summary,.tag) {
  font-weight: 500; letter-spacing: normal; text-transform: none;
}
body :is(label,legend,button,select,input,textarea,.admin-view label,.help-topics summary) {font-size: .9375rem; font-weight: 500}
body :is(input,textarea,select,.desk-panel input,.desk-panel select,.desk-panel textarea) {font-family: var(--body); font-weight: 400}
body :is(.kicker,.overline) {font-size: .75rem; font-weight: 500; letter-spacing: .06em; color: var(--secondary)}
body :is(strong,b) {font-weight: 600}
.app-shell a, footer button {color: var(--action)}
body :is(.panel,.library-card,dialog,.admin-view,.source-list article,.stage-panel,.help-topics details,.help-contact,.desk-panel) {
  background: var(--surface); color: var(--ink); border-color: var(--rule); box-shadow: none;
}
body :is(.panel,.library-card,.source-list article,.admin-view) {border-radius: 10px}
body :is(.meta,.micro-note,.page-intro p,.library-card p,small,.source-list p,footer,.muted,label,legend) {color: var(--secondary)}
body :is(input,select,textarea,.ghost,.admin-tabs button,.iconbtn,.library-card button,.history-item button,.pref-icon) {
  border: 1px solid var(--control); border-radius: 7px; color: var(--ink); background: var(--surface);
}
body :is(.primary,.ghost,.admin-tabs button) {min-height: 44px; padding: 8px 14px; font-size: .9375rem; box-shadow: none}
body .primary,.auth-page form button {border: 1px solid var(--blue); background: var(--blue); color: white; border-radius: 7px}
body .ghost:hover {background: var(--inset); color: var(--ink); border-color: var(--action)}
body :is(.primary,.ghost,.admin-tabs button,.pref-icon,select,a,summary):focus-visible, .pref-icon:focus-within {
  outline: 3px solid var(--amber); outline-offset: 3px;
}
body input::placeholder,body textarea::placeholder {color: var(--secondary); opacity: 1}
body input[type=checkbox],body input[type=radio] {accent-color: var(--blue)}
body :is(.tag,.condition-chip,.quick-summary>div,.choice-card>span,.metric-strip article,.geometry-note,
  .technology-list li,.candidate,.explain-box,.ab-grid article,.confidence-box,.recipe-card,.product,
  .ab-recipe-card,.recipe-tech-header,.recipe-score,.tech-product,.cycle-record,.race-stage,.desk-card,
  .personal-suggestion,.snow-presets button,.forecast-points article,.layer-card,.step,.stat,.wax-card,.secret-result,.season-row,.filter-row,.course-card,.card-content,.quick-diary,
  .scheme-legend,.start-card,.result-tabs,.view-switch,.recipe-toggle,.start-mode,.hours button,.diary-scale span) {
  color: var(--ink); background: var(--inset); border-color: var(--rule);
}
body :is(.view-btn,.result-tab,.recipe-toggle-btn,.start-mode button) {color: var(--secondary); background: transparent}
body :is(.view-btn.active,.result-tab.active,.recipe-toggle-btn.active,.start-mode button[aria-pressed=true],
  .admin-tabs button[aria-pressed=true],.hours button[aria-pressed=true],.desk-panel [aria-pressed=true],
  .choice-card input:checked+span,.snow-presets button[aria-pressed=true],.diary-scale input:checked+span) {
  color: var(--action); background: var(--selected); border-color: var(--action); box-shadow: inset 0 -2px var(--action);
}
body :is(.choice-card>span b,.choice-card input:checked+span b,.condition-chip strong,.metric-strip strong,.tag,.recipe-focus-head h3) {color: var(--ink)}
body :is(.tag,.recipe-products .recipe-line span,.recipe-products .recipe-line small) {font-size: .8125rem; font-weight: 400}
body :is(.confidence-top strong,.recipe-status,.race-tools summary,.gate-tools summary,.input-group legend,.score,.recipe-score strong,.recipe-role,.compare-results dt,.conditions-toggle strong,.status-chip,#cardProgress) {color: var(--action)}
body .recipe-focus, .workspace>.stage-panel {background: var(--surface); border-color: var(--rule)}
body .recipe-products .recipe-line {
  background: var(--inset); border: 1px solid var(--rule); border-inline-start: 3px solid var(--action);
  border-radius: 6px; padding: 12px 14px; margin: 0;
}
body .recipe-products .recipe-line:nth-child(n+2) {border-inline-start-color: var(--amber)}
body .recipe-products .recipe-line b {color: var(--ink); font: 600 clamp(1rem, 1.45vw, 1.25rem)/1.35 var(--heading)}
body :is(.recipe-products .recipe-line span,.recipe-products .recipe-line small,.condition-chip,.metric-strip span) {color: var(--secondary)}
body .weatherhead {background: var(--inset); color: var(--ink); min-height: auto; gap: 12px; align-items: center}
body .weatherhead h2 {color: var(--ink); font-size: 1.4rem}
body .weatherbody .iconbtn {background: var(--inset); color: var(--ink)}
body .status-chip {background: var(--inset); border-color: var(--rule); font-weight: 500; font-size: .8125rem}
body .status-chip.warn {color: var(--navy); background: var(--amber)}
body .ski-stage-wrap {background-color: #edf2f9; color: var(--navy)}
body .help-link {background: var(--inset); color: var(--action); border: 1px solid var(--rule)}
.help-link svg {width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round}
.help-tip {font-family: var(--body)}

/* The photograph has its own 3:1 canvas. Controls never cover the athlete or workbench. */
body .topbar {
  position: relative; display: block; min-height: 0; padding: 0;
  color: var(--ink); background: var(--surface); border: 0; box-shadow: none; backdrop-filter: none;
}
.mast-inner {display: grid; grid-template-columns: minmax(0, 1fr) clamp(210px, 28vw, 348px); align-items: stretch}
.mast-tools {display: flex; flex-flow: row wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 12px 16px 0}
.topbar .brand {display: block; min-width: 0}
.topbar .wordmark {display: block; width: clamp(140px, 15vw, 192px); height: auto}
.mast-photo {position: relative}
.mast-photo::after {content: ""; position: absolute; inset: 0 auto 0 0; width: 4%; pointer-events: none; background: linear-gradient(90deg, var(--surface), transparent)}
.mast-photo img {display: block; width: 100%; height: auto; aspect-ratio: 3; object-fit: contain}
.mast-photo .mast-workshop, body:has(#tab-service.active,#tab-waxes.active,#tab-tests.active) .mast-trail {display: none}
body:has(#tab-service.active,#tab-waxes.active,#tab-tests.active) .mast-workshop {display: block}
.topbar .header-actions, [data-preferences] {display: flex; align-items: center; flex-wrap: wrap; gap: 8px}
.topbar .header-actions button,.topbar .pref-icon,.auth-page .pref-icon {min-height: 44px; background: var(--surface); border: 1px solid var(--control); color: var(--ink)}
.pref-icon select {margin: 0; padding: 0; min-height: 0}
.topbar .mobile-nav {background: var(--surface); color: var(--ink); border: 1px solid var(--rule)}
.topbar .mobile-nav-btn {color: var(--secondary); background: transparent; border: 0; border-radius: 5px; box-shadow: none; font-weight: 500}
.topbar .mobile-nav-btn:hover {background: var(--inset); color: var(--ink)}
.topbar .mobile-nav-btn.active {background: var(--selected); color: var(--action); box-shadow: inset 0 -2px var(--action)}
.topbar .mobile-nav-btn :is(.feature-label,#calcNavLabel) {font: inherit}
@media(min-width: 901px) {
  .topbar .mobile-nav {position: static; width: 100%; margin: 0; padding: 5px max(var(--space), calc((100% - 1320px) / 2)); border-inline: 0; border-radius: 0; gap: 3px; flex-wrap: wrap}
  .topbar .mobile-nav-btn[data-tab] {font-size: .875rem; padding: 8px 10px; min-height: 40px}
}
@media(max-width: 900px) {
  .topbar #navMore[aria-expanded=true]+.nav-secondary {background: var(--surface); border: 1px solid var(--rule)}
}
@media(max-width: 670px) {
  .mast-inner {width: 100%; display: flex; flex-direction: column}
  .mast-tools {flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding: 12px var(--space); flex-wrap: wrap}
  .mast-tools .header-actions {margin-left: auto}
  .topbar .wordmark {width: 130px}
  .topbar .header-actions button {font-size: .8125rem; padding-inline: 9px}
}
.nav-glyph,.account-glyph {display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round}
@media(max-width: 900px) {
  .topbar .mobile-nav>.mobile-nav-btn {display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; font-size: .8125rem; min-height: 48px; padding: 4px}
  .topbar .mobile-nav>.mobile-nav-btn .nav-glyph {display: block}
  .topbar .nav-secondary .mobile-nav-btn>span[aria-hidden] {display: none}
}
@media(max-width: 670px) {
  .mast-photo {width: min(100%, 300px); align-self: center}
  .mast-photo::after {display: none}
}
@media(max-width: 520px) {
  .mast-tools .header-actions {position: static; display: flex; flex-wrap: nowrap}
  .topbar .header-actions [data-nav=plans] {position: relative; flex: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center}
  .topbar .account-glyph {display: block}
  .topbar [data-nav=plans]>span {position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap}
  .app-shell .page-intro {flex-direction: row; align-items: center}
}

/* Common page edges, control sizes, panel padding and actions across sections. */
.app-shell .page-intro {display: flex; align-items: center; justify-content: flex-start; gap: 10px; flex-wrap: wrap; margin-block: 0 16px}
.page-intro>:first-child {margin-right: auto}
.app-shell #tab-calc>.page-intro {min-height: 0; padding: 0}
.app-shell #tab-calc>.start-mode {margin: 0 0 16px}
.page-panel :is(.history-controls,.fleet-filters,.desk-panel,.access-panel,.compare-panel,.account-panel,.help-topics,.help-contact,.admin-body,.diagnostics,.wax-manager) {
  padding: var(--space); margin-inline: 0; max-width: none;
}
.page-panel .desk-panel {width: 100%}
.page-panel .desk-tools {margin-top: 0}
.app-shell .admin-view {gap: 10px; align-items: center; padding: 12px var(--space)}
.app-shell :is(.admin-view label,.history-controls label,.fleet-filters label,.desk-tools label) {margin: 0}
.help-topics details {padding: 0; border: 0; border-bottom: 1px solid var(--rule)}
.help-topics details:last-child {border-bottom: 0}
.help-topics summary {display: flex; justify-content: space-between; min-height: 48px; color: var(--ink)}
.help-topics summary::after {content: ''; width: 7px; height: 7px; border: solid var(--action); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin: 0 5px 3px 12px}
.help-topics details[open] summary::after {transform: rotate(225deg)}
.help-contact :is(h2,p:first-child),.desk-panel :first-child>label {margin-top: 0}
#feedbackForm {display: grid; gap: 10px; justify-items: start}
#feedbackForm>label {width: 100%}
#researchLink {margin: 12px 0 0}
#researchLink>a {display: inline-flex; align-items: center; text-decoration: none}
.app-shell .library-card {display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px}
.library-card :is(h3,p,.wax-own) {margin: 0}
.library-card .meta {display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: auto}
.library-card .wax-own {display: inline-flex; align-items: center; gap: 8px; min-height: 36px}
.library-card .wax-own input {margin: 0}
#tab-plans .offers>article>button+button {margin-top: 0}
#tab-plans .access-panel :is(#authStatus,#accessUntil):empty {display: none}
#tab-plans #loginControls {display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px}
#tab-plans #loginControls p {margin: 0}
#featureDialog, #raceMapDialog, #diaryDialog, #adminDialog {background: var(--surface); color: var(--ink)}
.auth-page {margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink)}
.auth-page header {display: flex; justify-content: space-between; align-items: center; padding: 18px var(--space); gap: 16px; background: var(--surface)}
.auth-page header img {width: 150px}
.auth-page main {width: min(420px,calc(100% - 32px)); margin: 8vh auto; padding: var(--space); background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-sizing: border-box}
.auth-page form,.auth-page form label {display: grid; gap: 8px}
.auth-page form {gap: 16px; margin-block: 16px}
.auth-page input,.auth-page button {padding: 10px}
.auth-page a {display: inline-block; margin-top: 12px; color: var(--action)}
.auth-page [hidden] {display: none}

.catalog-editor {
  color-scheme: light; --edge: var(--rule); --fg: var(--ink); --dim: var(--secondary);
  font: 400 1rem/1.5 var(--body); background: var(--paper); color: var(--ink);
}
html[data-theme=dark] .catalog-editor {color-scheme: dark}
.catalog-editor header {padding: 0; background: var(--surface); border: 0}
.editor-bar,.catalog-editor main {width: var(--shell); margin-inline: auto}
.editor-bar {display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px}
.editor-bar img {display: block; width: 150px; height: auto}
.catalog-editor main {max-width: none; padding: 20px 0 40px}
.catalog-editor h1 {margin-block: 12px 0; font-size: clamp(1.75rem,3vw,2.45rem)}
.catalog-editor .stats {margin-top: 16px}
.catalog-editor a,.catalog-editor #message {color: var(--action)}
.catalog-editor .item {background: var(--surface); color: var(--ink); border-color: var(--rule)}
.catalog-editor .item:is(:hover,.active) {background: var(--selected); color: var(--ink)}
.catalog-editor :is(.toolbar,.actions) button:not(.primary,.danger) {background: var(--inset); color: var(--ink); border-color: var(--control)}
.catalog-editor .mutedbox strong,.catalog-editor .status {color: var(--ink); border-color: var(--control)}
.catalog-editor .status.ok {background: var(--selected); color: var(--action)}
.catalog-editor .status.nd {background: var(--amber); color: var(--navy)}
.catalog-editor .fields label {color: var(--secondary)}
.catalog-editor .layout>* {min-width: 0}
.catalog-editor .item strong {overflow-wrap: anywhere}
.catalog-editor .pref-icon {background: var(--surface); color: var(--ink); margin: 0}

html[data-theme=light] :is(.wordmark,.auth-page header img,.editor-bar img) {filter: brightness(0) saturate(100%) invert(15%) sepia(22%) saturate(1100%) hue-rotate(174deg)}
.field-icon {display:inline-block; flex:none; width:24px; height:24px; color:var(--action); vertical-align:middle}
h3>.field-icon,button>.field-icon {margin-inline-end:8px}
.snow-presets button .field-icon {display:block; width:46px; height:46px; margin:0 auto 4px; background:none}
body .snow-presets button {font:500 .94rem/1.35 var(--body); padding:10px 4px}
.method-hint,.diary-launch,.rail-picker {display:flex; align-items:center; gap:10px}
.method-hint {padding:12px; background:var(--inset); border-radius:6px; margin-block:12px}
.method-hint .field-icon {width:44px; height:44px}
.method-hint p,.diary-launch .field-icon {margin:0}
.diary-launch>span {display:grid; text-align:start}
.diary-launch strong {font-size:.875rem; color:var(--action)}
.help-topics summary .field-icon {margin-right:12px}
.help-topics summary::after {margin-left:auto}
.help-topics summary {justify-content:flex-start}
.rail-picker {display:none}
@media screen and (min-width:981px) {
  .rail-picker {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px; padding:4px; border:1px solid var(--rule); border-radius:9px; background:var(--surface)}
  .rail-picker button {min-width:0; min-height:44px; border:0; border-radius:6px; font-size:.875rem; color:var(--secondary); background:transparent; cursor:pointer}
  .rail-picker button[aria-pressed=true] {background:var(--selected); color:var(--action); font-weight:600}
  .atlas-controls:not([data-pane=conditions])>#snowForm,.atlas-controls:not([data-pane=forecast])>#forecastPanel,.atlas-controls:not([data-pane=rules])>#rulesPanel {display:none}
}
.app-shell :is(fieldset,form,.panel,.field-grid>*,.help-contact,.help-layout>*,.series-columns>*) {min-width:0}
.app-shell :is(input:not([type=checkbox],[type=radio]),select,textarea) {max-inline-size:100%; min-inline-size:0; box-sizing:border-box}
#feedbackForm {width:100%; grid-template-columns:minmax(0,1fr)}
#feedbackForm label,#feedbackForm textarea,#feedbackForm input {width:100%; min-width:0}
#feedbackForm textarea,.desk-panel textarea {resize:vertical; max-width:100%}
#seriesPanel .series-columns {grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap:12px}
#seriesPanel .series-columns>label,.field-grid>label {display:flex; flex-direction:column; justify-content:flex-end; align-items:stretch; gap:6px; margin:0}
#seriesPanel .series-columns>label>:is(input,select) {margin:0; width:100%}
#startDesk>label {display:grid; gap:5px; max-width:100%}
.app-shell :is(.micro-note,.meta,.field-journal p,#trialSetup,.method-hint p) {font-size:.875rem; line-height:1.55}
.app-shell details:not(.help-topics details)>summary {
  display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px;
  padding:8px 12px; font:500 .9375rem/1.4 var(--body); color:var(--action); background:var(--inset);
  border:1px solid var(--rule); border-radius:6px; cursor:pointer; list-style:none; box-sizing:border-box
}
.app-shell details:not(.help-topics details)>summary::after {content:""; width:7px; height:7px; flex:none; margin-right:4px; border:solid currentColor; border-width:0 2px 2px 0; transform:rotate(45deg)}
.app-shell details:not(.help-topics details)[open]>summary::after {transform:rotate(225deg)}
.app-shell details>summary:hover {background:var(--selected)}
.app-shell details>summary::-webkit-details-marker {display:none}
.parameter-group {margin-block:12px}
.parameter-group[open]>.input-group {margin:12px 0}
#seriesPanel fieldset>legend {padding:0 6px; font-size:.9375rem; color:var(--ink)}
.pair-preparation,.seller-details {display:grid; gap:8px; margin-block:12px}
.pair-preparation>div,.seller-details>div {padding:8px 12px; background:var(--inset); border-left:3px solid var(--action)}
.pair-preparation dt,.seller-details dt {font-size:.875rem; color:var(--secondary)}
.pair-preparation dd,.seller-details dd {margin:2px 0 0; color:var(--ink); overflow-wrap:anywhere; white-space:pre-line}
#paymentMethods {margin-block:18px; padding:var(--space)}
.payment-grid {display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap:16px}
.payment-grid>section {background:var(--inset); padding:16px; border-radius:8px}
.payment-grid h3 {margin:0}
.support-action {display:inline-flex; align-items:center; min-height:44px; padding-inline:14px; border:1px solid var(--action); border-radius:6px; font-weight:600}
.payment-profiles a,.feedback-tools button {display:inline-flex; align-items:center; min-height:44px}
body [hidden] {display:none!important}

.terms-page {margin:0; color:var(--ink); background:var(--paper)}
.terms-page header {padding:18px max(16px,calc((100vw - 760px)/2)); background:var(--navy)}
.terms-page main,.terms-page footer {max-width:760px; margin:24px auto; padding:0 20px; box-sizing:border-box}
.terms-page main {background:var(--surface); padding:clamp(18px,4vw,48px); border:1px solid var(--rule); border-radius:12px}
.terms-page a,footer a {color:var(--action)}
.terms-page h1 {font-size:clamp(1.7rem,4vw,2.4rem)}
.terms-page h2 {margin-top:1.55em; font-size:1.4rem}
.terms-page .edition-date {color:var(--secondary); font-size:.875rem}
.tariff-list dt {font-weight:600; margin-top:.75em}
.tariff-list dd {margin:4px 0}
@media print {.terms-page header,.terms-page footer {display:none}.terms-page main {max-width:none; border:0; margin:0; padding:0}.terms-page h2 {break-after:avoid}}
