/* Journey and today cards, v2 (templates/journey/v2/). Every class is jc- so nothing here reaches the
   old cards (journey/exercise.html), which the v2 chapters also show on a larger screen.
   Status colors are the colors of the status symbols (commonAssets/image/status_*.png), so a pill, a
   ring and the symbol beside it always agree. Text on a tint uses the darker inks, which pass AA. */

.jc-page, #jcSheet {
  --jc-ink: var(--bia-fg, #201b39); --jc-body: #3f3a58; --jc-muted: var(--bia-muted, #5c5773);
  --jc-purple: #6c5fc0; --jc-purple-ink: #4a3fb0;
  --jc-ok: #55ccaa; --jc-work: #ffc876; --jc-hard: #fb7179; --jc-lock: #e6e1f6;
  --jc-green-ink: #1F7050;
  --jc-grad: linear-gradient(135deg, #149079 0%, #6c5fc0 70%, #877ad0 100%);
}
.jc-page { max-width: 560px; margin: 18px auto 8px; padding: 0 12px; display: grid; gap: 22px; text-align: left; }
.jc-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.jc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jc-page a.blank, #jcSheet a.blank { text-decoration: none; }

/* Status tints for the sheet's progress block. */
.jc-complete { --jc-bg: #EAF8F2; --jc-bd: #c4ebdc; --jc-fg: #1F7050; --jc-so: #2f9e7a; }
.jc-progress { --jc-bg: #FFF6E3; --jc-bd: #f6dfa8; --jc-fg: #7A4E00; --jc-so: #b97a00; }
.jc-improve { --jc-bg: #FFEDEE; --jc-bd: #fcc9cd; --jc-fg: #a3212c; --jc-so: #d8424e; }
.jc-locked { --jc-bg: #F3F0FB; --jc-bd: #e1dbf3; --jc-fg: #4b4566; --jc-so: #7d7699; }
.jc-open { --jc-bg: #F1EEFF; --jc-bd: #d9d3f3; --jc-fg: #4a3fb0; --jc-so: #6c5fc0; }

/* A chapter or today section: a soft fill with no border, so each chapter reads as one tappable
   block and it is clear where one ends and the next begins. */
.jc-page { gap: 12px; }
.jc-panel { position: relative; display: grid; gap: 12px; margin: 0; width: auto; padding: 8px; background: rgba(255,255,255,.55); border-radius: 22px; }
.jc-panel:has(.jc-head[aria-expanded="true"]) { padding-bottom: 12px; background: rgba(255,255,255,.4); }
/* The games hub has no colored card behind its chapters, so the soft fill fades into the page there.
   Its chapters are solid panels with a fine edge instead, and its cards get the same edge so they
   still read as separate from the white panel. */
.jc-games .jc-panel, .jc-games .jc-panel:has(.jc-head[aria-expanded="true"]) { background: #fff; box-shadow: 0 0 0 1px rgba(108,95,192,.18), 0 2px 10px rgba(40,30,90,.06); }
.jc-games .jc-list .jc-card:not(.returnHighlight) { box-shadow: 0 0 0 1px rgba(108,95,192,.16); }
@media (hover: hover) { .jc-games .jc-list .jc-card:not(.returnHighlight):hover { box-shadow: 0 0 0 1px rgba(108,95,192,.16), 0 6px 18px rgba(40,30,90,.10); } }
.jc-h { margin: 0; padding: 0; font: inherit; line-height: inherit; }
/* The header: the ring, the title with one pill per step and the count under it, the chevron. */
.jc-head { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: center; background: none; border: 0; padding: 6px; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 16px; }
@media (hover: hover) { .jc-head:hover { background: rgba(255,255,255,.7); } }
.jc-head:focus-visible, .jc-main:focus-visible, .jc-act:focus-visible, .jc-x:focus-visible, .jc-navRow a:focus-visible { outline: 3px solid var(--bia-focus, #6c5fc0); outline-offset: 2px; }
.jc-hText { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
/* One size folded or open, so opening a chapter does not make its header jump. */
.jc-hTitle { font-size: 19px; font-weight: 700; color: var(--jc-ink); line-height: 1.15; }
.jc-hMeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.jc-head > .jc-chv { width: 18px; height: 18px; stroke-width: 2.6; color: var(--jc-purple); margin-right: 4px; }
.jc-head[aria-expanded="true"] > .jc-chv { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) { .jc-head > .jc-chv { transition: transform .2s ease; } }

/* One pill per step: filled with its outcome, outlined while open (purple) or locked (pale). */
.jc-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.jc-pl { display: block; width: 17px; height: 7px; border-radius: 99px; }
.jc-p-complete { background: var(--jc-ok); }
.jc-p-progress { background: var(--jc-work); }
.jc-p-improve { background: var(--jc-hard); }
.jc-p-open { background: #fff; box-shadow: inset 0 0 0 1.5px var(--jc-purple); }
.jc-p-locked { background: #fff; box-shadow: inset 0 0 0 1.5px #c9c1e4; }

/* The ring: drawn once by the macro, sized here, the same folded or open. */
.jc-ring { position: relative; display: grid; place-items: center; width: 42px; height: 42px; flex: none; }
.jc-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.jc-ringChk { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--jc-grad); }
.jc-ringChk .jc-ico { width: 50%; height: 50%; stroke-width: 3; }
/* The open list: the description sits the same distance from the header above it and the first step
   below it. The panel's 12px gap plus the header's 6px padding is more than the 12px below, so the
   description pulls up by the difference. */
.jc-list { display: grid; gap: 12px; }
.jc-pDesc { margin: -6px 6px 0; font-size: 15px; line-height: 1.5; color: var(--jc-body); }
.jc-list[hidden] { display: none; }
/* Folding and opening is animated in jc_setOpen; the panel's padding and fill follow it. */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-a11y-motion="reduce"]) .jc-panel { transition: padding-bottom .3s cubic-bezier(.2,.8,.2,1), background-color .3s ease; }
  html:not([data-a11y-motion="reduce"]) .jc-head > .jc-chv { transition: transform .38s cubic-bezier(.34,1.56,.64,1); }
}

/* Phone rows (card.html). A larger screen shows the original squares instead (below). */
.jc-rows { display: grid; gap: 10px; }
.jc-card { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; background: #fff; border-radius: 18px; box-shadow: 0 1px 2px rgba(40,30,90,.06); padding-right: 16px; }
.jc-main { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 12px; align-items: center; min-height: 72px; padding: 10px 4px 10px 12px; font: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer; border-radius: 18px; }
.jc-tile { display: grid; place-items: center; }
.jc-art { display: block; width: 52px; height: 52px; object-fit: contain; }
.jc-locked .jc-tile { opacity: .55; filter: grayscale(1); }
.jc-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.jc-title { display: block; font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--jc-ink); overflow-wrap: anywhere; }
.jc-locked .jc-title { color: var(--jc-body); }
.jc-type { font-size: 13px; color: var(--jc-muted); }
.jc-admin { position: absolute; left: 8px; top: -9px; font-size: 11px; z-index: 3; }
.jc-right { display: flex; align-items: center; }

/* The button on the right. A status shows as the original square's corner does: the status symbol
   in a 44px tinted square (custom.css .exerciseStatus). A step simply ready: an arrow in a light
   purple ring. */
.jc-act { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; box-sizing: border-box; background: #fff; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.jc-next { box-shadow: inset 0 0 0 3px var(--jc-lock); color: #7d70c9; }
.jc-next .jc-ico { width: 21px; height: 21px; stroke-width: 2.6; }
.jc-st { border-radius: 10px; background: #E5DFFB; }
.jc-st img { width: 22px; height: 22px; display: block; }
.jc-st-complete, .jc-st-skipped { background: #E3F9F3; }
.jc-st-progress { background: #FFF4E3; }
.jc-st-improve { background: #FFE3E4; }
.jc-st-paceBreak { color: var(--bia-accent, #6c5fc0); }
.jc-st-paceBreak .jc-ico { width: 18px; height: 18px; stroke-width: 3.2; }
@media (hover: hover) {
  .jc-card:hover { box-shadow: 0 6px 18px rgba(40,30,90,.10); }
  .jc-next:hover { background: #f5f3ff; }
}
@media (prefers-reduced-motion: no-preference) { .jc-card { transition: box-shadow .2s ease; } }
/* t_scrollToExercise lands here when the user comes back from a step. */
.jc-card.returnHighlight { box-shadow: 0 0 0 3px var(--jc-purple); }

/* The original square cards (journey/exercise.html), with their own hover, from where they always
   switched: above 768px. Below it the phone rows show and the squares are not drawn at all. */
.jc-sqs { display: none; }
@media (min-width: 769px) {
  .jc-page { max-width: 980px; }
  .jc-rows { display: none; }
  /* Inline-block squares, as phase.html laid them out inside <center>. <center> also centers block
     children, and the status corner (.exerciseStatusWrapper, left: 110px) is placed from that
     centered spot, so the card takes the same block centering. */
  .jc-sqs { display: block; margin: 0 -5px; text-align: left; }
  .jc-sqs .exerciseSquare { text-align: center; text-align: -moz-center; text-align: -webkit-center; }
  .jc-list { display: block; }
  .jc-pDesc { max-width: 680px; font-size: 16.5px; margin: 0 6px 4px; }
  .jc-panel { padding: 10px 14px; }
  .jc-panel:has(.jc-head[aria-expanded="true"]) { padding-bottom: 18px; }
  .jc-ring { width: 48px; height: 48px; }
  .jc-pills { gap: 6px; }
  .jc-pl { width: 22px; height: 9px; }
  .jc-hTitle { font-size: 22px; }
}
/* Tablets: below 1200px four 221px squares do not fit, and the fixed squares left most of a column
   empty on the right (2 across at 834px, 3 at 1024px). Here they share the row evenly instead.
   The status corner is placed from the square's own corner, since the square is no longer 221px
   wide (same spot as before: 2px above, half a pixel in from the right). */
@media (min-width: 769px) and (max-width: 1199px) {
  .jc-sqs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; }
  .jc-sqs .exerciseSquare { width: auto; margin: 0; }
  .jc-sqs .exerciseSquare .exerciseStatusWrapper { position: absolute; top: -2px; right: 0.5px; left: auto; bottom: auto; margin: 0; }
}

/* The sheet: a bottom sheet on a phone, a centered dialog from 700px. */
.jc-overlay { position: fixed; inset: 0; z-index: 1100; }
.jc-scrim { position: absolute; inset: 0; background: rgba(20,14,50,.38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.jc-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; background: #fff; border-radius: 30px 30px 0 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 -10px 40px rgba(40,30,90,.18); color: var(--bia-fg, #201b39); text-align: left; padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (prefers-reduced-motion: no-preference) {
  .jc-overlay .jc-sheet { animation: jcUp .42s cubic-bezier(.16,1,.3,1); }
  .jc-overlay .jc-scrim { animation: jcFade .3s ease; }
}
@keyframes jcUp { from { transform: translateY(100%); } }
@keyframes jcFade { from { opacity: 0; } }
.jc-grab { width: 40px; height: 5px; border-radius: 3px; background: #ddd7ef; margin: 9px auto 0; flex: none; }
.jc-shHd { display: grid; grid-template-columns: minmax(0,1fr) 40px; gap: 12px; align-items: start; padding: 12px 18px 0 20px; flex: none; }
.jc-shTitle { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -.015em; line-height: 1.15; padding: 0; text-align: left; }
/* The sheet's close: the shared quiet chip (rounded square), like the back chip and the map's sheets. */
.jc-x { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--bia-ui-quiet, rgba(0,0,0,.05)); display: grid; place-items: center; cursor: pointer; color: var(--bia-ui-ink, inherit); }
.jc-x:hover { background: var(--bia-ui-quiet-hover, rgba(0,0,0,.1)); }
.jc-x .jc-ico { width: 18px; height: 18px; }
.jc-shBody { overflow-y: auto; padding: 14px 18px 16px; display: grid; gap: 14px; }
.jc-prog { background: var(--jc-bg); border: 1px solid var(--jc-bd); border-radius: 22px; padding: 12px; display: grid; gap: 10px; }
.jc-pl0 { display: flex; align-items: center; gap: 10px; padding: 2px 4px 0; font-size: 14px; font-weight: 600; color: var(--jc-fg); }
.jc-pl0 p { margin: 0; }
.jc-pi { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--jc-so); flex: none; }
.jc-pi img { width: 22px; height: 22px; }
.jc-pi .jc-ico { width: 14px; height: 14px; stroke-width: 2.8; }
.jc-chart { background: #fff; border-radius: 16px; padding: 10px 10px 6px; }
.jc-chart svg { width: 100%; height: auto; display: block; }
.jc-nums { display: flex; gap: 8px; }
.jc-nums > span { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 6px; background: rgba(255,255,255,.75); border-radius: 12px; padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--bia-muted, #5c5773); }
.jc-nums b { font-size: 20px; font-weight: 800; color: var(--bia-fg, #201b39); font-variant-numeric: tabular-nums; }
.jc-descr { margin: 0; font-size: 15px; line-height: 1.55; padding: 0 2px; }
.jc-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.jc-fact { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 10px 5px 8px; border-radius: 99px; background: #f5f3ff; color: #3f3a58; }
.jc-fact .jc-art, .jc-fact .biaIconTile { width: 18px !important; height: 18px !important; }
.jc-navRow { display: flex; gap: 10px; padding: 12px 18px 20px; flex: none; }
.jc-navRow:empty { display: none; }
.jc-navRow a { min-height: 52px; border-radius: 16px; font-weight: 700; font-size: 15.5px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 12px; }
/* The secondary button (View History, Back): the shared white outline button (.uiOutline). */
.jc-navRow .jc-b1 { flex: 1; background: #fff; border: 2px solid var(--bia-ui-line, #e1dcf1); color: var(--bia-ui-accent, #6c5fc0) !important; }
.jc-navRow .jc-b1:hover { background: var(--bia-ui-tint, #f5f3ff); border-color: var(--bia-ui-accent, #6c5fc0); text-decoration: none; }
.jc-navRow .jc-b2 { flex: 2; background: #6c5fc0; color: #fff !important; box-shadow: 0 8px 20px rgba(119,106,200,.22); }
.jc-navRow .jc-b2:hover { background: #4a3fb0; }
@media (min-width: 700px) {
  .jc-sheet { left: 50%; top: 50%; bottom: auto; right: auto; width: 440px; max-height: calc(100% - 48px); transform: translate(-50%, -50%); border-radius: 28px; }
  .jc-grab { display: none; }
  .jc-shHd { padding-top: 20px; }
  @media (prefers-reduced-motion: no-preference) { .jc-overlay .jc-sheet { animation: jcPop .3s cubic-bezier(.16,1,.3,1); } }
}
@keyframes jcPop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }

/* A therapist's assignments above the question that builds the day (journey/v2/todayBody.html). */
.jc-page.tdy-assignFirst { margin-bottom: 28px; }
/* The old todaySection margin would double the panel gap. */
.jc-page .todaySection { margin-top: 0; display: grid; }
/* A grid stretches its children: keep the logged-out "Get started" button its own size, as on /journey. */
.jc-page .todaySection > .standardButton { justify-self: center; }
/* Windows high contrast: keep the edges and the state text, drop the tints. */
@media (forced-colors: active) {
  .jc-card, .jc-pl, .jc-act { border: 1px solid CanvasText; }
}

/* The games hub's "Played today" chip (journey.css draws it as a badge on the square card); in a
   phone row it sits under the title instead. */
.jc-card .dailyPlayedChip { position: static; display: inline-block; align-self: flex-start; margin-top: 4px; }
