*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #1D9E75;
  --green-dark: #0F6E56;
  --green-light: #E1F5EE;
  --orange: #EF9F27;
  --orange-light: #FFFAF2;
  --red: #C0392B;
  --red-light: #FAECE7;
  --purple: #7F77DD;
  --purple-light: #EEEDFE;
  --blue: #3A7FD5;
  --blue-light: #EAF2FD;
  --bg: #f1f0ec;
  --surface: #ffffff;
  --surface2: #f7f7f5;
  --border: rgba(0,0,0,0.10);
  --border2: rgba(0,0,0,0.22);
  --text: #1a1a18;
  --text2: #6b6b68;
  --text3: #a0a09d;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --primary: var(--green);
  --card-bg: var(--surface);
  --surface3: var(--surface2);
  --green-teal: #5DCAA5;
  --green-deep: #085041;
  --orange-dark: #633806;
  --red-deep: #712B13;
  --purple-dark: #3C3489;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --surface: #1e1e1c;
    --surface2: #2a2a27;
    --border: rgba(255,255,255,0.10);
    --border2: rgba(255,255,255,0.22);
    --text: #e8e8e4;
    --text2: #9a9a96;
    --text3: #5a5a58;
    --green-light: #0d2e22;
    --orange-light: #2a1e09;
    --red-light: #2a1309;
    --purple-light: #1a1940;
    --blue-light: #0d1e38;
    --green-deep: #7ddfc0;
    --orange-dark: #f5c87a;
    --red-deep: #ff7070;
    --purple-dark: #a8a3f0;
  }
}

html[data-theme="dark"] {
  --bg: #161614;
  --surface: #1e1e1c;
  --surface2: #2a2a27;
  --border: rgba(255,255,255,0.10);
  --border2: rgba(255,255,255,0.22);
  --text: #e8e8e4;
  --text2: #9a9a96;
  --text3: #5a5a58;
  --green-light: #0d2e22;
  --orange-light: #2a1e09;
  --red-light: #2a1309;
  --purple-light: #1a1940;
  --blue-light: #0d1e38;
  --green-deep: #7ddfc0;
  --orange-dark: #f5c87a;
  --red-deep: #ff7070;
  --purple-dark: #a8a3f0;
}

html[data-theme="light"] {
  --bg: #f1f0ec;
  --surface: #ffffff;
  --surface2: #f7f7f5;
  --border: rgba(0,0,0,0.10);
  --border2: rgba(0,0,0,0.22);
  --text: #1a1a18;
  --text2: #6b6b68;
  --text3: #a0a09d;
  --green-light: #E1F5EE;
  --orange-light: #FFFAF2;
  --red-light: #FAECE7;
  --purple-light: #EEEDFE;
  --blue-light: #EAF2FD;
}

.theme-toggle {
  display: flex; gap: 4px;
  background: var(--surface2); border-radius: var(--radius);
  padding: 3px;
}
.theme-toggle button {
  flex: 1; padding: 5px 8px;
  font-size: 12px; font-weight: 500; color: var(--text2);
  background: none; border: none; border-radius: 6px;
  cursor: pointer; transition: background .15s, color .15s;
}
.theme-toggle button.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

body {
  font-family: var(--font);
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

input[type="checkbox"] { accent-color: var(--primary); }

/* ── Auth overlay ─────────────────────────────────────────────────── */
#auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#auth-overlay.hidden { display: none; }

.auth-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  width: 100%; max-width: 380px;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.75rem;
}
.auth-logo-img { height: 56px; width: auto; }
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .logo-light { display: none; }
  html:not([data-theme="light"]) .logo-dark { display: block; }
}
.auth-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 1.25rem; }
.auth-sub { font-size: 13px; color: var(--text2); margin-bottom: 1.5rem; line-height: 1.5; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.form-input {
  width: 100%; padding: 9px 11px;
  background: var(--surface2); color: var(--text);
  border: 0.5px solid var(--border2); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font);
  outline: none; transition: border-color .12s;
}
.form-input:focus { border-color: var(--green); }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }

.btn {
  display: block; width: 100%;
  padding: 10px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; font-family: var(--font);
  border: none; cursor: pointer; transition: background .12s;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { background: var(--text3); cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--text2);
  border: 0.5px solid var(--border2);
}
.btn-ghost:hover { background: var(--surface2); }
.btn-danger { background: var(--red-light); color: var(--red); border: 0.5px solid var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

.auth-link { font-size: 13px; text-align: center; margin-top: 16px; color: var(--text2); }
.auth-link a { color: var(--green); text-decoration: none; font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }

.error-msg { font-size: 12px; color: var(--red); margin-top: 8px; padding: 8px 10px; background: var(--red-light); border-radius: var(--radius); }
.success-msg { font-size: 12px; color: var(--green-dark); margin-top: 8px; padding: 8px 10px; background: var(--green-light); border-radius: var(--radius); }

/* ── App shell ────────────────────────────────────────────────────── */
#app-shell { display: flex; flex-direction: column; }

.top-bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: 0 1rem;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.top-bar-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; color: var(--text);
  flex-shrink: 0;
  position: relative;
}
.beta-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: #fff; background: var(--purple);
  border-radius: 3px; padding: 2px 5px;
  line-height: 1; text-transform: uppercase;
  position: absolute; left: 18px; top: 4px;
  transform: rotate(-12deg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.logo-img {
  height: 36px; width: auto;
}
.logo-img-icon { display: none; }
.top-bar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── Footer ───────────────────────────────────────────────────────── */
.app-footer {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px 8px;
  padding: 1.25rem 1rem 2rem;
  font-size: 11px; color: var(--text2);
}
.footer-sep { opacity: 0.4; }
.footer-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--text2);
  text-decoration: underline; text-underline-offset: 2px;
}
.footer-link:hover { color: var(--text); }
.info-modal-box { max-width: 420px; }
.info-modal-text { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 0.75rem; }

/* Top nav pills */
.top-nav { display: flex; gap: 6px; }
.top-nav-btn {
  font-size: 12px; padding: 5px 12px;
  border-radius: 20px;
  border: 0.5px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font);
  transition: all .12s;
  white-space: nowrap;
}
.top-nav-btn:hover { border-color: var(--border2); }
.top-nav-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 500;
}

.avatar-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  border: none; cursor: pointer;
  background: var(--purple-light); color: var(--purple);
  overflow: hidden; flex-shrink: 0;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.bell-btn {
  position: relative;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; flex-shrink: 0;
  background: var(--surface2); color: var(--text2);
  transition: background .12s;
}
.bell-btn:hover { background: var(--border); }
.bell-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
  min-width: 14px; height: 14px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; pointer-events: none;
}
.notif-panel {
  position: fixed; top: 52px; right: 8px;
  width: 320px; max-height: 420px;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.12);
  z-index: 200; display: flex; flex-direction: column;
  overflow: hidden;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 0.5px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .06em;
}
.notif-panel-header button {
  font-size: 11px; color: var(--green); background: none; border: none;
  cursor: pointer; padding: 0; font-family: var(--font);
}
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 10px 14px; border-bottom: 0.5px solid var(--border);
  font-size: 13px; color: var(--text2); cursor: default;
  line-height: 1.4;
}
.notif-item.clickable { cursor: pointer; }
.notif-item.clickable:hover { background: var(--surface2); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--green-light,#f0faf4); color: var(--text); }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 2px; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--text3); font-size: 13px; }

.group-select {
  font-size: 12px; font-weight: 500; color: var(--text);
  background: var(--surface2); border: 0.5px solid var(--border);
  border-radius: 20px; padding: 4px 10px; cursor: pointer;
  outline: none; font-family: var(--font); max-width: 150px;
}

/* ── Main content ─────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 1.25rem 1rem 2rem;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

.view { display: none; }
.view.active { display: block; }

/* ── Calendar two-column layout ───────────────────────────────────── */
.cal-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 1.25rem;
  align-items: start;
}
.cal-left  { display: flex; flex-direction: column; gap: 1rem; }
.cal-right { display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 700px) {
  .cal-layout { grid-template-columns: 1fr; }
}

/* Single-column constraint for non-calendar views */
.single-col { max-width: 640px; margin: 0 auto; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
}
.card-title {
  font-size: 14px; font-weight: 500; color: var(--text);
  margin-bottom: 12px;
}
.card-sub { font-size: 11px; color: var(--text2); font-weight: 400; margin-left: 4px; }

