/* Club Minutes. Every colour is a variable: light by default, dark when the device prefers it or the
   member picks it (name menu → Theme; saved in the browser as data-theme on <html>). */
:root {
  color-scheme: light;
  --bg: #eff5f7; --surface: #ffffff; --surface-2: #edf3f6; --surface-3: #dee8f0;
  --border: #d7e1e5; --border-strong: #bfccd4; --text: #161a20; --muted: #545e68; --faint: #79848e;
  --accent: #234976; --accent-strong: #182c41; --accent-soft: #d7e4f1; --accent-text: #192760;
  --btn-bg: #182c41; --btn-text: #ffffff; --btn-hover: #23405f;
  --danger: #b3261e; --danger-soft: #fbe4e2; --danger-text: #8c1d18;
  --warn-soft: #fff1c9; --warn-text: #6a4a00; --warn-edge: #d9a520;
  --info-soft: #e3e8f3; --ai: #6b5fb5; --ai-soft: #f1effb;
  --nav-bg: #15283e; --nav-text: #e0edf6; --nav-hover: rgba(255, 255, 255, .12); --nav-on: rgba(255, 255, 255, .2);
  --focus: rgba(39, 85, 130, .28); --mark: #fbe58a; --sheet-h: #95c0dc;
  --inperson-bg: #c0d9ef; --inperson-edge: #4177a9; --online-bg: #d6e4f7; --online-edge: #5a86c4;
  --chart-1: #2a78d6; --chart-2: #eb6834; --chart-3: #1baf7a; --chart-4: #eda100; --chart-5: #e87ba4; --chart-6: #008300; --chart-7: #6250d6; --chart-8: #e34948;  /* chart series, checked for colour blindness */
  --shadow: 0 1px 2px rgba(20, 30, 10, .06), 0 4px 16px rgba(20, 30, 10, .05);
  --shadow-pop: 0 10px 30px rgba(20, 30, 10, .18);
  --radius: .8rem; --radius-sm: .55rem;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101014; --surface: #16191f; --surface-2: #1c1f26; --surface-3: #242932;
  --border: #282d36; --border-strong: #373f4c; --text: #dae4ec; --muted: #94a0ad; --faint: #717b88;
  --accent: #5f95ce; --accent-strong: #82aee1; --accent-soft: #162435; --accent-text: #82aee1;
  --btn-bg: #5f95ce; --btn-text: #0c1117; --btn-hover: #80abde;
  --danger: #ff8a80; --danger-soft: #3b1e1b; --danger-text: #ffb4ab;
  --warn-soft: #3a3116; --warn-text: #f2d68c; --warn-edge: #b38a1c;
  --info-soft: #23304a; --ai: #a99cf0; --ai-soft: #262237;
  --nav-bg: #11151c; --nav-text: #d4e1ec; --nav-hover: rgba(255, 255, 255, .08); --nav-on: rgba(255, 255, 255, .14);
  --focus: rgba(95, 149, 206, .3); --mark: #6b5a12; --sheet-h: #1d314880;
  --inperson-bg: #182941; --inperson-edge: #4177a9; --online-bg: #1e2f47; --online-edge: #5a86c4;
  --chart-1: #3987e5; --chart-2: #d95926; --chart-3: #199e70; --chart-4: #c98500; --chart-5: #d55181; --chart-6: #008300; --chart-7: #9085e9; --chart-8: #e66767;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101014; --surface: #16191f; --surface-2: #1c1f26; --surface-3: #242932;
    --border: #282d36; --border-strong: #373f4c; --text: #dae4ec; --muted: #94a0ad; --faint: #717b88;
    --accent: #5f95ce; --accent-strong: #82aee1; --accent-soft: #162435; --accent-text: #82aee1;
    --btn-bg: #5f95ce; --btn-text: #0c1117; --btn-hover: #80abde;
    --danger: #ff8a80; --danger-soft: #3b1e1b; --danger-text: #ffb4ab;
    --warn-soft: #3a3116; --warn-text: #f2d68c; --warn-edge: #b38a1c;
    --info-soft: #23304a; --ai: #a99cf0; --ai-soft: #262237;
    --nav-bg: #11151c; --nav-text: #d4e1ec; --nav-hover: rgba(255, 255, 255, .08); --nav-on: rgba(255, 255, 255, .14);
    --focus: rgba(95, 149, 206, .3); --mark: #6b5a12; --sheet-h: #1d314880;
    --inperson-bg: #182941; --inperson-edge: #4177a9; --online-bg: #1e2f47; --online-edge: #5a86c4;
    --chart-1: #3987e5; --chart-2: #d95926; --chart-3: #199e70; --chart-4: #c98500; --chart-5: #d55181; --chart-6: #008300; --chart-7: #9085e9; --chart-8: #e66767;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, .55);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
body { margin: 0; font: 15.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
main { max-width: 68rem; margin: 1.8rem auto 3rem; padding: 0 1.1rem; }
h1 { font-size: 1.75rem; letter-spacing: -.015em; margin: .2rem 0 .8rem; }
h2 { font-size: 1.2rem; letter-spacing: -.01em; margin: 1.6rem 0 .6rem; } h3 { font-size: 1.02rem; }
a { color: var(--accent-text); } a:hover { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .hint { color: var(--muted); font-size: .88rem; }
.cs { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
mark { background: var(--mark); color: inherit; border-radius: .2rem; padding: 0 .1rem; }
code { background: var(--surface-3); border-radius: .3rem; padding: .05rem .35rem; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); }

/* form fields everywhere */
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=time], input[type=number], input:not([type]),
select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: .45rem .65rem; }
fieldset { min-width: 0; }  select { max-width: 100%; }  /* long option text ("Every year on the 1st Thursday of January") mustn't widen a phone page */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
textarea { resize: vertical; line-height: 1.45; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .35rem; background: var(--btn-bg); color: var(--btn-text);
  padding: .45rem .95rem; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; border: 1px solid transparent;
  transition: background .15s, border-color .15s; }
.btn:hover { background: var(--btn-hover); color: var(--btn-text); }
.btn.ghost { background: transparent; color: var(--accent-text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
button.btn { cursor: pointer; font: inherit; font-weight: 500; } .btn.small { padding: .25rem .65rem; font-size: .86rem; }
.btn.big { display: flex; justify-content: center; width: 100%; padding: .8rem; font-size: 1.05rem; cursor: pointer; }
.btn.warn { background: #8a3b12; color: #fff; }
button.act { font: inherit; font-size: .86rem; padding: .25rem .8rem; border: 1px solid var(--border-strong); border-radius: 1rem;
  background: var(--surface); color: var(--text); cursor: pointer; transition: background .15s; }
button.act:hover { background: var(--accent-soft); } button.act.on { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
button.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .85rem; padding: 0 .2rem; }
button.linkbtn:hover { color: var(--danger); } button.linkbtn.more { color: var(--accent-text); margin-bottom: .2rem; }

/* badges, chips, messages */
.badge { font-size: .74rem; font-weight: 600; padding: .08rem .5rem; border-radius: 1rem; background: var(--info-soft); color: var(--text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); } .badge.ai { background: var(--ai); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--surface-3); border-radius: 1rem; padding: .12rem .65rem; font-size: .84rem; }
.chip a { color: inherit; text-decoration: none; } .chip a:hover { text-decoration: underline; }
.chip.late { background: var(--danger-soft); color: var(--danger-text); font-weight: 600; } .chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip.ok { background: var(--accent-soft); color: var(--accent-text); }
.msg { padding: .7rem .9rem; border-radius: var(--radius-sm); text-align: left; border: 1px solid transparent; }
.msg.ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.msg.err { background: var(--danger-soft); color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.msg.warn { background: var(--warn-soft); color: var(--warn-text); border-color: var(--warn-edge); }
.note { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .95rem; line-height: 1.4; }
.note.ok { background: var(--accent-soft); } .note.err { background: var(--danger-soft); color: var(--danger-text); }
.missed { color: var(--danger); }

/* ---------- top bar ---------- */
nav.top { position: sticky; top: 0; z-index: 30; display: flex; gap: .25rem; align-items: center; padding: .5rem 1.1rem;
  background: var(--nav-bg); flex-wrap: wrap; box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
nav.top a { color: var(--nav-text); text-decoration: none; padding: .35rem .62rem; border-radius: .5rem; font-size: .95rem; transition: background .15s; }
nav.top a:hover { background: var(--nav-hover); } nav.top a.on { background: var(--nav-on); box-shadow: inset 0 -2px 0 var(--accent); }
nav.top .brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; margin-right: .8rem; padding-left: 0; font-size: 1.02rem; }
nav.top .brand:hover { background: none; } nav.top .brand img { width: 30px; }
nav.top input[type=search] { padding: .38rem .8rem; border-radius: 2rem; border: 1px solid transparent; width: 13rem;
  background: rgba(255, 255, 255, .92); color: #1b1f17; }
nav.top .menu { position: relative; margin-left: .4rem; }
nav.top .menu summary { list-style: none; cursor: pointer; color: var(--nav-text); }
nav.top .menu summary::-webkit-details-marker { display: none; }
nav.top .me { background: var(--nav-on); padding: .3rem .8rem; border-radius: 2rem; font-weight: 500; }
nav.top .drop { position: absolute; right: 0; top: 2.4rem; z-index: 40; min-width: 13rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: .35rem; }
nav.top .drop a, nav.top .drop button { display: block; width: 100%; padding: .5rem .8rem; color: var(--text); text-align: left;
  background: none; border: 0; font: inherit; cursor: pointer; border-radius: .45rem; font-size: .93rem; }
nav.top .drop a:hover, nav.top .drop button:hover { background: var(--accent-soft); }
nav.top .drop form { margin: 0; } nav.top .drop .sep { border-top: 1px solid var(--border); margin: .3rem .2rem; }
nav.top .drop .themes { display: flex; gap: .25rem; padding: .3rem .5rem .4rem; align-items: center; font-size: .85rem; color: var(--muted); }
nav.top .drop .themes button { width: auto; flex: 1; text-align: center; padding: .3rem .4rem; border: 1px solid var(--border); font-size: .82rem; }
nav.top .drop .themes button.on { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.preview { background: var(--warn-soft); color: var(--warn-text); border-bottom: 1px solid var(--warn-edge); padding: .45rem 1rem; font-size: .9rem; text-align: center; }
.preview a { color: inherit; }
.preview.stage { background: #0b4f6c; color: #fff; border-color: #0b4f6c; }  /* staging server: not to be mistaken for the live app */
.adminbar { background: #8b1d1d; color: #fff; padding: .45rem 1rem; font-size: .9rem; text-align: center; }
.adminbar.viewas { background: #4b2a7a; } .adminbar a.updlink { color: #fff; font-weight: 600; margin-left: .6rem; }
.adminbar form { display: inline; margin-left: .6rem; }
.adminbar button { font: inherit; font-size: .85rem; padding: .12rem .7rem; border-radius: 1rem; border: 1px solid rgba(255, 255, 255, .8); background: transparent; color: #fff; cursor: pointer; }

/* ---------- tables: rounded, striped ---------- */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: .4rem 0 1rem; }
.list th, .list td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid var(--border); }
.list thead th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.list tbody tr:nth-child(even) td { background: var(--surface-2); }
.list tbody tr:hover td { background: var(--accent-soft); }
.list tbody tr:last-child td { border-bottom: 0; }
.list .nw { white-space: nowrap; }
.list .n { text-align: right; font-variant-numeric: tabular-nums; }
.list td a { text-decoration: none; font-weight: 500; } .list td a:hover { text-decoration: underline; }
th.asc::after { content: " ▲"; } th.desc::after { content: " ▼"; } .list thead th { cursor: pointer; user-select: none; }
tr.yearrow th { text-align: left; padding: .9rem .85rem .45rem; font-size: 1rem; background: var(--surface); color: var(--accent-text);
  border-bottom: 2px solid var(--border-strong); text-transform: none; letter-spacing: 0; }
.list tbody tr.yearrow:hover th { background: var(--surface); }

/* page furniture */
.headrow { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.headrow h1, .headrow h2 { margin-bottom: .4rem; }
.filter { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; font-size: .92rem; color: var(--muted); }
.filter select { padding: .3rem .55rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.6rem; }  /* minutes page: Download PDF, View original */
.pager { display: flex; gap: .75rem; align-items: center; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; } @media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.row { display: flex; gap: .5rem; flex-wrap: wrap; }
[hidden] { display: none !important; }  /* .btn's display: inline-flex would otherwise show hidden buttons */
.ip { word-break: break-all; }  /* IPv6 addresses wrap instead of widening the table */
nav.tabs { display: flex; gap: .25rem; margin: .4rem 0 1.2rem; flex-wrap: wrap; background: var(--surface-3); padding: .25rem;
  border-radius: .7rem; width: fit-content; max-width: 100%; }
nav.tabs a { padding: .4rem .9rem; border-radius: .5rem; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .93rem; }
nav.tabs a:hover { color: var(--text); } nav.tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* search results, lists of links */
.results { list-style: none; padding: 0; } .results li { padding: .8rem 1rem; margin: .5rem 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pagesearch { display: none; } .pagesearch input { width: 100%; border-radius: 2rem; }  /* phones: the bar's search is behind ☰ */
.results .sec { font-size: .8rem; color: var(--muted); margin: 0 .4rem; }
.linkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.linkcard { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.3rem .8rem; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.linkcard:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.linkcard .ico { width: 2.6rem; height: 2.6rem; color: var(--accent); } .linkcard .label { font-weight: 600; }
.linkcard .host { font-size: .8rem; color: var(--muted); word-break: break-all; }

/* sign in */
.login { max-width: 25rem; margin: 3rem auto; padding: 2rem 1.8rem; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 1rem; box-shadow: var(--shadow); }
.login .loginlogo { width: 96px; }
.login h1 { font-size: 1.55rem; margin: .7rem 0 1.4rem; }
.login form { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; }
.login label { font-weight: 600; } .login input[type=email] { text-align: center; width: 100%; padding: .65rem .75rem; }
.login .help { color: var(--muted); font-size: .85rem; margin-bottom: .3rem; } .login .small { margin-top: 1.6rem; }
.or { color: var(--faint); margin: 1rem 0; }

/* account, profile, about, member pages */
.rename { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; } .rename .pkname { flex: 1 1 6rem; } .rename input { flex: 1 1 8rem; min-width: 0; padding: .25rem .45rem; }
.about dl, .contactcard { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; }
.about dt, .contactcard dt { color: var(--muted); } .about dd, .contactcard dd { margin: 0; min-width: 0; overflow-wrap: anywhere; } .contactcard dd.address { white-space: pre-line; }
.changelog h2, .changelog h3 { font-size: 1rem; margin: .8rem 0 .3rem; } .changelog li { margin: .2rem 0; }
.changelog details { border-bottom: 1px solid var(--border, #dde); padding: .4rem 0; } .changelog summary { cursor: pointer; }
.changelog pre, .deploynotes pre { overflow-x: auto; max-width: 100%; }  /* a long command scrolls inside its box on a phone */
form.profile { max-width: 36rem; } form.profile > label { display: block; margin: .9rem 0; font-weight: 600; }
form.profile input, form.profile textarea { display: block; margin-top: .25rem; font-weight: normal; }
form.profile input[type=email], form.profile input[type=tel], form.profile input[type=url], form.profile textarea { width: 100%; }
form.profile input[type=checkbox] { display: inline-block; margin: 0 .3rem 0 0; }
form.profile .hint { display: block; font-weight: normal; }
form.profile fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 1rem 0; padding: .7rem 1rem; background: var(--surface); }
form.profile legend { font-weight: 600; float: left; width: 100%; padding: 0; margin-bottom: .4rem; }  /* inside the box, so a long one wraps cleanly */
form.profile legend + * { clear: both; } form.profile label.check { display: inline-flex; align-items: center; margin-right: 1.2rem; font-weight: normal; }
svg.lock { width: .85em; height: .85em; vertical-align: -.05em; fill: var(--faint); stroke: var(--faint); stroke-width: 2.2; } svg.lock rect { stroke: none; }
div.change { white-space: pre-line; }
article.mail { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; margin: .8rem 0; background: var(--surface); box-shadow: var(--shadow); }
article.mail h3 { margin: .2rem 0; } article.mail pre { white-space: pre-wrap; font: inherit; font-size: .9rem; margin: .5rem 0 0; }
pre.relnotes { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius-sm); padding: .6rem .8rem; font-size: .88rem; max-height: 20rem; overflow-y: auto; }

/* inline forms and fold-downs that remain */
form.inline { display: inline-flex; gap: .3rem; align-items: center; margin: .15rem .2rem; flex-wrap: wrap; }
details.edit { display: inline-block; text-align: left; } details.edit > summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
details.edit[open] { display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .7rem; margin: .3rem 0; }
.swapreq form { display: inline; margin-left: .4rem; }

/* ---------- cards (business items, notes, suggestions) ---------- */
.cards { display: flex; flex-direction: column; gap: .8rem; margin: .5rem 0 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .95rem 1.15rem; box-shadow: var(--shadow); }
.card.overdue { border-left: 4px solid var(--danger); } .card.done { background: var(--surface-2); } .card.done .card-text { color: var(--muted); }
.card-head { display: flex; gap: .8rem; align-items: flex-start; justify-content: space-between; }
.card-text { font-size: 1.04rem; white-space: pre-wrap; line-height: 1.45; }
.card-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.card .badge.ai { float: right; }
.topacts { display: flex; gap: .35rem; flex-shrink: 0; } .topacts form { margin: 0; display: inline; } .topacts button.act { font-size: .82rem; padding: .2rem .65rem; }
@media (max-width: 560px) { .card-head { flex-direction: column; } }
.comments { margin-top: .6rem; } .comment { background: var(--surface-2); border-radius: .6rem; padding: .5rem .75rem; margin: .35rem 0; }
.comment .ctext { white-space: pre-wrap; margin-top: .15rem; }

.panel { margin-top: .7rem; padding: .7rem 0 .5rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.timeline { list-style: none; padding: 0; margin: 0; max-height: 22rem; overflow-y: auto; }
.timeline li { padding: .5rem .75rem; border-radius: .5rem; margin: .15rem 0; }
.timeline li:nth-child(odd) { background: var(--surface-2); } .timeline li:nth-child(odd) .chip { background: var(--surface-3); }
.tl-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .2rem; } .tl-comment { white-space: pre-wrap; }
ul.chowlog { max-width: 44rem; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .3rem; box-shadow: var(--shadow); }
ul.chowlist { margin: .3rem 0 1rem; }

/* modern forms */
form.modern label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; margin: .5rem 0; }
form.modern label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: normal; }
form.modern select { max-width: 100%; min-width: 0; } form.modern .formrow > label { min-width: 0; }
form.modern textarea { width: 100%; min-height: 5.5rem; }
form.modern input[type=date], form.modern .combo > input, form.modern select { height: 2.75rem; }
form.modern .formrow { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; margin-top: .4rem; }
form.modern .formrow label { margin: 0; } form.modern .hint { font-weight: normal; }
form.swapcard { max-width: 44rem; } .swapicon { font-size: 1.2rem; color: var(--muted); }

/* type-to-filter dropdown (combo.js) */
.combo { position: relative; display: inline-flex; align-items: stretch; }
.combo > input { padding-right: 2rem; width: 15rem; font-weight: normal; }
.combo-arrow { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .2rem .4rem; }
.combo-menu { position: absolute; z-index: 20; top: calc(100% + .25rem); left: 0; min-width: 100%; max-height: 16rem; overflow-y: auto;
  margin: 0; padding: .25rem; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); font-weight: normal; }
.combo-menu li { padding: .4rem .7rem; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; white-space: nowrap; border-radius: .4rem; }
.combo-menu li span { color: var(--faint); font-size: .85rem; } .combo-menu li.none { color: var(--faint); font-style: italic; }
.combo-menu li:hover, .combo-menu li.at { background: var(--accent-soft); }

/* ---------- chow lists ---------- */
ol.rotlist, ul.rotlist { max-width: 44rem; padding: 0; margin: .5rem 0 1.2rem; list-style: none; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
ol.rotlist > li, ul.rotlist > li { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .2rem .7rem; align-items: start;
  padding: .6rem .95rem; border-bottom: 1px solid var(--border); }
ol.rotlist > li:last-child, ul.rotlist > li:last-child { border-bottom: 0; }
ol.rotlist > li:nth-child(even), ul.rotlist > li:nth-child(even) { background: var(--surface-2); }
ol.rotlist > li.next { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.rotlist .num { width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; font-size: .85rem; font-weight: 600; }
.rotlist li.next .num { background: var(--accent); color: var(--btn-text); }
.rot-main { min-width: 0; padding-top: .15rem; } .rot-name { font-weight: 600; }
.rot-name a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--faint); } .rot-name a:hover { color: var(--accent-text); }
.rot-limits { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.rot-note { flex-basis: 100%; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.rot-ops { display: flex; gap: .3rem; align-items: center; } .rot-ops form { margin: 0; display: inline; } .rot-ops button.act { font-size: .85rem; padding: .2rem .65rem; }
.rot-panel { grid-column: 1 / -1; margin-top: .3rem; }
.rot-panel .weeks { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: .2rem 0 .4rem; font-size: .92rem; }
.rot-panel label.wk { display: inline-flex; gap: .3rem; align-items: center; font-weight: normal; flex-direction: row; margin: 0; }
.rot-panel > form.inline { display: block; margin-top: .7rem; }
.nights .dateblk { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.2rem; min-height: 2.7rem;
  border-radius: var(--radius-sm); background: var(--surface-3); line-height: 1.05; }
.nights .dateblk b { font-size: 1.15rem; } .nights .dateblk small { font-size: .7rem; color: var(--muted); white-space: nowrap; }
ol.nights > li { grid-template-columns: 3.4rem 1fr auto; align-items: center; }
ol.nights > li.mine { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
ol.nights > li.mine .dateblk { background: var(--accent); color: var(--btn-text); } ol.nights > li.mine .dateblk small { color: var(--btn-text); opacity: .85; }
ol.nights > li.none .dateblk { opacity: .55; } ol.nights > li.tonight { box-shadow: inset 4px 0 0 var(--warn-edge); }

/* misc older bits */
section.suggestions { border: 1px solid var(--ai); background: var(--ai-soft); border-radius: var(--radius); padding: .3rem 1rem .8rem; margin: 1rem 0 1.5rem; }
.sugg { border-bottom: 1px solid var(--border); padding: .5rem 0; } .sugg form { display: inline-block; vertical-align: bottom; }
nav.top .drop .ico { display: inline-block; width: 1.3rem; }
/* profile pictures (avatars.py, _avatar.html) */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex-shrink: 0; vertical-align: middle;
  background: var(--surface-3); color: #fff; font-weight: 600; overflow: hidden; }
.avatar.initials { background: hsl(var(--h) 38% 42%); letter-spacing: .02em; }
.avatar.xs { width: 1.15rem; height: 1.15rem; font-size: .55rem; margin-right: .1rem; }
.avatar.sm { width: 1.75rem; height: 1.75rem; font-size: .72rem; }
.avatar.md { width: 1.5rem; height: 1.5rem; font-size: .62rem; margin-right: .4rem; }
.avatar.xl { width: 5.5rem; height: 5.5rem; font-size: 1.9rem; box-shadow: var(--shadow); }
nav.top .me { display: inline-flex; align-items: center; padding-left: .3rem; }
a.withavatar { display: inline-flex; align-items: center; gap: .55rem; }
.memberhead { display: flex; gap: 1.1rem; align-items: center; margin-bottom: .6rem; } .memberhead h1 { margin: 0 0 .2rem; }
.photorow { display: flex; gap: 1.1rem; align-items: center; max-width: 36rem; margin: .4rem 0 1rem; }
.photorow p.hint { margin: .4rem 0 0; } .photoform { display: inline; } label.filebtn { cursor: pointer; }
/* roster: list / card switch and member cards */
.viewswitch { display: inline-flex; background: var(--surface-3); border-radius: .55rem; padding: .2rem; gap: .15rem; margin-left: auto; }
.viewswitch a { display: grid; place-items: center; width: 2.1rem; height: 1.9rem; border-radius: .4rem; color: var(--muted); }
.viewswitch a:hover { color: var(--text); } .viewswitch a.on { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow); }
.viewswitch svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.viewswitch a:last-child svg { fill: currentColor; stroke: none; }
form.filter { width: 100%; }
.membergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 1rem; margin: .6rem 0 1.2rem; }
.membercard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; padding: 1.2rem .9rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
.membercard:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.membercard .avatar.lg { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; margin-bottom: .3rem; }
.mc-name { font-weight: 600; font-size: 1.05rem; } .mc-call { color: var(--muted); font-size: .88rem; }
.mc-meta { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin: .2rem 0; }
form.profile fieldset.fixed { background: var(--surface-2); }
form.profile .fixedrow { display: flex; flex-wrap: wrap; gap: .8rem; }
form.profile .fixedrow label { flex: 1 1 9rem; margin: .2rem 0 .5rem; font-weight: 600; font-size: .9rem; }
form.profile input[readonly] { width: 100%; background: var(--surface-3); color: var(--muted); border-style: dashed; cursor: default; }
form.profile input[readonly]:focus { box-shadow: none; border-color: var(--border-strong); }
/* update available (admins) */
nav.top .me .dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #f2b33d; margin-left: .35rem; box-shadow: 0 0 0 2px var(--nav-bg); }
.updbar { background: var(--info-soft); color: var(--text); border-bottom: 1px solid var(--border); padding: .45rem 1rem; font-size: .9rem; text-align: center; }
nav.top .drop a.updnote { background: var(--warn-soft); color: var(--warn-text); font-weight: 600; margin-bottom: .2rem; }
nav.top .drop a.updnote small { display: block; font-weight: normal; font-size: .78rem; }
div.relnotes { background: var(--surface-2); border-radius: var(--radius-sm); padding: .3rem 1rem; margin: .4rem 0; max-height: 22rem; overflow-y: auto; font-size: .93rem; }
div.relnotes ul { padding-left: 1.2rem; margin: .5rem 0; } div.relnotes li { margin: .3rem 0; } div.relnotes p { margin: .5rem 0; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  /* iOS zooms the page into any field under 16px */
  input[type=text], input[type=search], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=time], input[type=number], input:not([type]),
  select, textarea { font-size: 16px; }
  main { margin-top: 1.1rem; padding: 0 .8rem; }
  .pagesearch { display: block; margin-bottom: .6rem; }
  h1 { font-size: 1.5rem; }
  /* tables fit the screen: tighter cells, less important columns hidden */
  .list { font-size: .93rem; } .list th, .list td { padding: .55rem .4rem; }
  .list thead th { font-size: .66rem; letter-spacing: 0; }
  .list .opt { display: none; } .list th:empty, .list td:empty { padding: 0; }
  .cols { gap: 0; }
  /* business cards: the buttons as even rows, big enough to tap */
  .topacts { flex-wrap: wrap; width: 100%; }
  .topacts > * { flex: 1 1 0; }
  .topacts button.act { width: 100%; min-height: 2.4rem; font-size: .9rem; white-space: nowrap; }
  .pager { flex-wrap: wrap; }
}
/* top bar: ☰ (left) opens a drawer with every page; the meeting pill, clock, search and name stay in the bar,
   dropping out as the screen narrows (search into the drawer, then the clock, then the name text) */
nav.top { flex-wrap: nowrap; gap: .3rem; }
nav.top .spacer { flex: 1; }
nav.top .burger { font: inherit; font-size: 1.3rem; line-height: 1; color: var(--nav-text); background: none; border: 0;
  padding: .35rem .55rem; border-radius: .5rem; cursor: pointer; margin-left: -.4rem; }
nav.top .burger:hover, body.drawer-open nav.top .burger { background: var(--nav-hover); }
nav.top .brand { margin-right: .5rem; white-space: nowrap; }
nav.top .clock { color: var(--nav-text); opacity: .8; font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; margin: 0 .4rem; }
nav.top input[type=search] { width: 15rem; }
@media (max-width: 1000px) { nav.top input[type=search] { width: 11rem; } }
nav.top a.start { border: 1px solid var(--accent); border-radius: 2rem; white-space: nowrap; }
nav.top a.start.soon, nav.top a.start.live { background: #f2b33d; color: #2a1d00; border-color: #f2b33d; font-weight: 600; }
nav.top a.start.soon { animation: startpulse 1.6s ease-in-out infinite; }
@keyframes startpulse { 50% { box-shadow: 0 0 0 .4rem transparent; } 0%, 100% { box-shadow: 0 0 0 0 #f2b33daa; } }
@media (max-width: 820px) { nav.top .barsearch { display: none; } }
@media (max-width: 760px) { nav.top { padding: .5rem .7rem; } nav.top .clock { display: none; } }
@media (max-width: 520px) { nav.top .brand span { display: none; } nav.top .me .name { display: none; } }
.drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; transition: visibility 0s .2s; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .2s; }
.drawer .panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(17rem, 85vw); background: var(--nav-bg); color: var(--nav-text);
  transform: translateX(-100%); transition: transform .2s ease-out; padding: .8rem .7rem; overflow-y: auto; display: flex; flex-direction: column; gap: .1rem;
  box-shadow: 4px 0 18px rgba(0, 0, 0, .3); }
.drawer .panel a { color: var(--nav-text); text-decoration: none; padding: .6rem .8rem; border-radius: .5rem; font-size: 1rem; }
.drawer .panel a:hover { background: var(--nav-hover); } .drawer .panel a.on { background: var(--nav-on); box-shadow: inset 3px 0 0 var(--accent); }
.drawer .panel .sep { border-top: 1px solid var(--nav-hover); margin: .4rem .2rem; }
.drawer .panel form { margin: 0 0 .5rem; }
.drawer .panel input[type=search] { width: 100%; padding: .5rem .9rem; border-radius: 2rem; border: 1px solid transparent; font-size: 16px;
  background: rgba(255, 255, 255, .92); color: #1b1f17; }  /* the same light pill as the bar's search, in either theme */
@media (min-width: 821px) { .drawer .dsearch { display: none; } }

body.drawer-open { overflow: hidden; }
body.drawer-open .drawer { visibility: visible; transition: visibility 0s; }
body.drawer-open .drawer .scrim { opacity: 1; } body.drawer-open .drawer .panel { transform: none; }
@media (prefers-reduced-motion: reduce) { nav.top a.start.soon { animation: none; } .drawer, .drawer .scrim, .drawer .panel { transition: none; } }
/* home page */
.homegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); gap: 1rem; align-items: start; margin-top: 1rem; }
.homegrid h2 { font-size: 1.02rem; margin: 0 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.homegrid p { margin: .35rem 0; } .homegrid .big { font-size: 1.2rem; font-weight: 600; }
.homegrid p.late, table.list tr.late td, table.list span.late { color: var(--danger-text); }
ul.plain { list-style: none; padding: 0; margin: .3rem 0; } ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--border); } ul.plain li:last-child { border: 0; }
nav.top .me .name { margin-right: .35rem; }
/* Links page editor (admins) */
form.linkedit input, form.linkedit select { width: 100%; } form.linkedit td { vertical-align: middle; }
form.linkedit .rowbtns { white-space: nowrap; } form.linkedit .rowbtns .btn { padding: .2rem .5rem; margin-left: .15rem; }
@media (max-width: 760px) { form.linkedit table, form.linkedit tbody, form.linkedit tr, form.linkedit td { display: block; }
  form.linkedit table.list { background: none; border: 0; box-shadow: none; }
  form.linkedit thead { display: none; } form.linkedit tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: .4rem; margin-bottom: 1.1rem; }
  form.linkedit tbody tr td { border: 0; background: none !important; padding: .3rem; }
  form.linkedit tr.folded td:not(:first-child):not(.rowbtns) { display: none; } }
@media (min-width: 761px) { form.linkedit .fold { display: none; } }
.iconpick { position: relative; } .iconpick summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .5rem; border: 1px solid var(--border-strong); border-radius: .5rem; background: var(--surface); }
.iconpick summary::-webkit-details-marker { display: none; } .iconpick summary small { color: var(--muted); }
.iconpick .ico { width: 1.4rem; height: 1.4rem; color: var(--accent); }
.iconpick .grid { position: absolute; z-index: 20; top: 2.3rem; left: 0; width: 22rem; max-width: 80vw; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .25rem; padding: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.iconpick .grid button { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem .2rem; border: 1px solid transparent;
  border-radius: .45rem; background: none; color: var(--text); cursor: pointer; font: inherit; font-size: .8rem; }
.iconpick .grid button:hover { background: var(--accent-soft); border-color: var(--accent); }
.iconpick .grid button small { font-size: .72rem; color: var(--muted); } .iconpick .grid .auto { font-weight: 600; justify-content: center; }
ul.checklist { list-style: none; padding: 0; margin: .3rem 0; } ul.checklist li { position: relative; padding: .35rem 0 .35rem 1.7rem; line-height: 1.4; }
ul.checklist li::before { content: ""; position: absolute; left: 0; top: .55rem; width: calc(1rem + 4px); height: calc(1rem + 4px); box-sizing: border-box; border: 2px solid var(--border-strong); border-radius: .25rem; }
ul.checklist li.late::before { border-color: var(--danger); }
/* Home's business items: each opens the item on the Business page. Pointing at one shows a faint tick in its box
   (what you can do there); a phone has no pointing, so the › says it opens */
ul.checklist.open li a { color: inherit; text-decoration: none; display: block; }
ul.checklist.open li a::after { content: " ›"; color: var(--muted); }
/* the tick is a drawing laid over the box (same place and size), not a "✓" in some font: every browser centres it */
ul.checklist.open li::after { content: ""; position: absolute; left: 0; top: .55rem; width: calc(1rem + 4px); height: calc(1rem + 4px);
  background: var(--accent-text); opacity: 0; transition: opacity .15s; pointer-events: none;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask: var(--tick) center / 75% no-repeat; mask: var(--tick) center / 75% no-repeat; }
ul.checklist.open li:hover::after, ul.checklist.open li:focus-within::after { opacity: .5; }
ul.checklist.open li a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }  /* the keyboard still shows where it is */
form.linkedit table.list { overflow: visible; }
/* calendar page */
.callegend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); }
.callegend span { display: inline-flex; align-items: center; gap: .3rem; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; flex: none; margin-right: .35rem; vertical-align: middle; }
.k-events { background: var(--accent); } .k-chow { background: #d9932b; } .k-planning { background: #7b4fb0; }
.k-community { background: #2f7fc1; } .k-birthday { background: #d24f86; } .k-holiday { background: #3a9a5b; }
h2.calday { font-size: 1rem; margin: 1.1rem 0 .3rem; color: var(--accent-text); }
ul.agenda { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
ul.agenda li + li { border-top: 1px solid var(--border); } ul.agenda li.alt { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.caltime { font-variant-numeric: tabular-nums; color: var(--muted); }
/* an event: the whole row opens its details */
button.calopen { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; width: 100%; }
ul.agenda button.calopen { display: flex; align-items: baseline; gap: .5rem; padding: .65rem .75rem; min-height: 2.75rem; }
ul.agenda button.calopen:hover { background: var(--accent-soft); } button.calopen:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
ul.agenda .caltime { flex: none; width: 4.6rem; font-size: .9rem; } ul.agenda .dot { align-self: center; margin-right: 0; } ul.agenda .caltitle { min-width: 0; overflow-wrap: anywhere; }
table.month button.calopen { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 3px; }
table.month button.calopen:hover { background: var(--accent-soft); }
/* the details dialog */
dialog#calmodal, dialog.modal, .modal[popover] { border: 0; border-radius: var(--radius); padding: 0; width: min(28rem, calc(100vw - 2rem)); background: var(--surface); color: var(--text);
  box-shadow: 0 10px 40px rgba(0,0,0,.3); max-height: calc(100dvh - 2rem); overflow: auto; } dialog#calmodal::backdrop, dialog.modal::backdrop, .modal[popover]::backdrop { background: rgba(0,0,0,.45); }
dialog#calmodal .body, dialog.modal .body, .modal[popover] .body { padding: 1.1rem 1.25rem 1rem; } dialog#calmodal h2, dialog.modal h2, .modal[popover] h2 { margin: .1rem 2rem .6rem 0; font-size: 1.25rem; }
dialog#calmodal form, dialog.modal form.x { position: absolute; top: .5rem; right: .5rem; margin: 0; }
button.calclose { font: inherit; background: none; border: 0; cursor: pointer; min-width: 2.5rem; min-height: 2.5rem; border-radius: 50%; color: var(--muted); }
button.calclose:hover { background: var(--accent-soft); }
.modal[popover] > .calclose { position: absolute; top: .5rem; right: .5rem; }  /* popover dialogs: no script needed */
td.evacts form { display: inline; } .modal[popover] { white-space: normal; text-align: left; }
dl.evinfo { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: 0; } dl.evinfo dt { font-weight: 600; } dl.evinfo dd { margin: 0; }
dl.evinfo .agent { overflow-wrap: anywhere; }
.calcal { margin: 0; font-size: .85rem; color: var(--muted); } .calwhen { font-weight: 600; } .calnotes { white-space: pre-line; overflow-wrap: anywhere; }
table.month { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
table.month th { font-size: .75rem; color: var(--muted); padding: .3rem; font-weight: 600; }
table.month td { border: 1px solid var(--border); vertical-align: top; height: 5.5rem; padding: .2rem .25rem; overflow: hidden; }
table.month td.other { background: var(--surface-2); color: var(--faint); } table.month td.today .daynum { background: var(--accent); color: #fff; }
table.month .daynum { display: inline-block; min-width: 1.5rem; text-align: center; border-radius: 1rem; font-size: .85rem; text-decoration: none; }
table.month ul { list-style: none; padding: 0; margin: .15rem 0 0; font-size: .75rem; line-height: 1.25; }
table.month li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {  /* phones: a dot per event; tap the day for the details */
  table.month td { height: 3.4rem; padding: .15rem; } table.month li { display: inline; } table.month .caltime, table.month .caltitle, table.month li.more { display: none; }
  table.month .dot { margin-right: .1rem; } table.month button.calopen { display: inline; }
}
.feedlink { width: 100%; max-width: 40rem; font-family: ui-monospace, monospace; font-size: .8rem; }
h2.calrange { font-size: 1.05rem; margin: .3rem 0; }
.iconpick .iconsearch { grid-column: 1 / -1; width: 100%; padding: .35rem .6rem; }
.iconpick .brandhits { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; max-height: 14rem; overflow-y: auto; }
.iconpick .brandhits:empty { display: none; } .iconpick .brandhits small { overflow-wrap: anywhere; }
form.profile label.until { display: block; margin-top: .5rem; }
/* emoji(): the native emoji where the device draws color emoji (html.emoji, set in base.html), else the app's line icon */
.emo { display: none; font-size: 1rem; line-height: 1; } html.emoji .emo { display: inline; } html.emoji .emo-alt { display: none; }
.emo-alt { display: inline-flex; vertical-align: -.2em; } .emo-alt .ico { width: 1.15em; height: 1.15em; } .emoji-wrap { display: inline; }
button.calkind { font: inherit; display: inline-flex; align-items: center; gap: .1rem; padding: .3rem .55rem; margin: -.3rem -.2rem;
  border: 1px solid transparent; border-radius: 2rem; background: none; color: inherit; cursor: pointer; }
button.calkind:hover { border-color: var(--border-strong); } button.calkind[aria-pressed=false] { opacity: .5; text-decoration: line-through; }
button.calkind[aria-pressed=false] .dot { background: transparent !important; box-shadow: inset 0 0 0 2px var(--muted); }
table.month li.extra { display: none; }

/* Charts (Attendance): stacked bars in plain HTML; each bar's title is its tooltip, the table below has the numbers */
.chart { margin: 0 0 1.5rem; padding: 1rem 1rem .6rem 2.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.chart.wide-axis { padding-left: 4rem; } .chart.wide-axis .bars { justify-content: space-around; } .chart.wide-axis .legend { margin-left: -3rem; }  /* "$4,800" needs more room than "40" */
.chart .legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 0 0 .8rem -1.4rem; }
.chart .legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .35rem; vertical-align: -.05rem; }
.chart .k1 { background: var(--chart-1); } .chart .k2 { background: var(--chart-2); } .chart .k3 { background: var(--chart-3); }
.chart .k4 { background: var(--chart-4); } .chart .k5 { background: var(--chart-5); } .chart .k6 { background: var(--chart-6); } .chart .k7 { background: var(--chart-7); } .chart .k8 { background: var(--chart-8); }
.chart .plot { position: relative; height: 11rem; }
.chart .grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.chart .grid span { position: absolute; right: 100%; margin-right: .4rem; transform: translateY(-50%); font-size: .75rem; color: var(--faint); }
.chart .bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart .bar { flex: 1 1 0; max-width: 1.6rem; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.chart .bar i { flex-basis: 0; min-height: 2px; } .chart .bar:hover, .chart .bar:focus-visible { opacity: .75; }
.chart figcaption { display: flex; justify-content: space-between; font-size: .75rem; color: var(--faint); margin-top: .3rem; }
table.list td select { max-width: 7.5rem; font-size: .8rem; display: block; margin-top: .2rem; }
@media (max-width: 760px) { table.list td select { max-width: 6.5rem; } }  /* Treasurer → Money fits 375px in Firefox too */
.swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .4rem; vertical-align: -.05rem; } .swatch.k1 { background: var(--chart-1); } .swatch.k2 { background: var(--chart-2); } .swatch.k3 { background: var(--chart-3); } .swatch.k4 { background: var(--chart-4); } .swatch.k5 { background: var(--chart-5); } .swatch.k6 { background: var(--chart-6); } .swatch.k7 { background: var(--chart-7); } .swatch.k8 { background: var(--chart-8); }
input.cellinput { font: inherit; font-size: .9rem; width: 100%; min-width: 10rem; border: 1px solid transparent; background: transparent; color: inherit; padding: .15rem .3rem; border-radius: .3rem; } input.cellinput:hover, input.cellinput:focus { border-color: var(--border-strong); background: var(--surface); }
/* Business items: a small card that opens a dialog with the details, comments, history and actions */
article.bcard { cursor: pointer; transition: border-color .15s; } article.bcard:hover { border-color: var(--border-strong); }
button.cardopen { all: unset; display: block; width: 100%; cursor: pointer; } button.cardopen:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: .3rem; }
dialog.modal.wide { width: min(40rem, calc(100vw - 2rem)); } dialog.modal h3 { font-size: 1rem; margin: 1.1rem 0 .3rem; }
dialog.modal .dacts { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 .2rem; } dialog.modal .dacts form { margin: 0; }
details.hist { margin-top: 1rem; } details.hist summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
button.cardopen .card-text { display: block; }

/* Safari fills an empty date or time box with today's date in grey, which reads as a value: blank until it's in use.
   Only in Safari (.safari, set in base.html): Chrome and Edge keep their mm/dd/yyyy and --:-- -- hints */
.safari input:is([type=date], [type=time]):is([value=""], :not([value])):not(:focus)::-webkit-datetime-edit { color: transparent; }

/* a possible duplicate (calview.mark_duplicates, console.js similar()): highlighted, never hidden */
.duphint { color: var(--warn-text); font-size: .85rem; }
li.dup .caltitle, li.dup > strong { background: var(--warn-soft); border-radius: .2rem; }
/* Site page: one row per picture (what it looks like now, where it's used, Upload and Reset) */
.sitename input { flex: 1; max-width: 22rem; }
.sitepics { display: grid; gap: .6rem; }
.sitepic { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 1rem; align-items: center; padding: .8rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sitepic .thumb { width: 6.5rem; height: 5rem; display: grid; place-items: center; border-radius: var(--radius-sm);
  background: repeating-conic-gradient(var(--border) 0 25%, transparent 0 50%) 0 0 / 12px 12px; }  /* see-through shows */
.sitepic .thumb img { max-width: 6rem; max-height: 4.5rem; }
.sitepic .thumbs { display: grid; gap: .3rem; } .sitepic .thumbs .thumb { height: 3.6rem; background: #fff; border: 1px solid var(--border); }
.sitepic .thumbs .thumb.ondark { background: #1b1f17; } .sitepic .thumbs img { max-height: 3.1rem; max-width: 5.5rem; }
.sitepic form.backing { margin: .35rem 0 0; } .sitepic form.backing select { margin-left: .3rem; max-width: 100%; }
.sitepic .about { min-width: 0; }  /* lets the text and the menu wrap instead of widening the page */
.sitepic .thumb.favicon img { width: 32px; height: 32px; } .sitepic .thumb.icon img { width: 60px; height: 60px; border-radius: 13px; }
.sitepic .acts { display: flex; gap: .4rem; align-items: center; } .sitepic .acts form { margin: 0; }
@media (max-width: 560px) { .sitepic { grid-template-columns: 5rem 1fr; } .sitepic .thumb { width: 5rem; } .sitepic .acts { grid-column: 1 / -1; }
  .sitepic form.backing label { display: block; } .sitepic form.backing select { margin: .25rem 0 0; width: 100%; } }
/* the file box sits invisibly in its Upload… button: still reachable with the keyboard (Tab, then Space) */
.sitepic label.btn { position: relative; } .sitepic label.btn input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.sitepic label.btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
/* what's behind the club's logo (Site): dark ink on a see-through background still shows in dark mode */
img.logo.bg-circle { background: #fff; border-radius: 50%; }
img.logo.bg-square { background: #fff; border-radius: 14%; padding: 6%; box-sizing: border-box; }
/* Site: Save and Cancel appear once something is chosen; the card is marked until it's saved */
.sitepic form .pend { display: none; } .sitepic form.pending .pend { display: inline-flex; gap: .4rem; }
.sitepic form.pending .pick { display: none; }
.sitepic:has(form.pending) { border-color: var(--warn-edge); background: var(--warn-soft); }
.sitepic .unsaved { color: var(--warn-text); font-size: .8rem; font-weight: 600; margin-left: .3rem; }
/* Admin page: one card per tool */
.admintools { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .7rem; }
.admintools a.card { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: inherit; padding: .9rem 1rem; }
.admintools a.card:hover { border-color: var(--accent); } .admintools a.card b { font-size: 1.05rem; }
/* ‹ Admin, above each admin tool's page */
nav.crumb { margin: -.6rem 0 .6rem; font-size: .9rem; } nav.crumb a { text-decoration: none; }

/* ---------- Site → Colours: two small previews, each drawn with the palette set on it ---------- */
form.colours .row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin: .4rem 0; }
form.colours input[type=color] { width: 3rem; height: 2rem; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.swatch { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; vertical-align: middle; margin-left: .2rem; }
.themeprev { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; margin: .8rem 0; max-width: 40rem; }
.tp { border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; color: var(--text); }
.tp-bar { background: var(--nav-bg); color: var(--nav-text); font-weight: 600; padding: .45rem .7rem; }
.tp-body { background: var(--bg); padding: .7rem; }
.tp-link { color: var(--accent-text); text-decoration: underline; }
.tp-btn { display: inline-block; background: var(--btn-bg); color: var(--btn-text); border-radius: var(--radius-sm); padding: .2rem .7rem; margin-left: .4rem; }
.tp-h { background: var(--sheet-h); border-radius: .3rem; font-weight: 600; padding: .1rem .4rem; margin: .6rem 0 .3rem; }
.tp-muted { color: var(--muted); font-size: .85rem; }

/* Admin → Site: each section a card; collapsible ones open from their heading */
.sitesec { margin: 0 0 1rem; max-width: 52rem; } fieldset.sitesec { min-width: 0; } /* "Your own formats" only while it's ticked (CSS :has; an older browser just always shows it) */
.sitedates:has(input[name=preset]:not([value=custom]):checked) [data-own] { display: none; } .sitesec h2 { margin: 0 0 .6rem; font-size: 1.15rem; }
details.sitesec > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.sitesec > summary::-webkit-details-marker { display: none; }
details.sitesec > summary::before { content: "›"; font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform .15s; }
details.sitesec[open] > summary::before { transform: rotate(90deg); }
details.sitesec > summary h2 { margin: 0; } details.sitesec[open] > summary { margin-bottom: .7rem; }
form .sitesec label.check { display: flex; width: 100%; gap: .6rem; align-items: flex-start; padding: .45rem 0; margin: 0; }
.sitesec label.check input { margin-top: .25rem; }
.fmtgrid { display: grid; grid-template-columns: max-content minmax(8rem, 20rem) 1fr; gap: .5rem .8rem; align-items: center; }
@media (max-width: 560px) { .fmtgrid { grid-template-columns: 1fr; } .fmtgrid span { margin-bottom: .4rem; } }
.agendagrid { display: grid; grid-template-columns: auto 3.5rem minmax(10rem, 16rem) 1fr; gap: .45rem .7rem; align-items: center; }
.agendagrid input[name^=pos] { width: 3.2rem; text-align: center; }
@media (max-width: 560px) { .agendagrid { grid-template-columns: auto 3.2rem minmax(0, 1fr); } .agendagrid .agh { display: none; }
  .agendagrid input[name^=hint] { grid-column: 2 / -1; margin-bottom: .6rem; } }
form.siteagenda { max-width: 52rem; } form.profile .sitesec input[type=number] { display: inline-block; width: 4.5rem; margin: 0 .35rem 0 0; }
form.sitewide { max-width: 52rem; } form.sitewide textarea { width: 100%; field-sizing: content; min-height: 4lh; }  /* grows with its text where the browser can */
/* the certificate's fields only while it's ticked (CSS :has; an older browser just always shows them) */
.sitecert:has(input[name=cert_on]:not(:checked)) .certfields { display: none; }
/* Features → the club's own holidays: a row each; "+ Add a holiday" shows the next empty row (CSS only: a checkbox per row) */
.holrows .hrow { display: grid; grid-template-columns: minmax(8rem, 1fr) 9rem 10rem 5rem 5.5rem; gap: .5rem; margin: .35rem 0; align-items: center; }
.holrows .hrow.head span { font-size: .85rem; color: var(--muted); }
.holrows .hrow input[type=number] { width: 5rem; }
.holrows .more { position: absolute; opacity: 0; width: 1px; height: 1px; }        /* still reachable with Tab */
.holrows .more:focus-visible + .add { outline: 2px solid var(--accent); }
.holrows .more:not(:checked) + .add + .hrow, .holrows .more:checked + .add { display: none; }
.holrows .more:not(:checked) ~ .more + .add { display: none; }                      /* only the first one not used yet */
.holrows .after span { display: none; }  /* the column heading says it, except on phones */
@media (max-width: 560px) { .holrows .hrow { grid-template-columns: 1fr 1fr; } .holrows .hrow.head { display: none; } .holrows .after { display: flex; align-items: center; gap: .4rem; white-space: nowrap; grid-column: 1 / -1; } .holrows .after span { display: inline; }
  .holrows .hrow input[name^=hol_name] { grid-column: 1 / -1; } }
/* Remove: a checkbox shown as a button; ticked, the row dims and the button says Undo; it goes when the form is saved */
.holrows .rm { position: relative; } .holrows .rm input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.holrows .rm:has(input:focus-visible) { outline: 2px solid var(--accent); }
.holrows .rm .rm-undo, .holrows .rm:has(input:checked) .rm-do { display: none; } .holrows .rm:has(input:checked) .rm-undo { display: inline; }
.holrows .hrow:has(.rm input:checked) > :not(.rm) { opacity: .4; text-decoration: line-through; }
