:root {
  color-scheme: dark;
  --bg: #101214;
  --surface: #171a1e;
  --surface-2: #1f2429;
  --surface-3: #262c33;
  --line: #343b43;
  --text: #f2f0e8;
  --muted: #aeb6bd;
  --soft: #d5d0c3;
  --accent: #c77ae3;
  --accent-2: #fff0dd;
  --accent-3: #7d3fa0;
  --info: #d6a5ef;
  --ok: #c77ae3;
  --warn: #f0c7ff;
  --danger: #ef8fa8;
  --accent-rgb: 199, 122, 227;
  --accent-2-rgb: 255, 240, 221;
  --accent-3-rgb: 125, 63, 160;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --avatar-viewer-side: 23rem;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-story: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
}

body {
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.1), transparent 34rem),
    radial-gradient(circle at top right, rgba(var(--accent-3-rgb), 0.16), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

html.is-avatar-modal-open,
html.is-avatar-modal-open body,
body.is-avatar-modal-open {
  height: 100%;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

.fa-solid,
.fa-regular,
.fa-brands {
  line-height: 1;
}

.liria-fa {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1rem;
  text-align: center;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2rem);
  align-items: center;
  justify-items: center;
}

.app-shell {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
}

.app-shell.is-chat-view {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 0;
}

.app-shell.is-chat-view .sidebar {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1rem;
  border-right: 1px solid var(--line);
  background: rgba(16, 18, 20, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.72rem;
  align-items: center;
  min-height: 2.6rem;
  color: var(--text);
  text-decoration: none;
}

.brand strong {
  display: block;
  font-size: 1.28rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
}

.brand-mark img {
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
}

.nav-list {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.4rem;
}

.nav-item {
  min-width: 0;
}

.nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.7rem;
  align-items: center;
  min-height: 2.7rem;
  padding: 0 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--soft);
  text-decoration: none;
}

.nav-link .liria-fa,
.topbar .liria-fa,
.icon-button .liria-fa,
.primary-action .liria-fa,
.secondary-action .liria-fa,
.ghost-action .liria-fa,
.danger-action .liria-fa,
.chip .liria-fa,
.tag .liria-fa,
.meta .liria-fa {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 1.02rem;
}

.nav-link:hover,
.nav-link.is-active {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

.nav-subgroup {
  display: none;
  gap: 0.15rem;
  margin: 0.2rem 0 0.45rem 2.35rem;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item.is-open .nav-subgroup {
  display: grid;
}

.nav-sub-link {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  width: 100%;
  padding: 0.35rem 0.55rem;
  border-radius: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.nav-sub-link:hover,
.nav-sub-link.is-active {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.nav-item.has-subnav .nav-link::after {
  content: "v";
  color: var(--muted);
  font-size: 0.72rem;
  transition: transform 0.16s ease;
}

.nav-item.has-subnav.is-open .nav-link::after {
  transform: rotate(180deg);
}

.nav-badge {
  min-width: 1.55rem;
  padding: 0.12rem 0.45rem;
  border-radius: 99px;
  background: rgba(var(--accent-2-rgb), 0.16);
  color: var(--accent-2);
  font-size: 0.72rem;
  text-align: center;
}

.nav-item.is-more,
.mobile-more-nav {
  display: none;
}

.identity-card {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.2rem;
  gap: 0.7rem;
  align-items: center;
  margin-top: auto;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.identity-card strong,
.identity-card span {
  display: block;
}

.identity-card strong {
  font-size: 0.9rem;
}

.identity-card span {
  color: var(--accent);
  font-size: 0.78rem;
}

.active-identity-banner {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.2rem;
  gap: 0.7rem;
  align-items: center;
  margin-top: auto;
  padding: 0.8rem;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.1);
}

.active-identity-banner strong,
.active-identity-banner span {
  display: block;
}

.active-identity-banner strong {
  font-size: 0.9rem;
}

.active-identity-banner span {
  color: var(--accent);
  font-size: 0.78rem;
}

.mini-avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 800;
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar {
  background: linear-gradient(135deg, #45676b, #7c5d42);
}

.main-area {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-width: 0;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 18, 20, 0.82);
  backdrop-filter: blur(18px);
}

.topbar-left {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: start;
  min-width: 0;
}

.topbar-left .search-wrap {
  flex: 1 1 auto;
  min-width: 12rem;
  max-width: 36rem;
}

.topbar-left .primary-action {
  flex: none;
  min-width: max-content;
  white-space: nowrap;
}

a.topbar-brand {
  display: none;
  flex: none;
}

.app-shell.is-chat-view a.topbar-brand {
  display: grid;
}

.search-wrap {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.7rem;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-wrap input::placeholder {
  color: #7e878d;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.icon-button,
.primary-action,
.secondary-action,
.ghost-action,
.segmented button,
.segmented a,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
}

.icon-button {
  position: relative;
  width: 2.35rem;
  padding: 0;
}

.topbar-user-menu {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.topbar-avatar-button {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.topbar-avatar-button:hover,
.topbar-avatar-button:focus-visible,
.topbar-avatar-button[aria-expanded="true"] {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.12);
}

.topbar-avatar-button .mini-avatar {
  width: 2.1rem;
  height: 2.1rem;
}

.topbar-profile-menu {
  position: fixed;
  top: 3.65rem;
  right: 0.85rem;
  left: auto;
  width: min(22rem, calc(100vw - 1.7rem));
  max-height: calc(100vh - 4.4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.account-menu-popover {
  gap: 0.42rem;
  padding: 0.72rem;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  background: #242526;
  box-shadow: 0 1.3rem 2.8rem rgba(0, 0, 0, 0.42);
}

.avatar-profile-menu.topbar-profile-menu {
  position: fixed;
  top: 3.65rem;
  right: 0.85rem;
  left: auto;
  width: min(22rem, calc(100vw - 1.7rem));
}

.account-profile-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem;
  border-radius: 0.72rem;
  background: #242526;
  box-shadow: 0 0.45rem 1rem rgba(0, 0, 0, 0.22);
}

.account-profile-row,
.account-menu-row {
  display: grid;
  grid-template-columns: 2.45rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: #e4e6eb;
  text-align: left;
  text-decoration: none;
}

.account-profile-row:hover,
.account-profile-row:focus-visible,
.account-menu-row:hover,
.account-menu-row:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.account-profile-row + .account-profile-row {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
}

.account-profile-row .avatar {
  width: 2.25rem;
  height: 2.25rem;
}

.account-profile-row strong,
.account-menu-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.account-all-profiles {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  margin-top: 0.38rem;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.1);
  color: #e4e6eb;
  font-weight: 850;
  text-decoration: none;
}

.account-all-profiles:hover,
.account-all-profiles:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.account-menu-row {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.3rem 0.25rem;
  font: inherit;
  font-weight: 850;
}

.account-menu-row > span {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: #3a3b3c;
}

.account-menu-row > .liria-fa:last-child,
.account-menu-row > svg:last-child {
  color: #b0b3b8;
}

.account-menu-footer {
  padding: 0.25rem 0.15rem 0;
  color: #b0b3b8;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.35;
}

.avatar-profile-menu a {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: start;
  min-height: 2.35rem;
  padding: 0 0.55rem;
  border-radius: var(--radius);
  color: #e4e6eb;
  font-weight: 850;
  text-decoration: none;
}

.avatar-profile-menu a:hover,
.avatar-profile-menu a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.notification-count {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  display: grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.32rem;
  border: 2px solid var(--bg);
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.primary-action {
  padding: 0 0.9rem;
  border-color: rgba(var(--accent-rgb), 0.5);
  background: var(--accent);
  color: #18091f;
  font-weight: 800;
}

.secondary-action {
  padding: 0 0.8rem;
  background: rgba(255, 255, 255, 0.05);
}

.ghost-action {
  padding: 0 0.75rem;
  background: transparent;
  color: var(--muted);
}

.content-shell {
  width: min(100%, 82rem);
  max-width: 100%;
  margin: 0 auto;
  padding: 1.6rem;
}

.app-shell.is-chat-view .content-shell {
  width: 100%;
  max-width: 100%;
  padding: 1rem 1.2rem;
}

.view-header {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 4.5rem;
  margin-bottom: 1.1rem;
}

.view-header h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  letter-spacing: 0;
}

.chat-header-brand {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.72rem;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.chat-header-brand strong {
  display: block;
  font-size: 1.28rem;
}

.chat-header-brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.eyebrow {
  margin: 0 0 0.32rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.profile-view-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  min-width: min(100%, 34rem);
}

.profile-control-spacer {
  flex: 1 1 auto;
}

.profile-logout-action {
  margin-left: auto;
}

.view-content {
  min-width: 0;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.post-card,
.profile-hero,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 30, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.panel {
  padding: 1rem;
}

.panel-title {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.metric {
  min-height: 6.2rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.metric:hover,
.metric:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.12);
}

.secondary-action.is-active {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
}

.metric strong {
  display: block;
  font-size: 1.65rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
}

.feed-list {
  display: grid;
  gap: 0.85rem;
}

.scenes-page {
  align-content: start;
}

.scenes-workbench {
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr) minmax(17rem, 21rem);
  gap: 0.85rem;
  align-items: start;
}

.scene-queue-panel,
.scene-inbox-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.scene-queue-panel {
  position: sticky;
  top: 4.8rem;
  padding: 0.72rem;
}

.scene-queue-head {
  display: grid;
  gap: 0.18rem;
  margin-bottom: 0.7rem;
}

.scene-queue-head h2 {
  margin: 0;
  font-size: 1rem;
}

.scene-queue-head span,
.scene-inbox-toolbar span {
  color: var(--muted);
  font-size: 0.8rem;
}

.scene-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.scene-tabs.is-vertical {
  display: grid;
  gap: 0.38rem;
  margin-bottom: 0;
}

.scene-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.scene-tabs.is-vertical a {
  justify-content: space-between;
  width: 100%;
}

.scene-tabs a:hover,
.scene-tabs a:focus-visible,
.scene-tabs a.is-active {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

.scene-inbox-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.scene-inbox-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 0.82rem;
  border-bottom: 1px solid var(--line);
}

.scene-inbox-toolbar div {
  display: grid;
  gap: 0.12rem;
}

.scene-inbox-list {
  display: grid;
}

.scene-inbox-row {
  display: grid;
  grid-template-columns: minmax(8rem, 10rem) minmax(0, 1fr) minmax(8rem, 12rem) auto;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  padding: 0.78rem 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.scene-inbox-row:last-child {
  border-bottom: 0;
}

.scene-row-main {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.scene-row-main h3,
.scene-row-main p {
  margin: 0;
}

.scene-row-main h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
}

.scene-row-main p,
.scene-row-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.scene-row-meta {
  display: grid;
  gap: 0.28rem;
}

.scene-row-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

.scene-context-panel {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.scene-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0.72rem;
}

.scene-card {
  display: grid;
  gap: 0.72rem;
  align-content: start;
  min-width: 0;
  padding: 0.82rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.scene-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: start;
}

.scene-card h3 {
  margin: 0;
  font-size: 1rem;
}

.scene-card header span:not(.status-pill),
.scene-card p {
  color: var(--muted);
  font-size: 0.86rem;
}

.scene-card p {
  margin: 0;
}

.scene-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.feed-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  gap: 1rem;
  align-items: start;
}

.feed-list-compact {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  align-items: start;
}

.social-feed-chain {
  max-width: 48rem;
  width: 100%;
  justify-self: center;
}

.home-feed-list {
  width: min(100%, 48rem);
  margin-inline: auto;
}

.home-layout {
  align-items: start;
}

.home-side-panel {
  align-self: start;
}

.scene-feed-card .story-text {
  min-height: 0;
}

.scene-feed-avatar {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
}

.feed-summary-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.82rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 30, 0.92);
}

.feed-summary-head h2 {
  margin: 0;
  font-size: 1rem;
}

.feed-summary-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.feed-activity-list {
  display: grid;
  gap: 0.55rem;
}

.feed-activity-row {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) auto auto;
  gap: 0.72rem;
  align-items: center;
  min-width: 0;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 30, 0.92);
}

.feed-activity-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

.feed-activity-row strong,
.feed-activity-row p {
  margin: 0;
}

.feed-activity-row p,
.feed-activity-time {
  color: var(--muted);
  font-size: 0.82rem;
}

.feed-activity-row .tag-row {
  margin-top: 0.38rem;
}

.scene-featured-card {
  min-height: 28rem;
}

.feed-focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: 1rem;
  align-items: start;
}

.feed-focus-main {
  min-width: 0;
}

.feed-featured-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  gap: 1rem;
  align-items: start;
}

.feed-featured-callout {
  display: grid;
  gap: 0.95rem;
  min-height: 28rem;
  align-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(23, 26, 30, 0.96) 48%),
    rgba(23, 26, 30, 0.94);
}

.feed-featured-kicker {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feed-featured-callout h2 {
  max-width: 44rem;
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.65rem);
  line-height: 1.05;
}

.feed-featured-callout p {
  max-width: 48rem;
  margin: 0;
  color: var(--soft);
  font-family: var(--font-story);
  font-size: 1.1rem;
  line-height: 1.6;
}

.feed-featured-callout footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.featured-stack {
  display: grid;
  gap: 0.55rem;
}

.featured-mini-card {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  padding: 0.62rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
}

.featured-mini-card:hover {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: rgba(var(--accent-rgb), 0.1);
}

.featured-mini-action {
  grid-column: 2 / -1;
  justify-self: start;
  padding: 0.32rem 0.58rem;
  font-size: 0.78rem;
}

.featured-mini-action + .featured-mini-action {
  margin-top: -0.35rem;
}

.featured-details-card {
  width: min(34rem, calc(100vw - 2rem));
}

.featured-details-card .compact-list {
  gap: 0.55rem;
}

.featured-mini-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

.featured-mini-card strong,
.featured-mini-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-mini-card small {
  color: var(--muted);
  font-size: 0.76rem;
}

