:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: #f4f6fb;
  color: #1f2933;
  --community-accent: #2563eb;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #fdfbff 0%, #eef2ff 100%);
}

body.call-active {
  overflow: hidden;
}

header {
  padding: 1.5rem;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: #f8fafc;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.header-intro {
  display: grid;
  gap: 0.35rem;
  max-width: 640px;
}

.header-intro h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  letter-spacing: 0.04em;
}

.header-intro p {
  margin: 0;
  font-size: 1.05rem;
  opacity: 0.9;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

main {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  grid-auto-flow: dense;
  gap: 1.5rem;
  padding: 1.5rem;
}

@media (min-width: 1024px) {
  main {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
  }
}

section {
  background: #ffffffee;
  backdrop-filter: blur(12px);
  border-radius: 1.25rem;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  padding: 1.25rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-margin-top: 96px;
}

.community-only {
  display: none;
}

body.community-selected .community-only {
  display: flex;
}

body.commons-active .community-only {
  display: none;
}

body.commons-active #chat-section {
  display: flex;
}

.landing-only {
  grid-column: 1 / -1;
}

body.community-selected .landing-only {
  display: none;
}

.community-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.community-tabs[hidden] {
  display: none;
}

.community-tab {
  border: none;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  padding: 0.45rem 0.95rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.community-tab:hover {
  background: rgba(37, 99, 235, 0.18);
}

.community-tab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.community-tab.active {
  background: #1d4ed8;
  color: #f8fafc;
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.35);
}

#community-preface {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  background: linear-gradient(140deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.08));
  padding: 1.75rem 1.8rem 2.1rem;
  position: relative;
  overflow: hidden;
}

#community-preface::after {
  content: "";
  position: absolute;
  inset: -40% 40% auto -20%;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
  pointer-events: none;
}

#community-preface .preface-hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
  max-width: 720px;
  grid-column: 1 / -1;
}

#community-preface .preface-hero h2 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  color: #111827;
  margin: 0;
}

#community-preface .preface-hero p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #1f2937;
  opacity: 0.9;
}

.core-room {
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  border-radius: 1.2rem;
  padding: 1.3rem 1.5rem 1.5rem;
  display: grid;
  gap: 0.75rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  max-width: 560px;
}

.core-room h3 {
  margin: 0;
  font-size: 1.35rem;
}

.core-room p {
  margin: 0;
  line-height: 1.6;
  opacity: 0.95;
}

.core-room ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.98rem;
}

.core-room button {
  justify-self: flex-start;
}

.landing-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.landing-heading {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.community-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.community-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1.2rem;
  padding: 1.1rem 1.25rem 1.35rem;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
  box-shadow: 0 18px 35px color-mix(in srgb, var(--community-accent) 16%, rgba(15, 23, 42, 0.18));
  display: grid;
  gap: 0.65rem;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border: 1px solid color-mix(in srgb, var(--community-accent) 25%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.18);
}

.community-card h3 {
  margin: 0;
  color: #111827;
  font-size: 1.2rem;
}

.community-card .community-tagline {
  margin: 0;
  font-weight: 600;
  color: var(--card-accent, #2563eb);
}

.community-card button {
  justify-self: flex-start;
  border: none;
  border-radius: 0.8rem;
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--card-accent, #2563eb), rgba(37, 99, 235, 0.8));
  background: linear-gradient(
    135deg,
    var(--card-accent, #2563eb),
    color-mix(in srgb, var(--card-accent, #2563eb) 70%, #0f172a)
  );
  color: #f8fafc;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--card-accent, #2563eb) 35%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.community-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.35);
}

.example-preview {
  margin-top: 2.25rem;
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.15);
  display: grid;
  gap: 1.25rem;
}

.example-heading h3 {
  margin: 0;
  font-size: 1.35rem;
  color: #111827;
}

.example-heading p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: #334155;
  opacity: 0.85;
}

.example-card {
  background: #fff;
  border-radius: 1.1rem;
  padding: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1.05rem;
}

.example-card h4 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.example-card .community-tagline {
  margin: 0;
  font-weight: 600;
  color: var(--card-accent, #16a34a);
}

.example-card p {
  margin: 0;
  color: #1f2937;
  line-height: 1.55;
}

.preview-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.preview-section {
  background: rgba(37, 99, 235, 0.06);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(37, 99, 235, 0.14);
  display: grid;
  gap: 0.65rem;
}

.preview-section h5 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.75);
}

.preview-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.preview-section li {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0.85rem;
  padding: 0.7rem 0.85rem;
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(59, 130, 246, 0.12);
}

.preview-section strong {
  font-size: 0.95rem;
  color: #0f172a;
}

.preview-section small {
  font-size: 0.8rem;
  color: #3b82f6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-section p {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
}

.example-preview {
  margin-top: 2.25rem;
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.15);
  display: grid;
  gap: 1.25rem;
}

