/* ══════════════════════════════════════════════════════════════
   shadowee — Path page (mockup 23a "Illustrated journey")
   Loaded after home-calm.css by path.html only.

   Every number below comes from the mockup source
   (mockup/English learning app home screen/English App Home.dc.html):
   the 23a markup, j23()/j23Pal() (map) and lsnVals() (hop overlay).
   Colour/shadow tokens are organic.css verbatim; type uses the app's own
   fonts (Nunito headings, Plus Jakarta Sans body — the same as every other
   page) instead of the mockup's Caprasimo/Figtree. The map is drawn on the mockup's 390 x 2790 design
   canvas and scaled to the column width (pixel-exact at 390px).
   ══════════════════════════════════════════════════════════════ */

.path-body {
  /* organic.css tokens */
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #c67139;
  --color-accent-2: #7a8a5e;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-400: #f6a06b;
  --color-accent-500: #d67f48;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;
  --color-accent-900: #402310;

  --color-accent-2-100: #f0fae1;
  --color-accent-2-200: #e1eecc;
  --color-accent-2-300: #ccdbb2;
  --color-accent-2-400: #aebf92;
  --color-accent-2-500: #8fa073;
  --color-accent-2-600: #728157;
  --color-accent-2-700: #56633f;
  --color-accent-2-800: #3d472b;
  --color-accent-2-900: #272e1b;

  /* the app's fonts (home-calm.css): Nunito headings, Plus Jakarta Sans body */
  --font-heading: var(--cg-font-heading, 'Nunito', system-ui, sans-serif);
  --font-body: var(--cg-font-body, 'Plus Jakarta Sans', system-ui, sans-serif);
  /* the device's own font — for text in the learner's language (translation, exit dialog) */
  --font-system: var(--font, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);

  /* set per level by path.js (j23Pal().page) */
  --pt-page: var(--color-bg);

  background: var(--pt-page);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.path-body *,
.path-body *::before,
.path-body *::after { box-sizing: border-box; }
.path-body [hidden] { display: none !important; }
.path-body button { font-family: inherit; }
.path-body ::-webkit-scrollbar { display: none; }

/* Modals / toast must sit above the practice overlay (z-index 600). */
.path-body .modal-backdrop { z-index: 700; }
.path-body #toast { z-index: 800; }

@keyframes om-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes om-glows {
  0%, 100% { box-shadow: 0 0 0 0 rgba(122, 138, 94, .45); }
  50%      { box-shadow: 0 0 0 16px rgba(122, 138, 94, 0); }
}
@keyframes om-pop { 0%, 80%, 100% { transform: scale(.82); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }
@keyframes om-hls { 0%, 100% { background-color: var(--color-accent-2-200); } 50% { background-color: var(--color-accent-2-300); } }
@keyframes om-hls2 { 0%, 100% { background-color: var(--color-accent-2-300); } 50% { background-color: var(--color-accent-2-200); } }
@keyframes om-hlt { 0%, 100% { background-color: var(--color-accent-200); } 50% { background-color: var(--color-accent-300); } }
@keyframes om-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198, 113, 57, .35); }
  50%      { box-shadow: 0 0 0 14px rgba(198, 113, 57, 0); }
}
/* Whole-passage row states (23a mockup revision 2) */
@keyframes om-eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes om-turn {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(198, 113, 57, .25); }
  50%      { box-shadow: inset 0 0 0 2px rgba(198, 113, 57, .75); }
}

/* ─── Shell ────────────────────────────────────────────────── */
.pt-main {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.pt-status {
  padding: 60px 16px;
  text-align: center;
  color: var(--color-neutral-700);
  font: 500 14px var(--font-body);
}
.pt-status.error { color: var(--color-accent-700); }
.pt-status button {
  margin-left: 6px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--color-accent-700);
  color: #fff;
  font: 800 12px var(--font-body);
  cursor: pointer;
}
.pt-login {
  margin: 40px 16px;
  padding: 40px 20px;
  text-align: center;
  background: var(--color-neutral-100);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}
.pt-login-title { font: 800 20px var(--font-heading); margin-bottom: 8px; }
.pt-login-sub { font: 400 13px/1.5 var(--font-body); color: var(--color-neutral-700); margin-bottom: 18px; }
.pt-login-btn {
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--color-accent-700);
  color: #fff;
  font: 800 13px var(--font-body);
  cursor: pointer;
}
.pt-login-btn:hover { background: var(--color-accent-800); }

