/* App pages (entry link, confirmation, office) on top of the website's Round 4 styles */
.app-main { padding-block: 24px 64px; }
.app-card { max-width: 820px; margin: 0 auto; display: grid; gap: 18px; }
.app-office { max-width: 1160px; }
.app-eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.app-note { margin: 0; padding: 12px 14px; border-radius: 10px; background: #e9f0fa; font-size: 14px; }
.app-note--warn { background: #fff4ea; color: #9a3412; }
.app-history { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--ink-70); }
.app-year { display: inline-block; padding: 1px 8px; border: 1px solid var(--field-line); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink); }
.app-box { display: grid; gap: 12px; margin: 0; padding: 18px; border: 1px solid var(--field-line); border-radius: 14px; background: #fff; min-width: 0; }
.app-box legend { padding: 0 6px; font-family: var(--slab); font-weight: 900; font-stretch: 50%; font-size: 24px; color: var(--blue); }
.app-hint { margin: 0; font-size: 13px; line-height: 19px; color: var(--ink-70); }
.app-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 22px; color: var(--ink); cursor: pointer; }
.app-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--blue); flex: none; }
.app-agree { padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--field-line); }
.app-agree a, .app-hint a { color: var(--blue); }
.app-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.app-search { flex: 1 1 220px; min-height: 42px; padding: 0 14px; border: 1px solid var(--field-line); border-radius: 10px; font: 15px var(--sans); }
.app-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--field-line); border-radius: 999px; background: #fff; color: var(--ink); font: 600 13px var(--sans); text-decoration: none; cursor: pointer; }
.app-chip:hover { background: var(--cream); }
.app-chip--go { background: var(--blue); border-color: var(--blue); color: #fff; }
.app-group { display: grid; gap: 6px; }
.app-players { list-style: none; margin: 0; padding: 0; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; overflow: hidden; }
.app-players li + li { border-top: 1px solid rgba(0,0,0,.06); }
.app-player { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; color: var(--ink); }
.app-player input { width: 20px; height: 20px; accent-color: var(--blue); }
.app-player:has(input:checked) { background: #eef4fc; }
.app-player__main { display: grid; min-width: 0; }
.app-player__main strong { font-size: 15px; }
.app-player__main span { font-size: 12.5px; color: var(--ink-70); overflow-wrap: anywhere; }
.app-player__meta { display: grid; justify-items: end; gap: 2px; font-size: 12px; color: var(--ink-70); }
.app-add { padding: 12px 14px; border-radius: 12px; background: var(--cream); }
.app-add summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.app-add[open] { display: grid; gap: 12px; }
.app-count { margin: 0; padding: 12px 14px; border-radius: 12px; background: #e9f0fa; font-size: 14px; color: var(--ink); }
.app-pairs { display: grid; gap: 10px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,.08); }
.app-subhead { margin: 8px 0 0; font-family: var(--slab); font-weight: 900; font-stretch: 50%; font-size: 24px; color: var(--blue); }
.app-subhead span { font: 400 13px var(--sans); color: var(--ink-70); }
.app-pairlabel { margin: 0; font-weight: 600; color: var(--ink); }
.app-link { justify-self: start; padding: 0; border: 0; background: none; color: var(--blue); font: 600 14px var(--sans); text-decoration: underline; cursor: pointer; }
.app-decline { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: #fff; border: 1px solid var(--field-line); color: var(--ink); }
.app-decline select { min-height: 44px; border: 1px solid var(--field-line); border-radius: 10px; padding: 0 10px; font: 15px var(--sans); }
.app-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink); line-height: 1.5; }
.app-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.app-kpis div { display: grid; gap: 2px; padding: 14px; border-radius: 12px; background: #fff; border: 1px solid var(--field-line); }
.app-kpis b { font-family: var(--slab); font-weight: 900; font-stretch: 50%; font-size: 34px; line-height: 1; color: var(--blue); }
.app-kpis span { font-size: 13px; color: var(--ink-70); }
.app-table { overflow-x: auto; border: 1px solid var(--field-line); border-radius: 12px; background: #fff; }
.app-table table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--ink); }
.app-table th { text-align: left; padding: 10px 12px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-70); border-bottom: 1px solid var(--field-line); }
.app-table td { padding: 10px 12px; border-top: 1px solid rgba(0,0,0,.06); vertical-align: top; }
.app-inline { display: flex; gap: 6px; }
.app-foot { padding-block: 0 32px; font-size: 13px; color: rgba(255,255,255,.75); }
.app-foot a { color: #fff; }
.app-card select { width: 100%; }
/* Office: staff sign-in, tabs, reveal, club actions, audit */
.app-officebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.app-officebar .r4-title { margin: 0; }
.app-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--field-line); }
.app-tabs a { padding: 10px 14px; border-bottom: 3px solid transparent; font: 600 14px var(--sans); color: var(--ink-70); text-decoration: none; }
.app-tabs a:hover { color: var(--ink); }
.app-tabs a.is-on { color: var(--blue); border-bottom-color: var(--blue); }
.app-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.app-chip--warn { color: #9a3412; border-color: #f2c9a8; }
.app-chip--danger { background: #b42318; border-color: #b42318; color: #fff; }
.app-chip:disabled { opacity: .5; cursor: not-allowed; }
.app-reveal { font-size: 12.5px; }
.app-reveal__got { font-size: 13px; overflow-wrap: anywhere; color: var(--ink); }
.app-reveal__form { display: grid; gap: 8px; min-width: 240px; max-width: 360px; padding: 10px; border-radius: 10px; background: var(--cream); }
.app-reveal__form select, .app-reveal__form .app-search { min-height: 38px; font-size: 14px; }
.app-confirm { background: #fff4ea; }
.app-row--key td { background: #fffaf0; }
.app-row--off td { opacity: .55; }
.app-signin { max-width: 460px; }
.app-signin__form { display: grid; gap: 14px; }
.app-signin__form .r4-btn { justify-self: start; }
.app-qr { width: 180px; max-width: 100%; padding: 8px; background: #fff; border: 1px solid var(--field-line); border-radius: 10px; }
.app-qr svg { display: block; width: 100%; height: auto; }
.app-key { font-size: 13px; letter-spacing: .04em; overflow-wrap: anywhere; }
/* MASHIE membership panel and app store buttons */
.app-mashie { border-color: #c9d6ea; }
.app-stores { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.app-stores a { display: block; line-height: 0; }
.app-stores img { display: block; height: 40px; width: auto; }
/* Office record pages (club, member) */
.app-record { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.app-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14px; color: var(--ink); }
.app-dl dt { color: var(--ink-70); }
.app-dl dd { margin: 0; overflow-wrap: anywhere; }
.app-table a, .app-box a { color: var(--blue); }
/* Office → Messages */
.app-subtabs { display: flex; gap: 6px; }
.app-subtabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--field-line); font: 600 13px var(--sans); color: var(--ink-70); text-decoration: none; }
.app-subtabs a.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.app-progress { height: 10px; border-radius: 999px; background: #e7eef9; overflow: hidden; }
.app-progress span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.app-launch__controls { display: grid; gap: 10px; }
.app-launch .app-table { margin-top: 4px; }
/* Office editing forms */
.app-fields { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.app-fields .app-search { width: 100%; min-height: 38px; font-size: 14px; }
.app-reveal__form:has(.app-fields) { max-width: none; }
.app-box .app-fields { margin: 8px 0; }
.app-inline { flex-wrap: wrap; align-items: center; }
.app-record + .app-inline, .app-tools + .app-inline, .app-table + .app-inline, .app-inline + .app-inline { margin-top: 10px; }
.app-switch--off { border: 2px solid #c25b00; }
/* Draw */
.app-row--on td { background: #f7f3ec; }
.app-row--soft td { background: #fff6e5; }
.app-row--warn td { background: #ffe8e0; }
.app-box details { margin-top: 8px; }

/* ---- Mobile (1 Dec 2026): the card's single column can shrink to the screen; nothing pushes past its edge */
.app-card { grid-template-columns: minmax(0, 1fr); }
.app-card > *, .app-box, .app-fields, .app-grid > * { min-width: 0; }
.app-card input:not([type=checkbox]):not([type=radio]), .app-card select, .app-card textarea { max-width: 100%; }
@media (max-width: 760px) {
  .app-card { overflow-wrap: anywhere; }
  .app-table th { font-size: 12px; }
  .app-chip, .app-link, .app-tools button, .app-tools a { min-height: 40px; }
  .app-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Box titles (fieldset legends) wrap inside the box on phones instead of over its border */
.app-box > legend { float: left; width: 100%; padding: 0; margin: 0 0 6px; line-height: 1.05; }
.app-box > legend + * { clear: both; }
/* Tick box and radio labels: the text (with any links) flows as one block beside the box */
.app-check > span { flex: 1; min-width: 0; }

/* A confirmed (locked) pair on the club's entry page */
.app-locked { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; background: #eef3fb; border: 1px solid #c9d6ea; }
.app-locked p { margin: 0; }
.app-pairs .app-confirm { display: grid; gap: 10px; padding: 16px; border-radius: 12px; }
.app-pairs .app-confirm p { margin: 0; }

/* The MASHIE membership box on a player's account: the MASHIE logo and a clear status */
.app-mashie__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.app-mashie__logo { display: block; height: 24px; width: auto; }
.app-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.app-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.app-ok { color: #136c34; }

/* The club portal (/account/club/<id>) */
.app-tabs--portal { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.app-tabs--portal a { flex: none; }
.app-portal-pair { display: grid; gap: 12px; }
.app-prow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; }
.app-prow > .app-player__main { flex: 1 1 220px; }
.app-prow__end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.app-prow.is-past { background: #fafafa; }
.app-prow.is-past strong { color: var(--ink-70); }
.app-tag { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: #eef1f5; font-size: 12.5px; font-weight: 600; color: var(--ink-70); }
.app-portal-qr { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; }
.app-copy textarea, .app-copy input { width: 100%; font: 14px/1.5 var(--sans); }
.app-copy .app-tools { margin-top: 6px; }
@media (max-width: 560px) {
  .app-portal-qr { grid-template-columns: minmax(0, 1fr); }
  .app-portal-qr .app-qr { width: 160px; }
  .app-prow__end { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .app-tabs--portal { justify-content: space-between; gap: 0; }
  .app-tabs--portal a { padding: 10px 6px; font-size: 13.5px; }
}

/* Status tags across the app (2 Dec 2026): solid colour, white writing */
.app-status { color: #fff; white-space: nowrap; vertical-align: middle; font-size: 12.5px; padding: 3px 11px; }
.app-status::before { background: #fff; width: 6px; height: 6px; }
.app-status--ok { background: #15803d; color: #fff; }
.app-status--no { background: #c62828; color: #fff; }
.app-status--wait { background: #b45309; color: #fff; }
.app-status--off { background: #5b6472; color: #fff; }
.app-table .app-status, .app-list .app-status { margin-right: 4px; }
@media (max-width: 560px) { .app-status { white-space: normal; } }
.app-tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
/* Club tabs on the account page (2 Dec 2026): six tabs fit a phone */
.app-clubname { margin-top: 2px; }
@media (max-width: 560px) { .app-tabs--portal a { padding: 10px 4px; font-size: 13px; } }
/* Club tab: the clubhouse pin on a map, and buttons that all match */
.app-map { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 420px; border-radius: 12px; overflow: hidden; border: 1px solid var(--field-line); background: #e9eef5; }
.app-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.app-portal .app-chip { min-height: 40px; padding: 0 16px; font-size: 14px; color: var(--blue); }
.app-portal .app-chip--go { color: #fff; }
.app-portal .app-chip.is-on { color: #fff; }
@media (max-width: 560px) { .app-map { aspect-ratio: 4 / 3; } }
.app-portal .app-chip--warn { color: #9a3412; }
/* Office: a draw's sponsor, with the logo on the same blue as the Draw page band */
.app-sponsor { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 14px; }
.app-sponsor__logo { display: inline-flex; align-items: center; justify-content: center; min-width: 120px; max-width: 220px; height: 64px; padding: 10px 16px; border-radius: 10px; background: var(--blue); }
.app-sponsor__logo img { display: block; max-width: 100%; max-height: 44px; width: auto; height: auto; }

/* 404: the paper boy on the blue, lost on the course */
.app-404 { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 40px; max-width: 880px; margin: 32px auto; padding: 48px; border-radius: 20px; background: var(--blue); color: #fff; }
.app-404__boy { width: 200px; height: auto; }
.app-404__text { display: grid; gap: 14px; min-width: 0; }
.app-404__text p { margin: 0; font-size: 17px; line-height: 1.5; color: rgba(255,255,255,.9); }
.app-404__code { font-size: 12px !important; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #ffdd33 !important; }
.app-404__title { margin: 0; font-family: var(--slab); font-weight: 900; font-stretch: 50%; font-size: clamp(38px, 6vw, 64px); line-height: .95; color: #fff; text-wrap: balance; }
.app-404__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px !important; }
.app-404__btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 999px; background: #fff; color: var(--blue); font: 700 16px var(--sans); text-decoration: none; }
.app-404__btn:hover { background: #ffdd33; color: #0e0f0b; }
.app-404__link { color: #fff; font-weight: 600; }
@media (max-width: 640px) {
  .app-404 { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 20px; padding: 32px 20px; margin: 16px auto; }
  .app-404__boy { width: 130px; }
  .app-404__actions { justify-content: center; }
}
