/* ==========================================================================
   Kern on a phone's browser: its own pages, drawn for a thumb.

   Not the laptop's pages made smaller. On a phone the next step is the biggest
   thing on the screen and everything else is a quiet list beneath it. Colour is
   for place: each subject has a hue and its pages wear it. There are no boxes
   inside boxes, nothing is pinned to the screen's edge, nothing swipes: a page
   is a column you scroll, like a website.

   kern-phone.js draws Home, Courses, a subject and a course; app.js hands them
   over when the window is a phone's. This file styles those, the unit page and
   progress (which the lab and progress.js still draw), the lesson, the phone
   menu (kern.js) and the signed-out front door. The laptop page is untouched:
   what is not inside the phone query only hides phone-only pieces.
   ========================================================================== */
html.kern .kp-menu-btn, html.kern .kp-menu { display: none; }   /* the phone's menu (kern.js builds it); never on a laptop */
html.kern .kp-fold > summary { list-style: none; }

/* ----------------------------------------------------------------------
   The phone's pages (kern-phone.js). Written without a query on purpose: they
   are only ever drawn for a phone, and a window that grows afterwards keeps
   them readable (a single column, never wider than 640px).
   ---------------------------------------------------------------------- */
html.kern .kx { --h: #0a6b58; --hl: var(--h); max-width: 640px; margin-inline: auto; }
html.kern .kx :where(button) { text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html.kern .kx :where(ul, ol) { list-style: none; margin: 0; padding: 0; }
/* A band that runs edge to edge, whatever the page's side room is. */
html.kern .kx-bleed { margin-inline: calc(var(--kx-gut, 18px) * -1); padding-inline: var(--kx-gut, 18px); }

html.kern .kx-hi { margin: 0 0 18px; font-size: 15px; color: var(--ink-3); }
html.kern .kx-title { margin: 4px 0 18px; font-size: 38px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
html.kern .kx-display { margin: 6px 0 10px; font-size: clamp(30px, 9.4vw, 40px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; text-wrap: balance; }
html.kern .kx-kick { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--hl); }
html.kern .kx-lede { margin: 0 0 12px; font-size: 16.5px; line-height: 1.5; color: var(--ink-2); }
html.kern .kx-meta { margin: 0 0 22px; font-size: 14.5px; color: var(--ink-3); }
html.kern .kx-h { margin: 44px 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
html.kern .kx-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; min-height: 36px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
html.kern .kx-back::before { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 2.5px 0 0 2.5px; transform: rotate(-45deg); margin-right: 2px; }

/* The one big button, with the lip the whole site's buttons have. */
html.kern .kx-cta { display: block; width: 100%; height: 58px; border-radius: 60px; background: var(--kern); color: #fff; font-size: 17px; font-weight: 650; text-align: center;
  transition: transform .1s ease-out, filter .15s; }
html.kern .kx-cta:active { transform: scale(.985); }
html.kern .kx-link { display: inline-block; margin-top: 16px; padding: 6px 0; font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
html.kern .kx-ghost { display: block; width: 100%; margin-top: 26px; padding: 15px 18px; border-radius: 16px; font-size: 15px; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--hair); }

/* Home's top: what to do now, on a wash of its course's colour. */
html.kern .kx-now, html.kern .kx-hero { position: relative; margin-top: 0; padding-top: 6px; padding-bottom: 26px; }
html.kern .kx-now::before, html.kern .kx-hero::before { content: ""; position: absolute; inset: -80px 0 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--h) 24%, transparent), transparent 85%); }
html.kern .kx-hero { padding-top: 14px; }
html.kern .kx-bigic { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 20px; color: var(--h);
  background: color-mix(in srgb, var(--h) 20%, var(--k-card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--h) 35%, transparent); }
html.kern .kx-bigic svg { width: 34px; height: 34px; }

/* The week: one band. */
html.kern .kx-week { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 16px; padding: 18px 0 16px; border-block: 1px solid var(--hair); }
html.kern .kx-streak { margin: 0; font-size: 15px; color: var(--ink-3); }
html.kern .kx-streak b { font-size: 36px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); margin-right: 4px; vertical-align: -3px; }
html.kern .kx-days { display: flex; gap: 7px; }
html.kern .kx-days li { display: grid; justify-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
html.kern .kx-days i { width: 22px; height: 22px; border-radius: 50%; background: var(--k-track); }
html.kern .kx-days .on i { background: var(--kern); }
html.kern .kx-days .today i { box-shadow: 0 0 0 2px var(--k-canvas), 0 0 0 3.5px var(--ink-3); }
html.kern .kx-days .today.on i { box-shadow: 0 0 0 2px var(--k-canvas), 0 0 0 3.5px var(--kern); }
html.kern .kx-xp { grid-column: 1 / -1; margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
@media (max-width: 400px) {
  html.kern .kx-week { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  html.kern .kx-days { justify-content: space-between; }
  html.kern .kx-days li { flex: 1; }
}

/* Lists: a picture, a name, how far. A hairline between, nothing around. */
html.kern .kx-row, html.kern .kx-step { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
html.kern .kx-rows > li:last-child > .kx-row { border-bottom: 0; }
html.kern .kx-ic { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: var(--h);
  background: color-mix(in srgb, var(--h) 17%, var(--k-card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--h) 28%, transparent); }
html.kern .kx-ic svg { width: 26px; height: 26px; }
html.kern .kx-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
html.kern .kx-tx b { font-size: 17px; font-weight: 650; letter-spacing: -.012em; line-height: 1.25; }
html.kern .kx-tx small { font-size: 13.5px; color: var(--ink-3); }
html.kern .kx-chev { flex: none; width: 9px; height: 9px; margin-right: 6px; border: solid var(--ink-3); border-width: 0 2.5px 2.5px 0; transform: rotate(-45deg); }
html.kern .kx-ring { flex: none; width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--h) calc(var(--p) * 1%), var(--k-track) 0);
  -webkit-mask: radial-gradient(circle 9.5px, transparent 98%, #000); mask: radial-gradient(circle 9.5px, transparent 98%, #000); }
html.kern .kx-none { padding: 14px 0; font-size: 15px; color: var(--ink-3); }

/* Search, and the subjects under it. */
html.kern .kx-search { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 18px; border-radius: 60px; background: var(--k-card); color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--k-line-2); }
html.kern .kx-search:focus-within { box-shadow: inset 0 0 0 2px var(--kern); color: var(--ink); }
html.kern .kx-search svg { flex: none; width: 21px; height: 21px; }
html.kern .kx-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 17px; }
html.kern .kx-search input::placeholder { color: var(--ink-3); }
html.kern .kx-hits { margin-top: 6px; }
html.kern .kx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
html.kern .kx-chip { height: 42px; padding: 0 16px; border-radius: 60px; font-size: 15px; font-weight: 600; color: var(--ink-2); background: var(--k-card); box-shadow: inset 0 0 0 1px var(--k-line-2); }
html.kern .kx-wrong { display: block; margin-top: 36px; }

html.kern .kx-subs { margin-top: 22px; display: grid; gap: 10px; }
html.kern .kx-sub { border-radius: 22px; background: color-mix(in srgb, var(--h) 11%, var(--k-card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--h) 20%, transparent); }
html.kern .kx-sub > summary { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 18px 14px 14px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
html.kern .kx-sub > summary::-webkit-details-marker { display: none; }
html.kern .kx-sub > summary .kx-chev { transform: rotate(45deg); transition: transform .25s var(--kern-ease); margin-right: 4px; }
html.kern .kx-sub[open] > summary .kx-chev { transform: rotate(-135deg); }
html.kern .kx-sub > .kx-rows { padding: 0 18px 6px 14px; }
html.kern .kx-sub .kx-row { border-bottom-color: color-mix(in srgb, var(--h) 16%, transparent); }

/* A course's units: a line you walk, a stop for each. Where you are is lit. */
html.kern .kx-rail { position: relative; margin-top: 4px; }
html.kern .kx-rail li { position: relative; }
html.kern .kx-rail li::before { content: ""; position: absolute; left: 25px; top: 0; bottom: 0; width: 2px; background: var(--hair); }
html.kern .kx-rail li:first-child::before { top: 50%; }
html.kern .kx-rail li:last-child::before { bottom: 50%; }
html.kern .kx-rail li.done::before { background: color-mix(in srgb, var(--kern-ok) 55%, transparent); }
html.kern .kx-step { position: relative; border-bottom: 0; min-height: 76px; padding-left: 0; }
html.kern .kx-step .kp-pad { width: 52px; height: 52px; z-index: 1; box-shadow: inset 0 0 0 2px var(--k-line-2), 0 0 0 5px var(--k-canvas); }
html.kern .kx-step .kp-pad svg { width: 32px; height: 32px; }
html.kern .kx-rail li.cur .kp-pad { box-shadow: inset 0 0 0 2.5px var(--kern), 0 0 0 5px var(--k-canvas), 0 0 22px rgba(10,107,88,.3); }
html.kern .kx-rail li.cur .kx-tx b { color: var(--k-ink); }
html.kern .kx-rail li.done .kp-pad { background: var(--k-green-t); box-shadow: inset 0 0 0 2px var(--k-green), 0 0 0 5px var(--k-canvas); }
html.kern .kx-rail li.soon { opacity: .5; }
html.kern .kx-fold { margin-top: 26px; }

@media (max-width: 700px) {

  html.kern { --kx-gut: 18px; --bar: 52px; --kn-2: 12px; --kn-3: 18px; --kn-4: 24px; --kn-5: 32px; --kn-6: 40px; }
  html.kern[data-look="obsidian"] { --gut: 18px; }
  html.kern body { font-size: 16px; overflow-x: clip; }
  html.kern, html.kern body { -webkit-text-size-adjust: 100%; }
  html.kern input, html.kern textarea, html.kern select { font-size: max(16px, 1em); }   /* iOS zooms into anything smaller */

  /* ------------------------------------------------------------ Header
     The mark, your streak, one button. Where to go is behind the button, in a
     page of its own (kern.js builds it), not a row of tabs. The header slides
     away as you read down and returns as soon as you read up. */
  html.kern .lx-bar { transition: transform .32s var(--kern-ease); }
  html.kern .lx-bar.kp-away { transform: translateY(-100%); }
  html.kern .lx-bar-in { height: calc(var(--bar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0 16px; gap: 10px; }
  html.kern .lx-mark { margin-right: -2px; }
  html.kern .lx-name { display: block; font-size: 19px; letter-spacing: -.02em; }
  html.kern .lx-top, html.kern #presence, html.kern #barProg, html.kern .lx-user { display: none; }
  html.kern .lx-streak { font-size: 15px; gap: 5px; padding: 0 2px; }
  html.kern .lx-streak .lx-streak-unit { margin-left: -2px; }
  html.kern .lx-streak svg { width: 15px; height: 15px; }
  html.kern .kp-menu-btn { display: grid; place-content: center; gap: 6px; flex: none; width: 48px; height: 48px; margin-right: 0; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
  html.kern .kp-menu-btn i { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .35s var(--kern-ease); }
  html.kern .kp-menu-btn[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
  html.kern .kp-menu-btn[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }

  /* The menu: a page under the header. The one thing to do first, then the places in large type. */
  html.kp-menu-open, html.kp-menu-open body { overflow: hidden; }
  html.kern .kp-menu { display: block; position: fixed; z-index: 60; inset: calc(var(--bar) + env(safe-area-inset-top)) 0 0 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 6px 20px calc(28px + env(safe-area-inset-bottom)); background: var(--k-canvas); opacity: 0; transform: translateY(-10px); visibility: hidden;
    transition: opacity .25s ease-out, transform .35s var(--kern-ease), visibility 0s .35s; }
  html.kern .kp-menu.on { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  html.kern .kp-menu > * { opacity: 0; transform: translateY(12px); transition: opacity .4s ease-out, transform .5s var(--kern-ease); transition-delay: calc(var(--i, 0) * 50ms + 70ms); }
  html.kern .kp-menu.on > * { opacity: 1; transform: none; }
  html.kern .kp-menu button { text-align: left; -webkit-tap-highlight-color: transparent; }
  html.kern .kp-m-go { display: flex; align-items: center; gap: 16px; width: 100%; margin: 10px 0 8px; padding: 16px; border-radius: 24px;
    border: 1.5px solid var(--kern); background: linear-gradient(135deg, rgba(84,104,255,.2), rgba(84,104,255,.05)); box-shadow: 0 0 40px -18px rgba(84,104,255,.8); }
  html.kern .kp-m-go:active { transform: scale(.985); }
  html.kern .kp-m-ic { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 17px; background: var(--k-soft); border: 1px solid var(--rule); }
  html.kern .kp-m-ic svg { width: 30px; height: 30px; }
  html.kern .kp-m-tx { display: grid; gap: 2px; min-width: 0; }
  html.kern .kp-m-tx em { font-style: normal; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
  html.kern .kp-m-tx b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
  html.kern .kp-m-tx span { font-size: 14px; color: var(--ink-2); line-height: 1.35; }
  html.kern .kp-m-links { list-style: none; margin: 10px 0 18px; padding: 0; }
  html.kern .kp-m-links li + li { border-top: 1px solid var(--hair); }
  html.kern .kp-m-links button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 0; font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--ink-3); transition: color .2s; }
  html.kern .kp-m-links button::after { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(-45deg); opacity: .5; }
  html.kern .kp-m-links button[aria-current="true"] { color: var(--ink); }
  html.kern .kp-m-links button[aria-current="true"]::after { width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--kern); transform: none; opacity: 1; }
  html.kern .kp-m-tutor { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; border-radius: 60px; font-size: 16.5px; font-weight: 600; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--k-line-2); }
  html.kern .kp-m-tutor svg { width: 21px; height: 21px; }
  html.kern .kp-m-me { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 22px; padding: 14px 0 0; border-top: 1px solid var(--hair); }
  html.kern .kp-m-me .av { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--k-ink); color: #fff; font-size: 14px; font-weight: 600; }
  html.kern .kp-m-me span:last-child { display: grid; gap: 1px; }
  html.kern .kp-m-me b { font-size: 16.5px; font-weight: 600; }
  html.kern .kp-m-me em { font-style: normal; font-size: 13.5px; color: var(--ink-3); }

  /* The laptop's row of subject links has no place here: Courses opens the subject you tap. */
  html.kern #subbar { display: none; }

  /* The page: less room above and below. */
  html.kern .lx-wrap { padding: 20px var(--kx-gut) 56px; }

  /* The Tutor lives in the menu; it is out of the way of every list. (In a lesson it is a small round button at the foot.) */
  html.kern .tt-open { display: none; }
  html.kern .tt { right: 12px; bottom: 12px; left: 12px; width: auto; max-width: 440px; margin-left: auto; height: min(560px, calc(100svh - 24px)); }
  html.kern .lx-badge { bottom: 16px; }

  /* ------------------------------------------------------------ A unit
     The lab draws it; here it gets the course's colour, one way back, one button,
     and its lessons as the same line the course page walks. */
  html.kern .kx-unit .lb-unit { max-width: none; padding-bottom: 0; }
  html.kern .kx-unit .lb-uhead { position: relative; margin: -20px calc(var(--kx-gut) * -1) 14px; padding: 18px var(--kx-gut) 6px; }
  html.kern .kx-unit .lb-uhead::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--h, #0a6b58) 26%, transparent), transparent 95%); }
  html.kern .bc { margin-bottom: 10px; font-size: 15px; }
  html.kern .bc ol li { display: none; }
  html.kern .bc ol li:nth-last-child(3) { display: block; }
  html.kern .bc ol li:nth-last-child(3) .bc-a { padding-left: 0; font-weight: 600; color: var(--ink-2); }
  html.kern .bc ol li:nth-last-child(3) .bc-a::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border: solid currentColor; border-width: 2.5px 0 0 2.5px; transform: rotate(-45deg); vertical-align: 1px; }
  html.kern .kx-unit .lb-uhead h1.lx-h1 { margin: 6px 0 10px; font-size: clamp(30px, 9.4vw, 40px); letter-spacing: -.035em; line-height: 1.05; text-wrap: balance; }
  html.kern .kx-unit .lb-uhead .lx-lede { font-size: 15.5px; line-height: 1.5; color: var(--ink-3); max-width: none; margin: 0;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  html.kern .kp-meta { margin-top: 0; gap: 6px; }
  html.kern .kp-meta span { padding: 4px 11px; font-size: 12.5px; }
  html.kern .lb-block { margin-bottom: var(--kn-4); }
  /* Up next is just the button, with its name above it. */
  html.kern .kp-next { display: grid; gap: 4px; margin-top: 18px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  html.kern .kp-next .kp-pad { display: none; }
  html.kern .kp-next .tx { display: grid; gap: 4px; }
  html.kern .kp-next .tx .eb { color: var(--hl, var(--blue)); }
  html.kern .kp-next .tx b { font-size: 21px; letter-spacing: -.02em; }
  html.kern .kp-next .tx span:not(.eb) { display: none; }
  html.kern .kp-next .lx-btn, html.kern .kp-next .kp-btn { width: 100%; margin-top: 10px; height: 58px; font-size: 17px; }
  html.kern .lb-next { flex-wrap: wrap; padding: 16px; gap: 14px; border-radius: 22px; margin-bottom: var(--kn-4); }

  html.kern .kp-h2 { margin: 40px 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
  html.kern .kp-path { margin: 0; gap: 0; display: block; position: relative; }
  html.kern .kp-node { position: relative; left: 0; width: auto; max-width: none; margin: 0; animation: none; }
  html.kern .kp-node::before { content: ""; position: absolute; left: 29px; top: 0; bottom: 0; width: 2px; background: var(--hair); }
  html.kern .kp-node:first-child::before { top: 50%; }
  html.kern .kp-node:last-child::before { bottom: 50%; }
  html.kern .kp-node.done::before { background: color-mix(in srgb, var(--kern-ok) 55%, transparent); }
  html.kern .kp-hit { position: relative; gap: 14px; padding: 8px 0 8px 4px; border-radius: 0; min-height: 66px; -webkit-tap-highlight-color: transparent; }
  html.kern .kp-hit:hover { background: none; }
  html.kern .kp-hit:active .kp-pad { transform: none; }
  html.kern .kp-pad { width: 50px; height: 50px; z-index: 1; box-shadow: inset 0 0 0 2px var(--k-line-2), 0 0 0 5px var(--k-canvas); }
  html.kern .kp-pad svg { width: 32px; height: 32px; }
  html.kern .kp-pad.plain b { font-size: 17px; }
  html.kern .kp-node.done .kp-pad { box-shadow: inset 0 0 0 2px var(--k-green), 0 0 0 5px var(--k-canvas); }
  html.kern .kp-node.done .kp-pad::after { width: 18px; height: 18px; background-size: 11px; box-shadow: 0 0 0 2px var(--k-canvas); }
  html.kern .kp-node.cur .kp-pad { box-shadow: inset 0 0 0 2.5px var(--kern), 0 0 0 5px var(--k-canvas), 0 0 22px rgba(10,107,88,.3); }
  html.kern .kp-lab b { font-size: 16.5px; }
  html.kern .kp-lab span { font-size: 13px; }
  html.kern .kp-go { display: none; }
  html.kern .kp-more { margin-top: var(--kn-4); }
  html.kern .kp-skills { gap: 8px; }
  html.kern .kp-skill { min-height: 44px; }

  /* Secondary lists: a heading you tap. (kern.js builds these on a phone; without it they simply stay open.) */
  html.kern .kp-fold { margin-bottom: 0; border-top: 1px solid var(--hair); }
  html.kern .kp-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; cursor: pointer; }
  html.kern .kp-fold > summary::-webkit-details-marker { display: none; }
  html.kern .kp-fold > summary > h2 { margin: 0; flex: 1; min-width: 0; font-size: 19px; display: flex; align-items: baseline; gap: 10px; }
  html.kern .kp-fold > summary > h2 span { font-size: 14px; font-weight: 500; color: var(--ink-3); }
  html.kern .kp-fold > summary::after { content: ""; flex: none; width: 20px; height: 20px; background: var(--ink-3);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform .2s var(--kern-ease); }
  html.kern .kp-fold[open] > summary::after { transform: rotate(180deg); }
  html.kern .kp-fold > :not(summary) { margin-top: 0; }
  html.kern .kp-fold[open] { padding-bottom: 8px; }
  html.kern .ab-binder > p { font-size: 14.5px; margin: 0 0 14px; }
  html.kern .ab-bar { margin-bottom: 14px; }
  html.kern .ab-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  html.kern .ab-mini { padding: 16px; border-radius: 18px; }

  /* ------------------------------------------------------------ Progress
     How today and this week are going first; what you have mastered, and the
     badges, after. (kern-phone.js puts the sections in that order.) */
  html.kern #v-progress { display: flex; flex-direction: column; }
  html.kern #v-progress > .lx-hello { display: none; }
  html.kern #v-progress .lx-h1 { order: -3; margin: 4px 0 14px; font-size: 38px; letter-spacing: -.035em; }
  html.kern #v-progress .lx-next { order: -2; margin: 0; padding: 18px 0 20px; border: 0; border-radius: 0; background: none; box-shadow: none; border-block: 1px solid var(--hair); }
  html.kern #v-progress .lx-next h2 { margin: 2px 0 4px; font-size: 30px; letter-spacing: -.03em; }
  html.kern #v-progress .lx-h2 { margin: 36px 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
  html.kern #v-progress .lx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html.kern #v-progress .lx-card { min-height: 0; padding: 14px; border-radius: 18px; }
  html.kern #v-progress .lx-card h3 { font-size: 15.5px; }
  html.kern #v-progress .lx-card p { font-size: 13px; line-height: 1.45; margin-top: 4px; }
  html.kern #v-progress .lx-card .foot { padding-top: 10px; font-size: 12.5px; }
  html.kern .kx-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 150px; margin: 6px 0 0; padding: 0; list-style: none; }
  html.kern .kx-chart li { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
  html.kern .kx-chart .kx-n { height: 16px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
  html.kern .kx-chart .kx-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
  html.kern .kx-chart .kx-bar i { display: block; width: 100%; max-width: 28px; border-radius: 9px; background: var(--k-track); }
  html.kern .kx-chart .on .kx-bar i { background: var(--kern); }
  html.kern .kx-chart .kx-d { font-size: 12px; font-weight: 600; color: var(--ink-3); }
  html.kern .kx-chart.none { height: 64px; }
  html.kern .lx-barrow { grid-template-columns: 28px minmax(0, 1fr) 56px; gap: 12px; }
  html.kern .lx-bars { gap: 12px; margin-top: 12px; }
  html.kern .lx-dims { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  /* ------------------------------------------------- A lesson, quiz, test
     The work, then its button. The step bar is one row: out, back, where you are,
     on, and the lesson list. The buttons follow the work down the page as they do
     on a laptop (the verdict arrives beside them, never off the screen). */
  html.kern .lx-wrap:has(#v-lab.on .lb-shell) { padding: 10px 16px 0; --lb-lead: 0px; }
  html.kern .lx-wrap:has(#v-lab.on .lb-shell.side-off) { padding-left: 16px; padding-right: 16px; }
  html.kern .lb-shell { position: relative; }
  html.kern .lb-shell .ch { padding: 0; max-width: none; }
  html.kern .lb-shell .ch-stepnav { gap: 2px; margin: 0 0 8px; padding: 0 40px 0 0; height: 44px; }
  html.kern .lb-shell .ch-sn-x { width: 40px; height: 40px; margin: 0; }
  html.kern .lb-shell .ch-sn-btn { width: 34px; height: 40px; margin: 0; }
  html.kern .lb-shell .ch-sn-mid { padding: 0 2px; }
  html.kern .lb-shell .ch-sn-dots { gap: 3px; }
  html.kern .lb-shell .ch-sn-dot { height: 26px; }
  html.kern .lb-shell .ch-sn-dot::before { top: 9px; }
  /* The lesson list is a link at the row's end, not a handle on the window's edge. */
  html.kern .lb-shell .lb-side-show { display: grid; position: absolute; z-index: 5; top: 2px; right: 0; left: auto; width: 40px; height: 40px; margin: 0;
    border-radius: 50%; background: none; box-shadow: none; color: var(--ink-3); transform: none; }
  html.kern .lb-shell .lb-side-show svg { display: none; }
  html.kern .lb-shell .lb-side-show::before { content: ""; width: 22px; height: 22px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11M4 6.5h.01M4 12h.01M4 17.5h.01'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11M4 6.5h.01M4 12h.01M4 17.5h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
  html.kern .lb-shell.peek .lb-side { width: min(88vw, 340px); }
  html.kern .lb-shell.peek .lb-side-show { display: none; }
  /* A quiz or test has no step bar: leave the top row to the lesson-list link. */
  html.kern .lb-shell:not(:has(.ch-stepnav)) .ch { padding-top: 44px; }

  html.kern .ch-stage { display: block; }
  html.kern body .ch-card.ch-card { min-height: 0; padding: 8px 0 0; }
  html.kern body .ch-card.ch-card::before { inset: -20px -16px 0; }
  /* Read from the left: a phone's lines are short, and a centred line is harder to find the start of. */
  html.kern .lb-shell :is(.ch-kind, .ch-prompt, .ch-then, .ch-after, .ch-work, .ch-options, .ch-hints, .ch-cap) { text-align: left; }
  html.kern .lb-shell .ch-work { justify-items: start; justify-content: flex-start; }
  html.kern .ch-kind { margin-bottom: 10px; font-size: 11px; }
  html.kern .ch-prompt { font-size: 19px; line-height: 1.45; margin-inline: 0; }
  html.kern .ch-art { margin-top: 18px; }
  html.kern .ch-work { margin-top: 20px; }
  html.kern .ch-options { gap: 10px; }
  html.kern .ch-opt { padding: 15px 16px; font-size: 16.5px; min-height: 52px; }
  html.kern .ch-foot { padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); gap: 10px; flex-wrap: wrap; margin-top: 24px; }
  html.kern .ch-foot .ch-btn.primary { flex: 1 1 auto; min-width: 0; margin-inline: 0; height: 52px; font-size: 17px; }
  html.kern .ch-foot-l { margin-left: 0; flex: none; }
  html.kern .ch-sheet.on { flex: 1 1 100%; max-height: 40vh; overflow-y: auto; }
  /* The Tutor, in a lesson, is a small round button at the foot's end, beside Hint and Check. */
  html.kern body:has(#v-lab.on .lb-shell) .tt-open { display: flex; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  html.kern body:has(#v-lab.on .lb-shell) .tt-open span { display: none; }
  html.kern body:has(#v-lab.on .lb-shell) .ch-foot { padding-right: 58px; }
  html.kern body:has(#v-lab.on .lb-shell) .ch-sheet.on { margin-right: -58px; }
  html.kern body:has(.lb-shell.peek) .tt-open { display: none; }

  /* ------------------------------------------------- Course kits with columns
     A film with its chapters beside it, the test-prep hub: beside becomes under,
     and columns become a list. */
  html.kern .ch:has(.ed-watch) { max-width: none; }
  html.kern .ed-watch { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  html.kern .ed-main { width: 100%; }
  html.kern .ed-side { height: 340px; }
  html.kern .ed-ctl { gap: 0; }
  html.kern .ed-time { min-width: 0; }
  html.kern .lx-wrap:has(#v-course.on .st-hub), html.kern .lx-wrap:has(#v-lab.on .st-page) { max-width: none; }
  html.kern .st-row2, html.kern .st-row3, html.kern .st-invite, html.kern .st-tools, html.kern .st-domgrid,
  html.kern .st-scan-how, html.kern .st-spot-list, html.kern .st-lay-tabs { grid-template-columns: minmax(0, 1fr); }
  html.kern .st-card { padding: 18px; }
  html.kern .st-invite { padding: 20px; gap: 16px; }
  html.kern .st-map-r { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  html.kern .st-dom { grid-template-columns: minmax(0, 1fr) auto 42px; }
  html.kern .st-opp { flex-direction: column; align-items: stretch; gap: 16px; padding: 22px 20px 20px 24px; }
  html.kern .st-opp h2 { font-size: 23px; }
  html.kern .st-opp-r { width: 100%; }

  /* ------------------------------------------------------- The front door
     One line, one sentence, one button, then the real step to try. The rest is
     short: three facts, three sentences, the courses, one more button. The site's
     own bar and footer are left as the site draws them. */
  html.kern #gate.kf .kf-main { font-size: 16px; }
  html.kern #gate.kf .kf-wrap { width: calc(100% - 40px); }
  html.kern #gate.kf .kf-btn.kf-big { height: 54px; padding: 0 24px; font-size: 17px; }
  html.kern #gate.kf .kf-hero { width: calc(100% - 40px); grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 30px 0 44px; min-height: 0; }
  html.kern #gate.kf .kf-hero h1 { font-size: 54px; margin-bottom: 16px; }
  html.kern #gate.kf .kf-lede { font-size: 18px; line-height: 1.5; margin-bottom: 24px; }
  html.kern #gate.kf .kf-go { flex-direction: column; gap: 6px; }
  html.kern #gate.kf .kf-go .kf-btn { width: 100%; }
  html.kern #gate.kf .kf-go .kf-ghost { height: 44px; background: none; box-shadow: none; font-size: 16px; color: var(--kf-ink-2); }
  html.kern #gate.kf .kf-note-s { margin-top: 10px; text-align: center; }
  html.kern #gate.kf .kf-hero-c { justify-self: stretch; }
  html.kern #gate.kf .kf-card { width: 100%; height: auto; padding: 18px 18px 20px; border-radius: 26px; }
  html.kern #gate.kf .kf-kick { margin-top: 18px; }
  html.kern #gate.kf .kf-ask { font-size: 19px; }
  html.kern #gate.kf .kf-stage { margin-top: 14px; }
  html.kern #gate.kf .kf-fb { min-height: 64px; margin-top: 12px; }

  /* Three facts: three plain rows. */
  html.kern #gate.kf .kf-facts { padding: 0 0 48px; }
  html.kern #gate.kf .kf-facts-in { gap: 0; border-top: 1px solid var(--kf-line); width: calc(100% - 40px); }
  html.kern #gate.kf .kf-fact { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 14px; text-align: left; padding: 16px 0; border: 0; border-bottom: 1px solid var(--kf-line); border-radius: 0; }
  html.kern #gate.kf .kf-fact-ic { grid-row: 1 / 3; width: 24px; height: 24px; margin: 3px 0 0; }
  html.kern #gate.kf .kf-fact-t { font-size: 20px; }
  html.kern #gate.kf .kf-fact p { margin: 2px 0 0; max-width: none; font-size: 14.5px; }

  /* The story and the moves: words only. (The little lesson mock-ups beside them are
     decoration, and the real step is already above.) */
  html.kern #gate.kf .kf-teach, html.kern #gate.kf .kf-moves { padding: 0 0 48px; }
  html.kern #gate.kf .kf-h2 { font-size: 32px; text-align: left; }
  html.kern #gate.kf .kf-teach .kf-h2 { margin-bottom: 24px; }
  html.kern #gate.kf .kf-row { display: block; margin: 0 0 28px; }
  html.kern #gate.kf .kf-teach .kf-row-t p + p, html.kern #gate.kf .kf-teach .kf-panel, html.kern #gate.kf .kf-move-fig { display: none; }
  html.kern #gate.kf .kf-row-t h3 { font-size: 25px; margin-bottom: 8px; }
  html.kern #gate.kf .kf-row-t p { font-size: 15.5px; line-height: 1.55; }
  html.kern #gate.kf .kf-moves .kf-h2 { margin-bottom: 8px; }
  html.kern #gate.kf .kf-moves-in { grid-template-columns: minmax(0, 1fr); gap: 0; }
  html.kern #gate.kf .kf-move { border: 0; border-top: 1px solid var(--kf-line); border-radius: 0; padding: 18px 0; }
  html.kern #gate.kf .kf-move h3 { padding: 0; font-size: 19px; }
  html.kern #gate.kf .kf-move p { padding: 6px 0 0; font-size: 15px; }

  /* Courses: the subjects, the course names, then its units in a list. */
  html.kern #gate.kf .kf-courses, html.kern #gate.kf .kf-books { padding: 0 0 48px; }
  html.kern #gate.kf .kf-shelf { padding: 28px 14px 14px; border-radius: 24px; text-align: left; }
  html.kern #gate.kf .kf-shelf .kf-h2 { max-width: none; margin: 0 6px 20px; font-size: 28px; }
  html.kern #gate.kf .kf-tabs { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin: 0 0 16px; }
  html.kern #gate.kf .kf-tab { height: 38px; padding: 0 16px; font-size: 14.5px; }
  html.kern #gate.kf .kf-shelf-in { padding: 8px; gap: 4px; border-radius: 20px; }
  html.kern #gate.kf .kf-shelf-l { padding: 8px 4px 4px; }
  html.kern #gate.kf .kf-shelf-l h3 { display: none; }
  html.kern #gate.kf #kfList { display: flex; flex-wrap: wrap; gap: 6px; }
  html.kern #gate.kf .kf-shelf-l button { width: auto; margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.6); gap: 8px; }
  html.kern #gate.kf .kf-shelf-r { min-height: 0; padding: 18px 16px 16px; border-radius: 16px; }
  html.kern #gate.kf .kf-units-h h4 { font-size: 24px; }
  html.kern #gate.kf .kf-units { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 18px; }
  html.kern #gate.kf .kf-units li { gap: 12px; }
  html.kern #gate.kf .kf-units .kp-pad.sm { width: 38px; height: 38px; }
  html.kern #gate.kf .kf-units .kp-pad.sm svg { width: 24px; height: 24px; }
  html.kern #gate.kf .kf-units span:last-child { font-size: 15px; }
  html.kern #gate.kf .kf-books .kf-row { display: grid; gap: 20px; margin-inline: auto; }
  html.kern #gate.kf .kf-src { width: 100%; }

  /* The last word. */
  html.kern #gate.kf .kf-final-in { padding: 64px 20px 56px; }
  html.kern #gate.kf .kf-final h2 { font-size: 40px; margin-bottom: 28px; }
  html.kern #gate.kf .kf-white { width: 100%; height: 56px; padding: 0 24px; font-size: 18px; }
/* Very small phones: one more notch tighter. */
@media (max-width: 360px) {
  html.kern { --kx-gut: 14px; }
  html.kern[data-look="obsidian"] { --gut: 14px; }
  html.kern .lx-wrap { padding-inline: 14px; }
  html.kern .lx-bar-in { padding-left: 12px; }
  html.kern body .lx-top button { padding: 0 8px; font-size: 14px; }
  html.kern .kh-hi, html.kern .kp-head h1, html.kern .lb-uhead h1.lx-h1 { font-size: 25px; }
  html.kern .ch-prompt { font-size: 18px; }
}
