/* ============================================================
   ICAA Meeting Scheduler — brand stylesheet
   Palette derived from the ICAA logo:
     teal   #25c9cd (brand) / #0e7c86 (action) / #0a5f66 (deep)
     red    #ef1216 (accent — used sparingly)
     ink    #1d2430 (text) on white / soft-teal surfaces
   ============================================================ */
:root {
  --brand: #25c9cd;
  --brand-deep: #0e7c86;
  --brand-darker: #0a5f66;
  --brand-ink: #083d42;
  --brand-soft: #e6f8f9;
  --brand-softer: #f3fcfc;
  --accent: #ef1216;
  --accent-soft: #fdeeee;

  --bg: #f6fafb;
  --surface: #ffffff;
  --surface-alt: #f0f6f7;
  --border: #dbe7e9;
  --text: #1d2430;
  --muted: #5f7177;
  --success: #0c8a5a;
  --success-soft: #e9f8f1;
  --warning: #b3720a;
  --warning-soft: #fdf5e6;
  --danger: #d31418;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(8, 61, 66, 0.06), 0 10px 30px rgba(8, 61, 66, 0.08);
  --shadow-lg: 0 2px 4px rgba(8, 61, 66, 0.08), 0 24px 60px rgba(8, 61, 66, 0.14);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1000px 400px at 85% -100px, rgba(37, 201, 205, 0.14), transparent 60%),
    radial-gradient(800px 400px at -10% 30%, rgba(37, 201, 205, 0.08), transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand-deep); }

/* ---------- Header / navigation ---------- */
.app-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.app-header .brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text);
}
.app-header .logo {
  width: 40px; height: 40px; display: block; object-fit: contain;
}
.app-header .wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.app-header .wordmark b {
  font-size: 17px; font-weight: 750; letter-spacing: .2px; color: var(--brand-ink);
}
.app-header .wordmark span { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
/* SchoolStream co-branding line, tucked under the ICAA wordmark */
.app-header .wordmark .powered-by { font-size: 10.5px; letter-spacing: .35px; margin-top: 1px; }
.app-header .wordmark .powered-by b { color: var(--brand-deep); font-weight: 750; font-size: inherit; letter-spacing: inherit; }
.app-header .spacer { flex: 1; }
.app-header .nav { display: flex; align-items: center; gap: 18px; }
.app-header .nav a {
  font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.app-header .nav a:hover { color: var(--brand-deep); }
.app-header .nav a.btn-primary, .app-header .nav a.btn-primary:hover { color: #fff; }
.app-header .nav .btn { padding: 9px 16px; }
.page-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--brand-deep); background: var(--brand-soft);
  border: 1px solid #c4eef0; padding: 4px 10px; border-radius: 999px; margin-left: 6px;
}

/* ---------- Layout ---------- */
.container { max-width: 940px; margin: 0 auto; padding: 32px 20px 72px; width: 100%; flex: 1; }
.container.wide { max-width: 1100px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 22px;
}
.card h2 { margin: 0 0 4px; font-size: 20px; color: var(--brand-ink); letter-spacing: -.2px; }
.card .card-desc { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.card-accent { border-top: 3px solid var(--brand); }

/* ---------- Hero (landing) ---------- */
.hero { text-align: center; padding: 58px 20px 30px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--brand-deep); background: var(--brand-soft); border: 1px solid #c4eef0;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 44px); line-height: 1.12; letter-spacing: -1px;
  margin: 0 auto 16px; max-width: 720px; color: var(--brand-ink); font-weight: 800;
}
.hero h1 .hl { color: var(--brand-deep); }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 620px; margin: 0 auto 30px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Feature grid / steps ---------- */
.section-title { text-align: center; margin: 44px 0 6px; font-size: 24px; color: var(--brand-ink); letter-spacing: -.3px; }
.section-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin: 0 0 26px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.feature .f-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); font-size: 21px; margin-bottom: 14px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; color: var(--brand-ink); }
.feature p { margin: 0; font-size: 13.5px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px 18px; box-shadow: var(--shadow); }
.step .num {
  width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand-deep); color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.step h4 { margin: 0 0 4px; font-size: 14.5px; color: var(--brand-ink); }
