/* =====================================================================
   Kingscourt Harps — Pitch Booking
   Bespoke design system. Red & black on generous white space.
   No CSS framework — hand-built tokens + components.
   ===================================================================== */

:root {
  /* Brand */
  --red:        #C8102E;   /* Kingscourt Harps red — used sparingly */
  --red-600:    #A60D26;
  --red-50:     #FCEBED;
  --ink:        #14151A;   /* near-black for text/headers */
  --ink-700:    #2B2D36;
  --white:      #FFFFFF;

  /* Neutrals (lots of breathing room) */
  --bg:         #F7F8FA;
  --surface:    #FFFFFF;
  --line:       #E7E9EF;
  --line-soft:  #F0F2F6;
  --muted:      #6B7280;
  --muted-2:    #9AA1AD;

  /* Status */
  --ok:         #1E9E6A;
  --ok-50:      #E7F6EF;
  --warn:       #C9810A;
  --warn-50:    #FBF1DE;
  --info:       #2563EB;
  --info-50:    #E8F0FE;

  /* Elevation + shape */
  --radius:     16px;
  --radius-sm:  10px;
  --radius-pill:999px;
  --shadow-sm:  0 1px 2px rgba(20,21,26,.06), 0 1px 3px rgba(20,21,26,.04);
  --shadow:     0 6px 20px rgba(20,21,26,.08);
  --shadow-lg:  0 24px 60px rgba(20,21,26,.18);

  /* Spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
button { font-family: inherit; }
/* default size for any inline icon not covered by a component rule (prevents
   unconstrained SVGs from ballooning); component rules below still override */
svg { width: 1.15em; height: 1.15em; vertical-align: -0.15em; }
small { color: var(--muted); }

/* ---------- Brand mark ---------- */
.brandmark { display: inline-flex; align-items: center; gap: 10px; }
.brandmark__crest {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--ink); display: grid; place-items: center; flex: 0 0 auto;
}
.brandmark__crest svg { width: 22px; height: 22px; }
/* official crest logo wherever a brand badge appears */
.brandmark__crest img, .a-head .crest img, .push-banner__icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.login-logo { width: 96px; height: 96px; border-radius: 20px; background: #fff; padding: 7px; object-fit: contain;
  box-shadow: var(--shadow); display: block; }
