/* ================================================================
   مَرفأ | MARFA — design system
   Deep navy base + teal accent, glassmorphism, RTL first
   ================================================================ */

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

:root {
  --navy-900: #071426;
  --navy-800: #0A1A2F;
  --navy-700: #0E2440;
  --teal: #22D3EE;
  --teal-deep: #0E9CB8;
  --teal-soft: rgba(34, 211, 238, 0.14);
  --teal-line: rgba(34, 211, 238, 0.18);
  --teal-line-strong: rgba(34, 211, 238, 0.34);
  --text: #F8FAFC;
  --muted: #94A3B8;
  --muted-2: #6E859C;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 28px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --glow: 0 0 40px rgba(34, 211, 238, 0.10);
  --font: "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-w: 268px;
  --ok: #34D399;
  --warn: #FBBF24;
  --bad: #FB7185;
}

html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, #071426 0%, #0A1A2F 46%, #071426 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 50% -8%, rgba(34, 211, 238, 0.20), transparent 62%),
    radial-gradient(620px 420px at 94% 2%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(560px 400px at 2% 34%, rgba(45, 212, 191, 0.07), transparent 65%);
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 12px;
}
::selection { background: rgba(34, 211, 238, 0.32); }

.hidden { display: none !important; }

/* thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(34, 211, 238, 0.35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, 0.28); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================ topbar ============================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(7, 20, 38, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.10);
}

.brand { display: flex; align-items: center; gap: 10px; -webkit-tap-highlight-color: transparent; }
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #04121F;
  background: linear-gradient(145deg, #67E8F9, #22D3EE 45%, #0E9CB8);
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  flex: 0 0 auto;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text strong { display: block; font-size: 1.12rem; font-weight: 700; line-height: 1.05; letter-spacing: 0.01em; }
.brand-text small { display: block; font-size: 0.58rem; letter-spacing: 0.24em; color: var(--muted); margin-top: 3px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--teal-line);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  max-width: 46vw;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.user-chip:hover { border-color: var(--teal-line-strong); background: var(--glass-strong); }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ shell ============================ */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 96px;
}

.view { padding: 16px 16px 0; min-width: 0; }

.sidebar { display: none; }

@media (min-width: 1024px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 32px;
    padding: 26px 30px 56px;
    align-items: start;
  }
  .sidebar { display: block; position: sticky; top: 92px; }
  .view { padding: 0; }
}

