/* STYLING GUIDE — a visual guidebook in 16 lessons (prefix sg-) */

/* ---------- part colour system ---------- */
.sg-p--choose  { --pc: var(--mint);   --pc-t: var(--ink); }
.sg-p--combine { --pc: var(--lav);    --pc-t: var(--ink); }
.sg-p--wear    { --pc: var(--orange); --pc-t: var(--ink); }
.sg-p--care    { --pc: var(--ink);    --pc-t: var(--paper); }

/* ================= COVER ================= */
.sg-cover { border-bottom: 1px solid var(--ink); padding-bottom: clamp(32px, 5vw, 64px); }
.sg-cover__grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px);
  align-items: end; padding-top: clamp(32px, 5vw, 72px);
}
.sg-cover__type { display: grid; gap: clamp(18px, 2.4vw, 28px); justify-items: start; }
.sg-cover__title { display: grid; line-height: .84; }
.sg-cover__l1 { font-size: clamp(2.9rem, 9.4vw, 9.2rem); font-variation-settings: "wdth" 62; font-stretch: 62%; letter-spacing: -.02em; }
.sg-cover__l2 { font-size: clamp(1.7rem, 4.6vw, 4.4rem); margin-top: .1em; box-shadow: inset 0 -.14em 0 var(--orange); justify-self: start; }
.sg-cover .lede { max-width: 46ch; }

.sg-parts { background: var(--ink); color: var(--paper); padding: clamp(16px, 2vw, 24px); }
.sg-parts__h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid rgba(247, 246, 240, .3); }
.sg-parts__h span:first-child { color: var(--orange); }
.sg-parts ol { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.sg-parts a {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px;
  background: var(--pc); color: var(--pc-t); text-decoration: none; padding: 12px 16px; min-height: 44px;
  transition: transform .3s var(--ease);
}
.sg-parts .sg-p--care a { outline: 1px solid rgba(247, 246, 240, .35); outline-offset: -1px; }
.sg-parts a:hover { transform: translateX(6px); }
.sg-parts a:focus-visible { outline: 3px solid var(--lemon); outline-offset: 2px; }
.sg-parts__n { grid-row: span 2; font-size: clamp(2.2rem, 3.4vw, 3rem); align-self: center; }
.sg-parts__name { font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1; }
.sg-parts__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; line-height: 1.4; }
.sg-parts__note { text-transform: none; letter-spacing: .02em; opacity: .85; }

.sg-howto { list-style: none; padding: 0; margin: clamp(32px, 4vw, 56px) 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-strong); }
.sg-howto li { padding: 16px clamp(12px, 2vw, 28px) 4px 0; font-size: var(--f-s); line-height: 1.55; color: var(--graphite); }
.sg-howto li + li { padding-left: clamp(12px, 2vw, 28px); border-left: 1px solid var(--line); }
.sg-howto .mono { display: block; color: var(--ink); margin-bottom: 6px; }
.sg-howto .mono::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--orange); margin-right: 8px; }

/* ================= BOOK LAYOUT: rail + main ================= */
.sg-book { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: clamp(28px, 3.5vw, 56px); padding-top: clamp(40px, 5vw, 72px); }
.sg-rail { position: relative; }
.sg-rail__in {
  position: sticky; top: calc(var(--head-h) + 20px);
  max-height: calc(100vh - var(--head-h) - 40px); overflow-y: auto; overscroll-behavior: contain;
  border-top: 2px solid var(--ink); padding-bottom: 16px;
}
.sg-rail__part { padding-top: 14px; }
.sg-rail__ph { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sg-rail__ph span { display: inline-grid; place-items: center; min-width: 30px; height: 20px; padding: 0 5px; background: var(--pc); color: var(--pc-t); }
.sg-rail ol { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--pc); }
.sg-rail a {
  display: grid; grid-template-columns: 2.1em minmax(0, 1fr); gap: 4px; align-items: baseline;
  padding: 6px 4px 6px 10px; text-decoration: none; font-size: .86rem; line-height: 1.3; min-height: 32px;
  transition: background-color .2s;
}
.sg-rail a:hover { background: var(--lemon); }
.sg-rail a:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; background: var(--lemon); }
.sg-rail__no { font-family: var(--mono); font-size: 11px; color: var(--graphite); }
.sg-rail__short { display: none; }

.sg-main { min-width: 0; }