/* ─── Journey map ──────────────────────────────────────────── */
#path-content {
  position: fixed;
  inset: 0;
  max-width: 480px;
  margin: 0 auto;
  z-index: 1;
}
.pt-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--pt-page);
}
/* The design canvas is 390 x 2790; --pt-s (set by path.js) scales it to the column. */
.pt-sizer { position: relative; width: 100%; height: calc(2790px * var(--pt-s, 1)); }
.pt-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: 2790px;
  transform-origin: 0 0;
  transform: scale(var(--pt-s, 1));
}
.pt-terrain-wrap svg { position: absolute; left: 0; top: 0; display: block; }
.pt-map {
  position: absolute;
  inset: 0;
  transition: transform .42s cubic-bezier(.35, 0, .2, 1), opacity .3s ease;
}

/* Hop node: 72px (current 86, checkpoint 80), 5px ring, bottom-right badge, name pill below */
.pt-hop {
  position: absolute;
  padding: 0;
  border-radius: 999px;
  border-style: solid;
  border-width: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pt-hop:hover { filter: brightness(1.07); }
.pt-hop:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.pt-hop-halo {
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  background: var(--color-accent-200);
  opacity: .8;
  animation: om-breathe 2.6s ease-in-out infinite;
  pointer-events: none;
}
.pt-hop-badge {
  position: absolute;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pt-hop-badge.done { width: 26px; height: 26px; background: var(--color-neutral-100); box-shadow: var(--shadow-sm); }
.pt-hop-badge.locked { width: 26px; height: 26px; background: var(--color-neutral-100); box-shadow: var(--shadow-sm); }
.pt-hop-badge.current { width: 30px; height: 30px; background: var(--color-accent-300); border: 3px solid var(--color-neutral-100); }
.pt-hop-name {
  position: absolute;
  width: 190px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.pt-hop-name span {
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font: 700 12px var(--font-body);
}

/* Unit pill + arrows (scroll with the map) */
.pt-unit-pill {
  position: absolute;
  left: 20px;
  top: 144px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 9px 13px;
  border-radius: 14px;
  background: var(--color-accent-800);
  box-shadow: var(--shadow-md);
}
.pt-unit-pill span { font: 800 14px var(--font-heading); color: #f5ead8; }
.pt-nav {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.pt-nav.locked { cursor: default; }
.pt-nav:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 26px; }
.pt-nav-disc {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pt-nav.up { left: 169px; top: 60px; width: 212px; height: 52px; }
.pt-nav.up .pt-nav-disc { left: 0; top: 0; background: var(--color-neutral-100); box-shadow: var(--shadow-md); }
.pt-nav.up:hover .pt-nav-disc { background: var(--color-accent-100); }
.pt-nav.up .pt-nav-label {
  position: absolute;
  left: 60px;
  top: 6px;
  width: 152px;
  font: 700 11.5px/1.3 var(--font-body);
  color: var(--pt-ink, var(--color-text));
}
.pt-nav.up:hover .pt-nav-label { color: var(--color-accent-700); }
.pt-nav.down { left: 0; top: 2482px; width: 390px; height: 80px; }
.pt-nav.down .pt-nav-disc { left: 169px; top: 0; }
.pt-nav.down:not(.locked) .pt-nav-disc { background: var(--color-accent-700); box-shadow: var(--shadow-md); }
.pt-nav.down:not(.locked):hover .pt-nav-disc { background: var(--color-accent-800); }
.pt-nav.down.locked .pt-nav-disc { background: var(--color-neutral-300); box-shadow: var(--shadow-sm); }
.pt-nav.down .pt-nav-label {
  position: absolute;
  left: 0;
  top: 62px;
  width: 390px;
  text-align: center;
  font: 700 12px var(--font-body);
  color: var(--color-accent-800);
}
.pt-nav.down:not(.locked):hover .pt-nav-label { opacity: .75; }
.pt-nav.down .pt-nav-note {
  position: absolute;
  left: 0;
  top: 62px;
  width: 390px;
  text-align: center;
  font: 600 11.5px var(--font-body);
  color: var(--pt-muted, var(--color-neutral-700));
}
.pt-nav-lock {
  position: absolute;
  left: 206px;
  top: -10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--color-neutral-100);
  border: 2px solid var(--color-bg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pt-end-note {
  position: absolute;
  left: 0;
  top: 2544px;
  width: 390px;
  text-align: center;
  font: 600 11.5px var(--font-body);
  color: var(--pt-muted, var(--color-neutral-700));
}

/* Floating chrome over the map */
.pt-topfade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 104px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(var(--pt-fade-1, rgba(245, 234, 216, .94)), var(--pt-fade-0, rgba(245, 234, 216, 0)));
}
.pt-levels {
  position: absolute;
  left: 50%;
  bottom: calc(92px + max(0px, env(safe-area-inset-bottom) - 24px));
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 3px;
  padding: 5px;
  border-radius: 999px;
  background: var(--color-neutral-100);
  box-shadow: var(--shadow-lg);
}
.pt-level {
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-neutral-800);
  font: 800 12px var(--font-body);
  cursor: pointer;
}
.pt-level:hover { filter: brightness(1.06); }
.pt-level.active { background: var(--color-accent-700); color: #fff; }

/* Tab bar: deliberately no path-specific styling — uses css/home-calm.css's
   shared .cg-tabbar/.cg-tab rules unmodified, exactly like every other page. */

/* ─── Table of contents icon + popup (23a's j23Toc) ──────────── */
.pt-toc-btn {
  position: absolute;
  top: calc(50px + env(safe-area-inset-top, 0px));
  left: 18px;
  z-index: 7;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--color-neutral-100);
  box-shadow: var(--shadow-md);
  color: var(--color-accent-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.pt-toc-btn:hover { background: var(--color-accent-100); }

/* Popup: a near-full-height inset panel, the mockup's own exact numbers
   (left/right:16, top:64, bottom:64, radius:28, dim:.42). */
.pt-toc-backdrop { align-items: stretch; background: rgba(32, 30, 29, .42); backdrop-filter: none; }
.pt-toc-panel {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 64px;
  bottom: 64px;
  max-width: 480px;
  max-height: none;
  margin: 0 auto;
  padding: 0;
  border-radius: 28px;
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-body);
}
.pt-toc-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 12px 24px;
}
.pt-toc-header-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pt-toc-eyebrow {
  font: 800 10px var(--font-body);
  letter-spacing: .14em;
  color: var(--color-accent-700);
}
.pt-toc-title { font: 400 22px/1.2 var(--font-heading); color: var(--color-text); }
.pt-toc-close {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--color-neutral-200);
  color: var(--color-neutral-800);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.pt-toc-close:hover { background: var(--color-accent-200); }

.pt-toc-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* The background + rounded corners belong to the whole unit (head + its
   expanded hops together), only tinted for the unit currently being
   viewed — not every unit, and not just its head row. */
.pt-toc-unit {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: transparent;
}
.pt-toc-unit.viewing { background: var(--color-neutral-100); }
.pt-toc-unit-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 0;
  border-radius: 20px;
  background: none;
  cursor: pointer;
  text-align: left;
}
.pt-toc-unit-head:hover { filter: brightness(.98); }
.pt-toc-unit-head-locked { opacity: .7; }
.pt-toc-unit-dot {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 800 14px var(--font-body);
  color: #fff;
  background: var(--color-neutral-200);
}
.pt-toc-unit-dot-done { background: var(--color-accent-2-600); }
.pt-toc-unit-dot-current { background: var(--color-accent-700); }
.pt-toc-unit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pt-toc-unit-title { font: 700 15px/1.3 var(--font-body); color: var(--color-text); }
.pt-toc-unit-meta { font: 600 12px var(--font-body); }
.pt-toc-unit-meta-current { color: var(--color-accent-700); }
.pt-toc-unit-meta-done { color: var(--color-accent-2-800); }
.pt-toc-unit-meta-locked { color: var(--color-neutral-600); }
.pt-toc-viewing {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--color-accent-200);
  font: 800 10.5px var(--font-body);
  color: var(--color-accent-800);
}
.pt-toc-chev { flex: none; display: flex; transition: transform .2s ease; color: var(--color-neutral-700); }
.pt-toc-chev.open { transform: rotate(180deg); }

.pt-toc-hops { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 12px 30px; }
.pt-toc-hop {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  background: none;
  cursor: pointer;
  text-align: left;
}
.pt-toc-hop:hover:not(:disabled) { background: var(--color-accent-100); }
.pt-toc-hop:disabled { cursor: default; opacity: .7; }
.pt-toc-hop-dot {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-neutral-200);
}
.pt-toc-hop-done .pt-toc-hop-dot { background: var(--color-accent-2-600); }
.pt-toc-hop-current .pt-toc-hop-dot { background: var(--color-accent-700); }
.pt-toc-hop-name { flex: 1; min-width: 0; font: 600 13.5px/1.3 var(--font-body); color: var(--color-text); }
.pt-toc-hop-locked .pt-toc-hop-name { color: var(--color-neutral-700); }
.pt-toc-hop-current .pt-toc-hop-name { font-weight: 800; }

/* ─── First-visit setup: language + level ─── both steps use the shared picker card (css/pickers.css). */

/* ─── Hop practice overlay — mockup 28a "Script, refined" ──────
   Colours, sizes and motion follow the 28a artboard (390 x 844); fonts are the
   app's own (--font-heading / --font-body). */
.pt-overlay:focus { outline: none; }
.pt-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--color-bg);
  display: flex;
  justify-content: center;
  font-family: var(--font-body);
}
.pt-ov-inner {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow: clip; /* never scrollable, even by focus/scrollIntoView (33f card swap flies off-screen) */
}
.pt-h-blob { position: absolute; border-radius: 999px; pointer-events: none; }
.pt-h-blob.a { right: -70px; top: 120px; width: 190px; height: 190px; background: var(--color-accent-200); opacity: .55; }
.pt-h-blob.b { left: -60px; top: 430px; width: 130px; height: 130px; background: var(--color-accent-2-200); opacity: .6; }

