:root {
  --bg: #1c1c1c;
  --bg-sidebar: #212121;
  --bg-elevated: #202020;
  --bg-raised: #282828;
  --bg-hover: #303030;
  --border: #333333;
  --border-strong: #484848;
  --text: #dadada;
  --text-muted: #999999;
  --text-dim: #777777;
  --accent: #8b6cf6;
  --accent-hover: #9b7ff8;
  --accent-soft: #30283d;
  --accent-ring: rgba(139, 108, 246, 0.35);
  --accent-text: #d8c6ff;
  --tag-bg: #332c42;
  --success: #22c55e;
  --danger: #ef4444;
  --sidebar-w: 240px;
  --aside-w: 300px;
  --font: "Inter", system-ui, sans-serif;
  --font-heading: "Inter", system-ui, sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, monospace;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --bg-scrim: 0.72;
  --bg-extra-dark: 0;
  --bg-extra-light: 0;
  --bottom-nav-h: 56px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.brand,
.achievement-group-title,
.panel-style-option__title,
.auth-card .text-2xl {
  font-family: var(--font-heading);
  font-weight: 600;
  font-variation-settings: "wght" 600;
  font-synthesis: none;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, var(--bg-extra-light)), rgba(255, 255, 255, var(--bg-extra-light))),
    linear-gradient(rgba(0, 0, 0, var(--bg-extra-dark)), rgba(0, 0, 0, var(--bg-extra-dark)));
  background-attachment: fixed;
  position: relative;
  font-size: 15px;
  line-height: 1.6;
}

code,
pre,
.font-mono {
  font-family: var(--font-code);
}

/* Custom image background with dark overlay (layered on body — not negative z-index) */
html.has-bg-image,
body.has-bg-image {
  background-color: #1c1c1c !important;
  background-image:
    linear-gradient(rgba(28, 28, 28, var(--bg-scrim)), rgba(28, 28, 28, var(--bg-scrim))),
    var(--app-bg-image) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

.brightness-control {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.brightness-control__scale {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.brightness-control input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.appearance-reset {
  display: flex;
  justify-content: flex-end;
}

.bg-option {
  position: relative;
  display: block;
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
  padding: 0;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.bg-option:hover {
  border-color: var(--border-strong);
}

.bg-option:active {
  transform: scale(0.985);
}

.bg-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-ring);
}

.bg-option__preview {
  height: 110px;
  width: 100%;
  background: var(--bg);
  background-size: cover;
  background-position: center;
  position: relative;
}

.bg-option__preview--default {
  background-image: linear-gradient(180deg, #1c1c1c, #232323);
}

.bg-option__preview--gradient {
  background-size: cover;
  background-position: center;
}

.bg-option__preview--image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.55);
}

/* Preset CSS gradient backgrounds (profile-banner style) */
html.has-bg-gradient,
body.has-bg-gradient {
  background-color: #1c1c1c !important;
  background-image:
    linear-gradient(rgba(255, 255, 255, var(--bg-extra-light)), rgba(255, 255, 255, var(--bg-extra-light))),
    linear-gradient(rgba(0, 0, 0, var(--bg-extra-dark)), rgba(0, 0, 0, var(--bg-extra-dark))),
    var(--app-bg-gradient) !important;
  background-attachment: fixed !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

html[data-theme="light"].has-bg-gradient,
body[data-theme="light"].has-bg-gradient,
html.theme-light.has-bg-gradient,
body.theme-light.has-bg-gradient {
  background-color: #ffffff !important;
}

.bg-option__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elevated);
}

.bg-option__check {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

button,
input,
textarea {
  font: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

/* Panel style: solid (default) vs outline (transparent fill) */
html.panels-outline {
  --bg-elevated: transparent;
  --bg-hover: rgba(255, 255, 255, 0.06);
}

html.panels-outline .card,
html.panels-outline .search-box,
html.panels-outline .btn-icon,
html.panels-outline .toast,
html.panels-outline .achievement-card,
html.panels-outline .bg-option,
html.panels-outline .modal,
html.panels-outline .auth-card {
  background: transparent;
  border-color: var(--border);
}

html.panels-outline .bg-option__meta {
  background: transparent;
  border-top: 1px solid var(--border);
}

html.panels-outline .field input,
html.panels-outline .field textarea,
html.panels-outline .field select,
html.panels-outline .input,
html.panels-outline .select,
html.panels-outline .explore-search-box {
  background: transparent;
  border-color: var(--border);
}

html.panels-outline .btn-ghost:hover:not(:disabled),
html.panels-outline .action-row:hover:not(:disabled),
html.panels-outline .nav-item:hover:not(:disabled):not(.nav-item--disabled),
html.panels-outline .nav-item.active {
  background: rgba(255, 255, 255, 0.06);
}

html.panels-glass .card,
html.panels-glass .search-box,
html.panels-glass .btn-icon,
html.panels-glass .toast,
html.panels-glass .achievement-card,
html.panels-glass .bg-option,
html.panels-glass .modal,
html.panels-glass .auth-card {
  background: rgba(40, 40, 40, 0.72);
  border-color: var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html.panels-glass .bg-option__meta {
  background: rgba(40, 40, 40, 0.85);
  border-top: 1px solid var(--border);
}

html.panels-glass .field input,
html.panels-glass .field textarea,
html.panels-glass .field select,
html.panels-glass .input,
html.panels-glass .select,
html.panels-glass .explore-search-box {
  background: rgba(28, 28, 28, 0.7);
  border-color: var(--border);
}

.panel-style-option {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: border-color 0.15s ease;
  width: 100%;
}

.panel-style-option:hover {
  border-color: var(--border-strong);
}

.panel-style-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-ring);
}

.panel-style-option__preview {
  height: 72px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.panel-style-option__preview--solid {
  background: #232323;
}

.panel-style-option__preview--outline {
  background: transparent;
}

.panel-style-option__preview--glass {
  background: #1c1c1c;
}

.panel-style-option__preview-inner {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 14px;
  height: 44px;
  border-radius: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.panel-style-option__preview--solid .panel-style-option__preview-inner {
  background: #282828;
}

.panel-style-option__preview--outline .panel-style-option__preview-inner {
  background: transparent;
}

.panel-style-option__preview--glass .panel-style-option__preview-inner {
  background: rgba(40, 40, 40, 0.72);
  border-color: rgba(51, 51, 51, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.panel-style-option__title {
  font-weight: 500;
  font-size: 0.95rem;
}

.panel-style-option__desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.app-shell {
  --shell-pad-x: 1.5rem;
  --shell-pad-y: 1.25rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--aside-w);
  grid-template-areas:
    "sidebar topbar topbar-aside"
    "sidebar main aside";
  align-items: start;
  align-content: start;
  gap: 1.25rem;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--shell-pad-y) var(--shell-pad-x) 2rem;
}

.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: fixed;
  z-index: 40;
  top: var(--shell-pad-y);
  left: max(var(--shell-pad-x), calc((100vw - min(1440px, 100vw)) / 2 + var(--shell-pad-x)));
  width: var(--sidebar-w);
  height: calc(100vh - (var(--shell-pad-y) * 2));
  min-width: 0;
  background: transparent;
  box-sizing: border-box;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  background: transparent;
}

.sidebar-menu .sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: transparent;
}

.logout-btn,
.sidebar-menu #logout-btn {
  margin-top: auto;
  flex-shrink: 0;
  color: #f87171;
}

