/* ARENA Apple test v2 — fixes from the UX and accessibility review (2026-11-13).
   Works with v2.js. To remove: delete the v2.css and v2.js lines in index.html. */

/* ---------- screen readers and keyboard ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; inset-inline-start: 12px; top: -80px; z-index: 1000; background: var(--blue); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- page title: the help button sits beside the h1, not inside it ---------- */
.h1-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.help { width: 44px; height: 44px; }

/* ---------- top bar: room for the search ---------- */
.top .search { flex: 3 1 340px; min-width: 200px; }
.sizer > span { display: none; }   /* the group keeps its name for screen readers */
.sizer button { min-height: 44px; }

/* the animations switch moved into the side menu */
.side .m-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 10px; background: transparent; color: var(--heading); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.side .m-toggle:hover { background: var(--frame-step); }
.side .m-toggle .m-label { display: inline !important; }
.side .m-toggle .m-dot { width: 10px; height: 10px; border-radius: 99px; background: var(--control); flex: none; }
.side .m-toggle[aria-pressed="true"] .m-dot { background: var(--magenta); }

/* the role switcher is a testing tool: show it as one */
.side .v2-demo { display: grid; gap: 8px; border: 1.5px dashed var(--control); border-radius: 12px; padding: 10px; }
.side .v2-demo::before { content: "للتجربة بس"; font-size: var(--fs-meta); font-weight: 700; color: var(--muted); }
.side .v2-demo:lang(en)::before { content: "Testing only"; }

/* ---------- touch targets ---------- */
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; }
.big-check { width: 32px; height: 32px; }
@media (pointer: coarse), (max-width: 760px) {
  .crumbs a { min-height: 44px; }
  .big-check { width: 44px; height: 44px; }
}
@media (max-width: 760px) {
  .top .tool, .top .brand-sm, .sizer button { min-width: 44px; min-height: 44px; justify-content: center; }
  .top .brand-sm { display: inline-flex; align-items: center; }
}

/* ---------- disabled buttons stay readable ---------- */
.btn.primary[disabled] { opacity: 1; background: var(--frame-step); border-color: var(--control); color: var(--muted); box-shadow: none; }
.btn[disabled]:not(.primary) { opacity: 1; color: var(--muted); background: var(--frame); }
.step-why { margin: 0; color: var(--muted); font-size: var(--fs-small); font-weight: 600; }

/* ---------- Home ---------- */
.setup-card { padding: 12px 16px; }
.setup-card .meter { height: 6px; }
.tile.zero b { color: var(--muted); }
@media (max-width: 760px) {
  .setup-card { flex-wrap: nowrap; gap: 12px; padding: 10px 14px; }
  .setup-card > div { min-width: 0; gap: 6px; }
  .setup-card b { font-size: var(--fs-meta); }
  .setup-card .btn { flex: none; }
}

/* ---------- schedule ---------- */
@media (min-width: 1101px) { .cal-layout { grid-template-columns: 300px minmax(0, 1fr); } }
.mini-cal { padding: 10px; }
.mini-grid button { min-height: 40px; }
.mini-grid button.other { opacity: 1; color: var(--muted); font-weight: 500; }
@media (max-width: 760px) {
  .coach-opt { min-height: 44px; }
  .coach-opt input { width: 20px; height: 20px; }
}

