/* LKS Active booking. One idea carries the design: route tape.
   Every programme type has a tape colour (teal 1-1, yellow clubs, pink camps) that follows it
   from the list, to the session picker, to the child's details, to the register. */

@font-face { font-family: 'Bricolage Grotesque'; src: url(/fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url(/fonts/figtree-latin-wght-normal.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --chalk: #F3F4F7;
  --paper: #FFFFFF;
  --ink: #18192E;          /* brand navy */
  --muted: #5A5F73;
  --line: #DADCE4;
  --line-strong: #B3B7C4;
  --red: #B8202F;          /* brand red */
  --steel: #78808B;        /* brand grey */
  --blue: #18192E;         /* primary buttons: brand navy */
  --blue-dark: #2D2F52;
  --link: #B8202F;
  --teal: #18192E;         /* 1-1 programmes */
  --yellow: #B8202F;       /* clubs */
  --pink: #78808B;         /* camps */
  --ok: #1B7F46;
  --warn: #8A5200;
  --bad: #9B1C1C;
  --display: 'Bricolage Grotesque', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--chalk); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 22px var(--pad) 48px; }
.wrap.wide { max-width: 1040px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 8vw, 3.1rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: 1.4rem; font-weight: 700; line-height: 1.15; }
h3 { font-size: 1.1rem; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 12px; }
a { color: var(--link); }
small, .small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.hide { display: none !important; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 6px; }

/* ---- top line: logo on the left, sign in / account on the right */
.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px; }
.topline .brand { margin-bottom: 0; }
.acct-link { font-weight: 700; color: var(--ink); text-decoration: none; padding: 8px 14px; border-radius: 99px; box-shadow: inset 0 0 0 2px var(--ink); }
.acct-link:hover { background: rgba(24, 25, 46, 0.06); }
.otp { font: 800 1.8rem var(--display); letter-spacing: 0.35em; text-align: center; }
details.kidcard { border-top: 1px solid var(--line); padding: 14px 0; }
details.kidcard:last-of-type { border-bottom: 1px solid var(--line); }
details.kidcard summary { font: 700 1.15rem var(--display); cursor: pointer; }

/* ---- brand */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font: 700 1.05rem var(--display); letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand img { display: block; height: 46px; width: auto; }
.print-head { display: none; }
.lede { font-size: 1.15rem; color: var(--muted); margin-top: 12px; max-width: 34ch; }
.back { display: inline-block; margin-bottom: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); text-decoration: underline; }

/* ---- tape colours */
.t-appointment { --tape: var(--teal); }
.t-club { --tape: var(--yellow); }
.t-camp { --tape: var(--pink); }
.t-none { --tape: var(--line-strong); }

