/*
  Capable Body visual and usability refinement — v50.8.9
  Presentation-only layer. No rules, dose, safety, storage, or routing logic.
*/
:root{
  --cb-midnight:#041722;
  --cb-navy:#071d2b;
  --cb-navy-soft:#103348;
  --cb-paper:#fffdf9;
  --cb-cream:#f4efe5;
  --cb-warm:#fbf7ef;
  --cb-rust:#c55732;
  --cb-rust-dark:#9f3e20;
  --cb-gold:#d6a53b;
  --cb-teal:#247f87;
  --cb-teal-soft:#e8f6f4;
  --cb-line:#ded5c8;
  --cb-ink:#14212a;
  --cb-muted:#5f6d76;
  --cb-shadow-sm:0 10px 28px rgba(4,23,34,.08);
  --cb-shadow-md:0 20px 55px rgba(4,23,34,.13);
  --cb-shadow-lg:0 34px 90px rgba(4,23,34,.2);
  --cb-radius-sm:14px;
  --cb-radius-md:20px;
  --cb-radius-lg:28px;
}

html{background:var(--cb-midnight)}
body{
  min-width:320px;
  background:
    radial-gradient(circle at 12% 4%,rgba(36,127,135,.14),transparent 30rem),
    radial-gradient(circle at 88% 18%,rgba(214,165,59,.12),transparent 28rem),
    var(--cb-cream);
  color:var(--cb-ink);
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  opacity:.22;
  background-image:linear-gradient(rgba(7,29,43,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(7,29,43,.035) 1px,transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(to bottom,#000,transparent 70%);
}

/* Header and navigation */
.site-header{
  min-height:74px;
  padding-top:10px;
  padding-bottom:10px;
  background:rgba(4,23,34,.96);
  border-bottom:1px solid rgba(255,255,255,.11);
  box-shadow:0 10px 34px rgba(4,23,34,.24);
}
.wordmark{min-width:max-content}
.wordmark span{
  width:40px;height:40px;
  border:0;
  background:linear-gradient(145deg,var(--cb-rust),#df744d);
  color:#fff;
  box-shadow:0 8px 22px rgba(197,87,50,.28),inset 0 0 0 1px rgba(255,255,255,.2);
}
.wordmark strong{font-size:17px;letter-spacing:.13em}
.site-header .desktop-nav{gap:5px}
.site-header nav a{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  padding:9px 11px;
  border-radius:999px;
  font-size:13px;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
.site-header nav a:hover,.site-header nav a:focus-visible{
  background:rgba(255,255,255,.09);
  color:#fff;
  text-decoration:none;
  transform:translateY(-1px);
  outline:2px solid rgba(214,165,59,.55);
  outline-offset:2px;
}
.site-header nav a[aria-current="page"]{
  background:rgba(255,255,255,.1);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.14);
  color:#fff;
}
.site-header nav .nav-today{
  /* Phase 9 a11y repair E: white on --cb-rust was 4.39:1 (<4.5 AA at 13px). */
  background:var(--cb-rust-dark);
  color:#fff;
  box-shadow:0 8px 18px rgba(159,62,32,.28);
}
.site-header nav .nav-today:hover,.site-header nav .nav-today:focus-visible{
  background:#822f18;
  color:#fff;
}
.mobile-nav{display:none;position:relative}
.mobile-nav summary{
  list-style:none;
  min-width:72px;
  min-height:44px;
  display:grid;
  place-items:center;
  cursor:pointer;
  border:1px solid rgba(255,255,255,.25);
  border-radius:999px;
  color:#fff;
  font-family:"Barlow Condensed",sans-serif;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.mobile-nav summary::-webkit-details-marker{display:none}
.mobile-nav[open] summary{background:var(--cb-rust);border-color:var(--cb-rust)}
.mobile-nav nav{
  position:absolute;
  right:0;
  top:54px;
  width:min(310px,calc(100vw - 28px));
  display:grid;
  gap:6px;
  padding:12px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:18px;
  background:rgba(4,23,34,.99);
  box-shadow:var(--cb-shadow-lg);
}
.mobile-nav nav a{justify-content:flex-start;padding:11px 13px}

/* Main shell and hero */
main{
  position:relative;
  width:min(1280px,100%);
  background:var(--cb-paper);
  border-inline:1px solid rgba(7,29,43,.05);
  box-shadow:var(--cb-shadow-lg);
  overflow:clip;
}
.hero{
  position:relative;
  min-height:560px;
  background:
    radial-gradient(circle at 14% 18%,rgba(36,127,135,.26),transparent 25rem),
    linear-gradient(135deg,var(--cb-midnight),var(--cb-navy-soft));
}
.hero::after{
  content:"";
  position:absolute;
  left:0;right:0;bottom:0;
  height:92px;
  pointer-events:none;
  background:linear-gradient(to top,rgba(4,23,34,.5),transparent);
}
.hero-copy{z-index:1;padding-left:clamp(30px,6.3vw,84px);padding-right:clamp(30px,6vw,78px)}
.hero-copy::before{height:5px;width:74px;border-radius:5px;background:linear-gradient(90deg,var(--cb-rust),var(--cb-gold))}
.hero-copy::after{
  content:"";
  position:absolute;
  right:-120px;
  bottom:-190px;
  width:390px;height:390px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:50%;
  box-shadow:0 0 0 42px rgba(255,255,255,.025),0 0 0 94px rgba(255,255,255,.018);
  pointer-events:none;
}
.hero .eyebrow{color:#f2c866;font-size:14px}
.hero h1{max-width:690px;text-wrap:balance;text-shadow:0 3px 24px rgba(0,0,0,.24)}
.hero-copy>p:not(.eyebrow){max-width:640px;color:#ede7dc;text-wrap:pretty}
.hero-image{
  position:relative;
  background-image:linear-gradient(90deg,var(--cb-navy),rgba(7,29,43,.1) 30%),linear-gradient(0deg,rgba(4,23,34,.34),transparent 50%),url('/capable-body-assets/hero.webp');
  filter:saturate(.84) contrast(1.04);
}
.hero-actions{gap:10px;margin-top:32px}
.hero-actions a,.hero-actions button,.btn{
  min-height:50px;
  padding:12px 20px;
  font-size:14px;
  letter-spacing:.005em;
  box-shadow:none;
  transition:transform .18s ease,box-shadow .18s ease,background .18s ease,border-color .18s ease;
}
.hero-actions .primary,.btn.primary{
  /* E.1: solid dark rust for AA contrast (gradient rust/orange failed at 4.3:1) */
  background:var(--cb-rust-dark);
  border-color:transparent;
  color:#fff;
  box-shadow:0 10px 24px rgba(159,62,32,.28);
}
.hero-actions .light{background:rgba(255,255,255,.96);color:var(--cb-navy);border-color:#fff}
.hero-actions a:hover,.hero-actions a:focus-visible,.btn:hover,.btn:focus-visible{
  transform:translateY(-2px);
  box-shadow:0 12px 26px rgba(4,23,34,.16);
  outline:3px solid rgba(214,165,59,.55);
  outline-offset:2px;
}
body:not([data-cb-route="home"]) .hero{min-height:390px;grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr)}
body:not([data-cb-route="home"]) .hero-copy{padding-top:58px;padding-bottom:72px}
body:not([data-cb-route="home"]) .hero h1{font-size:clamp(48px,6vw,74px);line-height:.86}
body:not([data-cb-route="home"]) .hero-image{min-height:390px;background-position:center 30%}
body[data-cb-view="player-power"] .hero,
body[data-cb-route="adaptive-day"] .hero{
  background:radial-gradient(circle at 15% 20%,rgba(214,165,59,.17),transparent 25rem),linear-gradient(135deg,#041722,#0b3042);
}
body[data-cb-view="player-power"] .hero-image,
body[data-cb-route="adaptive-day"] .hero-image{filter:saturate(.72) contrast(1.06)}

/* Setup summary becomes a clear, floating control strip */
.setup-bar{
  position:relative;
  z-index:4;
  width:calc(100% - 64px);
  margin:-30px auto 0;
  grid-template-columns:repeat(3,minmax(0,1fr)) auto;
  gap:0;
  border:1px solid rgba(7,29,43,.1);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 18px 44px rgba(4,23,34,.17);
}
.setup-bar>div{padding:17px 22px;background:linear-gradient(180deg,#fff,#fbfaf7);border-right:1px solid var(--cb-line)}
.setup-bar span{font-size:11px;color:var(--cb-rust)}
.setup-bar strong{font-size:15px;color:var(--cb-navy)}
.setup-bar button{
  min-width:150px;
  background:linear-gradient(145deg,var(--cb-gold),#e2bc64);
  transition:filter .18s ease,transform .18s ease;
}
.setup-bar button:hover,.setup-bar button:focus-visible{filter:brightness(1.05);outline:3px solid rgba(36,127,135,.45);outline-offset:-4px}

/* Content rhythm and headings */
.content-shell{
  padding-top:clamp(54px,7vw,88px);
  background:
    radial-gradient(circle at 96% 4%,rgba(214,165,59,.07),transparent 26rem),
    linear-gradient(180deg,#fffdf9,#fff 38rem);
}
.content-shell>.section-heading:not(:first-child){margin-top:clamp(54px,7vw,82px)}
.section-heading{
  align-items:center;
  margin-bottom:30px;
  padding-bottom:19px;
  border-bottom:1px solid var(--cb-line);
}
.section-heading::after{
  content:"";
  position:absolute;
}
.section-heading .eyebrow{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:5px 10px;
  border-radius:999px;
  background:#f8eadf;
  color:var(--cb-rust-dark);
  font-size:11px;
}
.section-heading h2{font-size:clamp(38px,5vw,64px);letter-spacing:-.025em;text-wrap:balance}
.section-heading p{max-width:520px;font-size:15px;line-height:1.65;color:var(--cb-muted);text-wrap:pretty}
.grid{gap:20px}

/* Cards and action hierarchy */
.card{
  position:relative;
  overflow:hidden;
  min-height:210px;
  padding:25px;
  border-color:rgba(7,29,43,.11);
  border-radius:var(--cb-radius-md);
  background:linear-gradient(180deg,#fff,#fefcf8);
  box-shadow:var(--cb-shadow-sm);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}
.card::after{
  content:"";
  position:absolute;
  top:-44px;right:-44px;
  width:128px;height:128px;
  border-radius:50%;
  background:rgba(197,87,50,.055);
}
.card.teal::after{background:rgba(36,127,135,.07)}
.card.gold::after{background:rgba(214,165,59,.085)}
.card .tag{position:relative;z-index:1;font-size:11px}
.card h3{position:relative;z-index:1;font-size:31px;letter-spacing:-.01em;text-wrap:balance}
.card p,.card li{position:relative;z-index:1;font-size:14px;line-height:1.62;color:#47545e}
.card .actions{position:relative;z-index:1;padding-top:21px}
.card .btn{min-height:46px;background:#f5f0e7;border-color:#d9d0c2}
.card .btn.primary::after{content:"  ›";font-size:19px;line-height:0;margin-left:5px}
@media(hover:hover){
  .card:hover{transform:translateY(-5px);box-shadow:0 22px 52px rgba(4,23,34,.13);border-color:rgba(7,29,43,.18)}
}

/* Forms and choices */
.setup-panel{
  max-width:920px;
  padding:clamp(24px,4vw,38px);
  border-color:rgba(7,29,43,.12);
  border-radius:var(--cb-radius-lg);
  background:linear-gradient(180deg,#fff,#fdfbf6);
  box-shadow:var(--cb-shadow-md);
}
body[data-cb-route="adaptive-day"] .setup-panel{max-width:1040px}
.setup-panel fieldset{
  padding:0 0 25px;
  margin:0 0 26px;
  border-bottom:1px solid var(--cb-line);
}
.setup-panel fieldset:last-of-type{border-bottom:0}
.setup-panel legend{font-size:26px;letter-spacing:-.01em}
.choice-grid{gap:12px}
.choice label{
  min-height:96px;
  padding:17px;
  border-color:#d8d0c5;
  background:#fff;
  box-shadow:0 4px 12px rgba(4,23,34,.035);
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease;
}
.choice label:hover{border-color:#adbbb9;background:#fdfbf7}
.choice input:checked+label{
  border-color:var(--cb-rust);
  background:linear-gradient(145deg,#fff8f3,#fff);
  box-shadow:0 0 0 4px rgba(197,87,50,.1),0 10px 24px rgba(4,23,34,.07);
  transform:translateY(-1px);
}
.form-grid{gap:14px}
.form-grid .field{
  padding:14px;
  border:1px solid #e1d9ce;
  border-radius:14px;
  background:#fff;
}
.field label{font-size:14px;color:var(--cb-navy)}
.field input,.field textarea,.field select,.own-plan-row select{
  min-height:48px;
  border:1px solid #bbc5c7;
  border-radius:11px;
  color:var(--cb-ink);
  background:#fff;
  box-shadow:inset 0 1px 2px rgba(4,23,34,.04);
}
.field input:focus,.field textarea:focus,.field select:focus,.own-plan-row select:focus{
  border-color:var(--cb-teal);
  outline:3px solid rgba(36,127,135,.18);
  outline-offset:1px;
}
.save-row{gap:14px;margin-top:22px}
.save-row button{min-height:50px;padding-inline:24px;background:linear-gradient(145deg,var(--cb-rust),#d96d45);box-shadow:0 10px 22px rgba(197,87,50,.22)}
.saved{display:inline-flex;align-items:center;min-height:32px;color:#176b55}
.privacy-note{padding:17px 19px;border-radius:14px;background:var(--cb-teal-soft);border-color:#b5dcd8}

/* Decision and status surfaces */
.why-today{
  position:relative;
  overflow:hidden;
  padding:28px 30px;
  border:1px solid rgba(255,255,255,.08);
  background:radial-gradient(circle at 92% 10%,rgba(214,165,59,.16),transparent 16rem),linear-gradient(135deg,#041722,#123b50);
  box-shadow:0 20px 50px rgba(4,23,34,.2);
}
.why-today::after{
  content:"WHY";
  position:absolute;
  right:18px;bottom:-28px;
  font-family:"Barlow Condensed",sans-serif;
  font-size:118px;
  font-weight:900;
  color:rgba(255,255,255,.035);
  pointer-events:none;
}
.why-today h3{font-size:38px;letter-spacing:-.01em}
.why-today p{position:relative;z-index:1;max-width:880px;font-size:18px}
.status-banner{
  position:relative;
  overflow:hidden;
  padding:24px 25px;
  border-color:rgba(7,29,43,.1);
  border-left-width:7px;
  border-radius:18px;
  box-shadow:var(--cb-shadow-sm);
}
.status-banner strong{font-size:28px}
.status-banner p{max-width:920px}
.status-banner.choice{background:linear-gradient(135deg,#fffaf0,#fff)}
.status-banner.foundation{background:linear-gradient(135deg,#eef9f8,#fff)}
.status-banner.redirect,.status-banner.hold{background:linear-gradient(135deg,#fff5ef,#fff)}
.notice{border-radius:16px;box-shadow:var(--cb-shadow-sm)}

/* Session and Power interfaces */
.session-summary,.receipt-panel{
  border-color:rgba(7,29,43,.1);
  border-radius:18px;
  box-shadow:var(--cb-shadow-sm);
}
.session-summary article,.receipt-panel>div{padding:20px;background:linear-gradient(180deg,#fff,#fbfaf7)}
.session-summary strong,.receipt-panel strong{font-size:15px}
.player{gap:24px}
.player-panel{
  border-color:rgba(7,29,43,.11);
  border-radius:22px;
  background:linear-gradient(180deg,#fff,#fdfbf7);
  box-shadow:var(--cb-shadow-sm);
}
.player-panel h3{font-size:36px}
.step-list li{padding:16px 0}
.step-list .num{box-shadow:0 8px 16px rgba(4,23,34,.16)}
.safety-box{
  position:relative;
  overflow:hidden;
  padding:28px;
  border-left:7px solid var(--cb-gold);
  background:radial-gradient(circle at 92% 12%,rgba(214,165,59,.14),transparent 16rem),linear-gradient(135deg,#041722,#103549);
  box-shadow:var(--cb-shadow-md);
}
.power-manual-controls{
  padding:28px;
  border-color:rgba(7,29,43,.11);
  background:linear-gradient(180deg,#fff,#fbfaf7);
  box-shadow:var(--cb-shadow-sm);
}
.manual-control-grid .btn,.own-plan-row .btn{min-height:48px;background:#f5f0e7}
.terminal-actions{
  padding:28px;
  border-color:#e0c27a;
  background:linear-gradient(135deg,#fff9e9,#fff);
  box-shadow:var(--cb-shadow-sm);
}
.context-callout{border-radius:18px;background:linear-gradient(135deg,#eaf8f6,#fff)}

/* Mission and hub components loaded from the secondary stylesheet */
.cb-hub-orientation,.cb-book-bridge{
  background:radial-gradient(circle at 90% 10%,rgba(214,165,59,.14),transparent 18rem),linear-gradient(135deg,#041722,#11384c);
  border:1px solid rgba(255,255,255,.06);
  box-shadow:var(--cb-shadow-md);
}
.cb-hub-path>a{transition:transform .18s ease,background .18s ease,border-color .18s ease}
.cb-hub-path>a:hover,.cb-hub-path>a:focus-visible{transform:translateX(4px);outline:3px solid rgba(214,165,59,.35);outline-offset:2px}
.cb-hub-today-card,.cb-hub-mission-card,.cb-hub-help,.cb-mission-builder,.cb-mission-progress{
  border-color:rgba(7,29,43,.11);
  box-shadow:var(--cb-shadow-sm);
}
.cb-hub-capacity-links a{
  min-height:140px;
  border-radius:18px;
  background:linear-gradient(145deg,#071d2b,#12384b);
  box-shadow:0 13px 30px rgba(4,23,34,.13);
  transition:transform .18s ease,box-shadow .18s ease;
}
@media(hover:hover){.cb-hub-capacity-links a:hover{transform:translateY(-4px);box-shadow:0 20px 38px rgba(4,23,34,.2)}}

/* Footer */
footer{
  width:min(1280px,100%);
  padding-top:28px;
  padding-bottom:28px;
  background:linear-gradient(135deg,#041722,#0b2a3b);
  border-top:1px solid rgba(255,255,255,.08);
}
footer a{min-height:40px;display:inline-flex;align-items:center;text-decoration:none}
footer a:hover,footer a:focus-visible{color:#fff;text-decoration:underline;text-underline-offset:4px;outline:none}

/* Responsive refinements */
@media(max-width:1120px){
  .site-header nav a{padding-inline:8px;font-size:12px}
  .site-header .desktop-nav{gap:2px}
}
@media(max-width:900px){
  .site-header .desktop-nav{display:none}
  .mobile-nav{display:block}
  main{box-shadow:none;border-inline:0}
  body:not([data-cb-route="home"]) .hero{grid-template-columns:1fr;min-height:auto}
  body:not([data-cb-route="home"]) .hero-image{min-height:260px;order:-1}
  .setup-bar{width:calc(100% - 34px);margin:-22px auto 0;grid-template-columns:repeat(3,1fr)}
  .setup-bar button{grid-column:1/-1;min-height:48px}
  .content-shell{padding-top:56px}
}
@media(max-width:620px){
  .site-header{min-height:68px;padding-inline:15px}
  .wordmark strong{max-width:190px;line-height:1.05}
  .hero-image{min-height:265px}
  .hero-copy{padding:52px 22px 64px}
  .hero-copy::before{left:22px}
  body:not([data-cb-route="home"]) .hero-copy{padding:48px 22px 64px}
  .hero h1,body:not([data-cb-route="home"]) .hero h1{font-size:clamp(44px,14vw,62px);line-height:.86}
  .hero-copy>p:not(.eyebrow){font-size:18px}
  .hero-actions{display:grid}
  .hero-actions a,.hero-actions button{width:100%}
  .setup-bar{width:calc(100% - 24px);grid-template-columns:1fr;border-radius:16px}
  .setup-bar>div{padding:12px 16px;border-right:0;border-bottom:1px solid var(--cb-line)}
  .content-shell{padding-inline:18px;padding-bottom:70px}
  .section-heading{margin-bottom:23px}
  .section-heading h2{font-size:40px}
  .card{padding:22px}
  .setup-panel{padding:21px;border-radius:20px}
  .form-grid .field{padding:12px}
  .field select,.field input,.own-plan-row select{font-size:16px}
  .choice label{min-height:0}
  .why-today,.power-manual-controls,.terminal-actions,.safety-box{padding:22px}
  .why-today h3{font-size:32px}
  .why-today p{font-size:17px}
  .status-banner{padding:21px}
  .session-summary article,.receipt-panel>div{padding:17px}
  footer{padding-inline:20px}
}
@media(prefers-reduced-motion:reduce){
  .card,.btn,.hero-actions a,.site-header nav a,.cb-hub-path>a,.cb-hub-capacity-links a{transition:none!important;transform:none!important}
}

/* Phase 9 real-device reflow Patch B — presentation only.
   At the exact 320 CSS-pixel floor, let the wordmark shrink and keep Menu fully in-view. */
@media(max-width:360px){
  body{min-width:0}
  .site-header{gap:8px;padding-inline:10px}
  .wordmark{min-width:0;flex:1 1 auto;gap:8px}
  .wordmark span{width:36px;height:36px;flex:0 0 36px}
  .wordmark strong{min-width:0;max-width:150px;font-size:13px;letter-spacing:.08em;line-height:1.02}
  .mobile-nav{flex:0 0 auto}
  .mobile-nav summary{min-width:58px;min-height:44px;padding-inline:8px}
}


/* Phase 9 a11y repair E.1: primary button contrast */
/* white on #c55a32/#c55732 was ~4.3:1 at 14px bold; need >=4.5 AA */
.btn.primary,
a.btn.primary,
.hero-actions .primary,
.hero-actions a.primary,
.card .btn.primary,
.status-banner .btn.primary,
.manual-control-grid .btn.primary,
.save-row button,
button.btn.primary {
  background: var(--cb-rust-dark) !important;
  border-color: var(--cb-rust-dark) !important;
  color: #fff !important;
}
.btn.primary:hover,
a.btn.primary:hover,
.btn.primary:focus-visible,
a.btn.primary:focus-visible,
.hero-actions .primary:hover,
.hero-actions .primary:focus-visible {
  background: #822f18 !important;
  border-color: #822f18 !important;
  color: #fff !important;
}