/* Header: ✕ · Line by line / Whole passage · translation */
.pt-h-head {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(24px, calc(env(safe-area-inset-top) + 12px)) 20px 0;
}
.pt-h-round {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pt-h-close { background: var(--color-neutral-100); box-shadow: var(--shadow-sm); color: var(--color-neutral-800); }
.pt-h-close svg { stroke: var(--color-neutral-800); }
.pt-h-close:hover { background: var(--color-accent-100); }
.pt-h-lang { background: var(--color-accent-2-100); }
.pt-h-lang svg { stroke: var(--color-accent-2-800); }
.pt-h-lang:hover { background: var(--color-accent-2-200); }
.pt-h-tabs { position: relative; flex: 1; min-width: 0; display: flex; padding: 4px; border-radius: 999px; background: var(--color-surface); }
/* The active-tab highlight is one sliding thumb, so switching steps glides (33c). */
.pt-h-tab-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--color-neutral-100);
  box-shadow: var(--shadow-sm);
  transition: left .6s cubic-bezier(.3, 1.3, .5, 1);
}
.pt-h-tabs[data-phase="full"] .pt-h-tab-thumb { left: 50%; }
.pt-h-tab {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background .25s;
}
.pt-h-tab span { font: 800 11.5px var(--font-body); color: var(--color-neutral-700); white-space: nowrap; }
.pt-h-tab { position: relative; }
.pt-h-tab span { transition: color .3s; }
.pt-h-tab.active span { color: var(--color-text); }
.pt-h-tab .pt-h-tab-tick { display: none; }
.pt-h-tab.done .pt-h-tab-tick { display: block; }
.pt-h-tab.locked { opacity: .55; cursor: default; }

