/* Skate Bud web demo: the page around the device on demo.html only (body.dp). Prefix dp-. Light only.
   The site's look (src/site.css): its bar with the name, its type, and one navy panel like the homepage's Skate Bud
   block. The device leads at every width: a slim head (the name, one headline, the picker), the device in the
   middle, and under it the guide to the step as one line, with the rest behind its More key.
   app.html loads this file too (body.dp.dp-app): the same panel filling the window, with no bar and no foot.
   hero.html does not load it.

   Every rule but the last block hangs off html:not([data-sb-fit]), so phone mode (js/shell.js sets
   data-sb-fit="phone" on <html>) keeps base.css's bare app and its yellow coach card exactly as they were.

   js/shell.js reads data-fit-room="measure" on #sb-root: in any framed window (wider than phone mode) it sizes the device from where
   it starts on the page, so the device and the demo strip under it fit the first screen below the bar, and
   data-fit-under, the height of the guide's line, which is brought into the first screen where there is room. */

html:not([data-sb-fit]) body.dp {
  --dp-navy: #0c2454; --dp-gold: #ffc93c; --dp-cream: #fff6e2; --dp-sky: #a9d4f5;
  --dp-ink: #13202b; --dp-soft: #5b6977; --dp-rule: #dfe5ea;
  padding: 0; background: #ffffff; color: var(--dp-ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html:not([data-sb-fit]) .dp-wrap {
  max-width: 1160px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* the site's bar and foot */
.dp-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 16px; }
.dp-nav a, .dp-foot a { text-decoration: none; }
.dp-name { font-weight: 700; color: inherit; }
.dp-links { display: flex; gap: 20px; font-size: 15px; }
.dp-links a, .dp-foot a { color: #5b6977; }
.dp-links a:hover, .dp-foot a:hover { color: #13202b; }
.dp-nav a:focus-visible, .dp-foot a:focus-visible { outline: 3px solid #0c2454; outline-offset: 2px; border-radius: 4px; }
.dp-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
  margin-top: 40px; padding-block: 20px 28px; font-size: 14px; position: relative;
}
html:not([data-sb-fit]) .dp-foot::before {
  content: ""; position: absolute; top: 0; height: 1px; background: var(--dp-rule);
  left: max(20px, env(safe-area-inset-left, 0px)); right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- the panel: one column on navy. The head, the device, the guide's line under it ---------- */
html:not([data-sb-fit]) .dp .sb-root {
  max-width: none; margin: 4px 0 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 310px) minmax(0, 310px) minmax(0, 1fr); gap: 0; align-items: center;
  padding: 20px 20px 16px; border-radius: 22px; color: #ffffff;
  background-color: var(--dp-navy);
  background-image:
    radial-gradient(120% 90% at 100% 0%, rgba(40, 86, 170, 0.75), rgba(40, 86, 170, 0) 60%),
    linear-gradient(165deg, #1d3462, #0c2454 50%, #08193b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
/* .sb-side is phone mode's card. Here its parts are laid out in the panel's own grid, around the device. */
html:not([data-sb-fit]) .dp .sb-side { display: contents; }
html:not([data-sb-fit]) .dp .sb-side > * { grid-column: 1 / -1; min-width: 0; grid-row: 6; }
html:not([data-sb-fit]) .dp .sb-head { grid-row: 1; }
html:not([data-sb-fit]) .dp .sb-stage { grid-row: 2; grid-column: 1 / -1; order: 0; margin-top: 16px; }
html:not([data-sb-fit]) .dp .sb-now { grid-row: 3; grid-column: 2 / 4; }
html:not([data-sb-fit]) .dp .sb-side > .hn-row { grid-row: 4; grid-column: 2; justify-self: start; }
html:not([data-sb-fit]) .dp .sb-side > .sb-tools { grid-row: 4; grid-column: 3; justify-self: end; }
html:not([data-sb-fit]) .dp .sb-side > .sb-errors { grid-row: 5; grid-column: 2 / 4; margin-top: 10px; }
html:not([data-sb-fit]) .dp .sb-side > .sb-selftest { grid-row: 6; margin-top: 10px; }
html:not([data-sb-fit]) .dp .sb-app-note { display: none; }   /* Start over's own title says it in a wide window */
@media (min-width: 900px) {
  html:not([data-sb-fit]) .dp .sb-root { padding: 20px 32px 14px; border-radius: 28px; }
}

/* the head: the icon, the name and one headline on the left, the picker on the right. One row where it fits. */
html:not([data-sb-fit]) .dp .sb-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
}
html:not([data-sb-fit]) .dp .sb-head-words {
  position: relative; flex: 1 1 300px; min-width: 0; min-height: 46px; padding-left: 58px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
html:not([data-sb-fit]) .dp .sb-devices { flex: 0 1 auto; margin: 0 auto; }
html:not([data-sb-fit]) .dp .sb-brand {
  display: block; font-size: 13px; line-height: 1.2; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dp-sky);
}
html:not([data-sb-fit]) .dp .sb-brand::before {
  position: absolute; left: 0; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 22.5%;
  background: #17346e url(../../assets/skatebud-icon.png) center / cover no-repeat;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.22), 0 8px 18px -8px rgba(0, 0, 0, 0.6);
}
html:not([data-sb-fit]) .dp .sb-h1 {
  margin: 0; font-size: clamp(21px, 2.1vw, 25px); line-height: 1.12; font-weight: 700; letter-spacing: -0.025em;
  color: var(--dp-cream); text-wrap: balance;
}

/* the guide to the step on screen: one line under the device that points up at it. The step's title, the start of
   its words, and More for the rest. A step's own keys and controls always show. */
html:not([data-sb-fit]) .dp .sb-now {
  position: relative; margin-top: 14px; padding: 9px 9px 9px 18px; border: 0; border-radius: 16px;
  background: #ffffff; color: var(--dp-ink);
  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.7);
  display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto; align-items: center; gap: 0 10px;
}
html:not([data-sb-fit]) .dp .sb-now::after {
  content: ""; position: absolute; width: 14px; height: 14px; background: #ffffff; border-radius: 3px;
  left: 50%; top: -6px; margin-left: -7px; transform: rotate(45deg);
}
html:not([data-sb-fit]) .dp .sb-now > * { grid-column: 1 / -1; }
html:not([data-sb-fit]) .dp .sb-now b {
  grid-column: 1; margin: 0; font-size: 15.5px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html:not([data-sb-fit]) .dp .sb-now p { font-size: 15px; line-height: 1.5; }
html:not([data-sb-fit]) .dp .sb-now #sb-coach-text {
  grid-column: 2; color: var(--dp-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html:not([data-sb-fit]) .dp .sb-coach-more {
  display: inline-flex; grid-column: 3; grid-row: 1; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: 999px; background: #eef2f7; color: var(--dp-navy); cursor: pointer;
  font: 600 13.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html:not([data-sb-fit]) .dp .sb-coach-more[hidden] { display: none; }
html:not([data-sb-fit]) .dp .sb-coach-more::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px; border: solid currentColor; border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}
html:not([data-sb-fit]) .dp .sb-coach-more:hover { background: #e2e8f0; }
html:not([data-sb-fit]) .dp .sb-coach-more:focus-visible { outline: 2px solid var(--dp-navy); outline-offset: 2px; }
html:not([data-sb-fit]) .dp .sb-now .sb-coach-demo { display: none; }
html:not([data-sb-fit]) .dp .sb-now .sb-coach-actions { margin: 8px 0 3px; }
html:not([data-sb-fit]) .dp .sb-now .sb-coach-extra { margin: 8px 9px 6px 0; padding-top: 10px; border-top-color: var(--dp-rule); }
/* a step with controls of its own (the jersey step's look picker) keeps its demo note in view: the note names them */
html:not([data-sb-fit]) .dp .sb-now:has(.sb-coach-extra:not([hidden])) .sb-coach-demo:not([hidden]),
html:not([data-sb-fit]) .dp .sb-now[data-open] .sb-coach-demo:not([hidden]) {
  display: block; margin: 8px 9px 4px 0; padding-top: 9px; border-top: 1px dashed #d9c27a; font-size: 13.5px; color: #5a4d14;
}
html:not([data-sb-fit]) .dp .sb-now .sb-coach-demo::before {
  padding: 3px 6px; border-radius: 4px; background: #ffd60a; color: #1d1a05; vertical-align: 1px;
  font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase;
}
/* open: the whole of the words */
html:not([data-sb-fit]) .dp .sb-now[data-open] b { grid-column: 1 / 3; white-space: normal; }
html:not([data-sb-fit]) .dp .sb-now[data-open] #sb-coach-text {
  grid-column: 1 / -1; margin: 4px 9px 5px 0; color: var(--dp-ink); white-space: normal;
}
html:not([data-sb-fit]) .dp .sb-now[data-open] .sb-coach-more::after { margin-top: 3px; transform: rotate(-135deg); }
html:not([data-sb-fit]) .dp .sb-coach-btn { background: var(--dp-navy); }
html:not([data-sb-fit]) .dp .sb-coach-btn:focus-visible { outline-color: var(--dp-navy); }

/* the rest of the words: behind More. The lead (first sentence) always shows. */
html:not([data-sb-fit]) .dp .sb-now:not([data-open]) .sb-coach-rest { display: none; }
/* a step with controls of its own (the look pickers): all its words show, with no More (Grant, 2026-11-28) */
html:not([data-sb-fit]) .dp .sb-now:has(.sb-coach-extra:not([hidden])) .sb-coach-rest { display: inline; }
html:not([data-sb-fit]) .dp .sb-now:has(.sb-coach-extra:not([hidden])) .sb-coach-more { display: none; }
html:not([data-sb-fit]) .dp .sb-now:has(.sb-coach-extra:not([hidden])) #sb-coach-text { white-space: normal; grid-column: 1 / -1; }

/* ---------- an upright device (iPhone, Duo closed) in a wide window: the guide stands beside it, on the left ----------
   The step's title and its first sentence show, More opens the rest and the demo note. The tools sit under the guide.
   Duo open and the iPhone on its side are too wide for that: they keep the guide's line under them. */
@media (min-width: 1000px) {
  html:not([data-sb-fit]) .dp .sb-root:has(#sb-device[data-device="iphone"]),
  html:not([data-sb-fit]) .dp .sb-root:has(#sb-device[data-device="duo-cover"]) {
    --dp-beside: 1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px) minmax(0, 1fr); grid-template-rows: auto 1fr auto auto auto 1fr; column-gap: 34px;
  }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-stage,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-stage { grid-column: 2; grid-row: 2 / span 5; }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-now,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-now {
    grid-column: 1; grid-row: 3; align-self: center; justify-self: end; width: min(100%, 400px); margin-top: 14px;
    display: block; padding: 18px 20px 16px; border-radius: 18px;
  }
  /* a step with look pickers keeps its card shorter than the device: the pickers scroll inside the card, so the card
     never reaches the title row and never makes the panel taller than the first screen (QC, 2026-11-28) */
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-now .sb-coach-extra:not([hidden]),
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-now .sb-coach-extra:not([hidden]) {
    max-height: max(150px, calc(100vh - 560px)); overflow-y: auto; overscroll-behavior: contain;
  }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-now::after,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-now::after { left: auto; right: -6px; top: 26px; margin-left: 0; }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-now b,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-now b { display: block; font-size: 19px; line-height: 1.25; white-space: normal; }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-now #sb-coach-text,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-now #sb-coach-text { margin: 6px 0 0; white-space: normal; color: var(--dp-ink); }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-coach-rest,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-coach-rest { color: var(--dp-soft); }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-coach-more,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-coach-more { margin-top: 12px; }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-side > .hn-row,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-side > .hn-row { grid-column: 1; grid-row: 4; justify-self: end; align-self: start; margin-top: 10px; width: min(100%, 400px); }
  .dp .sb-root:has(#sb-device[data-device="iphone"]) .sb-side > .sb-tools,
  .dp .sb-root:has(#sb-device[data-device="duo-cover"]) .sb-side > .sb-tools { grid-column: 1; grid-row: 5; justify-self: end; align-self: start; margin-top: 0; width: min(100%, 400px); }
}

/* the two quiet controls, one line under the guide */
html:not([data-sb-fit]) .dp .hn-row {
  gap: 8px; min-height: 34px; margin-top: 6px; padding: 0 4px; border: 0; border-radius: 6px; background: none;
  font-size: 13.5px; color: rgba(255, 255, 255, 0.78);
}
html:not([data-sb-fit]) .dp .hn-check { width: 15px; height: 15px; accent-color: var(--dp-gold); }
html:not([data-sb-fit]) .dp .hn-check:focus-visible { outline-color: var(--dp-gold); }
html:not([data-sb-fit]) .dp .sb-tools { margin-top: 6px; gap: 2px; flex-wrap: nowrap; }
html:not([data-sb-fit]) .dp .sb-tools button, html:not([data-sb-fit]) .dp .sb-app-leave {
  font: 600 13.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: rgba(255, 255, 255, 0.78); background: none; white-space: nowrap;
  min-height: 34px; border: 0; border-radius: 999px; padding: 0 10px;
}
html:not([data-sb-fit]) .dp .sb-tools button:hover, html:not([data-sb-fit]) .dp .sb-app-leave:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
html:not([data-sb-fit]) .dp .sb-tools button:focus-visible, html:not([data-sb-fit]) .dp .sb-app-leave:focus-visible { outline-color: var(--dp-gold); }

/* ---------- the device and its picker, one piece ---------- */
html:not([data-sb-fit]) .dp .sb-seg {
  padding: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
html:not([data-sb-fit]) .dp .sb-seg-btn { color: rgba(255, 255, 255, 0.86); padding: 8px 13px; border-radius: 999px; }
html:not([data-sb-fit]) .dp .sb-seg-btn:hover:not(:disabled):not(.is-on) { background: rgba(255, 255, 255, 0.1); }
html:not([data-sb-fit]) .dp .sb-seg-btn.is-on { color: var(--dp-ink); background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
html:not([data-sb-fit]) .dp .sb-seg-btn:disabled { color: rgba(255, 255, 255, 0.42); }
html:not([data-sb-fit]) .dp .sb-seg-btn:focus-visible { outline-color: var(--dp-gold); }
html:not([data-sb-fit]) .dp .sb-try { background: var(--dp-gold); color: #1c1503; }
html:not([data-sb-fit]) .dp .sb-seg-btn.is-try { animation-name: dpTry; }
@keyframes dpTry {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 201, 60, 0.35); }
  50% { box-shadow: 0 0 0 2px rgba(255, 201, 60, 0.75), 0 0 12px rgba(255, 201, 60, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-sb-fit]) .dp .sb-seg-btn.is-try { animation: none; box-shadow: 0 0 0 1.5px rgba(255, 201, 60, 0.7); }
}
/* the state key beside the device (Rotate, Open, Close): clear glass on the navy, like the picker */
html:not([data-sb-fit]) .dp .sb-state {
  color: #ffffff; background: rgba(255, 255, 255, 0.13);
  -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 26px -14px rgba(0, 0, 0, 0.75);
}
html:not([data-sb-fit]) .dp .sb-state:hover { background: rgba(255, 255, 255, 0.22); }
html:not([data-sb-fit]) .dp .sb-state:active { background: rgba(255, 255, 255, 0.28); }
html:not([data-sb-fit]) .dp .sb-state:focus-visible { outline: 2px solid var(--dp-gold); outline-offset: 3px; }
html:not([data-sb-fit]) .dp .sb-state svg { color: var(--dp-gold); }
html:not([data-sb-fit]) .dp .sb-state.is-try { animation-name: dpTryKey; }
@keyframes dpTryKey {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), 0 0 0 1px rgba(255, 201, 60, 0.35), 0 12px 26px -14px rgba(0, 0, 0, 0.75); }
  50% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), 0 0 0 2.5px rgba(255, 201, 60, 0.8), 0 0 16px rgba(255, 201, 60, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-sb-fit]) .dp .sb-state.is-try { animation: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), 0 0 0 1.5px rgba(255, 201, 60, 0.75); }
}
/* the device's body against navy: a thin light edge and a deeper shadow */
html:not([data-sb-fit]) .dp .sb-bezel {
  box-shadow: inset 0 0 0 1px var(--sb-bezel-edge), 0 0 0 2px var(--sb-bezel-metal), 0 0 0 3px rgba(255, 255, 255, 0.16),
    0 30px 50px -24px rgba(0, 0, 0, 0.85);
}

/* ---------- app.html in a wide window: the same panel, filling the window. No bar, no foot, a close key ---------- */
html:not([data-sb-fit]) body.dp-app { background: #08193b; }
html:not([data-sb-fit]) .dp-app .dp-wrap { max-width: none; padding: 0; }
html:not([data-sb-fit]) .dp-app .sb-root {
  margin: 0; min-height: 100vh; border-radius: 0; box-shadow: none; align-content: start; overflow: visible;
}
html:not([data-sb-fit]) .dp-app .sb-head { padding-right: 52px; }
html:not([data-sb-fit]) .dp-app .sb-app-close {
  top: 20px; right: 20px; width: 40px; height: 40px; color: #ffffff; background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
html:not([data-sb-fit]) .dp-app .sb-app-close:hover { background: rgba(255, 255, 255, 0.22); }
html:not([data-sb-fit]) .dp-app .sb-app-close:focus-visible { outline-color: var(--dp-gold); }

/* ---------- phone mode: the bare app. No bar, no foot, no panel. ---------- */
html[data-sb-fit] .dp-nav, html[data-sb-fit] .dp-foot { display: none; }
@media (max-width: 520px) {
  .dp-nav, .dp-foot { display: none; }
}
