/* Sahai Colour Guide (2026-12-02, second pass). The colour step of buying a Sahai: the device large on the left,
     recommended looks (slider), "make it yours" by zone or part, and a summary on the right.
     Every painted pixel is a real Fusion render of that paint (assets/views/<view>/<800|1200>/paints/<paint>.avif|webp),
     masked per part in the browser. Bandwidth: 800 px on phones, AVIF where supported, other views only when needed,
     ?v=<version> on every asset so a CDN / browser can cache them for a year. Look: website doc 06 section 2. */
  :root {
    --bg: #ffffff;
    --bg-soft: #fafcff;
    --hero: linear-gradient(180deg, #ffffff 0%, #eef6ff 60%, #ffffff 100%);
    --ink: #1a1d21;
    --ink-2: #3d4148;
    --muted: #666b73;
    --faint: #8d929a;
    --line: #e6e8ec;
    --card: #ffffff;
    --chip: #f3f5f8;
    --accent: #0a6fb3;
    --accent-soft: #e8f3fc;
    --night: #0b0f14;
    --on-night: #ffffff;
    --stage-a: #ffffff;
    --stage-b: #e6ecf4;
    --gold: #b7791f;
    --shadow: 0 0 0 1px rgba(4, 23, 43, .05), 0 20px 25px -5px rgba(0, 0, 0, .08), 0 8px 10px -6px rgba(0, 0, 0, .08);
    --dev-shadow: drop-shadow(0 30px 34px rgba(20, 30, 45, .30));
    --r-card: 24px; --r-stage: 32px;
    --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
    --font-ui: "Inter", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    color-scheme: light;
  }
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html { background: var(--bg); }
  body {
    margin: 0; background: var(--hero); background-repeat: no-repeat; background-size: 100% 900px; background-color: var(--bg);
    color: var(--ink); font: 400 16px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  button { font: inherit; color: inherit; }
  .wrap { max-width: 1520px; margin: 0 auto; padding: 14px 0 56px; }

  .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .2em; font-size: 13px; color: var(--ink-2); }
  .brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
  .pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 10px 18px;
    font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink);
    transition: border-color .15s, background .15s, transform .1s; white-space: nowrap;
  }
  .pill:hover { border-color: var(--faint); }
  .pill:active { transform: scale(.98); }
  .pill.primary { background: var(--night); color: var(--on-night); border-color: var(--night); }
  .pill.small { padding: 6px 14px; font-size: 13px; }
  .pill.on { border-color: var(--ink); }
  .pill:focus-visible, .rec:focus-visible, .seg button:focus-visible, .zrow:focus-visible, .paint:focus-visible,
  .sugg:focus-visible, .link:focus-visible, .nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* layout: big sticky stage on the left, everything else on the right */
  .grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(380px, 1fr); grid-template-areas: "stage intro" "stage steps";
          grid-template-rows: auto 1fr; gap: 0 36px; align-items: start; }
  .intro { grid-area: intro; padding: 6px 0 22px; }
  .stage-col { grid-area: stage; position: sticky; top: 12px; }
  .panel { grid-area: steps; display: grid; gap: 18px; min-width: 0; }
  @media (max-width: 980px) {
    .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "stage" "steps"; grid-template-rows: auto; gap: 0; }
    .stage-col { top: 0; z-index: 5; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 18px; }
  }

  .kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 4.2vw, 58px); line-height: 1.04;
       letter-spacing: -.02em; margin: 6px 0 10px; text-wrap: balance; }
  h1 em { font-style: normal; background: linear-gradient(90deg, #0a6fb3, #45b7ff 45%, #e8a23a); -webkit-background-clip: text;
          background-clip: text; color: transparent; }
  .intro p { margin: 0; color: var(--muted); font-size: 17px; max-width: 52ch; }
  .stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; margin-top: 18px; }
  .stats div { padding: 0 22px; border-left: 1px solid var(--line); display: grid; }
  .stats div:first-child { padding-left: 0; border-left: 0; }
  .stats b { font-family: var(--font-display); font-weight: 420; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; }
  .stats b.big { background: linear-gradient(90deg, #0a6fb3, #45b7ff 50%, #e8a23a); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .stats span { font-size: 13px; color: var(--muted); }
  @media (max-width: 460px) { .stats div { padding: 0 12px; } .stats b { font-size: 24px; } }

  /* stage */
  .stage {
    position: relative; border-radius: var(--r-stage); overflow: hidden; height: calc(100vh - 70px); min-height: 540px; max-height: 1000px;
    background: radial-gradient(62% 58% at 50% 46%, var(--stage-a) 0%, var(--stage-b) 100%); box-shadow: var(--shadow);
    container-type: size;
  }
  @media (max-width: 980px) { .stage { height: 54vh; min-height: 330px; border-radius: 0 0 26px 26px; } }
  .devbox { position: absolute; left: 50%; top: 50%; width: min(98cqw, 92cqh); aspect-ratio: 1 / 1; transform: translate(-50%, -50.5%); }
  .devbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .devbox canvas.device { filter: var(--dev-shadow); cursor: pointer; transition: opacity .2s; }
  .devbox canvas.device.loading { opacity: .65; }
  .devbox canvas.hl { pointer-events: none; opacity: 0; transition: opacity .25s; }
  .devbox canvas.hl.on { opacity: 1; }
  .stage-head { position: absolute; left: 24px; right: 24px; top: 20px; display: flex; justify-content: space-between; gap: 12px; pointer-events: none; }
  .look-name { display: grid; gap: 2px; }
  .look-name b { font-family: var(--font-display); font-weight: 420; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; }
  .look-name span { font-size: 13px; color: var(--muted); }
  @media (max-width: 980px) { .look-name b { font-size: 20px; } .stage-head { top: 14px; left: 18px; } }
  .seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: color-mix(in srgb, var(--card) 85%, transparent);
         border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .seg button { border: 0; background: none; border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
  .seg button[aria-pressed="true"] { background: var(--night); color: var(--on-night); }
  .stage-foot { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
  .stage-foot .seg { pointer-events: auto; }
  .tap-hint { font-size: 12px; color: var(--faint); padding-top: 4px; text-align: right; }
  @media (max-width: 980px) { .stage-foot { bottom: 12px; } .tap-hint { display: none; } }

  /* steps */
  .step { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 16px; min-width: 0; }
  .step-h { display: flex; align-items: center; gap: 12px; }
  .step-h .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600;
                 background: var(--chip); color: var(--ink-2); flex: none; }
  .step-h h2 { font-family: var(--font-display); font-weight: 420; font-size: 24px; margin: 0; letter-spacing: -.01em; line-height: 1.15; }
  .step-h .opt { margin-left: auto; font-size: 12px; color: var(--faint); }
  .sub { margin: -8px 0 0; color: var(--muted); font-size: 14px; }
  .teaser { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-top: -6px; }
  .teaser .sub { margin: 0; max-width: 36ch; }
  .custom-body { display: grid; gap: 16px; min-width: 0; }
  #custom-hide { margin-left: auto; font-size: 13px; }

  /* recommendation slider */
  .step > *, .slider, .track { min-width: 0; }
  .slider { position: relative; margin: 0 -22px; }
  .track { display: grid; grid-auto-flow: column; grid-auto-columns: 172px; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
           padding: 4px 22px 12px; scroll-padding: 0 22px; scrollbar-width: thin; overscroll-behavior-x: contain; }
  .rec { position: relative; scroll-snap-align: start; text-align: left; border: 1px solid var(--line); background: var(--bg-soft); border-radius: 18px;
         padding: 14px 14px 12px; cursor: pointer; display: grid; gap: 8px; align-content: start; transition: border-color .15s, background .15s; }
  .rec:hover { border-color: var(--faint); }
  .rec[aria-pressed="true"] { border-color: var(--ink); background: var(--card); box-shadow: 0 0 0 1px var(--ink); }
  .chipset { display: flex; align-items: center; height: 44px; }
  .chipset i { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--card); margin-left: -12px; display: block;
               box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
  .chipset i:first-child { margin-left: 0; width: 44px; height: 44px; }
  .rec strong { font-size: 14px; font-weight: 600; line-height: 1.25; }
  .rec .var { font-size: 12px; color: var(--muted); }
  .score { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
  .pips { display: inline-flex; gap: 2px; }
  .pips b { width: 6px; height: 6px; border-radius: 50%; background: var(--line); display: block; }
  .pips b.on { background: var(--gold); }
  .badge { position: absolute; top: 10px; right: 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px;
           background: var(--night); color: var(--on-night); }
  .nav { position: absolute; top: 50%; transform: translateY(-60%); width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
         background: var(--card); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; font-size: 18px; line-height: 1; z-index: 1; }
  .nav.prev { left: 6px; } .nav.next { right: 6px; }
  @media (hover: none) { .nav { display: none; } }
  .sigs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .rec.sig { padding: 16px; background: var(--card); }
  .rec.sig .chipset i { width: 44px; height: 44px; }
  .rec.sig .chipset i:first-child { width: 50px; height: 50px; }
  .rec.sig strong { font-family: var(--font-display); font-weight: 420; font-size: 18px; letter-spacing: -.01em; }
  @media (max-width: 520px) { .sigs { grid-template-columns: minmax(0, 1fr); } .rec.sig { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
    .rec.sig .chipset { grid-row: span 3; } }
  .rec .var { font-size: 12px; color: var(--muted); line-height: 1.35; }
  .rec-meta .seg button { padding: 5px 12px; font-size: 12.5px; white-space: nowrap; }
  .rec-meta { flex-wrap: wrap; }
  .rec .badge { position: static; justify-self: start; }
  .rec-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-top: -6px; }

  /* zones */
  .zones { display: grid; gap: 8px; }
  .zone { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg-soft); }
  .zone.open { background: var(--card); border-color: var(--ink-2); }
  .zrow { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px;
          background: none; border: 0; text-align: left; cursor: pointer; }
  .zrow .big { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }
  .zrow .t { display: grid; min-width: 0; }
  .zrow .t b { font-size: 15px; font-weight: 600; }
  .zrow .t span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .zrow .chev { font-size: 13px; color: var(--muted); font-weight: 600; }
  .zbody { padding: 4px 14px 14px; display: grid; gap: 12px; }
  .quick { display: flex; flex-wrap: wrap; gap: 6px; }
  .fam { display: grid; gap: 6px; }
  .fam h4 { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
  .paints { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
  .paint { border: 1px solid transparent; background: none; border-radius: 12px; padding: 6px 4px; cursor: pointer; display: grid;
           justify-items: center; gap: 4px; min-width: 0; }
  .paint:hover { background: var(--chip); }
  .paint[aria-pressed="true"] { border-color: var(--ink); background: var(--chip); }
  .paint .sw { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .14); }
  .paint span { font-size: 12px; line-height: 1.2; text-align: center; color: var(--ink-2); }
  .paint small { font-size: 10.5px; color: var(--faint); text-transform: capitalize; }
  .advice { border-radius: 16px; background: var(--accent-soft); padding: 14px 16px; display: grid; gap: 10px; }
  .advice p { margin: 0; font-size: 14px; color: var(--ink-2); }
  .advice .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
  .advice .head b { font-weight: 600; }
  .suggs { display: flex; flex-wrap: wrap; gap: 6px; }
  .sugg { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
          padding: 4px 11px 4px 5px; font-size: 13px; cursor: pointer; }
  .sugg i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); display: block; }
  .sugg em { font-style: normal; color: var(--faint); font-size: 12px; }
  .note { font-size: 13px; color: var(--muted); margin: 0; }
  .count { font-size: 13px; color: var(--muted); margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--chip); }
  .count b { color: var(--ink); font-weight: 600; }
  .switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
  .switch input { width: 16px; height: 16px; accent-color: var(--accent); }
  .row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
  .link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; }

  /* summary */
  .sum .r { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
  .sum .r:first-child { border-top: 0; }
  .sum .r i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }
  .sum .r span { font-size: 14px; color: var(--muted); }
  .sum .r b { font-size: 14px; font-weight: 600; text-align: right; }
  .code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; letter-spacing: .06em; background: var(--chip); border-radius: 8px; padding: 3px 8px; margin-left: auto; }
  .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  /* Scoped to the studio, so the site header's Guides menu keeps its own style. */
  main details { border-top: 1px solid var(--line); padding-top: 12px; }
  main summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }
  .spec { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
  .spec b { color: var(--ink-2); font-weight: 600; }
  .toast { min-height: 1.4em; font-size: 14px; color: var(--accent); font-weight: 600; }
  footer { margin-top: 30px; color: var(--faint); font-size: 13px; max-width: 90ch; }
  footer p { margin: 0; }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
