:root {
  color-scheme: light;
  --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #f5f4fb;
  --bg-accent-1: rgba(138, 43, 226, 0.16);
  --bg-accent-2: rgba(88, 64, 163, 0.14);
  --text: #141325;
  --muted: #5e6274;
  --card: rgba(255, 255, 255, 0.95);
  --panel: rgba(250, 249, 255, 0.92);
  --border: rgba(20, 22, 34, 0.12);
  --accent: #8a2be2;
  --accent-strong: #a066ff;
  --accent-contrast: #05060d;
  --line: rgba(20, 22, 34, 0.16);
  --shadow-card: 0 20px 50px rgba(39, 32, 79, 0.14);
  --shadow-elevated: 0 12px 30px rgba(51, 42, 97, 0.18);
  --nav-width: min(80vw, 1200px);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #05060b;
  --bg-accent-1: rgba(138, 43, 226, 0.4);
  --bg-accent-2: rgba(69, 0, 132, 0.32);
  --text: #e6e9ef;
  --muted: #9aa4b2;
  --card: rgba(14, 16, 30, 0.9);
  --panel: rgba(12, 14, 24, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --shadow-card: 0 28px 70px rgba(2, 3, 10, 0.75);
  --shadow-elevated: 0 14px 32px rgba(0, 0, 0, 0.6);
}

body.theme-discord {
  --accent: #5865f2;
  --accent-strong: #7c8cfa;
  --accent-contrast: #0e1028;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 500 16px/1.55 var(--font-family, 'Inter');
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

a:focus-visible {
  outline: 2px solid rgba(110, 243, 255, 0.68);
  outline-offset: 3px;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background:
    radial-gradient(1200px 700px at 8% -15%, rgba(255, 255, 255, 0.85), transparent 65%),
    radial-gradient(1000px 600px at 105% 5%, rgba(160, 102, 255, 0.2), transparent 60%),
    radial-gradient(1000px 600px at -5% 30%, rgba(138, 43, 226, 0.12), transparent 65%);
  opacity: 0.8;
}

body::after {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(245, 244, 255, 0.9));
}

html[data-theme='dark'] body::before {
  background:
    radial-gradient(1200px 700px at 15% -10%, var(--bg-accent-1), transparent 65%),
    radial-gradient(1000px 600px at 110% 10%, var(--bg-accent-2), transparent 60%);
  opacity: 0.9;
}

html[data-theme='dark'] body::after {
  background: linear-gradient(140deg, rgba(6, 7, 18, 0.88), rgba(3, 5, 14, 0.95));
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.12);
  z-index: 40;
  overflow: hidden;
}

html[data-theme='dark'] .topbar {
  background: rgba(0, 0, 0, 0.4);
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: nova-shimmer 2.4s ease-in-out infinite;
}

@keyframes nova-shimmer {
  0% { transform: translateX(-30%); }
  50% { transform: translateX(40%); }
  100% { transform: translateX(110%); }
}

.nav-wrap {
  position: sticky;
  top: 0;
  padding: clamp(12px, 2vw, 20px);
  z-index: 30;
}

.nav-container {
  width: var(--nav-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 24px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(14px);
}

html[data-theme='dark'] .navbar {
  border: 1px solid rgba(27, 33, 51, 0.85);
  background: linear-gradient(180deg, rgba(18, 22, 37, 0.95), rgba(11, 16, 26, 0.86));
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-logo img {
  height: clamp(42px, 5vw, 50px);
  filter: drop-shadow(0 10px 30px rgba(138, 43, 226, 0.45));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 10px 24px rgba(15, 18, 35, 0.12);
}

html[data-theme='dark'] .nav-link {
  border: 1px solid rgba(31, 38, 56, 0.85);
  background: rgba(18, 25, 42, 0.92);
  color: #dfe7f3;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.nav-link[aria-current='page'] {
  border-color: rgba(138, 43, 226, 0.5);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(226, 212, 255, 0.9));
  box-shadow: 0 16px 34px rgba(31, 33, 70, 0.2);
}

body.theme-discord .nav-link[aria-current='page'] {
  border-color: rgba(88, 101, 242, 0.85);
  background: linear-gradient(135deg, rgba(52, 60, 120, 0.92), rgba(88, 101, 242, 0.75));
}

html[data-theme='dark'] .nav-link[aria-current='page'] {
  border-color: rgba(138, 43, 226, 0.8);
  background: linear-gradient(135deg, rgba(26, 12, 32, 0.95), rgba(69, 0, 132, 0.75));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55);
}

