/* Aimlink CLUB on an upright iPad: the screens of apps/club/index.html, HTML in the app's own look (the colours and the
   tab bar are the GO app's, Figma "Aimlink GO AI Design System"; the layout follows GO's screens, wider).
   They are stand-ins built from what aimlink.ai and the owner say CLUB does until real screens exist: the door (check-in
   with the member's GO code, guests with ID), the cart (loans, ammunition and lane hire, paid with Vipps), the club's
   weapons and events, the electronic log, the 28-day overview and the monthly report by email. Rankings and the feed are GO's, so
   they are not here. Demo data: the Westside Shooting Club on a Tuesday evening, with the same people as in GO's feed and
   on the start page.
   The iPad's screen is 100cqw wide and about 143cqw tall. Parts switch on at a point in their clip with data-at
   (app-page.js runs the clock and adds .is-on; .t-in and .t-fade are in app-page-wide.css). Without the clock every
   screen shows its end state. */

@layer sections {
  .cs {
    --app-bg: var(--color-night); --app-card: var(--color-line-dark); --app-tile: var(--color-grey-2); --app-line: var(--color-grey-2); --app-text: var(--color-snow); --app-muted: var(--color-snow-2); --app-lime: var(--color-lime);
    position: absolute; inset: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden;
    font: 400 3.2cqw/1.3 var(--font-text); color: var(--app-text); background: var(--app-bg);
  }
  .cs .ui-ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .cs .ic { width: 2.1em; height: 2.1em; flex: none; margin: -0.5em; }
  .cs-top { display: flex; align-items: center; justify-content: space-between; padding: 3.6cqw 5.4cqw 0; font-size: 0.92em; font-weight: 600; }
  .cs-top-r { display: flex; align-items: center; gap: 0.4em; }
  .cs-bar { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; padding: 1.8cqw 5.4cqw 2cqw; }
  .cs-logo { display: flex; align-items: center; gap: 0.4em; font: 500 6.6cqw/1 var(--font-numeric); letter-spacing: 0.02em; }
  .cs-logo img { width: 1.2em; height: 1.2em; flex: none; margin-top: -0.2em; }
  .cs-who { display: flex; align-items: center; gap: 0.6em; font-size: 0.9em; line-height: 1.2; text-align: right; }
  .cs-who small { display: block; color: var(--app-muted); }
  .cs-av { display: grid; place-items: center; width: 6.4cqw; height: 6.4cqw; flex: none; border-radius: 50%; background: var(--app-tile); font-size: 0.74em; font-weight: 600; letter-spacing: 0.02em; }
  .cs-main { display: grid; align-content: start; gap: 2.2cqw; padding: 1cqw 4.8cqw 1.6cqw; min-height: 0; }
  .cs-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2cqw; }
  .cs-h { font: 500 7cqw/1 var(--font-numeric); letter-spacing: 0.01em; }
  .cs-sub { margin-top: 0.35em; color: var(--app-muted); }
  .cs-btn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.62em 1.1em; border-radius: 999px; background: var(--app-lime); color: var(--color-moss); font-size: 0.92em; font-weight: 600; white-space: nowrap; }
  .cs-btn .ic { width: 1.7em; height: 1.7em; margin: -0.4em 0 -0.4em -0.25em; }
  .cs-k, .cs-card-h { font-size: 0.78em; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--app-muted); }
  .cs-card { display: flex; flex-direction: column; min-height: 0; padding: 3cqw 3.4cqw; border-radius: 4.4cqw; background: var(--app-card); overflow: hidden; }
  .cs-card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4cqw; }
  .cs-live { display: inline-flex; align-items: center; gap: 0.45em; color: var(--app-lime); }
  .cs-live i { width: 0.6em; height: 0.6em; border-radius: 50%; background: currentColor; }
  .cs-foot { display: flex; align-items: center; gap: 0.5em; margin-top: 1.2cqw; font-size: 0.9em; color: var(--app-muted); }
  .cs-foot .ic { width: 2.2em; height: 2.2em; margin: -0.5em; }
  .cs-foot-solo { margin: 0; }
  .cs-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); height: 14cqw; padding: 2cqw 1cqw 0; border-radius: 5cqw 5cqw 0 0; background: var(--color-grey-2); }
  .cs-tabs span { display: grid; justify-items: center; align-content: start; gap: 0.6cqw; font-size: 0.74em; white-space: nowrap; }
  .cs-tabs .ic { width: 8.6cqw; height: 8.6cqw; margin: -1.8cqw; }
  .cs-tabs .is-on { color: var(--app-lime); }

  /* 1 · Open the door: the night's check-ins and the code to scan */
  .cs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2cqw; }
  .cs-stats .cs-k { color: var(--color-snow); }   /* the stat tile's label is snow (Figma GoStatTile), not the muted grey: 7:1 on the tile */
  .cs-stats p { display: grid; justify-items: center; gap: 0.8cqw; padding: 1.8cqw 0 1.4cqw; border-radius: 4cqw; background: var(--app-tile); }
  .cs-stats b { font: 500 7.6cqw/0.85 var(--font-numeric); color: var(--app-lime); font-variant-numeric: tabular-nums; }
  .cs-stats b i { font-style: normal; color: var(--color-snow); font-size: 70%; }
  .cs-log li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 2cqw; padding: 0.9cqw 0; border-top: 1px solid var(--app-line); }
  .cs-log .nm { line-height: 1.2; }
  .cs-log .nm small { display: block; font-size: 0.8em; color: var(--app-muted); }
  .cs-log .tm { color: var(--app-muted); font-variant-numeric: tabular-nums; }
  .cs-log .ln { padding: 0.25em 0.75em; border-radius: 999px; background: var(--app-tile); font-size: 0.82em; font-weight: 600; }
  .cs-log li:last-child .ln { background: var(--app-lime); color: var(--app-bg); }
  .cs-qr, .cs-scan { position: relative; flex-direction: row; align-items: center; gap: 4cqw; padding: 2.4cqw 3.4cqw; }
  .cs-qr svg { display: block; width: 16cqw; height: 16cqw; flex: none; padding: 1.4cqw; border-radius: 2.2cqw; background: var(--color-paper); }
  .cs-qr svg path { fill: var(--color-night); }
  .cs-qr p, .cs-scan p { font: 500 5.2cqw/1.05 var(--font-numeric); letter-spacing: 0.01em; }
  .cs-qr small, .cs-scan small { display: block; margin-top: 0.6em; font: 400 3cqw/1.3 var(--font-text); color: var(--app-muted); }
  /* the viewfinder: the camera sees a code; grey brackets while it waits, lime once it has read it */
  .cs-vf { position: relative; display: block; width: 18cqw; height: 18cqw; flex: none; overflow: hidden; border-radius: 2.4cqw; background: #0b1117; }
  .cs-vf svg { display: block; width: 100%; height: 100%; padding: 3.2cqw; opacity: 0.42; }
  .cs-vf svg path { fill: var(--color-snow); }
  .cs-vf::before, .cs-vf-c {
    content: ""; position: absolute; inset: 1.4cqw; --b: var(--app-muted); --l: 3.4cqw; --t: 0.5cqw;
    background:
      linear-gradient(var(--b), var(--b)) 0 0 / var(--l) var(--t) no-repeat, linear-gradient(var(--b), var(--b)) 0 0 / var(--t) var(--l) no-repeat,
      linear-gradient(var(--b), var(--b)) 100% 0 / var(--l) var(--t) no-repeat, linear-gradient(var(--b), var(--b)) 100% 0 / var(--t) var(--l) no-repeat,
      linear-gradient(var(--b), var(--b)) 0 100% / var(--l) var(--t) no-repeat, linear-gradient(var(--b), var(--b)) 0 100% / var(--t) var(--l) no-repeat,
      linear-gradient(var(--b), var(--b)) 100% 100% / var(--l) var(--t) no-repeat, linear-gradient(var(--b), var(--b)) 100% 100% / var(--t) var(--l) no-repeat;
  }
  .cs-vf-c { --b: var(--app-lime); }
  .cs-vf-c:not([data-at]) { display: none; }
  .cs-scanline { position: absolute; left: 1.4cqw; right: 1.4cqw; top: 1.4cqw; height: 0.7cqw; border-radius: 1cqw; background: var(--app-lime); box-shadow: 0 0 2.4cqw 0.4cqw var(--app-lime); opacity: 0; }
  .cs-scanline.is-on { animation: cs-scan 1100ms ease-in-out both; }
  @keyframes cs-scan { 0% { transform: translateY(0); opacity: 0; } 14%, 86% { opacity: 1; } 100% { transform: translateY(14.4cqw); opacity: 0; } }
  /* the door opens: the iPad's edge lights lime for a moment (lime is light, on dark) */
  .cs-flash { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 0.8cqw var(--app-lime), inset 0 0 9cqw rgb(160 224 32 / 0.4); }
  .cs-flash.is-on { animation: cs-flash 1100ms var(--ease-out) both; }
  @keyframes cs-flash { from { opacity: 1; } to { opacity: 0; } }
  .cs-log li.is-new .nm { font-weight: 600; }
  /* the member's phone beside the iPad (the door chapter): it carries the code, GO's Check-in screen. The wrapper is what the
     pinned story moves, so the pair travels as one; the iPad inside keeps its size. */
  .dev-pair { position: relative; width: 76cqw; }
  .cs-phone { --pw: 25cqw; position: absolute; z-index: 3; right: -9cqw; bottom: 9cqw; transform: rotate(-3deg); transition: opacity 360ms var(--ease-out), transform 640ms var(--ease-out); }
  .is-timed .cs-phone[data-at]:not(.is-on) { opacity: 0; transform: translate(22cqw, 14cqw) rotate(9deg); }

  /* 2 · Run the cart: loans, ammunition and lane hire, paid with Vipps (the line items are stand-ins; no prices are shown) */
  .cs-lines li { display: grid; grid-template-columns: 22cqw minmax(0, 1fr); align-items: center; gap: 3cqw; padding: 2.4cqw 0; border-top: 1px solid var(--app-line); }
  .cs-lines .nm { font-size: 1.08em; line-height: 1.2; }
  .cs-lines .nm small { display: block; margin-top: 0.2em; font-size: 0.78em; color: var(--app-muted); }
  .cs-tag { justify-self: start; padding: 0.3em 0.8em 0.2em; border-radius: 999px; background: var(--app-tile); font-size: 0.7em; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
  .cs-tag.is-door { background: var(--app-lime); color: var(--color-moss); }
  .cs-pay { display: flex; align-items: center; justify-content: center; gap: 0.6em; min-height: 11cqw; padding-top: 0.3cqw; border-radius: 999px; background: var(--app-tile); color: var(--app-lime); font: 500 5cqw/1 var(--font-numeric); letter-spacing: 0.06em; text-transform: uppercase; }
  .cs-pay .ui-ic { width: 1em; height: 1em; stroke-width: 2.2; }
  .is-timed .cs-pay:not(:has(.is-on)) { background: var(--app-lime); color: var(--color-moss); }
  .is-timed .cs-pay:not(:has(.is-on)) .ui-ic { display: none; }
  .cs-note { text-align: center; color: var(--app-muted); }

  /* 3 · The club's weapons and events; the most active today (the start page's iPad) */
  .cc-top li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2.4cqw; padding: 1.5cqw 0; border-top: 1px solid var(--app-line); }
  .cc-top i { display: grid; place-items: center; width: 6.2cqw; height: 6.2cqw; padding-top: 0.4cqw; border-radius: 50%; background: var(--app-tile); font: 500 4.2cqw/1 var(--font-numeric); font-style: normal; }
  .cc-top li:first-child i { background: var(--app-lime); color: var(--color-moss); }
  .cc-top b { color: var(--app-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
  .cs-gear li { display: flex; align-items: baseline; justify-content: space-between; gap: 2cqw; padding: 1.7cqw 0; border-top: 1px solid var(--app-line); }
  .cs-gear li span:last-child { color: var(--app-muted); text-align: right; }
  .cs-gear b { font-weight: 600; }

  /* 4 · Keep the log: every check-in and cart line, newest first */
  .cs-logrows li { display: grid; grid-template-columns: 11cqw minmax(0, 1fr) auto; align-items: center; gap: 2.6cqw; padding: 1.9cqw 0; border-top: 1px solid var(--app-line); }
  .cs-logrows .tm { color: var(--app-muted); font-variant-numeric: tabular-nums; }
  .cs-logrows .nm { line-height: 1.2; }
  .cs-logrows .nm small { display: block; margin-top: 0.15em; font-size: 0.8em; color: var(--app-muted); }

  /* 5 · Close the month: the last 28 days, and the report that arrives by email */
  .cs-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); align-items: end; gap: 1.4cqw; height: 36cqw; padding-top: 1cqw; }
  .cs-bars i { display: block; height: calc(var(--v) / 16 * 100%); min-height: 1cqw; border-radius: 1cqw 1cqw 0.3cqw 0.3cqw; background: #3a4450; transform-origin: 50% 100%; }
  .cs-bars i.is-today { background: var(--app-lime); }
  .cs-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 1.4cqw; margin-top: 1.4cqw; font-size: 0.78em; color: var(--app-muted); text-align: center; }
  .cs-days .is-today { color: var(--app-text); font-weight: 600; }
  .cs-days-rows li { display: flex; align-items: baseline; justify-content: space-between; gap: 2cqw; padding: 1.6cqw 0; border-top: 1px solid var(--app-line); }
  .cs-days-rows b { font: 500 6.4cqw/1 var(--font-numeric); font-variant-numeric: tabular-nums; }
  .cs-days-rows small { display: block; color: var(--app-muted); }
  .cs-bars-28 { grid-template-columns: repeat(28, minmax(0, 1fr)); gap: 0.7cqw; height: 32cqw; }
  .cs-bars-28 i { border-radius: 0.7cqw 0.7cqw 0.2cqw 0.2cqw; }
  .cs-weeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1.4cqw; font-size: 0.74em; color: var(--app-muted); }
  .cs-days-rows b.cs-sent { color: var(--app-lime); font-size: 1em; }
  .cs-sent .ui-ic { width: 1.5em; height: 1.5em; stroke-width: 2.2; }

  /* The badge on a card (month: "By email") */
  .cs-badge { justify-self: start; padding: 0.35em 0.9em 0.25em; border-radius: 999px; background: var(--app-lime); color: var(--color-moss); font-size: 0.74em; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
  .cs-badge.is-soft { background: var(--app-tile); color: var(--app-text); }

  /* ── The clock, CLUB's own parts ── */
  .is-timed .t-bar[data-at] { transform: scaleY(0); transition: transform 520ms var(--ease-out); }
  .is-timed .t-bar[data-at].is-on { transform: none; }
}

/* CLUB iPad: the recorded Main view plays in place of the stand-in screen. The recording is cut to the iPad screen's
   proportions (the empty chart area is taller, the text is not stretched), so it fills the screen with nothing cropped. */
.club-screen-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #091219; }
