/* Landing v4: the app pictures (WI-713 onwards). The phone frame and the app's screen, copied from /landing/
   (landing/index.html, "Phone frame" to the loop's reduced-motion rule; now /landing/v3/) so the pictures are the same
   everywhere: change them there and here together. Since overnight run 3 (Part 5, round 2) every picture here is still:
   the loop and its cross-fade, the pressed card and the ☆ filling are gone (/landing/v3/ keeps its own). Each phone is a
   .phone box, scaled by --s, holding the 386 x 766 .device. Values are recorded in DESIGN.md. */
.phone { --s: 0.6; --frame: #0B0C0F; position: relative; width: calc(386px * var(--s)); height: calc(766px * var(--s)); flex: none; }
.screen { --grain-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .86 0 0 0 0 .88 0 0 0 0 .92 0 0 0 .15 -.065'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); }

/* Phone frame: the same as /go/ (WI-652): silver rim, black border, notch with camera, speaker, side buttons. Drawn at
   386 x 766 with the 360 x 740 screen inside. Front-on and flat: no lean, turn or 3D perspective (WI-666). */
.device {
  position: absolute; left: 0; top: 0; width: 386px; height: 766px; padding: 10px; transform: scale(var(--s, 1)); transform-origin: 0 0;
  border: 3px solid transparent; border-radius: 57px;
  background:
    linear-gradient(var(--frame), var(--frame)) padding-box,
    linear-gradient(135deg, #d9dde2 0%, #858c95 20%, #c7ccd2 42%, #6c737c 68%, #b4b9c0 100%) border-box;
  box-shadow: inset 0 0 0 3px rgba(140, 148, 158, 0.26), 0 40px 60px -14px rgba(0, 0, 0, 0.55), 0 8px 18px rgba(0, 0, 0, 0.35);
}
.device::before {
  content: ''; position: absolute; left: -6px; right: -6px; top: -3px; bottom: -3px; pointer-events: none;
  background-repeat: no-repeat;
  background-size: 4px 26px, 4px 48px, 4px 48px, 4px 82px;
  background-position: 0 131px, 0 180px, 0 243px, 100% 184px;
  background-image:
    linear-gradient(90deg, #7d848d, #e1e5ea 45%, #aab0b8), linear-gradient(90deg, #7d848d, #e1e5ea 45%, #aab0b8),
    linear-gradient(90deg, #7d848d, #e1e5ea 45%, #aab0b8), linear-gradient(270deg, #7d848d, #e1e5ea 45%, #aab0b8);
}
.device::after {
  content: ''; position: absolute; left: 50%; top: 2px; width: 74px; height: 6px; margin-left: -37px;
  border-radius: 3px; background: linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.10));
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.45);
}
/* Inside the screen: the real app (light, unbranded master app), copied from the app (WI-696, WI-698): its Light
   background with the light-mode grain from theme.js, Nunito, and the app's own sizes and colours. The colours are the
   app's, as variables, so the colour dots (--a-brand) and Light | Dark (.m-dark: the app's Dark palette from theme.js,
   with the light grain) change every frame of the loop. */
.screen {
  --a-bg: #F7FAFC; --a-card: #fff; --a-text: #1A2B45; --a-text2: #3A4556; --a-line: #D7E3EE; --a-refline: #D7E3EE;
  --a-link: #306AA0; --a-logo: #14284A; --a-brand: #3B82C4;
  /* The demo's three colours (worker/demo.js colourCss(); landing round 3, the hero's looks): Colour 1 the selected tab,
     Colour 2 the step numbers, Colour 3 (--a-brand, the app's --blue) everything else. All three are --a-brand unless a
     look in hero-looks.json sets them on a hero screen (phones.js). */
  --a-c1: var(--a-brand); --a-c2: var(--a-brand);
  position: relative; width: 360px; height: 740px; overflow: hidden; border-radius: 44px;
  display: flex; flex-direction: column; color: var(--a-logo); font-size: 16px; line-height: 1.2; text-align: left;
  --app-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .30 0 0 0 0 .24 0 0 0 0 .16 0 0 0 .42 -.185'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-color: var(--a-bg); background-image: var(--app-grain); font-family: 'Nunito', sans-serif;
}
.screen.m-dark {
  --a-bg: #121418; --a-card: #22262D; --a-text: #EDF1F6; --a-text2: #B7C1CD; --a-line: #3A424D; --a-refline: #3A424D;
  --a-link: #7DB3E8; --a-logo: #EDF1F6; --app-grain: var(--grain-light);
}
.status { position: relative; flex: none; height: 44px; }
.notch { position: absolute; left: 50%; top: 0; width: 150px; height: 28px; border-radius: 0 0 18px 18px; background: var(--frame); transform: translateX(-50%); }
.status::before, .status::after { content: ''; position: absolute; top: 0; width: 6px; height: 6px; }
.status::before { left: calc(50% - 81px); background: radial-gradient(circle at 0 100%, transparent 6px, var(--frame) 6.5px); }
.status::after { left: calc(50% + 75px); background: radial-gradient(circle at 100% 100%, transparent 6px, var(--frame) 6.5px); }
.notch::after {
  content: ''; position: absolute; left: 50%; top: 6px; width: 9px; height: 9px; margin-left: -58px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #4f8cf0 0%, #1f4aa8 28%, #0b1530 62%, #05070b 100%);
  box-shadow: 0 0 0 2px #232830;
}
.m-head { position: relative; flex: none; height: 50px; display: flex; align-items: center; justify-content: center; }
.m-logo { font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; color: var(--a-logo); }
/* Aa, as the app's button.text-size: 48px round, white, "Aa" in Link blue, top right. The app has no gear any more. */
.m-aa {
  position: absolute; right: 16px; top: 1px; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--a-card); color: var(--a-link); font-size: 18px; font-weight: 700; box-shadow: 0 1px 3px rgba(26, 43, 69, 0.08);
}
.m-home { flex: 1; min-height: 0; overflow: hidden; padding: 10px 16px 0; color: var(--a-text); line-height: normal; }
/* The search bar (a picture: nothing to type into). */
.m-search {
  display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 4px 0 16px; background: var(--a-card); border: 1px solid var(--a-line);
  border-radius: 16px; box-shadow: 0 1px 3px rgba(26, 43, 69, 0.08); color: var(--a-text2); font-size: 16px; white-space: nowrap;
}
.m-search svg { width: 22px; height: 22px; fill: var(--a-text2); flex: none; }
/* The six tiles in Primary blue. Only their height is a little less than the app's (12px top padding, 8px gap,
   at least 120px, against 16px, 10px and 128px) so the A–Z list can peek above the bar; labels are never cut off. */
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 32px; }
.m-tile {
  position: relative; min-width: 0; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 8px 30px; border-radius: 20px; background: var(--a-brand); color: #fff; text-align: center; box-shadow: 0 6px 14px -6px rgba(10, 30, 40, 0.45);
}
.m-tile .ic { width: 48px; height: 48px; fill: #fff; flex: none; }
.m-tile .lbl { max-width: 100%; font-size: 19px; font-weight: 700; line-height: 1.15; overflow-wrap: break-word; }
.m-tile .chev { position: absolute; right: 12px; bottom: 11px; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* The A–Z list's first cards, cut off by the bar. */
.m-card { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 16px; border-radius: 16px; background: var(--a-card); box-shadow: 0 1px 3px rgba(26, 43, 69, 0.08); }
.m-circle { width: 48px; height: 48px; border-radius: 50%; background: var(--a-brand); flex: none; display: flex; align-items: center; justify-content: center; }
.m-circle svg { width: 22px; height: 22px; fill: #fff; }
.m-card-text { flex: 1; }
.m-card-title { font-size: 16px; font-weight: 700; }
.m-card-sub { margin-top: 2px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--a-text2); }
.m-chevron { color: var(--a-text2); font-size: 20px; }
/* The bottom bar, as nav.js draws it: Home selected on Home and Asthma attack (a chapter page), Favourites on Favourites. 8px more
   below the tabs for the phone's home strip. */
.m-bar {
  position: relative; z-index: 1; flex: none; display: flex; padding: 6px 8px 14px;
  background: var(--a-card); border-top: 1px solid var(--a-line); box-shadow: 0 -1px 3px rgba(26, 43, 69, 0.08);
}
.m-tab { flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px; color: var(--a-text2); }
.m-tab-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 30px; border-radius: 999px; flex: none; }
.m-tab-icon svg { width: 22px; height: 22px; fill: currentColor; }
.m-tab-label { display: block; width: 100%; font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; }
.screen:not([data-page="fav"]) .m-tab[data-tab="home"], .screen[data-page="fav"] .m-tab[data-tab="fav"] { color: var(--a-link); }
.screen:not([data-page="fav"]) .m-tab[data-tab="home"] .m-tab-icon, .screen[data-page="fav"] .m-tab[data-tab="fav"] .m-tab-icon { background: var(--a-c1); color: #fff; }

/* An app page over the bar. A screen shows the page its data-page names (home, topic, fav or biz), which also marks the
   selected tab (above; the business tab's phone marks its tab by class, .m-tab.on, as copied from "Inside the app"). */
.m-pages { position: relative; flex: 1; min-height: 0; }
.m-page { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; visibility: hidden; }
.screen[data-page="home"] .m-p-home, .screen[data-page="topic"] .m-p-topic, .screen[data-page="fav"] .m-p-fav, .screen[data-page="biz"] .m-p-biz { opacity: 1; visibility: visible; }
/* Asthma attack: the top of asthma.html as the app shows it at 360 wide, cut off by the bar. As on every chapter page,
   Aa moves to 72px from the right and the ☆ sits where it was. */
.m-aa.m-aa-ch { right: 72px; }
.m-star {
  position: absolute; right: 16px; top: 1px; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--a-card); color: var(--a-link); box-shadow: 0 1px 3px rgba(26, 43, 69, 0.08);
}
.m-star svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.screen.m-starred .m-star svg { fill: currentColor; }
.m-body { flex: 1; min-height: 0; overflow: hidden; padding: 7px 16px 0; color: var(--a-text); line-height: normal; }
.m-h1 { margin: 0 0 24px; font-size: 28px; font-weight: 700; }
.m-steps { margin: 16px 0; }
.m-step { position: relative; display: flex; gap: 16px; padding-bottom: 24px; }
.m-step:last-child { padding-bottom: 0; }
.m-step:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 32px; bottom: -24px; width: 2px; background: var(--a-line); }
.m-step-circle {
  position: relative; z-index: 1; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--a-c2); color: #fff; font-size: 15px; font-weight: 700;
}
.m-step-body { padding-top: 4px; font-size: 16px; }
.m-step-body strong { display: block; margin-bottom: 4px; }
.m-step-body strong.m-inline { display: inline; margin: 0; }
.m-h2 { margin: 32px 0 12px; font-size: 20px; font-weight: 700; }
.m-p { margin: 15px 0; font-size: 15px; line-height: 1.5; color: var(--a-text2); }
/* Favourites with Asthma attack saved: the app's own tile size and label (favourites.html). */
.m-favs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.m-tile.m-fav { min-height: 128px; gap: 10px; padding: 16px 8px 30px; }
.m-tile.m-fav .lbl { -webkit-hyphens: auto; hyphens: auto; }

