/* Detail pages (docs/research/pages-navigation.md): every entry, club, athlete, event, race, erg and email has its
   own page. A page header (breadcrumb, title row, tabs as links) over white cards. Loaded after sections.css; builds
   on dash.css (.ml-list, .mbtn, type tokens --t-*). Venue colour only where it means a venue. */

/* ---- page header ---- */
.ph { margin: 0 0 var(--s3); }
.ph-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s1); margin: 2px 0 var(--s2); font: var(--t-meta); color: var(--muted); }
.ph-crumbs a { color: var(--muted); text-decoration: none; }
.ph-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.ph-crumbs [aria-current] { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch; }
.ph-sep { color: #A9B1C4; }
.ph-up { display: none; }
.ph-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.ph-id { flex: 1 1 280px; min-width: 0; }
.ph-id h1 { margin: 0; font: var(--t-title); font-size: 22px; line-height: 1.25; display: flex; align-items: center; flex-wrap: wrap; gap: var(--s1) var(--s2); }
.ph-id h1 .pill { font-size: 12px; padding: 2px var(--s2); font-weight: 600; }
.ph-sub { margin: var(--s1) 0 0; font: var(--t-body); color: var(--muted); }
.ph-sub a { color: inherit; text-decoration: underline; text-decoration-color: #C3CADB; text-underline-offset: 2px; }
.ph-sub a:hover { color: var(--ink); text-decoration-color: currentColor; }
.ph-blade { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: #fff; box-shadow: var(--shadow); flex: none; }
.ph-blade.none { display: block; background: #EEF1F7; box-shadow: none; }
.ph-step { display: inline-flex; gap: var(--s1); }
.ph-step .m-icon { display: grid; place-items: center; width: 40px; height: 40px; text-decoration: none; background: #fff; box-shadow: var(--shadow); font-size: 22px; line-height: 1; }
.ph-step .m-icon.off { opacity: .35; pointer-events: none; box-shadow: none; }
.ph-acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ph-acts .mbtn { text-decoration: none; }

/* ---- tabs as links (Material secondary tabs) ---- */
.ptabs { display: flex; gap: 2px; margin: var(--s3) 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs a { display: inline-flex; align-items: center; gap: var(--s1); height: 44px; padding: 0 var(--s4); font: var(--t-head); font-size: 13px; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ptabs a:hover { color: var(--ink); background: rgba(27,36,64,.04); }
.ptabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- page body: cards ---- */
.pg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s4); align-items: start; }
.pcard { background: #fff; border-radius: var(--r-card, 14px); box-shadow: var(--shadow); padding: var(--s2) var(--s4) var(--s3); min-width: 0; animation: m-arrive var(--mo-3, 240ms) var(--e-settle, ease) both; }
.pcard + .pcard { margin-top: 0; }
.pg-narrow { max-width: 760px; }
.pcard-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); margin: var(--s3) var(--s1) var(--s1); font: var(--t-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pcard-h a { color: inherit; text-decoration: none; } .pcard-h a:hover { color: var(--ink); text-decoration: underline; }
.pcard-h span { font: var(--t-meta); letter-spacing: 0; text-transform: none; }
.pcard > .cc-status { margin: 0 0 var(--s1); }
.pcard .cc-drive { margin: var(--s1) var(--s1); }
.pcard .cc-drive a { color: var(--blue); }
.pcard .cc-actions { border-top: 0; padding-top: var(--s2); }
.pcard .cc-actions .mbtn { text-decoration: none; }
.cc.embedded > .cc-sec:first-child { border-top: 0; }
.ml-item.on { background: #F1F4FA; }
.ml-lead.ox { background: #E8EEFB; color: var(--blue); } .ml-lead.ld { background: #F0E9F8; color: var(--purple); }
a.ml-lead { text-decoration: none; } a.ml-lead:hover { box-shadow: inset 0 0 0 1px currentColor; }
.ml-text b a, .ml-text small a { color: inherit; text-decoration: none; }
.ml-text b a:hover, .ml-text small a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.call-club a { color: inherit; text-decoration: none; } .call-club a:hover { color: var(--blue); text-decoration: underline; }
.mail-page .ev-frame { height: min(70vh, 720px); }
.evp-res-h { margin: var(--s2) var(--s1) var(--s1); font: var(--t-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---- race page: floor plan tiles link to their erg ---- */
.race-floor { padding-top: var(--s1); overflow-x: auto; }
.fp-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.fp-link:hover { box-shadow: inset 0 0 0 2px var(--vc, var(--blue)); }
a.sch-race { text-decoration: none; }

/* ---- top tabs on a phone: seven, sliding sideways on the narrowest screens ---- */
@media (max-width: 599px) {
  .admin-tabs { grid-auto-columns: auto; justify-content: space-between; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .admin-tabs a { padding: 0 var(--s1); font-size: 12px; border-radius: 14px; }
}

/* ---- phone: one column, the breadcrumb becomes "‹ Parent" ---- */
@media (max-width: 599px) {
  .ph-crumbs { display: none; }
  .ph-up { display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px; margin: -6px 0 2px; font: var(--t-head); color: var(--muted); text-decoration: none; }
  .ph-up span { font-size: 20px; line-height: 1; }
  .ph-id { flex-basis: 100%; }
  .ph-id h1 { font-size: 19px; }
  .ph-blade { display: none; }
  .ph-step { order: 4; margin-left: auto; }
  .ph-step .m-icon { width: 44px; height: 44px; }
  .ph-acts { order: 3; flex: 0 1 auto; }
  /* tap targets: 44px on a phone */
  .ph-acts .mbtn.sm, .pcard .mbtn.sm, .pcard .mbtn { height: 44px; padding: 0 var(--s4); }
  .pcard .ml-list.dense .ml-item { min-height: 44px; }
  .ptabs a { padding: 0 var(--s3); }
  .pg-cards { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .pcard { padding: var(--s1) var(--s2) var(--s3); border-radius: 12px; }
  .mail-page .ev-frame { height: 60vh; }
}

/* Invoices (entry → Payments) */
.inv .inv-row { display: flex; align-items: center; gap: var(--s2); }
.inv .inv-row.void .ml-text b { text-decoration: line-through; color: var(--muted); }
.inv-acts { display: flex; gap: var(--s1); flex-wrap: wrap; justify-content: flex-end; }
.inv-form { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: flex-end; padding: var(--s2) var(--s3); margin: 0 0 var(--s2); background: var(--bg, #F4F6FB); border-radius: 10px; list-style: none; }
.inv-form label, .inv-billing-form label { display: grid; gap: var(--s1); font: var(--t-meta); color: var(--muted); }
.inv-form label.grow { flex: 1; min-width: 220px; }
.inv-form small, .inv-billing-form small { flex-basis: 100%; font: var(--t-meta); color: var(--muted); }
.inv-form-acts { display: flex; gap: var(--s2); margin-left: auto; }
.inv-form input, .inv-form select, .inv-billing-form input, .inv-billing-form textarea { min-height: 38px; padding: var(--s1) var(--s2); font-size: 14px; }
.inv-billing { margin: var(--s2) var(--s1); }
.inv-billing summary { cursor: pointer; font: var(--t-body); color: var(--muted); }
.inv-billing summary b { color: var(--ink); }
.inv-billing-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); padding: var(--s2) 0; }
.inv-billing-form .wide { grid-column: 1 / -1; }
.inv-billing-form .inv-form-acts { grid-column: 1 / -1; }
.inv-issue { display: flex; gap: var(--s2); margin: var(--s2) var(--s1) var(--s1); }
.mbtn.danger { background: var(--err); color: #fff; border-color: var(--err); }
/* coach's notes for the organisers (entry and athlete pages): the text as written, and who may see it */
.note-card .pcard-h .ic { color: var(--blue); }
.note-text { margin: var(--s1) var(--s1) var(--s2); white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.note-card .ml-text small.note-line { white-space: normal; overflow-wrap: anywhere; color: var(--ink); }
.note-why { display: flex; align-items: center; gap: var(--s1); margin: var(--s2) var(--s1) var(--s1); font: var(--t-meta); color: var(--muted); }
.note-why .ic { flex: none; font-size: 14px; }
.ml-text small.ml-note { display: flex; align-items: flex-start; gap: var(--s1); margin-top: 2px; white-space: normal; overflow-wrap: anywhere; color: var(--ink); }
.ml-note .ic { flex: none; margin-top: 1px; font-size: 14px; color: var(--blue); }