.nav-link:hover,
.nav-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(138, 43, 226, 0.6);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.6);
  outline: none;
}

body.theme-discord .nav-link:hover,
body.theme-discord .nav-link:focus-visible {
  border-color: rgba(88, 101, 242, 0.6);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 32px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  cursor: pointer;
  padding: 4px;
}

html[data-theme='dark'] .nav-toggle {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 25, 42, 0.92);
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 3px 0;
  background: var(--text);
  border-radius: 2px;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 12px 24px rgba(22, 18, 40, 0.18);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:focus-visible,
.theme-toggle:hover {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(138, 43, 226, 0.55);
  box-shadow: 0 16px 36px rgba(33, 20, 70, 0.25);
}

.theme-toggle__icon {
  position: relative;
  width: 20px;
  height: 20px;
}

.theme-toggle__icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.theme-toggle__icon svg[data-icon='sun'] {
  opacity: 1;
}

html[data-theme='dark'] .theme-toggle {
  background: rgba(18, 25, 42, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3e9ff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] .theme-toggle__icon svg[data-icon='sun'] {
  opacity: 0;
}

html[data-theme='dark'] .theme-toggle__icon svg[data-icon='moon'] {
  opacity: 1;
}

.container {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 28px);
}

.hero {
  position: relative;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(26, 12, 32, 0.9), rgba(9, 12, 20, 0.92));
  border: 1px solid rgba(83, 46, 120, 0.35);
  box-shadow: 0 28px 60px rgba(5, 9, 20, 0.55);
  overflow: hidden;
}

.card {
  background: var(--card);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from var(--rot, 0turn), transparent 0 65%, rgba(160, 102, 255, 0.25) 65% 70%, transparent 70% 100%);
  animation: nova-orbit 12s linear infinite;
  opacity: 0.95;
  pointer-events: none;
}

@keyframes nova-orbit { to { --rot: 1turn; } }

.card > * {
  position: relative;
  z-index: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 30px rgba(42, 28, 82, 0.12);
}

.btn-primary,
.btn.primary {
  border-color: rgba(138, 43, 226, 0.35);
  background: linear-gradient(135deg, #ffffff, #efe7ff);
}

.btn-secondary,
.btn.secondary {
  border-color: rgba(160, 102, 255, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(232, 227, 255, 0.95));
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(42, 28, 82, 0.2);
  outline: none;
}

html[data-theme='dark'] .btn {
  border: 1px solid #1f2638;
  background: #12192a;
  color: #dfe7f3;
  box-shadow: var(--shadow-elevated);
}

html[data-theme='dark'] .btn-primary,
html[data-theme='dark'] .btn.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, #361049, #220733);
}

html[data-theme='dark'] .btn-secondary,
html[data-theme='dark'] .btn.secondary {
  border-color: var(--accent-strong);
  background: linear-gradient(135deg, rgba(31, 26, 42, 0.95), rgba(40, 18, 53, 0.95));
}

html[data-theme='dark'] .btn:hover,
html[data-theme='dark'] .btn:focus-visible {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}

.nav-links .btn,
.nav-signout {
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-contrast);
  box-shadow: var(--shadow-elevated);
  text-shadow: none;
}

