/* On Target v1.7.2 — club styles */
:root {
  --maroon: #5C0F1F;
  --crimson: #9B1B35;
  --gold: #E9B44C;
  --gold-soft: #F7E8C6;
  --gold-text: #6B4600;
  --green: #1E7A3C;
  --ok-text: #1E7A3C;
  --ok-soft: #DDF0E3;
  --red: #B3261E;
  --red-text: #B3261E;
  --info-soft: #DDE8F7;
  --info-text: #1D4C8A;

  --bg: #F6F2EE;
  --card: #FFFFFF;
  --tint: #F3E6E2;
  --line: #E2D6D0;
  --line-soft: #F0E6E1;
  --text: #2A1A1E;
  --text-2: #5E4C51;
  --text-3: #7A666B;
  --heading: #5C0F1F;
  --accent: #9B1B35;
  --shadow: 0 1px 2px rgba(60,20,30,.06), 0 6px 18px rgba(60,20,30,.06);

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161012;
    --card: #221A1C;
    --tint: #34232A;
    --line: #3A2C30;
    --line-soft: #2E2226;
    --text: #F4ECEE;
    --text-2: #C9B8BC;
    --text-3: #A8959A;
    --heading: #F2C76E;
    --accent: #F08AA0;
    --gold-soft: #3D3018;
    --gold-text: #F2C76E;
    --ok-text: #7DD69A;
    --ok-soft: #1F3A28;
    --red-text: #FF8A80;
    --info-soft: #1D2E48;
    --info-text: #9CC1F2;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 Poppins, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button { font: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { font-family: Montserrat, sans-serif; font-weight: 800; margin: 0; }

/* Splash */
.splash {
  position: fixed; inset: 0; z-index: 50;
  background: var(--maroon); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .35s ease;
}
.splash img { border-radius: 24px; }
.splash-name { font: 800 24px Montserrat, sans-serif; letter-spacing: 1px; margin-top: 8px; }
.splash-sub { font: 700 11px Montserrat, sans-serif; letter-spacing: 2px; color: var(--gold); }
.splash.hide { opacity: 0; pointer-events: none; }

/* App frame */
.app { max-width: 720px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--maroon); color: #fff;
  padding: calc(12px + var(--safe-t)) 16px 12px;
  display: flex; align-items: center; gap: 10px;
}
.brand { flex: 1; display: flex; align-items: center; gap: 10px; }
.brand-mark { border-radius: 18px; }
.brand-name { font: 800 18px Montserrat, sans-serif; letter-spacing: .5px; line-height: 1.1; }
.brand-sub { font: 700 9px Montserrat, sans-serif; letter-spacing: 2px; color: var(--gold); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 20px; height: 20px; }

.view {
  flex: 1; outline: none;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(60,20,30,.06);
  display: flex; justify-content: center;
  padding: 4px 6px calc(8px + var(--safe-b));
}
.tabbar a {
  flex: 1; max-width: 140px; text-decoration: none; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3); font: 500 12px Poppins, sans-serif;
}
.tab-ico { display: flex; padding: 4px 16px; border-radius: 14px; }
.tab-ico svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--heading); font-weight: 700; }
.tabbar a[aria-current="page"] .tab-ico { background: var(--gold-soft); }