.post-card {
  padding: 1.1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.post-card.is-compact {
  min-height: 19rem;
}

.post-card.is-short-text {
  min-height: 0;
}

.post-card.is-compact .story-text {
  display: -webkit-box;
  min-height: 7.1rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.post-card.is-short-text .story-text {
  display: block;
  min-height: 0;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.42;
}

.post-card.is-compact .tag-row {
  max-height: 4.5rem;
  overflow: hidden;
}

.post-card.is-focus {
  padding: 1.15rem;
}

.post-card.is-highlighted {
  border-color: rgba(var(--accent-2-rgb), 0.72);
  box-shadow: 0 0 0 3px rgba(var(--accent-2-rgb), 0.18), var(--shadow);
}

.activity-switcher {
  display: grid;
  gap: 0.55rem;
}

.activity-option {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.activity-option strong,
.activity-option span {
  display: block;
}

.activity-option span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.activity-option:hover,
.activity-option.is-selected {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.1);
}

.post-head {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.post-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-self: end;
}

.post-menu {
  align-self: center;
}

.post-menu .comment-menu-popover {
  min-width: 12.5rem;
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-3), #3e474f);
  font-weight: 900;
}

.avatar::after {
  content: "";
  position: absolute;
  inset: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
}

.avatar img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.profile-hero .avatar.image-avatar {
  background: rgba(0, 0, 0, 0.28);
}

.profile-hero .avatar.image-avatar img {
  object-fit: cover;
  object-position: center center;
}

.avatar.seren {
  background: linear-gradient(135deg, #355b61, #d0a354);
}

.avatar.mael {
  background: linear-gradient(135deg, #3f4c6c, #9c6e51);
}

.avatar.nera {
  background: linear-gradient(135deg, #72505a, #4a8071);
}

.avatar.noam {
  background: linear-gradient(135deg, #5b6543, #6f5a8a);
}

.post-author strong,
.post-author span,
.post-author .post-author-name {
  display: block;
}

.post-author strong,
.post-author .post-author-name {
  font-size: 0.95rem;
}

.post-author .post-author-name {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.post-author .post-author-name:hover {
  text-decoration: underline;
  color: var(--accent);
}

.post-author span {
  color: var(--muted);
  font-size: 0.8rem;
}

.status-pill,
.tag,
.privacy-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  color: var(--soft);
  font-size: 0.75rem;
  white-space: nowrap;
}

.status-pill.ok {
  border-color: rgba(134, 199, 121, 0.4);
  color: var(--ok);
}

.status-pill.warn {
  border-color: rgba(var(--accent-2-rgb), 0.4);
  color: var(--warn);
}

.status-pill.info {
  border-color: rgba(134, 168, 220, 0.45);
  color: var(--info);
}

.status-pill.danger {
  border-color: rgba(239, 125, 125, 0.45);
  color: var(--danger);
}

.story-text {
  margin: 0.7rem 0;
  color: #ede7da;
  font-family: var(--font-story);
  font-size: 1.05rem;
  line-height: 1.72;
  white-space: pre-wrap;
}

.post-story-block {
  display: grid;
  gap: 0.12rem;
  margin: 0.55rem 0 0.65rem;
}

.post-card.is-short-text .post-story-block {
  margin: 0.65rem 0 0.55rem;
}

.post-story-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-see-more {
  justify-self: start;
  min-height: 1.55rem;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
  padding: 0;
}

.post-see-more:hover,
.post-see-more:focus-visible {
  color: var(--accent-2);
  text-decoration: underline;
}

.post-meta,
.tag-row,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.post-meta {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.post-interact {
  min-height: 1.9rem;
  padding: 0 0.6rem;
  font-size: 0.78rem;
}

.post-image-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  max-height: 42rem;
  margin: 0.75rem auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  background: #000;
  padding: 0;
  cursor: zoom-in;
  box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.35);
}

.post-image-button img {
  display: block;
  max-width: 100%;
  max-height: 42rem;
  width: auto;
  height: auto;
  border-radius: inherit;
  object-fit: contain;
  object-position: center center;
}

.post-media-collage {
  display: grid;
  gap: 0.12rem;
  width: 100%;
  height: clamp(18rem, 44vw, 34rem);
  margin: 0.75rem 0;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background: #000;
}

.post-media-collage.is-count-1 {
  height: clamp(16rem, 38vw, 30rem);
}

.post-media-collage.is-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-media-collage.is-count-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.post-media-collage.is-count-3 .post-collage-item:first-child {
  grid-row: 1 / 3;
}

.post-media-collage.is-count-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.post-media-collage.is-count-5 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.post-media-collage.is-count-5 .post-collage-item:nth-child(1),
.post-media-collage.is-count-5 .post-collage-item:nth-child(2) {
  grid-column: span 3;
}

.post-media-collage.is-count-5 .post-collage-item:nth-child(n + 3) {
  grid-column: span 2;
}

.post-collage-item {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #000;
  padding: 0;
  color: #fff;
  cursor: zoom-in;
}

.post-collage-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.post-collage-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
}

.group-post-album-strip {
  position: absolute;
  z-index: 5;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.35rem;
  max-width: min(52rem, calc(100vw - var(--avatar-viewer-side) - 3rem));
  margin: 0 auto;
  padding: 0.4rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.8rem;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  scrollbar-color: transparent transparent;
  transition: opacity 0.18s ease, scrollbar-color 0.18s ease;
}

.avatar-photo-container:hover .group-post-album-strip,
.group-post-album-strip:hover,
.group-post-album-strip.is-scrolling,
.group-post-album-strip:focus-within {
  opacity: 1;
  scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.group-post-album-thumb {
  position: relative;
  flex: 0 0 4.6rem;
  width: 4.6rem;
  height: 4.6rem;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 0.55rem;
  background: #000;
  padding: 0;
  color: #fff;
}

.group-post-album-thumb.is-active {
  border-color: var(--accent);
}

.group-post-album-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-post-album-thumb span {
  position: absolute;
  right: 0.25rem;
  bottom: 0.2rem;
  display: grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.64);
  font-size: 0.68rem;
  font-weight: 900;
}

.group-edit-media-grid {
  margin: 0;
}

.group-edit-media-item {
  position: relative;
}

.group-edit-media-item .icon-button {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.9rem;
  height: 1.9rem;
  min-height: 1.9rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.68);
}

.group-edit-media-item.is-removed {
  display: none;
}

.post-card.is-compact .post-image-button {
  max-height: 32rem;
}

.post-card.is-compact .post-image-button img {
  max-height: 32rem;
}

.profile-post-list .post-image-button {
  max-height: 34rem;
}

.profile-post-list .post-image-button img {
  max-height: 34rem;
}

.post-comments {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.025);
}

.post-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.post-comments-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.post-comment-list {
  display: grid;
  gap: 0.55rem;
}

.post-comment {
  padding-bottom: 0.45rem;
}

.post-comment:last-child {
  padding-bottom: 0;
}

.post-comment-form,
.post-composer-form {
  display: grid;
  gap: 0.55rem;
}

.post-composer-form textarea,
.post-composer-form input,
.post-composer-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.post-composer-form textarea {
  min-height: 3.1rem;
  padding: 0.58rem 0.65rem;
  resize: vertical;
}

.post-comment-form textarea {
  width: 100%;
  min-height: 2.4rem;
  max-height: 8rem;
  padding: 0.6rem 0.85rem;
  border: 0;
  border-radius: 1.2rem;
  outline: 0;
  background: #3a3b3c;
  color: #e4e6eb;
  font: inherit;
  resize: none;
}

.post-comment-form textarea:focus {
  background: #43444a;
}

.post-comment-form textarea::placeholder {
  color: #b0b3b8;
}

.post-comment-form .comment-form-row {
  align-items: center;
}

.post-comment-form .primary-action {
  min-height: 2.05rem;
  justify-self: end;
}

.post-composer-author {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0;
}

.post-composer-author span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.compact-form-grid {
  gap: 0.7rem;
}

.post-upload-field {
  display: grid;
  gap: 0.35rem;
}

.post-image-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 18rem;
  max-height: 30rem;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-2-rgb), 0.35);
  border-radius: calc(var(--radius) - 2px);
  background: #000;
}

.post-image-preview[hidden] {
  display: none;
}

.post-image-preview img {
  display: block;
  max-width: 100%;
  max-height: 30rem;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
}

.post-preview-collage {
  width: 100%;
  height: 100%;
}

.post-image-preview .post-preview-grid {
  height: min(30rem, 56vh);
  margin: 0;
}

.post-image-preview .post-collage-item {
  cursor: default;
}

.post-edit-media-block {
  display: grid;
  gap: 0.55rem;
}

.post-edit-media-head,
.post-edit-media-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.post-edit-media-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.post-edit-preview {
  min-height: 11rem;
  max-height: 22rem;
}

.post-edit-preview .post-preview-grid {
  height: min(22rem, 42vh);
}

.post-edit-media-actions .secondary-action,
.post-edit-media-actions .ghost-action {
  min-height: 2.1rem;
  padding: 0 0.72rem;
  font-size: 0.8rem;
}

.post-preview-edit,
.post-preview-remove {
  position: absolute;
  z-index: 2;
}

.post-preview-edit {
  top: 0.8rem;
  left: 0.8rem;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
}

.post-preview-remove {
  top: 0.8rem;
  right: 0.8rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: rgba(15, 17, 20, 0.84);
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tag {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.tag.accent {
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
}

.tag.warn {
  border-color: rgba(var(--accent-2-rgb), 0.35);
  color: var(--accent-2);
}

.timeline-list,
.compact-list {
  display: grid;
  gap: 0.7rem;
}

.timeline-item,
.compact-item,
.compact-link,
.partner-item,
.scene-item,
.message-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.8rem;
}

.timeline-dot {
  width: 0.72rem;
  height: 0.72rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item strong,
.compact-item strong,
.compact-link strong,
.scene-item strong,
.partner-item strong {
  display: block;
}

.timeline-item span,
.compact-item span,
.compact-link span,
.scene-item span,
.partner-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-item,
.compact-link,
.partner-item,
.scene-item {
  padding: 0.8rem;
}

.compact-link {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.compact-link:hover,
.compact-link.is-selected {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.1);
}

.character-grid,
.community-grid,
.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.85rem;
}

.character-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.character-card,
.community-card,
.document-card {
  position: relative;
  display: grid;
  gap: 0.75rem;
  min-height: 16rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.1), transparent 55%),
    var(--surface);
}

.character-card-delete {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--danger);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  cursor: pointer;
  z-index: 1;
}

.character-card:hover .character-card-delete,
.character-card:focus-within .character-card-delete {
  opacity: 1;
}

.character-card-delete:hover {
  background: var(--danger, #e05260);
  color: #fff;
}

.document-card:has(.document-card-delete) {
  padding-right: 2.6rem;
}

.document-card-delete {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--danger, #e05260);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  cursor: pointer;
  z-index: 1;
}

.document-card:hover .document-card-delete,
.document-card:focus-within .document-card-delete {
  opacity: 1;
}

.document-card-delete:hover {
  background: var(--danger, #e05260);
  color: #fff;
}

.document-card {
  min-height: 12rem;
  color: var(--text);
  text-decoration: none;
}

.document-card p {
  margin: 0;
  color: var(--soft);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.document-card:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.16), transparent 55%),
    var(--surface);
}

.document-reader {
  max-width: 58rem;
}

.document-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(58rem, 100%);
  height: min(46rem, calc(100vh - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

.document-modal-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.modal-backdrop.avatar-modal-backdrop {
  z-index: 90;
  padding: 0;
  background: #000;
  overflow: hidden;
  backdrop-filter: none;
}

.modal-backdrop.avatar-modal-backdrop .avatar-modal-panel {
  display: grid;
  width: 100vw;
  height: 100vh;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.avatar-modal-close {
  position: fixed;
  z-index: 100;
  top: 0.9rem;
  left: 0.9rem;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.avatar-modal-close svg {
  width: 1.35rem;
  height: 1.35rem;
}

.media-nav-button {
  position: fixed;
  z-index: 4;
  top: 50%;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: translateY(-50%);
}

.media-nav-button.is-prev {
  left: 1.25rem;
}

.media-nav-button.is-next {
  right: calc(var(--avatar-viewer-side) + 1.25rem);
}

.media-nav-button svg {
  width: 1.55rem;
  height: 1.55rem;
}

.media-nav-button:hover,
.media-nav-button:focus-visible {
  background: rgba(var(--accent-rgb), 0.72);
}

.avatar-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--avatar-viewer-side);
  width: 100%;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.chat-photo-backdrop {
  position: fixed;
}

.chat-photo-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(2.6rem) brightness(0.5) saturate(1.15);
  transform: scale(1.15);
}

.modal-backdrop.avatar-modal-backdrop .avatar-modal-panel.chat-photo-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  background: transparent;
}

.chat-photo-toolbar {
  position: fixed;
  z-index: 100;
  top: 0.9rem;
  right: 1.1rem;
  display: flex;
  gap: 0.5rem;
}

.chat-photo-toolbar .icon-button {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.chat-photo-toolbar .icon-button:hover {
  background: rgba(255, 255, 255, 0.26);
}

.chat-photo-toolbar .icon-button svg {
  width: 1.2rem;
  height: 1.2rem;
}

.chat-photo-panel .media-nav-button.is-next {
  right: 1.25rem;
}

.chat-photo-frame {
  position: relative;
  display: grid;
  place-items: center;
  max-width: min(92vw, 60rem);
  max-height: 88vh;
  overflow: hidden;
  border-radius: 1rem;
  background: #000;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.55);
}

.chat-photo-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
}

.chat-photo-frame .group-post-album-strip {
  position: absolute;
  z-index: 5;
  left: 50%;
  right: auto;
  bottom: 0.85rem;
  width: auto;
  max-width: calc(100% - 1.6rem);
  transform: translateX(-50%);
  border-radius: 0.7rem;
  opacity: 1;
}

.avatar-photo-container {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.avatar-expanded-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.avatar-expanded-frame img {
  display: block;
  max-width: min(100%, calc(100vw - var(--avatar-viewer-side)));
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
}

.avatar-expanded-placeholder {
  display: grid;
  place-items: center;
  width: min(22rem, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, #45676b, #7c5d42);
  color: var(--text);
  font-size: 4rem;
  font-weight: 900;
}

.avatar-side-container {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.58rem;
  width: var(--avatar-viewer-side);
  height: 100vh;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
  padding: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: #242526;
  color: #e4e6eb;
}

.avatar-side-static {
  display: grid;
  gap: 0.58rem;
  min-height: 0;
}

.post-photo-side {
  grid-template-rows: minmax(0, 1fr) minmax(10rem, 38vh);
  gap: 0.72rem;
}

.post-photo-static {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.post-photo-head {
  align-items: start;
}

.post-photo-head .post-menu {
  align-self: start;
}

.post-photo-head .comment-menu-popover {
  z-index: 8;
}

.post-photo-story {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
}

.post-photo-story .post-story-block {
  margin-top: 0;
}

.post-photo-story .post-story-text {
  line-height: 1.52;
}

.post-photo-meta {
  margin-top: 0.65rem;
}

.post-photo-comment-list {
  min-height: 0;
  overflow-y: auto;
}

.avatar-side-head {
  display: grid;
  grid-template-columns: 2.55rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar-side-head .avatar {
  width: 2.55rem;
  height: 2.55rem;
}

.avatar-side-head h2 {
  margin: 0;
  font-size: 0.95rem;
}

.avatar-side-head span {
  color: #b0b3b8;
  font-size: 0.78rem;
}

.avatar-caption,
.avatar-comments {
  display: grid;
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.avatar-caption {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.28rem;
}

.avatar-comments {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.28rem;
}

.avatar-caption p,
.avatar-comment p {
  margin: 0;
  color: #e4e6eb;
  line-height: 1.45;
}

.avatar-photo-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding: 0.45rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar-photo-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 2rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #b0b3b8;
  font-size: 0.76rem;
  font-weight: 800;
}

.avatar-photo-actions button:hover,
.avatar-photo-actions button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #e4e6eb;
}

.avatar-photo-actions svg {
  width: 0.95rem;
  height: 0.95rem;
}

.avatar-comment-list {
  display: grid;
  align-content: start;
  gap: 0.48rem;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
}

.avatar-comment {
  position: relative;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
}

.comment-author-avatar {
  display: block;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  text-decoration: none;
}
.comment-author-avatar .avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.6rem;
  border-radius: 50%;
}
.comment-bubble-col {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}
.comment-bubble {
  display: inline-block;
  justify-self: start;
  max-width: 100%;
  padding: 0.45rem 0.7rem;
  border-radius: 1rem;
  background: #3a3b3c;
}
.comment-author-name {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  color: #e4e6eb;
  text-decoration: none;
  line-height: 1.3;
}
.comment-author-name:hover {
  text-decoration: underline;
  color: var(--accent);
}
.comment-body-text {
  margin: 0;
  color: #e4e6eb;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}
.comment-meta-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.7rem;
}
.comment-time {
  color: #b0b3b8;
  font-size: 0.72rem;
}

.avatar-comment span,
.empty-inline {
  color: #b0b3b8;
  font-size: 0.76rem;
}

.comment-menu {
  position: relative;
}

.comment-menu summary {
  display: inline-flex;
  gap: 0.18rem;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.45rem;
  border-radius: 999px;
  color: #b0b3b8;
  cursor: pointer;
  list-style: none;
}

.comment-menu summary::-webkit-details-marker {
  display: none;
}

.friend-menu summary.status-pill {
  width: auto;
  height: auto;
  min-height: 1.7rem;
  padding: 0 0.55rem;
  color: var(--ok);
}

.comment-menu summary span {
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 50%;
  background: currentColor;
}

.comment-menu summary:hover,
.comment-menu summary:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #e4e6eb;
}

.comment-menu-popover {
  position: absolute;
  z-index: 2;
  top: calc(100% + 0.25rem);
  right: 0;
  display: grid;
  min-width: 7rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.55rem;
  background: #303134;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.28);
}

.comment-menu-popover button {
  justify-content: start;
  min-height: 2rem;
  border: 0;
  background: transparent;
  color: #e4e6eb;
  font-size: 0.78rem;
  font-weight: 800;
}

.comment-menu-popover button:hover,
.comment-menu-popover button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.comment-menu-popover button:disabled {
  cursor: not-allowed;
  color: rgba(176, 179, 184, 0.48);
}

.comment-menu-popover button:disabled:hover {
  background: transparent;
}

.avatar-photo-menu {
  align-self: start;
}

.app-confirm-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.42);
}