.brandmark__name { line-height: 1.05; }
.brandmark__name b { font-size: 15px; letter-spacing: -0.01em; display: block; }
.brandmark__name span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--ink); color: #fff;
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); }
.btn--primary:hover { background: var(--red-600); }
.btn--dark:hover { background: #000; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn--danger:hover { background: var(--red-50); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--icon { width: 42px; padding: 0; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card__pad { padding: var(--s5); }
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding: var(--s5) var(--s5) var(--s4);
}
.card__head h2 { display: flex; align-items: center; gap: 10px; }
.card__body { padding: 0 var(--s5) var(--s5); }
.section-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px;
  padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px;
  font-weight: 600; background: var(--line-soft); color: var(--ink-700);
}
.badge--match    { background: var(--red-50);  color: var(--red-600); }
.badge--training { background: var(--info-50); color: var(--info); }
.badge--ok       { background: var(--ok-50);   color: var(--ok); }
.badge--warn     { background: var(--warn-50);  color: var(--warn); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-700);
  cursor: pointer; transition: all .12s ease;
}
.pill:hover { border-color: var(--ink); }
.pill.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Layout shell ---------- */
.app-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #fff; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar .brandmark__name b, .sidebar .brandmark__name span { color: #fff; }
.sidebar .brandmark__name span { color: rgba(255,255,255,.55); }
.sidebar .brandmark__crest { background: var(--red); }
.sidebar__group { margin-top: 14px; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,.4); padding: 0 12px 4px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; color: rgba(255,255,255,.72); font-weight: 500;
  font-size: 14px; cursor: pointer; transition: all .12s ease;
}
.nav-item svg { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.is-active { background: var(--red); color: #fff; }
.nav-item.is-active svg { opacity: 1; }
.sidebar__spacer { flex: 1; }
.sidebar__user {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; background: rgba(255,255,255,.06);
}
.sidebar__user small { color: rgba(255,255,255,.55); }
.sidebar__user b { color: #fff; font-size: 13px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5; background: rgba(247,248,250,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding: 14px var(--s7);
}
.topbar__title h1 { font-size: 22px; }
.topbar__title p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.view { padding: var(--s6) var(--s7) var(--s8); max-width: 1180px; width: 100%; }

/* role switch (prototype helper) */
.roleswitch { display: inline-flex; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.roleswitch button { border: 0; background: transparent; height: 30px; padding: 0 14px;
  border-radius: var(--radius-pill); font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.roleswitch button.is-active { background: var(--ink); color: #fff; }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: var(--s5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: var(--s4); align-items: center; }
.row--wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.mt4 { margin-top: var(--s4); } .mt5 { margin-top: var(--s5); } .mt6 { margin-top: var(--s6); }

/* ---------- KPI / stat ---------- */
.kpi { padding: var(--s5); }
.kpi__label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi__value { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }
.kpi__delta { font-size: 12px; font-weight: 700; margin-top: 6px; display: inline-flex; gap: 5px; align-items: center; }
.kpi__delta.up { color: var(--ok); } .kpi__delta.down { color: var(--red); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--line-soft); }

/* ---------- Avatars ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--ink);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.avatar--red { background: var(--red); }
.avatar--sm { width: 30px; height: 30px; font-size: 12px; }
.who { display: flex; align-items: center; gap: 12px; }
.who b { display: block; font-size: 14px; }
.who small { color: var(--muted); }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-700); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, textarea.input {
  height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 14px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
  width: 100%; transition: border-color .12s ease, box-shadow .12s ease;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(20,21,26,.06);
}
.select { appearance: none; background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }

/* segmented control */
.segment { display: inline-flex; background: var(--line-soft); border-radius: var(--radius-sm); padding: 4px; gap: 4px; width: 100%; }
.segment button { flex: 1; border: 0; background: transparent; height: 38px; border-radius: 8px;
  font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.segment button svg { width: 17px; height: 17px; }
.segment button.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.segment button.is-active.match { color: var(--red); }

/* ---------- Modal ---------- */
.modal__overlay { position: fixed; inset: 0; background: rgba(20,21,26,.45);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 24px; z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.modal__overlay.is-open { opacity: 1; pointer-events: auto; }
.modal { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px; max-height: 90vh; overflow: auto; transform: translateY(8px);
  transition: transform .18s ease; }
.modal__overlay.is-open .modal { transform: translateY(0); }
.modal--wide { max-width: 720px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s4); padding: var(--s5) var(--s5) 0; }
.modal__head h2 { font-size: 19px; }
.modal__head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal__body { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.modal__foot { padding: var(--s4) var(--s5) var(--s5); display: flex; gap: 10px; justify-content: flex-end; }
.iconbtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.iconbtn:hover { border-color: var(--ink); color: var(--ink); }
.iconbtn svg { width: 17px; height: 17px; }

/* notice box */
.notice { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; display: flex; gap: 12px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.notice--red  { background: var(--red-50);  color: var(--red-600); }
.notice--warn { background: var(--warn-50); color: var(--warn); }
.notice--info { background: var(--info-50); color: var(--info); }
.notice--ok   { background: var(--ok-50);   color: var(--ok); }
.notice b { font-weight: 700; }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); flex-wrap: wrap; }
.cal-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal { display: grid; grid-template-columns: 64px repeat(7, 1fr); }
.cal__corner { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); }
.cal__dayhead { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-soft); }
.cal__dayhead b { font-size: 14px; } .cal__dayhead small { display: block; color: var(--muted); }
.cal__dayhead.is-today b { color: var(--red); }
.cal__time { font-size: 11px; color: var(--muted-2); text-align: right; padding: 6px 8px 0 0;
  border-right: 1px solid var(--line-soft); height: 64px; }
.cal__cell { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft);
  height: 64px; padding: 4px; position: relative; cursor: pointer; transition: background .1s; }
.cal__cell:hover { background: var(--line-soft); }
.cal__cell:hover::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted-2); font-size: 20px; font-weight: 600; }
.booking { position: absolute; left: 4px; right: 4px; top: 4px; border-radius: 9px;
  padding: 7px 9px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer;
  border-left: 3px solid; box-shadow: var(--shadow-sm); z-index: 2; }