/* Hero (home) */
.hero { background: var(--maroon); color: #fff; padding: 4px 16px 60px; position: relative; overflow: hidden; }
.hero-rings { position: absolute; right: -80px; top: -70px; width: 260px; height: 260px; opacity: .12; color: var(--gold); }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; position: relative;
  background: rgba(255,255,255,.12); border-radius: 14px; padding: 5px 12px 5px 8px;
  font-size: 13px; font-weight: 600;
}
.status-dot { width: 9px; height: 9px; border-radius: 5px; background: #4CC77A; box-shadow: 0 0 0 3px rgba(76,199,122,.3); }
.hero h1 { font-size: 26px; line-height: 1.15; margin-top: 8px; position: relative; }

/* Cards and sections */
.card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.next-card { margin: -48px 16px 0; padding: 16px; position: relative; display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font: 700 11px Poppins, sans-serif; letter-spacing: 1.5px; color: var(--accent); text-transform: uppercase; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chip { background: var(--gold-soft); color: var(--gold-text); font: 700 12px Poppins, sans-serif; padding: 4px 10px; border-radius: 10px; white-space: nowrap; }
.date-block { flex: 0 0 52px; border-radius: 12px; background: var(--maroon); text-align: center; padding: 7px 0; }
.date-block .m { font: 700 11px Poppins, sans-serif; letter-spacing: 1px; color: var(--gold); }
.date-block .d { font: 800 22px/1.1 Montserrat, sans-serif; color: #fff; }
.event-row { display: flex; gap: 14px; align-items: center; }
.event-title { font: 800 18px Montserrat, sans-serif; }
.muted { color: var(--text-2); font-size: 13px; }

.btn {
  flex: 1; min-height: 46px; border-radius: 12px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px Poppins, sans-serif; padding: 0 10px; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--crimson); color: #fff; border: 0; }
.btn-outline { background: var(--card); color: var(--text); border: 1.5px solid var(--line); }
.btn-outline svg { color: var(--accent); }
.btn-row { display: flex; gap: 10px; }

.section { padding: 20px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head h2 { font-size: 16px; color: var(--heading); }
.section-head a { font-size: 13px; font-weight: 600; text-decoration: none; }
.page-title { padding: 20px 16px 0; }
.page-title h1 { font-size: 24px; color: var(--heading); }
.page-title p { margin: 4px 0 0; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 18px 16px 0; }
.tile {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow); border: 0;
  padding: 14px 4px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--text); font: 600 13px Poppins, sans-serif; min-width: 0;
}
.tile-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--tint); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.tile-ico svg { width: 21px; height: 21px; }

.list { padding: 4px 16px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 18px; background: var(--gold-soft); color: var(--gold-text); display: flex; align-items: center; justify-content: center; }
.list-ico svg { width: 18px; height: 18px; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 15px; }
.score { font: 800 17px Montserrat, sans-serif; color: var(--heading); }

.status-dot.closed { background: var(--gold); box-shadow: 0 0 0 3px rgba(233,180,76,.3); }
.icon-btn.soft { background: var(--tint); color: var(--accent); }
.desc { margin-top: 4px; }
.link-row { text-decoration: none; color: var(--text); }

/* Loading placeholders */
.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--tint) 0%, var(--line-soft) 50%, var(--tint) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel-line { height: 14px; margin: 4px 0; width: 80%; }
.skel-line.short { width: 50%; }
.skel-circle { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 18px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* Empty and problem states */
.empty { padding: 20px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty p { margin: 0; }
.empty-title { font: 800 16px Montserrat, sans-serif; color: var(--heading); }
.empty .btn { flex: 0 0 auto; }

/* Results */
.day-head { font-size: 16px; color: var(--heading); }
.comp summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; min-height: 56px; }
.comp summary::-webkit-details-marker { display: none; }
.comp summary .list-main { display: flex; flex-direction: column; }
.comp summary .chev { width: 18px; height: 18px; color: var(--text-3); transition: transform .2s; }
.comp[open] summary .chev { transform: rotate(90deg); }
.result-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.result-table th { text-align: left; font: 700 11px Poppins, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); padding: 6px 16px; border-top: 1px solid var(--line-soft); }
.result-table td { padding: 9px 16px; border-top: 1px solid var(--line-soft); }
.result-table .num { text-align: right; font-weight: 700; color: var(--heading); }
.result-table tbody tr:first-child td { font-weight: 600; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.thumb-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.thumb { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--tint); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.viewer { position: fixed; inset: 0; z-index: 45; background: #0B0607; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
.viewer[hidden] { display: none; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; width: 48px; height: 48px; border-radius: 24px; border: 0; background: rgba(255,255,255,.16); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1; }
.viewer-close svg { width: 22px; height: 22px; }
.viewer-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px calc(16px + var(--safe-b)); background: rgba(11,6,7,.75); color: #E9DCDF; font-size: 13px; }
.viewer-cap .list-title { color: #fff; }

.menu-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); font-weight: 500; min-height: 52px; }
.menu-row:last-child { border-bottom: 0; }
.menu-row .chev { margin-left: auto; color: var(--text-3); width: 18px; height: 18px; }

.example-note { margin: 20px 16px 0; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line); font-size: 12px; color: var(--text-2); }

