/* ═══ THE BAND — one component, two pages (2026-11-09) ═══════════════════════════════════════════════
   The homepage's diary, its Media Center and its money band, and kitslate.app/transfers' two bands, are this one
   construction (Stephen, 2026-11-09, pointing at the diary: "make transfer page like this"). It moved here from
   index.html unchanged; index.html and functions/transfers.js both link it, and assets/band.js drives it.

   The parts: .cal-grid with .sat/.satc cards either side, .caltabs/.caltab view tabs, a .calshot frame holding every
   view in one box (one shown, so the frame never changes size), the narrow pan hint (.calhint) and the .kstack
   caption (.calcap). A pinned one sits in a .caltrack/.calpin pair: the track is given a height by bandPin(), the pin
   stays on screen for its length, and the scroll chooses the view (the diary; the bands on /transfers, data-pin).
   A page that links this sheet gives it the tokens: --panel --panel2 --line2 --text --dim --acc --acc-fill
   --shadow-card --shadow-hero. ═══════════════════════════════════════════════════════════════════════════ */
/* THE STACK — every variant of a changing label in one grid cell, the current one shown and the rest
   kept only for their size, so swapping them can never move what is below (a choice never moves
   what is below it). The calendar's caption and its satellite cards use it. It lived with the chain
   section until that section left the page; it is shared, so it lives here now. */
.kstack{display:grid}.kstack>*{grid-area:1/1;min-width:0}.kstack>[aria-hidden="true"]{visibility:hidden}

.caltrack{position:relative}
.js .calpin{position:sticky;top:0;min-height:100vh;min-height:100svh;
  display:flex;flex-direction:column;justify-content:center;padding:clamp(20px,4vh,48px) 0}
.cal-grid{display:grid;grid-template-columns:minmax(150px,1fr) minmax(0,var(--calw,1040px)) minmax(150px,1fr);
  gap:clamp(16px,1.8vw,26px);align-items:center;margin-top:clamp(30px,4vw,52px)}
.sat{display:flex;flex-direction:column;gap:12px}
.sat.l{align-items:flex-end;text-align:right}
.satc{border:1px solid var(--line2);background:var(--panel);border-radius:12px;padding:11px 14px;
  box-shadow:var(--shadow-card);max-width:250px}
.satc b{display:block;font-size:13px;font-weight:800;letter-spacing:-.01em}
.satc span{display:block;font-size:13px;color:var(--dim);line-height:1.45;margin-top:3px}
/* THE CALENDAR CYCLES ITS FOUR VIEWS. One month grid cannot carry the claim this section makes —
   "every day knows what belongs to it" is about what a day KNOWS, and the month is only the widest
   answer. Day answers who is free; Month + day opens one day beside the month without losing your
   place; Year shows the shape of a trading year. All four are real views of the same calendar,
   captured from the same staging workspace on the same date.

   The four shots are stacked in one box and cross-faded, so the frame's height never changes and
   nothing below it moves. The tabs are real buttons: this is a control, not a slideshow you have to
   wait out, and it stops auto-advancing the moment somebody picks a view themselves. */
.calshot{position:relative;border:1px solid var(--line2);border-radius:18px;overflow:hidden;
  background:var(--panel2);box-shadow:var(--shadow-hero);aspect-ratio:1600/940}
.calshot img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:top center;
  opacity:0;transition:opacity .45s ease}
.calshot img.on{opacity:1}
/* THE PIN MUST FIT THE SCREEN IT PINS TO. The shot's 1040px column gives it 611px of height, and
   the heading, tabs, caption, grid margin and pin padding around it are ~337px more — 948px of
   pinned content, which a smaller Mac's ~760px viewport cannot hold: the heading scrolled off
   while the section claimed to be pinned. The cure: derive the width
   from the height the viewport actually has, minus a 360px allowance for everything around the
   shot, at the shots' own 1600:940. The 480px floor keeps a freakishly short window from shrinking
   the calendar into a texture — past that, overflowing is the lesser evil. Only where the pin
   runs: below 861px the pin is off and the narrow scroller owns the geometry. */
