/* Phone layer for the approved designs. Desktop (over 760px) is untouched: it is the canvas, one to one.
   On phones the same design reflows; these few rules handle what inline styles cannot. */
.v6-menu-btn { display: none; }
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  img, video, iframe, svg { max-width: 100%; }
  /* Main menu: behind a Menu button on phones, so every link (Subscribe included) is reachable. Without script it simply wraps. */
  nav[aria-label="Main"] { flex: 1 1 100% !important; flex-wrap: wrap !important; gap: 12px 20px !important; padding: 6px 0 4px; }
  .v6-js nav[aria-label="Main"].v6-closed { display: none !important; }
  .v6-menu-btn { display: inline-flex !important; align-items: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 600; color: #F1EEE7; background: transparent; border: 1px solid #4A5362; border-radius: 6px; padding: 9px 14px; cursor: pointer; }
  /* Workspace sidebar becomes a top bar with a sideways scrolling menu */
  aside { flex: none !important; width: 100% !important; gap: 12px !important; padding: 12px 12px 8px !important; }
  aside nav[aria-label="Admin"] { flex-direction: row !important; overflow-x: auto; white-space: nowrap; gap: 4px !important; scrollbar-width: none; }
  aside nav[aria-label="Admin"]::-webkit-scrollbar { display: none; }
  aside nav[aria-label="Admin"] a { flex: none; }
  aside > div:last-child { display: none !important; }
  /* Wide tables scroll inside their card instead of pushing the page sideways (wrapper added by the runtime) */
  .dc-scroll { width: 0; min-width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  pre, code { white-space: pre-wrap; word-break: break-word; }
  /* Stop iPhones zooming into form fields */
  input, select, textarea { font-size: 16px !important; max-width: 100%; }
  /* Long words and links never force sideways scrolling */
  p, li, h1, h2, h3 { overflow-wrap: break-word; }
}

/* Phase 7 polish, workspace only (every rule starts with #app, which only the workspace has). */
/* The tick button on a to do row was 26 px, too small for a thumb. */
#app .ck { min-width: 36px; min-height: 36px; }
/* Small grey captions written with an inline color were 3.6 to 1 on white; this darker grey is 5.7 to 1 (the menu on the left is left as it is). */
#app .main [style*="color:#8C877E"], #app .main [style*="color: #8C877E"] { color: #6B665D !important; }
@media (max-width: 760px) {
  /* Room under the last row so the Feedback and Chats buttons never sit on top of it. */
  #app .main { padding-bottom: 92px; }
  #ws-fb-btn { padding: 8px 14px !important; font-size: 13px !important; min-height: 40px !important; left: 12px !important; bottom: 12px !important; }
}

/* The same darker grey for the captions the page styles set in their own style sheets. */
#app .main :is(.profbox .pf3 small, .cntp, .wstats small, .pmhead small, .chip span, .log span, .revr span, .rctl .rnote, .dd span, .dfoot small, .rbar .rhint, .note, .pno, .pmeta small, .dsum span, .chk2 small, .f small, .qq small, .steps, .flabel, .pbx, .s2 .n) { color: #6B665D; }

/* Phase 7 polish, round two (workspace on a phone). */
@media (max-width: 760px) {
  /* The menu and search bar stay put at the top with a solid background, so lists slide under it instead of behind the menu button. */
  #app .main > .top { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background: #F3F1EC; padding-bottom: 8px; box-sizing: border-box; }
  #app .main { padding-top: 72px; }
  #app .hamb { z-index: 40; }
  /* A page title never breaks into two short lines ("To / do") next to its note. */
  #app .ehdr h1, #app .ehdr h2 { white-space: nowrap; }
  #app .ehdr { flex-wrap: wrap; row-gap: 6px; }
  /* On Webinars the front page card is a setting, not the first thing a phone user wants: the list comes first. */
  #app .body:has(> section[aria-label="Front page"]) { display: flex; flex-direction: column; }
  #app .body:has(> section[aria-label="Front page"]) > section[aria-label="Front page"] { order: 10; margin-top: 16px; }
  /* Every button style reaches a comfortable thumb size. */
  #app :is(.btn, .sbtn, .sbtn2, .iconb, .addb, .wb, .sbt, .pcancel) { min-height: 40px; }
  /* In the Webinars list the transcript status (Full, 3 min) was a tall stack on every row: it now wraps along the row instead. */
  #app .trf { display: flex !important; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
  #app .trf > b { flex: 0 0 auto; min-width: 44px; }
  /* Tab rows that scroll sideways: no scrollbar, a soft fade on the right while there is more, and a snap. */
  #app .etabs { scrollbar-width: none; scroll-snap-type: x proximity; }
  #app .etabs::-webkit-scrollbar { display: none; }
  #app .etabs > * { scroll-snap-align: start; }
  #app .etabs.more { -webkit-mask-image: linear-gradient(to right, #000 86%, transparent); mask-image: linear-gradient(to right, #000 86%, transparent); }
}

/* Workspace colour, shape and type tokens. New and changed screens use these names; the old values stay until each screen is touched. */
#app, .ws {
  --ws-ink: #141414;        /* text, dark buttons, the menu */
  --ws-text-2: #5F5B53;     /* second text (6.8 to 1 on white) */
  --ws-text-3: #6B665D;     /* captions (5.7 to 1 on white) */
  --ws-line: #E2DED5;       /* borders and dividers */
  --ws-line-2: #ECE8E0;     /* lighter dividers */
  --ws-field: #CFCAC0;      /* input borders */
  --ws-surface: #FFFFFF;    /* cards */
  --ws-page: #F3F1EC;      /* page background */
  --ws-accent: #F0A63A;     /* focus rings, highlights */
  --ws-danger: #8A1C12;     /* errors, late */
  --ws-ok: #1F6B35;         /* done, on */
  --ws-r-s: 8px; --ws-r-m: 12px; --ws-r-l: 20px; --ws-r-pill: 999px;
  --ws-t-s: 13px; --ws-t-m: 14px; --ws-t-l: 16px; --ws-t-h: 24px;
  --ws-gap-s: 8px; --ws-gap-m: 12px; --ws-gap-l: 20px;
}

/* Step 228: the On this page links glide to their section, easing in and out, instead of jumping. Devices set to reduce motion keep the plain jump. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