.step p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 650; margin: 16px 0 6px; color: var(--brand-ink); }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-deep); box-shadow: 0 0 0 3px rgba(37, 201, 205, .22);
}
textarea { resize: vertical; min-height: 64px; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > .col { flex: 1 1 200px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #12909b, var(--brand-deep));
  color: #fff;
  box-shadow: 0 1px 2px rgba(8,61,66,.25), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #0f838d, var(--brand-darker)); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--brand-ink); }
.btn-ghost:hover { background: var(--brand-softer); border-color: var(--brand); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.small { padding: 8px 14px; font-size: 13px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650; padding: 4px 11px; border-radius: 999px;
}
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badge-gray { background: var(--surface-alt); color: var(--muted); }

/* ---------- Provider buttons ---------- */
.provider-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 4px; }
.provider-btn {
  flex: 1 1 210px; display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; font-weight: 650; font-size: 14px; color: var(--brand-ink);
  font-family: inherit; box-shadow: var(--shadow); transition: border-color .15s, background .15s;
}
.provider-btn:hover { border-color: var(--brand); background: var(--brand-softer); }
.provider-btn .ic { font-size: 18px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--brand-deep); font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; margin: 26px 0 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Slots & suggestions ---------- */
.slot-list { display: grid; gap: 10px; margin-top: 8px; }
.slot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--brand-softer);
}
.slot .when { font-weight: 650; color: var(--brand-ink); }

.suggestion {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: #fff; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.suggestion.best { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,201,205,.2), var(--shadow); position: relative; }
.suggestion.best::before {
  content: "★ Best match";
  position: absolute; top: -11px; left: 16px;
  background: var(--brand-deep); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; letter-spacing: .4px;
}
.suggestion .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.suggestion .when { font-size: 15.5px; font-weight: 700; color: var(--brand-ink); }
.suggestion .bar { height: 8px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; margin: 12px 0 8px; }
.suggestion .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-deep)); }
.suggestion .who { font-size: 12.5px; color: var(--muted); }
.suggestion .who b { color: var(--text); }

.attendee-grid { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; margin-top: 8px; }
.attendee-grid .nm { font-weight: 650; font-size: 14px; color: var(--brand-ink); }

/* ---------- Misc ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--brand-ink); color: #fff; padding: 13px 20px; border-radius: 11px;
  font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s;
  z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
code.inline { background: var(--surface-alt); padding: 2px 6px; border-radius: 6px; font-size: 12px; }

.callout {
  background: var(--brand-soft); border: 1px solid #b9e9eb; color: var(--brand-ink);
  border-radius: var(--radius-sm); padding: 13px 16px; font-size: 13.5px; margin-top: 14px;
}
.callout.success { background: var(--success-soft); border-color: #bfe8d6; color: #08543a; }

.link-box {
  display: flex; gap: 8px; align-items: center; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px;
}
.link-box input { border: none; background: transparent; padding: 4px; box-shadow: none; }
.link-box input:focus { box-shadow: none; }

table.invites { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
table.invites th, table.invites td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
table.invites th { color: var(--brand-deep); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- Progress stepper (coordinator) ---------- */
.stepper {
  display: flex; align-items: center; gap: 0; margin: 4px 0 26px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 10px; box-shadow: var(--shadow);
}
.stepper .st {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 13px; font-weight: 650; color: var(--muted); padding: 6px 8px;
  cursor: pointer; border-radius: 999px; transition: background .15s, color .15s;
  user-select: none;
}
.stepper .st:hover { background: var(--brand-softer); color: var(--brand-ink); }
.stepper .st .dot {
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface-alt); color: var(--muted); font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--border);
}
.stepper .st.active { color: var(--brand-ink); }
.stepper .st.active .dot { background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }
.stepper .st.done .dot { background: var(--success-soft); color: var(--success); border-color: #bfe8d6; }
.stepper .sep { width: 34px; height: 1px; background: var(--border); flex: 0 0 auto; }
@media (max-width: 640px) { .stepper .st span.lbl { display: none; } }

/* ---------- Stat tiles (dashboard) ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 6px 0 4px; }
.stat {
  background: var(--brand-softer); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat .v { font-size: 22px; font-weight: 800; color: var(--brand-ink); line-height: 1.1; letter-spacing: -.4px; }
.stat .l { font-size: 11.5px; font-weight: 700; color: var(--brand-deep); text-transform: uppercase; letter-spacing: .7px; margin-top: 3px; }

/* ---------- Info chips (attendee meeting facts) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-softer); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 13px; font-size: 12.5px; color: var(--brand-ink); font-weight: 600;
}
.chip .ci { font-size: 13px; }

/* ---------- Expired / past meeting cards ---------- */
.expired-card { opacity: .68; }
.expired-card:hover { opacity: 1; }

/* ---------- Tabs (coordinator / attendee) ---------- */
.tabs { display: flex; gap: 6px; margin: 18px 0 18px; border-bottom: 2px solid var(--border); }
.tab {
  padding: 11px 20px; font-weight: 700; font-size: 14px; color: var(--muted);
  background: none; border: none; border-bottom: 3px solid transparent;
  cursor: pointer; font-family: inherit; margin-bottom: -2px; border-radius: 8px 8px 0 0;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--brand-ink); background: var(--brand-softer); }