.booking b { font-size: 12px; display: block; }
.booking small { font-size: 11px; opacity: .85; }
.booking--training { background: var(--info-50); border-color: var(--info); color: #173a8a; }
.booking--match { background: var(--red-50); border-color: var(--red); color: var(--red-600); }
.booking .cap { position: absolute; top: 6px; right: 7px; font-size: 10px; font-weight: 700; opacity: .8; }

/* capacity meter */
.capbar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.capbar > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.capbar.warn > i { background: var(--warn); } .capbar.full > i { background: var(--red); }

/* legend */
.legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Heatmap (congestion) ---------- */
.heat { display: grid; grid-template-columns: 80px repeat(7,1fr); gap: 6px; align-items: center; }
.heat .h-lbl { font-size: 12px; color: var(--muted); }
.heat .h-day { font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }
.heatcell { height: 30px; border-radius: 7px; background: var(--line-soft); display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--ink-700); }

/* contact buttons */
.contactbtns { display: flex; gap: 8px; }
.cbtn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; cursor: pointer; transition: all .12s; }
.cbtn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.cbtn svg { width: 18px; height: 18px; }
.cbtn--call { color: var(--ink); } .cbtn--wa { color: #25D366; } .cbtn--mail { color: var(--info); }

/* misc */
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 10px; }
.divider { height: 1px; background: var(--line); margin: var(--s4) 0; }
.tag { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.list-item:last-child { border-bottom: 0; }
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 14px; display: flex; align-items: center; gap: 10px;
  animation: pop .25s ease; }
.toast svg { width: 18px; height: 18px; color: #6EE7B7; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.barchart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.barchart .bar { flex: 1; background: var(--line-soft); border-radius: 8px 8px 0 0; position: relative;
  display: flex; align-items: flex-end; justify-content: center; min-height: 4px; }
.barchart .bar > i { width: 100%; background: linear-gradient(180deg, var(--red), var(--red-600));
  border-radius: 8px 8px 0 0; }
.barchart .bar span { position: absolute; bottom: -24px; font-size: 11px; color: var(--muted); }
.barchart .bar em { position: absolute; top: -20px; font-size: 11px; font-weight: 700; color: var(--ink); font-style: normal; }

/* responsive */
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; z-index: 60; transition: left .2s; width: 264px; }
  .sidebar.is-open { left: 0; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .view, .topbar { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .cal { grid-template-columns: 48px repeat(7, minmax(90px,1fr)); overflow-x: auto; }
  .field-row { grid-template-columns: 1fr; }
}
.menu-toggle { display: none; }
@media (max-width: 1000px) { .menu-toggle { display: grid; } }

/* ===== Comms: bell, announcements, messages, push, glance ===== */

/* notification bell */
.bell { position: relative; }
.bell__dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg); }

