:root {
  --bg: #0f1117;
  --panel: #171a22;
  --panel-2: #1d2230;
  --text: #f3f5f7;
  --muted: #a9b1bc;
  --accent: #8b5cf6;
  --accent-2: #6d28d9;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.profile-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.profile-navbar {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 360px) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-navbar__brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.profile-navbar__search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.profile-navbar__menu {
  display: flex;
  gap: 10px;
  align-items: center;
}

.profile-navbar__menu a,
.profile-navbar__menu button,
.profile-switches button,
#open-olivia {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.profile-navbar__menu a:hover,
.profile-navbar__menu button:hover,
.profile-switches button:hover,
#open-olivia:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.owner-mode-banner {
  display: none;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--text);
}

.profile-header,
.profile-session-panels,
.profile-card,
.profile-owner-controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-header {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  align-items: center;
  padding: 24px;
  margin-bottom: 20px;
}

.avatar {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.profile-header__body h1,
#profile-displayName {
  margin: 0 0 8px;
  font-size: 2rem;
}

#profile-handle,
#profile-type,
#profile-bio,
#auth-email,
#active-account-type {
  color: var(--muted);
}

.profile-session-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 20px;
  margin-bottom: 20px;
}

.profile-panel {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.profile-panel h2,
.profile-card h2,
.profile-owner-controls h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.profile-owner-controls {
  display: none;
  margin-bottom: 20px;
  padding: 20px;
}

.profile-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.profile-card {
  margin-bottom: 20px;
  padding: 20px;
}

.u-chip {
  display: inline-flex;
  align-items: center;
  margin: 6px 8px 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.u-muted {
  color: var(--muted);
}

.profile-page[data-view-mode="manage"] .owner-mode-banner {
  display: block;
}

.profile-page[data-view-mode="manage"] .profile-owner-controls {
  display: block;
}

.profile-page[data-view-mode="public"] .profile-owner-controls,
.profile-page[data-view-mode="public"] .owner-mode-banner {
  display: none;
}

@media (max-width: 840px) {
  .profile-navbar {
    grid-template-columns: 1fr;
  }

  .profile-navbar__menu {
    flex-wrap: wrap;
  }

  .profile-navbar__links {
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .profile-navbar__links a,
  .profile-navbar__brand a {
    color: var(--text);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
  }

  .profile-navbar__links a:hover,
  .profile-navbar__brand a:hover {
    background: var(--panel-2);
  }

  .profile-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .avatar {
    margin: 0 auto;
  }

  .profile-session-panels {
    grid-template-columns: 1fr;
  }
}