/* the finished tick on a lesson card: a darker shade of the coach colour so it reads */
.ev-mark:not(.full) { color: color-mix(in srgb, var(--c) 62%, #000); }
html[data-theme="dark"] .ev-mark:not(.full) { color: color-mix(in srgb, var(--c) 55%, #fff); }

/* ---------- page buttons: on phones, the main one stays and the rest go under "More" ---------- */
.acts-more { display: none; position: relative; }
.acts-more > summary { list-style: none; cursor: pointer; }
.acts-more > summary::-webkit-details-marker { display: none; }
.acts-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; display: grid; gap: 4px; padding: 6px; background: var(--white); border: 1px solid var(--edge); border-radius: 12px; box-shadow: var(--lift, 0 6px 18px rgb(0 0 0 / .12)); }
.acts-menu .btn { justify-content: flex-start; width: 100%; border-color: transparent; }
@media (max-width: 760px) {
  .title-row > .actions.v2-split > .v2-sec { display: none; }
  .title-row > .actions.v2-split > .acts-more { display: block; }
  .title-row > .actions.v2-split { display: flex; gap: 8px; flex-wrap: nowrap; }
  .title-row > .actions.v2-split > .btn.primary { flex: 1; }
}

/* ---------- reports on phones: a section opens when you ask for it ---------- */
.v2-fold-btn { margin-inline-start: auto; }
.v2-fold.closed > :not(header) { display: none !important; }

/* ---------- dark mode: badges keep white text readable ---------- */
html[data-theme="dark"] :is(.top .tool .badge, .nav-h .count, .nav a .count, .bottom-nav b) { background: #B8297A; }

/* booking step 4: the package won't cover every chosen day (review fix 2026-11-13) */
.bk-short { display: flex !important; align-items: center; gap: 6px; margin-top: 4px; color: var(--warn); font-weight: 700; }

/* ---------- phones and tablets: a search button opens the member search under the top bar (review fix 2026-11-13) ---------- */
.top .search-sm { display: none; }
@media (max-width: 900px) {
  .top .search-sm { display: inline-flex; min-width: 44px; justify-content: center; }
  .top.search-open .search { display: block !important; position: absolute; top: 100%; inset-inline: 0; max-width: none; padding: 8px 12px 10px; background: var(--frame); box-shadow: 0 1px 0 var(--edge), 0 8px 18px rgb(0 0 0 / .08); z-index: 40; }
  .top.search-open .search .icon { inset-inline-start: 26px; }
  .top.search-open .search input { width: 100%; }
  .top.search-open .search-sm { background: var(--frame-step); }
}

/* ---------- dark mode fixes (review 2026-11-13) ---------- */
/* the payslip is a paper: white on screen too, like the other papers */
html[data-theme="dark"] .slip { background: #fff; padding: 16px; border-radius: 12px; }
/* drag tooltip: dark card instead of a near-white one */
html[data-theme="dark"] .drag-tip { background: #2A3170; color: #fff; }
html[data-theme="dark"] .drag-tip.bad { background: #A8231B; color: #fff; }
/* skip link and date-picker selection: a deeper blue so white text reads */
html[data-theme="dark"] .skip-link { background: #3B47E0; }
html[data-theme="dark"] :is(.dp-grid, .dp-months) button[aria-pressed="true"] { background: #3B47E0; border-color: #3B47E0; color: #fff; }

/* ---------- input and control edges reach 3:1 (owner approved 2026-11-13) ---------- */
:root { --control: #878DB2; }
html[data-theme="dark"] { --control: #6B74AD; }
/* date picker: a clear focus ring */
.dp-pop button:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }

/* ---------- small layout fixes (review 2026-11-13) ---------- */
/* form fields line up at the top, so a field with a hint under it doesn't push its neighbours down */
.form-grid > .field { align-content: start; }
/* phone bottom bar: the alerts badge sits at the icon's corner instead of on top of it */
@media (max-width: 760px) { .bottom-nav b { top: 2px; inset-inline-start: calc(50% + 9px); } }
/* dark mode: scrollbars and the browser's own controls follow the dark look */
html[data-theme="dark"] { color-scheme: dark; }
/* calendar: the week fits a 1366px laptop (narrower day columns, slimmer side column on mid-size screens) */
.sc-grid { min-width: calc(64px + var(--cols) * 76px); }
@media (min-width: 1101px) and (max-width: 1440px) { .cal-layout { grid-template-columns: 250px minmax(0, 1fr); } }
/* fonts: the Arabic certificate title uses Cairo (the brand serif has no Arabic letters) */
.certificate:lang(ar) .c-kicker, .certificate .c-kicker:lang(ar) { font-family: var(--ui); font-weight: 800; }
/* table headings that only screen readers need (the cash table) */
.v2-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* iPhone on its side: each side's padding follows its own safe area (they were swapped) */
.login .art { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (max-width: 900px) { .page { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); } }
.bottom-nav { padding-left: max(6px, env(safe-area-inset-left, 0px)); padding-right: max(6px, env(safe-area-inset-right, 0px)); }

/* ---------- colours (owner approved a live preview, 2026-11-13) ---------- */
/* coach name on lesson cards: a darker shade of the coach colour in light, a light tint in dark */
html:not([data-theme="dark"]) .cal-ev b { color: color-mix(in srgb, var(--c) 55%, #06106A) !important; }
html[data-theme="dark"] .cal-ev b { color: color-mix(in srgb, var(--c) 30%, #ffffff) !important; }
/* ring line on cards: darker, and full ink on full lessons */
.cal-ev > .ring { color: color-mix(in srgb, var(--muted) 60%, var(--ink)) !important; }
.cal-ev.full > .ring { color: var(--ink) !important; }
/* dark mode: hold-to-delete fill, legend swatches, the bottom bar's top line, the danger button edge */
html.motion[data-theme="dark"] .btn.m-hold .m-fill { background: #5C2128 !important; }
.cal-legend .lg.full { background: color-mix(in srgb, var(--blue) 30%, var(--white)) !important; }
.cal-legend .lg.done { background: color-mix(in srgb, var(--blue) 12%, var(--white)) !important; }
html[data-theme="dark"] .bottom-nav { border-top-color: var(--edge) !important; }
html[data-theme="dark"] .btn.danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent) !important; }
/* charts: the second bar (and its legend swatch) and the Excel preview headers are darker */
.col-b, .legend i[style*="B9B3A3"] { background: #8C8676 !important; }
.xl-grid thead th, .xl-grid th.xl-rn { color: #5B6170 !important; }

/* ---------- printing (review fixes 2026-11-14) ---------- */
/* the receipt's stamp is part of the receipt: it shows with animations off, and on paper */
.receipt { position: relative; }
.receipt .r-stamp { position: absolute; inset-inline-start: 50%; bottom: 26px; z-index: 4; pointer-events: none;
  border: 3px solid var(--blue); color: var(--blue); border-radius: 8px; padding: 4px 16px 6px;
  font-weight: 800; font-size: 24px; letter-spacing: .04em; line-height: 1.2; text-align: center; white-space: nowrap;
  transform: rotate(-11deg); opacity: .82; background: transparent; }
.receipt .r-stamp.bad { border-color: var(--danger); color: var(--danger); }
.receipt .r-stamp small { display: block; font-family: var(--brand); font-size: .55em; letter-spacing: .2em; font-weight: 600; }
@media print {
  /* motion.css hides its stamp on paper; this one is the receipt's own, so it prints (no animation, full strength) */
  .receipt .r-stamp.m-stamp { display: block !important; animation: none !important; opacity: .9 !important; transform: rotate(-11deg) !important; }
  /* things that are hidden on paper take no room either (the test-mode banner pushed the receipt onto a second page) */
  .test-banner, .skip-link, #v2-live { display: none !important; }
  body:has(.done-box .receipt) .sheet > :not(.page) { display: none !important; }
  /* a little room to spare on the A5 sheet */
  .receipt { zoom: 1.13 !important; break-inside: avoid; }
  html .receipt.print-area, html .done-box .receipt.print-area, html .overlay .receipt.print-area { margin: 7mm auto 0 !important; }   /* its own border from the sheet edge, even with Margins: None */
  .overlay .receipt.print-area { position: relative !important; }

  /* the certificate fills an A4 sheet on its side, with its round seal inside the frame */
  .overlay .dialog:has(.certificate) { max-width: none !important; width: 100% !important; margin: 0 !important; }   /* the window's on-screen width limit would cut the sheet */
  .overlay .certificate.print-area { position: relative !important; box-sizing: border-box; width: 277mm; height: 188mm; margin: 11mm auto 0; padding: 14mm 24mm; align-content: center; gap: 5mm; border-width: 5px; }
  .certificate img:not(.c-seal) { width: 52mm; }
  .certificate .c-kicker { font-size: 34pt !important; }
  .certificate .c-name { font-size: 38pt; }
  .certificate p { font-size: 16pt; margin: 0; }
  .certificate .pole { width: 120mm; }
  .certificate .c-seal { width: 30mm; inset-inline-end: 14mm; bottom: 12mm; }

  /* the membership card prints at real card size, in the middle of the sheet, with a dashed line to cut along */
  .card-stage { display: flex !important; justify-content: center; padding-top: 25mm !important; }
  .member-card { outline: 0.3mm dashed #8A8A8A; outline-offset: 3mm; box-sizing: border-box; height: 53.98mm; aspect-ratio: auto; padding: 4mm 5mm; gap: 1.2mm; overflow: hidden; }   /* real card size: 85.6 × 54 mm */
  .member-card img { width: 19mm !important; }
  .member-card b { font-size: 12pt !important; }
}

@media print {
  /* the schedule print: each page keeps an 8mm border inside the sheet, whatever the Margins setting (review fix 2026-11-14) */
  .sp-page { box-sizing: border-box; padding: 8mm !important; }
}

/* ---------- printed staff list (approved 2026-11-14) ---------- */
.staff-paper { gap: 14px; font-size: 12px; }
.staff-paper .st-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.staff-paper .st-sum > div { border: 1px solid #DDE0EC; border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; background: #F7F8FC; }
.staff-paper .st-sum span { font-size: 10.5px; color: #545A78; }
.staff-paper .st-sum b { font-size: 18px; color: #06106A; line-height: 1.2; }
.staff-paper .st-sum b small { font-size: 11px; font-weight: 600; color: #545A78; }
.staff-paper .st-table { font-size: 11.5px; }
.staff-paper .st-table th { font-size: 10.5px; color: #545A78; background: #F1F2F7; border-bottom: 1.5px solid #06106A; padding: 6px; white-space: nowrap; }
.staff-paper .st-table td { padding: 7px 6px; vertical-align: middle; border-bottom: 1px solid #E6E8F1; color: #1B1F4B; }
.staff-paper .st-table td b { color: #06106A; font-size: 12px; }
.staff-paper .st-table td small { font-size: 10px; color: #545A78; }
.staff-paper .st-table .n { width: 18px; color: #8A90AE; text-align: center; }
.staff-paper .st-table tbody tr:nth-child(even) td { background: #FAFAFD; }
.staff-paper .st-table tr.gone td { color: #8A90AE; }
.staff-paper .st-table tr.gone td b { color: #545A78; }
.staff-paper .st-table .pill { font-size: 10px; padding: 0 7px; }
.staff-paper .st-table td span[style] { font-size: inherit !important; }
.staff-paper .st-gone-h { font-size: 12px; color: #545A78; margin: 6px 0 0; }
.staff-paper .st-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 26px; }
.staff-paper .st-sign div { display: grid; gap: 22px; font-size: 11px; color: #545A78; }
.staff-paper .st-sign i { border-bottom: 1px solid #1B1F4B; display: block; }
@media (max-width: 600px) { .staff-paper .st-sum { grid-template-columns: repeat(2, 1fr); } }

/* every printed list keeps its own 12mm border inside the sheet, whatever the Margins setting (2026-11-14) */
@media print {
  @page { size: A4; margin: 0; }
  .paper { padding: 12mm !important; }
  .card-stage { padding-top: 25mm !important; }
  .staff-paper .st-table tr { break-inside: avoid; }
  .staff-paper .st-table thead { display: table-header-group; }
}

/* ---------- printed coaches and horses lists (approved 2026-11-14); they reuse the .staff-paper look ---------- */
.staff-paper .st-who { display: flex; align-items: flex-start; gap: 8px; }
.staff-paper .st-who > i { width: 10px; height: 10px; border-radius: 3px; margin-top: 4px; flex: none; }
.staff-paper .st-who small { display: block; font-size: 10px; color: #545A78; margin-top: 1px; }
.staff-paper .st-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.staff-paper .st-tags span { font-size: 9.5px; padding: 1px 6px; border-radius: 99px; background: #EEF0FA; color: #06106A; white-space: nowrap; }
.staff-paper .st-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; min-width: 150px; }
.staff-paper .st-week span { display: grid; justify-items: center; border-radius: 4px; padding: 1px 0; background: #F4F5FA; }
.staff-paper .st-week span i { font-style: normal; font-size: 8.5px; color: #8A90AE; }
.staff-paper .st-week span b { font-size: 10.5px; color: #B0B4C8; }
.staff-paper .st-week span.on { background: #E3E6FB; }
.staff-paper .st-week span.on b { color: #06106A; }
.staff-paper .st-week span.off { background: repeating-linear-gradient(45deg, #F4F5FA 0 3px, #ECEDF3 3px 6px); }
.staff-paper.st-coaches td, .staff-paper.st-horses td { vertical-align: top; }
.staff-paper .st-en { font-size: 10px; color: #8A90AE; margin-inline-start: 4px; }
.staff-paper .st-soon { color: #A8231B; font-weight: 700; }
.staff-paper .st-sub-h { font-size: 12px; color: #06106A; margin: 8px 0 0; }

/* ---------- printed members and expenses lists (approved 2026-11-14) ---------- */
.staff-paper .st-muted { color: #8A90AE; font-size: 10px; }
.staff-paper.st-members td, .staff-paper .st-cats td { vertical-align: middle; }
.staff-paper .st-bar { display: flex; align-items: center; gap: 6px; }
.staff-paper .st-bar i { display: block; height: 8px; border-radius: 4px; background: #0000A7; min-width: 2px; }
.staff-paper .st-bar span { font-size: 10px; color: #545A78; }
.staff-paper tfoot td { border-top: 1.5px solid #06106A; border-bottom: 0; padding-top: 8px; color: #06106A; }
.staff-paper .st-sum b { overflow-wrap: anywhere; }

/* tablet on its side (901–1180px): the top bar fits without a sideways scroll (review fix 2026-11-14) */
@media (min-width: 901px) and (max-width: 1180px) {
  .top { gap: 8px; }
  .top .search { flex: 1 1 200px; min-width: 150px; }
  .top .tool .lbl { display: none; }
  .top .tool { padding: 0 10px; }
}

/* ---------- batch 2 (2026-11-14) ---------- */
/* attendance: when the buttons open, and "cancel booking" kept apart from Attended / No-show */
.bk-wait { font-size: var(--fs-meta); color: var(--muted); }
.row-acts .bk-far { margin-inline-start: 18px; }
/* rider names on lesson cards */
.cal-ev .ev-riders { font-weight: 700; font-size: 12.5px; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the "member added" window */
.added-who { font-size: var(--fs-body); margin: 4px 0 8px; }

/* ---------- today's attendance page (2026-11-14; new look approved 2026-11-14) ---------- */
.td-date { font-size: var(--fs-body); color: var(--muted); margin: -4px 0 16px; }
.td-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; background: var(--white); border: 1px solid var(--edge); border-radius: 14px; padding: 14px 20px; margin-bottom: 18px; }
.td-prog { flex: 1 1 240px; color: var(--muted); }
.td-prog b { color: var(--heading); font-size: 19px; }
.td-bar { height: 8px; border-radius: 4px; background: var(--edge); margin-top: 6px; overflow: hidden; }
.td-bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .3s; }
.td-counts { display: flex; gap: 18px; color: var(--muted); font-size: var(--fs-meta); }
.td-counts b { font-size: 17px; margin-inline-end: 2px; }
.td-counts .ok { color: var(--ok); } .td-counts .bad { color: var(--danger); } .td-counts .wait { color: var(--warn); }
.td-slot { display: flex; gap: 14px; margin-bottom: 14px; }
.td-time { flex: none; width: 70px; display: grid; justify-items: center; align-content: start; padding-top: 12px; }
.td-time b { font-size: 18px; color: var(--heading); line-height: 1.2; }
.td-time small { font-size: 12px; color: var(--muted); }
.td-card { flex: 1; min-width: 0; background: var(--white); border: 1px solid var(--edge); border-inline-start: 5px solid var(--c, var(--blue)); border-radius: 14px; overflow: hidden; }
.td-card.is-now { box-shadow: 0 0 0 2px var(--blue-tint); }
.td-card > header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 14px 20px; }
.td-card > header > b { font-size: 16.5px; color: var(--heading); }
.td-meta { color: var(--muted); font-size: var(--fs-meta); }
.td-now { background: var(--blue-tint); color: var(--blue); font-size: 12px; font-weight: 700; border-radius: 99px; padding: 1px 10px; }
.td-cap { margin-inline-start: auto; color: var(--muted); font-size: 12.5px; border: 1px solid var(--edge); border-radius: 99px; padding: 2px 12px; white-space: nowrap; }
.td-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--edge); }
.td-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-tint); color: var(--blue); font-weight: 700; }
.td-who { flex: 1; min-width: 0; }
.td-who b { color: var(--heading); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-who small { color: var(--muted); font-size: 12.5px; }
.td-seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; flex: none; }
.td-seg button { font: inherit; font-size: 14px; min-height: 42px; padding: 0 16px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.td-seg button + button { border-inline-start: 1px solid var(--edge); }
.td-seg button:hover { background: var(--blue-tint); }
.td-seg .td-yes[aria-pressed="true"] { background: var(--ok-tint); color: var(--ok); font-weight: 700; }
.td-seg .td-no[aria-pressed="true"] { background: var(--danger-tint); color: var(--danger); font-weight: 700; }
.td-seg button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.td-cancel { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0; padding: 8px 6px; margin-inline-start: 8px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; flex: none; }
.td-cancel:hover { color: var(--danger); }
.td-empty { margin-inline-start: 84px; background: var(--white); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 20px; color: var(--muted); }
.td-empty summary { cursor: pointer; font-size: var(--fs-body); }
.td-empty ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-meta); }
.td-empty li b { color: var(--ink); }
@media (max-width: 600px) {
  .td-slot { flex-direction: column; gap: 4px; }
  .td-time { width: auto; display: flex; gap: 8px; align-items: baseline; padding: 0 4px; }
  .td-card > header, .td-row { padding-inline: 14px; }
  .td-row { flex-wrap: wrap; }
  .td-row .td-seg { margin-inline-start: 48px; }
  .td-empty { margin-inline-start: 0; }
  .td-strip { padding: 12px 14px; }
}
html[data-theme="dark"] .td-card { border-inline-start-color: color-mix(in srgb, var(--c, var(--blue)) 60%, white); }
@media (max-width: 600px) { .td-row .td-who { flex: 1 1 calc(100% - 52px); } .td-row .td-cancel { margin-inline-start: auto; } }

/* ---------- batch 3 (2026-11-14): phones and tablets only; computers and laptops stay exactly as they were ---------- */
.m-tiles { display: none; }
@media (max-width: 1024px) {
  /* member page: four number tiles under the name; the membership card moves to the end of the overview */
  .m-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 16px; }
  .m-tiles > div { background: var(--white); border: 1px solid var(--edge); border-radius: 14px; padding: 10px 14px; display: grid; gap: 1px; min-width: 0; }
  .m-tiles span:first-child { font-size: var(--fs-meta); color: var(--muted); }
  .m-tiles b { font-size: 22px; color: var(--heading); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-tiles b small { font-size: 13px; color: var(--muted); font-weight: 400; }
  .m-tiles .m-t-text b { font-size: 16.5px; }
  .m-tiles .m-t-owe b { color: var(--danger); }
  .m-tiles > div > small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-over { display: flex; flex-direction: column; }
  .m-over > .facts { display: none; }
  .m-over > .m-card-sec { order: 9; }
  /* Next / Save stays in sight at the bottom of the screen while filling a form */
  .step-nav { position: sticky; bottom: 0; z-index: 20; background: var(--sheet); margin-inline: -16px; padding: 10px 16px; border-top: 1px solid var(--edge); max-width: none; }
  .step-nav > .btn.primary, .step-nav .actions > .btn.primary { flex: 2; }
}
@media (max-width: 900px) {
  /* above the phone's bottom bar */
  .step-nav { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; }
  .m-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- money words explain themselves (batch 5, 2026-11-14) ---------- */
.money-term { cursor: help; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, var(--blue) 70%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.pill.money-term { text-decoration-color: currentColor; }
.money-term:hover { text-decoration-style: solid; }
.money-term:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.money-pop { position: absolute; z-index: 90; width: min(300px, calc(100vw - 20px)); background: var(--heading); color: var(--white); border-radius: 12px; padding: 12px 36px 12px 14px; box-shadow: 0 10px 30px rgb(6 16 106 / .25); font-family: inherit; }
.money-pop[dir="rtl"] { padding: 12px 14px 12px 36px; }
.money-pop b { display: block; font-size: 14.5px; margin-bottom: 2px; color: inherit; }
.money-pop p { margin: 0; font-size: 13.5px; line-height: 1.65; color: inherit; }
.money-pop-x { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
.money-pop-x:hover { background: rgb(255 255 255 / .12); }
html[data-theme="dark"] .money-pop { background: #F3F4FF; color: #1B1F4B; box-shadow: 0 10px 30px rgb(0 0 0 / .45); }
html[data-theme="dark"] .money-pop b { color: #06106A; }
html[data-theme="dark"] .money-pop-x:hover { background: rgb(6 16 106 / .08); }
@media print { .money-pop { display: none !important; } .money-term { text-decoration: none; } }
td.money-cell::before { cursor: help; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, var(--blue) 70%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }

/* ---------- phone top bar (2026-11-16): the logo never gets squeezed; the ARENA word shows only when there is room ---------- */
.top .brand-sm { flex-shrink: 0; }
@media (max-width: 900px) { [dir="rtl"] .top { padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); } }   /* Arabic had 8px more padding than English */
@media (max-width: 520px) { .brand-sm b { display: none; } }
@media (max-width: 400px) { .top { gap: 2px; } }
@media (max-width: 340px) {   /* the smallest phones (320 wide) */
  .top, [dir="rtl"] .top { padding-inline: 8px; }
  .top .tool, .top .brand-sm { min-width: 40px; padding: 0 4px; }
  .sizer button { min-width: 36px; }
}