/* The script card */
.pt-h-card {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 18px 16px 0;
  padding: 24px 22px 22px;
  border-radius: 30px;
  background: var(--color-neutral-100);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}
/* 33f: the whole passage gets a sage card, matching its tab, ring and highlight. */
.pt-h-card.passage { background: var(--color-accent-2-100); }
.pt-h-card.passage .pt-sline[data-hl="listen"] { background-color: var(--color-accent-2-300); animation: om-hls2 1.6s ease-in-out infinite; }
.pt-h-card.passage .pt-sline[data-hl="idle-done"] { background-color: var(--color-accent-2-300); }
/* 33f card swap (ptCardSwap): the old card flies off left, the passage card swings in from the right. */
.pt-h-card-ghost { position: absolute; z-index: 1; margin: 0; pointer-events: none; transition: transform .5s cubic-bezier(.5, 0, .6, 1); }
.pt-h-card-ghost.swap-out { transform: translateX(-118%) rotate(-7deg); }
.pt-h-card.swap-wait { transform: translateX(118%) rotate(7deg); }
.pt-h-card.swap-in { transition: transform .55s cubic-bezier(.3, 1.2, .5, 1); }
.pt-h-titles { flex: none; display: flex; flex-direction: column; gap: 4px; }
.pt-h-unit { font: 800 10px var(--font-body); letter-spacing: .16em; color: var(--color-accent-2-800); }
.pt-h-title { margin: 0; font: 800 26px/1.1 var(--font-heading); color: var(--color-text); text-wrap: pretty; }
.pt-h-script { margin: 0; flex: 1; min-height: 0; overflow-y: auto; font: 500 19px/1.72 var(--font-body); color: var(--color-text); text-wrap: pretty; }
.pt-sline {
  border-radius: 10px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  cursor: pointer;
  transition: color .3s ease, background-color .3s ease;
}
.pt-sline[data-tone="cur"], .pt-sline[data-tone="ahead"] { color: var(--color-text); }
.pt-sline[data-tone="past"] { color: var(--color-neutral-800); }
.pt-sline[data-tone="todo"] { color: var(--color-neutral-600); }
.pt-sline[data-tone="played"] { color: var(--color-neutral-700); }
.pt-sline.strong { font-weight: 700; padding: 3px 7px; margin: 0 -3px; }
.pt-sline[data-hl="listen"] { background-color: var(--color-accent-2-200); animation: om-hls 1.6s ease-in-out infinite; }
.pt-sline[data-hl="turn"] { background-color: var(--color-accent-200); animation: om-hlt 1s ease-in-out infinite; }
.pt-sline[data-hl="beep"] { background-color: var(--color-accent-100); }
.pt-sline[data-hl="idle"] { background-color: var(--color-accent-200); }
.pt-sline[data-hl="idle-done"] { background-color: var(--color-accent-2-200); }
/* Word-highlight-during-playback (ptStartWordHighlight) inside the current line. */
.pt-word { border-radius: 4px; transition: background-color .15s, box-shadow .15s; }
.pt-word.word-active { background-color: rgba(122, 138, 94, .38); box-shadow: 0 0 0 2px rgba(122, 138, 94, .38); }
.pt-h-tr {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--color-bg);
}
.pt-h-tr-lang {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--color-accent-2-200);
  font: 800 10px var(--font-body);
  letter-spacing: .08em;
  color: var(--color-accent-2-900);
}
.pt-h-tr-text { font: 500 14px/1.45 var(--font-system); color: var(--color-neutral-800); text-wrap: pretty; }

