/* /terms (prefix tm-; play/terms.js plays it): the deal in three toys on the play kit (play/play.css), then the full
   terms in the legal cards (play/legal.css). The toys are the comparison's (compare/flow.css, the standard): soft
   filled slabs, 18px corners, no hairlines, a press that sinks, Mika's colour the only colour. Drawn in our own type;
   nothing here looks like Google Play. */
.tm .pl-hero h1 { margin-bottom: 4px; }
.tm .pl-rounds { margin-top: clamp(36px, 5vw, 60px); }

/* ---------- 1: the free week. Pick a plan; the week lights; the bill spins and lands on CA$0.00 ---------- */
.tm-plans { display: grid; gap: 10px; }
@media (min-width: 600px) { .tm-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tm-plan { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity .4s var(--pl-soft), background .45s var(--pl-soft), translate .5s var(--ease-spring), scale .2s var(--pl-soft); }
.tm-plan input { position: absolute; top: 14px; left: 16px; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.tm-plan:active { scale: .98; transition-duration: .14s; }
.tm-plan:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 255, 255, .55); }
.tm-plan .pl-tag { font-size: 15px; }
.tm-price { display: block; margin: 8px 46px 0 0; font-size: 17px; line-height: 25px; color: var(--ink-2); }
.tm-price b { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); font-variant-numeric: tabular-nums; }
/* the pick: a circle like the comparison's send arrow, lit with a tick */
.tm-tick { position: absolute; right: 12px; bottom: 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: transparent; transition: background .25s, color .25s, scale .4s var(--ease-spring); }
.tm-tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tm-plan:has(input:checked) { background: color-mix(in srgb, var(--mika) 11%, var(--surface-2)); translate: 0 -3px; }
.tm-plan:has(input:checked) .tm-tick { background: var(--mika); color: #0a0a0a; scale: 1.14; }
.tm-plans:has(input:checked) .tm-plan:not(:has(input:checked)) { opacity: .55; }
.tm-plan.lift { animation: pl-win .6s var(--ease-spring); }
/* untried, the two circles are cream (the kit's "touch me", like the HOLD pill) and take turns to nudge */
.pl-js .tm-plans:not(.tried) .tm-tick { background: var(--cream); }
.tm-plans:not(.tried) .tm-tick { animation: pl-nudge 2.6s var(--pl-soft) 1.2s infinite; }
.tm-plans:not(.tried) .tm-plan + .tm-plan .tm-tick { animation-delay: 1.5s; }

/* the bill: the week as seven days, what comes after, and what's due today */
.tm-bill { display: grid; gap: 16px; padding-bottom: 14px; }
.tm-week-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding-top: 2px; }
.tm-days { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tm-days li { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); font: 500 10.5px/1 var(--mono); transition: background .2s, color .2s; }
.tm-days li.on { background: var(--mika); color: #0a0a0a; }
.pl-js .tm-days li.on { animation: tm-pop .5s var(--ease-spring); }
@keyframes tm-pop { 0% { scale: .45; } }
.tm-then { display: inline-grid; place-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; transition: color .2s, background .2s; }
.tm-then.idle { background: transparent; color: var(--ink-3); padding: 0; }
.tm-then.pop { animation: tm-pop .5s var(--ease-spring); }
.tm-due { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.tm-due .pl-tag { flex: none; white-space: nowrap; }   /* "Due today" stays on one line while the total spins */
.tm-due .pl-mk { display: block; flex: none; width: 30px; height: 30px; }
/* the total: CA$ and five reels of digits, like a slot (play/terms.js builds the reels; the HTML holds CA$0.00) */
.tm-total { display: inline-flex; align-items: baseline; font-size: 30px; line-height: 1; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; transition: color .3s; }
.tm-total.due { color: var(--ink); }   /* spinning up to the full price, as if it's about to charge you */
.tm-total.lit, html:not(.pl-js) .tm-total { color: var(--mika); }
.tm-reel { display: inline-block; height: 1em; overflow: hidden; max-width: .7em; vertical-align: bottom; transition: max-width .38s var(--pl-soft), opacity .25s; }
.tm-reel.gone { max-width: 0; opacity: 0; }
/* the reel's digits, 0–9 four times, drawn by CSS so the page's text never reads "0123456789..." */
.tm-reel > span { display: block; line-height: 1; white-space: pre; }
.tm-reel > span::before { content: "0\A 1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 0\A 1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 0\A 1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 0\A 1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9"; }
html[data-mika="cloud"] .tm-total.lit { padding: 3px 8px 4px; margin: -3px -8px -4px 0; border-radius: 9px; background: var(--mika); color: #0a0a0a; }

/* ---------- 2: cancel in the free week. Drag Mika; the price strikes and drops; CA$0.00 lands ---------- */
.tm-amt { margin-left: auto; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.tm-amt .pl-swap > span { justify-self: end; text-align: right; }
.tm-amt .pl-swap .new { font-weight: 600; }
.tm-meter { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
.tm-meter i { height: 10px; border-radius: 5px; background: #6b6f76; }
.tm-meter i.now { background: var(--ink-2); }
.tm-meter i.now ~ i { background: var(--surface-3); }
.tm-subline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 10px; }
.tm-subline .pl-sub { margin: 0; white-space: nowrap; }
.tm-subline .pl-sub + .pl-sub { margin-left: auto; }
/* the track: Mika is the knob. It rests on the right, under a right thumb; drag it left (or press it) to cancel.
   --p (play/terms.js) runs 0 to 1; Mika and the fill behind it follow. No arrow knob, no label in the track: one
   cream pill says what the drag does, and goes as soon as Mika moves. */
.tm-slide { --p: 0; position: relative; height: 84px; border-radius: 24px; background: var(--surface-2); touch-action: pan-y; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tm-fill { position: absolute; right: 0; top: 0; bottom: 0; width: calc(84px + (100% - 84px) * var(--p)); border-radius: 24px; background: var(--surface-3); opacity: min(1, calc(var(--p) * 12)); transition: background .45s var(--pl-soft); }
.tm-slide.done .tm-fill, html:not(.pl-js) .tm-fill { background: color-mix(in srgb, var(--mika) 13%, var(--surface-2)); }
.tm-knob { position: absolute; z-index: 2; top: 6px; right: calc(6px + (100% - 84px) * var(--p)); width: 72px; height: 72px; padding: 0; border: 0; border-radius: 24px; background: none; cursor: grab; touch-action: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; transition: scale .35s var(--ease-spring); }
.tm-knob:active, .tm-slide.held .tm-knob { scale: .9; cursor: grabbing; }
.tm-knob:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 255, 255, .55); }
.tm-knob-mk { display: block; width: 72px; height: 72px; pointer-events: none; }
/* a glide (let go, a tap, a key): timed in play/terms.js, drawn here */
.tm-slide.glide .tm-knob { transition: right var(--ms, .3s) var(--pl-soft), scale .35s var(--ease-spring); }
.tm-slide.glide .tm-fill { transition: width var(--ms, .3s) var(--pl-soft), opacity var(--ms, .3s), background .45s var(--pl-soft); }
.tm-drag { position: absolute; right: 88px; top: 50%; translate: 0 -50%; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--cream); color: var(--cream-ink); display: grid; place-items: center; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; pointer-events: none; opacity: calc(1 - var(--p) * 6); transition: opacity .15s; }
.tm-slide:not(.tried) .tm-drag { animation: pl-nudge 2.6s var(--pl-soft) 1.2s infinite; }
.tm-slide-done { position: absolute; inset: 0; display: block; margin: 0; padding: 0 16px 0 84px; line-height: 84px; text-align: center; overflow: hidden; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); white-space: nowrap; pointer-events: none; }
.tm-slide-done b { font-weight: 600; color: var(--mika); }
html[data-mika="cloud"] .tm-slide-done b { padding: 0 5px; border-radius: 6px; background: var(--mika); color: #0a0a0a; }
/* without script there is no Mika to drag: the track shows how it ends */
html:not(.pl-js) .tm-knob, html:not(.pl-js) .tm-drag { display: none; }
html:not(.pl-js) .tm-slide { cursor: default; }
html:not(.pl-js) .tm-fill { width: 100%; opacity: 1; }
html:not(.pl-js) .tm-slide-done { padding-left: 16px; }

/* ---------- 3: fair use. Tap a rule: Mika side-eyes it, the rule shakes its head, strikes and stays on the card, dimmed,
   with its TAP turned to NO. Once every rule is struck, the line drops in under them ---------- */
.tm-rules { padding-bottom: 20px; }
/* Mika sits on the right, under a right thumb, big enough to read its face; what it says pops beside it, from the
   left; "Again" takes the left end once every rule is struck */
.tm-rules .pl-top { min-height: 60px; }
.tm-fair-mk { display: block; flex: none; width: 60px; height: 60px; }
.tm-rules .pl-quip { margin-left: auto; white-space: nowrap; transform-origin: right center; }
html:not(.pl-js) .tm-rules .pl-top { display: none; }   /* no script: no Mika, no Again; the struck rules say it */
/* play it again: a pill that reads as a button on the slab */
.tm-again { border: 0; cursor: pointer; background: var(--surface-3); color: var(--ink-2); -webkit-tap-highlight-color: transparent; transition: color .2s, background .2s, scale .2s var(--pl-soft); }
.tm-again:hover { background: #313131; color: var(--ink); }
.tm-again:active { scale: .94; }
.tm-again:not([hidden]) { animation: pl-pop .5s var(--ease-spring); }
.tm-pile { margin-top: 16px; }
.tm-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tm-chips li { display: flex; }
.tm-chips .pl-tap { transition: scale .2s var(--pl-soft), background .2s, opacity .4s var(--pl-soft) .12s; }
.tm-chips .pl-tap.struck, html:not(.pl-js) .tm-chips .pl-tap { opacity: .55; cursor: default; }
.tm-chips .pl-tap.struck:hover, html:not(.pl-js) .tm-chips .pl-tap:hover { background: var(--cream); }
.tm-chips .pl-tap.struck:active, .tm-chips .pl-tap.struck.is-down, html:not(.pl-js) .tm-chips .pl-tap:active { scale: 1; }
.tm-crime { position: relative; }
.tm-crime::after { content: ""; position: absolute; left: -3px; right: -3px; top: 52%; height: 2px; border-radius: 1px; background: currentColor; transform: scaleX(0); transform-origin: left center; transition: transform .25s var(--ease-out); }
.pl-tap.struck .tm-crime::after, html:not(.pl-js) .tm-crime::after { transform: scaleX(1); }
/* the key holds TAP and NO in one cell, so it keeps its width and nothing on the card moves when it turns */
.tm-chips .pl-tap-k > .tm-k { grid-area: 1 / 1; transition: opacity .15s, scale .4s var(--ease-spring); }
.tm-chips .pl-tap-k > .tm-k.no { opacity: 0; scale: .4; }
.pl-tap.struck .pl-tap-k > .tm-k:not(.no), html:not(.pl-js) .tm-chips .pl-tap-k > .tm-k:not(.no) { opacity: 0; scale: .4; }
.pl-tap.struck .pl-tap-k > .tm-k.no, html:not(.pl-js) .tm-chips .pl-tap-k > .tm-k.no { opacity: 1; scale: 1; }
.tm-rule { margin: 18px auto 0; max-width: 21em; text-align: center; font-size: 19px; line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
/* with script, the line's row is closed until every rule is struck; then it opens and the line pops in under them */
.pl-js .tm-pile { display: grid; grid-template-rows: auto 0fr; transition: grid-template-rows .45s var(--pl-soft); }
.pl-js .tm-pile.done { grid-template-rows: auto 1fr; }
.pl-js .tm-rule-box { min-height: 0; overflow: hidden; }
.pl-js .tm-rule { transition: opacity .25s .12s, transform .5s var(--ease-spring) .12s; }

html:not(.pl-js) .tm .pl-mk:empty { display: none; }   /* no script, no Mika: its tags close up */

/* ---------- the end: the tie comes off (play/legal.js) ---------- */
.tm-end .pl-final { margin-top: 4px; }

@media (max-width: 560px) {
  .tm-plan .pl-tag { font-size: 14px; }
  .tm-price { font-size: 16px; margin-right: 40px; }
  .tm-price b { font-size: 19px; }
  .tm-tick { right: 10px; bottom: 10px; width: 30px; height: 30px; }
  .tm-total { font-size: 26px; }
  .tm-amt { font-size: 18px; }
  .tm-rule { font-size: 18px; }
}
@media (max-width: 370px) {
  /* the full yearly price has to fit beside "Due today" while it spins: the total shrinks with the screen */
  .tm-due { gap: 8px; }
  .tm-total { font-size: clamp(20px, calc(18.5vw - 39px), 26px); }
  .tm-days { gap: 4px; }
  .tm-days li { width: 24px; height: 24px; }
  .tm-rules .pl-quip { font-size: 13px; padding: 7px 11px; }
  .tm-rules .pl-top { gap: 6px; }
  .tm-fair-mk { width: 52px; height: 52px; }
  .tm-drag { padding: 0 10px; font-size: 10px; letter-spacing: .08em; }
  .tm-slide-done { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-plans:not(.tried) .tm-tick, .tm-plan.lift, .pl-js .tm-days li.on, .tm-then.pop, .tm-again:not([hidden]), .tm-slide:not(.tried) .tm-drag { animation: none !important; }
  .tm-plan, .pl-js .tm-pile, .pl-js .tm-rule, .tm-chips .pl-tap, .tm-chips .pl-tap-k > .tm-k, .tm-knob, .tm-fill, .tm-slide.glide .tm-knob, .tm-slide.glide .tm-fill { transition: none; }
}