.app-confirm-card {
  display: grid;
  gap: 0.85rem;
  width: min(27rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: var(--radius);
  background: #1f2023;
  color: #e4e6eb;
  box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.42);
}

.app-confirm-card h2,
.app-confirm-card p {
  margin: 0;
}

.app-confirm-card h2 {
  font-size: 1.05rem;
}

.app-confirm-card p {
  color: #b0b3b8;
}

.app-confirm-card blockquote {
  max-height: 7rem;
  margin: 0;
  padding: 0.75rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: #f2f0e8;
}

.confirm-photo-preview {
  display: grid;
  place-items: center;
  max-height: 12rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: #000;
}

.confirm-photo-preview img {
  display: block;
  max-width: 100%;
  max-height: 12rem;
  width: auto;
  height: auto;
}

.app-confirm-form {
  display: grid;
  gap: 0.85rem;
}

.app-confirm-form textarea {
  width: 100%;
  min-height: 8rem;
  max-height: 16rem;
  padding: 0.75rem;
  resize: vertical;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: var(--radius);
  outline: 0;
  background: #2f3033;
  color: #f2f0e8;
  font: inherit;
}

.app-confirm-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.app-confirm-card footer {
  display: flex;
  gap: 0.55rem;
  justify-content: end;
}

.app-confirm-card.post-composer-card {
  width: min(44rem, calc(100vw - 2rem));
  max-height: min(48rem, calc(100vh - 2rem));
  padding: 0;
  overflow: auto;
}

.post-composer-backdrop {
  place-items: center;
  padding: 1.5rem;
}

.post-composer-card h2 {
  font-size: 1.08rem;
}

.post-composer-form {
  gap: 0.8rem;
  padding: 1rem;
}

.post-composer-head {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
  align-items: center;
  min-height: 3.65rem;
  padding: 0 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.post-composer-head h2 {
  margin: 0;
  text-align: center;
}

.post-composer-close {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.post-composer-form textarea#postComposerText {
  min-height: 8rem;
  max-height: 18rem;
  padding: 0.4rem 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.post-composer-form textarea#postComposerText:focus {
  box-shadow: none;
}

.post-composer-form label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.post-composer-form input,
.post-composer-form select {
  min-height: 2.45rem;
  padding: 0 0.7rem;
  background: #0b0d10;
  color: #fff;
  font-size: 0.94rem;
  font-weight: 500;
}

.post-composer-form .post-privacy-pill {
  width: auto;
  min-height: 1.65rem;
  margin-top: 0.18rem;
  padding: 0 1.7rem 0 0.55rem;
  border-radius: 0.38rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.post-composer-form select option {
  background: #0b0d10;
  color: #fff;
}

.post-composer-form .upload-field input {
  padding: 0.45rem;
}

.post-composer-form footer {
  display: grid;
  position: static;
  margin: 0;
  padding-top: 0;
  background: transparent;
}

.post-composer-form footer .primary-action {
  width: 100%;
}

.group-post-composer-card {
  width: min(44rem, calc(100vw - 2rem));
  background: #1f2023;
}

.group-post-composer-card .post-composer-head {
  grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
}

.group-post-composer-card .post-composer-close {
  grid-column: 3;
  grid-row: 1;
}

.group-post-composer-card .post-composer-head h2 {
  grid-column: 2;
  grid-row: 1;
}

.group-post-composer-card .post-composer-form {
  gap: 0.85rem;
  display: grid;
  grid-template-columns: 1fr;
}

.group-post-composer-identity {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
}

.group-post-composer-identity strong {
  display: block;
  margin-bottom: 0.25rem;
}

.group-post-composer-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.group-post-composer-selects select {
  width: auto;
  min-height: 1.75rem;
  padding: 0 1.8rem 0 0.55rem;
  border: 0;
  border-radius: 0.35rem;
  background: #3a3b3c;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 850;
}

.group-post-composer-card textarea#groupPostText {
  display: block;
  width: 100%;
  min-height: 12rem;
  padding: 0.75rem 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #f2f0e8;
  font-size: 1rem;
  line-height: 1.6;
}

.group-post-composer-card textarea#groupPostText:focus {
  box-shadow: none;
}

.group-post-add-row {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.14);
  background: transparent;
}

.group-post-add-row label.post-add-icon {
  cursor: pointer;
}

.group-post-composer-card footer {
  display: flex;
  justify-content: flex-end;
}

.group-post-composer-card footer .primary-action {
  width: auto;
  min-width: 7rem;
}

.post-add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.03);
}

.post-add-row strong {
  font-size: 0.88rem;
}

.post-add-actions {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

.post-add-icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.post-add-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.post-add-icon.is-image {
  color: #45bd62;
}

.post-add-icon.is-active,
.post-add-icon:hover:not(:disabled),
.post-add-icon:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.post-add-icon:disabled {
  cursor: default;
  opacity: 0.75;
}

.post-tool-panel {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(10, 12, 15, 0.76);
}

.post-tool-panel[hidden] {
  display: none;
}

.post-tool-panel > strong {
  font-size: 0.88rem;
}

.post-tool-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.post-tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.post-tool-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.15rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 800;
}

.post-tool-choice:hover,
.post-tool-choice:focus-visible,
.post-tool-choice.is-selected {
  border-color: rgba(var(--accent-rgb), 0.58);
  background: rgba(var(--accent-rgb), 0.16);
  color: #fff;
}

.post-tool-textarea,
.post-tool-label input,
.post-tool-label select,
.app-confirm-form select,
.app-confirm-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: #0b0d10;
  color: #fff;
}

.post-tool-textarea {
  min-height: 6rem;
  padding: 0.65rem;
  resize: vertical;
}

.post-tool-label {
  display: grid;
  gap: 0.35rem;
  color: var(--soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.post-tool-label input,
.post-tool-label select,
.app-confirm-form select,
.app-confirm-form input {
  min-height: 2.3rem;
  padding: 0 0.65rem;
}

.post-editor-card {
  width: min(46rem, calc(100vw - 2rem));
}

.post-editor-card .app-confirm-form textarea {
  min-height: 14rem;
  max-height: 50vh;
  line-height: 1.6;
}

.post-gif-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.post-gif-search input {
  min-height: 2.35rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: #0b0d10;
  color: #fff;
}

.post-gif-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  max-height: 18rem;
  overflow: auto;
}

.post-gif-result {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: calc(var(--radius) - 3px);
  background: #000;
  padding: 0;
}

.post-gif-result:hover,
.post-gif-result:focus-visible,
.post-gif-result.is-selected {
  border-color: var(--accent);
}

.post-gif-result img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-gif-state:empty {
  display: none;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .avatar-select-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-confirm-card.post-composer-card {
    width: min(100%, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
    padding: 1rem;
  }

  .post-composer-backdrop {
    padding: 0.5rem;
  }

  .post-composer-form textarea#postComposerText {
    min-height: 12rem;
  }
}

.groups-page {
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.groups-app {
  min-height: 100vh;
}

.groups-global-topbar {
  z-index: 30;
}

.groups-global-left,
.groups-global-actions,
.groups-global-nav {
  display: flex;
  align-items: center;
}

.groups-global-left {
  min-width: 0;
}

.groups-app-logo {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
}

.groups-app-logo img {
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
}

.groups-top-search {
  width: min(36rem, 100%);
}

.groups-top-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.groups-global-nav {
  justify-content: center;
  gap: clamp(0.4rem, 3vw, 3.6rem);
}

.groups-global-nav a {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 4.2rem;
  height: 3.1rem;
  color: var(--muted);
  text-decoration: none;
}

.groups-global-nav a:hover,
.groups-global-nav a.is-active {
  color: var(--accent);
}

.groups-global-nav a.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0.16rem;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.groups-global-actions {
  justify-content: flex-end;
  gap: 0.6rem;
}

.groups-user-pill {
  display: grid;
  place-items: center;
}

.groups-workspace {
  display: grid;
  grid-template-columns: 22.5rem minmax(0, 1fr);
  height: calc(100vh - 4.8rem);
  min-height: 0;
}

.groups-hub-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.75rem 0.85rem;
  border-right: 1px solid var(--line);
  background: rgba(20, 23, 26, 0.98);
}

.groups-hub-head,
.groups-joined-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.groups-hub-head h1 {
  margin: 0;
  font-size: 1.35rem;
}

.groups-hub-menu {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.groups-hub-menu a {
  display: grid;
  grid-template-columns: 2.35rem 1fr;
  gap: 0.65rem;
  align-items: center;
  min-height: 2.55rem;
  color: var(--soft);
  text-decoration: none;
  font-weight: 800;
}

.groups-hub-menu a span {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.groups-hub-menu a:hover,
.groups-hub-menu a.is-active {
  color: var(--text);
}

.groups-joined-head {
  color: var(--soft);
  font-size: 0.9rem;
}

.groups-page .groups-list {
  display: grid;
  gap: 0.35rem;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 0.45rem 0.15rem 1rem 0;
}

.groups-page .group-list-item {
  grid-template-columns: 2.55rem minmax(0, 1fr);
  min-height: 3.55rem;
  border-color: transparent;
  background: transparent;
}

.groups-page .group-list-item:hover,
.groups-page .group-list-item.is-active {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
}

.groups-page .groups-workspace {
  grid-template-columns: 4.8rem minmax(0, 1fr);
}

.groups-page .groups-hub-sidebar {
  position: relative;
  z-index: 2;
  align-items: center;
  max-height: none;
  padding: 0.75rem 0.45rem;
}

.groups-page .groups-hub-head h1,
.groups-page .groups-joined-head strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.groups-page .groups-hub-head,
.groups-page .groups-joined-head {
  justify-content: center;
  width: 100%;
}

.groups-page .groups-list {
  justify-items: center;
  width: 100%;
  overflow: hidden;
  padding: 0.45rem 0 1rem;
}

.groups-page .group-list-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  width: 3rem;
  min-height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.groups-page .group-list-item:hover,
.groups-page .group-list-item:focus-visible,
.groups-page .group-list-item.is-active {
  background: transparent;
  outline: 0;
}

.groups-page .group-list-avatar {
  width: 2.55rem;
  height: 2.55rem;
  font-size: 0.72rem;
  transition: box-shadow 0.14s ease, transform 0.14s ease, border-color 0.14s ease;
}

.groups-page .group-list-item:hover .group-list-avatar,
.groups-page .group-list-item:focus-visible .group-list-avatar {
  border-color: rgba(var(--accent-rgb), 0.72);
  box-shadow: 0 0 0 0.2rem rgba(var(--accent-rgb), 0.12);
}

.groups-page .group-list-item.is-active .group-list-avatar {
  border-color: rgba(var(--accent-rgb), 0.82);
  box-shadow:
    0 0 0 0.18rem rgba(20, 23, 26, 1),
    0 0 0 0.32rem rgba(var(--accent-rgb), 0.58);
}

.groups-page .group-list-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.groups-page .group-list-meta {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.groups-page .group-list-item::after {
  position: absolute;
  z-index: 35;
  left: calc(100% + 0.55rem);
  top: 50%;
  max-width: 16rem;
  padding: 0.45rem 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.55rem;
  background: rgba(20, 23, 26, 0.98);
  box-shadow: 0 0.9rem 2rem rgba(0, 0, 0, 0.36);
  color: var(--text);
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translate(-0.2rem, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
}

.groups-page .group-list-item:hover::after,
.groups-page .group-list-item:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.groups-canvas {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: rgba(255, 255, 255, 0.018);
}

.groups-canvas .group-front {
  width: min(100%, 94rem);
  margin: 0 auto;
}

.group-profile-shell {
  min-height: calc(100vh - 4.8rem);
}

.group-profile-hero {
  border-bottom: 1px solid var(--line);
  background: rgba(28, 31, 35, 0.95);
}

.group-profile-hero.is-liria-fandom {
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--accent-rgb), 0.2), transparent 22rem),
    linear-gradient(180deg, rgba(31, 24, 38, 0.98), rgba(18, 20, 24, 0.98));
}

.group-profile-cover {
  width: min(100%, 74rem);
  height: clamp(13rem, 27vw, 21rem);
  margin: 0 auto;
  border-radius: 0 0 var(--radius) var(--radius);
  background:
    linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.55)),
    radial-gradient(circle at 35% 20%, rgba(var(--accent-rgb), 0.2), transparent 22rem),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 18px),
    #101317;
  background-position: center;
  background-size: cover;
}