.example-heading h3 {
  margin: 0;
  font-size: 1.35rem;
  color: #111827;
}

.example-heading p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: #334155;
  opacity: 0.85;
}

.example-card {
  background: #fff;
  border-radius: 1.1rem;
  padding: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1.05rem;
}

.example-card h4 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.example-card .community-tagline {
  margin: 0;
  font-weight: 600;
  color: var(--card-accent, #16a34a);
}

.example-card p {
  margin: 0;
  color: #1f2937;
  line-height: 1.55;
}

.preview-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.preview-section {
  background: rgba(37, 99, 235, 0.06);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(37, 99, 235, 0.14);
  display: grid;
  gap: 0.65rem;
}

.preview-section h5 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.75);
}

.preview-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.preview-section li {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0.85rem;
  padding: 0.7rem 0.85rem;
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(59, 130, 246, 0.12);
}

.preview-section strong {
  font-size: 0.95rem;
  color: #0f172a;
}

.preview-section small {
  font-size: 0.8rem;
  color: #3b82f6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-section p {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
}

.community-detail {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.25rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.14);
  box-shadow: 0 22px 45px color-mix(in srgb, var(--community-accent) 18%, rgba(15, 23, 42, 0.12));
  padding: 1.35rem 1.5rem 1.6rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border: 1px solid color-mix(in srgb, var(--community-accent) 28%, transparent);
}

.example-preview {
  margin-top: 2.25rem;
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.15);
  display: grid;
  gap: 1.25rem;
}

.example-heading h3 {
  margin: 0;
  font-size: 1.35rem;
  color: #111827;
}

.example-heading p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: #334155;
  opacity: 0.85;
}

.example-card {
  background: #fff;
  border-radius: 1.1rem;
  padding: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1.05rem;
}

.example-card h4 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.example-card .community-tagline {
  margin: 0;
  font-weight: 600;
  color: var(--card-accent, #16a34a);
}

.example-card p {
  margin: 0;
  color: #1f2937;
  line-height: 1.55;
}

.preview-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.preview-section {
  background: rgba(37, 99, 235, 0.06);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(37, 99, 235, 0.14);
  display: grid;
  gap: 0.65rem;
}

.preview-section h5 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.75);
}

.preview-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.preview-section li {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0.85rem;
  padding: 0.7rem 0.85rem;
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(59, 130, 246, 0.12);
}

.preview-section strong {
  font-size: 0.95rem;
  color: #0f172a;
}

.preview-section small {
  font-size: 0.8rem;
  color: #3b82f6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-section p {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
}

.community-detail {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.25rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.14);
  box-shadow: 0 22px 45px color-mix(in srgb, var(--community-accent) 18%, rgba(15, 23, 42, 0.12));
  padding: 1.35rem 1.5rem 1.6rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border: 1px solid color-mix(in srgb, var(--community-accent) 28%, transparent);
}

.community-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.community-detail-meta {
  display: grid;
  gap: 0.35rem;
}

.community-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  background: color-mix(in srgb, var(--community-accent) 22%, transparent);
  color: var(--community-accent);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.community-detail h3 {
  font-size: 1.55rem;
  margin: 0;
  color: #0f172a;
}

.feature-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.feature-card {
  border-radius: 1rem;
  padding: 1rem 1.1rem 1.2rem;
  background: rgba(37, 99, 235, 0.05);
  background: color-mix(in srgb, var(--community-accent) 12%, #ffffff);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border: 1px solid color-mix(in srgb, var(--community-accent) 22%, transparent);
  display: grid;
  gap: 0.55rem;
}

.feature-card h4 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.feature-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #1f2937;
}

