/* Follow the shell's surface theme: device dark preference only themes the map.
   --ink also follows an explicitly selected dark shell appearance. */
.course-candidate{max-width:1440px;margin:auto;color:var(--ink,#282d29);width:100%;min-width:0;box-sizing:border-box;display:block}
.course-candidate .september-eyebrow{margin-bottom:.85rem}
.course-intro{font-family:Georgia,serif;font-size:clamp(1.2rem,2.5vw,1.8rem);margin:12px 0 24px;max-width:40em}
.course-toolbar{display:flex;align-items:end;gap:10px;flex-wrap:wrap;padding:12px 0 16px}
.course-toolbar label{display:flex;gap:8px;align-items:center;flex:1;min-width:200px;flex-wrap:wrap;white-space:nowrap}
.course-toolbar select{width:100%;max-width:430px;min-width:12ch}
.course-toolbar select option{background:var(--surface,#fff);color:var(--ink,#282d29)}
.course-toolbar button,.course-toolbar select{font:inherit;min-height:44px;border:1px solid #a8aea5;border-radius:5px;padding:8px 12px;color:inherit;background:transparent}
.course-toolbar button[aria-selected=true],.course-context-switcher button[aria-selected=true]{background:#c4571a;color:#fff;border-color:#c4571a}
.course-toolbar button:disabled{opacity:.4}
.course-step-controls{display:flex;gap:6px;flex-wrap:wrap}
.course-candidate :focus-visible{outline:3px solid #c4571a;outline-offset:3px}
.course-toolbar,.course-scrub-label,.course-context-switcher{font-family:var(--font-sans)}

.course-workspace{display:flex;flex-direction:column;gap:18px;min-width:0}
.course-map-pane,.course-context-pane{min-width:0}
.course-map-frame{position:relative;height:clamp(400px,60vh,740px);background:#e3e7de;border:1px solid #bdc6b8;overflow:hidden}
.course-apple-map{height:100%;width:100%}
.course-map-status{position:absolute;inset:40% 12% auto;text-align:center;font:1.1rem/1.6 Georgia,serif;color:#354435;background:#f4f2ea;padding:24px}
.course-map-identity{position:absolute;top:12px;left:16px;max-width:calc(100% - 90px);padding:8px 12px;background:#f4f2eae8;color:#242b25;font-size:.85rem;pointer-events:none}
.course-endpoints{position:absolute;left:16px;bottom:36px;display:flex;gap:12px;margin:0;padding:7px 9px;background:#f3f1eef0;color:#2e3136;font:600 11px/1.4 var(--font-sans);pointer-events:none}
.course-endpoints span{display:flex;align-items:center;gap:5px}
.course-endpoints b{display:inline-grid;place-items:center;border-radius:50%;width:20px;height:20px;background:#242a25;color:white}

.course-context-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 16px}
.course-context-switcher{display:flex;gap:0;border-bottom:1px solid #adb4a8;margin:0;flex:1}
.course-show-map-context{font:inherit;min-height:44px;border:1px solid #c4571a;border-radius:5px;padding:8px 14px;background:transparent;color:inherit;cursor:pointer}
.course-context-switcher button{appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;padding:10px 14px;min-height:44px;font:inherit;color:inherit;cursor:pointer}
.course-context-switcher button[aria-selected=true]{border-bottom-color:#c4571a;background:transparent;color:inherit;font-weight:600}

.course-analysis,.course-profile,.course-stats,.course-history{border-top:0;padding:4px 0 12px;margin-top:0}
.course-analysis .course-profile{border-top:1px solid #adb4a8;padding-top:20px;margin-top:18px}
.course-profile-heading{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:center}
.course-profile-heading h2,.course-stats h2,.course-history h2,.course-history h3{font:1.4rem Georgia,serif;margin:0 0 8px}
.course-history h3{font-size:1.05rem;margin-top:18px}
.course-profile-heading p{font:.8rem ui-monospace,monospace}
.course-profile svg{display:block;width:100%;height:160px;margin-top:12px;overflow:hidden}
.course-profile-area{fill:#c4571a20}
.course-profile-line{fill:none;stroke:#c4571a;stroke-width:2;vector-effect:non-scaling-stroke}
.course-profile-boundary{stroke:#697462;stroke-width:.5;opacity:.35}
.course-profile svg text{font:10px sans-serif;fill:currentColor}
.course-profile-cursor{stroke:#96622b;stroke-width:2;vector-effect:non-scaling-stroke}
.course-scrub-label{display:flex;gap:14px;align-items:center;font-size:.8rem}
.course-scrub-label input{min-height:44px;flex:1;accent-color:#c4571a;min-width:0}
.course-profile output{font:.85rem ui-monospace,monospace}
.course-method{font-size:.8rem;line-height:1.6;opacity:.75;max-width:78ch}
.course-stats dl,.course-history-benchmarks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px}
.course-stats dt,.course-history-benchmarks dt{font-size:.8rem}
.course-stats dd,.course-history-benchmarks dd{font:1.25rem ui-monospace,monospace;margin:8px 0 0}
.course-history-list{list-style:none;padding:0;margin:8px 0 0;display:grid;gap:8px}
.course-history-list li{font:.95rem/1.45 var(--font-sans);border-bottom:1px solid #d5d8d1;padding-bottom:8px}
.course-history-link{margin-top:18px}
.course-history-mobile-return{display:none;margin-top:16px}
.course-history-mobile-return button{font:inherit;min-height:44px;border:1px solid #a8aea5;border-radius:5px;padding:8px 14px;background:transparent;color:inherit}
.course-candidate [hidden]{display:none!important}
.course-page .platform-ops{display:none}
.course-page .platform-content-page{width:100%;min-width:0}
.course-page .club-page-title,.course-page .platform-page-hero{display:none}

/* Desktop / tablet: map left, Analysis/History right */
@media(min-width:900px){
  .course-workspace{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,.9fr);gap:22px;align-items:start}
  .course-map-frame{height:clamp(480px,70vh,820px);position:sticky;top:12px}
  .course-context-pane{padding-top:4px}
  .course-stats dl,.course-history-benchmarks{grid-template-columns:1fr}
  .course-candidate[data-map-visible=false] .course-workspace{grid-template-columns:1fr}
  .course-candidate[data-map-visible=false] .course-map-pane{display:none}
  .course-candidate[data-analysis-visible=false] .course-workspace{grid-template-columns:1fr}
  .course-candidate[data-analysis-visible=false] .course-context-pane{display:none}
  .course-map-visibility,.course-analysis-visibility{display:inline-flex}
  .course-history-mobile-return{display:none}
  .course-mobile-history-entry{display:none!important}
}

/* Mobile: identity → Stats → map → Profile → History entry */
@media(max-width:899px){
  .course-map-visibility,.course-analysis-visibility{display:none!important}
  .course-context-switcher{display:none}
  .course-workspace{display:flex;flex-direction:column}
  .course-context-pane{display:contents}
  .course-analysis{display:contents}
  .course-stats{order:1}
  .course-map-pane{order:2}
  .course-profile{order:3;border-top:1px solid #adb4a8;padding-top:20px;margin-top:8px}
  .course-history{order:4;border-top:1px solid #adb4a8;padding-top:20px;margin-top:8px}
  .course-candidate[data-mobile-history=open] .course-map-pane,
  .course-candidate[data-mobile-history=open] .course-stats,
  .course-candidate[data-mobile-history=open] .course-profile{display:none}
  .course-candidate[data-mobile-history=closed] .course-history{display:none}
  .course-history-mobile-return{display:block}
  .course-map-frame{height:430px}
  .course-map-status{inset:30% 6% auto;padding:18px}
  .course-stats dl{grid-template-columns:1fr 1fr}
  .course-map-identity{font-size:.75rem}
  .course-profile-heading{display:block}
  .course-intro{margin-bottom:12px}
  .course-profile svg{height:130px}
  .course-toolbar{gap:8px}
  .course-toolbar label{flex-basis:100%}
  .course-toolbar button{font-size:.8rem;padding:8px 10px}
  .course-mobile-history-entry{order:5;margin:8px 0 0}
  .course-mobile-history-entry button{font:inherit;min-height:44px;border:0;border-bottom:1px solid #c4571a;background:transparent;color:inherit;padding:8px 0;cursor:pointer}
}

@media(min-width:900px) and (max-width:1100px){
  .course-workspace{grid-template-columns:minmax(0,1.15fr) minmax(260px,1fr)}
  .course-map-frame{height:clamp(420px,62vh,680px)}
}

@media(prefers-reduced-motion:reduce){
  .course-workspace,.course-map-pane,.course-context-pane{transition:none}
}

@media(prefers-color-scheme:dark){
  .course-map-frame{background:#252e27;border-color:#505c4d}
  .course-map-status,.course-map-identity{background:#202922eb;color:#e5e9dc}
  .course-toolbar button,.course-toolbar select,.course-history-mobile-return button{border-color:#65705e}
  .course-context-switcher{border-bottom-color:#505c4d}
  .course-history-list li,.course-analysis .course-profile{border-color:#3d463c}
}
