/* Home, the welcome's first screen (owner, 2026-11-14, on an iPhone: "is this a lot to look at, or is it just me? This is a
   lot."). scripts/sections/home.mjs homeStartHtml and homeWeekendRowsHtml; app-shell.js rolesBlock moves the blocks into the
   app home. Calm surfaces from the site tokens (so dark and Light pages both follow), clear icons, generous spacing and one
   loud colour moment: the lime "Scan a card". No gradients, no motion of its own. The app frame's stylesheets load after
   this file, so the frame rules here carry #main (an id) to win over theirs. */

/* ---------- the blocks themselves (the website page without the frame shows them too) */
#main > .home-start, #main > .home-wk { width: min(var(--shell), calc(100% - 32px)); margin: 16px auto; box-sizing: border-box; }
.home-start { display: grid; gap: 12px; }
.home-search { position: relative; display: flex; align-items: center; height: 52px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--bg); }
.home-search:focus-within { border-color: var(--blue); }
.home-search-ic { position: absolute; left: 14px; display: flex; color: var(--muted); pointer-events: none; }
.home-search-ic .ico { width: 20px; height: 20px; }
.home-search input { flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; padding: 0 14px 0 44px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); font: inherit; font-size: 16px; /* 16px: no zoom on iPhone */ }
.home-search input::placeholder { color: var(--muted); opacity: 1; }
.home-search input:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.home-search input::-webkit-search-cancel-button { cursor: pointer; }