/* ================= PARTS ================= */
.sg-part { margin-bottom: clamp(48px, 6vw, 96px); }
.sg-part__head {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: end;
  background: var(--pc); color: var(--pc-t); padding: clamp(22px, 3.5vw, 48px);
}
.sg-part__n { font-size: clamp(4.5rem, 11vw, 10rem); line-height: .78; }
.sg-part__head .mono { margin-bottom: 10px; }
.sg-part__sum { margin-top: 14px; max-width: 58ch; font-size: var(--f-m); line-height: 1.45; }

/* ================= LESSONS ================= */
.sg-lesson { padding-block: clamp(36px, 5vw, 72px); border-bottom: 1px solid var(--line-strong); scroll-margin-top: calc(var(--head-h) + 12px); }
.sg-part > .sg-lesson:last-child { border-bottom: 0; }
.sg-lesson__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(14px, 2.4vw, 32px); align-items: end; margin-bottom: clamp(20px, 3vw, 36px); }
.sg-lesson__no {
  font-size: clamp(3.6rem, 7vw, 6.4rem); color: var(--ink); padding: .08em .12em 0;
  background: linear-gradient(to top, var(--pc) 42%, transparent 42%);
}
.sg-p--care .sg-lesson__no { background: linear-gradient(to top, var(--lav) 42%, transparent 42%); }
.sg-lesson__k { color: var(--graphite); margin-bottom: 8px; }
.sg-lesson__t { font-size: var(--f-l); line-height: .98; max-width: 22ch; }

.sg-lesson__body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(24px, 3.4vw, 52px); align-items: start; }
.sg-lesson--flip .sg-lesson__body > figure { order: -1; }
.sg-lesson--flip .sg-lesson__body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); }
.sg-lesson__body--full { grid-template-columns: minmax(0, 1fr); }
.sg-lesson__text { max-width: 64ch; }
.sg-lesson__text.prose a { text-decoration-color: var(--orange); }