/* week-at-a-glance strip */
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.weekstrip--5 { grid-template-columns: repeat(5, 1fr); }
.wk-day { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px; min-height: 116px; cursor: pointer; transition: border-color .12s, transform .06s; display: flex; flex-direction: column; gap: 8px; }
.wk-day:hover { border-color: var(--ink); }
.wk-day.is-today { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-50); }
.wk-day__top { display: flex; align-items: baseline; justify-content: space-between; }
.wk-day__top span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.wk-day__top b { font-size: 17px; }
.wk-day.is-today .wk-day__top b, .wk-day.is-today .wk-day__top span { color: var(--red); }
.wk-chip { font-size: 11px; font-weight: 600; padding: 5px 7px; border-radius: 7px; border-left: 3px solid;
  line-height: 1.2; background: var(--info-50); border-color: var(--info); color: #173a8a; }
.wk-chip b { display: block; font-size: 11px; }
.wk-chip--match { background: var(--red-50); border-color: var(--red); color: var(--red-600); }
.wk-empty { font-size: 12px; color: var(--muted-2); }

/* announcements feed */
.ann { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.ann:last-child { border-bottom: 0; }
.ann__main { flex: 1; min-width: 0; }
.ann__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann__head b { font-size: 13px; } .ann__head small { color: var(--muted); }
.ann h3 { font-size: 16px; margin: 8px 0 4px; }
.ann p { color: var(--ink-700); font-size: 14px; }
.ann.is-pinned { background: linear-gradient(90deg, var(--red-50), transparent 40%); margin: 0 -16px; padding: 18px 16px; border-radius: 12px; border-bottom: 0; }

/* messages: conversation list + thread */
.thread-list { display: flex; flex-direction: column; }
.thread-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; border-radius: 10px; }
.thread-row:hover { background: var(--line-soft); }
.thread-row__body { flex: 1; min-width: 0; }
.thread-row__body .t { display: flex; justify-content: space-between; gap: 8px; }
.thread-row__body b { font-size: 14px; }
.thread-row__body .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: 0 0 auto; }