/* Sheet (simple dialog) */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(20,8,12,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-panel { background: var(--card); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 24px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.sheet-panel h2 { font-size: 20px; color: var(--heading); }
.sheet-panel p { margin: 0; color: var(--text-2); }

.sheet-panel .btn { flex: 0 0 auto; }
.notice { background: var(--gold-soft); color: var(--gold-text); border-radius: 12px; padding: 10px 14px; font-weight: 500; }
.sheet-panel .notice { color: var(--gold-text); }

/* Forms */
.field-label { font-weight: 600; font-size: 15px; display: block; }
.field-hint { font-weight: 400; color: var(--text-2); font-size: 13px; }
.field {
  width: 100%; min-height: 50px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--text); font: 400 16px Poppins, system-ui, sans-serif; padding: 10px 14px;
}
textarea.field { min-height: 110px; resize: vertical; line-height: 1.5; }
.field:focus { border-color: var(--accent); }
/* Date boxes: iPhones give them their own width and centre the date, so both are overridden here */
.date-wrap { position: relative; min-width: 0; }
input[type="date"].field { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 50px; text-align: left; line-height: 1.5; }
input[type="date"].field::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.5em; }
.date-hint { position: absolute; left: 15.5px; top: 0; height: 50px; display: flex; align-items: center; color: var(--text-3); font-size: 16px; pointer-events: none; }
.date-wrap:not(.no-date) .date-hint, .date-wrap:focus-within .date-hint { display: none; }
.date-wrap.no-date input:not(:focus) { color: transparent; }
.pin-box { min-height: 64px; text-align: center; font: 800 28px Montserrat, sans-serif; letter-spacing: 6px; }
.form { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.form .field { margin-bottom: 10px; }
.form-error { margin: 0; color: var(--accent); font-weight: 600; }
.sheet-panel .form-error { color: var(--accent); }
.btn-big { min-height: 54px; font-size: 16px; }
.btn[disabled] { opacity: .6; cursor: default; }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; text-decoration: none; }
.back-link .chev { width: 18px; height: 18px; transform: rotate(180deg); }
.done-ico { width: 52px; height: 52px; border-radius: 26px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.done-ico svg { width: 26px; height: 26px; stroke-width: 3; }
.empty .btn-row { align-self: stretch; flex-wrap: wrap; }
.empty .btn-row .btn { flex: 1 1 160px; white-space: normal; text-align: center; line-height: 1.3; padding: 10px 14px; }

/* Club Team */
.who { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.who .muted { font-size: 15px; }
.who .btn { flex: 0 0 auto; padding: 0 18px; }
.post-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.post-tiles .tile { cursor: pointer; font-size: 15px; padding: 18px 4px 16px; }
.post-tiles .tile-ico { width: 48px; height: 48px; border-radius: 14px; }
.post-tiles .tile-ico svg { width: 24px; height: 24px; }
button.menu-row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; text-align: left; font: 500 16px Poppins, sans-serif; }

/* Post results: one block per shooter */
.form-head { font-size: 16px; color: var(--heading); margin-top: 8px; }
.form .muted { margin: 0 0 4px; }
.rs-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px; gap: 0 10px; align-items: end; padding: 12px 0 2px; border-top: 1px solid var(--line-soft); }
.rs-row .field { margin-top: 4px; }
.rs-shooter { grid-column: 1 / 3; }
.rs-remove { grid-column: 3; width: 48px; height: 50px; border-radius: 12px; margin-bottom: 10px; }
.rs-member { grid-column: 1 / -1; margin: -4px 0 10px; display: flex; align-items: center; gap: 6px; color: var(--ok-text); font-weight: 600; font-size: 14px; }
.rs-member svg { width: 18px; height: 18px; stroke-width: 3; flex: 0 0 auto; }
.rs-class { grid-column: 1; }
.rs-score { grid-column: 2 / -1; }
.rs-place { display: inline-block; min-width: 40px; text-align: center; font-size: 13px; margin-right: 4px; }
.rs-tools { flex-wrap: wrap; margin: 10px 0; }
.rs-tools .btn { flex: 1 1 140px; }
@media (min-width: 600px) {
  .rs-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 48px; }
  .rs-shooter { grid-column: 1; grid-row: 1; }
  .rs-class { grid-column: 2; grid-row: 1; }
  .rs-score { grid-column: 3; grid-row: 1; }
  .rs-remove { grid-column: 4; grid-row: 1; }
  .rs-member { grid-row: 2; }
}