html[data-theme='dark'] .nav-links .btn,
html[data-theme='dark'] .nav-signout {
  color: #f4edff;
  text-shadow: 0 0 10px rgba(10, 2, 25, 0.35);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(160, 102, 255, 0.35);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme='dark'] .badge {
  background: rgba(26, 12, 32, 0.85);
  color: #d8ddff;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.status-pill {
  border-radius: 14px;
  border: 1px solid rgba(20, 22, 34, 0.12);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 14px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

html[data-theme='dark'] .status-pill {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.footer {
  color: #8c97a6;
  text-align: center;
  margin: 30px 0 20px;
  font-size: 0.85rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Policies page layout */
body.page-policies {
  align-items: center;
  padding: clamp(1.2rem, 3vw, 2.5rem) clamp(0.8rem, 3vw, 2.5rem);
  color: var(--text);
}

.page-policies .nav-wrap {
  margin-bottom: clamp(1rem, 3vw, 2rem);
}

.page-policies main {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem);
  line-height: 1.7;
}

.page-policies main a {
  color: #9be7ff;
}

.page-policies h1,
.page-policies h2,
.page-policies h3 {
  color: var(--accent-strong);
  margin-top: 2rem;
  letter-spacing: 0.02em;
}

.page-policies h1 {
  margin-top: 0;
  font-size: clamp(2.1rem, 4vw, 2.8rem);
}

.page-policies p,
.page-policies ul {
  color: var(--muted);
}

.page-policies ul {
  padding-left: 1.4rem;
}

.page-policies li + li {
  margin-top: 0.4rem;
}

.page-policies .bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.page-policies .page-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, min(24vw, 280px)) minmax(0, 1fr) minmax(220px, min(24vw, 280px));
  gap: clamp(1.5rem, 3vw, 3.5rem);
  align-items: flex-start;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.page-policies .page-hero {
  background: linear-gradient(135deg, rgba(20, 18, 34, 0.96), rgba(9, 11, 24, 0.92));
  border: 1px solid rgba(160, 102, 255, 0.22);
  border-radius: 22px;
  padding: clamp(2rem, 4vw, 2.75rem);
  box-shadow: 0 24px 60px rgba(4, 8, 20, 0.5);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
  animation: policy-fade-in 520ms ease both;
}

.page-policies .page-hero::after {
  content: '';
  position: absolute;
  inset: -40% 50% auto -40%;
  height: 220px;
  background: radial-gradient(circle at top right, rgba(160, 102, 255, 0.3), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.page-policies .page-hero p {
  margin: 0 0 1rem;
  max-width: 100%;
}

.page-policies .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.page-policies .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(160, 102, 255, 0.16);
  border: 1px solid rgba(160, 102, 255, 0.35);
  font-size: 0.8rem;
  color: #f3e7ff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme='light'] .page-policies .tag {
  background: rgba(138, 43, 226, 0.12);
  border-color: rgba(138, 43, 226, 0.25);
  color: var(--text);
}

.page-policies .policy-section {
  background: linear-gradient(135deg, rgba(13, 13, 28, 0.94), rgba(7, 9, 20, 0.92));
  border: 1px solid rgba(160, 102, 255, 0.32);
  border-radius: 20px;
  padding: clamp(2.2rem, 4vw, 2.75rem);
  margin-top: 2.5rem;
  box-shadow: 0 18px 45px rgba(3, 0, 9, 0.45);
  backdrop-filter: blur(14px);
  animation: policy-slide-up 560ms ease both;
}

.page-policies .policy-section:nth-of-type(odd) {
  animation-delay: 80ms;
}

.page-policies .policy-section:nth-of-type(even) {
  animation-delay: 140ms;
}

.page-policies .policy-section h2 {
  margin-top: 0;
}

.page-policies .policy-section h3 {
  margin-top: 1.6rem;
  color: #d6c0ff;
}

.page-policies .policy-section ul {
  background: rgba(10, 7, 18, 0.55);
  border-radius: 14px;
  padding: 1.1rem 1.35rem 1.25rem;
  border: 1px solid rgba(160, 102, 255, 0.18);
}

.page-policies .policy-section ul li strong {
  color: var(--text);
}

.page-policies nav.sidebar {
  position: sticky;
  top: clamp(1rem, 4vw, 6rem);
  justify-self: center;
  align-self: flex-start;
  width: min(100%, min(24vw, 280px));
  background: rgba(16, 12, 28, 0.96);
  padding: 2rem 1.6rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(160, 102, 255, 0.18);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  backdrop-filter: blur(14px);
  z-index: 2;
}

.page-policies .sidebar-spacer {
  grid-column: 3;
}

.page-policies nav.sidebar .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.page-policies nav.sidebar .brand img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(160, 102, 255, 0.35);
  background: rgba(10, 6, 18, 0.8);
  object-fit: cover;
}

.page-policies nav.sidebar .brand span {
  display: block;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.page-policies nav.sidebar .brand small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-policies .sidebar-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(214, 186, 255, 0.6);
}

.page-policies nav.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.page-policies nav.sidebar a.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: rgba(12, 8, 24, 0.82);
  border: 1px solid transparent;
  color: #cfe8ff;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.page-policies nav.sidebar a.nav-link:hover,
.page-policies nav.sidebar a.nav-link:focus-visible {
  border-color: rgba(160, 102, 255, 0.35);
  background: rgba(18, 10, 32, 0.94);
  transform: translateX(4px);
  outline: none;
}

.page-policies nav.sidebar a.nav-link span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 235, 255, 0.5);
}