.brand {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  background: transparent;
}

.topbar {
  grid-area: topbar;
}

.topbar-aside {
  grid-area: topbar-aside;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
}

main {
  grid-area: main;
  min-width: 0;
}

.aside-panel {
  grid-area: aside;
}

.profile-card {
  display: flex;
  flex-direction: column;
}

.aside-panel {
  background: transparent;
}

.sidebar,
.aside-panel,
.sidebar .nav-item,
.aside-panel * {
  font-family: var(--font);
  font-weight: 400 !important;
  font-variation-settings: "wght" 400;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-gradient {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-gradient:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  line-height: 0;
  flex-shrink: 0;
}

.btn-icon svg {
  display: block;
  flex-shrink: 0;
}

.btn-icon:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.composer-toolbar .btn-primary,
.composer-toolbar .btn-gradient {
  margin-left: auto;
  height: 2.25rem;
  padding: 0 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 400;
}

.nav-item svg,
.action-row svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.nav-item:hover:not(:disabled):not(.nav-item--disabled) {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid transparent;
}

.nav-item--disabled {
  opacity: 0.72;
  cursor: default;
}

.nav-badge {
  margin-left: auto;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.7rem 1rem;
  color: var(--text-dim);
}

.search-box__btn {
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.search-box__btn:hover {
  opacity: 0.85;
  color: var(--text);
  transform: scale(1.08);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-box-wrapper {
  flex: 1;
  position: relative;
  min-width: 0;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.4), 0 8px 12px -6px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.35rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search-dropdown[hidden] {
  display: none;
}

.search-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.15s ease;
  outline: none;
}

.search-dropdown__item:hover,
.search-dropdown__item.is-selected {
  background: var(--bg-hover);
}

.search-dropdown__item.is-selected {
  outline: 1px solid var(--accent);
}

.search-dropdown__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.search-dropdown__names {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown__display-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown__username {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.search-dropdown__about {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.search-dropdown__empty,
.search-dropdown__loading,
.search-dropdown__error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
}

.search-dropdown__empty svg,
.search-dropdown__loading svg,
.search-dropdown__error svg {
  color: var(--text-dim);
  flex-shrink: 0;
}


.topbar-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  line-height: 0;
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.topbar-avatar-btn:hover {
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar-avatar-btn.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.topbar-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  height: 44px;
  padding: 0.25rem 0.85rem 0.25rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
}

.topbar-profile-btn:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar-profile-btn.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.topbar-profile-btn__avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-profile-btn__avatar .avatar {
  width: 34px;
  height: 34px;
}

.topbar-profile-btn__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  max-width: 160px;
  line-height: 1.25;
}

.topbar-profile-btn__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.topbar-profile-btn__username {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 600px) {
  .topbar-profile-btn__info {
    display: none;
  }
  .topbar-profile-btn {
    padding: 0.25rem;
    gap: 0;
  }
}

.avatar--topbar {
  width: 100%;
  height: 100%;
}

.theme-choice-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 0.95rem;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.1s ease;
  position: relative;
  width: 100%;
}

.theme-choice-btn:hover {
  border-color: var(--border-strong);
}

.theme-choice-btn.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-ring);
}

.theme-choice-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.65rem;
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.theme-choice-icon svg {
  width: 18px;
  height: 18px;
}

.theme-choice-info {
  flex: 1;
  min-width: 0;
}

.theme-choice-title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.theme-choice-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

html.panels-outline .theme-choice-btn,
html.panels-outline .topbar-profile-btn,
html.panels-outline .topbar-avatar-btn {
  background: transparent;
  border-color: var(--border);
}

html.panels-glass .theme-choice-btn,
html.panels-glass .topbar-profile-btn,
html.panels-glass .topbar-avatar-btn {
  background: rgba(40, 40, 40, 0.55);
  border-color: var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Light theme: theme switchers stay soft, not dark blobs */
html[data-theme="light"] .theme-choice-btn,
html.theme-light .theme-choice-btn,
body[data-theme="light"] .theme-choice-btn {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="light"] .theme-choice-btn:hover,
html.theme-light .theme-choice-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

html[data-theme="light"] .theme-choice-btn.is-selected,
html.theme-light .theme-choice-btn.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-ring);
}

html[data-theme="light"] .theme-choice-icon,
html.theme-light .theme-choice-icon {
  background: var(--bg-raised);
  color: var(--accent-text);
}

html[data-theme="light"] .theme-choice-btn[data-theme-choice="dark"] .theme-choice-icon,
html.theme-light .theme-choice-btn[data-theme-choice="dark"] .theme-choice-icon {
  background: #2a2435;
  color: #d8c6ff;
}

html[data-theme="light"] .theme-choice-btn[data-theme-choice="light"] .theme-choice-icon,
html.theme-light .theme-choice-btn[data-theme-choice="light"] .theme-choice-icon {
  background: #f0ebff;
  color: #5b39c4;
}

