:root {
  --navy: #0d2b52; --navy-2: #163d6f; --ink: #13233a; --soft: #5a6b80; --line: #dfe5ec;
  --bg: #f2f5f8; --paper: #fff; --red: #d0233f; --green: #1f8a5b; --amber: #c27a00;
  --r: 10px; --display: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 Barlow, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: .01em; margin: 0; line-height: 1.1; }
h1 { font-size: 32px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
.muted { color: var(--soft); }
.small { font-size: 13px; }

/* Layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand img { width: 42px; height: 42px; border-radius: 10px; }
body.club-logo .brand img { width: auto; height: 46px; max-width: 120px; border-radius: 0; object-fit: contain; } /* the club's logo, outlined white (lib/logo-outline.mjs) */
.brand b { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.brand small { display: block; font-size: 12px; color: rgba(255,255,255,.65); }
.side select { width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 8px; padding: 8px; }
.side select option { color: var(--ink); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: rgba(255,255,255,.8); text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 500; display: flex; align-items: center; gap: 11px; }
.nav a .ic { flex: none; opacity: .85; width: 20px; text-align: center; font-size: 16px; }
.nav a.on .ic { opacity: 1; color: var(--red); }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: #fff; color: var(--navy); font-weight: 600; }
.side .me { margin-top: auto; font-size: 13px; color: rgba(255,255,255,.7); padding: 0 6px; }
.side .me b { color: #fff; display: block; }
.side .me button { background: none; border: 0; color: rgba(255,255,255,.75); padding: 0; cursor: pointer; text-decoration: underline; }
main { padding: 26px 30px 60px; max-width: 1180px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head p { margin: 4px 0 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* Dashboard banner: race-day photo with a navy fade behind the words */
.hero { border-radius: 14px; margin-bottom: 18px; min-height: 210px; display: flex; align-items: flex-end; padding: 26px 28px; color: #fff;
  background: linear-gradient(90deg, rgba(13,43,82,.95) 0%, rgba(13,43,82,.7) 38%, rgba(13,43,82,.05) 75%), url(/hero.jpg) center 58% / cover no-repeat, var(--navy); }
.hero h1 { font-size: 40px; }
.hero-kicker { margin: 0 0 4px; font-weight: 600; color: rgba(255,255,255,.8); }
.hero-sub { margin: 6px 0 14px; color: rgba(255,255,255,.85); }
.hero .hero-btn { background: #fff; color: var(--navy); border-color: #fff; }
.hero .hero-btn:hover { background: #e8eef5; }
@media (max-width: 820px) { .hero { min-height: 180px; padding: 20px; background-position: 70% 55%; } .hero h1 { font-size: 30px; } }

/* Surfaces */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid2 > .card + .card { margin-top: 0; }
.grid2 + .card, .card + .grid2 { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--navy); display: block; line-height: 1; }
.stat span { color: var(--soft); font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--soft); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.link { cursor: pointer; }
tr.link:hover td { background: #f6f9fc; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.empty { padding: 26px; text-align: center; color: var(--soft); }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 8px 13px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: #b9c4d0; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { color: var(--red); }
.btn.small { padding: 5px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; border: 1px solid #c9d2dc; border-radius: 8px; padding: 8px 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
input:not([type]):focus, input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=number]:focus, input[type=search]:focus, input[type=tel]:focus, input[type=url]:focus, textarea:focus {
  border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(22, 61, 111, .14); outline: none; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input::placeholder, textarea::placeholder { color: #9aa7b6; }
/* checkboxes: one look everywhere */
input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid #b3c0cf; border-radius: 6px; background: #fff; cursor: pointer;
  display: inline-grid; place-items: center; vertical-align: middle; transition: background .12s, border-color .12s; }
input[type=checkbox]::after { content: ""; width: 10px; height: 6px; border: 2.4px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
input[type=checkbox]:checked { background: var(--navy); border-color: var(--navy); }
input[type=checkbox]:checked::after { opacity: 1; }
input[type=checkbox]:disabled { opacity: .55; cursor: default; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
textarea { min-height: 70px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
label.f { display: block; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--soft); margin-bottom: 4px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check { cursor: pointer; min-height: 40px; }
.search { max-width: 280px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #e8eef5; color: var(--navy); }
.pill.green { background: #dff3ea; color: var(--green); }
.pill.amber { background: #fbefd9; color: var(--amber); }
.pill.red { background: #fbe3e7; color: var(--red); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; font-weight: 600; color: var(--soft); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--navy); border-color: var(--red); }

/* Silks + drivers */
.silk { width: 26px; height: 26px; flex: none; vertical-align: middle; }
.driver { display: inline-flex; align-items: center; gap: 7px; }

/* Race card */
.race { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); overflow: hidden; }
.race + .race { margin-top: 16px; }
.race-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #f6f9fc; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.race-no { font-family: var(--display); font-weight: 800; font-size: 26px; color: #fff; background: var(--navy); border-radius: 8px; min-width: 42px; text-align: center; padding: 2px 8px; }
.place { font-family: var(--display); font-weight: 800; font-size: 20px; }
.place.p1 { color: var(--red); }
td input.mini { width: 74px; padding: 5px 7px; }
.map { height: 320px; border-radius: var(--r); border: 1px solid var(--line); }
.map.tall { height: 460px; }
.mk { background: var(--navy); color: #fff; border: 2px solid #fff; border-radius: 99px; font-weight: 700; font-size: 12px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mk.finish { background: var(--red); }

/* Handicap log */
.log li { margin: 0 0 6px; }
.hc-big { font-family: var(--display); font-size: 44px; font-weight: 800; color: var(--navy); line-height: 1; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; background: #081a33; }
/* Blurred race-night photo behind the sign in card, darkened so the card stays the focus. */
.login::before { content: ""; position: absolute; inset: -40px; background: url(/login-bg.jpg) center / cover no-repeat; filter: blur(14px); transform: scale(1.05); }
.login::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(13,43,82,.55) 0%, rgba(8,26,51,.78) 100%); }
.login > * { position: relative; z-index: 1; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { color: var(--navy); margin-bottom: 18px; padding: 0; }
.login .brand small { color: var(--soft); }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* Modal + toast */
.modal { position: fixed; inset: 0; background: rgba(8,20,40,.5); display: grid; place-items: center; padding: 16px; z-index: 2000; }
.modal[hidden] { display: none; }
.modal .box { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; padding: 22px; }
.modal .box.wide { max-width: 860px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 3000; }
.toast.on { opacity: 1; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 18px; background: #f2f5f8; padding: 10px 12px; border-radius: 8px; user-select: all; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
  .side .club { flex: 1; min-width: 150px; }
  .nav { display: none; }
  .side .me { display: none; }
  main { padding: 18px 16px 50px; }
  .form { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
}

/* Page changes: the old page stays (slightly dimmed) until the new one is ready, then fades in. */
main.busy { opacity: .6; transition: opacity .12s .08s; pointer-events: none; }
main.enter > * { animation: rise .2s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Modals and the confirm box */
.modal { animation: fade .14s ease-out; }
.modal .box { animation: pop .16s cubic-bezier(.2,.9,.3,1.2); }
.modal.closing { animation: fade .14s ease-in reverse forwards; }
.modal.closing .box { animation: pop .14s ease-in reverse forwards; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.modal.confirm { z-index: 2500; }
.modal.confirm .box { max-width: 420px; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-solid:hover { background: #b51d36; }
.btn { transition: background .12s, border-color .12s, transform .08s; }
.btn:active { transform: scale(.97); }

/* HTML dropdowns */
.dd { position: relative; }
.dd-native { position: absolute !important; opacity: 0; pointer-events: none; width: 1px !important; height: 1px; }
.dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  border: 1px solid #c9d2dc; border-radius: 8px; padding: 8px 10px; background: #fff; cursor: pointer; min-height: 38px; }
.dd-btn:hover { border-color: #9fb0c2; }
.dd.open .dd-btn { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(22,61,111,.12); }
.dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { flex: none; color: var(--soft); transition: transform .15s; }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd.dark .dd-btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.dd.dark .dd-chev { color: rgba(255,255,255,.8); }
.dd-list { position: fixed; z-index: 3000; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(8,26,51,.18); padding: 5px; max-height: 320px; display: flex; flex-direction: column;
  opacity: 0; transform: translateY(-4px); transition: opacity .12s, transform .12s; outline: none; }
.dd-list.on { opacity: 1; transform: none; }
.dd-search { margin: 2px 2px 6px; width: auto !important; }
.dd-opts { overflow-y: auto; }
.dd-opt { padding: 8px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-opt.active { background: #eef3f9; }
.dd-opt.sel { font-weight: 600; color: var(--navy); }
.dd-opt.sel::after { content: "\2713"; float: right; margin-left: 12px; color: var(--red); }
.dd-none { padding: 10px; color: var(--soft); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  main.enter > *, .modal, .modal .box, .modal.closing, .modal.closing .box { animation: none !important; }
  .dd-list, main.busy, .btn { transition: none; }
}

/* Members filters */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--soft); }
.chip b { color: var(--ink); margin-left: 3px; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.on b { color: #fff; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.th-sort:hover { color: var(--navy); }

/* Colour swatches in dropdowns */
.dd-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }

/* Activity log */
.a-day { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--navy); padding: 14px 4px 6px; border-bottom: 1px solid var(--line); }
.a-day:first-child { padding-top: 0; }
.a-row { display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.a-ic { flex: none; width: 26px; height: 26px; border-radius: 99px; background: #e8eef5; color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.a-ic.del { background: #fbe3e7; color: var(--red); }
.a-ic.bad { background: var(--red); color: #fff; }
.a-ch summary { cursor: pointer; color: var(--navy-2); font-size: 13px; margin-top: 4px; }
.a-ch table { margin-top: 6px; font-size: 13px; width: auto; }
.a-ch td { padding: 3px 10px 3px 0; border: 0; }
.arrow { color: #ffd23f; font-size: 14px; line-height: 16px; text-align: center; text-shadow: 0 0 3px rgba(0,0,0,.8); }

/* Unplaced run: three dots, filled per start without placing */
.run { display: inline-flex; gap: 4px; vertical-align: middle; }
.run i { width: 11px; height: 11px; border-radius: 99px; border: 2px solid #b9c4d0; }
.run i.on { background: var(--amber); border-color: var(--amber); }
.run-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.run.full i.on { background: var(--red); border-color: var(--red); }
.warn-t { color: var(--red); }
/* Start number, like a saddlecloth */
.no { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 6px; background: var(--navy); color: #fff; font-family: var(--display); font-weight: 800; font-size: 16px; }

/* Distance change badge + "i" explainer */
td.dist { white-space: nowrap; }
.delta { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 99px; margin-right: 6px; vertical-align: 1px; }
.delta.neg { background: #fbe3e7; color: var(--red); }
.delta.pos { background: #dff3ea; color: var(--green); }
.info { width: 20px; height: 20px; margin-left: 6px; border-radius: 99px; border: 1.5px solid #9fb0c2; background: #fff; color: var(--navy-2);
  font: italic 700 12px/1 Georgia, serif; cursor: pointer; vertical-align: 1px; padding: 0; }
.info:hover, .info:focus-visible { border-color: var(--navy); background: var(--navy); color: #fff; }
.why { position: fixed; z-index: 3500; width: min(380px, calc(100vw - 16px)); background: #0f2238; color: #fff; border-radius: 10px; padding: 12px 14px;
  font-size: 13.5px; line-height: 1.45; box-shadow: 0 12px 30px rgba(8,26,51,.35); opacity: 0; transform: translateY(-3px); transition: opacity .12s, transform .12s; }
.why.on { opacity: 1; transform: none; }
.why-h { font-family: var(--display); font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.why table { width: 100%; }
.why td { border: 0; padding: 3px 0; vertical-align: top; color: rgba(255,255,255,.88); }
.why td.n { padding-right: 12px; color: #fff; text-align: right; }
.why p { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.75); }
.why .neg { color: #ff8a9b; font-weight: 700; }
.why .pos { color: #7be0b5; font-weight: 700; }

/* Gap arrows: a curved bracket from the middle of the row above to the middle of this row */
table.field tbody tr { height: 50px; }
th.gap-h { width: 92px; }
td.gapc { position: relative; padding: 0; width: 92px; }
.gap { position: absolute; left: 2px; right: 0; top: -50%; height: 100%; pointer-events: auto; }
.gap-arc { position: absolute; left: 0; top: 8px; bottom: 8px; width: 16px; border: 2px solid #7f95ad; border-left: 0; border-radius: 0 14px 14px 0; }
.gap-arc::after { content: ""; position: absolute; left: -2px; bottom: -6px; border: 5px solid transparent; border-right: 7px solid #7f95ad; border-left: 0; }
.gap-t { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); font-size: 12.5px; font-weight: 700; color: var(--navy-2); background: #eef3f9; border-radius: 99px; padding: 1px 7px; white-space: nowrap; }
.dd-ic { display: inline-flex; margin-right: 8px; vertical-align: -6px; }
.dd-ic .silk { width: 22px; height: 22px; }

/* Phones: bottom tab bar + "More" sheet */
.tabbar, .sheet, .sheet-bg { display: none; }
@media (max-width: 820px) {
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none;
    color: var(--soft); text-decoration: none; font-size: 11.5px; font-weight: 600; cursor: pointer; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
  .tabbar .ic { font-size: 19px; height: 23px; line-height: 23px; }
  .tabbar a.on, .tabbar button.on, .tabbar button[aria-expanded="true"] { color: var(--navy); }
  .tabbar a.on .ic, .tabbar button.on .ic { color: var(--red); }
  .tabbar a:active, .tabbar button:active { background: #eef3f9; }
  .sheet-bg { display: block; position: fixed; inset: 0; z-index: 1600; background: rgba(8,20,40,.4); animation: fade .15s; }
  .sheet-bg[hidden] { display: none; }
  .sheet { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1700; background: #fff; border-radius: 18px 18px 0 0;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 -10px 30px rgba(8,26,51,.2); }
  .sheet.open { transform: none; }
  .sheet-grab { width: 40px; height: 5px; border-radius: 99px; background: #d5dde6; margin: 2px auto 10px; }
  .sheet-me { padding: 4px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
  .sheet a, .sheet button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 10px; border: 0; background: none; border-radius: 10px;
    color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 600; cursor: pointer; text-align: left; }
  .sheet a .ic, .sheet button .ic { color: var(--navy-2); width: 22px; text-align: center; font-size: 18px; }
  .sheet a.on { background: #eef3f9; }
  .sheet a.on .ic { color: var(--red); }
  .sheet #out2 { color: var(--red); }
  .sheet #out2 .ic { color: var(--red); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }

/* Track editor */
.hint { font-size: 13.5px; color: var(--soft); margin: 10px 0; min-height: 20px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.hint b { color: var(--ink); }
.hint.busy { color: var(--navy-2); }
.spin { width: 15px; height: 15px; border-radius: 99px; border: 2px solid #c9d6e6; border-top-color: var(--navy-2); animation: sp .8s linear infinite; flex: none; margin-top: 2px; }
@keyframes sp { to { transform: rotate(360deg); } }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.res { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.res i { color: var(--navy-2); width: 18px; text-align: center; }
.res span { display: flex; flex-direction: column; min-width: 0; }
.res b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res small { color: var(--soft); font-size: 12px; }
.res.on { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(13,43,82,.15); }
.hdl { width: 22px; height: 22px; border-radius: 99px; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); cursor: grab; }
.hdl.hdl-move { background: var(--navy); }
.hdl.hdl-end { background: var(--red); }
.hdl.hdl-width { background: #f59e0b; }
.hdl.in { display: inline-block; width: 13px; height: 13px; border-width: 2px; vertical-align: -2px; cursor: default; }

/* Made by Lewin Digital */
.made { display: block; margin-top: 14px; font-size: 12px; color: rgba(255,255,255,.5); text-decoration: none; }
.made b { font-weight: 600; color: rgba(255,255,255,.75); }
.made:hover b { color: #fff; }
.sheet .made { color: var(--soft); text-align: center; margin: 10px 0 0; padding: 0; justify-content: center; font-size: 12.5px; font-weight: 400; }
.sheet .made b { color: var(--navy-2); }
.login .made.login-made { position: relative; z-index: 1; text-align: center; margin-top: 16px; color: rgba(255,255,255,.65); }
.login { grid-auto-flow: row; align-content: center; }

/* Phones: table rows become cards */
@media (max-width: 820px) {
  .tablewrap { overflow: visible; }
  .card.tablewrap { padding: 0; background: none; border: 0; }
  table.cards, table.cards tbody { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
  .race table.cards tr, .modal table.cards tr, .card table.cards tr { box-shadow: none; }
  table.cards tr.wide { padding: 0; }
  table.cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 5px 0; text-align: right; min-height: 0; }
  table.cards td::before { content: attr(data-label); color: var(--soft); font-size: 13px; font-weight: 500; text-align: left; flex: none; }
  table.cards td:not([data-label])::before, table.cards td[data-label=""]::before { content: none; }
  table.cards td:not([data-label]) { justify-content: flex-end; }
  table.cards td:first-child { justify-content: flex-start; text-align: left; font-size: 16px; padding-top: 2px; }
  table.cards td:first-child::before { content: none; }
  table.cards td:empty { display: none; }
  table.cards tr.wide td { display: block; text-align: center; }
  tr.link:hover td { background: none; }
  tr.link:active { background: #f6f9fc; }

  /* Race field: number + horse on one line, the rest under it */
  .race table.cards { padding: 10px 10px 2px; }
  table.field tr { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; }
  table.field td { grid-column: 1 / -1; }
  table.field td:first-child { grid-column: 1; padding: 0; }
  table.field td:nth-child(2) { grid-column: 2; justify-content: flex-start; font-size: 17px; padding: 2px 0 6px; }
  table.field td:nth-child(2)::before { content: none; }
  td.gapc { position: static; width: auto; }
  td.gapc:not(:has(.gap)) { display: none; }
  .gap { position: static; display: inline-flex; }
  .gap-arc { display: none; }
  .gap-t { position: static; transform: none; }
  td input.mini { width: 110px; }
}
@media (max-width: 820px) {
  table.field tbody tr { height: auto; }
  .sheet:not(.open) { visibility: hidden; transition: transform .22s cubic-bezier(.2,.8,.2,1), visibility 0s .22s; }
}
@media (max-width: 820px) {
  table.cards td { justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
  table.cards td::before { margin-right: auto; }
  table.cards td:first-child { justify-content: flex-start; }
  table.cards td > div { width: auto; }
  .search { max-width: none; width: 100%; }
}

/* Download menu */
.menu-pop { position: fixed; z-index: 3200; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(8,26,51,.2);
  padding: 6px; min-width: 260px; opacity: 0; transform: translateY(-4px); transition: opacity .12s, transform .12s; }
.menu-pop.on { opacity: 1; transform: none; }
.menu-pop button { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; text-align: left; cursor: pointer; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: #eef3f9; outline: none; }
.menu-pop i { width: 20px; text-align: center; color: var(--navy-2); font-size: 17px; }
.menu-pop span { display: flex; flex-direction: column; }
.menu-pop small { color: var(--soft); font-size: 12px; }
.btn .spin { display: inline-block; vertical-align: -2px; }

/* Pony next to horse names */
.hname { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.pony-ic { width: 28px; height: 28px; object-fit: contain; flex: none; }
.pony-box { display: inline-flex; align-items: flex-end; justify-content: center; flex: none; }
.dd-own { width: 22px; text-align: center; color: var(--navy-2); margin-right: 6px; }

/* ===================== Phone polish ===================== */
@media (max-width: 820px) {
  /* iPhone zooms into inputs under 16px */
  input, select, textarea, .dd-btn { font-size: 16px; }
  /* installed app: keep clear of the notch */
  .side { padding-top: calc(12px + env(safe-area-inset-top)); }

  /* Page heading: title, then the actions, wrapping onto a second line and sharing the width so none hide off-screen */
  .head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 14px; }
  .head > .row:last-child:not(:first-child), .head > div:last-child:not(:first-child) { flex-wrap: wrap; gap: 8px; }
  .head .btn { flex: 1 1 auto; justify-content: center; padding: 10px 13px; }
  .head .search { flex: 1 0 100%; }
  .head h1 { font-size: 28px; }
  /* horse/member heading: picture beside the name */
  .head > .row:first-child { flex-wrap: nowrap; align-items: center; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  /* Race header: number + name + status on one line, actions in a scrolling row underneath */
  .race-h { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 12px; }
  .race-h > .btn { display: none; }
  .race-h .race-actions { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
  .race-h .race-actions::-webkit-scrollbar { display: none; }
  .race-h .race-actions .btn { display: inline-flex; flex: none; }

  /* Race field: compact runner cards */
  table.field tr { grid-template-columns: auto 1fr auto; column-gap: 10px; row-gap: 2px; padding: 10px 12px; align-items: center; }
  table.field td { grid-column: 2; padding: 0; justify-content: flex-start; text-align: left; font-size: 14px; }
  table.field td::before { content: none !important; }
  table.field td:first-child { grid-column: 1; grid-row: 1 / span 3; align-self: start; padding-top: 4px; }
  table.field td:nth-child(2) { grid-column: 2; grid-row: 1; font-size: 16px; padding: 0; }
  table.field td[data-label="Junior"] { grid-row: 2; color: var(--soft); }
  table.field td[data-label="Distance"] { grid-row: 3; font-weight: 700; color: var(--ink); }
  table.field td.gapc { grid-row: 3; grid-column: 2; justify-content: flex-end; }
  table.field td[data-label="Place"] { grid-column: 3; grid-row: 1; justify-content: flex-end; }
  table.field td[data-label="Place"] .place { font-size: 24px; }
  table.field td[data-label="Time"] { grid-column: 3; grid-row: 2; justify-content: flex-end; color: var(--soft); }
  table.field td:last-child:not([data-label]) { grid-column: 3; grid-row: 2 / span 2; justify-content: flex-end; }
  /* a resulted runner shows its time on row 2, so its Change button drops to row 3 */
  table.field td[data-label="Time"] ~ td:last-child:not([data-label]) { grid-row: 3; }
  table.field .driver .silk { width: 20px; height: 20px; }

  /* Popups become bottom sheets with the buttons always in reach */
  .modal { place-items: end stretch; padding: 0; }
  .modal .box { max-width: none !important; width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; padding: 18px 16px 0;
    display: flex; flex-direction: column; animation: sheetUp .22s cubic-bezier(.2,.8,.2,1); }
  .modal .box > h2 { position: sticky; top: 0; z-index: 2; background: #fff; margin: 0 -16px; padding: 4px 16px 8px; }
  .modal .box::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 99px; background: #d5dde6; margin: -8px auto 10px; flex: none; }
  .modal .foot { position: sticky; bottom: 0; background: #fff; margin: 14px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .modal .foot .btn { flex: 1; justify-content: center; padding: 12px; }
  .modal.confirm { place-items: center; padding: 16px; }
  .modal.confirm .box { border-radius: 14px; animation: pop .16s; padding: 20px; }
  .modal.confirm .box::before { content: none; }
  .modal.confirm .foot { position: static; margin: 16px 0 0; padding: 0; border: 0; }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
  .modal.closing .box { animation: sheetUp .16s ease-in reverse forwards; }
  .modal .box { overflow-y: auto; }

  /* Cards a touch tighter */
  .card { padding: 14px; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 26px; }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) { .modal .box { animation: none; } }
.race-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 820px) { .head > .btn { align-self: flex-start; } }

/* Horse photos */
.horse-photo { border-radius: 99px; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c9d6e6; background: #e8eef5; }
.photo-wrap { position: relative; display: inline-flex; flex: none; }
.photo-btn { position: absolute; right: -4px; bottom: -2px; width: 30px; height: 30px; border-radius: 99px; border: 2px solid #fff; background: var(--navy); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 13px; box-shadow: 0 2px 6px rgba(8,26,51,.3); }
.photo-btn:hover { background: var(--navy-2); }

/* add to home screen guide */
.seg { display: inline-flex; background: #e8eef5; border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(13, 43, 82, .15); }
.steps { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: st; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.step-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 16px; position: relative; }
.steps li { counter-increment: st; }
.step-ic::after { content: counter(st); position: absolute; top: -6px; left: -6px; width: 17px; height: 17px; border-radius: 99px; background: var(--red); color: #fff; font: 700 10.5px/17px sans-serif; text-align: center; }
.install-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.install-banner > i { font-size: 26px; color: var(--navy); }
.install-banner .grow { flex: 1; min-width: 160px; }

/* register filters and sorting */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters .chips + .chips, #typec + .chips { padding-left: 10px; border-left: 1px solid var(--line); }
.filters .search { min-width: 200px; }
.th-sort { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.th-sort i { font-size: 10px; opacity: .35; }
.th-sort.on { color: var(--navy); }
.th-sort.on i { opacity: 1; color: var(--red); }
th.n .th-sort { justify-content: flex-end; }
#sortm { display: none; }
.type-pill { background: #eef2ff; color: #3730a3; }
@media (max-width: 760px) {
  #sortm { display: block; flex: 1 1 100%; }
  .filters .search, .filters .dd, .filters > div:has(> .club-f) { flex: 1 1 100%; min-width: 0; }
  .filters .chips + .chips, #typec + .chips { padding-left: 16px; border-left: 0; }
  .filters .chips { padding-bottom: 2px; }
  .filters .chip { flex: none; }
  .filters > * { flex: 1 1 100%; min-width: 0; }
  .filters > .chips, #typec { flex-basis: calc(100% + 32px); }
  .filters .grow { display: none; }
}
.pill.hist { background: #eef1f5; color: #5a6b80; }

/* racing colours editor */
.silk-ed { display: flex; gap: 16px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.silk-ed-prev { flex: none; width: 84px; display: grid; place-items: center; padding-top: 4px; }
.silk-ed-main { flex: 1; min-width: 0; display: grid; gap: 10px; }
.silk-ed-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-row { display: flex; align-items: center; gap: 8px; }
.sc-lab { width: 58px; flex: none; font-size: 13px; color: var(--soft); font-weight: 600; }
.sc-row .dd { flex: 1; min-width: 0; }
.sc-fine { flex: none; width: 42px; height: 40px; border-radius: 10px; border: 1px solid var(--line); position: relative; cursor: pointer; display: grid; place-items: center; box-shadow: inset 0 0 0 3px #fff; }
.sc-fine input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.sc-fine i { font-size: 12px; color: #fff; mix-blend-mode: difference; pointer-events: none; }
#silkStyle label { margin: 0; }
@media (max-width: 600px) { .silk-ed { flex-direction: column; align-items: stretch; } .silk-ed-prev { width: auto; } }
.silk-ed-prev .silk { width: 76px; height: 76px; }

/* settings: club logo + rules, event handicaps */
.club-set-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin-top: 10px; align-items: start; }
.logo-box { border: 1px dashed var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; background: #fbfcfe; }
.logo-prev { height: 120px; display: grid; place-items: center; background: repeating-conic-gradient(#f1f4f8 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 10px; }
.logo-prev img { max-height: 104px; max-width: 220px; object-fit: contain; }
.rules-form { grid-template-columns: 1fr 1fr; }
.event-pill { background: #eef2ff; color: #3730a3; }
.gala-pill { background: #fef3c7; color: #92400e; }
.bands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.band-col { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; align-content: start; }
.band-col h3 { margin: 0; }
.band-t th { font-size: 12px; }
.band-t td { padding: 4px 4px 4px 0; }
.band-t input.mini { width: 100%; min-width: 70px; }
@media (max-width: 900px) { .club-set-grid, .rules-form, .bands { grid-template-columns: 1fr; } }

/* date picker */
.date-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; min-height: 42px; }
.date-btn:hover { border-color: #b9c7d6; }
.date-btn:focus-visible { outline: 3px solid rgba(29, 78, 216, .25); border-color: var(--navy); }
.date-btn i { color: var(--navy); }
.cal { position: fixed; z-index: 3000; width: 304px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 50px -20px rgba(13, 43, 82, .45); padding: 12px; animation: calin .14s ease; }
@keyframes calin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cal-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.cal-h button { border: 0; background: none; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; color: var(--navy); }
.cal-h button:hover { background: #eef3f9; }
.cal-h .cal-title { width: auto; padding: 0 10px; font: 700 16px var(--font, inherit); }
.cal-h b { font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--soft); padding: 4px 0; }
.cal-grid button { aspect-ratio: 1; border: 0; background: none; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.cal-grid button:hover { background: #eef3f9; }
.cal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--red); }
.cal-grid button.on { background: var(--navy); color: #fff; }
.cal-grid button:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); }
.cal-years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cal-years button { border: 0; background: #f4f7fb; border-radius: 10px; padding: 12px 0; font: inherit; font-weight: 700; cursor: pointer; }
.cal-years button.on, .cal-years button:hover { background: var(--navy); color: #fff; }
.cal-f { display: flex; justify-content: space-between; margin-top: 10px; gap: 8px; }
.cal.cal-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto !important; width: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 50px -20px rgba(13, 43, 82, .5); }
.cal.cal-sheet .cal-grid button { font-size: 17px; }
.name-silk { display: inline-flex; align-items: center; gap: 10px; }
.name-silk > svg { flex: none; }

/* Sponsors */
.sponsor-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: rgba(61, 143, 203, .1); font-size: 13px; vertical-align: middle; }
.sponsor-chip img { height: 24px; width: auto; max-width: 80px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; }
.sponsor-chip i { width: 20px; text-align: center; opacity: .7; }
.new-sponsor-in { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(61, 143, 203, .08); }
@media (max-width: 640px) { .new-sponsor-in { grid-template-columns: 1fr; } }
.sponsor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 12px; }
.sponsor-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px; border: 1px solid rgba(127, 127, 127, .25); border-radius: 14px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: center; }
.sponsor-card:hover { border-color: #3d8fcb; }
.sponsor-card:focus-visible { outline: 2px solid #3d8fcb; outline-offset: 2px; }
.sponsor-logo { height: 54px; width: 100%; display: grid; place-items: center; background: #fff; border-radius: 10px; }
.sponsor-logo img { max-height: 46px; max-width: 90%; object-fit: contain; }
.sponsor-logo i { font-size: 22px; color: #8796a8; }

/* Qualifiers */
.qual-pill { background: #e6e9fb; color: #3b45a8; }
.qual-pill.ready { background: #dff3ea; color: var(--green); }
.qual-card { border-top: 4px solid #3b45a8; margin-bottom: 18px; }
.qual-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.qual-prog { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.qual-prog b { font-family: var(--display); font-size: 26px; display: block; line-height: 1; }
.qual-prog span { color: var(--soft); font-size: 13px; }
.qual-prog .bar { height: 8px; background: #eef1f5; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.qual-prog .bar i { display: block; height: 100%; background: linear-gradient(90deg, #3b45a8, var(--green)); border-radius: 99px; }
.ok-t { color: var(--green); font-weight: 600; }
.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gala-more { margin-top: 12px; } .gala-more summary { cursor: pointer; font-weight: 600; color: var(--navy-2); }
.chip-no { margin: 2px 0 0; }
@media (max-width: 700px) { .reasons { grid-template-columns: 1fr; } }
.hcell { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h1 .qual-pill { vertical-align: middle; font-family: Barlow, sans-serif; font-size: 13px; letter-spacing: 0; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }

/* Racing colours maker */
.maker { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(120% 90% at 0% 0%, #eaf1fa 0%, #f8fafc 55%); }
.mk-prev { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mk-views { display: flex; gap: 6px; justify-content: center; }
.mk-views figure { margin: 0; text-align: center; }
.mk-views figcaption { font-size: 12px; font-weight: 600; color: var(--soft); margin-top: -4px; }
.mk-views .silk { filter: drop-shadow(0 6px 10px rgba(13, 43, 82, .18)); }
.mk-words { margin: 0; font-size: 13px; text-align: center; color: var(--ink); min-height: 2.6em; }
.mk-photo { width: 100%; }
.mk-photo p { margin: 6px 0 0; text-align: center; }
.mk-shot { position: relative; border-radius: 10px; overflow: hidden; cursor: crosshair; touch-action: none; user-select: none; }
.mk-shot img { display: block; width: 100%; pointer-events: none; }
.mk-box { position: absolute; border: 2.5px solid #fff; box-shadow: 0 0 0 1px var(--navy), 0 0 0 9999px rgba(13, 43, 82, .35); border-radius: 6px; pointer-events: none; }
.mk-ctl { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mk-tabs { display: flex; gap: 4px; background: #e8eef5; padding: 4px; border-radius: 11px; flex-wrap: wrap; }
.mk-tabs button { flex: 1; border: 0; background: none; padding: 7px 8px; border-radius: 8px; font-weight: 600; color: var(--soft); cursor: pointer; white-space: nowrap; }
.mk-tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(13, 43, 82, .15); }
.mk-panel { display: flex; flex-direction: column; gap: 10px; }
.mk-g { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--navy); }
.mk-layer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.mk-layer .mk-grid { grid-column: 1 / -1; }
.mk-pat { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; border: 1px solid var(--line); background: #f8fafc; border-radius: 10px; padding: 6px 4px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--navy); }
.mk-pat i { font-size: 10px; color: var(--soft); }
.mk-pat[aria-expanded="true"] { border-color: var(--navy); }
.mk-lc { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mk-lbtns { display: flex; flex-direction: column; gap: 4px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--soft); }
.icon-btn:hover { color: var(--red); border-color: var(--red); }
.mk-text { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: .08em; }
.mk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.mk-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 5px; border: 1.5px solid transparent; border-radius: 10px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--soft); line-height: 1.15; text-align: center; }
.mk-tile:hover { border-color: #b9c7d8; color: var(--navy); }
.mk-tile.on { border-color: var(--navy); color: var(--navy); background: #eef3fa; }
.colours-card .mk-views { padding: 6px 0; }
@media (max-width: 760px) { .maker { grid-template-columns: 1fr; padding: 12px; } .mk-tabs button { flex: 1 1 40%; } }
.maker .silk, .colours-card .silk { width: auto; height: auto; }
.mk-views .silk { width: 150px; height: 150px; }
.mk-tile .silk { width: 46px; height: 46px; }
.mk-pat .silk { width: 34px; height: 34px; }
@media (max-width: 420px) { .mk-views .silk { width: 132px; height: 132px; } }
.mk-lc .sc-row:first-child .sc-lab { display: none; }
.mk-lc .sc-row .sc-lab { width: 52px; }
@media (min-width: 761px) { .mk-prev { position: sticky; top: 8px; align-self: start; } }
/* colour chips and swatch palette */
.cp { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.cp.open { border-color: var(--navy); box-shadow: 0 4px 14px rgba(13, 43, 82, .12); }
.cp-chip { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px 8px 8px; border: 0; background: none; cursor: pointer; text-align: left; }
.cp-chip > i { color: var(--soft); font-size: 12px; transition: transform .15s; }
.cp.open .cp-chip > i { transform: rotate(180deg); }
.cp-sw { flex: none; width: 44px; height: 44px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), inset 0 -8px 14px rgba(0, 0, 0, .08); }
.cp-sw.none { background: repeating-linear-gradient(45deg, #fff 0 6px, #eef1f5 6px 12px); }
.cp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cp-txt small { color: var(--soft); font-size: 12px; font-weight: 600; }
.cp-txt b { font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-pal { padding: 4px 12px 12px; border-top: 1px solid var(--line); background: #fbfcfe; }
.cp-f { margin: 10px 0 6px; font-size: 12px; font-weight: 700; color: var(--soft); }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 7px; }
.cp-s { aspect-ratio: 1; min-height: 40px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .16), 0 1px 2px rgba(13, 43, 82, .15); transition: transform .1s; }
.cp-s:hover { transform: scale(1.1); }
.cp-s.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--navy); }
.cp-none { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 600; }
.cp-none .cp-sw { width: 32px; height: 32px; }
.cp-none.on { border-color: var(--navy); }
.cp-custom { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 10px; border: 1.5px dashed #b9c7d8; border-radius: 12px; cursor: pointer; font-weight: 600; color: var(--navy); position: relative; }
.cp-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cp-name { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cp-name span { font-size: 13px; font-weight: 600; color: var(--soft); flex: none; }
.cp-name input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; }
.mk-tabs button i { margin-right: 4px; opacity: .8; }
.mk-pat small { font-size: 11px; font-weight: 600; color: var(--soft); }
.mk-pat .silk { width: 44px; height: 44px; }
.mk-pat { width: 90px; }
.mk-add { justify-content: center; border-style: dashed; }
.mk-tile .silk { width: 54px; height: 54px; }
.mk-tiles { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.mk-views .silk { width: 170px; height: 170px; }
@media (max-width: 760px) {
  .mk-layer { grid-template-columns: auto minmax(0, 1fr); }
  .mk-lbtns { grid-column: 2; flex-direction: row; justify-content: flex-end; }
  .mk-views .silk { width: 150px; height: 150px; }
  .mk-tabs button { flex: 1 1 30%; font-size: 13px; padding: 8px 4px; }
  .cp-grid { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; }
}
/* member families */
.fam { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; display: flex; flex-direction: column; gap: 10px; }
.fam-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fam-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fam-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-weight: 600; color: var(--navy); text-decoration: none; }
.fam-chip > i { color: var(--soft); }
.fam-chip button { border: 0; background: #eef1f5; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; color: var(--soft); }
.fam-chip button:hover { background: #fbe3e7; color: var(--red); }
a.fam-chip { padding-right: 12px; }
.fam-new { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; }
.fam-new input { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.fam-card .fam-list { margin-top: 8px; }
.fam-link { color: var(--navy-2); }
.warn-t { color: var(--amber); font-weight: 600; }
#famNewBtn { align-self: flex-start; }
@media (max-width: 600px) { .fam-new { grid-template-columns: 1fr 1fr auto; } .fam-new input[data-nf=phone] { grid-column: 1 / 3; grid-row: 2; } }
.sen-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #e8eef5; color: var(--navy); display: inline-grid; place-items: center; font-size: 12px; }
.sen-ic.big { width: 56px; height: 56px; font-size: 24px; }
.sen-pill { background: #ece8fb; color: #4c3a9e; }

/* profile button (bottom left) and profile page */
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: .02em;
  background: linear-gradient(135deg, #d0233f, #8f1730); color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.avatar.big { width: 76px; height: 76px; font-size: 30px; }
.me-card { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.07); color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.1); }
.me-card:hover, .me-card.on { background: rgba(255,255,255,.14); }
.me-card .me-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-card .me-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .me-txt small { font-size: 11.5px; color: rgba(255,255,255,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card > i { font-size: 11px; opacity: .6; }
.side .me { margin-top: 0; }
.side .me button { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; opacity: .8; }
.sheet-me { display: flex !important; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.sheet-me > span:last-child { display: flex; flex-direction: column; }
.prof-hero { display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: 16px; margin-bottom: 18px; color: #fff; flex-wrap: wrap;
  background: radial-gradient(120% 140% at 100% 0%, #1f4f8f 0%, var(--navy) 60%); }
.prof-hero h1 { color: #fff; } .prof-hero .muted { color: rgba(255,255,255,.7); }
.prof-hero .pill { background: rgba(255,255,255,.14); color: #fff; }
.signout-big { width: 100%; justify-content: center; margin-top: 4px; }

/* family area */
.fam-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 26px 24px 34px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(90% 120% at 100% 0%, #d0233f 0%, rgba(208,35,63,0) 55%), linear-gradient(135deg, #163d6f, var(--navy)); }
.fam-hero h1 { color: #fff; font-size: 38px; } .fam-hero .hero-sub { color: rgba(255,255,255,.85); }
.fam-hero .pill { vertical-align: middle; }
.fam-waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70px; }
.fam-hero-in { position: relative; }
.sec-h { margin: 22px 0 10px; }
.kid-grid, .horse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.kid { display: flex; gap: 14px; align-items: center; }
.kid-silks { display: flex; flex: none; } .kid-silks .silk { width: 72px; height: 72px; }
.hcard { display: flex; gap: 14px; align-items: flex-start; }
.hcard-pic { flex: none; background: radial-gradient(circle at 50% 70%, #eaf1fa, #fff 70%); border-radius: 14px; }
.hstats { display: flex; gap: 16px; margin-top: 8px; }
.hstats div { display: flex; flex-direction: column; gap: 2px; }
.hstats b { font-family: var(--display); font-size: 20px; line-height: 1; }
.hstats span { font-size: 11.5px; color: var(--soft); }
.race-pill { background: #e3ecf8; color: var(--navy); }
.daybadge { flex: none; width: 50px; height: 54px; border-radius: 12px; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.daybadge b { font-family: var(--display); font-size: 24px; } .daybadge small { font-size: 11px; text-transform: uppercase; opacity: .8; margin-top: 2px; }
.mt-list { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.mt-row { display: flex; gap: 12px; align-items: flex-start; }
.min-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.min-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: inherit; background: #fff; }
.min-row:hover { border-color: var(--navy-2); }
.min-row > i:first-child { font-size: 22px; color: var(--red); }
.min-row .grow { display: flex; flex-direction: column; min-width: 0; }
.min-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .min-item .min-row { flex: 1 1 300px; }
.min-act { display: flex; gap: 8px; align-items: center; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px; border: 2px dashed #b9c7d8; cursor: pointer; text-align: center; background: #f8fafc; }
.drop i { font-size: 30px; color: var(--navy-2); } .drop.over { border-color: var(--navy); background: #eef3fa; }
.up-bar { height: 8px; background: #eef1f5; border-radius: 99px; overflow: hidden; } .up-bar i { display: block; height: 100%; width: 0; background: var(--navy); transition: width .2s; }
.nom-list { display: flex; flex-direction: column; gap: 14px; }
.nom-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nom-horses { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.nom-h { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); }
.nom-h.on { border-color: #b7e0cc; background: #f3fbf7; }
.login-card .row { flex-wrap: nowrap; } .login-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #fdf0f2; color: var(--red); display: grid; place-items: center; font-size: 18px; }
.noms { border-left: 4px solid var(--red); margin-bottom: 18px; }
.nom-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.nom-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px; border-radius: 12px; background: #f8fafc; }
.nom-row.done { opacity: .7; }
.nom-row select { max-width: 160px; }
@media (max-width: 600px) { .fam-hero h1 { font-size: 32px; } .kid-grid, .horse-grid { grid-template-columns: 1fr; } .login-card .row { flex-wrap: wrap; } .login-card .btn { width: 100%; justify-content: center; } }

.first-marks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .first-marks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .first-marks label.f > span { font-size: 12px; } }
.prof-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.prof-link .grow { display: flex; flex-direction: column; }
.prof-link:hover { border-color: var(--navy-2); }
.ai-card { padding: 0; overflow: hidden; }
.ai-hero { position: relative; color: #fff; padding: 22px 22px 26px; background: radial-gradient(80% 140% at 100% 0%, rgba(208,35,63,.9) 0%, rgba(208,35,63,0) 55%), linear-gradient(135deg, #163d6f, var(--navy)); }
.ai-waves { position: absolute; inset: 0; width: 100%; height: 100%; }
.ai-hero-in { position: relative; }
.ai-hero h2 { color: #fff; font-size: 26px; } .ai-hero p { color: rgba(255,255,255,.85); margin: 6px 0 0; max-width: 640px; }
.ai-url { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 8px 8px 8px 14px; border-radius: 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); flex-wrap: wrap; }
.ai-url-l { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.7); width: 100%; margin-bottom: -6px; }
.ai-url code { flex: 1; min-width: 0; color: #fff; font: 600 16px Barlow, sans-serif; overflow-wrap: anywhere; }
.ai-tabs { display: flex; gap: 6px; padding: 14px 18px 0; overflow-x: auto; scrollbar-width: none; }
.ai-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; color: var(--ink); white-space: nowrap; }
.ai-tab svg, .ai-tab > i { flex: none; } .ai-tab > i { font-size: 17px; color: var(--soft); }
.ai-tab.on { border-color: var(--navy); background: #eef3fa; box-shadow: inset 0 -2px 0 var(--navy); }
.ai-term { background: #13233a; border-radius: 5px; padding: 3px; }
.ai-pane { padding: 4px 18px 6px; }
.ai-steps { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
.ai-steps li { counter-increment: s; position: relative; padding-left: 38px; min-height: 28px; }
.ai-steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 13px Barlow, sans-serif; }
.ai-steps code { background: #eef1f5; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; overflow-wrap: anywhere; }
.ai-conns { padding: 6px 18px 18px; border-top: 1px solid var(--line); margin-top: 14px; }
.conn-list { display: flex; flex-direction: column; gap: 8px; }
.conn { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 14px; }
.conn .grow { display: flex; flex-direction: column; }
.ai-url code { font-family: Barlow, sans-serif; font-weight: 600; letter-spacing: .01em; }
/* horse markings */
.mk-horse { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(120% 90% at 0% 0%, #eaf1fa 0%, #f8fafc 55%); }
.mkh-views, .marks-views { display: flex; align-items: flex-end; gap: 8px; justify-content: center; }
.mkh-views figure, .marks-views figure { margin: 0; text-align: center; }
.mkh-views img { height: 150px; } .marks-views img { height: 140px; }
.mkh-views figcaption, .marks-views figcaption { font-size: 12px; font-weight: 600; color: var(--soft); }
.mkh-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 12px 0; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.marks-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
@media (max-width: 760px) { .mk-horse { grid-template-columns: 1fr; } .mkh-views img { height: 130px; } .marks-views img { height: 120px; } }
.moved-note { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(13, 43, 82, .25); font-size: 14px; }
.moved-note > i { color: var(--red); font-size: 20px; } .moved-note span { flex: 1; }
@media (max-width: 820px) { .moved-note { bottom: calc(76px + env(safe-area-inset-bottom)); flex-wrap: wrap; } }
/* club email */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.tabbar .nav-badge { position: absolute; top: 4px; margin-left: 14px; }
.mail-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 26px 24px 34px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(90% 120% at 100% 0%, #3b82f6 0%, rgba(59,130,246,0) 55%), linear-gradient(135deg, #163d6f, var(--navy)); }
.mail-hero h1 { color: #fff; font-size: 36px; } .mail-hero .hero-sub { color: rgba(255,255,255,.85); }
.hero-btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.mail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.mailbox { display: flex; flex-direction: column; gap: 10px; }
.mb-head { display: flex; align-items: center; gap: 12px; } .mb-head .grow { display: flex; flex-direction: column; min-width: 0; }
.mail-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #e3ecf8; color: var(--navy); font-size: 17px; }
.mail-ic.shared { background: #fdf0f2; color: var(--red); }
.unread-pill { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.unread-t { color: var(--red); }
.mb-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mb-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; text-decoration: none; color: inherit; border-top: 1px solid #eef1f5; }
.mb-row:first-child { border-top: 0; } .mb-row:hover { background: #f8fafc; }
.mb-row .grow { display: flex; flex-direction: column; min-width: 0; } .mb-row .grow > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-row .grow b { font-weight: 500; font-size: 14px; } .mb-row .grow span { font-size: 13px; color: var(--soft); }
.mb-row.new .grow b { font-weight: 700; } .mb-row.new .grow span { color: var(--ink); }
.mb-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; } .mb-row.new .mb-dot { background: #3b82f6; }
.mb-open { align-self: flex-start; }
#dashMail:not(:empty) { margin-top: 16px; }
.mail-strip { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; padding: 16px 20px; }
.mail-strip .grow { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.mail-strip .grow b { font-size: 15px; }
.mail-strip .boxes { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-strip .boxes > span { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: #f2f5fa; border: 1px solid var(--line); overflow-wrap: anywhere; line-height: 1.3; }
.mail-strip .boxes > span.has { background: #fdf0f2; border-color: #f4d3da; }
.mail-strip .boxes .n { font-weight: 700; color: var(--muted, #6b7a90); white-space: nowrap; }
.mail-strip .boxes .has .n { color: var(--red); }
.mail-strip:hover { border-color: #c9d6e8; }
@media (max-width: 600px) { .mail-grid { grid-template-columns: 1fr; } .mail-hero h1 { font-size: 30px; } }
.mail-grid > .card { margin: 0; align-self: start; }
/* viewing as someone else */
.view-as-bar { position: sticky; top: 0; z-index: 70; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #7a1630; color: #fff; font-size: 14px;
  background: repeating-linear-gradient(135deg, #8f1730 0 14px, #7a1630 14px 28px); box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.view-as-bar span { flex: 1; } .view-as-bar .btn { background: #fff; color: #7a1630; border-color: #fff; font-weight: 700; white-space: nowrap; }

@media (max-width: 820px) { .view-as-bar { font-size: 12.5px; padding: 8px 10px; } }
/* mail app */
.mail-app { display: grid; grid-template-columns: 230px 340px minmax(0, 1fr); gap: 0; height: calc(100vh - 80px); min-height: 520px; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.mail-side { border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 12px; background: #f8fafc; overflow-y: auto; }
.mail-new { justify-content: center; }
.mail-boxes, .mail-folders { display: flex; flex-direction: column; gap: 4px; }
.mail-box { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: 12px; background: none; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.mail-box .grow { display: flex; flex-direction: column; min-width: 0; } .mail-box small { color: var(--soft); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-box .mail-ic { width: 34px; height: 34px; font-size: 14px; }
.mail-box.on { background: #fff; border-color: var(--line); box-shadow: 0 1px 3px rgba(13, 43, 82, .08); }
.mail-folder { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--soft); font: 600 14px Barlow, sans-serif; text-align: left; }
.mail-folder i { width: 16px; text-align: center; } .mail-folder.on { background: #e3ecf8; color: var(--navy); }
.mail-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.mail-search { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); } .mail-search input { flex: 1; }
#mRows { overflow-y: auto; flex: 1; }
.mail-row { display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid #eef1f5; background: #fff; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.mail-row:hover { background: #f8fafc; } .mail-row.on { background: #eef3fa; }
.mail-row .mb-dot { margin-top: 7px; } .mail-row.new .mb-dot { background: #3b82f6; }
.mail-row .grow { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.mr-top { display: flex; gap: 8px; align-items: baseline; } .mr-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; } .mr-top small { color: var(--soft); white-space: nowrap; }
.mail-row.new .mr-top b { font-weight: 700; }
.mr-sub { font-size: 13px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mail-row.new .mr-sub { color: var(--ink); }
.mr-who { font-size: 11.5px; color: var(--green); font-weight: 600; }
.mail-more { margin: 10px auto; display: flex; }
.mail-read { overflow-y: auto; padding: 14px 20px 20px; min-width: 0; }
.mail-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--soft); gap: 8px; } .mail-empty i { font-size: 34px; opacity: .5; }
.mr-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; } .mr-back { display: none; }
.mr-subject { font-size: 24px; margin: 0 0 12px; }
.mr-head { display: flex; gap: 10px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; box-shadow: none; }
.mr-activity { margin: 0 0 10px; }
.mr-body { width: 100%; border: 0; min-height: 200px; display: block; background: #fff; }
.mr-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; } .mr-att { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--navy); font-size: 13px; }
.mr-reply { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--green); background: #f3fbf7; border-radius: 0 10px 10px 0; } .mr-reply-text { white-space: pre-wrap; font-size: 14px; margin-top: 4px; }
@media (max-width: 1100px) { .mail-app { grid-template-columns: 210px minmax(0, 1fr); } .mail-read { display: none; } .mail-app.reading .mail-list { display: none; } .mail-app.reading .mail-read { display: block; } .mail-app.reading .mr-back { display: inline-flex; } }
@media (max-width: 760px) {
  .mail-app { grid-template-columns: 1fr; height: auto; min-height: 0; border-radius: 14px; }
  .mail-side { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: column; }
  .mail-boxes, .mail-folders { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .mail-box { flex: none; } .mail-box small { display: none; } .mail-folder { flex: none; }
  .mail-app.reading .mail-side { display: none; }
  #mRows { max-height: none; } .mail-read { padding: 12px; }
}
/* mail: read dot, folders, right-click menu */
.mail-row { cursor: pointer; }
.mr-dot { flex: none; width: 22px; height: 22px; margin: 0 -4px 0 -6px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.mr-dot span { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid transparent; transition: background .12s, border-color .12s, transform .12s; }
.mail-row.new .mr-dot span { background: #3b82f6; }
.mail-row:hover .mr-dot span { border-color: #93b4e6; } .mr-dot:hover span { transform: scale(1.25); }
.mail-row .mb-dot { display: none; }
.mail-folder .grow { text-align: left; } .f-count { font-weight: 700; color: var(--navy); background: #dbe7f7; border-radius: 99px; padding: 0 7px; font-size: 11.5px; }
.mail-folder.add { color: var(--navy-2); font-weight: 600; }
.mr-seen { gap: 7px; } .mr-dot-ic { width: 10px; height: 10px; border-radius: 50%; background: #3b82f6; display: inline-block; }
.ctx-menu { position: fixed; z-index: 120; min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 38px rgba(13, 43, 82, .22); animation: ctxIn .1s ease-out; }
@keyframes ctxIn { from { opacity: 0; transform: scale(.97); } }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; font: 500 14px Barlow, sans-serif; color: var(--ink); text-align: left; }
.ctx-menu button i { width: 16px; text-align: center; color: var(--soft); }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: #eef3fa; outline: none; }
.ctx-menu button.danger, .ctx-menu button.danger i { color: var(--red); }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.ctx-chev { margin-left: auto; font-size: 10px; }
.ctx-sub { position: relative; } .ctx-subm { display: none; padding-left: 14px; } .ctx-sub.open .ctx-subm, .ctx-sub:hover .ctx-subm { display: block; }
.ctx-sub.open .ctx-chev, .ctx-sub:hover .ctx-chev { transform: rotate(90deg); }
/* qualifier progress in the horses list */
.qbar { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 150px; }
.qbar-track { display: block; width: 100%; height: 7px; border-radius: 99px; background: #e6e9fb; overflow: hidden; }
.qbar-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3b45a8, var(--green)); }
.qbar-txt { font-size: 12px; color: var(--soft); white-space: nowrap; }
@media (max-width: 760px) { .qbar { align-items: stretch; min-width: 0; width: 100%; } .qbar-txt { text-align: right; } }
.icon-btn:disabled { cursor: default; opacity: .85; } .icon-btn .fa-spin { color: var(--navy-2); }
@media (max-width: 820px) { .side .me-card, .side .me { display: none !important; } } /* phones: profile and sign out live under More (or the Profile tab) */
.sheet:focus { outline: none; }
.sheet .sheet-me { flex-direction: row !important; align-items: center; gap: 12px; text-align: left; padding: 10px 12px 14px !important; }
.sheet .sheet-me .grow { display: flex; flex-direction: column; min-width: 0; } .sheet .sheet-me b { font-size: 16px; }
.sheet .sheet-me .avatar { width: 44px; height: 44px; font-size: 18px; }
.sheet .sheet-me { margin: 4px 8px 10px; border-radius: 14px; background: linear-gradient(135deg, #eef3fa, #fdf0f2); border: 1px solid #dbe5f2 !important; padding: 12px !important; }
.sheet .sheet-me:active { transform: scale(.99); }
.prof-go { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--navy); color: #fff; font-weight: 600; font-size: 13px; }
.prof-go i { font-size: 10px; }
.sheet .sheet-me { margin: 4px 0 10px !important; width: auto !important; box-sizing: border-box; }
.prof-go { white-space: nowrap; }
.sheet .prof-go { flex-direction: row !important; display: inline-flex !important; width: auto !important; }
.mk-side { display: inline-flex; gap: 4px; padding: 4px; background: #e8eef5; border-radius: 11px; align-self: flex-start; }
.mk-side button { border: 0; background: none; padding: 7px 18px; border-radius: 8px; font-weight: 700; color: var(--soft); cursor: pointer; }
.mk-side button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(13, 43, 82, .15); }
.mk-own { margin: 0; }
.mk-views figure { cursor: pointer; border-radius: 14px; padding: 4px; border: 2px solid transparent; transition: border-color .12s; }
.mk-views figure.on { border-color: var(--navy); background: rgba(255, 255, 255, .6); }
/* notifications intro */
.ni-hero { position: relative; border-radius: 16px; padding: 26px 18px 18px; background: radial-gradient(90% 120% at 100% 0%, #d0233f 0%, rgba(208,35,63,0) 55%), linear-gradient(135deg, #163d6f, var(--navy)); display: flex; flex-direction: column; align-items: center; gap: 14px; overflow: hidden; }
.ni-bell { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; font-size: 24px; animation: niRing 2.4s ease-in-out infinite; }
@keyframes niRing { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .ni-bell { animation: none; } }
.ni-toast { width: min(320px, 100%); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.95); box-shadow: 0 10px 26px rgba(0,0,0,.25); text-align: left; }
.ni-toast img { width: 34px; height: 34px; border-radius: 8px; } .ni-toast span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ni-toast b { font-size: 14px; } .ni-toast small { color: var(--soft); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ni-toast em { font-style: normal; font-size: 11px; color: var(--soft); align-self: flex-start; }
/* phones: one slim header row, the club logo in the corner and the club switcher beside it */
@media (min-width: 821px) { .viewing-as .side { top: 42px; height: calc(100vh - 42px); } }
@media (max-width: 820px) {
  .viewing-as .side { top: auto; height: auto; }
  .side { flex-wrap: nowrap; gap: 12px; padding-bottom: 10px; }
  .side .brand { padding: 0; flex: none; }
  .side .brand img { width: 38px; height: 38px; }
  .side .club { min-width: 0; }
  .side .club select { padding: 9px 10px; }
  body.club-logo .side .brand > div { display: none; }
  body.club-logo .side .brand img { height: 40px; width: auto; max-width: 112px; }
  .view-as-bar { gap: 8px; padding: 6px 10px; line-height: 1.25; }
  .view-as-bar span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .view-as-bar .btn { padding: 6px 10px; }
}
.view-as-bar .va-more { font-style: normal; }
@media (max-width: 820px) { .view-as-bar .va-more { display: none; } }
/* ===== mail: sender pictures, and a proper phone mail app ===== */
.mail-row { display: block; padding: 0; position: relative; overflow: hidden; }
.mr-in { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; background: #fff; position: relative; z-index: 1; transition: transform .2s ease; }
.mail-row:hover .mr-in { background: #f8fafc; } .mail-row.on .mr-in { background: #eef3fa; }
.mr-av { flex: none; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #eef2f7; box-shadow: inset 0 0 0 1px rgba(13,43,82,.06); }
.mr-av.big { width: 42px; height: 42px; }
.mr-in .mr-dot { align-self: center; } .mr-clip { margin-top: 3px; }
.mail-top, .mail-fab, .mr-swipe, .mail-side-bg, .mr-foot, .mail-side-grab { display: none; }
@media (max-width: 760px) {
  /* edge to edge, like a phone mail app */
  .mail-app { margin: -18px -16px 0; border: 0; border-radius: 0; background: #fff; min-height: calc(100vh - 140px); }
  .mail-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px; }
  .mail-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; color: var(--ink); cursor: pointer; }
  .mail-pick .grow { display: flex; flex-direction: column; min-width: 0; }
  .mail-pick b { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.05; color: var(--navy); }
  .mail-pick small { color: var(--soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mail-pick > i { color: var(--navy); font-size: 14px; width: 34px; height: 34px; border-radius: 50%; background: #eef3fa; display: grid; place-items: center; flex: none; }
  /* inboxes and folders: a sheet from the bottom */
  .mail-side { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1700; max-height: 80vh; border: 0; border-radius: 20px 20px 0 0; background: #fff; padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(13,43,82,.25); transform: translateY(105%); transition: transform .25s cubic-bezier(.2,.8,.3,1); visibility: hidden; }
  .mail-app.picking .mail-side { transform: none; visibility: visible; }
  .mail-side-grab { display: block; width: 40px; height: 5px; border-radius: 99px; background: #d5dde6; margin: 2px auto 6px; flex: none; }
  .mail-side-bg { display: block; position: fixed; inset: 0; z-index: 1650; background: rgba(8,20,40,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .mail-app.picking .mail-side-bg { opacity: 1; pointer-events: auto; }
  body.mail-picking { overflow: hidden; }
  .mail-boxes, .mail-folders { flex-direction: column; overflow: visible; }
  .mail-box small { display: block; } .mail-box { padding: 10px; }
  .mail-folder { padding: 12px; font-size: 16px; }
  .mail-side .mail-new { display: none; }
  .mail-app.reading .mail-side { display: flex; }
  /* list */
  .mail-list { border: 0; }
  .mail-search { border: 0; padding: 4px 16px 10px; }
  .mail-search input { border-radius: 99px; background: #eef2f7; border-color: transparent; padding: 10px 16px; }
  .mail-search input:focus { background: #fff; border-color: var(--line); }
  .mail-search .icon-btn { border-radius: 50%; }
  .mr-in { padding: 12px 16px 12px 8px; gap: 10px; }
  .mail-row { border-bottom: 0; } .mail-row + .mail-row .mr-in::before { content: ""; position: absolute; top: 0; left: 76px; right: 0; border-top: 1px solid #edf0f4; }
  .mr-av { width: 44px; height: 44px; }
  .mr-in .mr-dot { margin: 0 -6px 0 -2px; }
  .mr-top b { font-size: 16px; } .mr-top small { font-size: 13px; }
  .mr-sub { font-size: 14.5px; }
  .mail-row:hover .mr-in { background: #fff; } .mail-row:active .mr-in { background: #f3f6fa; }
  /* swipe actions under the row */
  .mr-swipe { display: flex; position: absolute; inset: 0; align-items: center; gap: 8px; padding: 0 24px; color: #fff; font-weight: 700; font-size: 14px; opacity: 0; }
  .mr-swipe.seen { background: #3b82f6; justify-content: flex-start; }
  .mr-swipe.arch { background: var(--green); justify-content: flex-end; }
  .mail-row.sw-r .mr-swipe.seen, .mail-row.sw-l .mr-swipe.arch { opacity: 1; }
  .mr-swipe i { transition: transform .15s; } .mail-row.sw-go .mr-swipe i { transform: scale(1.3); }
  .mail-list .mail-more { margin: 14px auto; display: flex; }
  /* new message button */
  .mail-fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 1400; width: 58px; height: 58px; border-radius: 18px; border: 0;
    background: var(--red); color: #fff; font-size: 20px; box-shadow: 0 8px 22px rgba(208,35,63,.4); cursor: pointer; }
  .mail-fab:active { transform: scale(.95); }
  .mail-app.reading .mail-fab, .mail-app.reading .mail-top { display: none; }
  /* reading */
  .mail-read { padding: 0 16px 24px; }
  .mr-bar { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); margin: 0 -16px 8px; padding: 8px 10px; border-bottom: 1px solid #edf0f4; }
  .mr-back { border: 0; background: none; color: var(--navy-2); font-weight: 700; padding: 6px 4px; }
  .mr-bar #mReply { display: none; }
  .mr-seen-l { display: none; } .mr-seen { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
  .mr-subject { font-size: 22px; line-height: 1.2; }
  .mr-head { gap: 12px; }
  .mr-head .nowrap { font-size: 12px; }
  .mr-foot { display: flex; position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 4; margin: 16px 0 0; }
  .mr-foot .btn { flex: 1; justify-content: center; padding: 13px; font-size: 16px; border-radius: 14px; box-shadow: 0 6px 18px rgba(13,43,82,.18); }
}
@media (max-width: 760px) { .mail-app { display: flex; flex-direction: column; } .mail-list { flex: 1; } .mail-app.reading .mail-list { display: none; } }
@media (max-width: 760px) { body.mail-picking .tabbar, body.mail-picking .mail-fab { display: none; } .mail-side { overflow-y: auto; } }
.mail-none { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; } .mail-none i { font-size: 30px; opacity: .45; }
@media (max-width: 760px) {
  .mail-app { overflow: visible; }
  .viewing-as .mr-bar { top: 42px; }
  .mr-atts { margin-bottom: 4px; }
}
@media (max-width: 760px) { main.enter > .mail-app { animation: none; } } /* a lingering transform would pin the new-message button and the folder sheet to the page instead of the screen */
/* ===== help page and the tour ===== */
.help-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.help-item { padding: 0; }
.help-item summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary .ic { width: 36px; height: 36px; border-radius: 10px; background: #eef3fa; color: var(--navy); display: grid; place-items: center; flex: none; }
.help-item summary .grow { display: flex; flex-direction: column; gap: 2px; }
.help-item[open] summary .fa-chevron-down { transform: rotate(180deg); }
.help-item ul { margin: 0 16px 12px 64px; padding-left: 16px; line-height: 1.55; }
.help-item ul li { margin-bottom: 4px; }
.help-item .btn { margin: 0 16px 16px 64px; }
@media (max-width: 820px) {
  .help-item ul, .help-item .btn { margin-left: 16px; }
}
/* the coach: a bubble that moves to what it's explaining */
.coach { position: fixed; z-index: 2800; width: min(330px, calc(100vw - 24px)); background: var(--navy); color: #fff; border-radius: 14px; padding: 13px 15px; box-shadow: 0 16px 44px rgba(8,20,40,.35); transition: left .35s cubic-bezier(.2,.8,.2,1), top .35s cubic-bezier(.2,.8,.2,1); }
.coach.coach-in { animation: coachIn .3s ease; }
@keyframes coachIn { from { opacity: 0; transform: scale(.94); } }
.coach::after { content: ''; position: absolute; left: calc(var(--ax, 50%) - 8px); width: 16px; height: 16px; background: var(--navy); transform: rotate(45deg); border-radius: 3px; }
.coach[data-side="below"]::after { top: -6px; } .coach[data-side="above"]::after { bottom: -6px; } .coach[data-side="none"]::after { display: none; }
.coach-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.coach-top b { font-size: 16px; } .coach .muted { color: rgba(255,255,255,.65); }
.coach .icon-btn { color: #fff; background: rgba(255,255,255,.12); }
.coach p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.45; position: relative; z-index: 1; }
.coach-bar { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.coach .btn { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }
.coach .btn.primary { background: #fff; color: var(--navy); }
.coach-tap { font-size: 13px; color: #ffd3da; } .coach-tap i { animation: coachTap 1.2s ease-in-out infinite; }
@keyframes coachTap { 50% { transform: translateY(-3px); } }
.coach-ring { position: fixed; z-index: 2790; pointer-events: none; border-radius: 12px; box-shadow: 0 0 0 3px #d0233f, 0 0 0 9999px rgba(8,20,40,.28); transition: all .35s cubic-bezier(.2,.8,.2,1); animation: coachPulse 1.6s ease-in-out infinite; }
@keyframes coachPulse { 50% { box-shadow: 0 0 0 6px rgba(208,35,63,.55), 0 0 0 9999px rgba(8,20,40,.28); } }
@media (prefers-reduced-motion: reduce) { .coach, .coach-ring { transition: none; animation: none; } .coach-tap i { animation: none; } }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 22px; max-width: 760px; }
.lesson { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; cursor: pointer; border: 1px solid var(--line); font: inherit; color: inherit; }
.lesson:hover { border-color: var(--navy); }
.lesson .ic-wrap .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; }

/* Search (Cmd/Ctrl+K) */
.find-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: rgba(255,255,255,.8); cursor: pointer; text-align: left; }
.find-btn:hover { background: rgba(255,255,255,.13); color: #fff; }
.find-btn:focus-visible { outline: 2px solid #8cc4ec; outline-offset: 2px; }
.find-btn span { flex: 1; }
.find-btn kbd { font: 600 11.5px Barlow, sans-serif; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,.14); color: rgba(255,255,255,.85); }
.find-bg { position: fixed; inset: 0; z-index: 2500; background: rgba(13, 27, 45, .45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: findIn .14s ease-out; }
.find { width: 100%; max-width: 620px; background: var(--paper); border-radius: 14px; box-shadow: 0 24px 60px rgba(13, 27, 45, .35); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.find-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--soft); }
.find .find-in input#findQ { flex: 1; border: 0; outline: 0; box-shadow: none; padding: 4px 0; border-radius: 0; font-size: 17px; background: transparent; color: var(--ink); min-width: 0; }
.find-in input::-webkit-search-cancel-button { display: none; }
.find-in kbd { font: 600 11px Barlow, sans-serif; padding: 2px 6px; border-radius: 5px; background: var(--bg); color: var(--soft); border: 1px solid var(--line); }
.find-list { overflow-y: auto; padding: 6px; }
.find-g { font-size: 11.5px; font-weight: 700; color: var(--soft); padding: 10px 10px 4px; }
.find-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.find-row .ic { width: 20px; text-align: center; color: var(--navy-2); }
.find-row b { display: block; font-weight: 600; }
.find-row small { display: block; color: var(--soft); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-row .grow { min-width: 0; }
.find-row.on { background: #e8f0f9; }
.find-enter { color: var(--soft); opacity: 0; font-size: 12px; }
.find-row.on .find-enter { opacity: 1; }
.find-empty { padding: 22px 12px; color: var(--soft); text-align: center; }
@keyframes findIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .find-bg { animation: none; } }
@media (max-width: 820px) {
  .find-btn { width: auto; flex: none; padding: 9px 11px; }
  .find-btn span, .find-btn kbd { display: none; }
  .find-bg { padding: 10px; }
  .find { max-height: 80vh; }
}

/* Club files */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ftabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ftab { border: 1px solid transparent; background: none; border-radius: 99px; padding: 7px 13px; font-weight: 600; color: var(--soft); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.ftab:hover { background: #e8eef5; color: var(--ink); }
.ftab.on { background: var(--navy); color: #fff; }
.fsearch { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 0 12px; color: var(--soft); min-width: 220px; }
.fsearch input[type=search] { border: 0; box-shadow: none; padding: 7px 0; background: transparent; flex: 1; min-width: 0; }
.fsearch input[type=search]:focus { box-shadow: none; outline: 0; }
.fsearch:focus-within { border-color: var(--navy-2); }
.fcard { padding: 0; overflow: hidden; transition: box-shadow .15s, background .15s; }
.fcard.fdrop-all { box-shadow: 0 0 0 3px #3d8fcb inset; background: #f3f8fd; }
.fcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.fcrumbs a { text-decoration: none; color: var(--navy-2); padding: 2px 6px; border-radius: 6px; }
.fcrumbs a:last-child { color: var(--ink); }
.fcrumbs i { font-size: 10px; color: var(--soft); }
.ftable { width: 100%; border-collapse: collapse; }
.ftable th { text-align: left; font-size: 12px; color: var(--soft); font-weight: 600; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.ftable td { padding: 9px 16px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.ftable tr:last-child td { border-bottom: 0; }
.frow { cursor: pointer; }
.frow:hover td { background: #f6f9fc; }
.fname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fname > span { min-width: 0; }
.fname b { font-weight: 600; word-break: break-word; }
.fname small { display: block; color: var(--soft); font-size: 12px; }
.fname > i { font-size: 20px; width: 22px; text-align: center; flex: none; }
.fk-folder { color: #e3a21a; }
.fk-file { color: var(--navy-2); }
.fa-file-pdf.fk-file { color: #d0233f; } .fa-file-image.fk-file { color: #1f8a5b; } .fa-file-excel.fk-file { color: #1d7044; } .fa-file-word.fk-file { color: #2b5fb4; }
.fshow { display: none !important; }
.fdrop td, .fcrumbs a.fdrop { background: #dcebf8 !important; }
.fempty { display: grid; justify-items: center; gap: 6px; padding: 46px 16px; color: var(--soft); text-align: center; }
.fempty i { font-size: 34px; color: #b9c6d5; }
.fempty b { color: var(--ink); }
.fnote { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.nowrap { white-space: nowrap; }
.fmenu { position: absolute; z-index: 2600; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(13,27,45,.18); padding: 5px; min-width: 210px; }
.fmenu button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-align: left; }
.fmenu button:hover, .fmenu button:focus-visible { background: #eef3f9; outline: 0; }
.fmenu button i { width: 16px; color: var(--soft); }
.fmenu button.neg, .fmenu button.neg i { color: var(--red); }
.fup-list { position: fixed; right: 18px; bottom: 18px; z-index: 2400; width: min(360px, calc(100vw - 36px)); background: var(--paper); border-radius: 12px; box-shadow: 0 16px 40px rgba(13,27,45,.25); padding: 8px; max-height: 50vh; overflow: auto; }
.fup { display: flex; align-items: center; gap: 10px; padding: 8px; font-size: 13px; }
.fup b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fup .grow { min-width: 0; }
.fup .bar { display: block; height: 4px; background: #e8eef5; border-radius: 9px; overflow: hidden; margin-top: 4px; }
.fup .bar i { display: block; height: 100%; width: 0; background: #3d8fcb; transition: width .2s; }
.fup.ok .bar i { width: 100%; background: var(--green); } .fup.ok small { color: var(--green); }
.fup.err .bar i { width: 100%; background: var(--red); } .fup.err small { color: var(--red); }
.fup small { color: var(--soft); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.fdetail-h { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.fdetail-h > i { font-size: 26px; }
.fdetail-h h2 { word-break: break-word; }
.fdetail-h p { margin: 2px 0 0; }
.fprev { background: #f2f5f8; border-radius: 10px; display: grid; place-items: center; min-height: 160px; max-height: 52vh; overflow: auto; }
.fprev img, .fprev video { max-width: 100%; max-height: 52vh; display: block; }
.fprev iframe { width: 100%; height: 52vh; border: 0; background: #fff; }
.fprev audio { width: 90%; }
.fprev-text { margin: 0; padding: 14px; width: 100%; align-self: start; font: 13px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.fprev-none { display: grid; justify-items: center; gap: 8px; color: var(--soft); padding: 30px; text-align: center; }
.fprev-none i { font-size: 36px; }
.factions { margin: 14px 0 4px; }
.factions .btn.busy { opacity: .6; pointer-events: none; }
.fcols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 14px; }
.fcols h3 { font-size: 18px; margin-bottom: 8px; }
.fversions, .factivity { list-style: none; margin: 0; padding: 0; }
.fversions li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef2f6; }
.fversions .vno { font: 700 15px var(--display); background: #e8eef5; border-radius: 7px; padding: 2px 8px; color: var(--navy); }
.fversions li.cur .vno { background: var(--navy); color: #fff; }
.fversions b { display: block; font-weight: 600; }
.fversions small, .factivity small { display: block; color: var(--soft); font-size: 12px; }
.fversions .icon-btn { display: inline-grid; place-items: center; text-decoration: none; }
.factivity li { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #eef2f6; }
.factivity li > i { width: 18px; text-align: center; color: var(--navy-2); }
.factivity li > span { flex: 1; min-width: 0; }
.factivity b { font-weight: 500; word-break: break-word; }
.factivity.small-list li { padding: 7px 0; font-size: 13.5px; }
.factivity.small-list { max-height: 300px; overflow: auto; }
@media (max-width: 820px) {
  .fhide { display: none; }
  .fshow { display: block !important; }
  .fsearch { margin-left: 0; width: 100%; }
  .ftable td { padding: 10px 12px; }
  .fcols { grid-template-columns: 1fr; }
  .head .row #fUpBtn, .head .row #fNew { flex: 1; justify-content: center; }
  .head .row #fSet { flex: none; }
}

/* Committee or personal view switch */
.seg { display: inline-flex; background: #e8eef5; border-radius: 99px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 99px; padding: 7px 14px; font-weight: 600; color: var(--soft); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.seg button.on { background: var(--paper); color: var(--navy); box-shadow: 0 1px 3px rgba(13,27,45,.15); }
.seg button:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 1px; }
.view-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.view-card .grow { min-width: 240px; }
.view-card p { margin: 4px 0 0; max-width: 62ch; }
.side-seg { background: rgba(255,255,255,.1); width: 100%; }
.side-seg button { flex: 1; justify-content: center; color: rgba(255,255,255,.75); padding: 6px 8px; font-size: 13px; }
.side-seg button.on { background: #fff; color: var(--navy); }
@media (max-width: 820px) { .side-seg { display: none; } }
/* Suspended member */
.sus-card { display: flex; gap: 14px; align-items: flex-start; border-left: 4px solid var(--red); background: #fff6f7; }
.sus-card > i { color: var(--red); font-size: 20px; margin-top: 2px; }
.sus-card b { color: var(--red); }

/* Sign-in history */
.flag { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); object-fit: cover; vertical-align: -2px; flex: none; }
.flag-ic { color: var(--soft); width: 20px; text-align: center; }
.ipf { display: inline-flex; align-items: center; gap: 7px; }
.ipf .ip { font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lg-c { display: block; margin-left: 27px; font-size: 12px; }
.lg-table td { vertical-align: middle; }
.lg-what { display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.lg-what i { color: var(--navy-2); width: 16px; text-align: center; }
tr.lg-bad .lg-what, tr.lg-bad .lg-what i { color: var(--red); font-weight: 600; }

.login .card.sent { text-align: center; animation: sentIn .35s ease-out; }
.login .card.sent h2 { margin: 6px 0 10px; color: var(--navy); font-size: 22px; }
.login .card.sent p { margin: 0 0 12px; line-height: 1.5; }
.sent-ic { width: 72px; height: 72px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; background: #e8f6ee; color: var(--green); }
@keyframes sentIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .login .card.sent { animation: none; } }
/* Long IPv6 addresses stay on one line so they never look cut off. */
.lg-table .ipf .ip { white-space: nowrap; overflow-wrap: normal; }
.lg-table .lg-what { white-space: normal; }
.lg-table td:last-child { min-width: 90px; }

/* Files storage: the meter in the header and the plans popup */
.fquota { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--soft); font: inherit; font-size: 13px; cursor: pointer; }
.fquota b { color: var(--navy); font-weight: 600; }
.fquota:hover { border-color: var(--navy-2); }
.fq-bar { display: inline-block; width: 90px; height: 6px; background: #e8eef5; border-radius: 99px; overflow: hidden; }
.fq-bar i { display: block; height: 100%; background: var(--navy-2); border-radius: 99px; }
.fquota.low .fq-bar i { background: var(--amber); } .fquota.full .fq-bar i { background: var(--red); } .fquota.full b { color: var(--red); }
.fq-bar.big { width: 100%; height: 10px; margin: 8px 0; }
.sp-use { margin: 14px 0 18px; } .sp-num { font-size: 15px; } .sp-num b { font-family: var(--display); font-size: 26px; color: var(--navy); }
.sp-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sp-plan { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sp-plan.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #f5f8fb; }
.sp-gb { font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1; }
.sp-price { font-weight: 600; } .sp-price small { color: var(--soft); font-weight: 400; }
.sp-plan .btn, .sp-plan .pill, .sp-plan > small { margin-top: auto; }
.sp-foot { margin-top: 16px; gap: 8px; flex-wrap: wrap; }
.err-t { color: var(--red); }
@media (max-width: 600px) { .sp-plans { grid-template-columns: 1fr 1fr; } }

.sp-split { display: flex; gap: 16px; font-size: 13px; color: var(--soft); margin-bottom: 6px; }
.sp-split .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--navy-2); }
.sp-split .dot.e { background: var(--green); }
.paybox { min-height: 120px; border-radius: var(--r); }

/* Club calendar: month grid plus the coming-up list. Each kind of event has its own colour (--k). */
.k-race { --k: #0d2b52; } .k-gala { --k: #c27a00; } .k-agm { --k: #d0233f; } .k-committee { --k: #5a6b80; }
.k-presentation { --k: #7c3aed; } .k-social { --k: #1f8a5b; } .k-working { --k: #b45309; } .k-training { --k: #0e7490; } .k-other { --k: #64748b; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.calv { padding: 16px; }
.cal-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-top h2 { min-width: 170px; text-align: center; }
.calv-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { font-size: 12px; font-weight: 600; color: var(--soft); padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f7f9fb; }
.cal-day { min-height: 96px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: default; }
.cal-day[tabindex], .cal-day.has { cursor: pointer; }
.cal-day[tabindex]:hover { background: #f7f9fb; }
.cal-day.out { background: #fafbfc; } .cal-day.out .cal-n { color: #a9b4c2; }
.cal-n { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-n { background: var(--red); color: #fff; }
.cal-chip { all: unset; box-sizing: border-box; display: block; width: 100%; font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--k) 12%, #fff); color: var(--k); border-left: 3px solid var(--k);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-weight: 600; }
.cal-chip span { font-weight: 500; opacity: .8; }
.cal-chip:hover, .cal-chip:focus-visible { background: color-mix(in srgb, var(--k) 22%, #fff); outline: none; }
.cal-more { font-size: 11px; color: var(--soft); padding-left: 6px; }
.cal-dots { display: none; }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--soft); }
.cal-key i, .cal-dots i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--k); margin-right: 6px; }
.cal-list { padding: 16px; }
.cal-list h2 { margin-bottom: 8px; }
.cal-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 6px; border-radius: 8px; cursor: pointer; }
.cal-item + .cal-item { border-top: 1px solid var(--line); }
.cal-item:hover, .cal-item:focus-visible { background: #f5f8fb; }
.cal-item b { display: block; line-height: 1.25; }
.cal-item small { display: block; }
.cal-date { flex: none; width: 46px; text-align: center; border-radius: 8px; padding: 4px 0; background: color-mix(in srgb, var(--k) 12%, #fff); color: var(--k); border-top: 3px solid var(--k); }
.cal-date b { font-family: var(--display); font-size: 22px; line-height: 1; }
.cal-date small { font-size: 11px; font-weight: 600; }
.cal-bar { flex: none; width: 4px; align-self: stretch; border-radius: 2px; background: var(--k); }
.cal-head span { display: inline-block; font-size: 12px; font-weight: 700; color: var(--k); background: color-mix(in srgb, var(--k) 12%, #fff); padding: 2px 9px; border-radius: 99px; margin-bottom: 8px; }
.cal-day-list { margin-top: 10px; }
@media (max-width: 1000px) { .cal-wrap { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .calv { padding: 10px; }
  .cal-day { min-height: 52px; align-items: center; padding: 3px 0; }
  .cal-chip, .cal-more { display: none; }
  .cal-dots { display: flex; gap: 2px; }
  .cal-dots i { width: 6px; height: 6px; margin: 0; }
  .cal-dow { padding: 6px 0; text-align: center; }
  .cal-top h2 { min-width: 0; flex: 1; font-size: 20px; }
}
.cal-item .pill { flex: none; white-space: nowrap; }
/* The storage card form: just the card fields and our own button. */
.paybox { min-height: 0; max-width: 460px; }
.payform .pay-el { min-height: 120px; }
.payform .pay-err { margin: 10px 0 0; min-height: 0; }
.payform .pay-go { width: 100%; justify-content: center; margin-top: 14px; padding: 12px; font-size: 16px; }
.payform .pay-safe { margin: 10px 0 0; text-align: center; }
#modal .box.pay-narrow { max-width: 520px; }
/* time picker (shares the date picker's popover) */
.tpick { width: 280px; }
.tp-show { font-size: 15px; text-align: center; padding: 4px 0 10px; color: var(--soft); }
.tp-show b { font: 800 30px var(--display); color: var(--navy); }
.tp-ampm { display: flex; margin: 0 0 10px; }
.tp-ampm button { flex: 1; }
.tp-lbl { font-size: 11.5px; font-weight: 700; color: var(--soft); margin: 6px 0 4px; }
.tp-hours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.tp-mins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tp-hours button, .tp-mins button { border: 0; background: #f4f7fb; border-radius: 9px; padding: 9px 0; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.tp-hours button:hover, .tp-mins button:hover { background: #e6edf6; }
.tp-hours button.on, .tp-mins button.on { background: var(--navy); color: #fff; }
.tp-hours button:focus-visible, .tp-mins button:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); }
.cal.cal-sheet.tpick .tp-hours button, .cal.cal-sheet.tpick .tp-mins button { padding: 13px 0; font-size: 17px; }
/* "Where" place search */
.place-f { position: relative; }
.place-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(13, 43, 82, .45); padding: 4px; }
.place-opt { all: unset; box-sizing: border-box; display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.place-opt i { color: var(--red); margin-top: 3px; }
.place-opt b { display: block; font-weight: 600; line-height: 1.3; }
.place-opt small { display: block; color: var(--soft); font-size: 12.5px; }
.place-opt:hover, .place-opt.active { background: #eef3f9; }
.place-by { font-size: 11px; color: var(--soft); text-align: right; padding: 2px 8px 4px; }
.form [hidden] { display: none !important; }
/* Sign-ins on a phone: one tidy block per sign-in instead of a table wider than the screen. */
@media (max-width: 700px) {
  .lg-table, .lg-table tbody { display: block; width: 100%; }
  .lg-table thead { display: none; }
  .lg-table tr.lg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
  .lg-table tr.lg-row:last-child { border-bottom: 0; }
  .lg-table tr.lg-row td { display: block; padding: 0; border: 0; min-width: 0 !important; }
  .lg-table .lg-w { grid-column: 1; grid-row: 1; font-weight: 600; }
  .lg-table .lg-when { grid-column: 2; grid-row: 1; text-align: right; font-size: 12.5px; color: var(--soft); }
  .lg-table .lg-who { grid-column: 1 / -1; font-size: 13.5px; }
  .lg-table .lg-ip, .lg-table .lg-dev { grid-column: 1 / -1; font-size: 12.5px; }
  .lg-table .lg-ip .ip { font-size: 12px; }
  .lg-table .lg-c { display: inline; margin-left: 6px; }
}
/* The "viewing as" bar: who, then their role and club underneath; the button stays on the right. */
.view-as-bar .va-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.view-as-bar .va-txt > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-line-clamp: unset; }
.view-as-bar .va-txt small { font-size: 12px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-as-bar .va-txt .va-more { font-size: 12px; opacity: .75; }
/* My family, not linked yet */
.link-fam { display: flex; gap: 18px; align-items: flex-start; padding: 22px; }
.link-fam-ic { flex: none; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: #e3ecf8; color: var(--navy); }
.link-fam h2 { margin-bottom: 4px; }
.link-fam .row select { min-width: 240px; }
@media (max-width: 600px) { .link-fam { flex-direction: column; } .link-fam .row select { min-width: 0; width: 100%; } }
/* the signature preview under a new message */
.sig-box { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px 6px; background: #fafbfd; }
.sig-l { display: block; font-size: 12px; font-weight: 600; color: var(--soft); margin-bottom: 4px; }
.sig-frame { width: 100%; height: 120px; border: 0; display: block; background: transparent; }
/* Email on phones: inboxes and folders as chips under the title, one tap to switch. */
.mail-chips { display: none; }
@media (max-width: 820px) {
  .mail-chips { display: flex; flex-direction: column; gap: 8px; padding: 4px 16px 10px; }
  .mail-app.reading .mail-chips { display: none; }
  .mc-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
  .mc-row::-webkit-scrollbar { display: none; }
  .mc-box, .mc-f { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 99px; padding: 8px 14px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
  .mc-box i, .mc-f i { color: var(--navy-2); font-size: 13px; }
  .mc-box.on { background: var(--navy); border-color: var(--navy); color: #fff; }
  .mc-box.on i { color: #fff; }
  .mc-box .unread-pill { margin-left: 2px; }
  .mc-f { padding: 6px 12px; font-size: 13.5px; background: #f3f6fa; border-color: transparent; }
  .mc-f.on { background: #e1eaf5; color: var(--navy); }
  .mc-f .f-count { background: var(--red); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11.5px; font-weight: 700; }
  .mail-pick > i { display: none; }
}

/* Start marks card on a meeting (startMapCard) */
.smap { margin-bottom: 16px; }
.smap h3 { margin: 0; }
.smap-map { height: 400px; margin-top: 12px; border-radius: 14px; }
.smap-pin { overflow: visible; }
.smap-lead { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.smap-lead line { stroke: #fff; stroke-width: 2; }
.smap-lead line.to { stroke: #ffc94a; stroke-width: 2.5; stroke-linecap: round; }
.smap-lead line.h { stroke: rgba(13, 43, 82, .75); stroke-width: 4.5; }
.smap-lead polygon { fill: #fff; stroke: rgba(13, 43, 82, .75); stroke-width: 1; }
.smap-nos { position: absolute; transform: translate(-50%, -50%); display: flex; gap: 2px; padding: 2px; background: rgba(13, 43, 82, .85); border-radius: 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); cursor: pointer; }
.cl { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 5px; font: normal 800 13px/1 var(--display); }
.cl.more { background: #eef2f6; color: var(--soft); font-size: 11px; }
.smap-lab { position: absolute; transform: translate(-50%, -50%); height: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; white-space: nowrap; background: #fff; color: var(--navy); border-radius: 10px; box-shadow: 0 3px 10px rgba(6, 20, 40, .45); line-height: 1.05; cursor: pointer; }
.smap-lab b { font: 800 16px/1 var(--display); }
.smap-lab small { font-size: 10.5px; font-weight: 700; color: var(--soft); margin-top: 1px; }
.smap-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.smap-chip { display: inline-flex; align-items: center; gap: 4px; background: #f2f6fa; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px 3px 4px; font-size: 13px; }
.smap-chip b { margin-left: 3px; }
.smap-chip small { color: var(--soft); font-weight: 600; margin-left: 2px; }
.smap-chip .cl { border-radius: 99px; min-width: 20px; }
@media (max-width: 640px) { .smap-map { height: 360px; } .smap .leaflet-control-attribution { font-size: 9px; } }

/* the little "i" is hard to hit with a finger: a bigger invisible target round it */
.info { position: relative; touch-action: manipulation; }
.info::after { content: ""; position: absolute; inset: -11px; }
.dnp { white-space: nowrap; }