.group-cover-edit {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.group-cover-edit-preview {
  width: 100%;
  height: clamp(8rem, 18vw, 14rem);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-placeholder {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.group-cover-edit-label {
  align-self: flex-start;
  cursor: pointer;
}

.group-cover-edit-label input[type="file"] {
  display: none;
}

.group-profile-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  width: min(100%, 67rem);
  margin: 0 auto;
  padding: 0.75rem 0 0.85rem;
}

.group-title-block h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  line-height: 1.04;
}

.group-title-block p {
  margin: 0.2rem 0 0;
  color: var(--soft);
}

.group-title-block .eyebrow {
  margin-bottom: 0.28rem;
}

.group-liria-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.62rem;
}

.group-liria-meta span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  min-height: 1.8rem;
  padding: 0 0.58rem;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.group-member-strip {
  display: flex;
  margin-top: 0.55rem;
}

.group-member-strip span {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  margin-right: -0.38rem;
  border: 2px solid rgba(28, 31, 35, 0.95);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.35), rgba(255, 255, 255, 0.12));
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 900;
  overflow: hidden;
}

.group-member-strip span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.group-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.group-profile-actions .primary-action,
.group-profile-actions .secondary-action,
.group-profile-actions .icon-button {
  box-shadow: none;
}

.group-member-menu {
  position: relative;
}

.group-member-menu summary {
  list-style: none;
  cursor: pointer;
}

.group-member-menu summary::-webkit-details-marker {
  display: none;
}

.group-member-menu[open] summary {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.12);
}

.group-member-popover {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.45rem);
  right: 0;
  display: grid;
  width: min(17rem, calc(100vw - 2rem));
  gap: 0.25rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 30, 0.98);
  box-shadow: var(--shadow);
}

.group-member-popover button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.15rem;
  padding: 0 0.65rem;
  border: 0;
  border-radius: calc(var(--radius) - 0.25rem);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: left;
}

.group-member-popover button:hover,
.group-member-popover button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.group-profile-tabs {
  display: flex;
  gap: 0.38rem;
  align-items: center;
  width: min(100%, 67rem);
  margin: 0 auto;
  padding: 0.62rem 0 0.72rem;
  border-top: 1px solid rgba(var(--accent-rgb), 0.18);
  overflow-x: auto;
}

.group-profile-tabs button {
  min-height: 2.15rem;
  padding: 0 0.66rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.group-profile-tabs button:hover,
.group-profile-tabs button.is-active {
  border-color: rgba(var(--accent-rgb), 0.58);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.16);
}

.group-profile-tabs .icon-button {
  min-width: 2.45rem;
  height: 2.15rem;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.group-profile-tabs .icon-button + .icon-button {
  margin-left: 0.35rem;
}

.compact-item:has(button, a.ghost-action) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.universe-subtabs {
  display: flex;
  gap: 0.38rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.universe-subtabs button {
  min-height: 2.15rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.universe-subtabs button:hover,
.universe-subtabs button.is-active {
  border-color: rgba(var(--accent-rgb), 0.58);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.16);
}

.group-conversation-grid {
  display: grid;
  grid-template-columns: minmax(25rem, 43rem) minmax(18rem, 31rem);
  gap: 0.8rem;
  align-items: start;
  width: min(100%, 67rem);
  margin: 0 auto;
  padding: 0.8rem 0 2rem;
}

.group-conversation-main,
.group-info-column {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.group-composer-panel,
.group-highlight-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.09), transparent 42%),
    rgba(16, 18, 22, 0.94);
}

.group-composer-panel {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.62rem;
  padding: 0.85rem;
  border-left: 3px solid rgba(var(--accent-rgb), 0.82);
}

.group-composer-panel > button {
  display: grid;
  gap: 0.12rem;
  min-height: 2.8rem;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  text-align: left;
  padding: 0.45rem 0.7rem;
  font: inherit;
}

.group-composer-panel > button strong {
  color: var(--text);
  font-size: 0.92rem;
}

.group-composer-panel > button span {
  color: var(--muted);
  font-size: 0.8rem;
}

.group-composer-tools {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  padding-top: 0.72rem;
  border-top: 1px solid var(--line);
}

.group-composer-tools button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.05rem;
  padding: 0 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.group-composer-tools button:hover,
.group-composer-tools button:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.group-composer-tools button:nth-child(1) .liria-fa {
  color: var(--accent);
}

.group-composer-tools button:nth-child(2) .liria-fa {
  color: var(--accent-2);
}

.group-composer-tools button:nth-child(3) .liria-fa {
  color: #d7b7ff;
}

.group-highlight-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.1rem;
  padding: 0.68rem 0.82rem;
  border-style: dashed;
}

.group-highlight-panel strong,
.group-highlight-panel span {
  display: block;
}

.group-highlight-panel span,
.group-feed-sort {
  color: var(--accent);
  font-weight: 900;
}

.group-feed-sort {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  width: fit-content;
  padding: 0.25rem 0.1rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.groups-page .group-feed {
  display: grid;
  gap: 0.75rem;
}

.groups-page .group-post-card {
  position: relative;
  overflow: hidden;
  padding: 0.9rem 0.95rem 0.75rem;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.13), transparent 34%),
    rgba(19, 22, 26, 0.96);
}

.groups-page .group-post-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.2rem;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  content: "";
}

.groups-page .group-post-card .post-head {
  grid-template-columns: 2.5rem 1fr auto;
  margin-bottom: 0.55rem;
}

.groups-page .group-post-card .story-text {
  margin: 0;
  padding: 0;
  border-top: 0;
  color: #f1eadf;
  line-height: 1.65;
}

.groups-page .group-post-card .post-story-block,
.groups-page .group-post-card .post-image-button,
.groups-page .group-post-card .post-media-collage,
.groups-page .group-post-card .tag-row,
.groups-page .group-post-card .group-post-actions {
  position: relative;
  z-index: 1;
}

.groups-page .group-post-card .post-story-block {
  margin: 0.55rem 0 0.65rem;
}

.group-gallery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
  gap: 0.8rem;
  align-items: start;
  width: min(100%, 67rem);
  margin: 0 auto;
  padding: 0.8rem 0 2rem;
}

.group-gallery-layout.is-grid-only {
  grid-template-columns: minmax(0, 1fr);
}

.group-members-layout {
  width: min(100%, 67rem);
  margin: 0 auto;
  padding: 0.8rem 0 2rem;
}

.group-library-layout {
  width: min(100%, 67rem);
  margin: 0 auto;
  padding: 0.8rem 0 2rem;
}

button.document-card,
div.document-card[role="button"] {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.group-member-list {
  display: grid;
  gap: 0.5rem;
}

.group-member-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.group-member-row strong,
.group-member-row span {
  display: block;
}

.group-member-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.group-join-request-row {
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
}

.group-join-request-info {
  min-width: 0;
}

.group-join-request-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.group-tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.group-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.8rem, 1fr));
  gap: 0.35rem;
}

.group-gallery-card {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #050608;
}

.group-gallery-card:hover,
.group-gallery-card:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.72);
  outline-offset: -2px;
}

.group-gallery-card img,
.group-gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-gallery-detail {
  position: sticky;
  top: 5.35rem;
  display: grid;
  gap: 0.75rem;
  min-height: 20rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 18, 22, 0.96);
}

.group-gallery-preview {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}

.group-gallery-side-body {
  display: grid;
  gap: 0.65rem;
}

@media (max-width: 920px) {
  .group-gallery-layout {
    grid-template-columns: 1fr;
    width: calc(100% - 1.4rem);
  }

  .group-gallery-detail {
    position: static;
    max-height: none;
  }
}

.group-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.group-post-actions button {
  min-height: 1.95rem;
  padding: 0 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 900;
}

.group-post-actions button:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text);
}