/* figures */
.sg-fig { padding: clamp(10px, 1.4vw, 18px); background: var(--pc); position: relative; }
.sg-fig--mint { background: var(--mint); }
.sg-fig--lav { background: var(--lav); }
.sg-fig--orange { background: var(--orange); }
.sg-fig--orange figcaption { color: var(--ink); }
.sg-fig--care { background: var(--ink); }
.sg-fig--care figcaption { color: #c9cbc6; }
.sg-fig img { background: #fff; }
.sg-fig figcaption { text-transform: none; letter-spacing: .01em; font-size: .78rem; color: #2f3336; padding-top: 2px; }

/* side panels */
.sg-side { border-top: 3px solid var(--pc); background: #fff; padding: clamp(16px, 2vw, 24px); }
.sg-p--care .sg-side { border-top-color: var(--ink); }
.sg-side__h { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.sg-side__h::before { content: ""; width: 8px; height: 8px; background: var(--orange); flex: none; }
.sg-rules { list-style: none; padding: 0; display: grid; gap: 0; }
.sg-rules li { position: relative; padding: 9px 0 9px 22px; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.45; }
.sg-rules li:last-child { border-bottom: 0; }
.sg-rules li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 9px; height: 9px; border: 2px solid var(--ink); background: var(--pc); }
.sg-spec { grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr); }
.sg-steps { list-style: none; padding: 0; counter-reset: st; }
.sg-steps li { counter-increment: st; display: grid; grid-template-columns: 2em minmax(0, 1fr); column-gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; line-height: 1.45; }
.sg-steps li::before { content: counter(st, decimal-leading-zero); font-family: var(--mono); font-size: 11px; grid-row: span 2; padding-top: 3px; }
.sg-steps b { display: block; }

/* practical example */
.sg-example {
  margin-top: clamp(22px, 3vw, 36px); display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 8px 24px;
  border-top: 2px solid var(--ink); padding-top: 16px;
}
.sg-example__k { display: flex; gap: 8px; align-items: center; }
.sg-example__k::before { content: "→"; display: inline-grid; place-items: center; width: 24px; height: 24px; background: var(--orange); color: var(--ink); font-size: 13px; flex: none; }
.sg-example p:last-child { max-width: 72ch; }

/* do / don't */
.sg-dd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; margin-top: clamp(22px, 3vw, 32px); }
.sg-dd__col { padding: 16px 20px; font-size: .95rem; line-height: 1.5; }
.sg-dd__col--do { background: var(--mint); }
.sg-dd__col--dont { background: #ece9e1; box-shadow: inset 4px 0 0 var(--orange); }
.sg-dd__k { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 700; }
.sg-dd__k span { display: inline-grid; place-items: center; width: 22px; height: 22px; background: var(--ink); color: var(--paper); font-size: 12px; }

/* ================= MATRIX ================= */
.sg-matrix { margin-top: clamp(28px, 4vw, 48px); background: #fff; border: 1px solid var(--ink); }
.sg-matrix__scroll { overflow-x: auto; }
.sg-matrix__scroll:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sg-matrix table { min-width: 620px; font-size: .88rem; }
.sg-matrix caption { text-align: left; padding: 14px 16px; font-family: var(--mono); font-size: var(--f-xs); letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper); }
.sg-matrix th, .sg-matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.sg-matrix thead th { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; font-weight: 500; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.sg-matrix thead th .sg-sw { display: block; width: 100%; max-width: 72px; height: 16px; margin-bottom: 6px; }
.sg-matrix__corner { color: var(--graphite); }
.sg-matrix tbody th { font-weight: 700; white-space: nowrap; }
.sg-matrix tbody th .sg-sw { display: inline-block; vertical-align: -3px; width: 18px; height: 18px; margin-right: 10px; }
.sg-matrix tbody tr:hover { background: #faf8f0; }
.sg-sw { background: var(--c); border: 1px solid rgba(32, 35, 38, .45); }
.sg-sw--stripe { background: repeating-linear-gradient(90deg, #fff 0 3px, #6f93c2 3px 4px); }
.sg-sw--check { background-color: #fff; background-image: linear-gradient(90deg, rgba(80, 120, 180, .45) 50%, transparent 50%), linear-gradient(rgba(80, 120, 180, .45) 50%, transparent 50%); background-size: 6px 6px; }
.sg-r { white-space: nowrap; }
.sg-r--c { background: rgba(213, 232, 223, .55); font-weight: 600; }
.sg-r--u { color: var(--graphite); }
.sg-mk { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; flex: none; }
.sg-mk--c, .sg-r--c .sg-mk { background: var(--ink); border-radius: 50%; }
.sg-mk--w, .sg-r--w .sg-mk { border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.sg-mk--u, .sg-r--u .sg-mk { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--orange); }
.sg-matrix__key { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 14px 16px; margin: 0; border-top: 1px solid var(--ink); text-transform: none; letter-spacing: .01em; font-size: .8rem; color: var(--ink); }
.sg-matrix__key > span { display: inline-flex; align-items: center; }
.sg-matrix__note { color: var(--graphite); flex-basis: 100%; }

/* ================= PATTERN SCALE ================= */
.sg-scale { margin-top: clamp(28px, 4vw, 44px); border: 1px solid var(--ink); background: #fff; }
.sg-scale__h { padding: 12px 16px; background: var(--mint); border-bottom: 1px solid var(--ink); }
.sg-scale__row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; }
.sg-scale__row + .sg-scale__row { border-top: 1px solid var(--line); }
.sg-scale__verdict { display: flex; align-items: center; font-weight: 700; }
.sg-scale__set { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sg-scale__set > div { display: grid; gap: 8px; }
.sg-scale__set .mono { text-transform: none; letter-spacing: .02em; font-size: .75rem; }
.sg-scale__note { align-self: center; font-size: .9rem; color: var(--graphite); line-height: 1.45; }
.sg-pat { display: block; height: 64px; border: 1px solid rgba(32, 35, 38, .4); }
.sg-pat--fine { background: repeating-linear-gradient(90deg, #f4f7fb 0 4px, #6f8fb8 4px 5px); }
.sg-pat--dot { background-color: #233453; background-image: radial-gradient(#f7f6f0 2.6px, transparent 3.2px); background-size: 16px 16px; }
.sg-pat--large { background-color: #8a8d90; background-image: linear-gradient(90deg, rgba(32, 35, 38, .55) 0 3px, transparent 3px), linear-gradient(rgba(32, 35, 38, .55) 0 3px, transparent 3px); background-size: 40px 40px; }
.sg-pat--mid { background: repeating-linear-gradient(90deg, #f4f7fb 0 8px, #4f6f9a 8px 14px); }

/* ================= COLOUR STRIP ================= */
.sg-colours { list-style: none; padding: 0; margin: clamp(28px, 4vw, 44px) 0 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--ink); background: #fff; }
.sg-colours li { display: grid; gap: 8px; padding: 10px; font-size: .85rem; line-height: 1.25; }
.sg-colours li + li { border-left: 1px solid var(--line); }
.sg-colours__sw { display: block; height: 72px; background: var(--c); border: 1px solid rgba(32, 35, 38, .35); }
.sg-meter { font-family: var(--mono); font-size: 11px; color: var(--graphite); display: grid; gap: 5px; }
.sg-meter::before { content: ""; height: 6px; background: linear-gradient(90deg, var(--ink) calc(var(--v) * 20%), #e3e1da calc(var(--v) * 20%)); }

/* ================= COLLARS ================= */
.sg-collars { display: grid; gap: 0; background: #fff; border-top: 3px solid var(--pc); padding: 6px clamp(14px, 2vw, 22px); }
.sg-collar { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sg-collar:last-child { border-bottom: 0; }
.sg-collar svg { width: 64px; height: auto; fill: var(--mint); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.sg-collar svg path:first-child { fill: none; }
.sg-collar svg circle { fill: var(--ink); stroke: none; }
.sg-collar p { font-size: .9rem; line-height: 1.4; }
.sg-collar b { display: block; }

/* ================= CONTRAST LADDER ================= */
.sg-ladder { margin-top: clamp(28px, 4vw, 44px); }
.sg-ladder__bar { position: relative; height: 56px; background: linear-gradient(90deg, #fff 0%, #cfe0f1 18%, #8f3b4a 52%, #6a2f3c 62%, #1f2a44 82%, #202326 100%); border: 1px solid var(--ink); margin-top: 34px; }
.sg-ladder__pin { position: absolute; left: var(--x); top: -34px; transform: translateX(-50%); display: grid; justify-items: center; }
.sg-ladder__pin b { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 3px 7px; }
.sg-ladder__pin::after { content: ""; width: 2px; height: 66px; background: var(--ink); box-shadow: 0 0 0 1px var(--paper); }
.sg-ladder figcaption { text-transform: none; letter-spacing: .01em; font-size: .82rem; margin-top: 14px; max-width: 80ch; }

/* ================= OFFICE CODES ================= */
.sg-codes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; border: 1px solid var(--ink); }
.sg-code { padding: clamp(16px, 2vw, 24px); background: #fff; position: relative; }
.sg-code + .sg-code { border-left: 1px solid var(--ink); }
.sg-code::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--orange); }
.sg-code:nth-child(2)::before { right: 33%; }
.sg-code:nth-child(3)::before { right: 66%; }
.sg-code .mono { color: var(--graphite); margin-top: 6px; }
.sg-code h4 { font-weight: 800; text-transform: uppercase; font-variation-settings: "wdth" 72; font-stretch: 72%; font-size: 1.5rem; line-height: 1; margin: 8px 0 10px; }
.sg-code p:last-child { font-size: .93rem; line-height: 1.5; }

/* ================= CHECKLIST ================= */
.sg-check { background: var(--ink); color: var(--paper); padding: clamp(16px, 2vw, 24px); }
.sg-check .sg-side__h { color: var(--paper); }
.sg-check ul { list-style: none; padding: 0; margin: 0; }
.sg-check label { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 44px; padding: 4px 0; border-bottom: 1px solid rgba(247, 246, 240, .16); cursor: pointer; font-size: .93rem; line-height: 1.35; }
.sg-check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border: 2px solid var(--paper); background: transparent; display: grid; place-items: center; cursor: pointer; }
.sg-check input::after { content: ""; width: 10px; height: 10px; background: var(--orange); transform: scale(0); transition: transform .2s var(--ease); }
.sg-check input:checked { border-color: var(--orange); }
.sg-check input:checked::after { transform: scale(1); }
.sg-check input:checked + span { color: #b9bbb6; text-decoration: line-through; text-decoration-color: var(--orange); }
.sg-check input:focus-visible { outline: 3px solid var(--lemon); outline-offset: 2px; }
.sg-check__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 14px; }
.sg-check__bar { height: 6px; background: rgba(247, 246, 240, .2); display: block; }
.sg-check__bar span { display: block; height: 100%; width: var(--p, 0%); background: var(--orange); transition: width .35s var(--ease); }

/* ================= WARDROBE PLAN ================= */
.sg-plan { margin-top: clamp(28px, 4vw, 48px); background: var(--ink); color: var(--paper); padding: clamp(16px, 2.4vw, 32px); }
.sg-plan__cap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; margin: 0 0 20px; color: var(--paper); }
.sg-plan__cap > .mono { font-size: var(--f-xs); }
.sg-plan__legend { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-plan__tag { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; background: var(--orange); color: var(--ink); }
.sg-plan__tag--ext { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--paper); }
.sg-plan__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.sg-plan__item { display: grid; align-content: start; gap: 6px; background: var(--paper); color: var(--ink); padding: 12px 12px 14px; border-top: 5px solid var(--orange); }
.sg-plan__item--ext { border-top-color: var(--lav); background: #e9e7e0; }
.sg-plan__shirt { display: block; filter: drop-shadow(1px 0 0 var(--ink)) drop-shadow(-1px 0 0 var(--ink)) drop-shadow(0 1px 0 var(--ink)) drop-shadow(0 -1px 0 var(--ink)); padding: 4px 6px 8px; }
.sg-shirt {
  display: block; aspect-ratio: 1 / 1.05; width: 100%;
  clip-path: polygon(32% 0, 41% 7%, 50% 12%, 59% 7%, 68% 0, 100% 17%, 93% 42%, 80% 36%, 80% 100%, 20% 100%, 20% 36%, 7% 42%, 0 17%);
}
.sg-shirt--white { background: #fff; }
.sg-shirt--blue { background: #cfe0f1; }
.sg-shirt--stripe { background: repeating-linear-gradient(90deg, #fff 0 5px, #6f8fb8 5px 6px); }
.sg-shirt--check { background-color: #fff; background-image: linear-gradient(90deg, rgba(80, 120, 180, .5) 50%, transparent 50%), linear-gradient(rgba(80, 120, 180, .5) 50%, transparent 50%); background-size: 9px 9px; }
.sg-shirt--pink { background: linear-gradient(90deg, #f3d6d8 50%, #dcd6ec 50%); }
.sg-shirt--oxford { background-color: #bcd0e6; background-image: linear-gradient(90deg, rgba(255, 255, 255, .45) 50%, transparent 50%), linear-gradient(rgba(32, 35, 38, .08) 50%, transparent 50%); background-size: 3px 3px; }
.sg-shirt--dark { background: #27303f; }
.sg-plan__n { color: var(--graphite); font-size: 10.5px; }
.sg-plan__name { font-weight: 800; font-size: 1.02rem; line-height: 1.15; }
.sg-plan__role { font-size: .85rem; line-height: 1.35; }
.sg-plan__pairs { text-transform: none; letter-spacing: .01em; font-size: 11px; color: var(--graphite); line-height: 1.4; border-top: 1px solid var(--line); padding-top: 6px; }

/* ================= CARE SYMBOLS ================= */
.sg-care { margin-top: clamp(28px, 4vw, 48px); border: 1px solid var(--ink); background: #fff; }
.sg-care__h { padding: 12px 16px; background: var(--ink); color: var(--paper); }
.sg-care__grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sg-care__grid li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; padding: 16px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.sg-care__grid li:nth-child(4n) { border-right: 0; }
.sg-care__grid li:nth-last-child(-n+4) { border-bottom: 0; }
.sg-care__grid p { font-size: .86rem; line-height: 1.45; }
.sg-care__grid b { display: block; margin-bottom: 2px; }
.sg-sym { width: 52px; height: 52px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; background: var(--lav); padding: 2px; }
.sg-sym text { fill: var(--ink); stroke: none; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.sg-sym .sg-sym__dot { fill: var(--ink); stroke: none; }

/* ================= OUTRO ================= */
.sg-outro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px 40px; align-items: start; padding: clamp(24px, 3vw, 40px); background: var(--mint); margin-bottom: clamp(48px, 6vw, 88px); }
.sg-outro > p { grid-column: 1; color: #2f3336; }
.sg-outro ul { list-style: none; padding: 0; margin: 0; grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 14px; }
.sg-outro .arrow-link { min-height: 32px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1279px) {
  .sg-lesson__body, .sg-lesson--flip .sg-lesson__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sg-lesson__body--full { grid-template-columns: minmax(0, 1fr); }
  .sg-colours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sg-colours li + li { border-left: 0; }
  .sg-colours li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .sg-plan__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sg-care__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-care__grid li:nth-child(4n) { border-right: 1px solid var(--line); }
  .sg-care__grid li:nth-child(2n) { border-right: 0; }
  .sg-care__grid li:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .sg-care__grid li:nth-last-child(-n+2) { border-bottom: 0; }
}

/* rail collapses to a chip row */
@media (max-width: 1099px) {
  .sg-book { grid-template-columns: minmax(0, 1fr); padding-top: 0; gap: 0; }
  .sg-rail { margin-inline: calc(-1 * var(--gutter)); position: sticky; top: calc(var(--head-h) - 3px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--ink); margin-bottom: clamp(28px, 4vw, 48px); }
  .sg-rail__in {
    position: static; max-height: none; overflow-x: auto; overflow-y: hidden; border-top: 0;
    display: flex; gap: 14px; padding: 10px var(--gutter); scrollbar-width: thin;
  }
  .sg-rail__part { display: flex; align-items: center; gap: 6px; padding-top: 0; flex: none; }
  .sg-rail__ph { margin: 0; white-space: nowrap; }
  .sg-rail__ph span { min-width: 26px; }
  .sg-rail ol { display: flex; gap: 6px; border-left: 0; }
  .sg-rail li { flex: none; }
  .sg-rail a {
    display: inline-flex; gap: 6px; align-items: center; min-height: 44px; padding: 6px 12px;
    border: 1px solid var(--ink); border-radius: 99px; white-space: nowrap; font-size: .82rem;
    box-shadow: inset 0 -4px 0 var(--pc);
  }
  .sg-rail__long { display: none; }
  .sg-rail__short { display: inline; }
  .sg-lesson { scroll-margin-top: calc(var(--head-h) + 76px); }
  .sg-part { scroll-margin-top: calc(var(--head-h) + 76px); }
}

@media (max-width: 899px) {
  .sg-cover__grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .sg-howto { grid-template-columns: minmax(0, 1fr); }
  .sg-howto li, .sg-howto li + li { padding: 12px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .sg-codes { grid-template-columns: minmax(0, 1fr); }
  .sg-code + .sg-code { border-left: 0; border-top: 1px solid var(--ink); }
  .sg-outro { grid-template-columns: minmax(0, 1fr); }
  .sg-outro ul, .sg-outro > p { grid-column: 1; grid-row: auto; }
}

@media (max-width: 767px) {
  .sg-lesson__body, .sg-lesson--flip .sg-lesson__body { grid-template-columns: minmax(0, 1fr); }
  .sg-lesson--flip .sg-lesson__body > figure { order: 0; }
  .sg-fig { max-width: 520px; }
  .sg-example { grid-template-columns: minmax(0, 1fr); }
  .sg-dd { grid-template-columns: minmax(0, 1fr); }
  .sg-plan__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-care__grid { grid-template-columns: minmax(0, 1fr); }
  .sg-care__grid li, .sg-care__grid li:nth-child(4n) { border-right: 0; }
  .sg-care__grid li:nth-last-child(-n+4), .sg-care__grid li:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .sg-care__grid li:last-child { border-bottom: 0; }
  .sg-scale__row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .sg-colours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-ladder__pin b { font-size: 10px; padding: 2px 5px; }
}

@media (max-width: 479px) {
  .sg-part__head { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sg-part__n { font-size: 4rem; }
  .sg-lesson__head { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sg-lesson__no { justify-self: start; font-size: 3.4rem; }
  .sg-scale__set { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-scale__note { grid-column: 1 / -1; }
  .sg-pat { height: 48px; }
  .sg-parts a { grid-template-columns: 2.6rem minmax(0, 1fr); padding: 10px 12px; }
  .sg-plan { padding: 14px; }
  .sg-plan__list { gap: 8px; }
  .sg-plan__item { padding: 10px 9px 12px; }
  .sg-spec { grid-template-columns: minmax(0, 1fr); }
  .sg-spec dt { padding-bottom: 0; border-bottom: 0; }
}
@media (max-width: 699px) {
  .sg-matrix::before { content: "Swipe the table sideways for all five trouser colours →"; display: block; padding: 10px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--graphite); border-bottom: 1px solid var(--line); }
}

/* scroll-spy: current lesson in the rail (set by main.js [data-spy]) */
.sg-rail a[aria-current] .sg-rail__no { background: var(--orange); color: var(--ink); }
.sg-rail a[aria-current] { font-weight: 700; }