@media(min-width:861px){
  /* THE SATELLITES FOLLOW THE CALENDAR, NOT THE COLUMN. That max-width is derived from viewport
     HEIGHT, so on a window with a lot of browser chrome the calendar shrinks — and because it is
     centred inside a fixed 1040px column, it shrank AWAY from the cards on either side while they
     stayed at the column's edge. Measured on a full-height window the gap is 27px; on a short one
     it opened to nearly 200. The width is a variable now and the middle column takes the smaller
     of it and the nominal 1040, so the side columns absorb the difference and the cards stay the
     same distance from the picture at any window height. */
  .js .cal-grid{--calshotw:max(480px,calc((100vh - 360px) * 1600/940))}
  @supports(height:100svh){.js .cal-grid{--calshotw:max(480px,calc((100svh - 360px) * 1600/940))}}
  .js .calshot{max-width:var(--calshotw);margin-inline:auto}
  .js .cal-grid{grid-template-columns:minmax(120px,1fr) minmax(0,min(var(--calw,1040px),var(--calshotw))) minmax(120px,1fr)}
}
.caltabs{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:0 0 14px}
.caltab{font-size:12px;font-weight:700;letter-spacing:-.01em;padding:7px 15px;min-height:32px;
  border-radius:11px;border:1px solid var(--line2);background:var(--panel);color:var(--dim);
  cursor:pointer;font-family:inherit;transition:color .18s,border-color .18s,background .18s}