.feature-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--community-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.feature-link::after {
  content: '→';
  font-size: 0.9rem;
}

body.community-selected #community-preface {
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--community-accent) 18%, rgba(15, 118, 110, 0.12)),
    color-mix(in srgb, var(--community-accent) 8%, rgba(14, 165, 233, 0.12))
  );
}

section h2 {
  margin: 0;
  font-size: 1.3rem;
  color: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: #0b1120;
  border-radius: 0.95rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
}

section h2 .heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

section h2 .heading-actions .secondary {
  background: rgba(248, 250, 252, 0.18);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
}

section h2 .heading-actions .secondary:hover {
  background: rgba(248, 250, 252, 0.28);
}

section h2 .heading-actions .pill {
  background: rgba(248, 250, 252, 0.24);
  color: #f8fafc;
}

section h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #1d1e5f;
}

.section-intro {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1.6;
}

.section-intro a {
  color: var(--community-accent);
  font-weight: 600;
  text-decoration: none;
}

.section-intro a:hover,
.section-intro a:focus {
  text-decoration: underline;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  border-radius: 0.75rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #f8fafc;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.35);
}

.button-link.secondary {
  background: rgba(15, 23, 42, 0.08);
  color: #1f2937;
  box-shadow: none;
}

.button-link.secondary:hover {
  box-shadow: 0 8px 16px rgba(148, 163, 184, 0.25);
}

.empty-note {
  font-size: 0.9rem;
  opacity: 0.75;
}

.call-card {
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.call-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  justify-content: space-between;
}