/* ---- programme list */
.group-title { margin: 34px 0 4px; }
.prog { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.prog::before { content: ''; border-radius: 6px; background: var(--tape); }
.prog:last-of-type { border-bottom: 1px solid var(--line); }
a.prog:hover .prog-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a.prog:active { background: rgba(24, 25, 46, 0.04); }
.prog.off { opacity: 0.55; }
.prog-name { font: 700 1.3rem/1.15 var(--display); letter-spacing: -0.015em; }
.prog-desc { color: var(--muted); margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tag { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 0.85rem; font-weight: 600; background: #E7E9F0; color: var(--ink); }
.tag.price { background: var(--ink); color: #fff; }
.tag.low { background: #FFE7A8; }
.tag.full { background: #E9E9E9; color: #666; }
.tag.ok { background: #D7F0E0; color: #0F5A31; }
.tag.bad { background: #F8D9D9; color: #7a1414; }
.tag.warn { background: #FFE7A8; color: #6b4200; }

/* ---- page header on a programme */
.p-head { padding-left: 18px; position: relative; margin-bottom: 22px; }
.p-head::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 10px; border-radius: 6px; background: var(--tape); }
.p-head p { color: var(--muted); margin-top: 10px; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; border: 0; border-radius: 14px; background: var(--blue); color: #fff; font: 700 1.05rem var(--display); letter-spacing: -0.005em; cursor: pointer; text-decoration: none; transition: background 0.12s, transform 0.08s; }
.btn:hover { background: var(--blue-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: #B9BCC9; cursor: not-allowed; transform: none; }
.btn.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.secondary:hover { background: rgba(24, 25, 46, 0.06); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }
.btn.danger:hover { background: rgba(155, 28, 28, 0.08); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 0.95rem; border-radius: 10px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: 600 1rem var(--body); color: var(--link); text-decoration: underline; cursor: pointer; }

/* ---- date strip + slots (1-1) */
.section { margin-top: 30px; }
.section > h2 { margin-bottom: 12px; }
.dates { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px var(--pad) 12px; margin: 0 calc(var(--pad) * -1); scrollbar-width: thin; }
.date { flex: 0 0 66px; scroll-snap-align: start; display: grid; justify-items: center; gap: 0; padding: 10px 0 9px; border: 2px solid var(--line-strong); border-radius: 14px; background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.date .wd, .date .mo { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.date .dn { font: 800 1.55rem/1.15 var(--display); }
.date[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.date[aria-pressed='true'] .wd, .date[aria-pressed='true'] .mo { color: #C9CCDB; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot { min-height: 52px; border: 2px solid var(--line-strong); border-radius: 12px; background: var(--paper); font: 700 1.1rem var(--display); color: var(--ink); cursor: pointer; }
.slot[aria-pressed='true'] { background: var(--tape); border-color: var(--ink); }
.empty { padding: 20px 0; color: var(--muted); }

/* ---- session picker (clubs / camps) */
.week { margin-top: 26px; }
.week-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; }
.week-head h2 { font-size: 1.2rem; }
.sess { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 14px; padding: 14px 10px; margin: 0 -10px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 0; }
.sess:last-child { border-bottom: 1px solid var(--line); }
.sess.checked { background: color-mix(in srgb, var(--tape) 16%, white); }
.sess.disabled { opacity: 0.5; cursor: not-allowed; }
.sess input { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin: 0; border: 2px solid var(--ink); border-radius: 8px; background: #fff; display: grid; place-content: center; cursor: inherit; }
.sess input:checked { background: var(--tape) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='%230D2240' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat; }
.sess .when { font: 700 1.15rem var(--display); }
.sess .time { color: var(--muted); font-size: 0.95rem; }

/* ---- sticky bottom bar */
.bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 28px calc(var(--pad) * -1) calc(-48px); padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 2px solid var(--ink); }
.bar .what { line-height: 1.25; }
.bar .what b { font: 800 1.35rem var(--display); display: block; }

/* ---- forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .lbl { font-weight: 700; font-size: 0.95rem; }
.hint { color: var(--muted); font-size: 0.875rem; font-weight: 400; }
input, select, textarea { font: inherit; width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--ink); }
textarea { min-height: 88px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--red); outline-offset: 1px; border-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .two.keep-two { grid-template-columns: 1fr 1fr; } .two:not(.keep-two) { grid-template-columns: 1fr; } }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; margin-bottom: 14px; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; border: 2px solid var(--ink); border-radius: 8px; background: #fff; cursor: pointer; }
.check input:checked { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.child { position: relative; padding: 4px 0 4px 20px; margin: 22px 0; }
.child::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; border-radius: 6px; background: var(--tape); }
.child-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }

/* ---- summary */
.summary { margin: 24px 0 8px; padding: 0; }
.summary dd { margin: 0; }
.summary dt { margin: 0; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary div.total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font: 800 1.4rem var(--display); }
.summary .save { color: var(--ok); font-weight: 600; }

/* ---- notices + toast */
.notice { padding: 12px 14px; border-radius: 12px; background: #ECEEF5; border: 1px solid #CDD1E2; margin: 14px 0; }
.notice.test { background: #FFF3C7; border-color: #EBD27A; }
.notice.error { background: #FDE6E6; border-color: #F0B3B3; color: #6f1212; }
.notice.ok { background: #DDF1E4; border-color: #A9D9BA; }
#toasts { position: fixed; left: 0; right: 0; bottom: 16px; display: grid; gap: 8px; justify-items: center; z-index: 50; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 6px 24px rgba(24, 25, 46, 0.25); }
.toast.error { background: var(--bad); }

/* ---- confirmation */
.done { text-align: left; }
.tick { width: 72px; height: 72px; margin-bottom: 18px; }
.tick circle { fill: var(--red); }
.tick path { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.5s 0.15s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ref { display: inline-block; padding: 4px 12px; border-radius: 8px; background: var(--ink); color: #fff; font: 800 1.15rem var(--display); letter-spacing: 0.08em; }
.list-plain { list-style: none; padding: 0; margin: 12px 0; }
.list-plain li { padding: 10px 0; border-top: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 1px solid var(--line); }
.spinner { width: 28px; height: 28px; border: 4px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== admin =================== */
.topbar { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1040px; margin: 0 auto; padding: 10px var(--pad); display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topbar .brand { color: var(--ink); margin: 0; }
.topbar .brand img { height: 44px; }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.topbar nav a:hover { color: var(--ink); background: rgba(24, 25, 46, 0.06); }
.topbar nav a[aria-current='page'] { color: #fff; background: var(--ink); }
.topbar .linkbtn { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0 8px; }
.stat { padding: 14px 16px; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); }
.stat b { display: block; font: 800 1.8rem/1.1 var(--display); }
.stat span { color: var(--muted); font-size: 0.9rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--ink); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(24, 25, 46, 0.04); }
.tablewrap { overflow-x: auto; margin: 0 -4px; }
.sess-line { display: grid; grid-template-columns: 8px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.sess-line::before { content: ''; align-self: stretch; border-radius: 5px; background: var(--tape); grid-column: 1; }
.sess-line > :first-child { grid-column: 2; }
dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 0; border-radius: 16px; padding: 22px; background: var(--chalk); color: var(--ink); }
dialog::backdrop { background: rgba(24, 25, 46, 0.55); }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { display: inline-flex; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.days span { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; min-height: 44px; padding: 0 12px; border: 2px solid var(--line-strong); border-radius: 10px; background: #fff; font-weight: 700; cursor: pointer; }
.days input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.days input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.avail-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.copybox { display: flex; gap: 8px; }
.copybox input { font-size: 0.9rem; }
pre.code { background: var(--ink); color: #E6EDF8; padding: 14px; border-radius: 12px; overflow-x: auto; font-size: 0.82rem; white-space: pre-wrap; word-break: break-all; }

/* reports: simple horizontal bars */
.barrow { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 12px; align-items: center; padding: 6px 0; }
.barrow.wide { grid-template-columns: 13rem 1fr auto; }
.barlbl { font-size: 0.9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bartrack { display: block; height: 14px; border-radius: 7px; background: #E7E9F0; overflow: hidden; }
.barfill { display: block; height: 100%; border-radius: 7px; background: var(--red); }

/* =================== register =================== */
.reg-head { margin-bottom: 14px; }
.counter { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 14px; }
.counter b { font: 800 2.4rem/1 var(--display); }
.kid { position: relative; padding: 14px 0 14px 18px; border-top: 1px solid var(--line); }
.kid::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 8px; border-radius: 5px; background: var(--tape, var(--line-strong)); }
.kid:last-child { border-bottom: 1px solid var(--line); }
.kid-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kid-name { font: 700 1.25rem/1.2 var(--display); }
.kid-info { margin-top: 8px; font-size: 0.95rem; }
.kid-info .medical { display: inline-block; padding: 4px 10px; border-radius: 8px; background: #FFE7A8; color: #5d3a00; font-weight: 600; margin: 2px 0; }
.kid-info a { font-weight: 600; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seg button { min-width: 84px; min-height: 48px; padding: 0 14px; border: 0; background: #fff; font: 700 1rem var(--display); color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed='true'].yes { background: #2DB36B; color: #052e18; }
.seg button[aria-pressed='true'].no { background: #F08B8B; color: #3d0808; }
.photo-no { color: var(--bad); font-weight: 600; }

@media print {
  body { background: #fff; font-size: 11pt; }
  .print-head { display: block; margin-bottom: 10px; }
  .print-head img { height: 40px; width: auto; }
  .topbar, .no-print, .bar, #toasts, .btn, .seg button:not([aria-pressed='true']) { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .kid { break-inside: avoid; }
  .seg { border: 1px solid #000; }
  .seg button[aria-pressed='true'] { color: #000; background: none !important; font-weight: 800; min-height: 0; }
  .panel { border: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
  .tick path { stroke-dashoffset: 0; }
}

/* ---- v3: waiting list + payment plans */
.sess-full { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sess.has-wait { opacity: 1; cursor: default; }
.sess.has-wait > div { opacity: 0.55; }
.sess.has-wait input { opacity: 0.4; }
.wait-all { margin: -2px 0 8px; }
.plan h3 { font: 800 1.1rem var(--display); margin: 18px 0 8px; }
.plan-opt { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; padding: 12px 14px; margin-bottom: 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.plan-opt.on { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, white); }
.plan-opt input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); }
.plan-sum { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: #ECEEF5; }
button.linkish { border: 0; cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 600; }