.caltab:hover{color:var(--text)}
.caltab[aria-selected="true"]{background:var(--acc-fill);border-color:var(--acc);color:#fff}
.calcap{margin-top:12px;font-size:13px;color:var(--dim);text-align:center;min-height:1.6em}
.calcap b{color:var(--text);font-weight:700}
/* Declared BEFORE the query that switches it on. This is the second time the same mistake has been
   made on this page — see .panhint — and it fails silently both times: written after the query, the
   base rule wins at every width and the affordance simply never appears. tools/home-v4-audit.mjs
   now measures both hints at 390px so there is no third time. */
.calhint{display:none;font-size:11px;color:var(--dim);text-align:center;margin-top:7px}
/* Narrow: the same answer the spine's inline shots get, for the same reason — a month grid squeezed
   to 342px is a texture, not a calendar, and this section's whole claim is about what is written on
   the days. The stage becomes a scroller and the shots keep a legible width. They stay absolutely
   positioned so the cross-fade still works; the box gets an explicit height because an
   aspect-ratio cannot compute one once the child is wider than the container. */
@media(max-width:700px){
  .calshot{aspect-ratio:auto;height:calc(620px * 940 / 1600);overflow-x:auto;overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch}
  .calshot img{width:620px;height:auto;object-fit:unset;min-width:620px}
  .calhint{display:block}
}
.anim .satc{opacity:0;transform:translateY(10px)}
.anim .satc.in{opacity:1;transform:none;transition:opacity .5s ease var(--d,0s),transform .5s ease var(--d,0s)}
@media(max-width:1080px){
  .cal-grid{grid-template-columns:minmax(0,1fr);gap:22px}
  .cal-grid .calshot{order:-1}
  .sat{flex-direction:row;flex-wrap:wrap;gap:10px;justify-content:center}
  .sat.l{align-items:stretch;text-align:left}
  .satc{max-width:none;flex:1 1 210px}
}

/* ═══ THE BANDS — the Media Center and the money (2026-10-08) ═══════════════════════════════════════
   THE DIARY'S CONSTRUCTION, NOT A NEW COMPONENT: the same room, .secH, .cal-grid with .sat/.satc cards
   either side, .caltabs/.caltab view tabs, a .calshot frame holding every view in one box (one shown, so
   the frame never changes size), the narrow pan hint and the .kstack caption. What a band adds: no pin
   (the views are chosen by the tabs alone), a 16:10 frame (its captures' shape, not the calendar's
   1600:940), tabs that stay one row and scroll sideways on a phone, and the buttons under the grid.
   The Media Center is a dark room; the money band is the page's own colour with the steps' faint tint,
   so two inversions never stack. */
.room.band .wrap{max-width:1560px}
.band h2{text-wrap:balance}
.band .band-lede{margin:16px auto 0;max-width:66ch;font-size:15px;line-height:1.6;color:var(--dim)}
.room.band.money{background:color-mix(in srgb,var(--acc) 3.5%,var(--bg))}
/* straight after the dark room, no strip of page between them (as two dark rooms meet) */
.room.dark + .room.band{margin-top:0}
body.dark .room.band.money{background:color-mix(in srgb,var(--acc) 5%,var(--bg))}
/* THE FRAME NEVER CROPS (Stephen, 2026-10-09: "make it fit the screen … but dont cut the edges off"). The frame
   takes the ACTIVE picture's own shape: --bw/--bh are the <img>'s declared width and height, written on the stage
   for the first view before a byte arrives and rewritten by bandPick, so the height is right before paint and moves
   smoothly between views (bandFit writes it as a height; the transition carries it; reduced motion jumps). The
   picture is shown whole at the frame's full width — contain, never cover — and capped at 800px on a desk, 70vh on
   a phone; past the cap it sits whole inside the frame, never cut. */
.band .calshot{width:100%;aspect-ratio:calc(var(--bw,16) / var(--bh,10));max-height:800px;transition:height .3s cubic-bezier(.2,.7,.3,1)}
.band .calshot img{object-fit:contain}
.band .calshot img.dk{display:none}
body.dark .band .calshot img.dk{display:block}
body.dark .band .calshot img.lt{display:none}
.band-tabs{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;
  scrollbar-width:none;padding:4px;margin:0 -4px 10px;scroll-snap-type:x proximity;scroll-padding-inline:4px;--fl:0px;--fr:0px;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 var(--fl),#000 calc(100% - var(--fr)),transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0,#000 var(--fl),#000 calc(100% - var(--fr)),transparent 100%)}
.band-tabs::-webkit-scrollbar{display:none}
.band-tabs>.caltab{flex:0 0 auto;white-space:nowrap;scroll-snap-align:start}
.band-tabs>.caltab:first-child{margin-left:auto}
.band-tabs>.caltab:last-child{margin-right:auto}
.band-tabs[data-fade~="l"]{--fl:24px}
.band-tabs[data-fade~="r"]{--fr:24px}
.band-act{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:clamp(26px,3vw,36px)}
.band .band-foot{text-align:center;max-width:72ch;margin:16px auto 0;line-height:1.5}
/* a phone keeps the diary's legible 620px scroller: the frame's height is the picture's at that width (whole, never
   cut), capped at 70vh — past the cap bandFit narrows the picture (--bpw) so it still fits whole */
@media(max-width:700px){.band .calshot{aspect-ratio:auto;height:calc(var(--bpw,620px) * var(--bh,10) / var(--bw,16) + 2px);max-height:70vh}
  .band .calshot img{width:var(--bpw,620px);min-width:var(--bpw,620px)}}

/* A PINNED BAND (data-pin, kitslate.app/transfers): the frame keeps one shape for every view (data-frame on the stage,
   --fw/--fh on the section), so the pin never changes size while the scroll steps it. Its width comes from the height the
   window has, like the diary's, at the frame's own shape; on a phone the picture is contained in the 620px scroller. */
@media(min-width:861px){
  .js .band[data-pin] .cal-grid{--calshotw:max(480px,calc((100vh - 380px) * var(--fw,16) / var(--fh,10)))}
  @supports(height:100svh){.js .band[data-pin] .cal-grid{--calshotw:max(480px,calc((100svh - 380px) * var(--fw,16) / var(--fh,10)))}}
}
@media(max-width:700px){.band .calshot[data-frame] img{height:100%;object-fit:contain}}

/* ON A PHONE THE TABS AND BUTTONS ARE COMPACT (Stephen, 2026-11-10, on his iPhone: "The iPhone needs smaller buttons to sit
   side by side or center"). The public pages' one phone size, the same on every page: a tab or chip 13px on 5px x 11px, 30px
   tall; a small button 13.5px on 8px x 14px, 38px tall; 8px between them. Every tab row wraps centred, the bands' too: no
   tab is cut off at the edge or hidden behind a sideways scroll (Stephen, 2026-11-10, "yes to that"; tools/home-v4-audit.mjs).
   Desktop is untouched: nothing here applies above 600px. */
@media(max-width:600px){
  .caltabs{gap:8px}
  .band-tabs{flex-wrap:wrap;justify-content:center;overflow:visible;scroll-snap-type:none;padding:0;margin:0 0 10px;
    -webkit-mask-image:none;mask-image:none}
  .band-tabs>.caltab:first-child,.band-tabs>.caltab:last-child{margin:0}
  .caltab{font-size:13px;line-height:18px;padding:5px 11px;min-height:30px}
  .band .band-act{gap:8px}
  .band .band-act .btn{font-size:13.5px;line-height:20px;min-height:38px;padding:8px 14px}
}

/* THE MEDIA CENTER SHOWCASE (.band-show; Stephen, 2026-11-14: kitslate.app/transfers "just needs the same cell as main
   page, this one"). The homepage's "Media Center and Send" band is drawn by one renderer on both pages
   (functions/_media-center.js showcaseHtml), and its layout is here, once, so the two pages show the same cell. These are
   the homepage's own band rules as it measured them (index.html, THE BANDS ACROSS THE PAGE, 2026-11-09, and its 448px pin
   allowance), scoped to the showcase and written at a higher specificity than the page's general band rules, so the
   showcase follows this sheet on every page that draws it. Below 1100px it is the band above, as on the homepage.
   The heading sits above the pin (.mk-bandhead), so the pin holds only the tabs, the picture with its cards and the caption. */
.band-show .caltab{font-size:13px}
.band-show .calhint{font-size:13px}
@media(min-width:861px){
  .js .room.band.band-show[data-pin] .cal-grid{--calshotw:max(480px,calc((100vh - 448px) * var(--fw,16) / var(--fh,10)))}
  @supports(height:100svh){.js .room.band.band-show[data-pin] .cal-grid{--calshotw:max(480px,calc((100svh - 448px) * var(--fw,16) / var(--fh,10)))}}
}
@media(min-width:1100px){
  .room.band.band-show .wrap{max-width:1800px;padding-inline:24px;width:100%;box-sizing:border-box}
  .room.band.band-show .cal-grid,.js .room.band.band-show[data-pin] .cal-grid{grid-template-columns:250px minmax(0,1fr) 250px !important;gap:20px;margin-top:0}
  .js .room.band.band-show[data-pin] .cal-grid{--calshotw:max(480px,calc((100vh - 200px) * 1.6))}
  @supports(height:100svh){.js .room.band.band-show[data-pin] .cal-grid{--calshotw:max(480px,calc((100svh - 200px) * 1.6))}}
  .band-show .satc{max-width:none;width:100%}
  .band-show .sat.l{align-items:stretch}
  .band-show .cal-grid .calshot{max-width:min(100%,var(--calshotw)) !important;margin-inline:auto}
  /* the tabs run across the whole band in one row, over the cards' columns too (the homepage's ten, from 1100 up) */
  .band-show .caltabs{flex-wrap:nowrap !important;justify-content:center !important;overflow:visible !important;-webkit-mask-image:none !important;mask-image:none !important;
    width:calc(100% + 540px);margin-left:-270px !important;margin-right:0 !important;gap:clamp(4px,0.7vw,8px)}
  .band-show .band-tabs>.caltab:first-child,.band-show .band-tabs>.caltab:last-child{margin:0}
  .band-show .caltab{padding:7px clamp(8px,calc(1.2vw - 4px),13px)}
  .band-show .mk-bandhead .secH{padding-bottom:clamp(8px,1.5vw,20px)}
}
/* unpinned (reduced motion, or under 861px): the pin sits in flow at its content's height, as on the homepage */
@media (prefers-reduced-motion: reduce), (max-width: 860px){
  .js .band-show .caltrack{height:auto !important}
  .js .band-show .calpin{position:static;min-height:0;display:block;padding:0}
}