.call-card-identity {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.call-card-header strong {
  font-size: 1.05rem;
}

.call-card-username {
  font-size: 0.85rem;
  opacity: 0.75;
}

.call-card-meta {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.call-card-url {
  margin: 0;
  font-size: 0.9rem;
}

.call-card-url code {
  font-family: 'Fira Code', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  background: rgba(79, 70, 229, 0.08);
  padding: 0.2rem 0.4rem;
  border-radius: 0.4rem;
}

.call-card-note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.call-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.call-card-actions .secondary {
  background: rgba(148, 163, 184, 0.2);
}

.call-card-actions .secondary:hover {
  transform: translateY(-1px);
}

.call-card-participants {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding-top: 0.6rem;
}

.call-card-participants.stack {
  gap: 0.4rem;
}

.call-card-participants strong {
  font-size: 0.95rem;
}

.call-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.call-card-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.call-card-name {
  font-weight: 600;
}

.call-card-status {
  margin-left: auto;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  background: rgba(148, 163, 184, 0.25);
  color: #1f2937;
}

.call-card-status.status-accepted {
  background: rgba(34, 197, 94, 0.22);
  color: #166534;
}

.call-card-status.status-joined {
  background: rgba(59, 130, 246, 0.22);
  color: #1d4ed8;
}

.call-card-status.status-declined,
.call-card-status.status-cancelled {
  background: rgba(248, 113, 113, 0.25);
  color: #991b1b;
}

.call-card-status.status-pending {
  background: rgba(250, 204, 21, 0.25);
  color: #92400e;
}

.headline {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  background: rgba(79, 70, 229, 0.12);
  color: #312e81;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2a4a;
}

input,
select,
textarea {
  border-radius: 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  background: rgba(248, 250, 252, 0.9);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(14, 165, 233, 0.8);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

button {
  border-radius: 0.75rem;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #f8fafc;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.secondary {
  background: rgba(15, 23, 42, 0.08);
  color: #1f2937;
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

button.danger.large {
  font-size: 1.05rem;
  padding: 0.85rem 1.6rem;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.35);
}

button.secondary:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calendar-card {
  border-top: 1px solid rgba(79, 70, 229, 0.16);
  padding-top: 1rem;
}

.calendar-card h3 {
  font-weight: 600;
}

details {
  border-radius: 1rem;
  border: 1px solid rgba(79, 70, 229, 0.2);
  padding: 0.75rem 1rem 1rem;
  background: rgba(255, 255, 255, 0.9);
}

details > summary {
  cursor: pointer;
  font-weight: 600;
  margin: -0.25rem 0 0.5rem;
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 0.2s ease;
}

.exchange-card {
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exchange-card .detail-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #4338ca;
}

.exchange-card .detail-value {
  font-size: 0.95rem;
  white-space: pre-wrap;
}

details[open] > summary::before {
  transform: rotate(90deg);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 1rem;
  min-height: 420px;
  height: clamp(420px, 60vh, 760px);
}

.chat-layout.single-column {
  grid-template-columns: 1fr;
  height: clamp(360px, 60vh, 680px);
}

.chat-ai-tip {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-ai-tip.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
}

.chat-ai-tip code {
  background: rgba(15, 23, 42, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 0.45rem;
  font-weight: 600;
}

.chat-list {
  background: rgba(79, 70, 229, 0.08);
  border-radius: 1rem;
  padding: 0.75rem;
  overflow-y: auto;
  max-height: 100%;
  height: 100%;
}

.chat-item {
  border-radius: 0.9rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: background 0.15s ease;
}

.chat-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-item:hover,
.chat-item.active {
  background: rgba(99, 102, 241, 0.24);
}

.chat-item small {
  font-size: 0.8rem;
  opacity: 0.75;
}

.chat-window {
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
}

.heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#chat-section {
  grid-column: 1 / -1;
  order: -1;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  background: rgba(79, 70, 229, 0.12);
  display: grid;
  gap: 0.35rem;
}

.message .meta {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4338ca;
}

.message .body {
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-ai {
  background: rgba(14, 116, 144, 0.18);
  border: 1px solid rgba(14, 116, 144, 0.28);
}

.message-ai .meta {
  color: #0f766e;
}

.message-ai-request {
  border: 1px dashed rgba(79, 70, 229, 0.35);
}

.ai-flag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.12);
  color: #1e40af;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.message-ai .ai-flag {
  background: rgba(13, 148, 136, 0.2);
  color: #0f766e;
}

.attachment-card {
  margin-top: 0.5rem;
  border-radius: 0.85rem;
  overflow: hidden;
  background: rgba(14, 165, 233, 0.12);
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.attachment-card a {
  display: block;
  height: 100%;
}

.attachment-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-meta {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.attachment-meta small {
  font-size: 0.8rem;
  opacity: 0.7;
}

.message form {
  display: flex;
  gap: 0.5rem;
}

.chat-form {
  padding: 0.85rem;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-input-row input {
  flex: 1;
}

.attachment-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(79, 70, 229, 0.1);
}

.preview-card img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 0.6rem;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
}

.preview-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.error {
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 600;
}

ul.inline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

ul.inline li {
  background: rgba(15, 118, 110, 0.08);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.8rem;
}

.membership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.membership-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.15);
}

.membership-card h3 {
  margin-bottom: 0.25rem;
}

.membership-card h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #3730a3;
}

.host-claim-notice {
  border: 1px solid rgba(250, 204, 21, 0.55);
  background: rgba(253, 230, 138, 0.4);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.host-claim-notice strong {
  color: #92400e;
}

.verification-code {
  display: inline-block;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 118, 110, 0.15);
  letter-spacing: 0.2em;
  font-weight: 700;
}

.invite-card,
.host-claim-card {
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 0.9rem;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
}

.host-claim-card--self {
  border-color: rgba(250, 204, 21, 0.7);
  background: rgba(253, 230, 138, 0.4);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
}

.host-claim-card--self strong,
.host-claim-card--self small {
  color: #92400e;
}