.group-post-actions button.is-primary {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.group-post-actions button.is-primary:hover {
  border-color: rgba(var(--accent-rgb), 0.65);
  background: rgba(var(--accent-rgb), 0.22);
}

.post-type-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.post-type-banner--escena {
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

.post-type-banner--convocatoria {
  border: 1px solid rgba(var(--accent-2-rgb), 0.4);
  background: rgba(var(--accent-2-rgb), 0.14);
  color: var(--accent-2);
}

.post-card.post-type-escena {
  border-left: 3px solid rgba(var(--accent-rgb), 0.55);
}

.post-card.post-type-convocatoria {
  border-left: 3px solid rgba(var(--accent-2-rgb), 0.55);
}

.post-story-block--escena .post-story-text {
  font-style: italic;
  padding: 0.7rem 0.9rem;
  border-left: 2px solid rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-story-block--convocatoria .post-story-text {
  padding: 0.7rem 0.9rem;
  border: 1px dashed rgba(var(--accent-2-rgb), 0.4);
  border-radius: var(--radius);
  background: rgba(var(--accent-2-rgb), 0.05);
}

.post-type-heading {
  margin: 0.1rem 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
}

.post-type-subheading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.post-composer-extra-fields {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}

.post-composer-type-banner {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: var(--radius);
  width: 100%;
  display: flex;
}

.post-composer-type-banner:not(.post-type-banner) {
  display: none;
}

.group-event-composer-card {
  width: min(34rem, calc(100vw - 2rem));
  background: #1f2023;
}

.group-event-composer-card .post-composer-form {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
  padding-top: 0.85rem;
}

.group-event-composer-card textarea {
  min-height: 5rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: #0b0d10;
  color: #fff;
  resize: vertical;
}

.group-event-composer-card > .post-composer-form > input#groupEventName {
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: #0b0d10;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.event-organizer-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.event-cover-frame {
  position: relative;
  margin: 0.85rem 0 0;
  height: 14rem;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #0b0d10;
  cursor: default;
  touch-action: none;
}

.event-cover-frame.has-image {
  cursor: grab;
}

.event-cover-frame.has-image.is-dragging {
  cursor: grabbing;
}

.event-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.event-cover-placeholder {
  display: grid;
  place-items: center;
  gap: 0.4rem;
  height: 100%;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.event-cover-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.event-cover-edit {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.event-datetime-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.6rem;
}

.event-datetime-row[hidden],
.post-tool-label[hidden] {
  display: none;
}

.event-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--soft);
}

.event-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.event-toggle-row strong {
  display: block;
  font-size: 0.85rem;
}

.event-toggle-row span {
  color: var(--muted);
  font-size: 0.76rem;
}

.event-switch {
  position: relative;
  display: inline-block;
  width: 2.6rem;
  height: 1.5rem;
  flex: none;
}

.event-switch input {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.event-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.15s ease;
}

.event-switch-track::before {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.14rem;
  height: 1.14rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.event-switch input:checked + .event-switch-track {
  background: var(--accent);
}

.event-switch input:checked + .event-switch-track::before {
  transform: translateX(1.1rem);
}

.group-event-card .event-card-cover {
  margin: -0.1rem -0.1rem 0.7rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.group-event-card .event-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.event-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.event-card-description {
  margin: 0 0 0.6rem;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.event-card-rsvp {
  margin-bottom: 0.4rem;
}

.event-card-rsvp-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.post-inline-comments {
  padding: 0.7rem 0 0.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  animation: comment-reveal 0.18s ease;
}

@keyframes comment-reveal {
  from { opacity: 0; transform: translateY(0.3rem); }
  to { opacity: 1; transform: translateY(0); }
}

.post-comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.post-comment-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.post-comment-bubble {
  flex: 1;
  padding: 0.45rem 0.7rem 0.5rem;
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.post-comment-bubble-head {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.18rem;
}

.post-comment-bubble strong {
  font-size: 0.82rem;
}

.post-comment-bubble span {
  color: var(--muted);
  font-size: 0.72rem;
}

.post-comment-bubble p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.48;
  color: #e4e6eb;
  white-space: pre-wrap;
}

.post-comment-img-attached {
  display: block;
  max-width: 14rem;
  margin-top: 0.45rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}

.post-comment-new {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.post-modal-comment-new {
  animation: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.55rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.post-comment-img-preview {
  position: relative;
  display: inline-block;
  margin-left: 2.35rem;
  margin-bottom: 0.15rem;
}

.post-comment-img-preview img {
  display: block;
  max-height: 8rem;
  max-width: 16rem;
  border-radius: var(--radius);
  object-fit: cover;
}

.post-comment-img-clear {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
  line-height: 1;
}

.post-comment-compose {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.post-comment-body {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.post-comment-body:focus-within {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(255, 255, 255, 0.065);
}

.post-comment-textarea {
  display: block;
  width: 100%;
  min-height: 2.4rem;
  max-height: 8.75rem;
  padding: 0.55rem 0.72rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.87rem;
  line-height: 1.48;
  resize: none;
  overflow-y: hidden;
}

.post-comment-textarea:focus {
  outline: 0;
}

.post-comment-textarea::placeholder {
  color: var(--muted);
}

.post-comment-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.55rem 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.post-comment-img-btn {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: color 0.12s;
}

.post-comment-img-btn:hover {
  color: var(--text);
}

.post-comment-img-btn input[type="file"] {
  display: none;
}

.post-comment-submit {
  min-height: 1.75rem;
  padding: 0 0.85rem;
  font-size: 0.79rem;
}

.group-info-column {
  position: sticky;
  top: 3.75rem;
}

@media (max-width: 1180px) {
  .groups-global-topbar {
    grid-template-columns: minmax(14rem, 1fr) auto;
  }

  .groups-workspace {
    grid-template-columns: 18.5rem minmax(0, 1fr);
  }

  .group-conversation-grid,
  .group-profile-info,
  .group-profile-tabs {
    width: calc(100% - 1.4rem);
  }
}

@media (max-width: 920px) {
  .groups-global-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .groups-workspace,
  .group-conversation-grid {
    grid-template-columns: 1fr;
  }

  .groups-hub-sidebar,
  .group-info-column {
    position: static;
  }

  .groups-hub-sidebar {
    max-height: 22rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .groups-global-topbar {
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .groups-global-left {
    flex: 1;
    min-width: 0;
  }

  .groups-top-search {
    flex: 1;
    min-width: 0;
  }

  .groups-global-left .primary-action {
    flex: 0 0 auto;
    width: 2.35rem;
    min-width: 2.35rem;
    padding: 0;
    font-size: 0;
  }

  .groups-global-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .groups-workspace {
    height: auto;
  }

  .group-profile-info {
    grid-template-columns: 1fr;
  }

  .group-profile-actions,
  .group-composer-tools {
    grid-template-columns: 1fr;
  }
}

.danger-action {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.55rem 0.95rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--danger);
  color: #171116;
  font-weight: 900;
}

.avatar-comment-form {
  display: grid;
  gap: 0.45rem;
}
.comment-form-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
}
.comment-form-row .avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.6rem;
  border-radius: 50%;
  margin-top: 0.25rem;
}

.avatar-comment-form textarea {
  width: 100%;
  min-height: 3rem;
  max-height: 6rem;
  padding: 0.55rem;
  border: 0;
  border-radius: 1rem;
  outline: 0;
  background: #3a3b3c;
  color: #e4e6eb;
  resize: vertical;
}

.document-body {
  min-height: 100%;
  margin: 0;
  padding: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-family: var(--font-story);
  font-size: 1rem;
  line-height: 1.7;
}

.character-top {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.75rem;
  align-items: center;
}

.character-top h3,
.community-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.character-top p,
.community-card p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-hero {
  position: relative;
  z-index: 4;
  overflow: visible;
}

.hero-cover-wrap {
  position: relative;
}

.hero-cover {
  height: clamp(13rem, 26vw, 22rem);
  border-radius: var(--radius) var(--radius) 0 0;
  background:
    linear-gradient(120deg, rgba(var(--accent-rgb), 0.55), transparent 45%),
    linear-gradient(260deg, rgba(var(--accent-2-rgb), 0.45), transparent 48%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 22px),
    #23282d;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.image-reposition-panel {
  padding: 1.2rem;
  display: grid;
  gap: 0.8rem;
}

.image-reposition-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #0b0d10;
  touch-action: none;
  cursor: grab;
}

.image-reposition-frame.is-dragging {
  cursor: grabbing;
}

.image-reposition-frame.is-cover {
  width: 100%;
  aspect-ratio: 3 / 1;
}

.image-reposition-frame.is-avatar {
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  margin: 0 auto;
}

.image-reposition-frame img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.hero-cover-btn {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  cursor: zoom-in;
}

.cover-menu-wrap {
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
  z-index: 18;
}

.cover-edit-button {
  min-height: 2.25rem;
  padding-inline: 0.72rem;
  background: rgba(20, 22, 25, 0.86);
  backdrop-filter: blur(10px);
}

.cover-profile-menu {
  top: calc(100% + 0.35rem);
  right: 0;
  left: auto;
  width: 12.25rem;
}

.cover-select-card {
  width: min(42rem, calc(100vw - 2rem));
}

.avatar-select-card {
  width: min(42rem, calc(100vw - 2rem));
}

.cover-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem;
  max-height: min(27rem, 62vh);
  overflow: auto;
  padding-right: 0.2rem;
}

.avatar-select-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  max-height: min(31.2rem, 66vh);
  overflow: auto;
  padding-right: 0.2rem;
}

.cover-select-option,
.avatar-select-option {
  display: grid;
  gap: 0.35rem;
  padding: 0.42rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
}

.cover-select-option:hover,
.cover-select-option:focus-visible,
.cover-select-option.is-active,
.avatar-select-option:hover,
.avatar-select-option:focus-visible,
.avatar-select-option.is-active {
  border-color: rgba(var(--accent-rgb), 0.7);
  background: rgba(var(--accent-rgb), 0.1);
}

.cover-select-option img {
  width: 100%;
  aspect-ratio: 16 / 6;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  background: #000;
}

.avatar-select-option img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  background: #000;
}

.cover-select-option span,
.avatar-select-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.78rem;
}

.hero-body {
  position: relative;
  display: grid;
  grid-template-columns: 10rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 1.1rem 1.1rem;
  margin-top: 0;
  background: rgba(18, 20, 24, 0.96);
}

.hero-body .avatar {
  width: 10rem;
  height: 10rem;
  border: 4px solid var(--surface);
}

.hero-body .avatar-menu-wrap {
  transform: translateY(-5rem);
  align-self: end;
}

.avatar-button {
  display: grid;
  width: fit-content;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
}

.avatar-button .avatar {
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.avatar-button:hover .avatar {
  border-color: rgba(var(--accent-rgb), 0.78);
  transform: translateY(-1px);
}

.avatar-menu-wrap {
  position: relative;
  z-index: 12;
  width: fit-content;
}

.status-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  padding: 0.35rem 0.65rem;
  border-radius: 0.55rem;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 22, 28, 0.97);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

.status-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(20, 22, 28, 0.97);
  border-bottom: none;
}

.status-bubble[data-tone="available"] {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(18, 38, 24, 0.97);
  color: #86efac;
}
.status-bubble[data-tone="available"]::after { border-top-color: rgba(18, 38, 24, 0.97); }

.status-bubble[data-tone="seeking"] {
  border-color: rgba(250, 204, 21, 0.5);
  background: rgba(38, 32, 10, 0.97);
  color: #fde047;
}
.status-bubble[data-tone="seeking"]::after { border-top-color: rgba(38, 32, 10, 0.97); }

.status-bubble[data-tone="busy"] {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(38, 16, 16, 0.97);
  color: #fca5a5;
}
.status-bubble[data-tone="busy"]::after { border-top-color: rgba(38, 16, 16, 0.97); }

.status-bubble[data-tone="neutral"] {
  border-color: rgba(var(--accent-rgb), 0.4);
}
.status-bubble[data-tone="neutral"]::after { border-top-color: rgba(20, 22, 28, 0.97); }

.avatar-profile-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.45rem);
  left: 0;
  display: grid;
  width: 11.5rem;
  padding: 0.35rem;
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  border-radius: var(--radius);
  background: #1f2023;
  box-shadow: 0 1.1rem 2.4rem rgba(0, 0, 0, 0.38);
}

.avatar-profile-menu button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: start;
  min-height: 2.35rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #e4e6eb;
  font-weight: 850;
}

.avatar-profile-menu button:hover,
.avatar-profile-menu button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.avatar-profile-menu button:disabled {
  cursor: not-allowed;
  color: rgba(176, 179, 184, 0.48);
}

.avatar-profile-menu svg {
  width: 1rem;
  height: 1rem;
}

.avatar-profile-menu .account-profile-row,
.avatar-profile-menu .account-menu-row {
  display: grid;
  grid-template-columns: 2.45rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  justify-content: stretch;
  width: 100%;
  padding: 0.35rem 0.45rem;
  color: #e4e6eb;
  text-decoration: none;
}

.avatar-profile-menu .account-menu-row {
  padding: 0.3rem 0.25rem;
  border: 0;
}

.avatar-profile-menu .account-all-profiles {
  justify-content: center;
}

.avatar-upload-backdrop {
  z-index: 31;
}

.avatar-upload-card {
  width: min(31rem, calc(100vw - 2rem));
}

.hero-body .hero-info {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.hero-body h2 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.2;
}

.hero-handle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.hero-contact-count {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

a.hero-contact-count:hover {
  color: var(--text);
  text-decoration: underline;
}

.hero-body .hero-info > p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.hero-body p {
  margin: 0;
  color: var(--muted);
}

.profile-hero-actions {
  position: relative;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.profile-action-menu {
  position: relative;
}

.profile-action-menu summary {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 900;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.profile-action-menu summary::-webkit-details-marker {
  display: none;
}

.profile-action-menu[open] summary {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.12);
}

.profile-action-popover {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.45rem);
  right: 0;
  display: grid;
  width: min(18rem, calc(100vw - 2rem));
  gap: 0.4rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 30, 0.98);
  box-shadow: var(--shadow);
}

.profile-fact-card {
  padding: 0.75rem;
}

.profile-fact-card .panel-title {
  margin-bottom: 0.45rem;
}

.profile-fact-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 34rem) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
}

.profile-fact-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.38rem;
}

.profile-fact-row {
  display: grid;
  grid-template-columns: 1.55rem minmax(6rem, 0.34fr) minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.profile-fact-icon {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

.profile-fact-icon svg {
  width: 0.82rem;
  height: 0.82rem;
}

.profile-fact-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.profile-fact-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.profile-highlights {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-height: 19rem;
  padding: 0.6rem;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.profile-highlights-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-highlights-head strong {
  color: var(--text);
}

.profile-highlights-head > div {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
}

.profile-highlight-add {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  min-height: 1.85rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
}

.profile-highlight-add:hover,
.profile-highlight-add:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.16);
}

.featured-upload-card {
  width: min(36rem, calc(100vw - 2rem));
}

.featured-upload-form {
  display: grid;
  gap: 0.75rem;
}

.featured-upload-drop {
  display: grid;
  gap: 0.25rem;
  place-items: center;
  min-height: 6rem;
  padding: 0.9rem;
  border: 1px dashed rgba(var(--accent-rgb), 0.48);
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.featured-upload-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.featured-upload-drop span {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  font-weight: 900;
}

.featured-upload-drop small {
  color: var(--muted);
}

.featured-upload-preview {
  display: grid;
  place-items: center;
  min-height: 14rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050607;
}

.featured-upload-preview.is-empty {
  color: var(--muted);
}

.featured-upload-preview img {
  max-width: 100%;
  max-height: 22rem;
  object-fit: contain;
}

.featured-upload-form textarea {
  min-height: 6rem;
  resize: vertical;
}

.featured-upload-form footer {
  display: flex;
  gap: 0.55rem;
  justify-content: end;
}

.profile-highlight-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(9.5rem, 12rem);
  gap: 0.5rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.profile-highlight-track::-webkit-scrollbar {
  display: none;
}

.profile-highlight-slide {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: calc(var(--radius) + 2px);
  background: #0a0b0d;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.18s, transform 0.18s;
}

.profile-highlight-slide:hover,
.profile-highlight-slide:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.65);
  transform: scale(1.025);
}

.profile-highlight-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.3s;
}

.profile-highlight-slide:hover img {
  transform: scale(1.04);
}

.profile-highlight-slide.is-empty {
  display: grid;
  place-items: end start;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-3-rgb), 0.05)),
    #0a0b0d;
}

.profile-highlight-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 0.55rem 0.65rem 0.6rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.55) 40%, rgba(0, 0, 0, 0.88) 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.profile-highlight-caption:empty {
  display: none;
}

.character-featured-slide {
  cursor: default;
}

.character-featured-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(12, 13, 16, 0.72);
  color: #fff;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.character-featured-remove svg {
  width: 0.85rem;
  height: 0.85rem;
}

.character-featured-slide:hover .character-featured-remove,
.character-featured-remove:focus-visible {
  opacity: 1;
}

.character-featured-remove:hover {
  background: rgba(220, 38, 38, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}

.featured-side-thumb {
  width: 2.55rem;
  height: 2.55rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}

.featured-side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Story viewer ─────────────────────────────────────────── */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease;
}

.story-viewer-inner {
  position: relative;
  width: min(420px, 100vw);
  height: min(748px, 100svh);
  border-radius: 1rem;
  overflow: hidden;
  background: #060708;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
}

.story-progress {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  display: flex;
  gap: 0.22rem;
}

.story-progress-dot {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.story-progress-dot.done {
  background: rgba(255, 255, 255, 0.75);
}

.story-progress-dot.active {
  background: rgba(255, 255, 255, 0.95);
}

.story-viewer-header {
  position: absolute;
  top: 1.4rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  pointer-events: none;
}

.story-viewer-header .user-avatar {
  width: 2.1rem;
  height: 2.1rem;
  min-width: 2.1rem;
  font-size: 0.72rem;
  pointer-events: auto;
}

.story-viewer-header strong {
  display: block;
  color: #fff;
  font-size: 0.83rem;
  font-weight: 750;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  line-height: 1.2;
}

.story-viewer-header span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.72rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.story-viewer-close {
  position: absolute;
  top: 1.25rem;
  right: 0.75rem;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.88rem;
  transition: background 0.15s;
}

.story-viewer-close:hover {
  background: rgba(0, 0, 0, 0.6);
}

.story-image-wrap {
  position: absolute;
  inset: 0;
}

.story-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.story-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 1rem 1.1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, transparent 100%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.story-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.18s, background 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.story-nav-prev { left: 0.65rem; }
.story-nav-next { right: 0.65rem; }

.story-viewer-inner:hover .story-nav {
  opacity: 1;
}

.story-nav:hover {
  background: rgba(0, 0, 0, 0.65);
}

.story-viewer-backdrop-hit {
  position: fixed;
  inset: 0;
  z-index: -1;
  cursor: pointer;
}

.profile-image-archive {
  display: grid;
  gap: 0.65rem;
  padding-top: 0.2rem;
}

.image-archive-row {
  display: grid;
  gap: 0.38rem;
}

.image-archive-row > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.image-archive-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 4.2rem;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.image-archive-list em {
  grid-column: span 2;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.image-archive-thumb {
  position: relative;
  width: 4.2rem;
  height: 4.2rem;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.image-archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-archive-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}

.image-archive-thumb:disabled {
  cursor: default;
  opacity: 0.85;
}

.avatar-album-panel,
.profile-photos-panel {
  display: grid;
  gap: 0.75rem;
}

.profile-photos-title {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.profile-photos-title:hover,
.profile-photos-title:focus-visible {
  color: var(--accent);
}

.profile-lower-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 36rem) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.profile-left-column {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.profile-posts-panel {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  min-height: 28rem;
  align-content: start;
}

.profile-post-composer {
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.profile-post-composer .secondary-action {
  justify-content: start;
  width: 100%;
}

.character-post-composer {
  border-color: rgba(var(--accent-2-rgb), 0.26);
  background: linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.1), rgba(255, 255, 255, 0.035));
}

.character-post-composer .secondary-action {
  display: grid;
  gap: 0.12rem;
  text-align: left;
}

.character-post-composer .secondary-action span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.profile-post-list {
  align-content: start;
}

.profile-post-list .post-card {
  padding: 0.82rem;
}

.profile-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.friend-card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius);
  overflow: hidden;
  transition: opacity 0.15s;
}

.friend-card:hover { opacity: 0.82; }

.friend-card-media {
  position: relative;
  display: block;
}

.friend-card-media .presence-dot {
  right: 0.4rem;
  bottom: 0.4rem;
  width: 1.05rem;
  height: 1.05rem;
}