.home-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-act { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 12px; border-radius: 14px; font-size: 16px; font-weight: 800; line-height: 1.15; text-align: center; text-decoration: none; }
.home-act-ic { display: flex; flex: 0 0 auto; }
.home-act .ico { width: 22px; height: 22px; }
/* The one loud colour on the screen. */
.home-act.is-scan { background: var(--lime); color: #0b1430; box-shadow: 0 6px 18px rgba(198, 244, 50, .18); }
.home-act.is-scan:hover { background: var(--lime-hover, #d6ff5a); }
.home-act.is-value { border: 1px solid var(--border-strong); background: var(--bg); color: var(--ink); }
.home-act.is-value .home-act-ic { color: var(--blue); }
.home-act.is-value:hover { border-color: var(--blue); }
.home-act.is-only { grid-column: 1 / -1; }
.home-act:focus-visible, .home-tile:focus-visible, .home-wk-link:focus-visible, .home-wk-all:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.home-tiles > li { min-width: 0; }
.home-tiles > li:only-child { grid-column: 1 / -1; }
.home-tile { display: flex; align-items: center; gap: 10px; height: 100%; min-height: 64px; padding: 10px 10px 10px 12px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--ink); text-decoration: none; }
.home-tile:hover { border-color: var(--border-strong); }
.home-tile-ic { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg-soft); color: var(--blue); }
.home-tile-ic .ico { width: 20px; height: 20px; }
.home-tile-txt { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; line-height: 1.2; }
.home-tile-n { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.home-tile-l { color: var(--muted); font-size: 13px; }
.home-tile-txt > .home-tile-l:only-child { color: var(--ink); font-size: 15px; font-weight: 700; }
.home-tile.is-up .home-tile-n { color: var(--ok-text); }
.home-tile.is-down .home-tile-n { color: var(--error-text); }
.home-tile-go { display: flex; flex: 0 0 auto; color: var(--subtle); }
.home-tile-go .ico { width: 18px; height: 18px; }

/* This weekend: three rows with Play's date tile, smaller. */
.home-wk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.home-wk-head h2 { margin: 0; color: var(--ink); font-size: 18px; line-height: 1.2; }
.home-wk-all { color: var(--blue); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.home-wk-all::after { content: ' \203A'; }
.home-wk-list { margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); list-style: none; }
.home-wk-row + .home-wk-row { border-top: 1px solid var(--border); }
.home-wk-link { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; color: var(--ink); text-decoration: none; }
.home-wk-link:hover .home-wk-t { text-decoration: underline; text-underline-offset: 3px; }
.home-wk .date-tile { width: 44px; min-height: 48px; padding: 8px 2px 4px; border-radius: 10px; box-shadow: none; }
.home-wk .date-tile::before { height: 4px; }
.home-wk .dt-mon { color: #cfd8f0; font-size: 10px; }
.home-wk .dt-day { margin: 2px 0 0; font-size: 18px; }
.home-wk .dt-wd { display: none; }
.home-wk-txt { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.home-wk-t { overflow: hidden; font-size: 15px; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.home-wk-s { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
/* The website page without the frame keeps its own fuller weekend section. */
html:not(.zx-shell) #home-weekend-rows { display: none; }

/* ---------- the app frame: the brand strip (the website hero, compact) */
html.zx-shell-home.zx-shell.zx-choose #main > .hero { padding: 0; min-height: 0; background: var(--bg-alt); color: var(--ink); }
html.zx-shell-home.zx-shell.zx-choose #main > .hero::before, html.zx-shell-home.zx-shell.zx-choose #main > .hero::after { display: none; }
/* The fox spans the text's rows; the spare height goes to the outer rows, so the text sits centred beside him. */
html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr auto auto auto 1fr;
  grid-template-areas: ". fox" "title fox" "desc fox" "tag fox" ". fox"; align-items: center; column-gap: 12px; min-height: 0; padding: 14px 0 2px; }
html.zx-shell-home.zx-shell.zx-choose #main > .hero h1 { grid-area: title; margin: 0; color: var(--ink); font-size: clamp(22px, 6.2vw, 26px); line-height: 1.15; letter-spacing: -.015em; }
html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-desc { display: block; grid-area: desc; max-width: 40ch; margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-tag { grid-area: tag; margin: 6px 0 0; color: var(--subtle); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-tag .hero-accent { color: inherit; }
/* Phones: the tagline steps aside (fewer words and less height on the first screen); computers show it. */
@media (max-width: 759px) { html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-tag { display: none; } }
html.zx-shell-home.zx-shell.zx-choose #main > .hero :is(.hero-ctas, .hero-tiles, .lang-alt) { display: none; }
html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-fox { grid-area: fox; align-self: center; width: 64px; max-width: none; margin: 0; }
html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-fox-disc { display: none; }
html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-fox::before { display: none; }
html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-fox-img { animation: none; filter: drop-shadow(0 4px 10px rgba(2, 8, 28, .35)); }
/* The app home under it: the same calm surface, no glow. */
html.zx-shell-home.zx-shell.zx-choose #main > .zx-home { padding-top: 12px; border-bottom: 0; background: var(--bg-alt); color: var(--ink); }
html.zx-shell-home.zx-shell.zx-choose #main > .zx-home::before { display: none; }
html.zx-shell.zx-choose #main .zx-home-inner { grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* Long event or card names never widen the column (a phone's page never scrolls sideways). */
html.zx-shell.zx-choose #main .zx-home-inner > * { min-width: 0; }
/* The site's and the dark theme's link colours and underlines stay off these blocks: each sets its own. */
#main .home-start a, #main .home-wk a, #main .zx-join-strip a { text-decoration: none; }
/* Navy text and the lime in one rule: the dark theme keeps dark text on a bright background (scripts/lib/app-shell-dark.mjs). */
#main .home-act.is-scan { background: var(--lime); color: #0b1430; }
/* The trending row's market chip says what the Market tile above it already says. */
html.zx-shell.zx-choose #main #home-trending .home-mchip { display: none; }
#main :is(.home-act.is-value, .home-tile, .home-wk-link, .zx-join-strip a) { color: var(--ink); }
#main .home-wk-all { color: var(--blue); }
/* The blocks wait in place (zx-keep) for the app home, so nothing jumps; any other home leaves them hidden. */
html.zx-shell:not(.zx-choose) #main > :is(#home-start, #home-weekend-rows) { display: none; }
html.zx-shell #main > .home-start { width: min(var(--shell), calc(100% - 48px)); margin: 12px auto 0; }
html.zx-shell .zx-home .home-start, html.zx-shell .zx-home .home-wk { width: auto; margin: 0; }
/* The join strip at the end. */
html.zx-shell .zx-join-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--muted); font-size: 14px; }
html.zx-shell .zx-join-strip a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--ink); font-weight: 800; text-decoration: none; }
html.zx-shell .zx-join-strip a:hover { border-color: var(--blue); }
html.zx-shell .zx-join-strip a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Every block one column wide below a computer (the app home's own grid is two columns from 760px). */
@media (min-width: 760px) {
  html.zx-shell.zx-choose #main .zx-home-inner > * { grid-column: 1 / -1; }
}
/* ---------- computers: the same order, two columns that fill the width */
@media (min-width: 1024px) {
  html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-inner { padding-top: 24px; column-gap: 24px; }
  html.zx-shell-home.zx-shell.zx-choose #main > .hero h1 { font-size: 34px; }
  html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-desc { max-width: none; font-size: 16px; }
  html.zx-shell-home.zx-shell.zx-choose #main > .hero .hero-fox { width: 112px; }
  html.zx-shell.zx-choose #main .zx-home-inner { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 24px; align-items: start; }
  html.zx-shell.zx-choose #main .zx-home-inner > #home-weekend-rows { grid-column: 1 / span 7; }
  html.zx-shell.zx-choose #main .zx-home-inner > .gw-home { grid-column: 8 / -1; }
  html.zx-shell.zx-choose #main .zx-home-inner:not(:has(> .gw-home)) > #home-weekend-rows { grid-column: 1 / -1; }
  .home-start { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "search tiles" "acts tiles"; gap: 12px 24px; }
  .home-search { grid-area: search; height: 56px; }
  .home-acts { grid-area: acts; }
  .home-act { min-height: 60px; font-size: 17px; }
  .home-tiles { grid-area: tiles; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; }
  .home-tile { min-height: 0; }
  .home-tile-n { font-size: 20px; }
}