/* CPR's AED section (still; WI-715 follow-up 3, replacing Recovery position): cpr.html as the AED tile opens it
   (cpr.html#aed), laid out as the app at 360 wide: the page is scrolled so "Using a defibrillator (AED)" sits 72px
   from the top, with the last line of the list above it behind Aa and ☆, as in the app. Step 1's picture is the
   app's own (images/deck/cpr-aed-step-1.jpg), styled as cpr.html's img.step-image.step-icon (WI-924 fix round). */
.m-p-aed .m-head { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.m-p-aed .m-body { padding-top: 0; }
.m-plain { margin: 8px 0; padding-left: 20px; list-style: disc; font-size: 15px; line-height: 1.6; color: var(--a-text2); }
.m-plain.m-aed-cut { margin-top: 0.5px; }
.m-step-image { display: block; width: 100%; height: auto; margin: 8px 0 0; border-radius: 16px; }
.m-step-image.m-step-icon { max-width: 160px; }
.m-sign { color: var(--a-text); }

/* Still screens (Phase 4, WI-715): the five phones of landing/screens/ ("Inside the app") and the booklet card's small
   home screen. Every page of a still screen shows, and the selected tab is marked by class, as on the screens page. */
.v4-still .m-page { opacity: 1; visibility: visible; }
.m-tab.on { color: var(--a-link); }
.m-tab.on .m-tab-icon { background: var(--a-c1); color: #fff; }
/* The business tab (business.html): the business name, and six placeholder tiles in the brand colour, not tappable. */
.m-biz { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.m-biz-tile {
  min-width: 0; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 8px; border-radius: 20px; background: var(--a-brand); color: #fff; text-align: center; box-shadow: 0 6px 14px -6px rgba(10, 30, 40, 0.45);
}
.m-biz-tile svg { width: 48px; height: 48px; fill: #fff; flex: none; }
.m-biz-tile span { max-width: 100%; font-size: 19px; font-weight: 700; line-height: 1.15; overflow-wrap: break-word; }
/* Settings (settings.html, the master app): Appearance (Light | Dark, Light chosen), Language (English), Login. */
.m-switch { display: inline-flex; padding: 6px; border-radius: 999px; background: var(--a-card); box-shadow: 0 1px 3px rgba(26, 43, 69, 0.08); }
.m-switch span { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--a-text); }
.m-switch span.on { background: var(--a-text); color: var(--a-bg); }
.m-switch svg { width: 18px; height: 18px; fill: currentColor; }
.m-select { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 12px; background: var(--a-card); color: var(--a-text); font-size: 16px; }
.m-select svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-top: 32px; padding: 14px 16px; border-radius: 16px; background: var(--a-card); }
.m-row-name { font-size: 15px; font-weight: 700; color: var(--a-text2); }
.m-badge { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; background: #FFF4E0; color: #966006; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }

/* The colour fill on the branding phone (WI-715 follow-up 5, phones.js): the new colour is a layer under the tile's (or
   circle's, or pill's) icon and words, clipped to a circle that grows from the centre. */
.m-fill { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; clip-path: circle(0% at 50% 50%); }
.m-circle, .m-tab-icon { position: relative; }
.m-tile > .ic, .m-tile > .lbl, .m-circle > svg, .m-tab-icon > svg { position: relative; z-index: 1; }
.m-tile > .chev { z-index: 1; }