.page-policies .back-up {
  margin-top: auto;
  font-size: 0.85rem;
  color: rgba(228, 207, 255, 0.75);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 1rem;
}

.page-policies .back-up:hover {
  color: #fff;
}

.page-policies footer {
  width: min(1200px, 100%);
  margin-top: 4rem;
  text-align: center;
  padding: 2.5rem 1rem 3.5rem;
  font-size: 0.85rem;
  color: rgba(245, 235, 255, 0.7);
}

.page-policies a:focus-visible {
  outline: 2px solid rgba(160, 102, 255, 0.6);
  outline-offset: 3px;
}

html[data-theme='light'] .page-policies .page-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 239, 255, 0.95));
  border-color: rgba(138, 43, 226, 0.2);
  box-shadow: 0 20px 45px rgba(48, 42, 80, 0.15);
}

html[data-theme='light'] .page-policies .policy-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(240, 240, 255, 0.94));
  border-color: rgba(138, 43, 226, 0.15);
  box-shadow: 0 16px 36px rgba(48, 42, 80, 0.16);
}

html[data-theme='light'] .page-policies .policy-section ul {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(138, 43, 226, 0.18);
}

html[data-theme='light'] .page-policies nav.sidebar {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(20, 22, 34, 0.12);
  box-shadow: 0 20px 40px rgba(33, 30, 55, 0.15);
}

html[data-theme='light'] .page-policies nav.sidebar a.nav-link {
  background: rgba(249, 247, 255, 0.85);
  border-color: transparent;
  color: var(--text);
}

html[data-theme='light'] .page-policies nav.sidebar a.nav-link:hover,
html[data-theme='light'] .page-policies nav.sidebar a.nav-link:focus-visible {
  border-color: rgba(138, 43, 226, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

html[data-theme='light'] .page-policies nav.sidebar a.nav-link span {
  color: rgba(58, 52, 81, 0.7);
}

html[data-theme='light'] .page-policies .sidebar-label {
  color: rgba(74, 64, 110, 0.7);
}

html[data-theme='light'] .page-policies main a {
  color: #5c40c4;
}

html[data-theme='light'] .page-policies .policy-section h3 {
  color: #4e3b85;
}

/* Portal page layout */
body.page-portal {
  font-size: clamp(15px, 1.1vw, 17px);
}

.page-portal main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: clamp(18px, 4vw, 48px);
}

.page-portal .portal-window {
  width: min(1300px, 100%);
  position: relative;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 8, 20, 0.82);
  box-shadow: 0 25px 80px rgba(3, 5, 15, 0.55);
  backdrop-filter: blur(24px);
  padding: clamp(18px, 4vw, 42px);
  overflow: hidden;
}

