/* The routine card (DESIGN.md › Templates › Card): every guided routine's card in Care's carousels and on Today,
   built once here, one title, one line, one answer, one action. One even surface, Care's and Today's alike: the
   art on the card's own colour, the poster centred across the card, ··· on it at the end; the title in Heading;
   one line in Small (how long it takes, or "✓ Practiced today"); a flagged check-in's doctor line on its soft
   panel; free space, so the cards in a carousel are one height and the actions sit at the bottom; the progress row
   as a borderless row; the primary button across the body; then an old paused practice as a row. The button takes the now-playing sizes (box_player.css);
   sizes and colours are guided tokens, logical properties mirror it in Arabic, and larger text grows it. These
   classes are the component, so a card drawn in JS (Today's breathing card) can use them as they are.
   Selectors carry two or three classes so the players' own rules (`.gs-box-player p`, Today's card
   headings) and Care's old card rules never reach inside it. */
.gr-card { position:relative; display:flex; flex-direction:column; gap:0; min-width:0; padding:0; overflow:hidden; border:1px solid var(--gs-border); border-radius:var(--guided-radius-routine-card); background:var(--gs-card); color:var(--gs-text-primary); font-family:var(--guided-font); text-align:start; }
/* In Care it keeps gs-care-breathing-card, its carousel's hook, without that card's old layout. */
.gs-care-breathing-card.gr-card,
.gs-care-collection--compact .gs-care-breathing-card.gr-card { gap:0; min-height:0; padding:0; text-align:start; }

/* The art: on the card's own colour, so Care's card and Today's are one even surface (a soft field of its
   own read as a second shade on Care), the same for every routine, across the whole card with the poster
   centred however wide the card, and never wider than the body's 20px margins, so a wide picture (Daily
   Kegels' bridge) lines up with the title under it. One height in every state, so every card's title starts at
   one offset across a carousel. */
.gr-card .gr-card-art { position:relative; flex:none; width:100%; aspect-ratio:8 / 7; max-height:var(--guided-field-card); background:none; }
.gr-card .gr-card-art > .gr-card-poster { position:absolute; inset:12% var(--guided-margin); display:block; width:calc(100% - 2 * var(--guided-margin)); max-width:none; height:76%; margin:0; aspect-ratio:auto; object-fit:contain; }
/* ···: a 44px round button on the art, at the end, its glyph bare on the card's colour. */
.gr-card .gr-card-art > .gr-card-more { position:absolute; z-index:1; inset-block-start:var(--guided-space-3); inset-inline-end:var(--guided-space-3); display:grid; place-items:center; width:var(--guided-touch); height:var(--guided-touch); margin:0; padding:0; border-radius:var(--guided-radius-pill); background:transparent; color:var(--gs-text-primary); text-decoration:none; }
.gr-card .gr-card-more > .gr-card-more-icon { width:var(--guided-icon); height:var(--guided-icon); }

/* The body: 16px above, 20px at the sides and below. */
.gr-card .gr-card-body { display:flex; flex:1; flex-direction:column; min-height:0; padding:var(--guided-gap-block) var(--guided-margin) var(--guided-margin); }
.gr-card .gr-card-title { flex:none; margin:0; color:var(--gs-text-primary); font-size:var(--guided-size-now-heading); font-weight:700; line-height:var(--guided-leading-heading); letter-spacing:var(--guided-tracking); overflow-wrap:anywhere; }
.gr-card .gr-card-title:dir(rtl) { letter-spacing:normal; }
/* The title's row. */
.gr-card .gr-card-head { display:flex; align-items:flex-start; gap:var(--guided-space-2); min-width:0; }
.gr-card .gr-card-head > .gr-card-title { flex:1; min-width:0; }
/* The line: how long it takes ("About 2 min", "2 min left"), or once done "✓ Practiced today", its tick drawn as
   the card turns done (guided_moments.js). */