.pt-note {
  position: relative;
  flex: none;
  margin: 10px 16px 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--color-accent-100);
  color: var(--color-accent-800);
  font: 600 13px/1.4 var(--font-body);
  text-align: center;
}

/* Footer: status line + controls */
.pt-h-foot {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 22px max(28px, calc(env(safe-area-inset-bottom) + 16px));
}
.pt-h-status { height: 20px; display: flex; align-items: center; gap: 10px; }
.pt-h-ind { display: none; }
.pt-h-status[data-ind="listen"] .pt-h-ind[data-ind="listen"],
.pt-h-status[data-ind="turn"] .pt-h-ind[data-ind="turn"],
.pt-h-status[data-ind="beep"] .pt-h-ind[data-ind="beep"],
.pt-h-status[data-ind="done"] .pt-h-ind[data-ind="done"] { display: flex; }
.pt-h-ind.eq { align-items: center; gap: 2px; height: 14px; }
.pt-h-ind.eq i { width: 3px; height: 14px; border-radius: 999px; background: var(--color-accent-2-700); }
.pt-h-ind.dot { width: 9px; height: 9px; border-radius: 999px; background: var(--color-accent-700); animation: om-breathe .9s ease-in-out infinite; }
.pt-h-ind.pop { gap: 4px; }
.pt-h-ind.pop i { width: 6px; height: 6px; border-radius: 999px; background: var(--color-accent-700); }
.pt-h-ind.tick { align-items: center; }
.pt-h-kick { font: 800 11px var(--font-body); letter-spacing: .16em; }
.pt-h-sep { width: 4px; height: 4px; border-radius: 999px; background: var(--color-neutral-500); }
.pt-h-sub { font: 700 12.5px var(--font-body); color: var(--color-neutral-800); }
/* Shared motion for the eq bars and the popping dots (status line + main button). */
.pt-h-ind.eq i, .pt-h-ic.eq i { transform-origin: center; animation: om-eq .8s ease-in-out infinite; }
.pt-h-ind.eq i:nth-child(2), .pt-h-ic.eq i:nth-child(2) { animation-delay: .18s; }
.pt-h-ind.eq i:nth-child(3), .pt-h-ic.eq i:nth-child(3) { animation-delay: .36s; }
.pt-h-ind.eq i:nth-child(4), .pt-h-ic.eq i:nth-child(4) { animation-delay: .12s; }
.pt-h-ind.eq i:nth-child(5), .pt-h-ic.eq i:nth-child(5) { animation-delay: .28s; }
.pt-h-ind.pop i, .pt-h-ic.pop i { animation: om-pop .9s ease-in-out infinite; }
.pt-h-ind.pop i:nth-child(2), .pt-h-ic.pop i:nth-child(2) { animation-delay: .15s; }
.pt-h-ind.pop i:nth-child(3), .pt-h-ic.pop i:nth-child(3) { animation-delay: .3s; }