html[data-theme="light"].panels-outline .theme-choice-btn,
html.theme-light.panels-outline .theme-choice-btn {
  background: transparent;
  border-color: var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.avatar {
  position: relative;
  display: inline-block;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  border: none;
  outline: none;
  box-shadow: none;
  line-height: 0;
  vertical-align: middle;
}

button.avatar {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.avatar--image {
  background: transparent;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.avatar--default img {
  transform: scale(1.22);
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
  line-height: 0;
}

.profile-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: -3.25rem;
  position: relative;
  z-index: 1;
}

.profile-avatar-row__avatar {
  margin: -3.25rem 0 1rem 1rem;
}

.avatar-upload-btn {
  position: absolute;
  right: 0.15rem;
  bottom: 0.15rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(28, 28, 28, 0.9);
  border: 1px solid rgba(51, 51, 51, 0.95);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.avatar-upload-btn:hover {
  background: rgba(139, 108, 246, 0.9);
}

.banner-upload-btn {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.7rem;
  background: rgba(28, 28, 28, 0.82);
  border: 1px solid rgba(51, 51, 51, 0.9);
  color: #dadada;
  font-size: 0.82rem;
  font-weight: 560;
  cursor: pointer;
}

.banner-upload-btn:hover {
  background: rgba(139, 108, 246, 0.85);
}

.media-edit-block .profile-banner {
  border-radius: 0.85rem;
}

.avatar--xs,
.avatar-xs {
  width: 1.75rem;
  height: 1.75rem;
}

.avatar--sm,
.avatar-sm {
  width: 2.25rem;
  height: 2.25rem;
}

.avatar--md,
.avatar-md {
  width: 3rem;
  height: 3rem;
}

.avatar--xl,
.avatar-xl {
  width: 6.5rem;
  height: 6.5rem;
  border: none;
  box-shadow: none;
}

.profile-banner {
  height: 180px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background:
    linear-gradient(105deg, rgba(48, 40, 61, 0.35) 30%, rgba(28, 28, 28, 0.55) 100%),
    linear-gradient(135deg, #2a2435 0%, #1c1c1c 52%, #161616 100%);
  position: relative;
  overflow: hidden;
}

.profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 82%, rgba(48, 40, 61, 0.45), transparent 42%),
    radial-gradient(circle at 82% 22%, rgba(139, 108, 246, 0.12), transparent 36%);
  pointer-events: none;
}

.profile-banner--image {
  background: none;
}

.profile-banner--image::after {
  display: none;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.profile-skills {
  margin-top: 1.35rem;
}

.profile-skills__label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}

.profile-skills__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tab {
  padding: 0.9rem 1rem;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: -1px;
  flex: 0 0 auto;
}

.tab:hover,
.tab.active {
  color: var(--text);
  border-bottom-color: var(--text-muted);
}

.tab--disabled,
.tab--disabled:hover {
  opacity: 0.4;
  cursor: default;
  color: var(--text-muted);
  border-bottom-color: transparent;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.action-row:hover:not(:disabled) {
  background: var(--bg-hover);
}

.action-row:disabled {
  opacity: 0.72;
  cursor: default;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 0.85rem;
}

.stat-value {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 1.15rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.stat-trend {
  color: var(--success);
  display: inline-flex;
  line-height: 0;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--text-muted);
}

.post-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.5rem;
  transition: color 0.15s ease;
}

.post-action:hover:not(:disabled) {
  color: var(--text);
}

.post-action.liked {
  color: #f43f5e;
}

.post-action.reposted {
  color: #10b981;
}

.repost-quote-box {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  padding: 0.65rem 0.85rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.repost-original-card {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.85rem;
  background: var(--bg-hover);
  margin-top: 0.5rem;
}

.repost-deleted-stub {
  border: 1px dashed var(--border);
  border-radius: 0.65rem;
  padding: 0.85rem;
  background: rgba(239, 68, 68, 0.08);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
  margin-top: 0.5rem;
}

.badge-visibility {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-visibility--public {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-visibility--private {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.post-action:disabled {
  opacity: 0.35;
  cursor: default;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 560;
}

.field input,
.field textarea,
.field select,
.input,
.select {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.input::placeholder {
  color: var(--text-dim);
}

.select option {
  background: var(--bg-elevated);
  color: var(--text);
}

.field textarea {
  resize: vertical;
  min-height: 100px;
}

.toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  translate: -50% 0;
  z-index: 50;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 0.85rem;
  padding: 0.85rem 1.25rem 0.95rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  min-width: 240px;
  max-width: min(420px, calc(100vw - 2rem));
  overflow: hidden;
  animation: slide-in 0.2s ease;
}

.toast-text {
  text-align: center;
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--text-muted);
  transform-origin: right center;
  animation: toast-progress 3.8s linear forwards;
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.45);
}

.toast--error .toast-progress {
  background: var(--danger);
}

@keyframes slide-in {
  from {
    opacity: 0;
    translate: -50% -8px;
  }
  to {
    opacity: 1;
    translate: -50% 0;
  }
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: min(420px, 100%);
  padding: 2rem;
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.skill-pill,
.interest-pill,
.aside-panel .interest-pill,
.profile-card .skill-pill,
.profile-skills .skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--tag-bg);
  color: var(--accent-text) !important;
  font-family: var(--font) !important;
  font-size: 0.78rem;
  font-weight: 500 !important;
  font-variation-settings: "wght" 500;
  border: none !important;
  line-height: 1.25;
}

.skill-pill__remove,
.interest-pill__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  margin-left: 0.2rem;
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  border-radius: 50%;
  line-height: 1;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.skill-pill__remove:hover,
.interest-pill__remove:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.skill-pill__remove svg,
.interest-pill__remove svg {
  width: 11px;
  height: 11px;
}

.interest-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.interest-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.interest-add:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.interest-add:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Interest Catalog Modal & Chips */
.modal--interests {
  width: min(640px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.interest-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.interest-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.interest-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.interest-counter--limit {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.interest-search-wrapper {
  position: relative;
}

.interest-search-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.interest-search-input:focus {
  border-color: var(--accent);
}

.interest-chips-container {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem;
  margin: 0 -0.25rem;
}

.interest-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-family: var(--font);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.interest-chip:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.interest-chip--active,
.interest-chip.is-selected {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
  font-weight: 500;
}

.interest-chip:disabled,
.interest-chip--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.interest-modal__empty {
  width: 100%;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.interest-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

html[data-theme="light"] .interest-chip {
  background: #f4f4f5;
  border-color: #e4e4e7;
  color: #18181b;
}

html[data-theme="light"] .interest-chip:hover:not(:disabled) {
  background: #e4e4e7;
  border-color: #d4d4d8;
}

html[data-theme="light"] .interest-chip--active,
html[data-theme="light"] .interest-chip.is-selected {
  background: #7c3aed !important;
  color: #ffffff !important;
  border-color: #7c3aed !important;
}

html[data-theme="light"] .interest-search-input {
  background: #ffffff;
  border-color: #e4e4e7;
  color: #18181b;
}

html[data-theme="light"] .interest-counter {
  background: #f4f4f5;
  color: #71717a;
}

html[data-theme="light"] .interest-counter--limit {
  background: #f0ebff;
  color: #5b39c4;
}


.achievement-groups {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.achievement-group-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.achievement-card {
  padding: 1rem;
}

.achievement-card--locked {
  opacity: 0.42;
  filter: grayscale(0.9);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 1rem;
}

body.overlay-blur #app {
  filter: blur(18px);
  pointer-events: none;
  user-select: none;
}

.modal-backdrop--blur {
  background: rgba(6, 10, 20, 0.28);
}

.modal-backdrop--blur .modal {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.level-picker {
  position: relative;
}

.level-picker__value,
.level-picker__option {
  font: inherit;
  color: var(--text);
}

.level-picker__value {
  position: relative;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  padding: 0.7rem 2rem 0.7rem 0.9rem;
  cursor: pointer;
}

.level-picker__value::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
}

.level-picker__value:focus {
  outline: none;
  border-color: var(--accent);
}

.level-picker__menu {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.level-picker__menu[hidden] {
  display: none;
}

.level-picker__option {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0.55rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.level-picker__option:hover,
.level-picker__option.is-selected {
  background: var(--bg-hover);
}

.modal {
  width: min(520px, 100%);
  padding: 1.5rem;
}

.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

/* ==========================================================================
   Mobile-First Components (Desktop Defaults: Hidden)
   ========================================================================== */
.mobile-brand {
  display: none;
}
.mobile-search-toggle {
  display: none !important;
}
.mobile-search-close {
  display: none !important;
}
.mobile-bottom-nav {
  display: none !important;
}
.mobile-drawer,
.mobile-drawer-backdrop {
  display: none !important;
}
.chat-back-btn {
  display: none !important;
}

/* Responsive safety rules */
body, html {
  overflow-x: hidden;
  max-width: 100vw;
}

img, video {
  max-width: 100%;
  height: auto;
}

p, .post-content, .comment-content {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ==========================================================================
   Tablet Breakpoint (768px - 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto;
    grid-template-areas:
      "sidebar topbar topbar-aside"
      "sidebar main main";
  }

  .aside-panel {
    display: none;
  }
}

/* ==========================================================================
   Mobile Breakpoint (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .app-shell {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "topbar topbar-aside"
      "main main";
    padding: 0.5rem 0.75rem calc(var(--bottom-nav-h) + 1.25rem + env(safe-area-inset-bottom, 0px));
    gap: 0.75rem;
    min-height: 100vh;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .sidebar {
    display: none !important;
  }

  .aside-panel {
    display: none !important;
  }

  .topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    position: relative;
  }

  .mobile-brand {
    display: flex !important;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .mobile-search-toggle {
    display: inline-flex !important;
  }

  .search-box-wrapper {
    display: none;
  }

  .search-box-wrapper.mobile-search-open {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 0.75rem 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    z-index: 1100;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  .search-box-wrapper.mobile-search-open .search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
  }

  .search-box-wrapper.mobile-search-open .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
  }

  .mobile-search-close {
    display: inline-flex !important;
    color: var(--text-muted);
    cursor: pointer;
  }

  .search-box-wrapper.mobile-search-open .search-dropdown {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    max-height: calc(100vh - 60px - env(safe-area-inset-top, 0px));
    border-radius: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-top: none;
    z-index: 1101;
    overflow-y: auto;
  }

  .topbar-aside {
    grid-area: topbar-aside;
    display: flex;
    align-items: center;
  }

  .topbar-profile-btn__info {
    display: none !important;
  }

  .topbar-profile-btn {
    padding: 0.25rem;
    gap: 0;
    border: none;
    background: transparent;
  }

  /* Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    box-sizing: border-box;
  }

  .mobile-nav-btn {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0;
    gap: 0.15rem;
    transition: color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-btn:active {
    transform: scale(0.92);
  }

  .mobile-nav-btn.active {
    color: var(--accent);
  }

  .mobile-nav-btn__icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }

  .mobile-nav-btn__label {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.1;
  }

  .mobile-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--accent);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.05rem 0.3rem;
    min-width: 14px;
    line-height: 1.2;
    text-align: center;
  }

  /* Mobile Drawer */
  .mobile-drawer-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1200;
    transition: opacity 0.25s ease;
  }

  .mobile-drawer-backdrop[hidden] {
    display: none !important;
  }

  .mobile-drawer {
    display: flex !important;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 82vw);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    z-index: 1201;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  }

  .mobile-drawer.is-open {
    transform: translateX(0);
  }

  .mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .mobile-drawer__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    min-width: 0;
    flex: 1;
  }

  .mobile-drawer__user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-drawer__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-drawer__username {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

  .mobile-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
  }

  .mobile-drawer__footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
  }

  /* Messages Master-Detail */
  .messages-layout {
    height: calc(100vh - 125px) !important;
    position: relative;
    width: 100%;
    overflow: hidden;
  }

  .messages-layout .conversations-sidebar {
    width: 100% !important;
    border-right: none !important;
    display: flex !important;
  }

  .messages-layout .chat-main {
    display: none !important;
    width: 100% !important;
  }

  .messages-layout.has-active-chat .conversations-sidebar {
    display: none !important;
  }

  .messages-layout.has-active-chat .chat-main {
    display: flex !important;
  }

  .chat-back-btn {
    display: inline-flex !important;
    margin-right: 0.4rem;
    flex-shrink: 0;
  }

  /* Profile page mobile adjustments */
  .profile-banner {
    height: 120px !important;
  }

  .profile-avatar-row {
    margin-top: -2.5rem !important;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .avatar--xl,
  .avatar-xl {
    width: 5rem !important;
    height: 5rem !important;
  }

  .profile-avatar-row > div:last-child {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Modals on mobile */
  .modal-backdrop {
    padding: 0.5rem;
    overflow-y: auto;
  }

  .modal {
    max-height: calc(100vh - 2.5rem) !important;
    overflow-y: auto !important;
    padding: 1.25rem 1rem !important;
    width: 100% !important;
  }

  /* Communities & Chat */
  #communities-cards-grid {
    grid-template-columns: 1fr !important;
  }

  .community-chat-box {
    height: calc(100vh - 230px) !important;
    min-height: 360px;
  }
}

/* Light theme mobile refinements */
html[data-theme="light"] .mobile-bottom-nav,
html.theme-light .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: #e5e5e5;
}

html[data-theme="light"] .mobile-drawer,
html.theme-light .mobile-drawer {
  background: #ffffff;
  border-right-color: #e5e5e5;
}

html[data-theme="light"] .mobile-brand,
html.theme-light .mobile-brand {
  color: #111827;
}

html[data-theme="light"] .bg-option__preview--default,
html.theme-light .bg-option__preview--default {
  background-image: linear-gradient(180deg, #ffffff, #fafafa);
}

html[data-theme="light"] .panel-style-option__preview--glass,
html.theme-light .panel-style-option__preview--glass {
  background: #f6f6f6;
}

/* ==========================================================================
   Light Theme (Obsidian-inspired) & Theme Switcher
   ========================================================================== */
html[data-theme="light"],
body[data-theme="light"],
html.theme-light,
body.theme-light {
  --bg: #ffffff;
  --bg-sidebar: #fcfcfc;
  --bg-elevated: #fafafa;
  --bg-raised: #f6f6f6;
  --bg-hover: #efefef;
  --border: #e4e4e4;
  --border-strong: #d0d0d0;
  --text: #222222;
  --text-muted: #5c5c5c;
  --text-dim: #707070;
  --accent: #7852ee;
  --accent-hover: #6941d8;
  --accent-soft: #f0ebff;
  --accent-ring: rgba(120, 82, 238, 0.3);
  --accent-text: #5b39c4;
  --tag-bg: #f0ebff;
  --success: #00ba7c;
  --danger: #f4212e;
  --bg-scrim: 0;
}

html[data-theme="light"] body,
body[data-theme="light"],
html.theme-light body,
body.theme-light {
  background-color: #ffffff !important;
  color: #222222 !important;
}

html[data-theme="light"]:not(.has-bg-image):not(.has-bg-gradient) body,
body[data-theme="light"]:not(.has-bg-image):not(.has-bg-gradient),
html.theme-light:not(.has-bg-image):not(.has-bg-gradient) body,
body.theme-light:not(.has-bg-image):not(.has-bg-gradient) {
  background-image: none !important;
}

html[data-theme="light"].has-bg-image,
body[data-theme="light"].has-bg-image,
html[data-theme="light"] body.has-bg-image,
html.theme-light.has-bg-image,
body.theme-light.has-bg-image,
html.theme-light body.has-bg-image {
  background-color: #ffffff !important;
  background-image: var(--app-bg-image) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  filter: none !important;
}

html[data-theme="light"] .card,
body[data-theme="light"] .card,
html.theme-light .card,
body.theme-light .card {
  border: 1px solid #e4e4e4;
  box-shadow: none;
}

html[data-theme="light"] .search-box {
  background: #f6f6f6;
  border-color: #e4e4e4;
  color: #5c5c5c;
}

html[data-theme="light"] .search-box:focus-within {
  background: #ffffff;
  border-color: #7852ee;
  color: #7852ee;
  box-shadow: 0 0 0 1px #7852ee;
}

html[data-theme="light"] .search-box input {
  color: #222222;
}

html[data-theme="light"] .search-box input::placeholder {
  color: #5c5c5c;
}

html[data-theme="light"] .search-dropdown {
  background: #ffffff;
  border-color: #e4e4e4;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .search-dropdown__item:hover,
html[data-theme="light"] .search-dropdown__item.is-selected {
  background: #f4f2fd;
}

html[data-theme="light"] .search-dropdown__item.is-selected {
  outline-color: #7852ee;
}

html[data-theme="light"] .search-dropdown__display-name {
  color: #1a1a1a;
}

html[data-theme="light"] .search-dropdown__username {
  color: #6c6c6c;
}

html[data-theme="light"] .search-dropdown__about {
  color: #555555;
}

html[data-theme="light"] .search-dropdown__empty,
html[data-theme="light"] .search-dropdown__loading,
html[data-theme="light"] .search-dropdown__error {
  color: #666666;
}

html[data-theme="light"] .btn-icon {
  background: #fafafa;
  border-color: #e4e4e4;
  color: #222222;
}

html[data-theme="light"] .btn-icon:hover {
  background: #efefef;
  border-color: #d0d0d0;
  color: #222222;
}

html[data-theme="light"] .nav-item:hover:not(:disabled):not(.nav-item--disabled),
html[data-theme="light"] .action-row:hover:not(:disabled) {
  background: #efefef;
  color: #222222;
}

html[data-theme="light"] .nav-item.active {
  background: #f0ebff;
  color: #5b39c4;
  border-color: rgba(120, 82, 238, 0.25);
}

html[data-theme="light"] .btn-primary:hover:not(:disabled) {
  background: #6941d8;
}

html[data-theme="light"] .btn-ghost:hover:not(:disabled) {
  background: #efefef;
  color: #222222;
}

/* Default profile banner for light theme */
html[data-theme="light"] .profile-banner:not(.profile-banner--image),
body[data-theme="light"] .profile-banner:not(.profile-banner--image),
html.theme-light .profile-banner:not(.profile-banner--image),
body.theme-light .profile-banner:not(.profile-banner--image) {
  background:
    linear-gradient(105deg, rgba(240, 235, 255, 0.7) 30%, rgba(246, 246, 246, 0.9) 100%),
    linear-gradient(135deg, #efefef 0%, #e4e4e4 52%, #f6f6f6 100%);
}

html[data-theme="light"] .profile-banner:not(.profile-banner--image)::after,
body[data-theme="light"] .profile-banner:not(.profile-banner--image)::after,
html.theme-light .profile-banner:not(.profile-banner--image)::after,
body.theme-light .profile-banner:not(.profile-banner--image)::after {
  display: none;
}

html[data-theme="light"] .skill-pill,
html[data-theme="light"] .interest-pill,
body[data-theme="light"] .skill-pill,
body[data-theme="light"] .interest-pill,
html[data-theme="light"] .aside-panel .interest-pill,
body[data-theme="light"] .aside-panel .interest-pill,
html[data-theme="light"] .pathway-tag-pill,
body[data-theme="light"] .pathway-tag-pill,
html[data-theme="light"] .pathway-skill-chip,
body[data-theme="light"] .pathway-skill-chip {
  color: #5b39c4 !important;
  background: #f0ebff !important;
  border: 1px solid rgba(139, 108, 246, 0.25) !important;
  font-family: var(--font) !important;
  font-weight: 500 !important;
  font-variation-settings: "wght" 500;
}

html[data-theme="light"] .text-venture-muted {
  color: var(--text-muted) !important;
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .field select,
html[data-theme="light"] .input,
html[data-theme="light"] .select {
  background: #ffffff;
  border-color: #e4e4e4;
  color: #222222;
}

html[data-theme="light"] .field input:focus,
html[data-theme="light"] .field textarea:focus,
html[data-theme="light"] .field select:focus,
html[data-theme="light"] .input:focus,
html[data-theme="light"] .select:focus {
  border-color: #7852ee;
  box-shadow: 0 0 0 1px #7852ee;
}

html[data-theme="light"] .input::placeholder {
  color: #5c5c5c;
}

html[data-theme="light"] .select option {
  background: #ffffff;
  color: #222222;
}

html[data-theme="light"] .toast {
  background: #fafafa;
  border-color: #e4e4e4;
  color: #222222;
  box-shadow: none;
}

html[data-theme="light"] .level-picker__value {
  background: #ffffff;
  border-color: #e4e4e4;
  color: #222222;
}

html[data-theme="light"] .level-picker__menu {
  background: #ffffff;
  border-color: #e4e4e4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .level-picker__option:hover,
html[data-theme="light"] .level-picker__option.is-selected {
  background: #efefef;
}

html[data-theme="light"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] .modal-backdrop--blur {
  background: rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .modal {
  background: #fafafa;
  border-color: #e4e4e4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .bg-option {
  border-color: #e4e4e4;
  background: #fafafa;
}

html[data-theme="light"] .bg-option:hover {
  border-color: #d0d0d0;
}

html[data-theme="light"] .bg-option__meta {
  background: #fafafa;
}

html[data-theme="light"] .bg-option__preview--default {
  background-image: linear-gradient(180deg, #ffffff, #fafafa);
  border-bottom: 1px solid #e4e4e4;
}

html[data-theme="light"] .panel-style-option {
  border-color: #e4e4e4;
}

html[data-theme="light"] .panel-style-option:hover {
  border-color: #d0d0d0;
}

html[data-theme="light"] .panel-style-option__preview--solid {
  background: #ffffff;
  border-color: #e4e4e4;
}

html[data-theme="light"] .panel-style-option__preview--solid .panel-style-option__preview-inner {
  background: #f6f6f6;
  border-color: #d0d0d0;
}

/* Light theme defaults (solid panels) */
html[data-theme="light"],
html.theme-light,
body[data-theme="light"],
body.theme-light {
  --bg-elevated: #fafafa;
  --bg-hover: #efefef;
}

html[data-theme="light"].panels-solid,
html.theme-light.panels-solid {
  --bg-elevated: #fafafa;
  --bg-hover: #efefef;
}

html[data-theme="light"].panels-outline,
html.theme-light.panels-outline {
  --bg-elevated: transparent;
  --bg-hover: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"].panels-glass,
html.theme-light.panels-glass {
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --bg-hover: rgba(255, 255, 255, 0.88);
}

/* Light + solid */
html[data-theme="light"].panels-solid .card,
html[data-theme="light"].panels-solid .auth-card,
html[data-theme="light"].panels-solid .modal,
html[data-theme="light"].panels-solid .achievement-card,
html[data-theme="light"].panels-solid .bg-option,
html[data-theme="light"].panels-solid .toast,
html[data-theme="light"].panels-solid .search-box,
html[data-theme="light"].panels-solid .btn-icon,
html.theme-light.panels-solid .card,
html.theme-light.panels-solid .auth-card,
html.theme-light.panels-solid .modal,
html.theme-light.panels-solid .achievement-card,
html.theme-light.panels-solid .bg-option,
html.theme-light.panels-solid .toast {
  background: #fafafa;
  border-color: #e4e4e4;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"].panels-solid .bg-option__meta,
html.theme-light.panels-solid .bg-option__meta {
  background: #fafafa;
  border-top: 1px solid #e4e4e4;
}

html[data-theme="light"].panels-solid .field input,
html[data-theme="light"].panels-solid .field textarea,
html[data-theme="light"].panels-solid .field select,
html[data-theme="light"].panels-solid .input,
html[data-theme="light"].panels-solid .select,
html[data-theme="light"].panels-solid .explore-search-box,
html.theme-light.panels-solid .field input,
html.theme-light.panels-solid .field textarea,
html.theme-light.panels-solid .field select,
html.theme-light.panels-solid .input,
html.theme-light.panels-solid .select,
html.theme-light.panels-solid .explore-search-box {
  background: #ffffff;
  border-color: #e4e4e4;
  color: #222222;
}

/* Light + outline */
html[data-theme="light"].panels-outline .card,
html[data-theme="light"].panels-outline .auth-card,
html[data-theme="light"].panels-outline .modal,
html[data-theme="light"].panels-outline .achievement-card,
html[data-theme="light"].panels-outline .bg-option,
html[data-theme="light"].panels-outline .toast,
html[data-theme="light"].panels-outline .search-box,
html[data-theme="light"].panels-outline .btn-icon,
html.theme-light.panels-outline .card,
html.theme-light.panels-outline .auth-card,
html.theme-light.panels-outline .modal,
html.theme-light.panels-outline .achievement-card,
html.theme-light.panels-outline .bg-option,
html.theme-light.panels-outline .toast {
  background: transparent;
  border-color: #e4e4e4;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

html[data-theme="light"].panels-outline .bg-option__meta,
html.theme-light.panels-outline .bg-option__meta {
  background: transparent;
  border-top: 1px solid #e4e4e4;
}

html[data-theme="light"].panels-outline .field input,
html[data-theme="light"].panels-outline .field textarea,
html[data-theme="light"].panels-outline .field select,
html[data-theme="light"].panels-outline .input,
html[data-theme="light"].panels-outline .select,
html[data-theme="light"].panels-outline .explore-search-box,
html.theme-light.panels-outline .field input,
html.theme-light.panels-outline .field textarea,
html.theme-light.panels-outline .field select,
html.theme-light.panels-outline .input,
html.theme-light.panels-outline .select,
html.theme-light.panels-outline .explore-search-box {
  background: transparent;
  border-color: #e4e4e4;
  color: #222222;
}

html[data-theme="light"].panels-outline .btn-ghost:hover:not(:disabled),
html[data-theme="light"].panels-outline .action-row:hover:not(:disabled),
html[data-theme="light"].panels-outline .nav-item:hover:not(:disabled):not(.nav-item--disabled),
html.theme-light.panels-outline .btn-ghost:hover:not(:disabled),
html.theme-light.panels-outline .action-row:hover:not(:disabled),
html.theme-light.panels-outline .nav-item:hover:not(:disabled):not(.nav-item--disabled) {
  background: rgba(0, 0, 0, 0.04);
  color: #222222;
}

html[data-theme="light"].panels-outline .nav-item.active,
html.theme-light.panels-outline .nav-item.active {
  background: #f0ebff;
  color: #5b39c4;
  border-color: rgba(120, 82, 238, 0.25);
}

/* Light + glass */
html[data-theme="light"].panels-glass .card,
html[data-theme="light"].panels-glass .auth-card,
html[data-theme="light"].panels-glass .modal,
html[data-theme="light"].panels-glass .achievement-card,
html[data-theme="light"].panels-glass .bg-option,
html[data-theme="light"].panels-glass .toast,
html[data-theme="light"].panels-glass .search-box,
html[data-theme="light"].panels-glass .btn-icon,
html.theme-light.panels-glass .card,
html.theme-light.panels-glass .auth-card,
html.theme-light.panels-glass .modal,
html.theme-light.panels-glass .achievement-card,
html.theme-light.panels-glass .bg-option,
html.theme-light.panels-glass .toast {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(228, 228, 228, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
}

html[data-theme="light"].panels-glass .bg-option__meta,
html.theme-light.panels-glass .bg-option__meta {
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid #e4e4e4;
}

html[data-theme="light"].panels-glass .field input,
html[data-theme="light"].panels-glass .field textarea,
html[data-theme="light"].panels-glass .field select,
html[data-theme="light"].panels-glass .input,
html[data-theme="light"].panels-glass .select,
html[data-theme="light"].panels-glass .explore-search-box,
html.theme-light.panels-glass .field input,
html.theme-light.panels-glass .field textarea,
html.theme-light.panels-glass .field select,
html.theme-light.panels-glass .input,
html.theme-light.panels-glass .select,
html.theme-light.panels-glass .explore-search-box {
  background: rgba(255, 255, 255, 0.7);
  border-color: #e4e4e4;
  color: #222222;
}

html[data-theme="light"].panels-glass .theme-choice-btn,
html[data-theme="light"].panels-glass .topbar-profile-btn,
html[data-theme="light"].panels-glass .topbar-avatar-btn,
html.theme-light.panels-glass .theme-choice-btn,
html.theme-light.panels-glass .topbar-profile-btn,
html.theme-light.panels-glass .topbar-avatar-btn {
  background: rgba(255, 255, 255, 0.72);
  border-color: #e4e4e4;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-theme="light"] .btn-ghost:hover:not(:disabled),
html[data-theme="light"] .action-row:hover:not(:disabled),
html[data-theme="light"] .nav-item:hover:not(:disabled):not(.nav-item--disabled) {
  background: var(--bg-hover);
  color: #222222;
}

html[data-theme="light"] .nav-item.active {
  background: #f0ebff;
  color: #5b39c4;
  border-color: rgba(120, 82, 238, 0.25);
}

html[data-theme="light"] .bg-option__preview--image::after {
  display: none;
}

/* Theme toggle button styling & smooth transitions */
.theme-toggle {
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  transform: rotate(18deg) scale(1.08);
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle:active {
  transform: scale(0.92);
}

/* ==========================================================================
   Notifications Page & Badge Styles
   ========================================================================== */

.nav-badge {
  margin-left: auto;
  padding: 0.12rem 0.48rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  line-height: 1.3;
  min-width: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(139, 108, 246, 0.45);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-badge--hidden {
  display: none !important;
}

.notifications-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.notifications-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
}

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

.notifications-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.05);
}

.notif-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notif-tab:hover {
  color: var(--text);
}

.notif-tab.is-active {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.notif-tab-badge {
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--border-strong);
  color: var(--text);
  line-height: 1.3;
}

.notif-tab.is-active .notif-tab-badge {
  background: var(--accent);
  color: #fff;
}

.notifications-list {
  display: flex;
  flex-direction: column;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
  text-align: left;
  width: 100%;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--bg-hover);
}

.notification-item.is-unread {
  background: rgba(139, 108, 246, 0.07);
}

.notification-item.is-unread:hover {
  background: rgba(139, 108, 246, 0.14);
}

.notif-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.notif-type-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated);
}

.notif-type-badge--like {
  background: #ef4444;
  color: #fff;
}

.notif-type-badge--like svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.notif-type-badge--follow {
  background: var(--accent);
  color: #fff;
}

.notif-type-badge--follow svg {
  width: 10px;
  height: 10px;
}

.notif-content {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.notif-actor-name {
  font-weight: 600;
  color: var(--text);
}

.notif-actor-name:hover {
  text-decoration: underline;
}

.notif-text {
  color: var(--text-muted);
}

.notif-time {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

.notif-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 0.55rem;
  box-shadow: 0 0 8px rgba(139, 108, 246, 0.65);
}

.notifications-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  gap: 0.85rem;
}

.notifications-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.notifications-empty-icon svg {
  width: 28px;
  height: 28px;
}

.notifications-empty-title {
  font-weight: 600;
  color: var(--text);
  font-size: 1.05rem;
}

.notifications-empty-desc {
  font-size: 0.88rem;
  max-width: 280px;
  line-height: 1.45;
  color: var(--text-dim);
}

.post-card--highlight {
  animation: postHighlight 2.5s ease-out;
}

@keyframes postHighlight {
  0% {
    box-shadow: 0 0 0 3px var(--accent), 0 0 24px rgba(139, 108, 246, 0.55);
    border-color: var(--accent);
  }
  70% {
    box-shadow: 0 0 0 3px var(--accent), 0 0 24px rgba(139, 108, 246, 0.55);
    border-color: var(--accent);
  }
  100% {
    box-shadow: none;
    border-color: var(--border);
  }
}

/* ==========================================================================
   Comments Section & Tree
   ========================================================================== */

.post-comments-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: var(--bg-raised);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.comment-reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--accent);
}

.comment-reply-banner button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0 0.25rem;
  font-size: 1rem;
  line-height: 1;
}

.comment-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 60px;
  max-height: 180px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.comment-char-counter {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.comment-char-counter.is-near-limit {
  color: #f59e0b;
}

.comment-char-counter.is-over-limit {
  color: #f87171;
}

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

.comment-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}

.comment-item.comment-item--deleted {
  background: var(--bg);
  border-style: dashed;
  opacity: 0.75;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.comment-author--deleted {
  color: var(--text-dim);
  font-style: italic;
  cursor: default;
}

.comment-time {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.comment-content {
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.comment-content--deleted {
  color: var(--text-dim);
  font-style: italic;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.2rem;
}

.comment-btn-action {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.comment-btn-action:hover {
  color: var(--accent);
  background: rgba(139, 92, 246, 0.08);
}

.comment-btn-action--danger:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.comments-more-btn {
  margin-top: 0.75rem;
  width: 100%;
  font-size: 0.85rem;
  padding: 0.45rem;
}

.profile-more-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 195px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  padding: 0.35rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dropdown-menu[hidden] {
  display: none !important;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item--danger {
  color: #f87171;
}

.dropdown-item--danger:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #ef4444;
}

/* Moderation user cards */
.mod-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.mod-user-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.mod-user-box__badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mod-user-box__badge--target {
  color: #f87171;
}

.mod-user-box__badge--reporter {
  color: var(--text-muted);
}

.mod-user-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-subtle, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.mod-user-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.mod-user-card__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.mod-user-card__names {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mod-user-card__display-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mod-user-card__username {
  font-size: 0.8rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mod-user-card__arrow {
  margin-left: auto;
  opacity: 0.4;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--text-dim);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.mod-user-card:hover .mod-user-card__arrow {
  opacity: 1;
  color: var(--accent);
  transform: translate(2px, -2px);
}

.mod-user-card--disabled {
  opacity: 0.7;
  pointer-events: none;
  cursor: default;
}

.mod-target-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  background: var(--bg-subtle, rgba(255, 255, 255, 0.02));
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  margin-top: 0.25rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mod-target-meta code {
  font-family: var(--font-code, monospace);
  font-size: 0.78rem;
  background: var(--bg-hover);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: var(--text);
}



/* Pathways & Skill Tree Styles */
.pathways-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.pathway-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.pathway-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.pathway-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pathway-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pathway-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.pathway-card__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pathway-card__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-paused {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-completed {
  background: rgba(139, 108, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 108, 246, 0.3);
}

.badge-type {
  background: var(--bg-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Icon Picker styling */
.icon-picker-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface, var(--bg-raised));
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-picker-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.icon-picker-btn.is-active {
  border: 2px solid var(--accent);
  background: var(--accent-soft, rgba(99, 102, 241, 0.15));
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.icon-picker-btn .icon-picker__check {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-picker-btn.is-active .icon-picker__check {
  display: flex;
}

/* Pathway Skill Tag Chips */
.pathway-skills-manager {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pathway-skills-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 28px;
}

.pathway-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background: var(--bg-surface, var(--bg-raised));
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
}

.pathway-skill-chip__remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: color 0.15s ease;
}

.pathway-skill-chip__remove:hover {
  color: var(--danger, #ef4444);
}

/* Profile Rank Badge (next to Full Name) */
.profile-rank-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--tag-bg);
  color: var(--accent-text);
  border: 1px solid var(--border);
  line-height: 1.25;
  vertical-align: middle;
}

/* Pathway Tag Pills (rounded contour / badge style, no '#') */
.pathway-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--tag-bg);
  color: var(--accent-text);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  line-height: 1.25;
}

/* Skill Tree Canvas */
.skill-tree-viewport {
  position: relative;
  width: 100%;
  height: 580px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle, var(--border) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg-elevated);
  overflow: hidden;
  user-select: none;
  cursor: grab;
}

.skill-tree-viewport:active {
  cursor: grabbing;
}

.skill-tree-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 4000px;
  height: 4000px;
  transform-origin: 0 0;
  will-change: transform;
}

.skill-tree-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.tree-edge-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-dasharray: 4 2;
  animation: edgeDash 20s linear infinite;
}

@keyframes edgeDash {
  to {
    stroke-dashoffset: -200;
  }
}

.tree-node-card {
  position: absolute;
  box-sizing: border-box;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tree-node-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 108, 246, 0.25);
}

.tree-node-card.selected {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
}

.tree-node-card--info-only {
  cursor: default !important;
}

.tree-node-card--info-only:hover {
  transform: none !important;
}

.tree-node-card--root {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}

.tree-node-card--pathway {
  border-left: 4px solid var(--accent);
}

.profile-stat-btn {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.35rem;
  margin: -0.15rem -0.35rem;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.profile-stat-btn:hover {
  background: var(--bg-hover);
  text-decoration: underline;
}

.connection-row {
  transition: background-color 0.15s ease;
}

.connection-row:hover {
  background: var(--bg-hover) !important;
}

/* Leaders View */
.leader-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.leader-item:hover {
  background-color: var(--bg-hover);
  border-color: var(--border);
}

.leader-item__rank {
  min-width: 2.4rem;
  text-align: center;
  font-weight: 700;
}

.leader-item__score {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tree-node-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.tree-node-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tree-toolbar {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Timeline Mode */
.milestone-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding: 1rem 0 1rem 2rem;
  margin-top: 1rem;
}

.milestone-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.75rem;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 1.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}

/* Explore: Tags, Match Badge, and Cards */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  line-height: 1.25;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tag-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.tag-pill.tag-pill--accent {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--border);
}

.badge-match {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
}

.explore-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.explore-card:hover {
  border-color: var(--border-strong);
}

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

.explore-search-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  color: var(--text-dim);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.explore-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  color: var(--accent);
}

.explore-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 0;
}

.explore-search-box input::placeholder {
  color: var(--text-dim);
}

html[data-theme="light"] .explore-search-box {
  background: #ffffff;
  border-color: #e4e4e4;
  color: #5c5c5c;
}

html[data-theme="light"] .explore-search-box:focus-within {
  border-color: #7852ee;
  box-shadow: 0 0 0 1px #7852ee;
  color: #7852ee;
}

html[data-theme="light"] .explore-search-box input {
  color: #222222;
}

html[data-theme="light"] .explore-search-box input::placeholder {
  color: #5c5c5c;
}

/* ==========================================================================
   Communities & Direct Messages
   ========================================================================== */
.messages-layout {
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.conv-item {
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.conv-item:hover {
  background-color: var(--bg-hover) !important;
}

.conv-item.active {
  background-color: var(--bg-hover) !important;
  border-left: 3px solid var(--accent);
}

.chat-messages-container {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.chat-messages-container::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 3px;
}

.community-card-interactive {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.community-card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

@media (max-width: 900px) {
  .explore-layout {
    flex-direction: column-reverse !important;
  }
  .explore-filters-sidebar {
    width: 100% !important;
    position: static !important;
  }
}