.tab.active { color: var(--brand-deep); border-bottom-color: var(--brand-deep); }

/* ---------- Registration promo banner ---------- */
.promo-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(100deg, var(--brand-darker) 0%, var(--brand-deep) 45%, var(--brand) 100%);
  color: #fff; border-radius: var(--radius); padding: 18px 22px;
  box-shadow: 0 8px 26px rgba(14, 124, 134, .35);
  margin-bottom: 22px;
}
.promo-banner .promo-text { flex: 1 1 300px; font-size: 14.5px; line-height: 1.5; }
.promo-banner .promo-text b { font-size: 16px; display: block; margin-bottom: 2px; }
.promo-banner .promo-text .sub { opacity: .92; }
.btn-promo {
  background: #fff; color: var(--brand-darker); border: none;
  padding: 13px 22px; border-radius: 10px; font-weight: 800; font-size: 14.5px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  /* Attention-grabbing but finite: pulses a few times, then settles. */
  animation: promoPulse 2.2s ease-in-out 3;
}
.btn-promo:hover { background: var(--brand-softer); }
@media (prefers-reduced-motion: reduce) { .btn-promo { animation: none; } }
@keyframes promoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 3px 10px rgba(0,0,0,.18); }
  50% { transform: scale(1.04); box-shadow: 0 6px 18px rgba(0,0,0,.28); }
}

/* ---------- Danger / delete ---------- */
.btn-danger {
  background: var(--accent-soft) !important;
  border-color: #f6b9ba !important;
  color: var(--danger) !important;
  font-weight: 700;
}
.btn-trash:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- Modal (Add to my calendar) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8, 61, 66, 0.45);
  display: grid; place-items: center; z-index: 60; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%; padding: 24px; max-height: 90vh; overflow-y: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 18px; color: var(--brand-ink); }

/* ---------- Trust strip & footer ---------- */
.trust-strip {
  display: flex; gap: 26px; justify-content: center; flex-wrap: wrap;
  margin: 40px auto 0; padding: 18px 22px; max-width: 860px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); font-size: 13px; color: var(--muted);
}
.trust-strip b { color: var(--brand-ink); }
.trust-strip .t { display: flex; align-items: center; gap: 8px; }

.app-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 26px 28px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.app-footer .logo { width: 26px; height: 26px; object-fit: contain; }
.app-footer .powered-by-footer { font-size: 12px; color: var(--muted); }
.app-footer .powered-by-footer::before { content: "·"; margin-right: 14px; color: var(--border); }
.app-footer .powered-by-footer b { color: var(--brand-deep); font-weight: 700; }
.app-footer .spacer { flex: 1; }
.app-footer a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.app-footer a:hover { color: var(--brand-deep); }

/* ===== Mobile (v2.8) — phones & small tablets ===== */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }

  /* Header: compact brand, no page tag, tight nav — nothing overflows 360px */
  .app-header { padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); height: 58px; gap: 8px; }
  .app-header .logo { width: 30px; height: 30px; }
  .app-header .brand { gap: 8px; min-width: 0; }
  .app-header .wordmark b { font-size: 13.5px; letter-spacing: 0; white-space: nowrap; }
  .app-header .wordmark .powered-by { font-size: 8.5px; letter-spacing: .2px; white-space: nowrap; }
  .page-tag { display: none; }
  .app-header .nav { gap: 10px; }
  /* v4.2 — hide only NON-essential plain links on small screens. Links marked
     .nav-keep (the "My meetings" way back on every page) must NEVER
     disappear, or the user gets stranded with no navigation. */
  .app-header .nav a:not(.btn):not(.nav-keep) { display: none; }
  .app-header .nav a.nav-keep { font-size: 13px; white-space: nowrap; }
  .app-header .nav .btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  #userChip { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .container { padding: 18px 14px 56px; }
  .card { padding: 18px 16px; }
  .hero { padding: 34px 16px 18px; }
  .hero h1 { font-size: clamp(26px, 7.5vw, 34px); }
  .hero p.lead { font-size: 15px; }

  /* iOS zooms into inputs under 16px — keep form controls at 16px on phones */
  input, select, textarea { font-size: 16px; padding: 12px 13px; }
  .btn { min-height: 44px; }              /* comfortable touch targets */
  .btn.small { min-height: 36px; }

  /* Wide content scrolls inside its card instead of stretching the page */
  table.invites { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .link-box { flex-wrap: wrap; }
  .link-box input { min-width: 0; flex: 1 1 140px; font-size: 13px; }
  pre, code { word-break: break-word; }

  .row { gap: 10px; }
  .cta-row .btn { width: 100%; }

  .app-footer { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); gap: 8px; font-size: 12px; }
  .app-footer .powered-by-footer::before { content: none; }
  .app-footer a { margin-left: 10px; }

  .modal { max-height: 86vh; }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .app-header .wordmark .powered-by { display: none; }
  .app-header .wordmark b { font-size: 13px; }
}

