/* World Model · phone polish (390 to 820px wide). Loads after ds.css and skin-chronicle.css.
   Every rule here sits inside a screen max-width (or hover: none) media query, so nothing in this file can change the desktop layout or the printed report.
   Breakpoints follow ds.css: 820 is the phone shell (bottom bar, sheets), 720 is where sheets go to one column,
   620 is where the title charts and the four stages stack. The last block is for touch screens of any width. */

/* ============ 1 · the shell: header, search, help, Questions, menu, bar ============ */
@media screen and (max-width: 820px) {
  /* one gutter: the bar, the menu and every panel sit on the same 14px edge as the sheets */
  .ds-pbar, .ds-menu { left: 14px; right: 14px; }

  /* the desktop header paddings leak through and leave the field 124px wide; the wordmark starts on the page gutter */
  .ds-head-client { height: var(--ds-head); padding: 0 10px 0 14px; }
  .ds-head-ask { padding: 0 2px; }
  .ds-head-maker { padding: 0 14px 0 8px; }
  /* 16px or more in a field keeps iOS from zooming the page when it takes focus */
  .ds-ask input, .ds-head-ask .ds-ask input, .ds-ai-ask input { font-size: var(--ds-fs-6); }
  .ds-head-ask .ds-ask input { padding: 6px 8px; }
  /* the search button is a full thumb target (the skin pins it at 34px) */
  html[data-skin] .ds-head .ds-head-ask .ds-run { height: 40px; min-width: 44px; justify-content: center; }

  /* while asking, the field takes the whole header; the wordmark and the Chronicle mark step aside */
  body.ds-asking .ds-head { grid-template-columns: minmax(0, 1fr); }
  body.ds-asking .ds-head-client, body.ds-asking .ds-head-right, body.ds-asking .ds-head-maker { display: none; }
  body.ds-asking .ds-head-ask { padding: 0 14px; }
  body.ds-asking .ds-head-ask .ds-ask { max-width: none; }

  /* the search panel sits on the gutter (!important only to beat the !important that pins it at 12px) and never runs under the screen's edge */
  .ds-askp { left: 14px !important; right: 14px; max-height: calc(100dvh - var(--ds-head) - 20px - env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
  /* a suggestion's type sits under its question, so the question keeps the full measure */
  .ds-askp-list button { grid-template-columns: 18px minmax(0, 1fr); gap: 2px 12px; align-items: start; min-height: 48px; }
  .ds-askp-list button svg { margin-top: 3px; }
  .ds-askp-list button em { grid-column: 2; }
  .ds-askp-acts .ds-btn { flex: 1 1 100%; justify-content: center; }

  /* help is a sheet between the header and the bar: centred on the gutter, scrolling inside, nothing under the bar */
  .ds-ai { left: 14px; right: 14px; top: calc(var(--ds-head) + 10px); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: auto; height: auto; max-height: none; margin: 0; align-self: stretch; }
  .ds-ai-b { min-height: 0; overscroll-behavior: contain; }

  /* the Questions pane rises from the bar, stops under the header and scrolls inside; its head stays pinned so the close button is always in reach */
  .ds-pane { top: auto; left: 14px; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; max-height: calc(100dvh - var(--ds-head) - 94px - env(safe-area-inset-bottom, 0px)); padding: 0 18px 18px; }
  .ds-pane-h { position: sticky; top: 0; z-index: 1; justify-content: flex-start; gap: 10px; margin: 0 -18px 14px; padding: 12px 14px 12px 18px; background: var(--ds-paper); border-bottom: 1px solid var(--ds-line); }
  .ds-pane-h h2 { margin-right: auto; }
  /* its questions are rows on a hairline, not boxes inside the pane */
  .ds-pane .ds-hlist { gap: 0; }
  .ds-pane .ds-hlist :is(a, button) { min-height: 48px; padding: 12px 0; background: none; border: 0; border-top: 1px solid var(--ds-line); }
  .ds-pane .ds-hlist li:first-child :is(a, button) { border-top: 0; padding-top: 4px; }
  .ds-pane-f { margin-top: 10px; }

  /* the menu sheet stops under the header instead of covering a sliver of it, and scrolls inside when the screen is short */
  .ds-menu { max-height: calc(100dvh - var(--ds-head) - 92px - env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
  /* a little less air between its groups, so the whole menu fits a tall phone without scrolling */
  .ds-menu .ds-nv-rule { margin: 4px 0 0; }
  .ds-menu .ds-rail-foot { margin-top: 4px; padding-top: 8px; }

  /* every close button is a full thumb target */
  .ds-x, .ds-askp-h .ds-x { width: 36px; height: 36px; }
}

/* ============ 2 · heroes: Home, title pages, project pages, report covers ============ */
@media screen and (max-width: 820px) {
  /* hero copy starts on the same 18px edge as the copy in every sheet under it */
  .ds-hero-in, .ds-aud-hero .ds-hero-in { padding: 22px 18px 0; }
  .ds-phero-grid { padding: 22px 18px 0; }
  /* the mono kicker keeps to one line at 390: less tracking, and where it must wrap it wraps evenly */
  html[data-skin="chronicle"] .ds-hero-k, html[data-skin="chronicle"] .ds-ph-k, .ds-rep-k { letter-spacing: .05em; text-wrap: balance; }
  html[data-skin="chronicle"] .ds-sh-meta { letter-spacing: .04em; }

  /* key art is held to a band above the copy, so no line of text ever runs over a face */
  .ds-hero-bg { inset: 0 0 auto 0; height: 196px; }
  html[data-skin="chronicle"] .ds-hero-bg::after { background: linear-gradient(180deg, rgba(var(--ck-navy-rgb), .18) 0%, rgba(var(--ck-navy-rgb), 0) 34%, rgba(var(--ck-navy-rgb), 0) 56%, var(--ck-navy) 100%); }
  .ds-hero-bg + .ds-hero-in { padding-top: 208px; }
  /* a report cover takes the same band; the two cover buttons sit on its top-left */
  .ds-rep-cover { padding: 212px 18px 24px; }
  .ds-rep-cover-bg { inset: 0 0 auto 0; height: 196px; }
  .ds-rep-cover-bg::after { background: linear-gradient(180deg, rgba(6, 13, 28, .5) 0%, rgba(6, 13, 28, 0) 46%, rgba(6, 13, 28, 0) 58%, #060D1C 100%); }
  .ds-rep-acts { left: 18px; }
  /* the report's contents list is rows on a hairline, each a thumb tall, not a tinted box inside the section */
  .ds-rep-toc { padding: 18px 0 0; background: none; border-top: 1px solid var(--ds-line-strong); }
  .ds-rep-toc a { padding: 13px 0; }

  /* a title with no key art wears its colour in the same band, with the two scores it is known by */
  .ds-hero-plain .ds-hero-fig { grid-row: 1; padding: 22px 18px 20px; gap: 14px; }
  .ds-hero-plain .ds-hero-in { grid-row: 2; }
  .ds-hero-plain .ds-hero-bar { grid-row: 3; }
  .ds-hf-pair { gap: 18px; }
  .ds-hf-pair b { font-size: var(--ds-fs-11); }
  .ds-hf-pair span { margin-top: 8px; font-size: var(--ds-fs-4); }
  .ds-hero-fig p { font-size: var(--ds-fs-2); }
  /* the logo sits straight under its kicker: the fixed logo box left a hole above wide wordmarks */
  .ds-hero-title .ds-hero-logo { height: auto; }
  .ds-hero-title .ds-hero-logo img { max-height: 76px; }

  /* hero stats are rows, not a two-by-two: the value and its source share a line, the label keeps the full width, and nothing wraps mid-value or onto a separator */
  :is(.ds-hero, .ds-phero) .ds-hero-bar { grid-template-columns: minmax(0, 1fr); margin-top: 24px; }
  :is(.ds-hero, .ds-phero) .ds-hero-bar > * { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 14px; row-gap: 3px; min-height: 0; padding: 13px 18px 14px; border-left: 0; border-top: 1px solid var(--ck-dline, rgba(255, 255, 255, .12)); }
  :is(.ds-hero, .ds-phero) .ds-hero-bar > :first-child { border-top: 0; }
  :is(.ds-hero, .ds-phero) .ds-hero-bar > * > b { grid-column: 1; grid-row: 1; margin: 0; font-size: var(--ds-fs-7); white-space: nowrap; }
  :is(.ds-hero, .ds-phero) .ds-hero-bar > * > em { grid-column: 2; grid-row: 1; align-self: baseline; margin: 0; flex-wrap: nowrap; white-space: nowrap; }
  :is(.ds-hero, .ds-phero) .ds-hero-bar > * > span { grid-column: 1 / -1; grid-row: 2; margin: 0; }
  .ds-hero-bar em i, .ds-hero-bar em i::before { display: inline; }
  /* a project's four counts read as one line each: the number, then what it counts */
  .ds-phero .ds-hero-bar { margin-top: 22px; }
  .ds-phero .ds-hero-bar > * { grid-template-columns: 4.4em minmax(0, 1fr); padding: 11px 18px 12px; border-top-color: rgba(255, 255, 255, .16); }
  .ds-phero .ds-hero-bar > * > span { grid-column: 2; grid-row: 1; }

  .ds-phero-fig, .ds-verdict-fig { padding: 16px 14px 14px; }
}
@media screen and (max-width: 380px) {
  /* 15px less room than a 390 phone: the kickers give up the rest of their tracking to stay on one line */
  html[data-skin="chronicle"] .ds-hero-k, html[data-skin="chronicle"] .ds-ph-k, .ds-rep-k { letter-spacing: .02em; }
}

/* ============ 3 · strips that scroll sideways say so ============ */
@media screen and (max-width: 820px) {
  /* the edge a strip continues past fades out, and the fade follows the scroll: none where nothing is hidden, right at the start, left once it has moved.
     Two mask layers 28px wider than the strip slide in and out of view, so only mask-position animates. Browsers without scroll timelines keep the cut-off item as the cue. */
  @supports (animation-timeline: scroll()) {
    .ds-lanes, .ds-tabs, .ds-shape-fig, .ds-goal, .ds-curve, .ds-mom, .ds-replist, .ds-tstrip {
      -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px), linear-gradient(270deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px), linear-gradient(270deg, transparent, #000 28px);
      -webkit-mask-size: calc(100% + 28px) 100%; mask-size: calc(100% + 28px) 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
      -webkit-mask-composite: source-in; mask-composite: intersect; -webkit-mask-position: -28px 0, 0 0; mask-position: -28px 0, 0 0;
      animation: ph-edges linear both; animation-timeline: scroll(self inline);
    }
    @keyframes ph-edges {
      0% { -webkit-mask-position: -28px 0, -28px 0; mask-position: -28px 0, -28px 0; }
      8%, 92% { -webkit-mask-position: 0 0, -28px 0; mask-position: 0 0, -28px 0; }
      100% { -webkit-mask-position: 0 0, 0 0; mask-position: 0 0, 0 0; }
    }
  }
  /* every strip moves under a thumb and never drags the page sideways with it */
  .ds-lanes, .ds-tabs, .ds-shape-fig, .ds-goal, .ds-curve, .ds-mom, .ds-replist, .ds-tstrip { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  /* the project tabs bleed to the 14px gutter, not the old 12px one */
  .ds-top .ds-tabs { margin-left: -14px; margin-right: -14px; padding: 0 14px; }
}

/* ============ 4 · thumb targets ============ */
@media screen and (max-width: 820px) {
  /* lanes, profile tabs, selects and their options */
  .ds-lane { padding: 11px 14px; }
  .ds-sel-btn, .ds-aud-when .ds-sel-btn { height: 44px; }
  .ds-sel-menu li { padding: 12px 10px 12px 8px; }
  /* inline links grow a thumb-tall hit area without moving the line they sit on */
  .ds-sh-link { display: inline-flex; align-items: center; min-height: 44px; }
  .ds-link { display: inline-block; padding: 10px 0; margin: -6px 0; }
  .ds-log-p { display: inline-block; margin: -12px 0 -12px 2px; padding: 12px 0; }
  .ds-inputs a, .ds-shape-foot a, .ds-foot-l { display: inline-block; padding: 11px 0; margin: -11px 0; }
  .ds-cmp-chip a { width: 36px; height: 36px; }
  /* the "?" beside a heading keeps its 20px mark and takes a 44px hit area */
  .ds-how::after { inset: -12px; }
  /* next title reads from the left edge, and its arrow stays clear of the back-to-top button that rests over the right end of the row */
  .ds-nextt { justify-content: flex-start; padding: 0 60px 0 4px; }
}

/* ============ 5 · Audiences ============ */
@media screen and (max-width: 820px) {
  /* the hero's controls and the chart keep the hero's 18px edge; the chart scrolls from edge to edge */
  .ds-aud-lanes { padding: 16px 18px 0; }
  .ds-aud-when.ds-sel { margin: 14px 18px 0; }
  .ds-aud-shape { padding-left: 0; padding-right: 0; }
  .ds-aud-shape .ds-shape-fig { margin: 0; padding-left: 18px; padding-right: 18px; }

  /* the compare tray: each pinned audience keeps its whole name on a row of its own, then one line of result, and an open detail that stops near half the screen */
  .ds-cmp { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .ds-cmp-bar { gap: 6px 8px; padding: 10px; min-height: 0; }
  .ds-cmp-chip { flex: 1 1 100%; padding: 2px 2px 2px 10px; }
  .ds-cmp-chip > span { flex: 1 1 auto; }
  .ds-cmp-detail { max-height: 30dvh; gap: 14px; padding: 14px 14px 12px; overscroll-behavior: contain; }
  .ds-cmp-detail figure { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 14px; }
  .ds-cmp-venn { width: 104px; }
  .ds-cmp-detail figcaption { margin: 0; }
  .ds-cmp-detail figcaption b { display: block; margin: 0 0 2px; }
  /* open, the detail already says the result: the bar keeps the two chips and the buttons */
  .ds-cmp-detail + .ds-cmp-bar .ds-cmp-line { display: none; }
}
@media screen and (max-width: 720px) {
  /* the four figures read as rows: the value, its small figure and its source on one line, the label on the next at full width, so no label wraps onto a separator */
  .ds-kpis { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .ds-kpis .ds-kpi { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 6px; margin: 0; padding: 14px 0; border-right: 0; border-top: 1px solid var(--ds-line); }
  .ds-kpis .ds-kpi:first-child { border-top: 0; padding-top: 0; }
  .ds-kpis .ds-kpi:last-child { padding-bottom: 0; }
  .ds-kpis .ds-kpi-top { grid-column: 1; grid-row: 1; justify-content: flex-start; align-items: center; gap: 14px; min-height: 0; }
  .ds-kpis .ds-kpi-foot { grid-column: 2; grid-row: 1; margin: 0; white-space: nowrap; }
  .ds-kpis .ds-kpi > span { grid-column: 1 / -1; grid-row: 2; margin: 0; }
  .ds-kpis .ds-minibars { margin-top: 0; }

  /* the in-page Ask keeps its label: the header rule that hides it left a 24px blank block */
  .ds-ask-in .ds-run { padding: 0 16px; }
  .ds-ask-in .ds-run span { display: inline; }

  /* explorer filters fill the row two by two instead of leaving a third of it empty */
  .ds-segs .ds-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; }
  .ds-segs .ds-filters .ds-sel-btn { width: 100%; min-width: 0; }
  /* explorer rows use the full width: the compare mark sits beside the name, the facts line gets the whole measure and never breaks onto a separator */
  .ds-segs .ds-segbtn { padding: 12px 10px 14px; gap: 5px; }
  .ds-segs .ds-segname b { padding-right: 40px; }
  .ds-segs .ds-segname > span { margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ds-segs .ds-cmp-pin { top: 3px; right: 0; }
  .ds-segs .ds-segaff, .ds-segs .ds-segtam { grid-template-columns: 4em minmax(0, 1fr) 5.4em; }
  /* an open row's detail is a band to the sheet's edges, so its copy keeps the sheet's measure */
  .ds-segs .ds-segd { margin: 0 -18px 8px; padding: 6px 18px 22px; }
  /* show all: the button takes the row, its note sits under it */
  .ds-segs-more { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 18px 22px; }
  .ds-segs-more .ds-btn { justify-content: center; }
}

/* ============ 6 · Titles and Start ============ */
@media screen and (max-width: 620px) {
  /* the score chart: a later desktop rule undoes the phone grid and squeezes the track to nothing. Name and the two scores share a line; the track runs under them at full width */
  .ds-score:not(.ds-dumb-l) li, .ds-score-h { grid-template-columns: minmax(0, 1fr) 10.4em; gap: 2px 12px; }
  .ds-score:not(.ds-dumb-l) li { padding: 10px 0 14px; }
  .ds-score-h > span:nth-child(2) { display: none; }
  .ds-score .ds-score-t { grid-column: 1 / -1; grid-row: 2; }
  .ds-score-v { gap: 8px; }
  .ds-score-h .ds-score-v b { gap: 5px; }
  /* the then-and-now search chart keeps its three phone columns inside a two-up grid too, and its head sits on the same columns as its rows */
  .ds-dumb, .ds-grid2 .ds-dumb { --dg: minmax(0, 1fr) 52px 66px; }
  .ds-dumb-h { gap: 12px; }
  .ds-dumb .ds-dumb-l li { padding: 12px 0 14px; }
  /* a title card's plate is a band, not a poster: six cards stay inside five screens */
  .ds-ti-card .ds-tplate { aspect-ratio: 2 / 1; }
  .ds-ti-card .ds-tcard-b { padding: 16px 18px 18px; }

  /* the four stages on Start are sections of one sheet, not four boxes inside it; a step is as tall as its copy */
  .ds-wf4 { gap: 0; }
  .ds-wf-pick.ds-wf4 .ds-wf-col { background: none; border: 0; border-top: 1px solid var(--ds-line); box-shadow: none; padding: 24px 0; }
  .ds-wf-pick.ds-wf4 .ds-wf-col:first-child { border-top: 0; padding-top: 0; }
  .ds-wf4 .ds-wf-steps li { min-height: 0; padding: 10px 0; }
  .ds-wf4 .ds-wf-eg, .ds-wf-pick.ds-wf4 .ds-wf-eg { min-height: 0; }
  .ds-wf-loop { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--ds-line); }
}

/* ============ 7 · one container level: inside a sheet, cards and tiles become hairline rows ============ */
@media screen and (max-width: 720px) {
  /* stat tiles read as rows: the value and its tag on one line, the label under it at full width (no value wraps mid-range, no label wraps to a stub) */
  .ds-page .ds-stats { grid-template-columns: minmax(0, 1fr); background: none; border: 0; border-top: 1px solid var(--ds-line); border-bottom: 1px solid var(--ds-line); }
  .ds-page .ds-stats .ds-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 13px 0; border-left: 0; border-top: 1px solid var(--ds-line); }
  .ds-page .ds-stats .ds-stat:first-child { border-top: 0; }
  .ds-page .ds-stat b { grid-column: 1; grid-row: 1; white-space: nowrap; }
  .ds-page .ds-stat em { grid-column: 2; grid-row: 1; margin: 0; }
  .ds-page .ds-stat span { grid-column: 1 / -1; grid-row: 2; margin: 0; }
  /* the brief is a label and its value per row, so "Nov 3 – Dec 24" stays whole */
  .ds-page .ds-brief { grid-template-columns: minmax(0, 1fr); background: none; border: 0; }
  .ds-page .ds-brief > div { display: grid; grid-template-columns: 6.4em minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 11px 0; border-left: 0; border-top: 1px solid var(--ds-line); }
  .ds-page .ds-brief > div:first-child { border-top: 0; padding-top: 0; }
  .ds-page .ds-brief > div:last-child { padding-bottom: 0; }
  .ds-page .ds-brief b { margin: 0; }
  /* flags, reasons, spots and cuts: full-width rows on a hairline, no fill */
  .ds-risks, .ds-why, .ds-variants, .ds-page .ds-spots { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ds-risks li, .ds-why li, .ds-variants > li, .ds-page .ds-spots > li.ds-spot { background: none; border: 0; border-top: 1px solid var(--ds-line); padding: 18px 0; }
  .ds-risks li:first-child, .ds-why li:first-child, .ds-variants > li:first-child, .ds-page .ds-spots > li.ds-spot:first-child { border-top: 0; padding-top: 2px; }
  .ds-risks li:last-child, .ds-why li:last-child, .ds-variants > li:last-child, .ds-page .ds-spots > li.ds-spot:last-child { padding-bottom: 2px; }
  /* the chosen one keeps its wash, as a band that runs to the sheet's edges */
  .ds-convcuts > li.on, .ds-page .ds-spots > li.ds-spot.locked { margin: 0 -18px; padding: 18px; background: var(--ds-wash); border-top-color: transparent; }
  .ds-convcuts > li.on + li, .ds-page .ds-spots > li.ds-spot.locked + li { border-top-color: transparent; }
  /* a trailer row reads top to bottom: the title, its facts, then what it would start */
  .ds-inputs li { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ds-inputs-v { margin-left: 0; text-align: left; }

  /* concept cards stack one to a row, and the heights that lined three columns up are let go */
  .ds-concepts, .ds-concepts.n4 { grid-template-columns: minmax(0, 1fr); }
  .ds-concepts:is(.n3, .n4) .ds-concept :is(h3, .ds-logline, .ds-best) { min-height: 0; }
  .ds-concepts .ds-concept .ds-rec.ds-rec-none { display: none; }
  .ds-concept-pick { padding: 20px 18px; }

  /* the plan meter is a band across the sheet that pins flush under the header while the cut cards scroll beneath it; nothing shows through above it */
  .ds-planm { top: var(--ds-head); margin: 0 -18px 18px; padding: 12px 18px 14px; border: 0; border-bottom: 1px solid var(--ds-line); }
}

/* ============ 8 · figures, tables and feeds at phone width ============ */
@media screen and (max-width: 720px) {
  /* the trade figure: the name takes a line, the two bars share the next at equal widths (three columns left the bars as slivers, with the values clipped) */
  .ds-vtrade-h, .ds-vtrade-r, .ds-rep-fig .ds-vtrade-h, .ds-rep-fig .ds-vtrade-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 16px; }
  .ds-vtrade-h > span:first-child { display: none; }
  .ds-vtrade-r > b { grid-column: 1 / -1; }
  .ds-vtrade-r.rec > b::after { display: inline; margin: 0 0 0 8px; }
  .ds-vtrade-r .nv, .ds-vtrade-r .ck, .ds-rep-fig .ds-vtrade-r .nv, .ds-rep-fig .ds-vtrade-r .ck { grid-template-columns: minmax(0, 1fr) 3.3em; gap: 8px; }

  /* the campaign status is a three-part rail: each stage sits under its own segment, so it cannot wrap and no connector is left hanging */
  ol.ds-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  ol.ds-steps > .ds-step, ol.ds-steps > .ds-step.on, ol.ds-steps > .ds-step.done { padding: 10px 0 0; border-top: 2px solid var(--ds-line-strong); gap: 6px; letter-spacing: .05em; }
  ol.ds-steps > .ds-step.done { border-top-color: var(--ds-teal); }
  ol.ds-steps > .ds-step.on { border-top-color: var(--ds-blue); }
  ol.ds-steps > .ds-step + .ds-step::before { display: none; }

  /* the audience table: the name and its people take the row, the scores sit under them in equal columns, and the column names stay pinned under the header while the list scrolls */
  .ds-cmpt { overflow: visible; }
  .ds-cmpt table, .ds-cmpt thead, .ds-cmpt tbody { display: block; min-width: 0; width: 100%; }
  .ds-cmpt tr { display: flex; flex-wrap: wrap; }
  .ds-cmpt thead { position: sticky; top: var(--ds-head); z-index: 3; margin: 0 -18px; padding: 0 18px; width: auto; background: var(--ds-paper); }
  .ds-cmpt thead th:first-child { display: none; }
  .ds-cmpt thead th, .ds-cmpt td { flex: 1 1 0; min-width: 0; width: auto; padding: 8px 8px 12px 0; }
  .ds-cmpt thead th { padding: 10px 4px 8px 0; font-size: var(--ds-fs-1); line-height: 1.25; hyphens: auto; }
  .ds-cmpt tbody th { flex: 0 0 100%; width: auto; padding: 0; border-bottom: 0; }
  .ds-cmpt tbody th a { display: block; padding: 14px 0 3px; font-size: var(--ds-fs-4); }
  .ds-cmpt tbody th span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ds-cmpt tr.tgt { margin: 0 -18px; padding: 0 18px; background: var(--ds-wash); }
  .ds-cmpt tr.tgt th, .ds-cmpt tr.tgt td, .ds-cmpt thead th.on, .ds-cmpt td.on { background: none; }
  /* a score leads its cell on the column's left edge, the same edge as the column name over it; the bar follows */
  .ds-cmpt td { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 7px; }
  .ds-cmpt td .ds-bar { flex: 1 1 0; width: auto; min-width: 0; max-width: 54px; }
  .ds-cmpt td em { width: auto; min-width: 1.5em; text-align: left; }

  /* feed rows: the time is a narrow column and the entry keeps the measure */
  .ds-log li { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 12px 0; }
  /* a week-and-day stamp sits over its entry instead of wrapping in a column */
  .ds-timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; }
}

/* ============ 9 · small print: no stub lines, no break at a separator ============ */
@media screen and (max-width: 820px) {
  /* captions and facts lines wrap the way paragraphs here do: the last line never holds a lone tag, which is what left "· Modeled" stranded after a separator (balance was tried and split more of them at the dot) */
  figcaption, .ds-basis, .ds-fnote, .ds-rep-note, .ds-timeline span, .ds-inputs span, .ds-verdict-prov span, .ds-think-sum, .ds-segd-note, .ds-kpi > span, .ds-stat span, .ds-hero-bar span, .ds-cmp-line, .ds-askp-meta { text-wrap: pretty; }
}

/* ============ 10 · touch: nothing stays lit or lifted after a tap ============ */
@media screen and (hover: none) {
  /* a hover lift or wash sticks on a touch screen until the next tap elsewhere; controls that change the page in place go back to rest */
  .ds-tcard:hover, .ds-pcard:hover, .ds-tstrip-c:hover, .ds-act:hover { transform: none; box-shadow: none; }
  .ds-segbtn:hover, .ds-check:hover { background: none; }
  .ds-cmp-pin:hover:not(.on) { color: var(--ds-label); background: none; }
  .ds-how:hover:not([aria-expanded="true"]) { color: var(--ds-label); background: transparent; border-color: var(--ds-line-strong); }
  .ds-aud-read .ds-how:hover:not([aria-expanded="true"]) { color: rgba(244, 245, 247, .78); border-color: rgba(244, 245, 247, .38); }
  .ds-sel:not(.open) .ds-sel-btn:hover { border-color: var(--ds-line-strong); }
  .ds-aud-when:not(.open) .ds-sel-btn:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .22); }
  .ds-totop:hover { background: var(--ds-ink); }
}

/* ============ 11 · the bottom of the screen is one slot (Oct 2 phone pass) ============
   The bar owns it by default. Whatever else needs the bottom takes it whole and the bar steps aside until it is done:
   the console on Home, the search while you type, the keyboard, and a task's own action bar (Start a project).
   An open peek already covers it. Nothing floats on top of the bar, so the screen never carries two bottom bars. */
@media screen and (max-width: 820px) {
  .ds-pbar { visibility: visible; transition: transform .34s cubic-bezier(.2, .8, .2, 1), opacity .22s ease, visibility 0s linear 0s; }
  body:has(.ds-hx.cx-on) .ds-pbar,
  body.ds-asking .ds-pbar,
  body:has(.ds-sq2-bar) .ds-pbar,
  body:has(:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="button"], [type="submit"]), textarea):focus) .ds-pbar {
    transform: translateY(calc(100% + 24px + env(safe-area-inset-bottom, 0px))); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .3s cubic-bezier(.4, 0, .6, 1), opacity .2s ease, visibility 0s linear .3s;
  }
  /* Start's own bar drops into the bar's place */
  html[data-skin] .ds-sq2-bar { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ds-sq2 { padding-bottom: 20px; }
  /* the tour invitation never rides over the console, the search or a peek */
  html[data-skin] body:is(:has(.ds-hx.cx-on), .ds-asking, .ds-peek-open) .ds-tour-inv { opacity: 0; pointer-events: none; }
}
@media screen and (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .ds-pbar, body .ds-pbar { transition: opacity .2s ease, visibility 0s linear .2s; transform: none; }
}

/* ============ 12 · where am I: the back row, the share, the project tabs ============ */
@media screen and (max-width: 820px) {
  /* Home, Audiences, Titles and Projects are named by the bar and the page title; the row only repeated them */
  html[data-skin] body .ds-top[data-place] { display: none; }
  html[data-skin] body:has(.ds-top[data-place]) .ds-main { padding-top: 14px; }
  /* everywhere else it is one compact row: back on the left, the page's name, and Share on the right */
  html[data-skin] body .ds-top { padding-top: 0; }
  html[data-skin] body .ds-top-crumbs { height: 48px; gap: 4px; }
  html[data-skin] body .ds-top-crumbs .ds-top-back { min-height: 44px; margin-left: -4px; }
  html[data-skin] body .ds-top-crumbs b { flex: 1 1 auto; min-width: 0; }
  html[data-skin] body .ds-top-share { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: 0 -10px 0 0; padding: 0; border: 0; border-radius: 12px; background: none; color: var(--ds-muted); cursor: pointer; }
  html[data-skin] body .ds-top-share svg { width: 17px; height: 17px; }
  /* a project's tabs stay under the header while its long pages scroll; the back row slides away beneath the header */
  html[data-skin] body .ds-top:has(.ds-tabs) { position: sticky; top: calc(var(--ds-head) - 48px); z-index: 40; }
}
.ds-top-share { display: none; }

/* ============ 13 · section heads keep the sheet's full measure ============ */
@media screen and (max-width: 720px) {
  /* the icon sits beside the headline; the sentence and its count run under both from the sheet's edge, not indented past the icon */
  :is(.ds-sh, .ds-sh-row):has(> .ds-sh-i) { grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; row-gap: 8px; }
  :is(.ds-sh, .ds-sh-row):has(> .ds-sh-i) > .ds-sh-i { grid-column: 1; grid-row: 1; align-self: center; margin-top: 0; width: 32px; height: 32px; }
  :is(.ds-sh, .ds-sh-row):has(> .ds-sh-i) > :is(h2, h3) { grid-column: 2; grid-row: 1; align-self: center; }
  :is(.ds-sh, .ds-sh-row):has(> .ds-sh-i) > :not(.ds-sh-i, h2, h3) { grid-column: 1 / -1; margin-top: 0; }
}

/* ============ 14 · a project's hero reads the news first ============ */
@media screen and (max-width: 820px) {
  /* stacked, the brief came between the name and where the project stands. On a phone the order is: what it is, where it stands,
     what to do about it, then the brief for reference, then the path */
  html[data-skin] body .ds-phero-grid { display: flex; flex-direction: column; gap: 0; }
  html[data-skin] body .ds-phero-in { display: contents; }
  .ds-phero-in > .ds-hero-k { order: 1; } .ds-phero-in > .ds-phero-t { order: 2; } .ds-phero-in > .ds-phero-about { order: 3; }
  html[data-skin] body .ds-phero-fig { order: 4; margin-top: 22px; }
  html[data-skin] body .ds-phero-row { order: 5; margin-top: 22px; }
  html[data-skin] body .ds-phero-facts { order: 6; margin-top: 24px; }
  /* the path band: the four-count rule above gave each stage name a 4.4em column, which clipped its Done / Now pill to a sliver.
     The name and its pill share the first line; the status runs under them */
  html[data-skin] body .ds-phero .ds-path-bar > * { grid-template-columns: minmax(0, 1fr); row-gap: 5px; padding: 12px 18px 14px; }
  html[data-skin] body .ds-phero .ds-path-bar > * > b { grid-column: 1; grid-row: 1; }
  html[data-skin] body .ds-phero .ds-path-bar > * > span { grid-column: 1; grid-row: 2; }
}

/* ============ 15 · peeks: a handle you can pull ============ */
@media screen and (max-width: 720px) {
  /* the head stays put while the sheet scrolls, carries a grip, and takes the pull (peek.js); the × and the body work as before */
  html[data-skin] .ds-peek { padding-top: 0; }
  html[data-skin] .ds-peek .ds-peek-head { position: sticky; top: 0; z-index: 3; margin: 0 -18px 16px; padding: 24px 18px 14px; background: var(--ds-paper); touch-action: none; }
  html[data-skin] .ds-peek .ds-peek-head::before { content: ''; position: absolute; top: 9px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--ds-line-strong); }
}

/* ============ 16 · touch: a tap answers ============ */
@media screen and (hover: none) and (pointer: coarse) {
  /* cards and buttons dip for the moment the finger is on them, so a tap that leads to a new page still feels taken */
  :is(.ds-pcard, .ds-tcard, .ds-tst-card, .ds-rp-card, .ds-rp-feat, .ds-lib-card, .ds-hx-chip, .ds-segbtn, .ds-act):active { scale: .985; }
  :is(.ds-btn, .ds-pbar-item, .ds-pbar-menu, .ds-top-share, .ds-top-back, .ds-tour-inv-go):active { scale: .96; }
}

/* ---------- 17 · the hero field on a phone (round 54) ----------
   The model chip sat inside the field and left about 50px to type in. On a phone the field is the question and the
   button; the model is named in the line above the headline and in the console's status row. */
@media screen and (max-width: 560px) {
  html[data-skin] body .ds-hx-form .ds-mchip { display: none; }
  /* the button is its arrow on a phone (its name is still "Engage" to a screen reader), so the question has the field */
  html[data-skin] body .ds-hx-form .ds-hx-go { flex: none; width: 48px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  html[data-skin] body .ds-hx-form .ds-hx-go svg { width: 20px; height: 20px; }
  /* the line above the headline: the model, then when it was refreshed on its own line, no divider */
  html[data-skin] body .ds-hx-ref { display: block; margin: 2px 0 0; padding: 0; border: 0; }
}