.friend-card img,
.friend-card-initials {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.07);
}

.friend-card-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--muted);
}

.friend-card strong {
  font-size: 0.88rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-card span {
  font-size: 0.78rem;
  color: var(--muted);
}

.profile-photo-thumb {
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: calc(var(--radius) - 2px);
  background: #050607;
  color: inherit;
  aspect-ratio: 1;
}

.profile-photo-thumb:hover,
.profile-photo-thumb:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.7);
}

.profile-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photos-modal-backdrop {
  z-index: 34;
  place-items: stretch;
  padding: 0;
  overflow: hidden;
}

.photos-modal-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background: #202224;
  color: var(--text);
}

.photos-modal-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.35rem 0.75rem;
  background: #202224;
}

.photos-modal-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.photos-modal-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.link-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 850;
}

.photos-tabs {
  display: flex;
  gap: 1rem;
  padding: 0 1.35rem;
  background: #202224;
}

.photos-tabs button {
  min-height: 3rem;
  padding: 0 0.9rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.photos-tabs button.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.photos-modal-content {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.35rem 1.35rem;
  background: #202224;
}

.photos-count {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.photos-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 10rem));
  gap: 0.55rem;
  align-content: start;
}

.photos-grid-view .profile-photo-thumb {
  aspect-ratio: 1;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 0.35rem;
}

.photos-album-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.25rem, 10.75rem));
  gap: 0.85rem;
  align-content: start;
  align-items: start;
}

.photo-album-folder {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.photo-album-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-height: 10.75rem;
  overflow: hidden;
  border-radius: 0.35rem;
  background: #303335;
}

.photo-album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-album-cover.is-empty {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.photo-album-menu {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(35, 37, 39, 0.78);
  color: #fff;
}

.photo-album-folder-meta {
  display: grid;
  gap: 0.12rem;
}

.photo-album-folder-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.photo-album-folder-meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.create-album-card {
  cursor: pointer;
}

.create-album-plus {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-height: 10.75rem;
  border-radius: 0.35rem;
  background: #373a3d;
  color: #d6d8dc;
  font-size: 2rem;
}

.photo-album-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(3.25rem, 1fr);
  gap: 0.32rem;
  max-height: calc((3.25rem * 4) + (0.32rem * 3));
  min-height: 0;
  overflow: auto;
  padding-right: 0.08rem;
}

.photo-album-preview.is-empty {
  display: grid;
  place-items: center;
  padding: 0.7rem;
  border: 1px dashed var(--line);
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  text-align: center;
}

.photo-album-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 3px);
  background: #000;
}

.photo-album-preview .profile-photo-thumb {
  width: 100%;
}

.avatar-album-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.avatar-album-card {
  display: grid;
  gap: 0.38rem;
  align-content: start;
  min-width: 0;
  padding: 0.38rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.avatar-album-card:hover,
.avatar-album-card:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.65);
  background: rgba(var(--accent-rgb), 0.08);
}

.avatar-album-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  background: #000;
}

.avatar-album-card span,
.avatar-album-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-album-card span {
  font-weight: 850;
  font-size: 0.82rem;
}

.avatar-album-card small,
.muted-inline {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-action-strip {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.profile-action-button {
  display: grid;
  gap: 0.18rem;
  min-height: 3.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: var(--radius);
  background: rgba(23, 26, 30, 0.78);
  color: var(--text);
  text-align: left;
}

.profile-action-button:hover {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.1);
}

.profile-action-button strong {
  font-size: 0.86rem;
}

.profile-action-button span {
  color: var(--muted);
  font-size: 0.74rem;
}

.profile-legacy-panels {
  display: none;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.character-narrative-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.6rem;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.character-narrative-grid {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.sheet-field {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.sheet-field span {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
  min-width: 0;
  height: calc(100vh - 10.2rem);
  min-height: 30rem;
  max-height: calc(100vh - 10.2rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.35rem);
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--accent-rgb), 0.11), transparent 19rem),
    linear-gradient(180deg, rgba(24, 27, 31, 0.98), rgba(15, 17, 20, 0.98));
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.24);
}


.chat-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.chat-list-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.chat-list-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.chat-list-search svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
}

.chat-list-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
}

.chat-list-search input:focus {
  outline: none;
}

.chat-list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chat-tab {
  padding: 0.32rem 0.78rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chat-tab.is-active {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
}

.chat-tab-menu {
  margin-left: auto;
}

.chat-tab-menu .comment-menu-popover svg {
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.3rem;
}

.chat-list-items {
  min-height: 0;
  padding: 0.45rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat-list-row {
  position: relative;
}

.chat-list-item {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  column-gap: 0.7rem;
  align-items: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.72rem 2.1rem 0.72rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 1rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.chat-item-menu {
  position: absolute;
  top: 0.5rem;
  right: 0.35rem;
}

.chat-unread-dot {
  position: absolute;
  bottom: 0.7rem;
  right: 0.85rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
}

.chat-list-item:hover,
.chat-list-item.is-active {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
}

.chat-list-item:hover {
  transform: translateX(0.12rem);
}

.chat-list-item.is-active {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-2-rgb), 0.1));
}

.chat-list-copy {
  display: block;
  min-width: 0;
}

.chat-list-copy strong,
.chat-list-copy span,
.chat-list-copy small {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-copy strong {
  font-size: 0.92rem;
}

.chat-list-copy span,
.chat-list-copy small {
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.42), rgba(var(--accent-2-rgb), 0.34));
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 900;
  overflow: visible;
}

.chat-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.chat-avatar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.1rem;
  width: 0.68rem;
  height: 0.68rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #6d747a;
}

.chat-avatar.is-online::after {
  background: var(--ok);
}

.chat-thread {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 10%, rgba(var(--accent-2-rgb), 0.08), transparent 18rem),
    rgba(255, 255, 255, 0.018);
}

.chat-head,
.chat-compose {
  min-width: 0;
  padding: 0.82rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 20, 23, 0.74);
  backdrop-filter: blur(14px);
}

.chat-head strong,
.chat-head-name {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.chat-head-name {
  color: inherit;
  text-decoration: none;
}

.chat-head-name:hover {
  text-decoration: underline;
}

.chat-head-main {
  display: grid;
  grid-template-columns: 2.9rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.48rem;
}

.presence-text {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.presence-text.is-online {
  color: var(--ok);
}

.chat-info-toggle.is-active {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
}

.chat-info-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
}

.chat-info-close {
  display: grid;
  place-items: center;
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  z-index: 1;
}

.chat-info-head {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  padding: 1.4rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.chat-info-head .chat-avatar {
  width: 4.5rem;
  height: 4.5rem;
  font-size: 1.3rem;
}

.chat-info-head .chat-head-name,
.chat-info-head strong {
  font-size: 1.05rem;
}

.chat-info-profile {
  margin-top: 0.4rem;
  text-decoration: none;
}

.chat-info-section {
  border-bottom: 1px solid var(--line);
}

.chat-info-section summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.chat-info-section summary::-webkit-details-marker {
  display: none;
}

.chat-info-section summary::after {
  content: "\f078";
  margin-left: auto;
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-size: 0.78rem;
  color: var(--muted);
}

.chat-info-section[open] summary::after {
  transform: rotate(180deg);
}

.chat-info-body {
  display: grid;
  gap: 0.6rem;
  padding: 0 1rem 1rem;
}

.chat-info-body p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.chat-info-body p strong {
  color: var(--text);
}

.chat-info-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.chat-info-media-thumb {
  display: block;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}

.chat-info-media-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 1280px) {
  .chat-layout.is-info-open {
    grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr) minmax(16rem, 20rem);
  }

  .chat-info-panel {
    position: relative;
    inset: auto;
    z-index: auto;
    border-left: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
  }

  .chat-info-close {
    display: none;
  }
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(9.5rem, 13rem) 2.35rem minmax(0, 1fr) auto;
  gap: 0.52rem;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
}

.chat-compose .primary-action {
  grid-column: 4;
  grid-row: 1;
  min-height: 2.4rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  box-shadow: 0 0.45rem 1.1rem rgba(var(--accent-rgb), 0.18);
}

.chat-compose select {
  min-width: 0;
  width: 100%;
  min-height: 2.4rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.chat-compose select option {
  background: #0b0d10;
  color: #fff;
}

.chat-compose textarea {
  min-width: 0;
  width: 100%;
  min-height: 2.4rem;
  max-height: 10rem;
  padding: 0.66rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  line-height: 1.35;
  overflow-y: auto;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chat-compose textarea:focus,
.chat-compose select:focus {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(255, 255, 255, 0.095);
}

.chat-image-picker {
  position: relative;
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
  cursor: pointer;
}

.chat-image-picker:hover,
.chat-image-picker:focus-within {
  border-color: rgba(var(--accent-rgb), 0.48);
  color: var(--accent);
}

.chat-image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chat-image-name {
  grid-column: 3 / 4;
  grid-row: 2;
  min-width: 0;
  margin-top: -0.32rem;
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-list {
  display: grid;
  min-width: 0;
  min-height: 0;
  align-content: start;
  gap: 0.42rem;
  padding: 1.05rem clamp(0.85rem, 2vw, 1.4rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message-row {
  min-width: 0;
  width: fit-content;
  max-width: min(72%, 42rem);
  padding: 0.62rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.05rem 1.05rem 1.05rem 0.28rem;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0.6rem 1.4rem rgba(0, 0, 0, 0.12);
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: break-word;
}

.message-row strong,
.message-row div,
.message-row small {
  min-width: 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.message-row strong {
  margin-bottom: 0.1rem;
  color: var(--soft);
  font-size: 0.78rem;
}

.message-row.mine {
  justify-self: end;
  border-color: rgba(var(--accent-rgb), 0.26);
  border-radius: 1.05rem 1.05rem 0.28rem 1.05rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-2-rgb), 0.18));
}

.message-row small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
}

.editor-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.message-image-link {
  display: block;
  width: 100%;
  max-width: min(22rem, 100%);
  margin: 0.45rem 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: calc(var(--radius) - 0.2rem);
  background: rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.message-image-link img {
  display: block;
  max-width: 100%;
  max-height: 20rem;
  object-fit: contain;
}

.message-row.message-row-image {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}

.message-row.message-row-image .message-image-link {
  margin: 0;
}

.message-row.message-row-image small {
  margin-top: 0.3rem;
  padding: 0 0.15rem;
}

.auth-layout {
  display: grid;
  width: min(100%, 83rem);
  grid-template-columns: minmax(25rem, 1fr) minmax(25rem, 33rem);
  grid-template-rows: 44rem;
  gap: 1.2rem;
  align-items: stretch;
}

.auth-visual {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 30, 0.92);
}

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

.auth-panel {
  align-content: center;
  padding: 1.8rem;
  overflow-y: auto;
}

.auth-brand {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}

.auth-brand img {
  display: block;
  width: 7rem;
  height: 7rem;
  object-fit: contain;
}

.auth-brand strong {
  display: block;
  font-size: 1.75rem;
}

.auth-brand span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-mode-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.auth-token-link {
  margin-top: 0.3rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  opacity: 0.85;
}

.auth-token-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.auth-panel .form-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0.25rem 0;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
}

.auth-panel .field {
  gap: 0.5rem;
}

.auth-panel .field label {
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.auth-panel .field input {
  min-height: 3.15rem;
  padding: 0.9rem 1rem;
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  font-size: 1rem;
}

.auth-panel .field input:focus {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.13);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.field textarea {
  min-height: 15rem;
  resize: vertical;
  font-family: var(--font-story);
  font-size: 1.03rem;
  line-height: 1.65;
}

.profile-edit-form .field textarea {
  min-height: 7rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.5;
}

.profile-editor-block {
  gap: 0.65rem;
  padding: 0.85rem;
}

.profile-editor-block .panel-title {
  align-items: center;
  margin-bottom: 0.1rem;
}

.profile-editor-block .profile-edit-form,
.profile-editor-block > .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.profile-editor-block .profile-edit-form .form-grid,
.profile-editor-block > .form-grid {
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.profile-editor-block .field {
  gap: 0.28rem;
}

.profile-editor-block .field input,
.profile-editor-block .field select,
.profile-editor-block .field textarea {
  min-height: 2.7rem;
  padding: 0.7rem 0.85rem;
}

.profile-editor-block .field textarea {
  min-height: 5rem;
}

.profile-editor-block .profile-edit-form.char-creator-form {
  gap: 0.9rem;
}

.profile-editor-block .char-creator-section-label {
  font-size: 0.66rem;
}

.profile-editor-block .char-creator-row.two-col {
  grid-template-columns: 1fr;
}

.profile-editor-block .char-creator-submit {
  width: auto;
  justify-self: start;
  padding: 0 1.5rem;
}

.profile-editor-block .upload-note {
  min-height: auto;
  padding: 0.65rem;
}

/* ── Character creator ─────────────────────────────────────── */
.char-creator-shell {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  padding: 0.25rem 0;
}

.char-creator-form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.char-creator-hero {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.4rem 1.5rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0%, transparent 100%);
  border-bottom: 1px solid var(--line);
}

.char-creator-avatar-preview {
  flex-shrink: 0;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 2px 14px rgba(var(--accent-rgb), 0.3);
}

.char-creator-hero-text {
  flex: 1;
  min-width: 0;
}

.char-creator-hero-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-creator-hero-role {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.char-creator-form {
  padding: 1.2rem 1.5rem;
  display: grid;
  gap: 1.1rem;
}

.char-creator-section {
  display: grid;
  gap: 0.55rem;
}

.char-creator-section-label {
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 0.28rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
}

.char-creator-row {
  display: grid;
  gap: 0.6rem;
}

.char-creator-row.two-col {
  grid-template-columns: 1fr 1fr;
}

.char-creator-row.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.char-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.char-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 2rem;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}

.char-status-pill:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.4);
}

.char-status-pill:has(input:checked) {
  color: var(--text);
}

.char-status-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