/* ── Calendar ─────────────────────────────────────────────────────── */
.cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.cal-month { font-size: 15px; font-weight: 500; color: var(--text); }
.cal-arrows { display: flex; gap: 4px; }
.cal-arrow {
  width: 26px; height: 26px; border-radius: 6px;
  border: 0.5px solid var(--border); background: transparent;
  cursor: pointer; color: var(--text2); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.cal-arrow:hover { border-color: var(--border2); }

.wdays { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; margin-bottom: 3px; }
.wd { text-align: center; font-size: 11px; color: var(--text3); padding: 2px 0; }

.dgrid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.day {
  border-radius: 8px; padding: 5px 4px 4px;
  min-height: 52px; cursor: pointer;
  border: 0.5px solid transparent;
  transition: border-color .12s;
  background: transparent;
}
.day:hover:not(.inactive) { border-color: var(--border2); }
.day.today { border-color: var(--green-teal); }
.day.sel { background: var(--green-light); border-color: var(--green); }
.day.inactive { opacity: 0.2; pointer-events: none; }
.dnum {
  font-size: 12px; font-weight: 500; color: var(--text2);
  text-align: center; margin-bottom: 4px;
}
.dnum.weekend { color: var(--red); }
.day.today .dnum, .day.sel .dnum { color: var(--green-dark); }
.pip-row { display: flex; justify-content: center; gap: 4px; }
.pip { width: 6px; height: 6px; border-radius: 50%; }
.pip.go  { background: var(--green); }
.pip.few { background: var(--orange); }
.pip.no  { background: var(--border); }
.pip.bkd { background: var(--red); }
.pip.mine { box-shadow: 0 0 0 1.5px var(--card-bg), 0 0 0 3px var(--green-teal); }
.xg-dot { width: 5px; height: 5px; border-radius: 50%; margin: 5px auto 0; }
.xg-dot.xg-other    { background: #9B94EE; }
.xg-dot.xg-conflict { background: #E05C6A; }

.cal-legend { margin-top: 12px; padding-top: 10px; border-top: 0.5px solid var(--border); }
.leg-toggle { background: none; border: none; cursor: pointer; font-size: 11px; color: var(--text2); padding: 2px 0 0; display: block; width: 100%; text-align: center; line-height: 1; }
.leg-toggle:hover { color: var(--text); }
.leg-items { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.cal-legend.collapsed .leg-items { display: none; }
.leg-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text2); }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Slot blocks ──────────────────────────────────────────────────── */
.slot-block {
  border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px;
  border: 0.5px solid var(--border);
  cursor: pointer;
  transition: border-color .12s;
}
.slot-block:last-child { margin-bottom: 0; }
.slot-block:hover { border-color: var(--border2); }
.slot-block.go-slot   { border-color: #9FE1CB; background: var(--green-light); }
.slot-block.few-slot  { border-color: #FAC775; background: var(--orange-light); }
.slot-block.no-slot   { opacity: 0.65; }
.slot-block.bkd-slot  { border-color: #F0997B; background: var(--red-light); }

.slot-top { display: flex; align-items: center; justify-content: space-between; }
.slot-left { display: flex; align-items: center; gap: 8px; }
.slot-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.slot-icon svg { width: 14px; height: 14px; }
.slot-name { font-size: 13px; font-weight: 500; color: var(--text); }
.slot-time { font-size: 11px; color: var(--text2); }
.slot-right { display: flex; align-items: center; gap: 8px; }

.count-pill {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.cp-go  { background: var(--green-light); color: var(--green-deep); }
.cp-few { background: var(--orange-light); color: var(--orange-dark); }
.cp-no  { background: var(--surface2); color: var(--text2); }
.cp-bkd { background: var(--red-light); color: var(--red-deep); }

.toggle-btn {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .12s;
}
.toggle-btn.on { background: var(--green); border-color: var(--green); }
.toggle-btn.locked { opacity: 0.4; cursor: not-allowed; }

.avail-section { margin-top: 9px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-wrap { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 2px; }
.bar-num { font-size: 11px; color: var(--text2); min-width: 28px; text-align: right; }

.ava-stack { display: flex; margin-top: 6px; }
.ava {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; flex-shrink: 0;
}
.ava.dim { opacity: 0.28; }
.ava.overflow { background: var(--surface2); color: var(--text2); font-size: 9px; }
.miss-note { font-size: 11px; color: var(--orange-dark); margin-top: 5px; }
.miss-note.ok { color: var(--green-dark); }

.xg-note {
  margin-top: 6px; padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 11px; display: flex; align-items: center; gap: 7px;
}
.xg-note-avail    { background: var(--purple-light); color: var(--purple-dark); }
.xg-note-conflict { background: var(--orange-light); color: var(--orange-dark); }
.xg-conflict-group-link { color: var(--orange-dark); text-decoration: underline; cursor: pointer; }
.match-info { margin-top: 8px; padding: 8px 10px; background: var(--red-light); border-radius: var(--radius); }
.match-info-court { font-size: 13px; font-weight: 500; color: var(--text); }
.match-info-time  { font-size: 12px; color: var(--text2); margin-top: 2px; }
.match-info-url   { font-size: 12px; color: var(--green); text-decoration: none; }
.match-info-url:hover { text-decoration: underline; }
.match-actions { display: flex; gap: 6px; margin-top: 8px; }
.match-participants { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.mp-row { display: flex; gap: 6px; align-items: baseline; font-size: 12px; line-height: 1.4; }
.mp-label { color: var(--text3); flex-shrink: 0; min-width: 50px; }
.mp-spare { color: var(--text3); font-style: italic; }

.btn-sm {
  padding: 6px 12px; border-radius: var(--radius);
  font-size: 12px; font-weight: 500; font-family: var(--font);
  border: none; cursor: pointer; transition: background .12s;
}
.btn-sm-primary { background: var(--green); color: #fff; }
.btn-sm-primary:hover { background: var(--green-dark); }
.btn-sm-danger { background: var(--red-light); color: var(--red); border: 0.5px solid var(--red); }
.btn-sm-danger:hover { background: var(--red); color: #fff; }
.btn-sm-ghost { background: var(--surface2); color: var(--text2); border: 0.5px solid var(--border); }
.btn-sm-ghost:hover { border-color: var(--border2); }

/* Book button (full-width green CTA) */
.book-btn {
  display: block; width: 100%; margin-top: 8px;
  padding: 7px; border-radius: var(--radius);
  background: var(--green); border: none; color: #fff;
  font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--font);
  transition: background .12s;
}
.book-btn:hover { background: var(--green-dark); }

/* Match form */
.match-form { margin-top: 10px; padding: 10px; background: var(--surface2); border-radius: var(--radius); }
.match-form .form-group { margin-bottom: 8px; }
.match-form .form-group:last-child { margin-bottom: 0; }
.match-form .form-label { font-size: 11px; }
.match-form .form-input { font-size: 13px; padding: 7px 9px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Upcoming match cards ────────────────────────────────────────── */
.upcoming-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; display: flex; align-items: flex-start; gap: 11px;
  margin-bottom: 7px;
}
.upcoming-row:last-child { margin-bottom: 0; }
.uc-date {
  width: 40px; min-width: 40px; height: 44px; border-radius: 7px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.uc-date .d { font-size: 15px; font-weight: 800; line-height: 1; }
.uc-date .m { font-size: 8.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.uc-body { flex: 1; min-width: 0; }
.uc-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.uc-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11px; color: var(--text2); margin-bottom: 5px; }
.uc-meta svg { width: 10px; height: 10px; flex-shrink: 0; }
.uc-meta .sep { opacity: .4; }
.uc-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uc-status { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.uc-status.booked { background: var(--green-light); color: var(--green-dark); }
.uc-status.available { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.uc-status.me-player { background: var(--green-light); color: var(--green-dark); }
.uc-status.me-spare { background: var(--purple-light); color: var(--purple); }
.upcoming-row.me-player { border-left: 3px solid var(--green); }
.upcoming-row.me-spare { border-left: 3px solid var(--purple); }
.uc-court-link { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.uc-court-link:hover { color: var(--green-dark); text-decoration-style: solid; }
.uc-spare-sep { color: var(--border2); font-size: 10px; margin: 0 1px; line-height: 1; }
.cal-menu { position: relative; margin-left: auto; }
.cal-btn {
  background: none; border: 0.5px solid var(--border2); cursor: pointer;
  padding: 3px 7px; border-radius: 6px; color: var(--text2);
  font-size: 11px; font-weight: 500; display: inline-flex;
  align-items: center; gap: 4px; font-family: var(--font); white-space: nowrap;
  transition: background .12s, color .12s; position: relative;
}
.cal-btn:hover { background: var(--surface2); color: var(--text); }
.cal-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 210px; z-index: 210; overflow: hidden;
}
.cal-dropdown.open { display: block; }
.cal-item { display: flex !important; align-items: center; gap: 8px; text-decoration: none; }
.uc-avatars { display: flex; }
.uc-av-wrap { position: relative; margin-left: -5px; flex-shrink: 0; }
.uc-av-wrap:first-child { margin-left: 0; }
.uc-av {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--surface); font-size: 7.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  overflow: hidden; cursor: pointer; position: relative;
}
.uc-av.overflow { background: var(--surface2); color: var(--text2); font-size: 7px; border-color: var(--border2); cursor: default; }
.uc-av-pop {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 0.5px solid var(--border2); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.14); padding: 8px 10px; z-index: 300;
  white-space: nowrap; min-width: 110px; text-align: center;
}
.uc-av-pop.open { display: block; }
.uc-av-pop::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--border2);
}
.uc-av-pop-name { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 5px; }

/* ── Groups view ──────────────────────────────────────────────────── */
.group-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .12s;
}
.group-card:hover { border-color: var(--border2); }
.group-card.expanded { border-color: var(--green); background: color-mix(in srgb, var(--green) 4%, var(--surface)); }
.group-card-top { display: flex; align-items: center; justify-content: space-between; }
.group-card-name { font-size: 14px; font-weight: 500; color: var(--text); }
.group-card.expanded .group-card-name { font-weight: 700; color: var(--green-dark); font-size: 15px; }
.group-card-meta { font-size: 12px; color: var(--text2); margin-top: 3px; }
.group-card-right { display: flex; align-items: center; gap: 8px; }
.group-select-btn {
  padding: 5px 12px; border-radius: 20px;
  background: var(--green); color: #fff; border: none;
  font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--font);
  transition: background .12s;
}
.group-select-btn:hover { background: var(--green-dark); }
.group-select-btn.selected { background: var(--green-light); color: var(--green-dark); }

.member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 0.5px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-left { display: flex; align-items: center; gap: 8px; }
.member-name { font-size: 13px; font-weight: 500; color: var(--text); }
.member-role { font-size: 11px; color: var(--text3); }
.remove-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  color: var(--text3); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.remove-btn:hover { background: var(--red-light); color: var(--red); }

.invite-form { display: flex; gap: 6px; margin-top: 12px; }
.invite-form .form-input { flex: 1; }
.invite-form .btn-sm { white-space: nowrap; }

.icon-picker-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.icon-picker-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--surface2); font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: border-color .12s, background .12s;
}
.icon-picker-btn:hover { border-color: var(--border2); background: var(--surface); }
.icon-picker-btn.selected { border-color: var(--green); background: var(--green-light); }
.icon-picker-clear {
  width: 34px; height: 34px; border-radius: 8px; border: 1.5px dashed var(--border);
  background: transparent; color: var(--text3); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: border-color .12s, color .12s;
}
.icon-picker-clear:hover { border-color: var(--border2); color: var(--text2); }
.icon-preview {
  width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--green);
  background: var(--green-light); font-size: 20px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}

.new-group-fab {
  position: fixed; bottom: 1.5rem; right: 1rem;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--green); color: #fff; border: none;
  font-size: 22px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex; align-items: center; justify-content: center;
  z-index: 40;
}
.new-group-fab:hover { background: var(--green-dark); }

/* ── Mijn Tijd view ───────────────────────────────────────────────── */
.my-avail-row {
  padding: 8px 0; border-bottom: 0.5px solid var(--border);
}
.my-avail-row:last-child { border-bottom: none; }
.my-avail-date { font-size: 13px; color: var(--text); font-weight: 500; margin-bottom: 5px; }
.my-avail-group-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.my-avail-group-label { font-size: 11px; color: var(--text3); font-weight: 500; min-width: 80px; flex-shrink: 0; }
.my-avail-slots { display: flex; gap: 4px; flex-wrap: wrap; }
.slot-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 20px;
  background: var(--green-light); color: var(--green-dark); font-weight: 500;
}
.mijn-tijd-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.mijn-tijd-month { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.hidden { display: none !important; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem; width: 100%; max-width: 360px;
}
.modal-title { font-size: 15px; font-weight: 600; margin-bottom: 1rem; color: var(--text); }
.modal-actions { display: flex; gap: 8px; margin-top: 1rem; }
.modal-actions .btn { display: inline-block; width: auto; flex: 1; }

/* ── Profile panel ────────────────────────────────────────────────── */
.profile-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 210;
  width: min(320px, 100vw);
  background: var(--surface);
  border-left: 0.5px solid var(--border);
  padding: 1.25rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .2s ease;
}
.profile-panel.open { transform: translateX(0); }
.profile-backdrop {
  position: fixed; inset: 0; z-index: 209;
  background: rgba(0,0,0,0.25);
  display: none;
}
.profile-backdrop.open { display: block; }
.profile-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.profile-header-title { font-size: 15px; font-weight: 600; color: var(--text); }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 16px; font-weight: 600; text-align: center; color: var(--text); margin-bottom: 2px; }
.profile-email { font-size: 12px; text-align: center; color: var(--text2); margin-bottom: 1.25rem; }
.profile-section-title { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; margin-top: 16px; }

