:root {
  --bg: #f4f6f4; --card: #fff; --ink: #1c2a22; --muted: #66756c; --line: #dfe5e0;
  --green: #0b6b3a; --green-d: #08522c; --green-l: #e4f2ea;
  --amber: #8a5a00; --amber-l: #fff3d6; --red: #a12622; --red-l: #fde8e7;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45; }
h1 { font-size: 1.5rem; margin: .2rem 0 .6rem; } h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
a { color: var(--green); } a:hover { color: var(--green-d); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 1rem; }
.muted { color: var(--muted); } .center { text-align: center; } .pad { padding: 2rem 0; }
small { display: block; }
.plain { list-style: none; margin: 0; padding: 0; } .plain > li { padding: .6rem 0; border-top: 1px solid var(--line); } .plain > li:first-child { border-top: 0; }

/* header */
#top { background: var(--green); color: #fff; }
.bar { max-width: 1180px; margin: 0 auto; padding: .6rem 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.nav-link { color: #e6f4ec; text-decoration: none; padding: .3rem .6rem; border-radius: 6px; } .nav-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.who { display: flex; align-items: center; gap: .6rem; font-size: .9rem; margin-left: auto; } .who .muted, .who-name { color: #cfe8d9; } .who-name { text-decoration: none; } .who-name:hover { color: #fff; text-decoration: underline; }
.demo-banner { background: #ffe9a8; color: #5c4300; font-size: .88rem; padding: .35rem 1rem; text-align: center; }
.demo-banner .link { color: #5c4300; }

/* components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
.card.narrow, form.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.round-card { text-decoration: none; color: inherit; display: block; margin: 0; } .round-card:hover { border-color: var(--green); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.btn { display: inline-block; font: inherit; padding: .5rem .9rem; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--green); color: var(--green-d); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; } .btn.primary:hover { background: var(--green-d); color: #fff; }
.btn.wide { width: 100%; padding: .7rem; font-weight: 600; }
.btn.danger { color: var(--red); } .btn.small { padding: .25rem .6rem; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }
.chip { display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; background: #eef1ee; color: #3a4a40; margin-right: .35rem; white-space: nowrap; }
.chip.ok { background: var(--green-l); color: var(--green-d); } .chip.warn { background: var(--amber-l); color: var(--amber); }
.chip.grade { background: #1c2a22; color: #fff; min-width: 2.2rem; text-align: center; }
.notice { padding: .6rem .8rem; border-radius: 8px; background: #eef1ee; margin: 0 0 1rem; }
.notice.ok { background: var(--green-l); } .notice.warn { background: var(--amber-l); color: var(--amber); } .notice.err { background: var(--red-l); color: var(--red); }
.summary { margin: 0 0 1rem; display: flex; gap: .4rem; flex-wrap: wrap; }

/* forms */
label { display: block; margin: .7rem 0; font-weight: 500; }
label.inline { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; margin: .2rem .8rem .2rem 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea { display: block; width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid #c8d1cb; border-radius: 8px; background: #fff; margin-top: .25rem; }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; accent-color: var(--green); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checks { margin: .3rem 0 .8rem; }
fieldset.day { border: 1px solid var(--line); border-radius: 8px; margin: .6rem 0; padding: .5rem .8rem .8rem; } fieldset.day legend { font-weight: 600; padding: 0 .3rem; }
.seg { display: flex; gap: .4rem; flex-wrap: wrap; }
.seg-opt { margin: 0; position: relative; } .seg-opt input { position: absolute; opacity: 0; }
.seg-opt span { display: block; padding: .5rem 1rem; border: 1px solid #c8d1cb; border-radius: 8px; cursor: pointer; background: #fff; }
.seg-opt input:checked + span { color: #fff; font-weight: 600; }
.seg-opt.yes input:checked + span { background: var(--green); border-color: var(--green); }
.seg-opt.maybe input:checked + span { background: #b07a00; border-color: #b07a00; }
.seg-opt.no input:checked + span { background: var(--red); border-color: var(--red); }
.seg-opt input:focus-visible + span { outline: 3px solid #9cc9ae; }
.toggles { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.toggle { display: flex; gap: .5rem; align-items: flex-start; margin: 0; } .toggle small { font-weight: 400; }
.toolbar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; } .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem .8rem; } .grade-grid select { width: auto; margin: 0; }

/* tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 0 0 1rem; flex-wrap: wrap; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: .5rem .9rem; color: var(--muted); text-decoration: none; font: inherit; cursor: pointer; }
.tab.active { color: var(--green-d); border-bottom-color: var(--green); font-weight: 600; } .tab.right { margin-left: auto; }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.board th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: .4rem .5rem; border-bottom: 2px solid var(--line); }
.board td { padding: .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.board tr.needs td:last-child { background: #fffaf0; } .board tr.removed td { opacity: .55; text-decoration: line-through; }
.board td input:not([type=checkbox]) { margin: 0; min-width: 8rem; }
.day-block + .day-block { margin-top: .5rem; } .day-label { font-size: .78rem; color: var(--muted); margin-bottom: .15rem; }
.slot-wrap { display: flex; align-items: center; gap: .3rem; margin: .15rem 0; }
select.slot { min-width: 13rem; margin: 0; } select.slot.empty { border-color: #e0b44c; background: #fffaf0; } select.n-slots { width: auto; margin: 0; }
.warn-icon { color: var(--amber); cursor: help; font-size: 1.1rem; }
.change { font-size: .82rem; color: var(--amber); margin-top: .15rem; }
td.av { text-align: center; font-weight: 700; } td.av.ok { color: var(--green); background: var(--green-l); } td.av.maybe { color: var(--amber); background: var(--amber-l); } td.av.no { color: var(--red); background: var(--red-l); } td.av.none { color: #aaa; }

/* availability page */
.narrow-page { max-width: 640px; margin: 0 auto; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem .3rem; margin: .8rem 0; background: #fff; }
.tile h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.drow { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlabel { font-weight: 500; }
.opts { display: flex; gap: .4rem; }
.opt { font: inherit; padding: .55rem .9rem; min-width: 7.5rem; border: 1px solid #c8d1cb; border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
.opt.yes.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.opt.no.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); margin: .8rem -1rem -1rem; padding: .7rem 1rem; border-radius: 0 0 10px 10px; }
.savebar .btn { padding: .6rem 1.6rem; font-weight: 600; }

/* appointments */
.appt { display: grid; gap: .15rem; } .appt-date { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }

/* report */
.report-section { margin: 0 0 1.6rem; }
.report-section h2 { text-align: center; font-size: 1.05rem; background: #fff; padding: .3rem; margin: 0 0 .3rem; }
.report-table { background: #fff; font-size: .85rem; } .report-table th { background: #d9e8f7; text-align: left; padding: .3rem .5rem; border: 1px solid #aab; }
.report-table td { padding: .3rem .5rem; border: 1px solid #ccd; } .report-table td.gap { background: #ffe9e6; }

/* toasts */
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 50; max-width: min(92vw, 380px); }
.toast { background: #1c2a22; color: #fff; padding: .6rem .9rem; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25); white-space: pre-line; } .toast.err { background: #b3261e; } .toast.ok { background: #1e6b45; } .toast.warn { background: #f5b43c; color: #2b1d00; }

@media (max-width: 640px) {
  .opts { width: 100%; } .opt { flex: 1; min-width: 0; }
  .wrap { padding: .6rem; } .grid2 { grid-template-columns: 1fr; } select.slot { min-width: 10rem; }
  /* Brand and account menu share the top row; the officer's links wrap underneath. */
  .bar { gap: .4rem 1rem; } .who { order: 2; } .nav { order: 3; flex-basis: 100%; }
  .who-label { display: none; }
}

@media print {
  body { background: #fff; } #top, .noprint, #toasts { display: none !important; }
  .wrap { max-width: none; padding: 0; } .report-section { break-inside: avoid; }
  .report-table th { background: #d9e8f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-table td.gap { background: #ffe9e6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* availability: one section per competition */
/* Each group is its own panel: a solid header band and a tinted body, with clear space between groups. */
.comp-section { border: 2px solid var(--green); border-radius: var(--radius); background: var(--green-l); overflow: hidden; }
.comp-section + .comp-section { margin-top: 36px; }
.comp-head { align-items: center; margin: 0; padding: 10px 14px; background: var(--green); }
.comp-title { margin: 0; font-size: 1.15rem; color: #fff; }
.comp-head .link { font-size: .9rem; color: #fff; }
.comp-section > :not(.comp-head) { margin: 12px; }

.dnote { display: block; font-weight: 400; color: var(--muted, #666); font-size: .8rem; line-height: 1.25; margin-top: 2px; }

/* rounds home: one tile per competition */
.comp-tile { display: flex; flex-direction: column; gap: .35rem; margin: 0; }
.comp-tile h2 { margin: 0; }
.comp-tile.empty { opacity: .7; }
.tile-body { display: block; text-decoration: none; color: inherit; padding: .25rem 0 .1rem; }
.tile-body:hover .tile-round { color: var(--green); }
.tile-round { font-size: 1.25rem; font-weight: 600; }
.tile-starts { margin: .25rem 0 .5rem; }
.tile-starts li { margin: .15rem 0; padding: 0; border: 0; }
.tile-starts .tile-round { font-size: 1.05rem; }
.tile-stats { margin-top: .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.btn.small { padding: .25rem .7rem; font-size: .85rem; }

/* select grades popup */
dialog.modal { border: 0; border-radius: 12px; padding: 1.1rem 1.2rem; width: min(440px, 94vw); max-height: 86vh; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(0,0,0,.4); }
dialog.modal h2 { margin: 0 0 .25rem; }
.grade-list { margin: .5rem 0; max-height: 52vh; overflow: auto; border-top: 1px solid var(--line, #e3e8e4); }
.grade-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .1rem; border-bottom: 1px solid var(--line, #e3e8e4); cursor: pointer; }
.grade-row .muted { flex: 1; }
.grade-row input[type=checkbox] { width: 1.15rem; height: 1.15rem; }
.grade-row select { width: auto; padding: .2rem .4rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .6rem; }

.set-break { border: 0; border-top: 2px solid var(--line, #d9ded9); margin: 22px 0 18px; }
.load-more { display: flex; justify-content: center; margin: 22px 0 8px; }

.season-grid { max-height: 72vh; overflow: auto; }
.season-grid table { border-collapse: separate; border-spacing: 0; width: auto; }
.season-grid th, .season-grid td { white-space: nowrap; text-align: center; padding: .3rem .35rem; }
.season-grid thead th { position: sticky; top: 0; background: var(--card); z-index: 2; text-transform: none; color: var(--ink); border-bottom: 0; }
.season-grid thead tr:nth-child(2) th { top: 1.9rem; border-bottom: 2px solid var(--line); }
.season-grid tr.months th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); height: 1.9rem; }
.season-grid .stick { position: sticky; left: 0; background: var(--card); z-index: 1; font-weight: 600; text-align: left; padding-right: 1rem; }
.season-grid thead .stick { z-index: 3; }
.season-grid .sub { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; }
.season-grid .datebtn { background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: .15rem .45rem; border-radius: 8px; color: inherit; }
.season-grid .datebtn:hover, .season-grid th.on .datebtn { background: var(--green-l); }
.season-grid tr.counts td { font-weight: 600; color: var(--muted); background: #f6f8f6; font-size: .85rem; }
.season-grid td.av { padding: 2px; background: none; }
.season-grid .avbtn { position: relative; width: 2.3rem; height: 2rem; border: 0; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; background: #f1f3f1; color: inherit; }
.season-grid td.av.ok .avbtn { background: var(--green-l); color: var(--green); }
.season-grid td.av.no .avbtn { background: var(--red-l); color: var(--red); }
.season-grid .avbtn:hover { outline: 2px solid var(--line); }
.season-grid .avbtn.edited::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.season-grid .past { opacity: .5; }
.season-grid .tally { font-weight: 400; font-size: .75rem; }
.grid-search { max-width: 12rem; margin: 0; }
.summary .right { margin-left: auto; }
button.chip { border: 0; cursor: pointer; font: inherit; font-size: .8rem; }
.small { font-size: .8rem; }
.summary { align-items: center; }
.past-rounds { margin-top: 1.5rem; } .past-rounds summary { cursor: pointer; font-weight: 600; }
.past-row { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; text-decoration: none; color: inherit; }
.past-row strong { min-width: 6.5rem; }
.org-name { color: #fff; opacity: .9; font-size: .85rem; text-decoration: none; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: .15rem .6rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-name:hover { opacity: 1; background: rgba(255,255,255,.12); }
.org-tile { text-align: left; cursor: pointer; font: inherit; } .org-tile h2 { margin: 0 0 .3rem; }
.join-link { word-break: break-all; background: #f1f3f1; padding: .3rem .5rem; border-radius: 6px; display: inline-block; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; } .inline-form input { margin: 0; max-width: 20rem; }
.card.narrow.left { margin-left: 0; }
.members .in-sm { min-width: 7rem; } .members .in-dob { min-width: 8.5rem; } .members .in-addr { min-width: 18rem; }
.members input { margin: 0; }
.two-up { display: flex; gap: .75rem; } .two-up label { flex: 1; }
@media (max-width: 520px) { .two-up { display: block; } }
.type-rows { display: grid; gap: .4rem; }
.type-row { display: flex; gap: .5rem; align-items: center; }
.type-row input { margin: 0; } .type-row input:first-child { flex: 1; max-width: 18rem; } .type-row input[type=number] { width: 7rem; }
.member-type { display: flex; gap: .35rem; align-items: center; } .member-type .fee { font-size: .8rem; }
.members select { margin: 0; min-width: 9rem; }
.dropouts ul { margin: .4rem 0; } .dropouts a { color: inherit; }
.daymonth { display: flex; gap: .5rem; } .daymonth select { margin: 0; }
.appt-action { margin: 0; }
.appt-game { display: grid; gap: .2rem; }
.appt-days { display: grid; gap: .35rem; margin-top: .4rem; }
.appt-days .appt { padding: .35rem .6rem; background: #f6f8f6; border-radius: 8px; align-items: center; gap: .5rem; flex-wrap: wrap; }
.appt.declined { opacity: .7; }
.publish { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.import-card summary { cursor: pointer; font-weight: 600; }
.import-card textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .8rem; }
.import-out { margin-top: .6rem; } .import-out table { font-size: .85rem; }
.season-grid tr.nonmember .stick { font-weight: 500; }
.chip.tag { margin-left: .4rem; font-size: .7rem; }
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ' \25be'; }
.menu-items { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 11rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: .3rem; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: grid; }
.menu-items .nav-link { color: var(--ink); padding: .45rem .6rem; border-radius: 7px; opacity: 1; }
.menu-items .nav-link:hover { background: var(--green-l); }
.who-menu .menu-items { left: auto; right: 0; min-width: 13rem; max-width: calc(100vw - 1.5rem); }
.who-menu > summary { display: flex; align-items: center; gap: .45rem; padding: .2rem .35rem; border-radius: 999px; }
.who-menu > summary:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; background: #fff; color: var(--green); display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; }
.menu-head { display: grid; padding: .45rem .6rem .35rem; color: var(--ink); overflow-wrap: anywhere; } .menu-head .muted { color: var(--muted); }
.menu-items hr { border: 0; border-top: 1px solid var(--line); margin: .25rem 0; width: 100%; }
.menu-signout { background: none; border: 0; text-align: left; font: inherit; cursor: pointer; color: var(--red) !important; }
.mode { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; cursor: pointer; }
.mode input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; }
.mode > span { display: grid; gap: .1rem; }
.player-card:empty { display: none; }
.chooser { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.chooser h3 { margin: .2rem 0 .5rem; font-size: 1rem; }
.chooser-pick { display: flex; gap: .5rem; flex-wrap: wrap; } .chooser-pick select { margin: 0; }
.pick-list { max-height: 26rem; overflow: auto; margin-top: .5rem; }
.pick-row { display: grid; gap: .25rem; }
.pick-row.chosen { background: var(--green-l); border-radius: 8px; padding-left: .5rem; padding-right: .5rem; }
.pick-row .opts { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.my-picks li { gap: .5rem; }
.chip.pu { background: #ede7f6; color: #4a2c82; font-size: .7rem; margin-left: .3rem; }
.pu-note ul { margin: .4rem 0 0; }
.warn-text { color: var(--amber, #8a5a00); }
/* The save bar now sits below the cards (one Save for availability and chosen games), not inside one. */
.narrow-page > .savebar { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.comp-picks { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: -.2rem 0 .4rem 1.8rem; }
.comp-pick { display: inline-flex; gap: .35rem; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; cursor: pointer; font-size: .9rem; }
.comp-pick.on { background: var(--green-l); border-color: var(--green); color: var(--green-d); font-weight: 600; }
.comp-pick input { margin: 0; }
.comp-picks.flush { margin-left: 0; }
.avail-body { margin-top: .4rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.avail-body:empty, .avail-body[hidden] { display: none; }
.card > .row-between > .mode { padding: 0; }
.player-card h3 { margin: .8rem 0 .3rem; font-size: 1rem; }
.avail-body { margin-top: 0; border-top: 0; padding-top: 0; }
.player-card[hidden], .savebar[hidden] { display: none; }
.savebar .btn:disabled { opacity: .45; cursor: default; }
.mode-row { align-items: flex-start; } .mode-row .chip { margin-top: .6rem; }
.chip[hidden] { display: none; }
.mode-row { flex-wrap: nowrap; gap: .6rem; } .mode-row .mode { flex: 1; min-width: 0; } .mode-row .chip { flex: none; }
.comp-list { display: grid; gap: .35rem; margin: .1rem 0 .6rem 1.8rem; }
.comp-list.flush { margin-left: 0; }
.comp-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.comp-row .comp-pick { min-width: 6.5rem; }
.chip.muted-chip { background: #f1f3f1; color: var(--muted); }
.chip.new { background: #e3ecfb; color: #1d4f9c; font-weight: 600; }
.other-orgs .my-summary { margin-top: 16px; }
.comp-row .comp-pick { margin: 0; }
.drow.missing { background: #fdecea; border-radius: 8px; box-shadow: inset 3px 0 0 var(--red, #b3261e); padding-left: .5rem; }
.mode-head { margin: .6rem 0 .3rem; font-size: 1rem; }
td.av.pu { font-weight: 400; background: #f5f1fb; } td.av.pu .chip.pu { margin-left: 0; }
.avail-form[hidden], .my-summary[hidden] { display: none; }
.avail-form > .savebar { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.savebar-btns { display: flex; gap: .5rem; }
.savebar .btn[hidden] { display: none; }
.summary-list > li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.summary-list > li:last-child { border-bottom: 0; }
.summary-list ul { margin-top: .3rem; }
/* member profile */
a.member-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a.member-link:hover { text-decoration-color: currentColor; }
.member-profile .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.member-profile .stat { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; display: flex; flex-direction: column; }
.member-profile .stat strong { font-size: 1.5rem; line-height: 1.2; }
.member-profile .kv { display: grid; grid-template-columns: 11rem 1fr; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.member-profile .kv:last-of-type { border-bottom: 0; }
.member-profile .avail-line { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.member-profile .avail-line:last-child { border-bottom: 0; }
.member-profile .date-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.member-profile .chip.no { background: #fbeaea; color: #8a2a2a; }
.member-profile .appt-list > li { padding: .45rem 0; border-bottom: 1px solid var(--line); gap: .5rem; flex-wrap: wrap; }
.member-profile .appt-list > li:last-child { border-bottom: 0; }
@media (max-width: 560px) { .member-profile .kv { grid-template-columns: 1fr; gap: .1rem; } }
.member-profile input[type=date] { max-width: 11rem; }
.member-profile .date-btn { cursor: pointer; border: 1px solid transparent; font: inherit; font-size: .8rem; }
.member-profile .date-btn:hover { border-color: currentColor; }
.member-profile .date-btn:disabled { opacity: .6; cursor: progress; }
.member-profile .status-box { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.board tr.inactive td { opacity: .6; }
.member-profile .date-btn.readonly { cursor: default; opacity: 1; }
.member-profile .date-btn.readonly:hover { border-color: transparent; }
.member-mail { display: flex; flex-wrap: wrap; gap: .5rem; }
.member-profile .section-head { margin: 1.4rem 0 .6rem; font-size: 1.15rem; }
.member-profile .assoc-card .stats { margin: .8rem 0 .4rem; }
.member-profile .assoc-card details { border-top: 1px solid var(--line); padding: .6rem 0 .2rem; }
.member-profile .assoc-card summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.member-profile .assoc-card input[type=date] { max-width: 11rem; }
/* Allocate: one section per week */
.week { margin: 1.4rem 0 .4rem; }
.week-head { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.week-head h2 { margin: 0; font-size: 1.2rem; }
.continuing { margin: 0 0 .6rem; font-size: .9rem; }
.continuing li { margin: .15rem 0; }

/* ---------- phones: tables that are lists of things become one card per row ---------- */
@media (max-width: 640px) {
  .alloc-board thead, .grades-table thead, table.members thead { display: none; }
  .alloc-board, .alloc-board tbody, .grades-table, .grades-table tbody, table.members, table.members tbody { display: block; width: 100%; }
  .alloc-board tr, .grades-table tr, table.members tr { display: grid; gap: .3rem .6rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .alloc-board td, .grades-table td, table.members td { display: block; padding: 0; border: 0; min-width: 0; }
  .alloc-board td select, .grades-table td select { width: 100%; max-width: none; }

  /* Assign board: grade and fixture, the ground under the fixture, then the allocation and umpires full width. */
  .alloc-board tr { grid-template-columns: auto 1fr; }
  .alloc-board td:nth-child(3) { grid-column: 2; }
  .alloc-board td:nth-child(4), .alloc-board td:nth-child(5) { grid-column: 1 / -1; }
  .alloc-board td:nth-child(5)::before { content: 'Umpires needed'; display: block; font-size: .78rem; color: var(--muted); margin-bottom: .15rem; }

  /* Settings grades: the grade and competition, then Group and Umpires side by side. */
  .grades-table tr { grid-template-columns: 2fr 1fr; }
  .grades-table td:nth-child(1), .grades-table td:nth-child(2) { grid-column: 1 / -1; }
  .grades-table td:nth-child(3)::before { content: 'Group'; } .grades-table td:nth-child(4)::before { content: 'Umpires'; }
  .grades-table td:nth-child(3)::before, .grades-table td:nth-child(4)::before { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .15rem; }

  /* Members: the Active tick beside the name, the rest under the name. */
  table.members tr { grid-template-columns: auto 1fr; align-items: center; }
  table.members td:nth-child(n+3) { grid-column: 2; }
  table.members td:nth-child(3)::before { content: 'Umpiring '; } table.members td:nth-child(4)::before { content: 'Membership '; }
  table.members td:nth-child(3)::before, table.members td:nth-child(4)::before { color: var(--muted); font-size: .8rem; }
  table.members td:nth-child(5):not(:empty)::before { content: 'Membership type'; display: block; color: var(--muted); font-size: .78rem; margin-bottom: .15rem; }

  /* Membership types: the name on its own line, fee and Remove under it. */
  .type-row { flex-wrap: wrap; } .type-row input:first-child { flex: 1 1 100%; max-width: none; }
}

/* Sign-up: umpire or member only, as two big choices that fit a phone. */
.field-label { margin: .8rem 0 .3rem; font-weight: 600; }
.role-pick { display: grid; gap: .5rem; margin-bottom: 1rem; }
.role { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.role:has(input:checked) { border-color: var(--green); background: var(--green-l); }
.role input { margin-top: .2rem; } .role > span { display: grid; gap: .1rem; }

/* Members: applications and the import steps. */
.application { display: grid; gap: .3rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.app-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.member-filter { flex-wrap: wrap; margin-bottom: .5rem; }
.import-step { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
.import-step textarea { width: 100%; }
.import-preview li { padding: .3rem 0; border-bottom: 1px solid var(--line); gap: .5rem; flex-wrap: wrap; }
.import-step .import-card { border: 0; padding: 0; box-shadow: none; }

/* Members list: search and show, bulk actions on ticked rows, tags you click to change. */
.member-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.member-tools { align-items: center; }
.member-tools .member-search { flex: 0 1 22rem; width: auto; margin: 0; }
.member-tools select { flex: 0 0 auto; width: auto; margin: 0; }
@media (max-width: 640px) { .member-tools .member-search { flex: 1 1 100%; } }
.status-box { display: contents; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .5rem .6rem; margin-bottom: .6rem; background: var(--green-l); border-radius: var(--radius); }
button.tagbtn { border: 0; cursor: pointer; font: inherit; font-size: .85rem; }
button.tagbtn:hover { outline: 2px solid currentColor; outline-offset: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.status-line { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
/* Short pickers stay short on wide screens. */
.member-profile .kv select, table.members .member-type select { max-width: 16rem; }
@media (max-width: 640px) { table.members .member-type select { max-width: none; } }