.char-status-pill[data-status="available"] .char-status-dot { background: #5fc97e; }
.char-status-pill[data-status="seeking"] .char-status-dot { background: #f5c06e; }
.char-status-pill[data-status="busy"] .char-status-dot { background: #f07575; }
.char-status-pill[data-status="paused"] .char-status-dot { background: #8898a8; }

.char-status-pill[data-status="available"]:has(input:checked) { border-color: #5fc97e; background: rgba(95, 201, 126, 0.1); }
.char-status-pill[data-status="seeking"]:has(input:checked) { border-color: #f5c06e; background: rgba(245, 192, 110, 0.1); }
.char-status-pill[data-status="busy"]:has(input:checked) { border-color: #f07575; background: rgba(240, 117, 117, 0.1); }
.char-status-pill[data-status="paused"]:has(input:checked) { border-color: #8898a8; background: rgba(136, 152, 168, 0.1); }

.char-creator-submit {
  width: 100%;
  min-height: 2.75rem;
  font-size: 0.95rem;
  font-weight: 800;
}

/* ── Character creator – preview panel ─────────────────────── */
.char-creator-preview-panel {
  position: sticky;
  top: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.char-creator-preview-label {
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.char-creator-preview-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.char-preview-header {
  height: 68px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2) 0%, rgba(var(--accent-3-rgb), 0.12) 100%);
}

.char-preview-avatar {
  position: absolute;
  top: 32px;
  left: 1rem;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  border: 3px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
}

.char-preview-body {
  padding: 2rem 1rem 1rem;
}

.char-preview-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.char-preview-role {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.char-preview-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(95, 201, 126, 0.12);
  color: #5fc97e;
  border: 1px solid rgba(95, 201, 126, 0.25);
}

.char-preview-status::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.char-preview-status.seeking { background: rgba(245, 192, 110, 0.1); color: #f5c06e; border-color: rgba(245, 192, 110, 0.3); }
.char-preview-status.busy { background: rgba(240, 117, 117, 0.1); color: #f07575; border-color: rgba(240, 117, 117, 0.3); }
.char-preview-status.paused { background: rgba(136, 152, 168, 0.1); color: #8898a8; border-color: rgba(136, 152, 168, 0.3); }

.char-preview-bio {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.char-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.55rem;
}

.char-preview-tag {
  padding: 0.14rem 0.42rem;
  border-radius: 0.28rem;
  font-size: 0.67rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
}

.char-creator-preview-hint {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  opacity: 0.6;
}

@media (max-width: 720px) {
  .char-creator-shell {
    grid-template-columns: 1fr;
  }

  .char-creator-preview-panel {
    display: none;
  }

  .char-creator-row.two-col,
  .char-creator-row.three-col {
    grid-template-columns: 1fr;
  }
}

.upload-field input[type="file"] {
  padding: 0.55rem;
}

.upload-note {
  display: grid;
  align-content: center;
  gap: 0.3rem;
  min-height: 5.6rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.08);
}

.upload-note strong,
.upload-note span {
  display: block;
}

.upload-note span {
  color: var(--muted);
  font-size: 0.84rem;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented button,
.segmented a {
  min-height: 2.25rem;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}

.segmented button:last-child,
.segmented a:last-child {
  border-right: 0;
}

.segmented button.is-selected,
.segmented a.is-selected {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

.moderation-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.moderation-table th,
.moderation-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.moderation-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.moderation-table tr:last-child td {
  border-bottom: 0;
}

.security-overview .panel-title h3,
#adminPanel .panel-title h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.security-overview .panel-title svg,
#adminPanel .panel-title svg {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}

.security-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem;
}

.security-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.security-stat:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  transform: translateY(-1px);
}

.security-stat svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--muted);
}

.security-stat strong {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.security-stat span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.security-stat.is-alert {
  border-color: rgba(239, 125, 125, 0.4);
  background: rgba(239, 125, 125, 0.08);
}

.security-stat.is-alert svg,
.security-stat.is-alert strong,
.security-stat.is-alert span {
  color: var(--danger);
}

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

.security-account-card {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 0.15s ease;
}

.security-account-card.has-alerts {
  border-color: rgba(239, 125, 125, 0.35);
}

.security-account-card:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.security-account-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.security-account-head .avatar {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 0.95rem;
}

.security-account-identity {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.security-account-identity strong {
  font-size: 0.95rem;
}

.security-account-identity span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-account-badges {
  display: flex;
  flex: 0 0 auto;
  gap: 0.4rem;
}

.security-account-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.security-cell-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.security-activity-cell,
.security-alerts-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.security-activity-cell span:not(.security-cell-label) {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--soft);
  font-size: 0.82rem;
}

.security-activity-cell svg,
.security-alerts-list svg {
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
  color: var(--muted);
}

.security-alerts-cell .status-pill {
  align-self: flex-start;
  gap: 0.35rem;
}

.security-alerts-cell .status-pill svg {
  width: 0.8rem;
  height: 0.8rem;
}

.security-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.76rem;
}

.security-account-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .security-account-head {
    flex-wrap: wrap;
  }

  .security-account-badges {
    width: 100%;
  }
}

.security-alerts-list li {
  display: block;
}

.security-alert-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.security-alert-row:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
}

.security-alert-row.status-reviewed {
  border-left-color: var(--info);
}

.security-alert-row.status-dismissed {
  border-left-color: var(--ok);
  opacity: 0.7;
}

.security-alert-row-main {
  font-size: 0.8rem;
  font-weight: 600;
}

.security-alert-row-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

.security-detail-panel {
  width: min(38rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.security-detail-panel .modal-head {
  padding: 1.4rem 1.6rem;
}

.security-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 1.6rem;
}

.security-detail-account {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}

.security-detail-account .avatar {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 0.95rem;
}

.security-detail-account > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.security-detail-account span {
  color: var(--muted);
  font-size: 0.8rem;
}

.security-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.security-detail-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.security-detail-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.security-detail-value {
  font-size: 0.88rem;
  word-break: break-word;
}

.security-detail-value.is-mono {
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 0.78rem;
  color: var(--soft);
}

.security-detail-note {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.security-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1.3rem 1.6rem;
  border-top: 1px solid var(--line);
}

.security-detail-status-actions .ghost-action,
.security-detail-actions .primary-action {
  min-height: 2.6rem;
}

.security-detail-status-actions {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.security-detail-status-actions .ghost-action {
  flex: 1;
  min-width: 9rem;
  justify-content: center;
}

.security-detail-actions .primary-action {
  flex: 0 0 auto;
}

@media (max-width: 540px) {
  .security-detail-actions .primary-action {
    flex: 1;
    width: 100%;
  }
}

.ghost-action.is-active {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

@media (max-width: 540px) {
  .security-detail-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 18rem;
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: var(--radius);
  background: #17231f;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.notification-toast-stack {
  position: fixed;
  left: 1rem;
  bottom: 6.5rem;
  z-index: 90;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  width: min(20rem, calc(100vw - 2rem));
  pointer-events: none;
}

.notification-toast-item {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.6rem;
  align-items: center;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: var(--radius);
  background: #17231f;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateX(-0.75rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
}

.notification-toast-item.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.notification-toast-item:hover {
  border-color: rgba(var(--accent-rgb), 0.7);
}

.notification-toast-avatar {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  flex-shrink: 0;
}

.notification-toast-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notification-toast-avatar svg,
.notification-toast-avatar i {
  width: 1.2rem;
  height: 1.2rem;
}

.notification-toast-text {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.notification-toast-text strong {
  font-size: 0.88rem;
}

.notification-toast-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-panel {
  position: fixed;
  top: 4.6rem;
  right: 1rem;
  z-index: 25;
  width: min(24rem, calc(100vw - 2rem));
  max-height: calc(100vh - 6rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notification-panel-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.notification-list {
  display: grid;
  gap: 0.5rem;
  max-height: 28rem;
  overflow: auto;
  padding: 0.75rem;
}

.notification-item {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  text-align: left;
}

.notification-item.is-unread {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.1);
}

.notification-item.is-clickable {
  cursor: pointer;
}

.notification-item.is-clickable:hover {
  border-color: rgba(var(--accent-2-rgb), 0.45);
  background: rgba(var(--accent-2-rgb), 0.1);
}

.notification-item strong,
.notification-item p,
.notification-item small {
  display: block;
}

.notification-item p {
  margin: 0.3rem 0;
  color: var(--soft);
  line-height: 1.35;
}

.notification-item small {
  color: var(--muted);
  font-size: 0.76rem;
}

.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(10px);
}

.modal-panel {
  width: min(42rem, 100%);
  max-height: min(44rem, calc(100vh - 2rem));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.modal-head h2,
.modal-head p {
  margin: 0;
}

.modal-head p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.modal-body {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.two-cols {
  grid-template-columns: 12rem 1fr;
}

.canon-rule-list {
  display: grid;
  gap: 0.7rem;
}

.canon-rule-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label remove"
    "desc remove";
  gap: 0.4rem 0.6rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.canon-rule-row .field:nth-child(1) {
  grid-area: label;
}

.canon-rule-row .field:nth-child(2) {
  grid-area: desc;
}

.canon-rule-row [data-remove-canon-rule] {
  grid-area: remove;
  align-self: center;
  color: var(--danger, #e05260);
}

.canon-rule-row [data-remove-canon-rule]:hover {
  background: var(--danger, #e05260);
  color: #fff;
}

.contact-picker {
  display: grid;
  gap: 0.5rem;
  max-height: 20rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.contact-option {
  display: grid;
  grid-template-columns: auto 2.5rem minmax(0, 1fr);
  min-width: 0;
  gap: 0.7rem;
  align-items: center;
  min-height: 4rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.contact-option:hover,
.contact-option:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.12);
}

.contact-option input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.contact-option strong,
.contact-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-option small {
  color: var(--muted);
}

.contact-list {
  display: grid;
  gap: 0.6rem;
}

.contact-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.14s;
}

.contact-row:hover {
  background: rgba(255, 255, 255, 0.055);
}

.contact-row .avatar {
  width: 3rem;
  height: 3rem;
}

.contacts-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.75rem;
}

.contacts-card-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.14s;
}

.contacts-card-cell:hover {
  background: rgba(255, 255, 255, 0.06);
}

.contacts-card-avatar {
  position: relative;
  display: block;
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
}

.contacts-card-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.presence-dot {
  position: absolute;
  right: 0.2rem;
  bottom: 0.2rem;
  display: none;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--muted);
}

.presence-dot.is-online {
  display: block;
  background: var(--ok);
  box-shadow: 0 0 0 1px rgba(134, 199, 121, 0.4);
}

.contacts-card-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--muted);
}

.contacts-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.contacts-card-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.contacts-card-remove {
  font-size: 0.78rem;
  min-height: 1.7rem;
  padding: 0 0.5rem;
  opacity: 0.45;
  transition: opacity 0.15s;
}

.contacts-card-remove:hover {
  opacity: 1;
}

.contact-row strong,
.contact-row small,
.contact-row-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-row-name {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.contact-row-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.public-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.25rem 0;
}

.contact-row small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.contact-row footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.auth-recovery-account {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 0.2rem;
}

.form-error {
  color: #f87171;
  font-size: 0.85rem;
}

.invite-friends-list {
  display: grid;
  gap: 0.5rem;
  max-height: 14rem;
  overflow-y: auto;
}

.invite-friend-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
}

.invite-friend-row span {
  flex: 1;
  font-weight: 600;
}

.relationship-partner-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.relationship-partner-link:hover {
  text-decoration: underline;
}

.relationship-partner-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.relationship-partner-chip span {
  flex: 1;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relationship-partner-avatar,
.relationship-candidate-avatar {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
}

.relationship-picker-card {
  display: grid;
  gap: 0.75rem;
}

.relationship-picker-card input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: var(--radius);
  outline: 0;
  background: #2f3033;
  color: #f2f0e8;
  font: inherit;
}

.relationship-picker-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.relationship-candidate-list {
  display: grid;
  gap: 0.5rem;
  max-height: 16rem;
  overflow-y: auto;
}

.relationship-candidate-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s;
}

.relationship-candidate-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.relationship-candidate-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.relationship-candidate-tag {
  font-size: 0.78rem;
  color: var(--muted);
  flex-shrink: 0;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 5.4rem minmax(0, 1fr);
  }

  .brand {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand span:last-child,
  .nav-link span.label,
  .identity-card div,
  .active-identity-banner div,
  .nav-subgroup {
    display: none;
  }

  .nav-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .nav-item.has-subnav .nav-link::after {
    display: none;
  }

  .nav-badge {
    position: absolute;
    margin-left: 2rem;
    margin-top: -1.8rem;
  }

  .identity-card,
  .active-identity-banner {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .identity-card .icon-button,
  .active-identity-banner .icon-button {
    display: none;
  }

  .grid.two,
  .feed-page,
  .feed-focus-layout,
  .feed-featured-layout {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .chat-layout {
    grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  }

  .profile-action-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-fact-layout {
    grid-template-columns: 1fr;
  }

  .profile-highlights {
    min-height: 15rem;
  }

  .auth-visual {
    height: 28rem;
  }

  .chat-list {
    display: block;
  }
}

@media (max-width: 1180px) {
  .photos-modal-albums {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    padding-bottom: 4.2rem;
  }

  .app-shell.is-chat-view .sidebar {
    display: block;
  }

  .topbar-brand {
    grid-template-columns: 2.2rem;
    gap: 0;
  }

  .topbar-brand span:last-child {
    display: none;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    inset: auto 0 0;
    display: block;
    width: 100%;
    height: auto;
    padding: 0.5rem;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand,
  .identity-card,
  .active-identity-banner {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    margin: 0;
  }

  .nav-link {
    min-height: 3.25rem;
  }

  .nav-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.4rem;
    margin: 0;
  }

  .toast {
    right: 0.6rem;
    bottom: 4.8rem;
    left: 0.6rem;
    max-width: none;
  }

  .notification-toast-stack {
    bottom: 5rem;
  }

  .nav-item:nth-child(n + 6):not(.is-more) {
    display: none;
  }

  .nav-subgroup,
  .nav-item.is-open .nav-subgroup {
    display: none;
  }

  .nav-item.has-subnav .nav-link::after {
    display: none;
  }

  .nav-item.is-more {
    display: flex;
  }

  .mobile-more-nav {
    display: none;
  }

  .sidebar.is-more-open .mobile-more-nav {
    display: grid;
    position: fixed;
    z-index: 11;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 4.4rem;
    gap: 0.25rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .mobile-more-nav .nav-link {
    grid-template-columns: 1.4rem 1fr;
    justify-items: stretch;
    min-height: 2.7rem;
    padding: 0 0.75rem;
  }

  .mobile-more-nav .nav-link span.label {
    display: inline;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
  }

  .topbar-left {
    gap: 0.5rem;
  }

  .topbar-left .search-wrap {
    min-width: 0;
  }

  .topbar-left .primary-action {
    width: 2.35rem;
    min-width: 2.35rem;
    padding: 0;
    font-size: 0;
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .notification-panel {
    top: 3.8rem;
    right: 0.6rem;
    width: min(24rem, calc(100vw - 1.2rem));
  }

  .topbar-profile-menu {
    top: 2.85rem;
    right: 0.6rem;
  }

  .groups-page .groups-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .groups-page .groups-hub-sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    width: 100%;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem;
    overflow-x: auto;
  }

  .groups-page .groups-hub-head {
    display: none;
  }

  .groups-page .groups-joined-head {
    flex: 0 0 auto;
    width: auto;
  }

  .groups-page .groups-list {
    display: flex;
    width: auto;
    overflow-x: auto;
    padding: 0 0 0 0.5rem;
  }

  .groups-page .group-list-item::after {
    display: none;
  }

  .content-shell {
    padding: 1rem;
  }

  .view-header {
    align-items: start;
    flex-direction: column;
  }

  .feed-list-compact {
    grid-template-columns: 1fr;
  }

  .feed-activity-row {
    grid-template-columns: 2.35rem minmax(0, 1fr);
    align-items: start;
  }

  .feed-activity-time,
  .feed-activity-row .ghost-action {
    grid-column: 2;
    justify-self: start;
  }

  .scenes-workbench {
    grid-template-columns: 1fr;
  }

  .scene-queue-panel {
    position: static;
  }

  .scene-inbox-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .scene-row-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .grid.three,
  .form-grid,
  .sheet-grid {
    grid-template-columns: 1fr;
  }

  .hero-body {
    grid-template-columns: 7.5rem 1fr;
  }

  .hero-body .avatar {
    width: 7.5rem;
    height: 7.5rem;
  }

  .hero-body .avatar-menu-wrap {
    transform: translateY(-3.75rem);
  }

  .hero-body .secondary-action,
  .profile-hero-actions {
    grid-column: 1 / -1;
  }

  .profile-hero-actions {
    justify-content: stretch;
  }

  .profile-hero-actions .secondary-action {
    flex: 1;
  }

  .profile-fact-list {
    grid-template-columns: 1fr;
  }

  .profile-fact-row {
    grid-template-columns: 1.55rem minmax(6rem, 0.42fr) minmax(0, 1fr);
  }

  .profile-lower-layout {
    grid-template-columns: 1fr;
  }

  .photo-album-grid {
    grid-template-columns: 1fr;
  }

  .photos-modal-albums {
    grid-template-columns: 1fr;
  }

  .profile-highlight-track {
    grid-auto-columns: minmax(10rem, 68%);
  }

  .profile-highlights {
    min-height: 12rem;
  }

  .profile-action-strip {
    grid-template-columns: 1fr;
  }

  .message-row {
    max-width: 92%;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(7rem, 9.5rem) minmax(0, 1fr);
    height: calc(100vh - 13.5rem);
    max-height: calc(100vh - 13.5rem);
  }

  .chat-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }

  .chat-compose .primary-action,
  .chat-image-name {
    grid-column: 1;
    grid-row: auto;
  }

  .chat-compose .primary-action {
    width: 100%;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    justify-content: stretch;
  }

  .modal-actions button {
    flex: 1;
  }

  .avatar-modal-body {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .avatar-photo-container {
    height: 62vh;
  }

  .avatar-expanded-frame {
    height: 62vh;
    min-height: 0;
  }

  .avatar-side-container {
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 38vh;
    min-height: 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .media-nav-button.is-prev {
    left: 0.75rem;
  }

  .media-nav-button.is-next {
    right: 0.75rem;
  }
}

@media (min-width: 761px) {
  .app-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    padding-left: 18rem;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: 18rem;
    height: 100dvh;
    min-height: 0;
    overflow: hidden auto;
    overscroll-behavior: contain;
    padding: 1rem;
  }

  .main-area {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .brand span:last-child,
  .nav-link span.label,
  .identity-card div,
  .active-identity-banner div {
    display: block;
  }

  .nav-subgroup {
    display: none;
  }

  .nav-item.is-open .nav-subgroup {
    display: grid;
  }

  .brand {
    grid-template-columns: 2.6rem 1fr;
    gap: 0.72rem;
    min-height: 2.6rem;
  }

  .brand strong {
    font-size: 1.28rem;
  }

  .brand small {
    font-size: 0.78rem;
  }

  .brand-mark,
  .brand-mark img {
    width: 2.6rem;
    height: 2.6rem;
  }

  .nav-list {
    gap: 0.25rem;
    margin-top: 1.4rem;
  }

  .nav-link {
    grid-template-columns: 1.4rem 1fr auto;
    justify-items: stretch;
    min-height: 2.7rem;
    padding: 0 0.75rem;
    gap: 0.7rem;
    font-size: 1rem;
  }

  .nav-item.has-subnav .nav-link::after {
    display: block;
  }

  .nav-badge {
    position: static;
    margin: 0;
  }

  .identity-card,
  .active-identity-banner {
    display: grid;
    grid-template-columns: 2.5rem 1fr 2.2rem;
    gap: 0.7rem;
    justify-items: stretch;
    padding: 0.8rem;
  }

  .identity-card {
    margin-top: auto;
  }

  .identity-card .icon-button,
  .active-identity-banner .icon-button {
    display: inline-flex;
  }

  .mini-avatar {
    width: 2.5rem;
    height: 2.5rem;
  }

  .topbar {
    padding: 0.48rem 0.8rem;
    grid-template-columns: minmax(18rem, 1fr) auto;
  }

  .topbar-left {
    gap: 0.38rem;
  }

  .topbar-left .search-wrap {
    min-width: 10rem;
  }

  .search-wrap {
    min-height: 2.05rem;
    padding: 0 0.62rem;
    font-size: 0.88rem;
  }

  .topbar-actions {
    gap: 0.38rem;
  }

  .primary-action,
  .secondary-action,
  .ghost-action {
    min-height: 1.95rem;
    padding-inline: 0.58rem;
    font-size: 0.84rem;
  }

  .content-shell {
    width: min(100%, 96rem);
    padding: 1rem;
  }

  .view-header {
    min-height: 3.25rem;
    margin-bottom: 0.72rem;
  }

  .view-header h1 {
    font-size: 1.58rem;
  }

  .grid,
  .panel,
  .editor-panel {
    gap: 0.68rem;
  }

  .panel,
  .post-card,
  .profile-hero,
  .editor-panel,
  .document-card,
  .character-card,
  .community-card {
    padding: 0.72rem;
  }

  .metric-grid,
  .character-grid,
  .community-grid,
  .document-grid {
    gap: 0.62rem;
  }

  .metric-card {
    min-height: 4.85rem;
    padding: 0.68rem;
  }

  .metric-card strong {
    font-size: 1.35rem;
  }

  .post-head {
    grid-template-columns: 2.45rem 1fr auto;
    gap: 0.58rem;
    margin-bottom: 0.5rem;
  }

  .avatar {
    width: 2.45rem;
    height: 2.45rem;
  }

  .story-text {
    margin: 0.48rem 0;
    font-size: 0.96rem;
    line-height: 1.52;
  }

  .tag,
  .status-pill {
    min-height: 1.55rem;
    font-size: 0.7rem;
  }

  .hero-cover {
    height: clamp(13rem, 24vw, 22rem);
  }

  .hero-body {
    grid-template-columns: 10rem 1fr auto;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem 0.85rem;
    margin-top: 0;
  }

  .hero-body .avatar {
    width: 10rem;
    height: 10rem;
  }

  .hero-body h2 {
    font-size: 1.42rem;
  }

  .form-grid {
    gap: 0.58rem;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 2.25rem;
  }

  .chat-layout {
    grid-template-columns: 18rem minmax(0, 1fr);
    min-height: 30rem;
  }

  .chat-item {
    padding: 0.62rem;
  }

  .message-row {
    padding: 0.68rem;
  }

  .auth-layout {
    grid-template-columns: minmax(22rem, 0.94fr) minmax(25rem, 33rem);
  }

  .auth-panel .field input {
    min-height: 3rem;
  }
}

.groups-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 76% 0%, rgba(var(--accent-rgb), 0.14), transparent 26rem),
    var(--bg);
}

.groups-shell {
  display: grid;
  grid-template-columns: 14.4rem minmax(0, 1fr);
  min-height: 100vh;
}

.groups-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 0.55rem;
  border-right: 1px solid var(--line);
  background: rgba(10, 11, 13, 0.94);
}

.groups-nav {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.65rem;
}

.groups-main {
  min-width: 0;
}

.groups-topbar {
  position: sticky;
  z-index: 6;
  top: 0;
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) auto;
  gap: 0.38rem;
  align-items: center;
  padding: 0.48rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 18, 0.94);
  backdrop-filter: blur(14px);
}

.groups-topbar .search-wrap {
  max-width: 36rem;
  min-height: 2.05rem;
  padding: 0 0.62rem;
  font-size: 0.88rem;
}

.groups-board {
  display: grid;
  gap: 0.8rem;
  width: min(100%, 96rem);
  margin: 0 auto;
  padding: 1rem;
}

.groups-board-head {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
}

.groups-board-head h1,
.groups-board-head p {
  margin: 0;
}

.groups-board-head h1 {
  font-size: 1.55rem;
}

.groups-board-head > div:first-child p:last-child {
  color: var(--muted);
}

.groups-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: end;
}

.groups-summary span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  font-size: 0.84rem;
}

.groups-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
}

.groups-list-panel {
  position: sticky;
  top: 4.6rem;
  max-height: calc(100vh - 5.6rem);
  overflow: hidden;
}

.groups-list {
  display: grid;
  gap: 0.45rem;
  max-height: calc(100vh - 10rem);
  overflow: auto;
  padding-right: 0.2rem;
}

.group-list-item {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  width: 100%;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.group-list-item:hover,
.group-list-item.is-active {
  border-color: rgba(var(--accent-rgb), 0.58);
  background: rgba(var(--accent-rgb), 0.12);
}

.group-list-avatar,
.group-avatar {
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.28), rgba(255, 255, 255, 0.08));
  color: var(--text);
  font-weight: 900;
}

.group-list-avatar {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.76rem;
}

.group-list-item strong,
.group-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-list-item small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.group-front {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.group-discover-view {
  padding: 2rem 1.5rem;
}

.group-discover-view h2 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
}

.group-discover-hint {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.group-discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}

.group-discover-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.group-discover-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.group-discover-card-meta {
  min-width: 0;
}

.group-discover-card-meta h3 {
  margin: 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-discover-card-meta p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.group-discover-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.group-discover-card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
}

.group-hero-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 30, 0.92);
}