.pt-h-controls { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.pt-h-side { width: 80px; display: flex; justify-content: center; }
.pt-h-aux {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pt-h-aux:disabled { cursor: default; opacity: .5; }
.pt-h-aux-disc {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: var(--color-neutral-100);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.pt-h-aux-disc svg { stroke: var(--color-neutral-800); }
.pt-h-aux:not(:disabled):hover .pt-h-aux-disc { background: var(--color-accent-100); }
.pt-h-aux-lbl { font: 700 11px var(--font-body); color: var(--color-neutral-800); text-align: center; }
.pt-h-mic .pt-h-aux-disc { background: var(--color-accent-2-100); }
.pt-h-mic .pt-h-aux-lbl { color: var(--color-accent-2-900); }
.pt-h-mic[data-on="0"] .pt-h-aux-disc { background: var(--color-neutral-200); }
.pt-h-mic[data-on="0"] .pt-h-aux-lbl { color: var(--color-neutral-700); }
.pt-h-mic:hover .pt-h-aux-disc { filter: brightness(.96); background: var(--color-accent-2-100); }
.pt-h-mic[data-on="0"]:hover .pt-h-aux-disc { background: var(--color-neutral-200); }
.pt-h-mic .pt-mic-off, .pt-h-mic[data-on="0"] .pt-mic-on { display: none; }
.pt-h-mic[data-on="0"] .pt-mic-off { display: block; }
.pt-h-mic .pt-mic-on svg, .pt-h-mic .pt-mic-on { stroke: var(--color-accent-2-800); }
.pt-h-mic .pt-mic-off { stroke: var(--color-neutral-700); }
.pt-h-nomic { cursor: default; }
.pt-h-nomic .pt-h-aux-disc { background: var(--color-neutral-200); }
.pt-h-nomic .pt-h-aux-disc svg { stroke: var(--color-neutral-700); }
.pt-h-nomic .pt-h-aux-lbl { color: var(--color-neutral-700); }

.pt-h-ringwrap { position: relative; width: 104px; height: 104px; flex: none; }
.pt-h-ring { position: absolute; inset: 0; }
/* 28a "tap when done": a cream stop badge on the main button's lower-right edge while recording. */
.pt-h-stop {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pt-h-stop[hidden] { display: none; }
.pt-h-stop i { width: 10px; height: 10px; border-radius: 3px; background: var(--color-accent-700); }
.pt-ring-bg, .pt-ring-fg { fill: none; stroke-width: 6; stroke-linecap: round; }
.pt-ring-bg { stroke: var(--color-neutral-300); }
.pt-ring-fg { transition: stroke-dasharray .6s ease; }
.pt-h-ring.draining .pt-ring-fg { transition: stroke-dasharray .8s linear; } /* 33f: drains as the cards swap */
.pt-h-main {
  position: absolute;
  inset: 14px;
  border: 0;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .3s ease, transform .1s;
}
.pt-h-main:active:not(:disabled) { transform: scale(.95); }
.pt-h-main:disabled { cursor: default; opacity: .6; }
.pt-h-ic { display: none; }
.pt-h-main[data-icon="play"] [data-ic="play"],
.pt-h-main[data-icon="next"] [data-ic="next"],
.pt-h-main[data-icon="listen"] [data-ic="listen"],
.pt-h-main[data-icon="beep"] [data-ic="beep"],
.pt-h-main[data-icon="speak"] [data-ic="speak"],
.pt-h-main[data-icon="tick"] [data-ic="tick"] { display: flex; }
.pt-h-ic.pop { gap: 5px; }
.pt-h-ic.pop i { width: 8px; height: 8px; border-radius: 999px; background: #fff; }
.pt-h-ic.eq { align-items: center; gap: 4px; height: 28px; }
.pt-h-ic.eq i { width: 4px; height: 28px; border-radius: 999px; background: #fff; }

/* Dialogs (28a): mic blocked, Hop complete, Leave this hop? */
.pt-h-scrim { position: absolute; inset: 0; background: rgba(32, 30, 29, .42); }
.pt-h-scrim.dark { background: rgba(32, 30, 29, .5); }
.pt-mic-warn, .pt-exit { position: fixed; inset: 0; z-index: 640; display: flex; align-items: center; justify-content: center; padding: 22px; }
.pt-h-dialog {
  position: relative;
  width: 100%;
  max-width: 386px;
  padding: 26px 22px 22px;
  border-radius: 28px;
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-body);
}
.pt-h-dialog.center { align-items: center; padding: 30px 26px 26px; gap: 12px; }
.pt-h-dlg-title { font: 800 21px/1.2 var(--font-heading); color: var(--color-text); }
.pt-h-dialog.center .pt-h-dlg-title { font-size: 22px; text-align: center; }
.pt-h-dlg-body { font: 500 14px/1.5 var(--font-body); color: var(--color-neutral-800); text-wrap: pretty; }
.pt-h-dlg-sub { font: 400 13px/1.5 var(--font-body); color: var(--color-neutral-700); text-align: center; }
.pt-h-dlg-texts { display: flex; flex-direction: column; gap: 8px; }
.pt-h-dlg-badge {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: var(--color-accent-2-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pt-dialog.error .pt-h-dlg-badge { background: var(--color-accent-600); }
.pt-mic-hint { font: 600 12.5px/1.45 var(--font-body); color: var(--color-accent-800); }
.pt-h-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 999px;
  font: 800 14px var(--font-body);
  cursor: pointer;
}
.pt-h-dialog.center .pt-h-btn { font-size: 13px; }
.pt-h-dialog.center .pt-h-btn:first-of-type { margin-top: 6px; }
.pt-h-btn.primary { background: var(--color-accent); color: #fff; }
.pt-h-btn.primary:hover { background: var(--color-accent-600); }
.pt-h-btn.dark { background: var(--color-accent-700); color: #fff; }
.pt-h-btn.dark:hover { background: var(--color-accent-800); }
.pt-h-btn.soft { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.pt-h-btn.soft:hover { background: var(--color-accent-100); }
.pt-h-btn.ghost { background: transparent; color: var(--color-accent-800); }
.pt-h-btn.ghost:hover { background: var(--color-accent-100); }
.pt-h-btn:disabled { opacity: .6; cursor: default; }
/* "Leave this hop?" (28a): a short confirm — title, one line, Leave | Stay side by side.
   Shown in the learner's translation language, so in the device's own font. */
.pt-h-dialog.pt-h-confirm { max-width: 318px; padding: 26px 20px 20px; align-items: center; gap: 6px; text-align: center; }
.pt-h-confirm-btns { align-self: stretch; display: flex; gap: 8px; margin-top: 16px; }
.pt-h-confirm-btns .pt-h-btn { flex: 1; width: auto; min-height: 48px; padding: 0 12px; }
#pt-exit .pt-h-btn.soft { color: var(--color-accent-800); }
#pt-exit .pt-h-dlg-title, #pt-exit .pt-h-dlg-body, #pt-exit .pt-h-btn { font-family: var(--font-system); }
.pt-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 650;
  background: rgba(32, 30, 29, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

/* Step 1: language — the app's shared translate-sheet in the shared picker-card
   style (css/pickers.css). 23a lists the languages first and "No translation" last. */
.path-body .translate-lang-row[data-lang=""] { order: 99; }
.path-body .translate-lang-row[data-lang=""] .translate-lang-native { font-size: 0; }
.path-body .translate-lang-row[data-lang=""] .translate-lang-native::before { content: "No translation"; font: 800 15px var(--cg-font-body, 'Plus Jakarta Sans', sans-serif); }

@media (prefers-reduced-motion: reduce) {
  .pt-hop-halo, .pt-h-main, .pt-sline, .pt-h-ind i, .pt-h-ind.dot, .pt-h-ic i { animation: none !important; }
  .pt-map, .pt-sline, .pt-ring-fg, .pt-h-tab-thumb { transition: none !important; }
}

/* ─── Hop complete popup + celebration (mockup 32a) ─────────────── */
#pt-done .pt-h-dialog.center { max-width: 318px; padding: 30px 24px 22px; gap: 18px; border-radius: 30px; animation: pt-cx-popin .45s cubic-bezier(.3, 1.4, .5, 1) both; }
#pt-done .pt-h-dlg-badge { width: 72px; height: 72px; box-shadow: var(--shadow-md); }
#pt-done .pt-h-dlg-title { font-size: 26px; line-height: 1.1; }
#pt-done .pt-h-dlg-sub { margin-top: -8px; }
#pt-done.pt-dialog-backdrop { background: rgba(32, 30, 29, .38); animation: pt-cx-in .3s ease both; }
.pt-h-dlg-row { width: 100%; display: flex; gap: 8px; }
.pt-h-dlg-row .pt-h-btn { flex: 1; min-height: 50px; font-size: 14px; margin-top: 0 !important; }
.pt-h-dlg-row .pt-h-btn:not([hidden]) + .pt-h-btn { flex: 1; }
#pt-done .pt-h-dialog.center > .pt-h-btn { margin-top: 0; }
@keyframes pt-cx-popin { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.pt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pt-cele { position: absolute; inset: 0; z-index: 630; cursor: pointer; }
/* The bursts are drawn on the hop's own column (390 x 844 artboard, scaled). */
.pt-cx-stage { position: absolute; top: 0; bottom: 0; left: 50%; width: 100%; max-width: 430px; transform: translateX(-50%); overflow: hidden; pointer-events: none; }
.pt-cx-dim { position: fixed; inset: 0; background: rgba(32, 30, 29, .62); animation: pt-cx-fade 2.6s ease forwards; }
.pt-cx-rocket { position: absolute; top: 100%; width: 6px; height: 14px; margin-left: -3px; border-radius: 999px; background: #f5ead8; opacity: 0; animation: pt-cx-rise .55s cubic-bezier(.2, .6, .4, 1) forwards; }
.pt-cx-flash { position: absolute; width: 100px; height: 100px; margin: -50px 0 0 -50px; border-radius: 999px; background: radial-gradient(circle, #f5ead8 0%, rgba(245, 234, 216, 0) 65%); opacity: 0; animation: pt-cx-flash .5s ease-out forwards; }
.pt-cx-spark { position: absolute; border-radius: 999px; transform: translate(-50%, -50%); opacity: 0; animation: pt-cx-spark 1.25s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes pt-cx-fade { 0% { opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pt-cx-rise { 0% { top: 100%; opacity: 1; } 92% { opacity: 1; } 100% { top: var(--ty); opacity: 0; } }
@keyframes pt-cx-flash { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes pt-cx-spark {
  0% { transform: translate(-50%, -50%) translate(0, 0) scale(1); opacity: 1; }
  65% { transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(.9); opacity: 1; }
  100% { transform: translate(-50%, -50%) translate(var(--x), calc(var(--y) + 40px)) scale(.3); opacity: 0; }
}

/* Reward: +XP toast (top) and, when today's streak is new, the streak card. */
.pt-cx-reward.dim::before { content: ''; position: fixed; inset: 0; background: rgba(32, 30, 29, .5); animation: pt-cx-in .25s ease both; }
.pt-cx-reward.leaving::before { animation: pt-cx-out .3s ease forwards; }
.pt-cx-toastrow { position: absolute; left: 0; right: 0; top: max(50px, calc(env(safe-area-inset-top) + 36px)); display: flex; justify-content: center; }
.pt-cx-reward.leaving .pt-cx-toastrow { animation: pt-cx-outup .3s ease forwards; }
.pt-cx-toast { display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 999px; background: var(--color-accent-2-700); box-shadow: var(--shadow-lg); animation: pt-cx-toast .4s cubic-bezier(.3, 1.3, .5, 1) both; }
.pt-cx-zap { flex: none; width: 30px; height: 30px; border-radius: 999px; background: var(--color-accent-2-500); display: flex; align-items: center; justify-content: center; }
.pt-cx-xp { font: 800 20px/1 var(--font-heading); color: #fff; }
.pt-cx-dot { width: 4px; height: 4px; border-radius: 999px; background: rgba(245, 234, 216, .6); }
.pt-cx-how { font: 700 13px var(--font-body); color: #f5ead8; }
.pt-cx-cardrow { position: absolute; left: 0; right: 0; top: 34%; display: flex; justify-content: center; }
.pt-cx-reward.leaving .pt-cx-cardrow { animation: pt-cx-out .3s ease forwards; }
.pt-cx-card { width: 300px; max-width: calc(100% - 40px); padding: 18px; border-radius: 26px; background: var(--color-neutral-100); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; animation: pt-cx-pop .5s cubic-bezier(.3, 1.4, .5, 1) .3s both; }
.pt-cx-streak { display: flex; align-items: baseline; gap: 8px; }
.pt-cx-streak b { font: 700 15px var(--font-body); color: var(--color-text); }
.pt-cx-roll { display: inline-block; height: 1em; overflow: hidden; line-height: 1; font: 800 38px var(--font-heading); color: var(--color-accent-700); }
.pt-cx-roll > span { display: flex; flex-direction: column; animation: pt-cx-roll .55s cubic-bezier(.3, 1.4, .5, 1) .85s forwards; }
.pt-cx-roll > span > span { height: 1em; line-height: 1; }
.pt-cx-week { display: flex; justify-content: space-between; gap: 6px; }
.pt-cx-wd { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pt-cx-wd b { font: 700 11px var(--font-body); color: var(--color-neutral-700); }
.pt-cx-wd.today b { color: var(--color-accent-800); }
.pt-cx-day { position: relative; width: 30px; height: 30px; border-radius: 999px; border: 2px dashed var(--color-neutral-400); box-sizing: border-box; }
.pt-cx-day.done { border: 0; background: var(--color-accent); }
.pt-cx-day.shield { border: 0; background: var(--color-accent-2-600); }
.pt-cx-pulse, .pt-cx-fill { position: absolute; inset: -2px; border-radius: 999px; background: var(--color-accent); opacity: 0; }
.pt-cx-pulse { animation: pt-cx-pulse .8s ease-out .95s both; }
.pt-cx-fill { display: flex; align-items: center; justify-content: center; animation: pt-cx-pop .5s cubic-bezier(.3, 1.4, .5, 1) .7s forwards; }
@keyframes pt-cx-in { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes pt-cx-out { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.92); } }
@keyframes pt-cx-outup { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes pt-cx-toast { 0% { transform: translateY(-120%); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes pt-cx-pop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pt-cx-roll { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }
@keyframes pt-cx-pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #pt-done .pt-h-dialog.center, #pt-done.pt-dialog-backdrop { animation: none; }
}