.gr-card .gr-card-facts { display:grid; gap:var(--guided-gap-line); margin-top:var(--guided-gap-heading); }
.gr-card .gr-card-facts:not(:has(> :not(:empty))) { display:none; }
.gr-card .gr-card-facts > .gr-card-duration:empty { display:none; }
.gr-card .gr-card-fact { margin:0; color:var(--gs-text-secondary); font-size:var(--guided-size-small); font-weight:400; line-height:var(--guided-leading-small); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.gr-card .gr-card-facts > .gr-card-done { display:flex; align-items:center; gap:var(--guided-space-1); }
.gr-card .gr-card-done > .gr-card-done-icon { flex:none; width:1em; height:1em; }

/* Rows: borderless, so the button is the card's one strong thing; an icon, the label in Body, a chevron, on the
   body's edges, 44px tall. */
.gr-card .gr-card-rows { display:grid; gap:var(--guided-gap-row); margin-top:var(--guided-gap-block); }
.gr-card .gr-card-rows > .gr-card-row { display:flex; align-items:center; gap:var(--guided-space-3); width:100%; min-width:0; min-height:var(--guided-touch); margin:0; padding:var(--guided-space-2) 0; border:0; border-radius:var(--guided-radius-row); background:transparent; color:var(--gs-text-primary); font-size:var(--guided-size-body); font-weight:400; line-height:var(--guided-leading-label); text-align:start; text-decoration:none; }
/* The progress row's answer: Progress's arrow in its badge's tone (green the good way, grey about the same, the
   dark neutral the other way); the label says it in words, so colour is never the only cue. */
.gr-card .gr-card-row > .gr-card-trend[data-badge="good"] { color:var(--guided-progress-now); }
.gr-card .gr-card-row > .gr-card-trend[data-badge="bad"] { color:var(--gs-text-primary); }
.gr-card .gr-card-row > .gr-card-row-icon { flex:none; width:var(--guided-icon-row); height:var(--guided-icon-row); color:var(--gs-text-secondary); }
.gr-card .gr-card-row > .gr-card-row-label { flex:1; min-width:0; overflow-wrap:anywhere; }
/* A trailing value (an old practice's Resume) sits at the end, as on the player's Rows; on a narrow card
   (320px, larger text) it drops under the label, so the label keeps its width. */
.gr-card .gr-card-rows { container-type:inline-size; }
.gr-card .gr-card-row > .gr-card-row-text { display:flex; flex:1; align-items:center; gap:var(--guided-space-3); min-width:0; }
.gr-card .gr-card-row-text > .gr-card-row-label { flex:1; min-width:0; overflow-wrap:anywhere; }
.gr-card .gr-card-row-text > .gr-card-row-value { flex:none; max-width:45%; color:var(--gs-text-secondary); font-size:var(--guided-size-small); font-weight:400; text-align:end; overflow-wrap:anywhere; }
@container (max-width: 240px) {
  .gr-card .gr-card-row > .gr-card-row-text { flex-direction:column; align-items:flex-start; gap:0; }
  .gr-card .gr-card-row-text > .gr-card-row-label { flex:none; }
  .gr-card .gr-card-row-text > .gr-card-row-value { max-width:100%; text-align:start; }
}
.gr-card .gr-card-row > .gr-card-row-chevron { flex:none; width:var(--guided-chevron); height:var(--guided-chevron); color:var(--gs-text-secondary); }
.gr-card .gr-card-row > .gr-card-row-chevron:dir(rtl) { transform:scaleX(-1); }
/* A flagged check-in's doctor line on its soft panel, under the card's line. */
.gr-card .gr-card-body > .gr-card-safety { margin:var(--guided-gap-block) 0 0; padding:var(--guided-space-3) var(--guided-space-4); border-radius:var(--guided-radius-row); background:var(--box-soft); color:var(--gs-text-primary); font-size:var(--guided-size-small); line-height:var(--guided-leading-small); text-align:start; overflow-wrap:anywhere; }

/* Free space: the content stays at the top and the actions at the bottom. */
.gr-card .gr-card-spacer { flex:1 1 auto; min-height:var(--guided-gap-block); }

/* The action: one button across the body, as tall as the player's Done button and with the app's button
   corners (box_player.css, the layout system, 7), so the card's one action is the player's; filled with play
   to start, outlined with repeat once practised, its icon and label centred together. The play icon is never
   mirrored. */
.gr-card .gr-card-actions { display:flex; flex-direction:column; align-items:stretch; margin:0; padding:0; }
/* The progress row right above the button, at the card's foot like every other card's in a carousel. */
.gr-card .gr-card-rows.gr-card-progress { margin-top:0; margin-bottom:var(--guided-gap-row); }
.gr-card .gr-card-actions > .gr-card-primary { display:flex; align-items:center; justify-content:center; gap:var(--guided-space-2); width:100%; min-width:0; min-height:var(--guided-primary-h); margin:0; padding:var(--guided-space-2) var(--guided-space-4); border:1.5px solid var(--box-action); border-radius:var(--guided-radius); background:var(--box-action); color:var(--box-on-action); font-size:var(--guided-size-body); font-weight:700; line-height:var(--guided-leading-label); text-align:center; text-decoration:none; overflow-wrap:anywhere; }
.gr-card .gr-card-actions > .gr-card-primary[data-gr-again] { border-color:var(--gs-text-primary); background:transparent; color:var(--gs-text-primary); }
/* Today's pill keeps pj-item-primary, the hook its players and tests find it by; Today's tracker palette
   paints that class with !important, so the outlined pill answers it here. */
.pj-today-card.pj-box-card .gr-card .gr-card-actions > .gr-card-primary.pj-item-primary { border:1.5px solid var(--box-action); }
.pj-today-card.pj-box-card .gr-card .gr-card-actions > .gr-card-primary.pj-item-primary[data-gr-again] { border-color:var(--gs-text-primary); background:transparent !important; color:var(--gs-text-primary) !important; }
.gr-card .gr-card-primary > .gr-card-primary-icon { flex:none; width:var(--guided-icon-row); height:var(--guided-icon-row); }
.gr-card .gr-card-primary > .gr-card-play { }
.gr-card .gr-card-primary > .gr-card-again { }
.gr-card .gr-card-primary[data-gr-again] > .gr-card-play,
.gr-card .gr-card-primary:not([data-gr-again]) > .gr-card-again { display:none; }

.gr-card a:focus-visible { outline:2px solid var(--gs-text-primary); outline-offset:2px; }
/* Practice again eases from filled to outlined when Care's card changes in place (the owner's motion review,
   2026-11-04), with or without reduced motion: it's a colour change, not movement. */
.gr-card .gr-card-actions > .gr-card-primary { transition:background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
/* The pill, ··· and the Rows press in, unless motion is reduced. */
@media (prefers-reduced-motion:no-preference) {
  .gr-card :is(.gr-card-primary, .gr-card-more, a.gr-card-row) { transition:transform 160ms var(--guided-ease-out, ease-out); }
  .gr-card :is(.gr-card-primary, .gr-card-more, a.gr-card-row):active { transform:scale(.96); }
  .gr-card .gr-card-actions > .gr-card-primary { transition:transform var(--guided-press) var(--guided-ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
}

/* Today: the card fills its carousel card and takes its frame. A player that takes the slot over brings
   the carousel card's own padding back, since the card is no longer in it. */
.pj-box-card:has(> .gs-box-player > .gr-card) { padding:0; }
.pj-box-card > .gs-box-player:has(> .gr-card) { margin:0; padding:0; background:transparent; }
.pj-box-card .gr-card { flex:1; border:0; background:transparent; }

/* Today's breathing card, resting (box_breathing_today_views.js): the same card, which the Box player
   draws inside its view in the card's slot, for all 8 breathing routines. Its frame is the carousel
   card's, so the slot, the view and its surface step aside and let the card fill it. The mascot (live on
   the player's card, a still on the others) sits on the field as the poster does; its controls are
   buttons, so they drop the player's button frame, and its title keeps the card's Heading over the
   player's own headings. */
.pj-box-card:has(> [data-box-today-slot] > .gs-box-player .gr-card) { padding:0; }
.pj-box-card > [data-box-today-slot]:has(> .gs-box-player .gr-card),
.pj-box-card > [data-box-today-slot] > .gs-box-player:has(.gr-card),
.pj-box-card > [data-box-today-slot] > .gs-box-player :is([data-box-surface], .box-player-layout):has(> .box-player-layout > .gr-card, > .gr-card) { display:flex; flex:1; flex-direction:column; min-height:0; }
.gs-box-player.box-player-view .gr-card .gr-card-art > .box-stage { position:absolute; inset-block-start:12%; left:50%; width:auto; max-width:92%; height:76%; margin:0; transform:translateX(-50%); }
.gs-box-player.box-player-view .gr-card .gr-card-art > .box-stage > .box-static-mascot { width:100%; height:100%; object-fit:contain; }
.gs-box-player .gr-card .gr-card-art > button.gr-card-more { min-height:0; border:0; cursor:pointer; }
.gs-box-player .gr-card .gr-card-head > h2.gr-card-title { font-size:var(--guided-size-now-heading); font-weight:700; line-height:var(--guided-leading-heading); letter-spacing:var(--guided-tracking); }
.gs-box-player .gr-card .gr-card-head > h2.gr-card-title:dir(rtl) { letter-spacing:normal; }
.gs-box-player .gr-card .gr-card-head > h2.gr-card-title:focus { outline:none; }
.gs-box-player .gr-card .gr-card-actions > button.gr-card-primary { cursor:pointer; }
.gs-box-player .gr-card .gr-card-rows > button.gr-card-row { cursor:pointer; }
.gs-box-player .gr-card :is(button.gr-card-primary, button.gr-card-more, button.gr-card-row):focus-visible { outline:2px solid var(--gs-text-primary); outline-offset:2px; }
/* Any status (a start that needs a connection, a save that stopped) sits over the pill, on its panel. */
.gr-card .gr-card-body > .gr-card-status { margin:0 0 var(--guided-gap-block); font-size:var(--guided-size-small); line-height:var(--guided-leading-small); text-align:start; overflow-wrap:anywhere; }
.gr-card .gr-card-body > .gr-card-status:empty { display:none; }
.gr-card .gr-card-body > .gr-card-status > button { margin-top:var(--guided-gap-row); }
@media (prefers-reduced-motion:no-preference) {
  .gr-card button.gr-card-row { transition:transform 160ms var(--guided-ease-out, ease-out); }
  .gr-card button.gr-card-row:active { transform:scale(.96); }
}