.group-cover {
  min-height: 10rem;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(10, 11, 13, 0.3)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 18px),
    #0b0d10;
  background-position: center;
  background-size: cover;
}

.group-hero-body {
  display: grid;
  grid-template-columns: 4.1rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
}

.group-avatar {
  width: 4.1rem;
  height: 4.1rem;
}

.group-hero-body h2,
.group-hero-body p {
  margin: 0;
}

.group-hero-body p {
  color: var(--muted);
}

.group-front-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: 0.8rem;
  align-items: start;
}

.group-feed {
  display: grid;
  gap: 0.7rem;
}

.group-post-card {
  min-height: auto;
}

.compact-card {
  display: grid;
  gap: 0.18rem;
  padding: 0.62rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.compact-card > span:first-child {
  color: var(--accent);
}

.compact-card small,
.compact-card span {
  color: var(--muted);
}

.group-composer-card {
  width: min(38rem, calc(100vw - 2rem));
}

@media (max-width: 1060px) {
  .groups-shell {
    grid-template-columns: 5.4rem minmax(0, 1fr);
  }

  .groups-sidebar .brand span:not(.brand-mark),
  .groups-sidebar .identity-card div,
  .groups-sidebar .nav-link .label {
    display: none;
  }

  .groups-sidebar .nav-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .groups-sidebar .nav-subgroup {
    display: none;
  }

  .groups-sidebar .nav-link .liria-fa {
    margin: auto;
    font-size: 1rem;
  }

  .groups-layout,
  .group-front-grid {
    grid-template-columns: 1fr;
  }

  .groups-list-panel {
    position: static;
    max-height: none;
  }

  .groups-list {
    max-height: 18rem;
  }
}

@media (max-width: 760px) {
  .groups-shell {
    display: block;
    padding-bottom: 4.2rem;
  }

  .groups-sidebar {
    position: fixed;
    z-index: 10;
    inset: auto 0 0;
    display: block;
    width: 100%;
    height: 4rem;
    padding: 0.4rem;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .groups-sidebar .brand,
  .groups-sidebar .identity-card {
    display: none;
  }

  .groups-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin: 0;
  }

  .groups-nav .nav-item:nth-child(n + 6) {
    display: none;
  }

  .groups-topbar {
    grid-template-columns: 1fr;
  }

  .groups-topbar .topbar-actions {
    display: flex;
  }

  .groups-board {
    padding: 0.8rem;
  }

  .groups-board-head,
  .group-hero-body {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* ── Settings / Privacy / Admin panel ─────────────────────────────── */

.app-loading {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 2rem;
  background: var(--bg);
  text-align: center;
  color: var(--accent);
}

.app-loading img {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  filter: drop-shadow(0 0 1.6rem rgba(var(--accent-rgb), 0.45));
  animation: app-loading-pulse 1.6s ease-in-out infinite;
}

.app-loading span {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

@keyframes app-loading-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

.loading-state {
  padding: 2rem;
  text-align: center;
  color: var(--soft);
}

.settings-form {
  display: grid;
  gap: 1rem;
}

.settings-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--soft);
}

.settings-form select,
.settings-form input[type="password"] {
  width: 100%;
  min-height: 2.3rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

.settings-form select:focus,
.settings-form input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.settings-grid {
  align-content: start;
}

.settings-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

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

.session-list {
  display: grid;
  gap: 0.4rem;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.session-row.session-current {
  border-color: rgba(134, 199, 121, 0.35);
}

.session-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
}

.session-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.session-info {
  display: grid;
  flex: 1;
  gap: 0.2rem;
  min-width: 0;
}

.session-info strong {
  font-size: 0.875rem;
}

.session-info span {
  font-size: 0.75rem;
  color: var(--soft);
}

.session-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.6rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.session-empty svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--muted);
}

.session-empty p {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
}

.session-empty small {
  color: var(--muted);
  font-size: 0.76rem;
}

.danger-zone {
  border-color: rgba(239, 143, 168, 0.3);
}

.danger-zone p {
  font-size: 0.875rem;
  color: var(--soft);
  margin: 0 0 1rem;
}

.ghost-action.danger {
  color: var(--danger);
  border-color: rgba(239, 143, 168, 0.3);
}

.ghost-action.danger:hover {
  background: rgba(239, 143, 168, 0.1);
  border-color: rgba(239, 143, 168, 0.5);
}

.primary-action.danger {
  border-color: rgba(239, 143, 168, 0.5);
  background: rgba(239, 143, 168, 0.15);
  color: var(--danger);
}

.primary-action.danger:hover {
  background: rgba(239, 143, 168, 0.25);
}

.app-confirm-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.app-confirm-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--soft);
}