/* ===== Scheduler Administrator console (v2.7) ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.admin-health { display: flex; flex-wrap: wrap; gap: 10px; }
.health-chip {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; min-width: 120px;
}
.health-chip.bad { border-color: var(--danger); background: #fdf2f2; }
.health-chip .hc-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.health-chip .hc-value { font-size: 14px; font-weight: 700; color: var(--ink); word-break: break-word; }

.cfg-field { margin-bottom: 18px; }
.cfg-field label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cfg-key {
  font-family: Consolas, Menlo, monospace; font-size: 11px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px;
}
.cfg-restart, .cfg-secret, .cfg-src { font-size: 10.5px; border-radius: 6px; padding: 2px 7px; font-weight: 600; }
.cfg-restart { background: #fff4e5; color: #8a5a00; border: 1px solid #f2d9ac; }
.cfg-secret { background: #f3eefe; color: #5b3ea8; border: 1px solid #ddd0f5; }
.cfg-src { background: var(--success-soft); color: #08543a; border: 1px solid #bfe8d6; }
.cfg-help { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ===== Coordinator roster: availability details + list editing (v3.0) ===== */
.roster-row { border-bottom: 1px solid var(--border); padding: 10px 0; }
.roster-row:last-child { border-bottom: none; }
.roster-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.roster-main .nm { font-weight: 650; font-size: 14px; color: var(--brand-ink); flex: 1 1 180px; }
.roster-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.roster-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.roster-avail {
  margin: 10px 0 4px 6px; padding: 10px 14px;
  background: var(--brand-softer); border: 1px solid var(--border); border-radius: 10px;
}
.roster-avail .slot { background: #fff; }

/* ===== Server-unreachable banner (v3.1) ===== */
.server-down-banner {
  position: sticky; top: 0; z-index: 60;
  background: #fff4e5; border-bottom: 2px solid #f2b8ac; color: #7a3b00;
  padding: 12px 20px; font-size: 13.5px; line-height: 1.6; text-align: center;
}
.server-down-banner code { background: #fff; border: 1px solid #f2d9ac; border-radius: 5px; padding: 1px 6px; }
.server-down-banner .sdb-retry { margin-left: 10px; background: #7a3b00; color: #fff; border: none; padding: 6px 14px; }
.server-down-banner .sdb-hint { display: inline-block; }
@media (max-width: 640px) { .server-down-banner { font-size: 12.5px; padding: 10px 12px; } }

/* ===== Meeting days picker (v3.4) ===== */
.workday-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.workday-picker .wd {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 13px; font-weight: 600; color: var(--brand-ink);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; user-select: none;
}
.workday-picker .wd:has(input:checked) { background: var(--brand-soft); border-color: #c4eef0; color: var(--brand-deep); }
.workday-picker input { width: auto; margin: 0; accent-color: var(--brand-deep); }

/* ===== Pinned confirmed-time banner (v3.5) ===== */
.final-pin .fp-label {
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.2px; color: #08543a;
}
.final-pin .fp-time {
  font-size: 22px; font-weight: 800; color: var(--brand-ink); margin: 4px 0 2px; letter-spacing: -.3px;
}
.final-pin .fp-sub { font-size: 12.5px; color: #35604f; }

/* ===== Time-change requests (v3.7) ===== */
.cr-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.cr-who { flex: 1 1 260px; }
.cr-msg { font-size: 13px; color: var(--text); margin-top: 4px; font-style: italic; }
.cr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dlg-input { width: 100%; }

/* ===== Change-request visibility (v3.8): red list icon + pink panel ===== */
.badge-alert {
  background: #fdeeee; color: #b30f13; border: 1px solid #f3b6b8;
  font-weight: 800; animation: crPulse 1.6s ease-in-out 4;
}
@keyframes crPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(211,20,24,.35); } 50% { box-shadow: 0 0 0 6px rgba(211,20,24,0); } }
@media (prefers-reduced-motion: reduce) { .badge-alert { animation: none; } }
.suggestion.has-change-request { border-left: 4px solid var(--danger); }

.cr-panel {
  margin: 0 0 16px; padding: 14px 18px;
  background: #fde8f3;                    /* noticeable pink */
  border: 2px solid #ec4899; border-left-width: 6px;
  border-radius: 12px;
}
.cr-panel .cr-title { font-weight: 800; color: #9d174d; font-size: 15px; margin-bottom: 2px; }
.cr-panel .cr-row { background: #fff0f7; border-color: #f9a8d4; }
.cr-panel .cr-msg {
  color: #9d174d; background: #fce7f3; border: 1px solid #f9a8d4;
  border-radius: 8px; padding: 6px 10px; margin-top: 6px;
  font-size: 13.5px; font-weight: 600; font-style: normal;
}

/* ===== Coordinator decision reason shown to the attendee (v3.9) ===== */
.coord-reason {
  margin-top: 8px; padding: 8px 12px;
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--brand-deep);
  border-radius: 8px; font-size: 13.5px; color: var(--text);
}

/* ===== Meeting time changed — attendee notification (v4.0) ===== */
/* Pink alert badge on the attendee's My-meetings list: the confirmed time
   changed and they haven't opened their link since. */
.badge-pink {
  background: #fce7f3; color: #9d174d; border: 1px solid #ec4899;
  font-weight: 800; animation: crPulse 1.6s ease-in-out 4;
}
@media (prefers-reduced-motion: reduce) { .badge-pink { animation: none; } }
.suggestion.has-time-change { border-left: 4px solid #ec4899; }

/* Pink change notice on the attendee's invite page (old → new time + reason). */
.tc-panel {
  margin: 0 0 12px; padding: 14px 18px;
  background: #fde8f3;                    /* noticeable pink */
  border: 2px solid #ec4899; border-left-width: 6px;
  border-radius: 12px;
}
.tc-title { font-weight: 800; color: #9d174d; margin-bottom: 6px; }
.tc-old { color: #9d174d; }
.tc-old s, .tc-panel s { color: #9d174d; opacity: .8; }
.tc-new { margin-top: 4px; }

/* ===== First-page time-change alert (v4.1) ===== */
/* Pink counter chip on the Attendee tab — visible even while the
   Coordinator tab is active. */
.tab-chip-pink {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: #fce7f3; color: #9d174d; border: 1px solid #ec4899;
  border-radius: 999px; font-size: 12px; font-weight: 800;
  animation: crPulse 1.6s ease-in-out 4;
}
@media (prefers-reduced-motion: reduce) { .tab-chip-pink { animation: none; } }
/* One row per changed meeting inside the banner. */
.tc-alert-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-top: 10px; padding: 10px 12px;
  background: #fff; border: 1px solid #f3c6dd; border-radius: 10px;
}
@media (max-width: 640px) {
  .tc-alert-row { flex-direction: column; align-items: stretch; }
  .tc-alert-row .btn { text-align: center; }
}

/* ===== Meeting rules editor on the dashboard (v4.3) ===== */
.rules-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rule-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rule-chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--brand-softer, #f0fbfc); border: 1px solid #c4eef0;
  color: var(--brand-ink, #083d42); font-size: 13px; font-weight: 650;
}
.rules-edit {
  padding: 14px 16px; background: #fbfeff; border: 1px solid var(--border);
  border-radius: 12px;
}

/* ===== "Any day, any time" vs business rules (v4.4) ===== */
.rule-mode { display: flex; flex-direction: column; gap: 8px; }
.rm-opt {
  display: flex; align-items: flex-start; gap: 10px; margin: 0;
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; font-weight: 400;
}
.rm-opt:has(input:checked) { border-color: var(--brand-deep); background: var(--brand-softer); }
.rm-opt input { width: auto; margin-top: 3px; accent-color: var(--brand-deep); }
.rm-opt b { color: var(--brand-ink); }
.biz-rules {
  margin-top: 10px; padding: 4px 16px 14px;
  border: 1px dashed var(--border); border-radius: 10px; background: #fbfeff;
}
.rule-chip.chip-any { background: #eafaf0; border-color: #b7e4c7; color: #0c8a5a; }

/* ===== QR code dialog (v4.5) ===== */
.qr-box {
  background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--border);
  width: 240px; height: 240px;
}
.qr-box svg { width: 100%; height: 100%; display: block; }

/* ===== Dark mode (v4.5) — follows the device setting automatically ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --brand-ink: #bfeef1;
    --brand-soft: #0d3236;
    --brand-softer: #0b2a2e;
    --accent-soft: #3a1518;
    --bg: #0c1416;
    --surface: #131f22;
    --surface-alt: #17262a;
    --border: #294247;
    --text: #e2edee;
    --muted: #93aab0;
    --success-soft: #0e2b20;
    --warning-soft: #2e2410;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .45), 0 24px 60px rgba(0, 0, 0, .5);
  }
  body {
    background:
      radial-gradient(1000px 400px at 85% -100px, rgba(37, 201, 205, 0.10), transparent 60%),
      radial-gradient(800px 400px at -10% 30%, rgba(37, 201, 205, 0.05), transparent 55%),
      var(--bg);
  }
  .app-header { background: rgba(15, 24, 26, 0.92); }
  input, select, textarea { background: #0f1a1d; color: var(--text); }
  input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(37, 201, 205, .18); }
  /* Light-tinted panels: keep tint, dark base */
  .rm-opt, .tc-alert-row, .coord-reason { background: var(--surface); }
  .rules-edit, .biz-rules { background: var(--surface-alt); }
  .rule-chip { background: var(--brand-softer); border-color: #1d4b52; }
  .modal { background: var(--surface); }
  .callout { background: var(--surface-alt); }
  .promo-banner { filter: brightness(.92); }
  /* Alert panels stay light on purpose (pink/green cards read as cards),
     but soften their glare slightly. */
  .cr-panel, .tc-panel, .final-pin, .callout.success { filter: brightness(.96); }
  .qr-box { background: #fff; } /* QR must stay black-on-white to scan */
  .app-footer { background: var(--surface); }
  .suggestion, .stat, .roster-row, .card, .feature, .step { background: var(--surface); }
  .invites th { background: var(--surface-alt); }
  .link-box input { background: #0f1a1d; }
}

@media (prefers-color-scheme: dark) {
  /* Ghost buttons were white pills with light text — unreadable on dark. */
  .btn-ghost {
    background: var(--surface-alt); color: var(--text); border-color: var(--border);
  }
  .btn-ghost:hover { background: #1d3237; border-color: #35545a; }
}

/* ===== Tap-and-drag availability grid — attendee (v4.6) ===== */
.avail-grid { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ag-inner { display: grid; gap: 0; padding: 8px; touch-action: none; user-select: none; -webkit-user-select: none; }
.ag-corner { position: sticky; left: 0; }
.ag-day, .hm-day {
  text-align: center; font-size: 11.5px; font-weight: 700; color: var(--brand-ink);
  line-height: 1.25; padding: 4px 2px 6px;
}
.ag-time, .hm-time {
  font-size: 10.5px; color: var(--muted); text-align: right; padding-right: 6px;
  transform: translateY(-6px); white-space: nowrap;
}
.ag-cell {
  height: 26px; border: 1px solid var(--border); border-top-width: 0; border-left-width: 0;
  background: var(--surface-alt); cursor: pointer;
}
.ag-cell.hour { border-top-width: 1.5px; border-top-color: #b7ced2; }
.ag-cell:hover { background: var(--brand-soft); }
.ag-cell.on { background: #12909b; border-color: #0e7c86; }
.ag-cell.on:hover { background: #0e7c86; }

/* ===== Availability heatmap — coordinator (v4.6) =====
   Sequential single-hue teal ramp, light→dark (lightness-monotonic). */
.hm-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.hm-inner { display: grid; gap: 0; padding: 8px; }
.hm-cell { height: 18px; border: 1px solid var(--surface); background: var(--surface-alt); }
.hm-cell.hour { border-top-color: #c9dde0; }
.hm-cell.heat-1 { background: #bfeef1; }
.hm-cell.heat-2 { background: #7fdbe0; }
.hm-cell.heat-3 { background: #3fc3ca; }
.hm-cell.heat-4 { background: #12909b; }
.hm-cell.heat-4.heat-all { background: #0a5f66; outline: 1px solid #083d42; outline-offset: -1px; }
.hm-legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.hm-swatch { display: inline-block; width: 20px; height: 12px; border-radius: 3px; border: 1px solid var(--border); }
.hm-swatch.heat-1 { background: #bfeef1; }
.hm-swatch.heat-2 { background: #7fdbe0; }
.hm-swatch.heat-3 { background: #3fc3ca; }
.hm-swatch.heat-4 { background: #12909b; }
.hm-swatch.heat-4.heat-all { background: #0a5f66; }

@media (prefers-color-scheme: dark) {
  .ag-cell { background: #0f1a1d; }
  .ag-cell:hover { background: #16343a; }
  .ag-cell.hour { border-top-color: #35545a; }
  .ag-cell.on { background: #2ab3bb; border-color: #3fc3ca; }
  .hm-cell { border-color: var(--surface); background: #0f1a1d; }
  .hm-cell.hour { border-top-color: #35545a; }
  /* Dark mode gets its own selected steps (not an automatic flip):
     dark→light teal so MORE people = BRIGHTER on the dark surface. */
  .hm-cell.heat-1 { background: #124b50; }
  .hm-cell.heat-2 { background: #17707a; }
  .hm-cell.heat-3 { background: #2ab3bb; }
  .hm-cell.heat-4 { background: #6fe3e9; }
  .hm-cell.heat-4.heat-all { background: #bff5f7; outline-color: #e2fdfe; }
  .hm-swatch.heat-1 { background: #124b50; }
  .hm-swatch.heat-2 { background: #17707a; }
  .hm-swatch.heat-3 { background: #2ab3bb; }
  .hm-swatch.heat-4 { background: #6fe3e9; }
  .hm-swatch.heat-4.heat-all { background: #bff5f7; }
}
@media (max-width: 640px) {
  .ag-cell { height: 30px; } /* bigger touch targets on phones */
}

/* ===== "Who's free when" per-attendee view (v4.6 revision) ===== */
.hm-cell.hm-all {
  background: #0c8a5a;
  outline: 1.5px solid #083d42; outline-offset: -1.5px;
}
.hm-swatch.hm-all { background: #0c8a5a; border-color: #083d42; }
.hm-name { margin-right: 8px; }
@media (prefers-color-scheme: dark) {
  .hm-cell.hm-all { background: #16b374; outline-color: #d9fbe9; }
  .hm-swatch.hm-all { background: #16b374; }
}

/* Green everyone-free squares are clickable time pickers (v4.6 revision 2). */
.hm-cell.hm-all { cursor: pointer; }
.hm-cell.hm-all:hover { filter: brightness(1.15); box-shadow: 0 0 0 2px #0c8a5a inset; }

/* v5.0 — EVERY square with at least one person is a time picker, not just the
   unanimous green ones (vote mode rarely produces unanimity). */
.hm-cell.hm-pick { cursor: pointer; }
.hm-cell.hm-pick:not(.hm-all):hover { filter: brightness(1.12); box-shadow: 0 0 0 2px var(--brand-ink) inset; }
@media (prefers-color-scheme: dark) {
  .hm-cell.hm-pick:not(.hm-all):hover { box-shadow: 0 0 0 2px #e2edee inset; }
}

/* ===== Vote-on-times + deadline (v4.7) ===== */
.vote-opt { cursor: pointer; border: 1.5px solid var(--border); }
.vote-opt input { width: 22px; height: 22px; accent-color: var(--brand-deep); flex: 0 0 auto; }
.vote-opt.on { border-color: var(--brand-deep); background: var(--brand-softer); }
.rule-chip.chip-vote { background: #efe7fb; border-color: #c8b1f0; color: #5b21b6; }
.rule-chip.chip-overdue { background: var(--accent-soft); border-color: #f3b6b8; color: var(--danger); }
@media (prefers-color-scheme: dark) {
  .vote-opt.on { background: #16343a; }
  .rule-chip.chip-vote { background: #2a1f47; border-color: #5b21b6; color: #cdb6f6; }
}

/* ===== My-meetings calendar view (v4.8) ===== */
.view-toggle {
  display: inline-flex; border: 1.5px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--card);
}
.vt {
  border: 0; background: transparent; padding: 7px 13px; font: inherit;
  font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.vt + .vt { border-left: 1.5px solid var(--border); }
.vt.active { background: var(--brand-deep); color: #fff; }

.cal-wrap { margin: 4px 0 10px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; }
.cal-title { flex: 1; text-align: center; font-weight: 800; font-size: 17px; color: var(--brand-ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dows { margin-bottom: 4px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 800; letter-spacing: .4px; color: var(--muted); text-transform: uppercase; }
.cal-cell {
  min-height: 84px; border: 1px solid var(--border); border-radius: 10px;
  padding: 4px 5px; background: var(--card); cursor: pointer; overflow: hidden;
}
.cal-cell:hover:not(.dim) { border-color: var(--brand-deep); }
.cal-cell.dim { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.cur-week { background: var(--brand-softer); }
.cal-cell.today { outline: 2px solid var(--brand-deep); outline-offset: -2px; }
.cal-num { font-size: 12px; font-weight: 800; color: var(--brand-ink); display: flex; align-items: center; gap: 6px; }
.cal-today-tag {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  background: var(--brand-deep); color: #fff; border-radius: 6px; padding: 1px 5px;
}
.cal-evt {
  display: block; font-size: 11px; line-height: 1.35; border-radius: 6px;
  padding: 2px 5px; margin-top: 3px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-decoration: none; cursor: pointer;
}
.cal-evt.confirmed { background: #d8f3e6; border: 1px solid #79c9a4; color: #0b5e3d; }
.cal-evt.collecting { background: transparent; border: 1.5px dashed #d9a514; color: #8a6a00; }
.cal-evt.held, .cal-evt.expired { background: #ececec; border: 1px solid #cfcfcf; color: #666; }
.cal-evt:hover { filter: brightness(0.96); text-decoration: none; }
.cal-more { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); margin-top: 3px; }
.cal-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.cal-evt.cal-key { display: inline-block; margin: 0; cursor: default; }

.cal-day-detail {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px;
  margin: 0 0 14px; background: var(--card);
}
.cal-dd-head { font-size: 14px; color: var(--brand-ink); }
.cal-dd-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 9px 0; border-top: 1px solid var(--border); margin-top: 9px;
}

@media (max-width: 640px) {
  .cal-cell { min-height: 62px; padding: 3px 3px; }
  .cal-title { font-size: 15px; }
  /* Phones: titles truncate to nothing in a 7-column grid, so each meeting
     becomes a colored DOT and the whole cell opens that day's detail list
     (dots are decorative there — the list carries the names and Open links). */
  .cal-cell .cal-evt {
    display: inline-block; width: 9px; height: 9px; padding: 0; margin: 3px 3px 0 0;
    border-radius: 50%; font-size: 0; line-height: 0; overflow: hidden; pointer-events: none;
  }
  .cal-cell .cal-evt.collecting { border-width: 2px; border-style: solid; }
  .cal-num { font-size: 11.5px; }
  .cal-today-tag { display: none; }        /* the ring already marks today */
  .cal-cell.today .cal-num { color: var(--brand-deep); text-decoration: underline; }
  .cal-more { font-size: 9.5px; }
  /* A dot can't show the 🔴/🕐 marker, so needs-attention meetings get a ring. */
  .cal-cell .cal-evt.has-mark { box-shadow: 0 0 0 2px var(--danger); }
}
.cal-hint-narrow { display: none; }
@media (max-width: 640px) {
  .cal-hint-wide { display: none; }
  .cal-hint-narrow { display: inline; }
}

@media (prefers-color-scheme: dark) {
  .vt.active { background: #2ab3bb; color: #06262a; }
  .cal-cell.cur-week { background: #10333a; }
  .cal-evt.confirmed { background: #0d3d2a; border-color: #1c7a52; color: #8fe0bb; }
  .cal-evt.collecting { border-color: #a8842a; color: #e3c05e; }
  .cal-evt.held, .cal-evt.expired { background: #26292b; border-color: #43484b; color: #9aa2a6; }
}

/* ===== Expandable "Meeting settings" panel on the create form (v5.1) ===== */
.settings-panel {
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--card);
  margin: 22px 0 4px; overflow: hidden;
}
.settings-panel[open] { border-color: var(--brand-deep); }
.settings-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 16px; cursor: pointer; list-style: none;
  background: var(--brand-softer);
}
.settings-head::-webkit-details-marker { display: none; }
.settings-head::before {
  content: '▸'; font-size: 13px; color: var(--brand-deep); font-weight: 900;
  transition: transform .15s ease; flex: 0 0 auto;
}
.settings-panel[open] .settings-head::before { transform: rotate(90deg); }
.settings-head:hover { filter: brightness(0.98); }
.settings-title {
  font-size: 13px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--brand-ink); flex: 0 0 auto;
}
.settings-summary { font-size: 13px; color: var(--muted); flex: 1 1 auto; }
.settings-panel[open] .settings-summary { display: none; }
.settings-body { padding: 4px 16px 18px; }
.settings-group { padding: 14px 0 2px; border-top: 1px solid var(--border); }
.settings-group:first-child { border-top: 0; padding-top: 8px; }
.sg-title {
  font-size: 13.5px; font-weight: 800; color: var(--brand-ink); margin: 0 0 8px;
}
.settings-group .row { margin-bottom: 2px; }
@media (max-width: 640px) {
  .settings-head { padding: 11px 12px; gap: 8px; }
  .settings-summary { flex-basis: 100%; }
  .settings-body { padding: 4px 12px 16px; }
}
@media (prefers-color-scheme: dark) {
  .settings-head { background: #10333a; }
}