/* ============================ sidebar ============================ */
.side-card {
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
.side-title {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  margin: 6px 8px 12px;
  font-weight: 600;
}
.side-link {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
  text-align: start;
  min-height: 46px;
}
.side-link svg { width: 20px; height: 20px; flex: 0 0 auto; }
.side-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.side-link.is-active {
  background: var(--teal-soft);
  color: #CFFAFE;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.22);
}
.side-link.is-active svg { color: var(--teal); }

.side-promo { text-align: center; }
.side-promo h3 { font-size: 0.98rem; margin-bottom: 6px; }
.side-promo p { font-size: 0.8rem; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }

/* ============================ bottom nav ============================ */
.bottomnav {
  position: fixed;
  z-index: 70;
  inset-inline: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px 10px;
  background: rgba(8, 22, 40, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(34, 211, 238, 0.14);
}
@media (min-width: 1024px) { .bottomnav { display: none; } }

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: 14px;
  color: var(--muted-2);
  font-size: 0.66rem;
  font-weight: 600;
  min-height: 52px;
  transition: color 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.is-active { color: var(--teal); background: rgba(34, 211, 238, 0.08); }
.nav-item:active { transform: scale(0.96); }

.nav-badge {
  position: absolute;
  top: 2px;
  inset-inline-start: 50%;
  margin-inline-start: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--teal);
  color: #04121F;
  font-size: 0.6rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* ============================ primitives ============================ */
.glass {
  background: var(--glass);
  border: 1px solid var(--teal-line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:hover { background: rgba(255, 255, 255, 0.11); }
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(140deg, #67E8F9, #22D3EE 55%, #12B6D4);
  color: #04121F;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.28);
}
.btn-primary:hover { background: linear-gradient(140deg, #8DF0FC, #22D3EE 55%, #17C3E2); }

.btn-ghost { background: transparent; border-color: var(--teal-line); color: #CFFAFE; }
.btn-ghost:hover { background: rgba(34, 211, 238, 0.10); border-color: var(--teal-line-strong); }

.btn-soft { background: rgba(34, 211, 238, 0.10); border-color: rgba(34, 211, 238, 0.22); color: #CFFAFE; }
.btn-soft:hover { background: rgba(34, 211, 238, 0.16); }

.btn-danger { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.35); color: #FECDD3; }
.btn-danger:hover { background: rgba(251, 113, 133, 0.2); }

.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.82rem; border-radius: 12px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.is-on { color: var(--teal); background: rgba(34, 211, 238, 0.14); border-color: rgba(34, 211, 238, 0.3); }

.link-btn {
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 2px;
  border-radius: 8px;
}
.link-btn:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.tabnum { font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-type { background: rgba(34, 211, 238, 0.13); color: #A5F3FC; border-color: rgba(34, 211, 238, 0.22); }
.badge-mode { background: rgba(255, 255, 255, 0.06); color: var(--muted); border-color: rgba(255, 255, 255, 0.1); }
.badge-level { background: rgba(167, 139, 250, 0.12); color: #DDD6FE; border-color: rgba(167, 139, 250, 0.24); }
.badge-demo {
  background: rgba(148, 163, 184, 0.10);
  color: #CBD5E1;
  border-color: rgba(148, 163, 184, 0.30);
  border-style: dashed;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 6px; height: 6px; border-radius: 99px; background: currentColor;
}
.pill-open { background: rgba(52, 211, 153, 0.12); color: #6EE7B7; border-color: rgba(52, 211, 153, 0.28); }
.pill-soon { background: rgba(251, 191, 36, 0.12); color: #FCD34D; border-color: rgba(251, 191, 36, 0.28); }
.pill-closed { background: rgba(148, 163, 184, 0.12); color: #CBD5E1; border-color: rgba(148, 163, 184, 0.24); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.71rem;
  color: #BAE6FD;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.14);
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* match ring */
.ring { position: relative; width: var(--s, 56px); height: var(--s, 56px); display: grid; place-items: center; flex: 0 0 auto; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 2.8; }
.ring-fg { fill: none; stroke: var(--teal); stroke-width: 2.8; stroke-linecap: round; transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-num { font-size: calc(var(--s, 56px) * 0.29); font-weight: 700; font-variant-numeric: tabular-nums; color: #E0FBFF; letter-spacing: -0.02em; }
.ring-num i { font-style: normal; font-size: 0.62em; opacity: 0.65; margin-inline-start: 1px; }

/* avatars */
.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: #04121F;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.avatar-g0 { background: linear-gradient(145deg, #67E8F9, #22D3EE); }
.avatar-g1 { background: linear-gradient(145deg, #C4B5FD, #8B5CF6); color: #14082B; }
.avatar-g2 { background: linear-gradient(145deg, #6EE7B7, #10B981); color: #05231B; }
.avatar-g3 { background: linear-gradient(145deg, #FDBA74, #F97316); color: #2B1105; }
.avatar-g4 { background: linear-gradient(145deg, #FDA4AF, #F43F5E); color: #2B0710; }
.avatar-g5 { background: linear-gradient(145deg, #A5B4FC, #6366F1); color: #0A0B2E; }
.avatar-g6 { background: linear-gradient(145deg, #FDE68A, #F59E0B); color: #2B1B02; }
.avatar-g7 { background: linear-gradient(145deg, #7DD3FC, #0EA5E9); color: #041B2B; }

/* ============================ hero ============================ */
.hero-main {
  position: relative;
  padding: 26px 22px 22px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.hero-main::after {
  content: "";
  position: absolute;
  inset-inline: -20%;
  top: -140px;
  height: 250px;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.30), transparent 70%);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #A5F3FC;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.eyebrow svg { width: 14px; height: 14px; }

.hero-title {
  font-size: clamp(1.6rem, 5.6vw, 2.5rem);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-bottom: 12px;
  max-width: 20ch;
}
.hero-sub {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 54ch;
  margin-bottom: 20px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.stat { min-width: 0; }
.stat-num { font-size: clamp(1.15rem, 4.4vw, 1.6rem); font-weight: 700; font-variant-numeric: tabular-nums; color: #E0FBFF; }
.stat-label { font-size: 0.7rem; color: var(--muted-2); line-height: 1.4; }

/* ============================ sections ============================ */
.section { margin-top: 26px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.06rem;
  font-weight: 700;
}
.section-title svg { width: 18px; height: 18px; color: var(--teal); }
.section-sub { font-size: 0.8rem; color: var(--muted-2); margin-top: 2px; }

.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.soon-card {
  flex: 0 0 min(268px, 78vw);
  scroll-snap-align: start;
  padding: 14px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: start;
  transition: border-color 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}
.soon-card:hover { border-color: var(--teal-line-strong); }
.soon-card:active { transform: scale(0.99); }
.soon-title { font-size: 0.95rem; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.soon-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.countdown {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  color: #FCD34D;
  border: 1px solid rgba(251, 191, 36, 0.24);
  white-space: nowrap;
}
.countdown.urgent { background: rgba(244, 63, 94, 0.14); color: #FDA4AF; border-color: rgba(244, 63, 94, 0.3); }

/* ============================ cards grid ============================ */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 288px), 1fr));
  gap: 14px;
}
.grid-2 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.card {
  position: relative;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--teal-line);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-align: start;
  min-width: 0;
}
@media (hover: hover) {
  .card:hover {
    border-color: var(--teal-line-strong);
    box-shadow: var(--shadow), var(--glow);
  }
  .event-card:hover { transform: translateY(-2px); }
}
.event-card { cursor: pointer; }
.event-card:active { transform: scale(0.995); }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.card-title { font-size: 1.02rem; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.card-meta { font-size: 0.79rem; color: var(--muted-2); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dot { width: 3px; height: 3px; border-radius: 99px; background: var(--muted-2); display: inline-block; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-wrap: wrap;
}
.card-foot-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.card-foot-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

/* ============================ filters ============================ */
.filters { padding: 14px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }

.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted-2);
  pointer-events: none;
}
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(4, 15, 28, 0.55);
  border: 1px solid rgba(34, 211, 238, 0.16);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.16s ease, background 0.16s ease;
  appearance: none;
}
.search-wrap .input { padding-inline-start: 42px; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(4, 15, 28, 0.8);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px;
  padding-inline-end: 14px;
  padding-inline-start: 36px;
}
.select option { background: #0A1A2F; color: var(--text); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: all 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: rgba(34, 211, 238, 0.28); }
.chip:active { transform: scale(0.97); }
.chip.is-active {
  color: #04121F;
  background: linear-gradient(140deg, #67E8F9, #22D3EE);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.24);
}
.chip-on {
  color: #CFFAFE;
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.4);
}
.chip-sm { min-height: 32px; padding: 0 11px; font-size: 0.76rem; }

.results-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted-2); }

/* ============================ empty / skeleton ============================ */
.empty {
  padding: 34px 20px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed rgba(34, 211, 238, 0.24);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: var(--teal);
}
.empty-icon svg { width: 26px; height: 26px; }
.empty h3 { font-size: 1rem; font-weight: 700; }
.empty p { font-size: 0.85rem; color: var(--muted); max-width: 44ch; line-height: 1.7; }

.boot-skeleton { padding: 20px 0; }
.sk-line { height: 14px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); margin-bottom: 12px; animation: pulse 1.6s ease-in-out infinite; }
.sk-lg { height: 34px; width: 60%; }
.sk-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-top: 20px; }
.sk-card { height: 148px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.05); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ============================ event detail ============================ */
.detail-head { padding: 20px; border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 14px; }
.back-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 12px 8px 8px;
  border-radius: 12px;
  min-height: 40px;
}
.back-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.back-btn svg { width: 18px; height: 18px; }

.detail-title { font-size: clamp(1.3rem, 5vw, 1.9rem); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.83rem; color: var(--muted); }

.match-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.18);
  flex-wrap: wrap;
}
.match-reasons { flex: 1 1 200px; min-width: 0; }
.match-reasons ul { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.match-reasons li { font-size: 0.82rem; color: #CBD5E1; line-height: 1.6; display: flex; gap: 7px; }
.match-reasons li::before { content: "—"; color: var(--teal); flex: 0 0 auto; }

.action-row { display: flex; flex-wrap: wrap; gap: 8px; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kv { padding: 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); min-width: 0; }
.kv-k { font-size: 0.7rem; color: var(--muted-2); margin-bottom: 4px; }
.kv-v { font-size: 0.9rem; font-weight: 600; line-height: 1.5; word-break: break-word; }

.panel { padding: 18px; border-radius: var(--radius); }
.panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.prose { font-size: 0.9rem; line-height: 1.85; color: #CBD5E1; white-space: pre-wrap; word-break: break-word; }

.tabbar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 5px;
  border-radius: var(--radius-sm);
  background: rgba(4, 15, 28, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.18s ease;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: rgba(34, 211, 238, 0.15); color: #CFFAFE; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.25); }

/* ============================ chat ============================ */
.chat-wrap { display: flex; flex-direction: column; gap: 12px; }
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52vh, 460px);
  min-height: 180px;
  overflow-y: auto;
  padding: 4px;
}
.msg { display: flex; gap: 9px; align-items: flex-start; }
.msg-mine { flex-direction: row-reverse; }
.msg-body {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 8px 12px;
  max-width: min(78%, 460px);
  min-width: 0;
}
.msg-mine .msg-body { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.24); }
.msg-name { font-size: 0.72rem; font-weight: 700; color: #A5F3FC; margin-bottom: 2px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.msg-time { font-size: 0.66rem; color: var(--muted-2); font-weight: 400; }
.msg-text { font-size: 0.86rem; line-height: 1.7; word-break: break-word; white-space: pre-wrap; }

.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer .input { flex: 1 1 auto; }
.send-btn {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #67E8F9, #22D3EE);
  color: #04121F;
  flex: 0 0 auto;
  box-shadow: 0 6px 22px rgba(34, 211, 238, 0.25);
}
.send-btn svg { width: 20px; height: 20px; transform: scaleX(-1); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: 0.45; }

.locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 26px 18px;
  border-radius: var(--radius);
  border: 1px dashed rgba(34, 211, 238, 0.24);
  background: rgba(255, 255, 255, 0.03);
}
.locked-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.2); color: var(--teal); }
.locked-icon svg { width: 22px; height: 22px; }

.person-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  min-width: 0;
}
.person-card.complement { border-color: rgba(34, 211, 238, 0.3); background: rgba(34, 211, 238, 0.07); }
.person-info { min-width: 0; flex: 1 1 auto; }
.person-name { font-size: 0.86rem; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.person-role { font-size: 0.75rem; color: var(--muted); line-height: 1.6; }
.mini-tag { font-size: 0.66rem; padding: 2px 7px; border-radius: 7px; background: rgba(34, 211, 238, 0.14); color: #A5F3FC; border: 1px solid rgba(34, 211, 238, 0.24); }

/* ============================ forms / profile ============================ */
.form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 0.79rem; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 0.72rem; color: var(--muted-2); line-height: 1.5; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }

.avatar-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar-lg { width: 74px; height: 74px; font-size: 1.9rem; border-radius: 24px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 34px; height: 34px;
  border-radius: 11px;
  border: 2px solid transparent;
  display: grid; place-items: center;
  color: #04121F;
  font-weight: 700;
  font-size: 0.8rem;
}
.swatch.is-on { border-color: #F8FAFC; box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.28); }

/* ============================ overlay / sheet ============================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 10, 20, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet-card {
  width: min(520px, 100%);
  max-height: min(88vh, 900px);
  overflow-y: auto;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(175deg, rgba(20, 42, 68, 0.96), rgba(8, 22, 40, 0.98));
  border: 1px solid rgba(34, 211, 238, 0.24);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  animation: popIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--text);
}
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sheet-head h2 { font-size: 1.14rem; font-weight: 700; line-height: 1.5; }
.sheet-sub { font-size: 0.85rem; color: var(--muted); line-height: 1.7; margin-bottom: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }

/* ============================ toast ============================ */
.toast {
  position: fixed;
  z-index: 300;
  inset-inline: 16px;
  bottom: 84px;
  margin-inline: auto;
  width: fit-content;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(14, 36, 64, 0.97);
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  text-align: center;
}
.toast.is-on { opacity: 1; transform: none; }
@media (min-width: 1024px) { .toast { bottom: 28px; } }

/* ============================ misc ============================ */
.divider { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 16px 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.member-row + .member-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }

.suggest-card {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.22);
}
.ai-out {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(4, 15, 28, 0.55);
  border: 1px solid rgba(34, 211, 238, 0.18);
  font-size: 0.9rem;
  line-height: 1.9;
  color: #E2E8F0;
  white-space: pre-wrap;
  word-break: break-word;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.24);
  color: #FDE68A;
  font-size: 0.82rem;
  line-height: 1.7;
}
.notice svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.notice-bad { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.3); color: #FECDD3; }
.notice-ok { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.28); color: #A7F3D0; }

/* ============================ notifications ============================ */
.bell-btn { position: relative; }
.bell-badge {
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--teal);
  color: #04121F;
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  border: 2px solid #071426;
}
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  text-align: start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.notif-item:hover { border-color: var(--teal-line-strong); background: rgba(34, 211, 238, 0.07); }
.notif-item.is-new { border-color: rgba(34, 211, 238, 0.34); background: rgba(34, 211, 238, 0.09); }
.notif-ico {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex: 0 0 auto;
  background: rgba(34, 211, 238, 0.12);
  color: var(--teal);
  border: 1px solid rgba(34, 211, 238, 0.2);
}
.notif-ico svg { width: 17px; height: 17px; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-size: 0.86rem; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.notif-text { font-size: 0.79rem; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.notif-time { font-size: 0.68rem; color: var(--muted-2); }

/* ============================ Q&A / discussions ============================ */
.qa-list { display: flex; flex-direction: column; gap: 10px; }
.qa-item {
  padding: 13px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  min-width: 0;
}
.qa-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.qa-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.qa-text { font-size: 0.9rem; line-height: 1.8; overflow-wrap: anywhere; }
.qa-actions { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.qa-like, .qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.qa-like svg, .qa-btn svg { width: 15px; height: 15px; }
.qa-like:hover, .qa-btn:hover { color: var(--text); border-color: rgba(34, 211, 238, 0.3); }
.qa-like.is-on { color: #FDA4AF; border-color: rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.12); }
.qa-like.is-on svg { fill: currentColor; }
.qa-answers {
  margin-top: 10px;
  padding-inline-start: 12px;
  border-inline-start: 2px solid rgba(34, 211, 238, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qa-answer { padding: 10px; border-radius: 12px; background: rgba(4, 15, 28, 0.45); border: 1px solid rgba(255, 255, 255, 0.06); }
.qa-answer-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.qa-time { font-size: 0.68rem; color: var(--muted-2); }
.qa-answer-text { font-size: 0.85rem; line-height: 1.75; margin-top: 6px; overflow-wrap: anywhere; }
.qa-actions-sm { margin-top: 8px; }
.qa-form, .qa-new { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.tag-past { background: rgba(251, 191, 36, 0.14); color: #FCD34D; border-color: rgba(251, 191, 36, 0.28); }
.tag-hidden { background: rgba(251, 113, 133, 0.16); color: #FECDD3; border-color: rgba(251, 113, 133, 0.3); }
.faq-list { display: flex; flex-direction: column; gap: 6px; }
.faq-item {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 12px;
}
.faq-item summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.6;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--teal); font-weight: 700; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin-top: 8px; line-height: 1.8; }

/* ============================ admin ============================ */
.admin-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.stat-card { padding: 14px; border-radius: var(--radius-sm); }
.stat-card .stat-num { font-size: 1.45rem; font-weight: 700; color: #E0FBFF; line-height: 1.2; }
.stat-card .stat-label { font-size: 0.72rem; color: var(--muted-2); margin-top: 2px; line-height: 1.4; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-row:first-of-type { border-top: 0; }
.admin-row.is-muted { opacity: 0.55; }

/* ============================ small screens ============================ */
@media (max-width: 430px) {
  .topbar { padding: 10px 12px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .brand-text small { display: none; }
  .user-chip { max-width: 38vw; padding: 4px 10px 4px 5px; }
  .user-chip span { max-width: 74px; }
  .tab { padding: 0 13px; font-size: 0.81rem; }
  .stats-row { gap: 6px; }
  .stat-label { font-size: 0.66rem; }
  .section-title { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================ demo enrichments ============================ */
.interest-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
}
.interest-num { font-size: 1.6rem; font-weight: 700; color: #E0FBFF; line-height: 1.15; }
.interest-label { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }

.team-progress {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.team-progress span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #0E9CB8, #22D3EE);
  transition: width 0.4s ease;
}

.person-goal { font-size: 0.74rem; color: #A5F3FC; line-height: 1.65; margin-top: 4px; }

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 18px auto 0;
  padding: 22px 16px 116px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.site-footer p {
  font-size: 0.76rem;
  color: var(--muted-2);
  line-height: 1.9;
  max-width: 62ch;
  margin-inline: auto;
}

.footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 64ch;
  margin-inline: auto;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--teal);
  opacity: 0.7;
  flex: 0 0 auto;
}
.footer-note p { font-size: 0.73rem; line-height: 1.8; color: var(--muted-2); }

.footer-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 600;
  color: #CFFAFE;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.footer-share svg { width: 16px; height: 16px; flex: 0 0 auto; }
.footer-share:hover { background: rgba(34, 211, 238, 0.14); border-color: rgba(34, 211, 238, 0.36); }
.footer-share:active { transform: scale(0.97); }

@media (max-width: 430px) {
  .footer-note { border-radius: 16px; align-items: flex-start; padding: 12px 14px; }
  .footer-dot { margin-top: 7px; }
}
@media (min-width: 1024px) { .site-footer { padding-bottom: 40px; } }

@media print {
  .topbar, .bottomnav, .sidebar, .bg-glow, .toast, .overlay, .site-footer { display: none !important; }
  body { background: #fff; color: #111; }
  .glass, .card { box-shadow: none; border: 1px solid #ddd; background: #fff; color: #111; }
}