.chat { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.bubble { max-width: 78%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.bubble small { display: block; font-size: 10.5px; opacity: .6; margin-top: 4px; }
.bubble.them { align-self: flex-start; background: var(--line-soft); border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.chat-compose { display: flex; gap: 8px; margin-top: 12px; }

/* toggle switch */
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--line); border: 0; position: relative;
  cursor: pointer; flex: 0 0 auto; transition: background .15s; }
.switch.is-on { background: var(--ok); }
.switch__dot { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: left .15s; }
.switch.is-on .switch__dot { left: 21px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* one-tap player-count check-in chips */
.pcounts { display: flex; flex-wrap: wrap; gap: 7px; }
.pcount { min-width: 42px; height: 40px; padding: 0 10px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; font-weight: 800; font-size: 15px; color: var(--ink); cursor: pointer; transition: all .1s ease; }
.pcount:hover, .pcount:active { border-color: var(--red); color: var(--red); background: var(--red-50); }
.pcount--x { color: var(--muted); font-weight: 700; }

/* simulated phone push notification */
.push-banner { position: fixed; top: 14px; left: 50%; transform: translateX(-50%) translateY(-160%);
  width: min(420px, calc(100vw - 28px)); background: rgba(255,255,255,.86); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(20,21,26,.08); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; z-index: 90; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.push-banner.show { transform: translateX(-50%) translateY(0); }
.push-banner__icon { width: 38px; height: 38px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; flex: 0 0 auto; }
.push-banner__icon svg { width: 22px; height: 22px; }
.push-banner__txt { min-width: 0; }
.push-banner__app { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.push-banner__txt b { display: block; font-size: 13.5px; margin-top: 2px; }
.push-banner__txt span { font-size: 13px; color: var(--ink-700); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 760px) {
  .weekstrip { grid-template-columns: repeat(7, minmax(120px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .weekstrip--5 { grid-template-columns: repeat(5, minmax(110px, 1fr)); }
}

/* dashboard two-column rows stack on phones even with inline column sizes */
@media (max-width: 860px) { .stack-mobile { grid-template-columns: 1fr !important; } }

/* ===== Week-ahead share view ===== */
.weekview { display: flex; flex-direction: column; }
.wv-day { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.wv-day:last-child { border-bottom: 0; }
.wv-day__h b { font-size: 15px; display: block; }
.wv-day__h small { color: var(--muted); }
.wv-day.is-today .wv-day__h b { color: var(--red); }
.wv-sessions { display: flex; flex-direction: column; gap: 6px; }
.wv-row { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.wv-row .t { font-weight: 700; color: var(--ink-700); min-width: 110px; }
.wv-row .m { color: var(--red); font-weight: 700; font-size: 11px; }
.wv-free { color: var(--muted-2); font-size: 13px; }
.share-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* announcement image */
.ann__img { margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; max-width: 460px; }
.ann__img img { display: block; width: 100%; height: auto; }
.an-preview { margin-top: 10px; }
.an-preview img { max-height: 160px; border-radius: 10px; border: 1px solid var(--line); }

/* ===== Harps Assistant (guardrailed chat) ===== */
#assistant { position: fixed; right: 22px; bottom: 22px; z-index: 46; }
.fab { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 18px;
  border-radius: 999px; border: 0; background: var(--red); color: #fff; font-weight: 700; font-size: 15px;
  cursor: pointer; box-shadow: var(--shadow-lg); transition: transform .12s ease, background .15s ease; }
.fab:hover { background: var(--red-600); transform: translateY(-2px); }
.fab svg { width: 22px; height: 22px; }
#assistant.is-open .fab { display: none; }

.a-panel { position: fixed; right: 22px; bottom: 90px; width: min(390px, calc(100vw - 32px));
  height: min(584px, calc(100vh - 130px)); background: #fff; border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  z-index: 45; opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; }
#assistant.is-open .a-panel { opacity: 1; transform: none; pointer-events: auto; }

.a-head { background: var(--ink); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.a-head .crest { width: 38px; height: 38px; border-radius: 10px; background: var(--red); display: grid; place-items: center; flex: 0 0 auto; }
.a-head .crest svg { width: 22px; height: 22px; }
.a-head b { font-size: 15px; display: block; line-height: 1.2; }
.a-head small { color: rgba(255,255,255,.6); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.a-head .dot-live { width: 7px; height: 7px; border-radius: 50%; background: #34d399; display: inline-block; }
.a-head .iconbtn { margin-left: auto; background: rgba(255,255,255,.1); border: 0; color: #fff; }
.a-head .iconbtn:hover { background: rgba(255,255,255,.2); }

.a-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.a-msg { max-width: 88%; font-size: 13.5px; line-height: 1.45; }
.a-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 5px; padding: 11px 13px; box-shadow: var(--shadow-sm); }
.a-msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-radius: 14px 14px 5px 14px; padding: 11px 13px; }
.a-msg.typing { color: var(--muted-2); letter-spacing: 2px; }
.a-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.a-chip { font-size: 12px; font-weight: 600; background: var(--red-50); color: var(--red-600); border: 0;
  border-radius: 999px; padding: 7px 12px; cursor: pointer; text-align: left; transition: background .12s; }
.a-chip:hover { background: #f7d3da; }
.chat-actions { margin-top: 10px; }
.chat-people, .chat-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.chat-person { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--line-soft); border-radius: 10px; padding: 8px 10px; }
.chat-person .contactbtns .cbtn { width: 32px; height: 32px; }
.chat-list > div { font-size: 13px; }

.a-foot { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; background: #fff; }
.a-foot input { flex: 1; height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px;
  font-size: 14px; font-family: inherit; outline: none; }
.a-foot input:focus { border-color: var(--ink); }
.a-foot button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--red); color: #fff;
  cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.a-foot button:hover { background: var(--red-600); }
.a-foot button svg { width: 18px; height: 18px; }
.a-note { font-size: 11px; color: var(--muted-2); text-align: center; padding: 0 12px 10px; background: #fff; }

@media (max-width: 520px) {
  #assistant { right: 14px; bottom: 14px; }
  .a-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 82vh; border-radius: 20px 20px 0 0; }
}