.page-portal .portal-window::after {
  content: '';
  position: absolute;
  inset: 20% auto auto 60%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(77, 208, 251, 0.28), transparent 60%);
  filter: blur(30px);
  opacity: 0.6;
  animation: portal-float 14s ease-in-out infinite;
  pointer-events: none;
}

.page-portal .content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(16px, 2vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.page-portal .content.has-session {
  grid-auto-flow: dense;
}

.page-portal .content > .account-card,
.page-portal .content > #status-card,
.page-portal #events-pane {
  grid-column: 1 / -1;
}

.page-portal .card {
  background: rgba(13, 16, 34, 0.88);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: clamp(20px, 3vw, 36px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 45px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  position: relative;
}

.page-portal .card::before {
  content: '';
  position: absolute;
  inset: 10% auto auto 50%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(143, 90, 255, 0.16), transparent 70%);
  filter: blur(20px);
  opacity: 0.8;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.page-portal .card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.page-portal .card > * {
  position: relative;
  z-index: 1;
}

.page-portal .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: clamp(16px, 2vw, 24px);
}

.page-portal .card-header .label {
  margin: 0;
}

.page-portal h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 2.3rem);
  letter-spacing: -0.02em;
}

.page-portal p {
  margin: 0;
  color: var(--muted);
}

.page-portal .pill {
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  white-space: nowrap;
}

.page-portal .pill-purple {
  background: linear-gradient(120deg, var(--accent), rgba(255, 138, 212, 0.4));
  border-color: transparent;
  color: var(--accent-contrast);
  font-weight: 600;
}

.page-portal .pill-outline {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.page-portal .account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.page-portal .account-block {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 14px;
}

.page-portal .account-title {
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-portal .account-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.page-portal .avatar {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.6);
}

.page-portal .fields {
  display: grid;
  gap: 10px;
}

.page-portal .label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.page-portal .value {
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  color: var(--text);
}

.page-portal .form-grid {
  display: grid;
  gap: 18px;
}

.page-portal .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-portal .input,
.page-portal select,
.page-portal input[type='datetime-local'],
.page-portal .search-box {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 14, 32, 0.85);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.page-portal .input:focus,
.page-portal select:focus,
.page-portal input[type='datetime-local']:focus,
.page-portal .search-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(143, 90, 255, 0.25);
}

.page-portal .btn {
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--accent), #4dd0fb);
  color: #05060d;
  cursor: pointer;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.page-portal .btn:hover:not([disabled]),
.page-portal .btn:focus-visible:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 28px 55px rgba(0, 0, 0, 0.55);
  outline: none;
}

.page-portal .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.page-portal .btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--text);
  box-shadow: none;
}

.page-portal .events-list,
.page-portal .history-list {
  display: grid;
  gap: 16px;
}

.page-portal .history-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.page-portal .history-stat {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.page-portal .history-stat .stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-portal .history-stat .stat-value {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
}

.page-portal .event-item,
.page-portal .history-item {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-portal .event-headline,
.page-portal .history-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-portal .history-headline .pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  font-size: clamp(0.58rem, 0.85vw, 0.7rem);
  letter-spacing: 0.12em;
  padding: 2px clamp(10px, 1.4vw, 14px);
  line-height: 1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
}

.page-portal .event-headline h2,
.page-portal .history-headline h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.page-portal .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.page-portal .event-meta,
.page-portal .history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.page-portal .event-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.page-portal .hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.page-portal details.history-details {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 22, 0.7);
  padding: 12px 14px;
}

.page-portal details.history-details summary {
  cursor: pointer;
  font-weight: 600;
}