/* Add photos: thumbnails */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 4px 0 8px; }
.ph-tile { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--tint); }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-tile.failed { outline: 3px solid var(--accent); outline-offset: -3px; }
.ph-cover { position: absolute; inset: 0; border-radius: 0; }
.ph-remove { position: absolute; top: 0; right: 0; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ph-remove span { width: 30px; height: 30px; border-radius: 15px; background: rgba(20,8,12,.72); color: #fff; display: flex; align-items: center; justify-content: center; }
.ph-remove svg { width: 16px; height: 16px; stroke-width: 2.5; }
.ph-shade { position: absolute; inset: 0; background: rgba(20,8,12,.5); display: flex; align-items: flex-end; padding: 10px; }
.ph-bar { display: block; width: 100%; height: 8px; border-radius: 4px; background: rgba(255,255,255,.35); overflow: hidden; }
.ph-bar span { display: block; width: 40%; height: 100%; border-radius: 4px; background: var(--gold); animation: phSlide 1.1s ease-in-out infinite; }
@keyframes phSlide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .ph-bar span { animation: none; width: 100%; } }
.ph-mark { position: absolute; left: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 0 0 2px #fff; }
.ph-mark svg { width: 18px; height: 18px; stroke-width: 3; }
.ph-done { background: var(--green); }
.ph-failed { position: absolute; left: 0; right: 0; bottom: 0; background: var(--crimson); color: #fff; font: 700 13px Poppins, sans-serif; text-align: center; padding: 4px 2px; }
.ph-add { aspect-ratio: 1 / 1; border-radius: 12px; border: 2px dashed var(--line); background: none; color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 600 14px Poppins, sans-serif; padding: 4px; }
.ph-add.first { grid-column: 1 / -1; aspect-ratio: auto; min-height: 120px; font-size: 16px; }
#phSubmit[hidden] { display: none; }

/* Manage posts */
.seg { display: flex; gap: 6px; background: var(--tint); border-radius: 14px; padding: 5px; }
.seg button { flex: 1; min-height: 46px; border: 0; border-radius: 10px; background: none; color: var(--text); font: 600 15px Poppins, sans-serif; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--heading); font-weight: 700; box-shadow: var(--shadow); }
button.manage-row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text); text-align: left; cursor: pointer; min-height: 64px; }
button.manage-row:last-child { border-bottom: 0; }
.manage-row .list-main { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.manage-row .list-title { font: 600 15px Poppins, sans-serif; }
.manage-row .chev { flex: 0 0 18px; width: 18px; height: 18px; color: var(--text-3); }
.badge { display: inline-block; font: 700 12px Poppins, sans-serif; padding: 2px 10px; border-radius: 10px; white-space: nowrap; vertical-align: middle; }
.badge-everyone { background: var(--ok-soft); color: var(--ok-text); }
.badge-members { background: var(--gold-soft); color: var(--gold-text); }
.badge-committee { background: var(--maroon); color: #fff; }
.badge-hidden { background: var(--line); color: var(--text); }
.section > .btn { flex: 0 0 auto; }
.edit-photo { width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px; background: var(--tint); margin-bottom: 10px; }
.btn-danger { background: var(--card); color: var(--accent); border: 1.5px solid var(--accent); margin-top: 10px; }
.btn-danger-solid { background: var(--crimson); color: #fff; border: 0; }

/* "Who can see this?" choices */
.choices { border: 0; padding: 0; margin: 4px 0 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 6px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; min-height: 56px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice input { flex: 0 0 22px; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--crimson); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.choice-title { display: block; font-weight: 600; font-size: 15px; }
.choice-text { display: block; color: var(--text-2); font-size: 13px; }

/* Messages */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.count-badge { margin-left: 8px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--crimson); color: #fff; font: 700 13px/26px Poppins, sans-serif; text-align: center; }
.menu-row .count-badge + .chev { margin-left: auto; }
.msg-search { display: flex; gap: 8px; }
.msg-search .field { flex: 1; min-width: 0; }
.msg-search .btn { flex: 0 0 auto; min-height: 50px; padding: 0 18px; font-size: 15px; }
#msgList { display: flex; flex-direction: column; gap: 10px; }
#msgList > .btn { flex: 0 0 auto; }
.msg-list { padding: 0 14px; }
.msg-row { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); min-height: 64px; }
.msg-row:last-child { border-bottom: 0; }
.avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 20px; color: #fff; font: 700 17px/40px Montserrat, sans-serif; text-align: center; }
.msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-top { display: flex; align-items: baseline; gap: 8px; }
.msg-name { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-date { flex: 0 0 auto; font-size: 13px; color: var(--text-2); }
.msg-count { color: var(--text-2); font-weight: 400; font-size: 13px; }
.msg-subject { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-snippet { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-row.unread .msg-name, .msg-row.unread .msg-subject { font-weight: 700; }
.msg-row.unread .msg-date { color: var(--accent); font-weight: 700; }
.labs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lab { font: 700 12px Poppins, sans-serif; padding: 2px 10px; border-radius: 10px; white-space: nowrap; background: var(--line); color: var(--text); }
.lab-membership { background: var(--gold-soft); color: var(--gold-text); }
.lab-training { background: var(--info-soft); color: var(--info-text); }
.lab-range { background: var(--tint); color: var(--accent); }
.lab-replied { background: var(--ok-soft); color: var(--ok-text); }
.lab-tag { background: none; color: var(--text-2); border: 1.5px solid var(--line); padding: 1px 9px; font-weight: 600; }
.msg-title { font-size: 20px !important; overflow-wrap: anywhere; }
.msg-actions { flex-wrap: wrap; }
.msg-actions .btn { flex: 1 1 100px; }
.msg-card { padding: 14px 16px; }
.msg-from { font-weight: 600; overflow-wrap: anywhere; }
.msg-body { margin-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
select.field { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.reply-text { min-height: 220px !important; }
.gaps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); }
.gaps[hidden] { display: none; }
.gaps-title { flex: 1 1 100%; font-weight: 600; font-size: 14px; color: var(--gold-text); }
.gap { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--gold); background: var(--card); color: var(--text); font: 600 14px Poppins, sans-serif; cursor: pointer; overflow-wrap: anywhere; text-align: left; }

/* Admin */
.admin-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-count { flex: 1 1 150px; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); color: var(--text); text-decoration: none; font-weight: 500; }
.admin-count b { font: 800 20px Montserrat, sans-serif; color: var(--heading); }
.admin-count.amber { background: var(--gold-soft); color: var(--gold-text); }
.admin-count.amber b { color: var(--gold-text); }
.admin-count.red { background: var(--red); color: #fff; }
.admin-count.red b { color: #fff; }
.pay-card { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.pay-name { font-size: 18px; color: var(--heading); overflow-wrap: anywhere; }
.pay-total { font: 800 20px Montserrat, sans-serif; color: var(--heading); white-space: nowrap; }
.pay-ref { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; padding: 10px 14px; border-radius: 12px; background: var(--gold-soft); }
.pay-ref .muted { color: var(--gold-text); font-weight: 600; }
.pay-ref b { font: 800 18px Montserrat, sans-serif; letter-spacing: 1px; color: var(--text); overflow-wrap: anywhere; }
.pay-contact { overflow-wrap: anywhere; }
.pay-card .btn { flex: 0 0 auto; margin-top: 8px; }
#memList { display: flex; flex-direction: column; gap: 10px; }
#memList > .btn { flex: 0 0 auto; }
#memList > p { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { min-height: 44px; padding: 6px 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); font: 600 14px Poppins, sans-serif; cursor: pointer; text-align: left; }
.chip-btn[aria-pressed="true"] { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.mem-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.mem-row:last-child { border-bottom: 0; }
.mem-row .list-main { flex: 1 1 150px; }
.mem-row .list-title { overflow-wrap: anywhere; }
.mem-row.not-financial { border-left: 4px solid var(--red); padding-left: 10px; margin-left: -14px; }
.mem-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.mbadge { font: 700 12px Poppins, sans-serif; padding: 3px 10px; border-radius: 10px; white-space: nowrap; }
.mbadge-ok { background: var(--ok-soft); color: var(--ok-text); }
.mbadge-amber { background: var(--gold-soft); color: var(--gold-text); }
.mbadge-red { background: var(--red); color: #fff; }
.mbadge-red-line { background: none; color: var(--red-text); border: 2px solid var(--red); padding: 1px 8px; }
.mbadge-grey { background: var(--line); color: var(--text); }
.mbadge-maroon { background: var(--maroon); color: #fff; }
.notice-red { background: var(--red); color: #fff !important; }
.pin-once { background: var(--gold-soft); color: var(--text); border: 2px solid var(--gold); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; text-align: center; font-weight: 500; }
.pin-digits { font: 800 40px Montserrat, sans-serif; letter-spacing: 6px; color: var(--heading); overflow-wrap: anywhere; }
.pin-once .btn { flex: 0 0 auto; }
#personForm > .choice { margin-bottom: 10px; }
#ppPinWrap[hidden] { display: none; }

/* Tab bar with the Club Team tab: tabs share the width by label length so all six stay readable */
.tabbar a[hidden] { display: none; }
.tabbar.six a { flex: 1 1 auto; max-width: none; padding: 0 2px; }
.tabbar.six .tab-ico { padding: 4px 10px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Larger screens: a bit more room */
@media (min-width: 720px) {
  .tiles { gap: 14px; }
  .hero h1 { font-size: 30px; }
}