.close-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 0.5px solid var(--border); background: var(--surface2);
  cursor: pointer; font-size: 16px; color: var(--text2);
  display: flex; align-items: center; justify-content: center;
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--text); color: var(--surface);
  padding: 9px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  z-index: 200; animation: toast-in .2s ease;
  max-width: calc(100vw - 2rem); text-align: center;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* ── Offline banner ───────────────────────────────────────────────── */
#offline-banner {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  background: var(--red); color: #fff;
  font-size: 13px; font-weight: 500; text-align: center;
  padding: 6px 12px; z-index: 300;
}
#offline-banner.visible { display: block; }

/* ── Admin view ───────────────────────────────────────────────────── */
.admin-section { margin-bottom: 1.5rem; }
.admin-section-title {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 10px; margin-top: 16px;
}
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card {
  background: var(--surface2); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 12px; text-align: center;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text2); margin-top: 2px; }
.admin-user-row {
  display: flex; flex-direction: column;
  padding: 10px 0; border-bottom: 0.5px solid var(--border); gap: 6px;
}
.admin-user-row:last-child { border-bottom: none; }
.admin-user-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.admin-user-meta { font-size: 11px; color: var(--text2); margin-top: 1px; }
.admin-user-badges { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; }
.badge { font-size: 10px; padding: 2px 7px; border-radius: 20px; font-weight: 500; }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; margin-left: 5px; vertical-align: middle; line-height: 1; }
.badge-admin { background: var(--purple-light); color: var(--purple); }
.badge-inactive { background: var(--red-light); color: var(--red); }
.badge-locked { background: var(--orange-light); color: var(--orange); }
.badge-unverified { background: var(--blue-light); color: var(--blue); }
.kebab-menu { position: relative; }
.kebab-btn { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--text2); font-size: 18px; line-height: 1; transition: background .12s; }
.kebab-btn:hover { background: var(--surface2); color: var(--text); }
.kebab-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.12); min-width: 168px; z-index: 200; overflow: hidden; }
.kebab-dropdown.open { display: block; }
.kebab-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 9px 14px; font-size: 13px; color: var(--text); cursor: pointer; font-family: var(--font); transition: background .1s; white-space: nowrap; }
.kebab-item:hover { background: var(--surface2); }
.kebab-item-danger { color: var(--red); }
.kebab-item-danger:hover { background: var(--red-light); }
.audit-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 8px 0; border-bottom: 0.5px solid var(--border); gap: 8px;
}
.audit-row:last-child { border-bottom: none; }
.audit-action { font-size: 12px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.audit-detail { font-size: 11px; color: var(--text2); margin-top: 2px; }
.audit-meta { font-size: 11px; color: var(--text3); white-space: nowrap; text-align: right; }
.audit-ip { font-size: 10px; color: var(--text3); margin-top: 2px; font-family: monospace; }
.sev-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 1px 5px; border-radius: 4px; line-height: 1.5; flex-shrink: 0; }
.sev-info     { background: var(--text2); color: #fff; }
.sev-warning  { background: var(--orange); color: #fff; }
.sev-critical { background: var(--red); color: #fff; }
.audit-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.audit-section-header .admin-section-title { margin-bottom: 0; }
.audit-limit-select { font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); cursor: pointer; }
.audit-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.audit-pagination-info { font-size: 12px; color: var(--text3); }
.audit-pagination-btns { display: flex; gap: 6px; }
.audit-pagination-btns button { font-size: 12px; padding: 3px 10px; border: 0.5px solid var(--border); border-radius: var(--radius); background: var(--surface2); color: var(--text); cursor: pointer; font-family: var(--font); transition: background .12s; }
.audit-pagination-btns button:disabled { opacity: 0.4; cursor: default; }
.admin-subtabs { display: flex; gap: 6px; margin: 12px 0 16px; flex-wrap: wrap; }
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }
.settings-form { display: flex; flex-direction: column; gap: 16px; max-width: 520px; margin-top: 12px; }
.settings-row { display: flex; flex-direction: column; gap: 4px; }
.settings-label { font-size: 13px; font-weight: 600; color: var(--text); }
.settings-input-group { display: flex; flex-direction: column; gap: 3px; }
.settings-input { width: 120px; }
.settings-hint { font-size: 11px; color: var(--text3); }
.toggle-switch { display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { width: 38px; height: 22px; background: var(--border2); border-radius: 11px; position: relative; transition: background .18s; flex-shrink: 0; }
.toggle-switch input:checked + .toggle-track { background: var(--green); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .18s; }
.toggle-switch input:checked + .toggle-track .toggle-thumb { left: 19px; }
.admin-user-filter {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center;
}
.admin-user-filter .form-input { font-size: 12px; padding: 5px 9px; flex: 1; min-width: 140px; }
.admin-user-filter select { font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.audit-filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center;
}
.audit-filter-bar .form-input { font-size: 12px; padding: 4px 8px; flex: 1; min-width: 110px; }
.audit-filter-bar input[type="date"] { font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); width: 136px; flex-shrink: 0; }
.audit-clear-btn { font-size: 11px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text2); cursor: pointer; white-space: nowrap; transition: background .12s; flex-shrink: 0; }
.audit-clear-btn:hover { background: var(--surface3); }
.integrity-check-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.integrity-check-row { border: 0.5px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.integrity-check-row.ok { border-color: var(--green); background: var(--green-light); }
.integrity-check-row.warning { border-color: var(--orange); background: var(--orange-light); }
.integrity-check-row.info { border-color: var(--blue); background: var(--blue-light); }
.integrity-check-header { display: flex; align-items: center; gap: 8px; }
.integrity-status-icon { font-size: 13px; flex-shrink: 0; }
.integrity-check-label { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.integrity-count { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 20px; flex-shrink: 0; }
.integrity-count.count-ok { background: var(--green); color: #fff; }
.integrity-count.count-warning { background: var(--orange); color: #fff; }
.integrity-count.count-info { background: var(--blue); color: #fff; }
.integrity-check-desc { font-size: 11px; color: var(--text3); margin-top: 3px; }
.integrity-items { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.integrity-item { font-size: 12px; color: var(--text2); padding: 3px 0; border-bottom: 0.5px solid var(--border); }
.integrity-item:last-child { border-bottom: none; }
.integrity-item-more { font-size: 11px; color: var(--text3); padding-top: 3px; }
.integrity-timestamp { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.audit-filter-bar select { font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.modal-box-wide { max-width: 560px; max-height: 85vh; overflow-y: auto; }
.modal-section { margin-bottom: 20px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-title {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 10px;
}
.modal-inline-row { display: flex; gap: 10px; }
.modal-inline-row .form-group { margin-bottom: 0; }
.modal-field-sm { width: 80px; flex-shrink: 0; }
.modal-add-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.modal-add-row .form-input { flex: 1; font-size: 12px; }
.modal-error { color: var(--red); font-size: 12px; margin-top: 6px; min-height: 16px; }
.modal-actions-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1rem; }
.agd-member-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 0.5px solid var(--border); }
.agd-member-row:last-child { border-bottom: none; }
.agd-member-info { flex: 1; font-size: 13px; color: var(--text); min-width: 0; }
.agd-member-role { font-size: 11px; color: var(--text3); margin-left: 4px; }
.agd-match-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 0.5px solid var(--border); }
.agd-match-row:last-child { border-bottom: none; }
.agd-match-info { flex: 1; font-size: 13px; color: var(--text); min-width: 0; }
.agd-match-meta { font-size: 11px; color: var(--text2); margin-top: 1px; }
.agd-btn-row { display: flex; gap: 6px; flex-shrink: 0; }
.btn-sm-ghost-danger { color: var(--red); }
.btn-sm-ghost-danger:hover { background: var(--red-light); color: var(--red); }
@media (max-width: 480px) {
  .stats-grid { gap: 6px; }
  .stat-value { font-size: 22px; }
}

/* ── No-group overlay ────────────────────────────────────────────── */
#no-group-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
[data-theme="dark"] #no-group-overlay {
  background: rgba(30,30,28, 0.72);
}
@media (prefers-color-scheme: dark) {
  #no-group-overlay { background: rgba(30,30,28, 0.72); }
}
.no-group-box {
  text-align: center; padding: 2rem 2.5rem;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  max-width: 280px;
}
.no-group-box .no-group-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.no-group-box p { font-size: 14px; color: var(--text2); margin: 0 0 1.25rem; line-height: 1.55; }

/* ── Empty states ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 2rem 1rem; color: var(--text2);
}
.empty-state p { font-size: 14px; }
.empty-state small { font-size: 12px; color: var(--text3); display: block; margin-top: 4px; }

/* ── Nav icon/label visibility ────────────────────────────────────── */
.nav-icon { display: inline-flex; align-items: center; line-height: 1; }
.nav-label { display: inline; }
.top-nav-btn { display: inline-flex; align-items: center; gap: 5px; }

/* ── Responsive top-bar ───────────────────────────────────────────── */
@media (max-width: 800px) {
  .nav-label { display: none; }
}
@media (max-width: 820px) {
  .is-admin .nav-label { display: none; }
}

@media (max-width: 580px) {
  .logo-img-full { display: none; }
  .logo-img-icon { display: block; height: 32px; }
  .top-bar { gap: 8px; padding: 0 0.75rem; }
  .top-nav { gap: 4px; }
  .top-nav-btn { padding: 4px 10px; font-size: 11px; }
  .group-select { max-width: 100px; }
}
@media (max-width: 600px) {
  .is-admin .logo-img-full { display: none; }
  .is-admin .logo-img-icon { display: block; height: 32px; }
  .is-admin .top-bar { gap: 8px; padding: 0 0.75rem; }
  .is-admin .top-nav { gap: 4px; }
  .is-admin .top-nav-btn { padding: 4px 10px; font-size: 11px; }
  .is-admin .group-select { max-width: 100px; }
}
@media (max-width: 400px) {
  .top-nav-btn { padding: 5px 9px; }
  .group-select { max-width: 70px; }
}
/* Admin has an extra nav pill — tighten only for those users */
@media (max-width: 645px) {
  .is-admin .top-bar { gap: 6px; }
  .is-admin .top-bar-right { gap: 6px; }
  .is-admin .top-nav { gap: 3px; }
}
@media (max-width: 500px) {
  .is-admin .top-nav-btn { padding: 5px 7px; }
  .is-admin .group-select { max-width: 60px; }
  .is-admin .top-bar-right { gap: 4px; }
  .is-admin .bell-btn { width: 26px; height: 26px; }
  .is-admin .avatar-btn { width: 26px; height: 26px; }
}

/* ── Onboarding tour ─────────────────────────────────────────────── */
#tour-overlay {
  position: fixed; inset: 0; z-index: 500; pointer-events: none;
}
#tour-highlight {
  position: fixed; z-index: 501; border-radius: var(--radius);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.52);
  transition: top 0.22s ease, left 0.22s ease, width 0.22s ease, height 0.22s ease;
  pointer-events: none;
}
#tour-card {
  position: fixed; z-index: 502; background: var(--surface);
  border-radius: var(--radius-lg); padding: 1.25rem 1.1rem 1rem;
  max-width: 290px; width: calc(100vw - 2rem);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  pointer-events: all; transition: top 0.22s ease, left 0.22s ease;
}
#tour-step-label {
  font-size: 11px; color: var(--text3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
#tour-title {
  font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
#tour-body { font-size: 13px; color: var(--text2); line-height: 1.5; }
#tour-actions { margin-top: 10px; }
#tour-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; gap: 8px;
}
#tour-skip {
  font-size: 12px; color: var(--text3); background: none; border: none;
  cursor: pointer; padding: 4px 0; text-decoration: underline;
}
#tour-skip:hover { color: var(--text2); }
#tour-next {
  background: var(--green); color: #fff; border: none; border-radius: var(--radius);
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.12s;
}
#tour-next:hover { background: var(--green-dark); }
.tour-action-btn {
  width: 100%; background: var(--green-light); color: var(--green);
  border: 1px solid var(--green); border-radius: var(--radius);
  padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.12s;
}
.tour-action-btn:hover { background: var(--green); color: #fff; }
/* ── Chat ─────────────────────────────────────────────────────────── */
.chat-float-panel {
  position:fixed; bottom:16px; right:16px;
  width:320px; max-height:480px;
  background:var(--surface); border:0.5px solid var(--border);
  border-radius:10px; box-shadow:0 4px 20px rgba(0,0,0,.12);
  z-index:200; display:flex; flex-direction:column;
  padding:12px;
}
@media (max-width:700px) {
  .chat-float-panel {
    left:0; right:0; bottom:0; width:100%;
    border-radius:12px 12px 0 0; max-height:70vh;
  }
}
.chat-panel-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.chat-panel-header span { font-size:14px; font-weight:600; color:var(--text); }
.chat-messages-list { display:flex; flex-direction:column; gap:8px; max-height:280px; overflow-y:auto; margin-bottom:8px; }
.chat-msg { display:flex; gap:8px; align-items:flex-start; }
.chat-msg.own { flex-direction:row-reverse; }
.chat-msg-bubble { background:var(--surface2); border-radius:12px; padding:6px 10px; max-width:78%; word-break:break-word; font-size:13px; position:relative; }
.chat-msg.own .chat-msg-bubble { background:var(--green); color:#fff; }
.chat-msg-meta { font-size:11px; color:var(--text3); margin-top:3px; display:flex; align-items:center; gap:6px; }
.chat-msg.own .chat-msg-meta { flex-direction:row-reverse; }
.chat-msg-del { font-size:10px; color:var(--text3); cursor:pointer; opacity:0; transition:opacity .12s; background:none; border:none; padding:0; line-height:1; }
.chat-msg-bubble:hover .chat-msg-del { opacity:0.7; }
.chat-msg.own .chat-msg-bubble:hover .chat-msg-del { opacity:0.9; }
.chat-send-form { display:flex; gap:6px; align-items:flex-end; margin-top:4px; }
.chat-input { flex:1; resize:none; border:1px solid var(--border); border-radius:8px; padding:6px 8px; font-size:13px; font-family:inherit; background:var(--bg); color:var(--text); }
.chat-input:focus { outline:none; border-color:var(--green); }
.chat-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
  min-width: 14px; height: 14px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; pointer-events: none;
}