.page-portal .history-details-body {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.page-portal .history-attendees {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-portal .history-attendees li {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.page-portal .cohost-results {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(6, 9, 18, 0.95);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.page-portal .cohost-option {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-portal .cohost-option:last-child {
  border-bottom: none;
}

.page-portal .cohost-option:hover,
.page-portal .cohost-option:focus-visible {
  background: rgba(143, 90, 255, 0.18);
  outline: none;
}

.page-portal .empty-state {
  padding: clamp(22px, 3vw, 32px);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

.page-portal footer {
  text-align: center;
  color: #8c97a6;
  font-size: 0.85rem;
  padding: 20px;
}

.page-portal .viewer-mode #session-create-card {
  display: none;
}

html[data-theme='light'] .page-portal .portal-window {
  border-color: rgba(20, 22, 34, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 55px rgba(51, 42, 97, 0.18);
}

html[data-theme='light'] .page-portal .card,
html[data-theme='light'] .page-portal .account-block,
html[data-theme='light'] .page-portal .event-item,
html[data-theme='light'] .page-portal .history-item {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(20, 22, 34, 0.08);
  box-shadow: 0 18px 36px rgba(42, 34, 84, 0.15);
}

html[data-theme='light'] .page-portal .history-stat {
  border-color: rgba(20, 22, 34, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme='light'] .page-portal .input,
html[data-theme='light'] .page-portal select,
html[data-theme='light'] .page-portal input[type='datetime-local'],
html[data-theme='light'] .page-portal .search-box {
  border-color: rgba(20, 22, 34, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

html[data-theme='light'] .page-portal .btn-outline {
  border-color: rgba(20, 22, 34, 0.2);
  color: var(--text);
}

html[data-theme='light'] .page-portal .cohost-option {
  border-bottom-color: rgba(20, 22, 34, 0.08);
}

html[data-theme='light'] .page-portal .history-headline .pill,
html[data-theme='light'] .page-portal .chip {
  background: rgba(138, 43, 226, 0.12);
  border-color: rgba(138, 43, 226, 0.2);
  color: var(--text);
}

@keyframes policy-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes policy-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes portal-float {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-20px, 15px, 0) scale(1.05);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1024px) {
  .nav-container {
    width: min(92vw, 1100px);
  }

  .page-policies .page-shell {
    grid-template-columns: 1fr;
  }

  .page-policies nav.sidebar {
    position: relative;
    top: 0;
    justify-self: stretch;
    width: 100%;
  }

  .page-policies nav.sidebar ul {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .page-policies .sidebar-spacer {
    display: none;
  }

  .page-policies main {
    grid-column: 1;
  }
}

@media (max-width: 900px) {
  .navbar {
    width: min(95vw, 1200px);
  }
}

@media (max-width: 820px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
  }

  .nav-link {
    width: 100%;
  }

  .nav-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .theme-toggle {
    align-self: flex-end;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .navbar {
    gap: 12px;
    padding: 14px 18px;
  }

  .nav-logo {
    width: 100%;
    justify-content: space-between;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-actions {
    align-items: flex-start;
  }

  .page-policies .page-shell {
    gap: 1.25rem;
  }

  .page-policies main {
    padding: 2rem 1rem 3rem;
  }

  .page-policies .page-hero,
  .page-policies .policy-section {
    padding: 1.9rem 1.6rem;
  }

  .page-policies h1 {
    font-size: 2.1rem;
  }

  .page-policies nav.sidebar {
    padding: 1.5rem 1.15rem 1.7rem;
    border-radius: 16px;
  }

  .page-policies nav.sidebar .brand {
    gap: 0.6rem;
  }

  .page-policies nav.sidebar .brand img {
    width: 44px;
    height: 44px;
  }

  .page-policies nav.sidebar ul {
    grid-template-columns: 1fr;
  }

  .page-portal .portal-window {
    padding: 16px;
  }

  .page-portal .card {
    padding: 18px;
  }

  .page-portal .account-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-portal .avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .nav-links .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .nav-logo img {
    height: 42px;
  }
}

@media (min-width: 960px) {
  .page-portal .content.has-session {
    grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.2fr);
  }

  .page-portal .content.has-session #session-create-card {
    grid-column: 1 / 2;
  }

  .page-portal .content.has-session #events-pane {
    grid-column: 2 / 3;
  }
}

@media (max-width: 960px) {
  .page-portal .content {
    grid-template-columns: 1fr;
  }

  .page-portal #events-pane,
  .page-portal #history-card {
    grid-column: 1 / -1;
  }
}

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