.host-claim-self-hint {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.invite-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.launch-module {
  border: 1px dashed rgba(79, 70, 229, 0.4);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  background: rgba(79, 70, 229, 0.08);
}

.admin-card {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.9);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

.admin-hint {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.admin-card summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.admin-card summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 0.2s ease;
}

.admin-card[open] summary::before {
  transform: rotate(90deg);
}

.admin-card-body {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.member-directory {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding-top: 0.75rem;
  gap: 0.85rem;
}

.member-directory-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.member-directory-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.member-directory-meta {
  font-size: 0.85rem;
  opacity: 0.7;
}

.member-directory-note {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.75;
}

.member-directory-error {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #b91c1c;
}

.member-directory-list {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.member-card {
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.85rem 1rem;
  gap: 0.6rem;
}

.member-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.member-card-identity {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.member-card-username {
  font-size: 0.85rem;
  opacity: 0.7;
}

.member-card-status {
  background: rgba(148, 163, 184, 0.25);
  color: #1f2937;
}

.member-card-status.status-verified {
  background: rgba(34, 197, 94, 0.22);
  color: #166534;
}

.member-card-status.status-pending {
  background: rgba(250, 204, 21, 0.25);
  color: #92400e;
}

.member-card-meta {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.member-card-code {
  font-size: 0.85rem;
}

.member-card-code code {
  background: rgba(37, 99, 235, 0.12);
  padding: 0.2rem 0.45rem;
  border-radius: 0.45rem;
  font-weight: 600;
}

.member-card-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.member-card-role {
  background: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
}

.member-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.member-card-actions button {
  flex: 0 1 auto;
}

.ai-toggle input {
  width: 44px;
  height: 24px;
}

.ai-preview-output {
  white-space: pre-wrap;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 0.75rem;
  padding: 0.75rem;
  min-height: 3rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.admin-chat-card,
.admin-subchat-card {
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.95);
}

.admin-subchat-card .pill {
  margin-top: 0.25rem;
}

.host-claim-card .pill {
  align-self: flex-start;
}

#admin-section {
  transition: box-shadow 0.2s ease;
}

#admin-section.expanded {
  grid-column: 1 / -1;
}

#admin-section.expanded #admin-panel {
  max-height: none;
}

@media (max-width: 640px) {
  .membership-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-card-body {
    margin-top: 0.5rem;
  }

  .admin-chat-card,
  .admin-subchat-card {
    padding: 0.65rem 0.75rem;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
}

table td,
table th {
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.5rem 0.25rem;
  text-align: left;
  font-size: 0.9rem;
}

pre {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  white-space: pre-wrap;
  margin: 0;
  font-size: 0.9rem;
}

footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #475569;
}

.call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 40;
}

.call-overlay[hidden] {
  display: none;
}

.call-dialog {
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  width: min(960px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 1.5rem;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.call-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.35), rgba(14, 165, 233, 0.2));
}

.call-dialog-titles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.call-dialog-titles strong {
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.call-dialog-titles span {
  font-size: 0.85rem;
  opacity: 0.8;
}

.call-stage {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), rgba(15, 23, 42, 0.65));
}

.call-tiles {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.call-tile {
  position: relative;
  border-radius: 1.15rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.6);
  min-height: 180px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0f172a;
}

.call-tile-label {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.call-tile-local {
  border: 2px solid rgba(129, 140, 248, 0.6);
}

.call-status {
  min-height: 1.1rem;
  font-size: 0.85rem;
  opacity: 0.8;
  padding: 0 0.25rem;
}

.call-status[data-tone='error'] {
  color: #fecaca;
}

.call-status[data-tone='info'] {
  color: #bae6fd;
}

.call-status[data-tone='success'] {
  color: #bbf7d0;
}

.call-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem 1.5rem;
  background: rgba(15, 23, 42, 0.65);
}

.call-controls .danger {
  background: rgba(248, 113, 113, 0.25);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.call-controls .danger:hover {
  background: rgba(239, 68, 68, 0.35);
}

@media (max-width: 720px) {
  .call-dialog {
    border-radius: 1rem;
  }

  .call-stage {
    padding: 1.25rem;
  }

  .call-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 960px) {
  main {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    height: clamp(360px, 65vh, 640px);
  }

  #chat-section.expanded .chat-layout {
    grid-template-columns: 1fr;
    height: clamp(420px, 75vh, 720px);
  }
}

@media (max-width: 640px) {
  header {
    padding: 1.25rem 1rem;
  }

  main {
    padding: 1.25rem 1rem;
  }

  section {
    padding: 1.1rem 1.1rem 1.4rem;
  }

  .chat-layout,
  .chat-layout.single-column,
  #chat-section.expanded .chat-layout {
    height: min(70vh, 560px);
  }

  .chat-form {
    flex-wrap: wrap;
  }

  .chat-form button {
    width: 100%;
  }

  .attachment-card {
    grid-template-columns: 1fr;
  }
}
