/* Meydan v1.3 - controlled release layer */

:root {
  --v13-bg-canvas: #070b12;
  --v13-bg-sidebar: #0a0f18;
  --v13-surface-1: #101722;
  --v13-surface-2: #151e2b;
  --v13-surface-3: #1b2635;
  --v13-border-soft: rgba(226, 238, 251, .10);
  --v13-border-strong: rgba(126, 218, 237, .32);
  --v13-text-1: #f3f7fb;
  --v13-text-2: #a7b4c5;
  --v13-text-3: #7f8da0;
  --v13-accent-lime: #cfff8d;
  --v13-accent-cyan: #72dfee;
  --v13-accent-violet: #b69cff;
  --v13-success: #8fea70;
  --v13-warning: #ffc568;
  --v13-danger: #ff7184;
  --v13-focus: #8be9f5;
  --v13-on-accent: #09130b;
  --v13-shadow-panel: 0 22px 58px rgba(0, 0, 0, .38);
  --v13-gradient-accent: linear-gradient(145deg, var(--v13-accent-lime), var(--v13-accent-cyan));
  --v13-density-compact-gap: 8px;
  --v13-density-compact-padding: 12px;
  --v13-density-default-gap: 14px;
  --v13-density-default-padding: 18px;
  --v13-density-comfortable-gap: 20px;
  --v13-density-comfortable-padding: 28px;
  --v13-type-display: clamp(30px, 3.4vw, 54px);
  --v13-type-title: clamp(22px, 2.1vw, 34px);
  --v13-type-heading: 17px;
  --v13-type-body: 13px;
  --v13-type-helper: 11px;
  --v13-type-label: 10px;
  --v13-leading-tight: 1.08;
  --v13-leading-body: 1.55;
}

/* Item 75: simple, privacy-forward support reporting. */
.support-field {
  display: grid;
  gap: 7px;
}

.support-field > span {
  color: var(--v13-text-2);
  font-size: var(--v13-type-helper);
  font-weight: 900;
  letter-spacing: .05em;
}

.support-diagnostics-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid color-mix(in srgb, var(--v13-accent-cyan) 24%, transparent);
  border-radius: 14px;
  padding: 11px 13px;
  background: color-mix(in srgb, var(--v13-accent-cyan) 5%, transparent);
  cursor: pointer;
}

.support-diagnostics-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--v13-accent-lime);
}

.support-diagnostics-choice span,
.support-diagnostics-choice small {
  display: block;
}

.support-diagnostics-choice small,
.support-send-status {
  margin: 3px 0 0;
  color: var(--v13-text-3);
  font-size: var(--v13-type-helper);
  line-height: 1.45;
}

.support-diagnostics-detail {
  border: 1px solid color-mix(in srgb, var(--v13-accent-cyan) 24%, transparent);
  border-radius: 14px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--v13-accent-cyan) 4%, transparent);
}

.support-diagnostics-detail summary {
  cursor: pointer;
  color: var(--v13-text-1);
  font-weight: 900;
}

.support-diagnostics-detail pre {
  overflow: auto;
  max-height: 260px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--v13-text-2);
  font-size: 10px;
  line-height: 1.5;
}

.support-diagnostics-empty {
  color: var(--v13-text-3);
  font-size: var(--v13-type-helper);
}

/* Item 76: admin landing page with health and risk triage. */
.admin-overview {
  display: grid;
  gap: 16px;
}

.admin-overview[hidden] { display: none; }

.admin-global-search { position: relative; display: grid; gap: 7px; }
.admin-global-search label { color: var(--v13-accent-cyan); font-size: var(--v13-type-label); font-weight: 950; letter-spacing: .13em; }
.admin-global-search input { width: 100%; border: 1px solid var(--v13-border-strong); border-radius: 14px; padding: 0 15px; color: var(--v13-text-1); background: var(--v13-bg-canvas); }
.admin-global-search-results { position: absolute; z-index: 12; top: calc(100% + 8px); right: 0; left: 0; display: grid; gap: 6px; max-height: min(460px, 52vh); overflow: auto; border: 1px solid var(--v13-border-strong); border-radius: 16px; padding: 8px; background: color-mix(in srgb, var(--v13-surface-1) 97%, transparent); box-shadow: var(--v13-shadow-panel); }
.admin-global-search-results[hidden] { display: none; }
.admin-global-search-results button { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-width: 0; border: 1px solid var(--v13-border-soft); border-radius: 12px; padding: 10px 12px; color: var(--v13-text-1); background: var(--v13-surface-2); text-align: left; }
.admin-global-search-results button > b { color: var(--v13-accent-cyan); font-size: var(--v13-type-label); letter-spacing: .08em; }
.admin-global-search-results button > span { display: grid; gap: 3px; min-width: 0; }
.admin-global-search-results button small { color: var(--v13-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-global-search-results button em { color: var(--v13-accent-lime); font-size: var(--v13-type-helper); font-style: normal; font-weight: 900; }

#adminDialog .admin-guard {
  border-color: color-mix(in srgb, var(--v13-warning) 34%, var(--v13-border-soft));
  background: linear-gradient(135deg, color-mix(in srgb, var(--v13-warning) 8%, var(--v13-surface-1)), var(--v13-surface-1));
}

#adminDialog .admin-guard > div span { color: var(--v13-warning); }
#adminDialog .admin-guard textarea { min-height: 70px; resize: vertical; }

.admin-announcement-center {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 18px;
}
.admin-announcement-composer,
.admin-announcement-preview,
.admin-announcement-history {
  border: 1px solid var(--v13-border-soft);
  border-radius: 18px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--v13-surface-2) 92%, var(--v13-accent-cyan) 8%), var(--v13-surface-1));
  padding: 18px;
}
.admin-announcement-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-announcement-fields label { display: grid; gap: 7px; color: var(--v13-text-2); font-size: var(--v13-type-label); font-weight: 800; letter-spacing: .08em; }
.admin-announcement-fields .wide { grid-column: 1 / -1; }
.admin-announcement-fields input,
.admin-announcement-fields select,
.admin-announcement-fields textarea { width: 100%; }
.admin-announcement-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.admin-announcement-preview { align-self: start; min-height: 240px; display: flex; flex-direction: column; justify-content: center; gap: 12px; position: sticky; top: 8px; overflow: hidden; }
.admin-announcement-preview::after { content: ""; position: absolute; width: 180px; height: 180px; right: -70px; bottom: -90px; border-radius: 50%; background: color-mix(in srgb, var(--v13-accent-cyan) 22%, transparent); filter: blur(24px); pointer-events: none; }
.admin-announcement-preview > * { position: relative; z-index: 1; }
.admin-announcement-preview span,
.admin-announcement-history .section-title > span { color: var(--v13-accent-cyan); font-size: var(--v13-type-label); font-weight: 900; letter-spacing: .14em; }
.admin-announcement-preview strong { color: var(--v13-text-1); font-size: clamp(22px, 2.4vw, 34px); line-height: 1.05; }
.admin-announcement-preview p { color: var(--v13-text-2); line-height: 1.55; white-space: pre-wrap; }
.admin-announcement-preview small { color: var(--v13-accent-cyan); font-weight: 800; }
.admin-announcement-history { grid-column: 1 / -1; }
#adminAnnouncementHistoryList { display: grid; gap: 10px; }
#adminAnnouncementHistoryList article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--v13-border-soft); border-radius: 14px; background: var(--v13-surface-1); }
#adminAnnouncementHistoryList article > div { display: grid; gap: 5px; min-width: 0; }
#adminAnnouncementHistoryList article span { color: var(--v13-accent-cyan); font-size: var(--v13-type-label); font-weight: 900; letter-spacing: .08em; }
#adminAnnouncementHistoryList article strong { color: var(--v13-text-1); font-size: var(--v13-type-heading); }
#adminAnnouncementHistoryList article p { color: var(--v13-text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
#adminAnnouncementHistoryList article small { color: var(--v13-text-3); }
#adminAnnouncementHistoryList article.cancelled { opacity: .72; }
#adminAnnouncementHistoryList article.sent { border-color: color-mix(in srgb, var(--v13-success) 38%, var(--v13-border-soft)); }
@media (max-width: 920px) {
  .admin-announcement-center { grid-template-columns: 1fr; }
  .admin-announcement-preview { position: static; min-height: 190px; }
}
@media (max-width: 620px) {
  .admin-announcement-fields { grid-template-columns: 1fr; }
  .admin-announcement-fields .wide { grid-column: auto; }
  .admin-announcement-actions { flex-direction: column; }
  #adminAnnouncementHistoryList article { grid-template-columns: 1fr; }
}

#adminDialog .admin-audit .admin-filters.compact {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(130px, 1fr));
  gap: 10px;
}
@media (max-width: 1100px) {
  #adminDialog .admin-audit .admin-filters.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #adminDialog .admin-audit #adminAuditSearch { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  #adminDialog .admin-audit .admin-filters.compact { grid-template-columns: 1fr; }
  #adminDialog .admin-audit #adminAuditSearch { grid-column: auto; }
}

.admin-access-security {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 18px;
  background: color-mix(in srgb, var(--v13-warning) 4%, var(--v13-surface-1));
}
.admin-suspicious-login-list { display: grid; gap: 8px; }
.admin-suspicious-login-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--v13-warning) 26%, var(--v13-border-soft));
  border-radius: 13px;
  background: var(--v13-surface-1);
}
.admin-suspicious-login-list article > b { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--v13-warning); background: color-mix(in srgb, var(--v13-warning) 12%, transparent); }
.admin-suspicious-login-list article > div { display: grid; gap: 3px; min-width: 0; }
.admin-suspicious-login-list article strong { color: var(--v13-text-1); }
.admin-suspicious-login-list article small { color: var(--v13-text-3); overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .admin-suspicious-login-list article { grid-template-columns: 38px minmax(0, 1fr); }
  .admin-suspicious-login-list article button { grid-column: 1 / -1; }
}

.admin-overview-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 140px;
  border: 1px solid var(--v13-border-strong);
  border-radius: 22px;
  padding: 24px;
  background:
    radial-gradient(circle at 90% 20%, color-mix(in srgb, var(--v13-accent-cyan) 18%, transparent), transparent 34%),
    linear-gradient(135deg, var(--v13-surface-1), color-mix(in srgb, var(--v13-surface-2) 88%, var(--v13-accent-lime)));
}

.admin-overview-hero div { display: grid; gap: 7px; }
.admin-overview-hero span { color: var(--v13-accent-cyan); font-size: var(--v13-type-label); font-weight: 950; letter-spacing: .14em; }
.admin-overview-hero strong { color: var(--v13-text-1); font-size: clamp(23px, 3vw, 38px); }
.admin-overview-hero small { color: var(--v13-text-2); font-size: var(--v13-type-body); }
.admin-overview-hero > b { display: grid; place-items: center; width: 92px; aspect-ratio: 1; border: 1px solid currentColor; border-radius: 26px; font-size: 25px; box-shadow: 0 0 38px color-mix(in srgb, currentColor 18%, transparent); }
.admin-overview-hero > b.healthy { color: var(--v13-success); }
.admin-overview-hero > b.warning { color: var(--v13-warning); }
.admin-overview-hero > b.critical { color: var(--v13-danger); }

.admin-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-overview-metrics article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 16px;
  padding: 15px;
  background: var(--v13-surface-1);
}

.admin-overview-metrics span,
.admin-overview-layout header span { color: var(--v13-text-3); font-size: var(--v13-type-label); font-weight: 950; letter-spacing: .12em; }
.admin-overview-metrics strong { color: var(--v13-text-1); font-size: 22px; }
.admin-overview-metrics small { color: var(--v13-text-3); }

.admin-overview-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: 14px; }
.admin-overview-layout > section { min-width: 0; border: 1px solid var(--v13-border-soft); border-radius: 18px; padding: 16px; background: color-mix(in srgb, var(--v13-surface-1) 92%, transparent); }
.admin-overview-layout header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-overview-layout header strong { color: var(--v13-text-1); }
.admin-overview-risks,
.admin-overview-shortcuts { display: grid; gap: 8px; }
.admin-overview-risks article,
.admin-overview-shortcuts button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; min-width: 0; border: 1px solid var(--v13-border-soft); border-radius: 13px; padding: 11px; background: var(--v13-surface-2); text-align: left; }
.admin-overview-risks article.high { border-color: color-mix(in srgb, var(--v13-danger) 45%, transparent); }
.admin-overview-risks article.warn { border-color: color-mix(in srgb, var(--v13-warning) 38%, transparent); }
.admin-overview-risks article.ok { border-color: color-mix(in srgb, var(--v13-success) 36%, transparent); }
.admin-overview-risks article > b,
.admin-overview-shortcuts button > b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--v13-accent-cyan); background: color-mix(in srgb, var(--v13-accent-cyan) 10%, transparent); }
.admin-overview-risks div,
.admin-overview-shortcuts span { display: grid; gap: 3px; min-width: 0; }
.admin-overview-risks small,
.admin-overview-shortcuts small { color: var(--v13-text-3); overflow-wrap: anywhere; }

@media (max-width: 780px) {
  .admin-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-overview-layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .admin-overview-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
  .admin-overview-hero > b { width: 72px; border-radius: 20px; }
  .admin-overview-metrics { grid-template-columns: 1fr; }
  .admin-overview-risks article { grid-template-columns: auto minmax(0, 1fr); }
  .admin-overview-risks article button { grid-column: 1 / -1; width: 100%; }
  .admin-global-search-results button { grid-template-columns: 1fr auto; }
  .admin-global-search-results button > b { grid-column: 1 / -1; }
}

/* Shared server Lounge preferences and seating */
.lounge-settings-fieldset {
  margin: 8px 0 16px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent, #a7ff4f) 30%, #263143);
  border-radius: 16px;
  background: color-mix(in srgb, #101722 92%, var(--accent, #a7ff4f));
}
.lounge-settings-fieldset legend {
  padding: 0 8px;
  color: var(--accent, #a7ff4f);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
}
.lounge-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.voice-stage[data-lounge-layout="circle"] .seat-1 { left: 50%; bottom: 58px; transform: translateX(-50%); }
.voice-stage[data-lounge-layout="circle"] .seat-2 { left: 27%; bottom: 88px; }
.voice-stage[data-lounge-layout="circle"] .seat-3 { right: 27%; bottom: 88px; }
.voice-stage[data-lounge-layout="circle"] .seat-4 { left: 17%; bottom: 178px; }
.voice-stage[data-lounge-layout="circle"] .seat-5 { right: 17%; bottom: 178px; }
.voice-stage[data-lounge-layout="circle"] .seat-6 { left: 34%; bottom: 230px; top: auto; }
.voice-stage[data-lounge-layout="circle"] .seat-7 { right: 34%; bottom: 230px; top: auto; }
.voice-stage[data-lounge-layout="theater"] .seat-1 { left: 20%; bottom: 58px; transform: none; }
.voice-stage[data-lounge-layout="theater"] .seat-2 { left: 40%; bottom: 58px; }
.voice-stage[data-lounge-layout="theater"] .seat-3 { right: 20%; bottom: 58px; }
.voice-stage[data-lounge-layout="theater"] .seat-4 { left: 12%; bottom: 172px; }
.voice-stage[data-lounge-layout="theater"] .seat-5 { left: 35%; bottom: 172px; right: auto; }
.voice-stage[data-lounge-layout="theater"] .seat-6 { right: 35%; bottom: 172px; top: auto; left: auto; }
.voice-stage[data-lounge-layout="theater"] .seat-7 { right: 12%; bottom: 172px; top: auto; }
@media (max-width: 760px) {
  .lounge-settings-grid { grid-template-columns: 1fr; }
}

/* Watch-together owner and viewer controls */
.screen-share-status[data-role="owner"] {
  border-color: color-mix(in srgb, var(--v13-success, #a7ff4f) 55%, var(--v13-border, #273244));
}
.screen-share-status[data-role="viewer"] {
  border-color: color-mix(in srgb, var(--v13-info, #5ee7f2) 55%, var(--v13-border, #273244));
}
#screenShareRoleBadge {
  color: var(--v13-canvas, #081018);
  background: var(--v13-info, #5ee7f2);
}
.screen-share-status[data-role="owner"] #screenShareRoleBadge {
  background: var(--v13-success, #a7ff4f);
}
.screen-share-actions .role-hidden {
  display: none !important;
}
.screen-share-status[data-role="owner"] #stopScreenShareButton {
  color: #fff;
  border-color: color-mix(in srgb, var(--v13-danger, #ff6474) 65%, transparent);
  background: color-mix(in srgb, var(--v13-danger, #ff6474) 20%, var(--v13-surface-2, #131c29));
}

/* Real weekly Arcade tournament */
.arcade-tournament {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.5fr);
  gap: 18px;
  margin: 18px 0;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--v13-info, #5ee7f2) 36%, var(--v13-border, #273244));
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 50%, color-mix(in srgb, var(--v13-info, #5ee7f2) 14%, transparent), transparent 42%),
    linear-gradient(135deg, var(--v13-surface-2, #121a27), color-mix(in srgb, var(--v13-surface-2, #121a27) 88%, var(--v13-success, #a7ff4f)));
}
.arcade-tournament-copy span,
.arcade-tournament-metrics span {
  color: var(--v13-info, #5ee7f2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}
.arcade-tournament-copy h3 { margin: 8px 0; font-size: clamp(21px, 2vw, 30px); }
.arcade-tournament-copy p { margin: 0; color: var(--v13-text-2, #aeb9c9); }
.arcade-tournament-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.arcade-tournament-metrics article {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--v13-border, #273244);
  border-radius: 16px;
  background: color-mix(in srgb, var(--v13-canvas, #081018) 60%, transparent);
}
.arcade-tournament-metrics strong { font-size: clamp(17px, 1.5vw, 23px); }
.arcade-tournament-metrics small { color: var(--v13-text-3, #8793a6); }
.arcade-tournament-loading { display: grid; gap: 5px; grid-column: 1 / -1; }
@media (max-width: 900px) {
  .arcade-tournament { grid-template-columns: 1fr; }
  .arcade-tournament-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Item 17: one semantic button hierarchy across static and dynamic actions. */
:where(button, .create-btn, .primary-action)[data-button-variant],
:where(button, .create-btn, .primary-action) {
  min-height: 40px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, opacity .16s ease;
}

:where(button, .create-btn, .primary-action)[data-button-variant="primary"],
:where(.create-btn, .primary-action) {
  color: var(--v13-on-accent);
  border-color: transparent;
  background: var(--v13-gradient-accent);
}

button[data-button-variant="secondary"] {
  color: var(--v13-text-1);
  border-color: var(--v13-border-strong);
  background: color-mix(in srgb, var(--v13-accent-cyan) 9%, var(--v13-surface-1));
}

button[data-button-variant="ghost"],
button.ghost {
  color: var(--v13-text-2);
  border-color: var(--v13-border-soft);
  background: transparent;
}

button[data-button-variant="danger"],
button.danger {
  color: #ffdce1;
  border-color: color-mix(in srgb, var(--v13-danger) 40%, transparent);
  background: color-mix(in srgb, var(--v13-danger) 12%, var(--v13-surface-1));
}

:where(button, .create-btn, .primary-action):not(:disabled):hover {
  transform: translateY(-1px);
  border-color: var(--v13-border-strong);
}

:where(button, .create-btn, .primary-action):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--v13-focus) 40%, transparent);
  outline-offset: 2px;
}

:where(input, textarea, select, a[href], summary, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--v13-focus) 46%, transparent);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--v13-focus) 12%, transparent);
}

dialog[open]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--v13-focus) 35%, transparent);
  outline-offset: -2px;
}

/* v1.3 readable type and reliable pointer targets */
:where(#loginScreen, .app, dialog) :where(small, .dialog-note, .settings-lead) {
  font-size: max(10px, .625rem);
  line-height: 1.45;
}

:where(#loginScreen, .app, dialog) :where(.kicker, label:not(.setting-toggle):not(.recovery-confirm)) {
  font-size: max(10px, .625rem);
}

:where(#loginScreen, .app, dialog) :where(button, select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), summary, a[href], [role="button"]) {
  min-height: 44px;
}

:where(#loginScreen, .app, dialog) :where(button, select, textarea, input) {
  font-size: max(12px, .75rem);
}

:where(#loginScreen, .app, dialog) :where(.setting-toggle, .recovery-confirm) {
  min-height: 44px;
  align-items: center;
}

@media (pointer: coarse) {
  :where(#loginScreen, .app, dialog) :where(button, select, summary, a[href], [role="button"]) { min-height: 48px; }
  :where(#loginScreen, .app, dialog) :where(input[type="checkbox"], input[type="radio"]) { width: 20px; height: 20px; }
}

:where(button, .create-btn, .primary-action):disabled,
:where(button, .create-btn, .primary-action)[aria-busy="true"] {
  cursor: not-allowed;
  opacity: .48;
  transform: none;
}

button[data-button-variant] svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

/* Item 18: SVG icons inherit state color and share one optical weight. */
:where(.rail-btn, .topbar button, .top-actions button, .has-svg-icon, .icon-only-button) svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .94;
  filter: none;
}

:where(.rail-btn, .topbar button, .top-actions button, .has-svg-icon, .icon-only-button):hover svg,
:where(.rail-btn, .topbar button, .top-actions button, .has-svg-icon, .icon-only-button)[aria-current="page"] svg,
:where(.rail-btn, .topbar button, .top-actions button, .has-svg-icon, .icon-only-button)[aria-pressed="true"] svg {
  color: currentColor;
  opacity: 1;
  filter: drop-shadow(0 0 8px color-mix(in srgb, currentColor 38%, transparent));
}

.icon-only-button {
  width: 40px;
  min-width: 40px;
  padding-inline: 0;
  display: inline-grid;
  place-items: center;
}

.icon-only-button > :where(.notification-count, .inline-count, .moderation-dot) {
  position: absolute;
}

/* Item 19: card geometry follows explicit density levels. */
[data-density="compact"] {
  --v13-card-gap: var(--v13-density-compact-gap);
  --v13-card-padding: var(--v13-density-compact-padding);
  min-height: 56px;
  gap: var(--v13-card-gap);
  padding: var(--v13-card-padding);
}

[data-density="default"] {
  --v13-card-gap: var(--v13-density-default-gap);
  --v13-card-padding: var(--v13-density-default-padding);
  min-height: 92px;
  gap: var(--v13-card-gap);
  padding: var(--v13-card-padding);
}

[data-density="comfortable"] {
  --v13-card-gap: var(--v13-density-comfortable-gap);
  --v13-card-padding: var(--v13-density-comfortable-padding);
  min-height: 172px;
  gap: var(--v13-card-gap);
  padding: var(--v13-card-padding);
}

@media (max-width: 700px) {
  :root {
    --v13-density-default-padding: 15px;
    --v13-density-comfortable-padding: 20px;
  }

  [data-density="comfortable"] {
    min-height: 138px;
  }
}

/* Item 25: shared busy buttons and loading skeletons. */
.busy-spinner {
  width: 15px;
  height: 15px;
  display: inline-block;
  flex: 0 0 15px;
  border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: v13-spin .75s linear infinite;
}

button[aria-busy="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-state {
  width: 100%;
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 16px;
  background: color-mix(in srgb, var(--v13-surface-2) 82%, transparent);
}

.loading-state-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--v13-text-2);
  font-size: 12px;
  font-weight: 800;
}

.skeleton-stack {
  display: grid;
  gap: 9px;
}

.skeleton-row {
  width: var(--skeleton-width, 100%);
  height: 12px;
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--v13-surface-3) 20%, color-mix(in srgb, var(--v13-focus) 14%, var(--v13-surface-3)) 50%, var(--v13-surface-3) 80%);
  background-size: 220% 100%;
  animation: v13-skeleton 1.25s ease-in-out infinite;
}

@keyframes v13-spin { to { transform: rotate(360deg); } }
@keyframes v13-skeleton { to { background-position: -220% 0; } }

/* Item 26: semantic status panels never rely on color alone. */
.status-state {
  --status-color: var(--v13-accent-cyan);
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--status-color) 36%, transparent);
  border-radius: 15px;
  color: var(--v13-text-1);
  background: color-mix(in srgb, var(--status-color) 8%, var(--v13-surface-1));
}

.status-state[data-status="success"] { --status-color: var(--v13-success); }
.status-state[data-status="warning"] { --status-color: var(--v13-warning); }
.status-state[data-status="error"] { --status-color: var(--v13-danger); }

.status-state > b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--status-color) 52%, transparent);
  border-radius: 12px;
  color: var(--status-color);
  background: color-mix(in srgb, var(--status-color) 12%, transparent);
  font-size: 16px;
}

.status-state strong { display: block; font-size: 13px; line-height: 1.3; }
.status-state p { margin: 4px 0 0; color: var(--v13-text-2); font-size: 11px; line-height: 1.45; }
.status-state > button { min-width: 112px; }

@media (max-width: 560px) {
  .status-state { grid-template-columns: 38px minmax(0, 1fr); }
  .status-state > button { grid-column: 1 / -1; width: 100%; }
}

/* Item 20: readable, predictable type roles across every primary surface. */
.app :where(.home-hero, .friends-hero, .servers-hero, .game-hero, .server-focus-hero) h1 {
  max-width: 19ch;
  margin-block: 8px;
  color: var(--v13-text-1);
  font-size: var(--v13-type-display);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: var(--v13-leading-tight);
  text-wrap: balance;
}

.app :where(.home-panel-head, .game-panel-head, .section-title) h2,
.app :where(.home-panel-head, .game-panel-head, .section-title) h3,
dialog h2 {
  color: var(--v13-text-1);
  font-size: var(--v13-type-heading);
  font-weight: 850;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.app :where(p, .dialog-note),
dialog :where(p, .dialog-note) {
  color: var(--v13-text-2);
  font-size: var(--v13-type-body);
  line-height: var(--v13-leading-body);
}

.app :where(small, .helper-text),
dialog :where(small, .helper-text) {
  color: var(--v13-text-3);
  font-size: var(--v13-type-helper);
  line-height: 1.45;
}

.app :where(.hero-kicker, .kicker, label, [data-label]),
dialog :where(.kicker, label, [data-label]) {
  font-size: var(--v13-type-label);
  font-weight: 850;
  letter-spacing: .12em;
  line-height: 1.25;
}

.app :where(button, input, select, textarea),
dialog :where(button, input, select, textarea) {
  font-size: max(12px, .75rem);
}

@media (max-width: 560px) {
  :root {
    --v13-type-display: clamp(27px, 9vw, 39px);
    --v13-type-title: 23px;
    --v13-type-body: 12px;
  }
}

/* Item 21: predictable dialog sizing, scrolling and dismissal. */
dialog[data-modal-size] {
  width: min(var(--v13-modal-width), calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: min(90dvh, 920px) !important;
  padding: 0;
  border: 1px solid var(--v13-border-strong);
  border-radius: 22px;
  background: var(--v13-surface-1);
  box-shadow: var(--v13-shadow-panel);
  overflow: hidden !important;
  overscroll-behavior: contain;
}

dialog[data-modal-size="compact"] { --v13-modal-width: 460px; }
dialog[data-modal-size="medium"] { --v13-modal-width: 680px; }
dialog[data-modal-size="wide"] { --v13-modal-width: 1080px; }

dialog[data-modal-size] > form {
  width: 100% !important;
  max-width: none !important;
  max-height: min(90dvh, 920px) !important;
  margin: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

dialog[data-modal-size]::backdrop {
  background: rgba(3, 6, 11, .76);
  backdrop-filter: blur(9px);
}

dialog[data-modal-size] .x {
  z-index: 20;
}

/* Item 22: native selects stay legible in every supported theme. */
:where(.app, dialog) select {
  min-height: 42px;
  padding: 9px 40px 9px 13px;
  color: var(--v13-text-1) !important;
  border: 1px solid var(--v13-border-strong) !important;
  border-radius: 11px;
  background-color: var(--v13-surface-1) !important;
  color-scheme: dark;
}

:where(.app, dialog) select:hover {
  border-color: color-mix(in srgb, var(--v13-focus) 58%, transparent) !important;
  background-color: var(--v13-surface-2) !important;
}

:where(.app, dialog) select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--v13-focus) 36%, transparent);
  outline-offset: 2px;
}

:where(.app, dialog) select :where(option, optgroup) {
  color: var(--v13-text-1) !important;
  background-color: var(--v13-surface-1) !important;
  font-size: 13px;
}

:where(.app, dialog) select option:checked {
  color: var(--v13-on-accent) !important;
  background-color: var(--v13-accent-cyan) !important;
}

:where(.app, dialog) select :where(option, optgroup):disabled,
:where(.app, dialog) select:disabled {
  color: var(--v13-text-3) !important;
  opacity: .68;
}

html[data-theme="sunset"] :where(.app, dialog) select option:checked {
  color: #160d05 !important;
  background-color: var(--v13-warning) !important;
}

html.high-contrast :where(.app, dialog) select {
  color: #fff !important;
  border-color: #fff !important;
  background: #000 !important;
}

html.high-contrast :where(.app, dialog) select option:checked {
  color: #000 !important;
  background: #ff0 !important;
}

html.high-contrast {
  color-scheme: dark;
  --v13-bg-canvas: #000;
  --v13-bg-sidebar: #020202;
  --v13-surface-1: #080808;
  --v13-surface-2: #101010;
  --v13-surface-3: #181818;
  --v13-border-soft: rgba(255, 255, 255, .38);
  --v13-border-strong: rgba(255, 255, 255, .82);
  --v13-text-1: #fff;
  --v13-text-2: #f1f1f1;
  --v13-text-3: #d5d5d5;
  --v13-focus: #fff36b;
}
html.high-contrast :where(.app, dialog) :where(.session-box, article, .home-panel, .voice-stage, .topbar) {
  border-color: var(--v13-border-soft);
}

.accessibility-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin: 10px 0 15px;
  padding: 11px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 13px;
  background: var(--v13-surface-0, #0a1019);
}
.accessibility-summary > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--v13-on-accent);
  background: var(--v13-gradient-accent);
  font-style: normal;
  font-weight: 1000;
}
.accessibility-summary span,
.accessibility-summary b,
.accessibility-summary small { display: block; }
.accessibility-summary b { color: var(--v13-text-1); font-size: 11px; }
.accessibility-summary small { margin-top: 4px; color: var(--v13-text-2); }
.accessibility-summary[data-contrast="high"] { border-color: var(--v13-border-strong); }

@media (forced-colors: active) {
  :where(.app, dialog) select,
  :where(.app, dialog) select :where(option, optgroup) {
    color: CanvasText !important;
    border-color: ButtonText !important;
    background: Canvas !important;
    forced-color-adjust: auto;
  }
}

/* Item 23: one accessible tooltip layer for mouse, keyboard and touch. */
.app-tooltip {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  max-width: min(260px, calc(100vw - 20px));
  padding: 8px 10px;
  border: 1px solid var(--v13-border-strong);
  border-radius: 9px;
  color: var(--v13-text-1);
  background: color-mix(in srgb, var(--v13-bg-canvas) 96%, transparent);
  box-shadow: var(--v13-shadow-panel);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity .14s ease, visibility .14s ease, transform .14s ease;
}

.app-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (pointer: coarse) {
  .app-tooltip {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* Item 24: priority-aware toast language and safe viewport placement. */
#toast.toast {
  position: fixed;
  z-index: 11000;
  left: 50%;
  right: auto;
  bottom: max(22px, env(safe-area-inset-bottom));
  width: min(430px, calc(100vw - 24px));
  min-height: 48px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border: 1px solid var(--toast-border, var(--v13-border-strong));
  border-radius: 14px;
  color: var(--v13-text-1);
  background: color-mix(in srgb, var(--toast-color, var(--v13-accent-cyan)) 9%, var(--v13-surface-1));
  box-shadow: var(--v13-shadow-panel);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  transform: translate(-50%, 14px);
}

#toast.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--toast-color, var(--v13-accent-cyan));
  box-shadow: 0 0 14px var(--toast-color, var(--v13-accent-cyan));
}

#toast.toast.show {
  transform: translate(-50%, 0);
  animation: v13-toast-life var(--toast-duration, 2600ms) linear both;
}

#toast.toast[data-type="success"] { --toast-color: var(--v13-success); --toast-border: color-mix(in srgb, var(--v13-success) 38%, transparent); }
#toast.toast[data-type="warning"] { --toast-color: var(--v13-warning); --toast-border: color-mix(in srgb, var(--v13-warning) 42%, transparent); }
#toast.toast[data-type="error"] { --toast-color: var(--v13-danger); --toast-border: color-mix(in srgb, var(--v13-danger) 48%, transparent); }

@keyframes v13-toast-life {
  0%, 100% { opacity: 0; }
  5%, 92% { opacity: 1; }
}

@media (max-width: 700px) {
  #toast.toast {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 700px), (max-height: 700px) {
  dialog[data-modal-size] {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 17px;
  }

  dialog[data-modal-size] > form {
    max-height: calc(100dvh - 16px) !important;
    scrollbar-gutter: auto;
  }
}

/* Item 1: keep the four primary destinations visually distinct from utilities. */
.rail-zone-separator {
  width: 32px;
  height: 1px;
  flex: 0 0 1px;
  margin: 2px auto 3px;
  background: linear-gradient(90deg, transparent, rgba(126, 218, 237, .42), transparent);
}

.rail-btn[data-primary-nav] {
  isolation: isolate;
}

.rail-btn[data-primary-nav]::before {
  content: attr(data-nav-label);
  position: absolute;
  z-index: 80;
  left: calc(100% + 12px);
  top: 50%;
  min-width: max-content;
  padding: 8px 10px;
  border: 1px solid var(--v13-border-strong);
  border-radius: 9px;
  color: var(--v13-text-1);
  background: color-mix(in srgb, var(--v13-bg-canvas) 97%, transparent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .38);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transform: translate(-4px, -50%);
  transition: opacity .16s ease, transform .16s ease;
}

.rail-btn[data-primary-nav]:hover::before,
.rail-btn[data-primary-nav]:focus-visible::before {
  opacity: 1;
  transform: translate(0, -50%);
}

.rail-btn[data-primary-nav][aria-current="page"] {
  outline: 2px solid color-mix(in srgb, var(--v13-focus) 42%, transparent);
  outline-offset: 2px;
}

@media (max-width: 780px) {
  .rail-zone-separator {
    width: 1px;
    height: 28px;
    flex-basis: 1px;
    margin: auto 3px;
    background: linear-gradient(180deg, transparent, rgba(126, 218, 237, .42), transparent);
  }

  .rail-btn[data-primary-nav]::before {
    display: none;
  }
}

/* Motion and rendering budget */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after,
html.low-performance *,
html.low-performance *::before,
html.low-performance *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: .001ms !important;
  transition-delay: 0ms !important;
}

html.low-performance dialog::backdrop,
html.low-performance :where(.home-panel, .rail, .reaction-picker, .server-card-main, .friends-hero, .servers-hero, .game-hero) {
  backdrop-filter: none !important;
}

html.low-performance :where(.home-aurora, .showcase-orbit, .voice-reaction-layer, .arcade-arena-stars, .arcade-stage-sweep) {
  display: none !important;
}

#performanceModeHint {
  display: block;
  margin-top: 7px;
  color: var(--v13-text-2);
  font-size: var(--v13-type-helper);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

/* Item 15: the same four destinations remain primary on every viewport. */
@media (min-width: 701px) and (max-width: 1100px) {
  html[data-navigation-layout="notebook"] .rail {
    gap: 8px;
  }

  html[data-navigation-layout="notebook"] .rail-btn[data-primary-nav],
  html[data-navigation-layout="notebook"] .rail-tools-trigger {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 700px) {
  html[data-navigation-layout="mobile"] .app {
    padding-bottom: 68px;
  }

  html[data-navigation-layout="mobile"] .rail {
    height: 68px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 4px;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  html[data-navigation-layout="mobile"] .rail-zone-separator,
  html[data-navigation-layout="mobile"] .server-rail-list,
  html[data-navigation-layout="mobile"] .rail-profile-dock {
    display: none !important;
  }

  html[data-navigation-layout="mobile"] .rail-btn[data-primary-nav],
  html[data-navigation-layout="mobile"] .rail-tools-trigger {
    width: 100%;
    height: 54px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border-radius: 13px;
  }

  html[data-navigation-layout="mobile"] .rail-btn[data-primary-nav] svg,
  html[data-navigation-layout="mobile"] .rail-tools-trigger svg {
    order: 1;
    width: 19px;
    height: 19px;
  }

  html[data-navigation-layout="mobile"] .rail-btn[data-primary-nav]::before,
  html[data-navigation-layout="mobile"] .rail-tools-trigger::before {
    content: attr(data-nav-label);
    position: static;
    order: 2;
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    color: currentColor;
    background: transparent;
    box-shadow: none;
    font-size: 8px;
    line-height: 1;
    opacity: .78;
    transform: none;
  }

  html[data-navigation-layout="mobile"] .main {
    height: calc(100dvh - 68px);
  }

  html[data-navigation-layout="mobile"] .sidebar {
    bottom: 68px;
  }

  html[data-navigation-layout="mobile"] .rail-tools-menu {
    bottom: 78px;
  }
}

/* Item 3: persistent location context and one-click return to the section root. */
.navigation-context {
  order: -1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0 0 3px;
  color: #778399;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

.navigation-context button {
  min-height: 0;
  padding: 0;
  border: 0;
  color: #7edaed;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.navigation-context button:hover,
.navigation-context button:focus-visible {
  color: #cfff8d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.navigation-context strong {
  min-width: 0;
  overflow: hidden;
  color: #aab4c4;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigation-context .hidden {
  display: none;
}

.topbar > div:first-child > div:has(#roomName) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 620px) {
  .navigation-context {
    max-width: min(48vw, 230px);
    font-size: 9px;
  }
}

/* Item 4: server rail, channel navigation and content are separate regions. */
.selected-server-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 7px;
  color: #cfff8d;
}

.selected-server-section-title span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.selected-server-section-title small {
  overflow: hidden;
  color: #758197;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-channel-shell:focus-within .selected-server-section-title {
  color: #7edaed;
}

@media (max-width: 1040px) {
  .selected-server-section-title small {
    display: none;
  }
}

/* Item 5: the top bar only promotes actions relevant to the active context. */
.topbar[data-context] .top-actions {
  gap: 7px;
}

.topbar[data-context="dm"] #dmCallButton,
.topbar[data-context="server"] #voiceJoinButton {
  border-color: rgba(126, 218, 237, .34);
  background: linear-gradient(145deg, rgba(126, 218, 237, .13), rgba(168, 237, 85, .08));
}

.topbar[data-context="server"] .top-more > summary,
.topbar[data-context="dm"] .top-more > summary {
  border-color: rgba(126, 218, 237, .22);
}

.topbar .top-actions > button.hidden {
  display: none;
}

@media (max-width: 760px) {
  .topbar[data-context] .top-actions {
    gap: 5px;
  }
}

/* Item 6: keep essential voice controls available above the profile dock. */
.sidebar-noise-suppression {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(126, 218, 237, .22);
  border-radius: 15px;
  color: #dfe8f4;
  text-align: left;
  background: linear-gradient(145deg, rgba(19, 27, 40, .88), rgba(10, 15, 24, .92));
}

.sidebar-noise-suppression.hidden { display: none; }
.sidebar-noise-suppression:hover:not(:disabled) { border-color: rgba(126, 218, 237, .52); }
.sidebar-noise-suppression.active {
  border-color: rgba(168, 237, 85, .45);
  background: linear-gradient(145deg, rgba(168, 237, 85, .13), rgba(94, 231, 242, .08));
  box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 0 20px rgba(168, 237, 85, .08);
}
.sidebar-noise-suppression:disabled { cursor: wait; opacity: .72; }
.sidebar-noise-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #93a5ba;
  background: rgba(255, 255, 255, .055);
}
.sidebar-noise-suppression.active .sidebar-noise-icon { color: var(--green); background: rgba(168, 237, 85, .12); }
.sidebar-noise-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.sidebar-noise-copy { min-width: 0; display: grid; gap: 3px; }
.sidebar-noise-copy strong { overflow: hidden; color: #f5f9ff; font-size: 10px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-noise-copy small { overflow: hidden; color: #8291a6; font-size: 8px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-noise-suppression.active .sidebar-noise-copy small { color: rgba(205, 255, 155, .84); }
.sidebar-noise-switch { width: 34px; height: 20px; display: flex; align-items: center; padding: 2px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(3,7,13,.72); }
.sidebar-noise-switch i { width: 14px; height: 14px; border-radius: 50%; background: #758399; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.sidebar-noise-suppression.active .sidebar-noise-switch { border-color: rgba(168,237,85,.42); background: rgba(168,237,85,.13); }
.sidebar-noise-suppression.active .sidebar-noise-switch i { transform: translateX(14px); background: var(--green); box-shadow: 0 0 12px rgba(168,237,85,.58); }
.sidebar-noise-suppression.busy .sidebar-noise-icon { animation: sidebarNoiseBusy .7s ease-in-out infinite alternate; }
@keyframes sidebarNoiseBusy { to { transform: scale(.9); opacity: .6; } }

/* v1.4 voice room stability and a calmer Lounge. */
.lounge-toolbar {
  width: min(1180px, calc(100% - 28px));
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px auto 0;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(126, 218, 237, .20);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(17, 25, 37, .96), rgba(8, 13, 21, .96));
}
.lounge-toolbar > div { min-width: 0; display: grid; gap: 3px; }
.lounge-toolbar > div strong { color: #f4f8ff; font-size: 14px; }
.lounge-toolbar > div small { color: #9baabd; font-size: 11px; }
.lounge-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lounge-toolbar button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(126, 218, 237, .28);
  border-radius: 11px;
  color: #eaf6ff;
  background: rgba(126, 218, 237, .08);
  font-size: 11px;
  font-weight: 850;
}
.lounge-toolbar button:hover { border-color: rgba(168, 237, 85, .48); color: #fff; background: rgba(168, 237, 85, .11); }
.lounge-toolbar button.hidden { display: none; }
.lounge-scene { width: min(1180px, calc(100% - 28px)); margin: 10px auto 0; perspective: none; }
.lounge-room {
  min-height: 310px;
  padding: 82px 20px 20px;
  border: 1px solid rgba(168, 237, 85, .22);
  border-radius: 24px;
  transform: none;
  background:
    radial-gradient(circle at 8% 0%, rgba(168, 237, 85, .14), transparent 30%),
    radial-gradient(circle at 92% 0%, rgba(94, 231, 242, .11), transparent 32%),
    linear-gradient(145deg, #111a27, #090e17 62%, #0b1718);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 20px 50px rgba(0,0,0,.26);
}
.lounge-room::before { transform: none; height: 100%; inset: 0; border-radius: inherit; background: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 42px 42px; opacity: .45; }
.lounge-room::after { opacity: .22; mix-blend-mode: normal; }
.lounge-ceiling, .lounge-neon, .lounge-screen-art, .lounge-accent-orbs, .lounge-wall-right, .lounge-shelf, .lounge-sofa-back, .lounge-table, .lounge-rug, .lounge-plant { display: none; }
.lounge-brand { left: 20px; right: 20px; top: 18px; width: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-radius: 14px; background: rgba(5, 10, 17, .56); }
.lounge-brand span { color: var(--green); font-size: 9px; letter-spacing: .16em; }
.lounge-brand strong { overflow: hidden; color: #f6f9ff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.lounge-seats { position: relative; inset: auto; z-index: 10; display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 10px; }
.voice-stage .lounge-seat,
.voice-stage[data-lounge-layout="circle"] .lounge-seat,
.voice-stage[data-lounge-layout="theater"] .lounge-seat {
  position: relative;
  inset: auto;
  width: auto;
  min-width: 0;
  min-height: 166px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 15px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  transform: none;
  filter: none;
  color: #eaf1fb;
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 1px rgba(255,255,255,.045);
}
.voice-stage .lounge-seat:hover { transform: translateY(-2px); filter: none; border-color: rgba(126,218,237,.38); background: rgba(126,218,237,.07); }
.voice-stage .lounge-seat.self { border-color: rgba(168,237,85,.42); background: linear-gradient(145deg, rgba(168,237,85,.12), rgba(94,231,242,.06)); }
.voice-stage .lounge-chair { display: none; }
.voice-stage .lounge-avatar { position: relative; inset: auto; width: 54px; height: 54px; margin: 0; border-radius: 17px; box-shadow: 0 0 0 2px rgba(126,218,237,.24), 0 12px 24px rgba(0,0,0,.34); }
.voice-stage .lounge-seat.self .lounge-avatar { box-shadow: 0 0 0 2px rgba(168,237,85,.62), 0 0 24px rgba(168,237,85,.16); }
.voice-stage .lounge-seat strong, .voice-stage .lounge-seat em { position: relative; inset: auto; max-width: 100%; margin: 0; overflow: hidden; border: 0; color: #f4f8ff; background: transparent; font-size: 11px; font-style: normal; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; box-shadow: none; }
.voice-stage .lounge-seat em { color: #93a4b8; font-size: 9px; }
.voice-stage .lounge-seat.empty { min-height: 166px; opacity: 1; border-style: dashed; color: #8292a7; background: rgba(255,255,255,.018); }
.voice-stage .lounge-seat.empty::before { content: "+"; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(126,218,237,.22); border-radius: 14px; color: #7edafd; background: rgba(126,218,237,.06); font-size: 20px; }
.voice-stage .lounge-seat.empty small { position: relative; inset: auto; margin: 0; border: 0; color: #93a4b8; background: transparent; font-size: 9px; box-shadow: none; }
.voice-stage .lounge-seat.speaking { border-color: rgba(168,237,85,.55); box-shadow: 0 0 24px rgba(168,237,85,.12), inset 0 1px rgba(255,255,255,.08); }
.voice-stage .lounge-seat.speaking .lounge-avatar { animation: loungePulse .75s ease-in-out infinite alternate; }
.voice-stage :where(.stage-head button, .screen-share-actions button, .call-controls button, .call-controls select) { min-height: 40px; font-size: 11px; }
.voice-stage :where(.voice-inspector small, .screen-preview-head span, .participant small) { color: #9cacc0; font-size: 10px; }

.voice-invite-dialog { width: min(560px, calc(100vw - 28px)); }
.voice-invite-friend-list { display: grid; gap: 9px; max-height: min(52vh, 430px); margin-top: 18px; overflow: auto; }
.voice-invite-friend { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px; border: 1px solid rgba(255,255,255,.10); border-radius: 15px; background: rgba(255,255,255,.035); }
.voice-invite-friend .user-avatar { width: 44px; height: 44px; border-radius: 14px; }
.voice-invite-friend > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.voice-invite-friend strong { overflow: hidden; color: #f4f8ff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.voice-invite-friend small { color: #91a1b5; font-size: 9px; }
.voice-invite-friend button { min-height: 38px; border-color: rgba(168,237,85,.32); color: #eaffd4; background: rgba(168,237,85,.10); font-size: 10px; }

@media (max-width: 680px) {
  .lounge-toolbar { align-items: flex-start; flex-direction: column; }
  .lounge-toolbar-actions { width: 100%; justify-content: stretch; }
  .lounge-toolbar-actions button { flex: 1; }
  .lounge-room { min-height: 0; padding: 78px 12px 12px; }
  .lounge-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voice-stage .lounge-seat, .voice-stage .lounge-seat.empty { min-height: 140px; }
  .voice-invite-friend { grid-template-columns: 40px minmax(0, 1fr); }
  .voice-invite-friend button { grid-column: 1 / -1; width: 100%; }
}

/* v1.4.2 compact voice room: keep chat visible and make Lounge a simple sofa. */
.voice-stage:not(.screen-sharing) {
  flex: 0 1 auto;
  max-height: min(52dvh, 610px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.voice-stage:not(.screen-sharing) + .voice-stage-restore + .messages { min-height: 180px; }

.voice-stage-restore {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 80;
  min-width: 240px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(168, 237, 85, .42);
  border-radius: 16px;
  color: #f6fbff;
  background: linear-gradient(145deg, rgba(22, 34, 35, .98), rgba(8, 13, 21, .98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .48), inset 0 1px rgba(255, 255, 255, .08);
  cursor: pointer;
}
.voice-stage-restore:hover { transform: translateY(-2px); border-color: rgba(168, 237, 85, .72); }
.voice-stage-restore > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; text-align: left; }
.voice-stage-restore strong { font-size: 11px; }
.voice-stage-restore small { overflow: hidden; color: #9fb0c1; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.voice-stage-restore b { padding: 7px 9px; border-radius: 9px; color: #10170b; background: var(--green); font-size: 9px; white-space: nowrap; }

.voice-stage:not(.screen-sharing) .voice-visualizer { height: 20px; margin: 2px auto; }
.voice-stage:not(.screen-sharing) .lounge-toolbar {
  min-height: 44px;
  margin-top: 6px;
  padding: 7px 10px 7px 13px;
  border-radius: 13px;
}
.voice-stage:not(.screen-sharing) .lounge-toolbar > div { display: flex; align-items: baseline; gap: 8px; }
.voice-stage:not(.screen-sharing) .lounge-toolbar > div strong { font-size: 12px; }
.voice-stage:not(.screen-sharing) .lounge-toolbar > div small { font-size: 9px; }
.voice-stage:not(.screen-sharing) .lounge-toolbar button { min-height: 32px; padding: 6px 10px; font-size: 9px; }

.voice-stage:not(.screen-sharing) .lounge-scene { margin-top: 7px; }
.voice-stage:not(.screen-sharing) .lounge-room {
  min-height: 214px;
  padding: 52px 18px 18px;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, #111a25 0 67%, #0a1119 67% 100%);
}
.voice-stage:not(.screen-sharing) .lounge-room::before {
  background: linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 52px 100%;
  opacity: .55;
}
.voice-stage:not(.screen-sharing) .lounge-room::after { display: none; }
.voice-stage:not(.screen-sharing) .lounge-brand {
  top: 10px;
  left: 14px;
  right: 14px;
  padding: 7px 10px;
  border-radius: 10px;
}
.voice-stage:not(.screen-sharing) .lounge-seats {
  position: relative;
  min-height: 142px;
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
  align-items: end;
  gap: 4px;
  padding: 31px 14px 13px;
  isolation: isolate;
}
.voice-stage:not(.screen-sharing) .lounge-seats::before {
  content: "";
  position: absolute;
  inset: 14px 0 18px;
  z-index: -2;
  border: 1px solid rgba(168, 237, 85, .20);
  border-radius: 28px 28px 18px 18px;
  background: linear-gradient(155deg, #25362f, #17241f 55%, #101a17);
  box-shadow: inset 0 2px rgba(255,255,255,.07), 0 14px 24px rgba(0,0,0,.28);
}
.voice-stage:not(.screen-sharing) .lounge-seats::after {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 6px;
  z-index: -1;
  height: 28px;
  border-radius: 8px 8px 18px 18px;
  background: #0d1714;
  box-shadow: 0 8px 16px rgba(0,0,0,.36);
}
.voice-stage:not(.screen-sharing) .lounge-seat,
.voice-stage:not(.screen-sharing)[data-lounge-layout="circle"] .lounge-seat,
.voice-stage:not(.screen-sharing)[data-lounge-layout="theater"] .lounge-seat,
.voice-stage:not(.screen-sharing) .lounge-seat.empty {
  min-height: 94px;
  gap: 3px;
  padding: 8px 5px 7px;
  border-color: rgba(255,255,255,.09);
  border-radius: 13px 13px 10px 10px;
  background: rgba(5, 11, 10, .22);
  box-shadow: inset 0 -12px rgba(0,0,0,.10);
}
.voice-stage:not(.screen-sharing) .lounge-seat:hover { transform: translateY(-3px); }
.voice-stage:not(.screen-sharing) .lounge-seat.empty::before { width: 28px; height: 28px; border-radius: 9px; font-size: 15px; }
.voice-stage:not(.screen-sharing) .lounge-avatar { width: 38px; height: 38px; border-radius: 12px; }
.voice-stage:not(.screen-sharing) .lounge-seat strong { font-size: 9px; }
.voice-stage:not(.screen-sharing) .lounge-seat em,
.voice-stage:not(.screen-sharing) .lounge-seat.empty small { font-size: 8px; }

.voice-stage:not(.screen-sharing) .participants { margin: 6px auto 0; }
.voice-stage:not(.screen-sharing) .voice-inspector {
  width: min(1180px, calc(100% - 28px));
  display: grid;
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 5px;
  margin: 6px auto 8px;
}
.voice-stage:not(.screen-sharing) .voice-inspector article {
  min-height: 36px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 10px;
}
.voice-stage:not(.screen-sharing) .voice-inspector article::before,
.voice-stage:not(.screen-sharing) .voice-inspector article::after,
.voice-stage:not(.screen-sharing) .voice-inspector small { display: none; }
.voice-stage:not(.screen-sharing) .voice-inspector span { font-size: 7px; line-height: 1; }
.voice-stage:not(.screen-sharing) .voice-inspector strong { overflow: hidden; font-size: 9px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .voice-stage:not(.screen-sharing) { max-height: 54dvh; }
  .voice-stage:not(.screen-sharing) .lounge-seats { grid-template-columns: repeat(7, 78px); overflow-x: auto; }
  .voice-stage:not(.screen-sharing) .voice-inspector { display: flex; overflow-x: auto; }
  .voice-stage:not(.screen-sharing) .voice-inspector article { min-width: 112px; }
}
@media (max-width: 680px) {
  .voice-stage-restore { right: 10px; bottom: 82px; left: 10px; min-width: 0; }
  .voice-stage:not(.screen-sharing) + .voice-stage-restore + .messages { min-height: 140px; }
  .voice-stage:not(.screen-sharing) .lounge-toolbar > div small { display: none; }
}

.sidebar-call-controls {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.sidebar-call-controls.hidden {
  display: none;
}

.sidebar-call-controls button {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(126, 218, 237, .20);
  border-radius: 12px;
  color: #dfe8f4;
  background: rgba(255, 255, 255, .045);
  font-size: 10px;
  font-weight: 850;
}

.sidebar-call-controls button:hover:not(:disabled),
.sidebar-call-controls button:focus-visible {
  border-color: rgba(126, 218, 237, .50);
  color: #fff;
  background: rgba(126, 218, 237, .11);
}

.sidebar-call-controls button.active {
  border-color: rgba(255, 101, 119, .52);
  color: #ffdbe0;
  background: rgba(255, 101, 119, .15);
}

.sidebar-call-controls button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.sidebar-call-controls svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.sidebar-call-controls + .sidebar-call-leave {
  margin-top: 7px;
}

/* Item 7: one compact decision area replaces repeated home shortcuts. */
.home-primary-actions {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(126, 218, 237, .18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(16, 27, 34, .94), rgba(11, 15, 25, .96));
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
}

.home-primary-actions > div,
.home-primary-actions > button {
  min-width: 0;
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 13px;
}

.home-primary-actions > div > span {
  color: #7edaed;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .16em;
}

.home-primary-actions > div > strong {
  color: #f5f8fc;
  font-size: 17px;
}

.home-primary-actions small {
  color: #8996a9;
  font-size: 10px;
  line-height: 1.35;
}

.home-primary-actions > button {
  grid-template-columns: 34px minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, .09);
  color: #edf3fa;
  background: rgba(255, 255, 255, .035);
  text-align: left;
}

.home-primary-actions > button > span {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #0a130a;
  background: linear-gradient(145deg, #cfff8d, #72dfee);
  font-size: 15px;
  font-weight: 950;
}

.home-primary-actions > button > strong {
  align-self: end;
  font-size: 12px;
}

.home-primary-actions > button:hover,
.home-primary-actions > button:focus-visible {
  border-color: rgba(126, 218, 237, .42);
  background: rgba(126, 218, 237, .08);
  transform: translateY(-1px);
}

.home-primary-actions + .home-stats {
  margin-bottom: 14px;
}

@media (max-width: 1120px) {
  .home-primary-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-primary-actions > div {
    grid-column: 1 / -1;
    min-height: 58px;
  }
}

@media (max-width: 680px) {
  .home-primary-actions {
    grid-template-columns: 1fr;
  }

  .home-primary-actions > div {
    grid-column: auto;
  }
}

/* Item 8: requests, online friends and the full list are separate views. */
.friends-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 15px;
  background: rgba(8, 13, 22, .72);
}

.friends-view-tabs button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #aab5c5;
  background: transparent;
  font-size: 11px;
  font-weight: 850;
}

.friends-view-tabs button b {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #7edaed;
  background: rgba(126, 218, 237, .10);
  font-size: 9px;
  text-align: center;
}

.friends-view-tabs button:hover,
.friends-view-tabs button:focus-visible {
  color: #f5f8fc;
  background: rgba(255, 255, 255, .045);
}

.friends-view-tabs button.active {
  border-color: rgba(126, 218, 237, .38);
  color: #09130b;
  background: linear-gradient(145deg, #cfff8d, #72dfee);
}

.friends-view-tabs button.active b {
  color: #09130b;
  background: rgba(9, 19, 11, .13);
}

.friends-view-empty {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  color: #e7edf6;
  text-align: center;
}

.friends-view-empty p {
  max-width: 390px;
  margin: 0;
  color: #8d99aa;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .friends-view-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .friends-view-tabs button {
    justify-content: space-between;
  }
}

/* Item 9: selecting a server leads to channels instead of a generic group page. */
.server-channel-dashboard {
  display: grid;
  gap: 14px;
}

.server-focus-switcher {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.server-focus-switcher button {
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  color: #aeb9c8;
  background: rgba(255, 255, 255, .035);
}

.server-focus-switcher button > span {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  color: #09130b;
  background: var(--group-accent, #cfff8d);
}

.server-focus-switcher button > span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-focus-switcher button strong {
  max-width: 150px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-focus-switcher button.active {
  border-color: rgba(126, 218, 237, .46);
  color: #f8fbff;
  background: rgba(126, 218, 237, .10);
  box-shadow: inset 0 -2px #7edaed;
}

.server-focus-hero {
  position: relative;
  isolation: isolate;
  min-height: 205px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  overflow: hidden;
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--group-accent, #cfff8d) 34%, transparent);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(19, 27, 40, .96), rgba(8, 14, 22, .98));
}

.server-focus-hero > img,
.server-focus-shade {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
}

.server-focus-hero > img {
  object-fit: cover;
}

.server-focus-shade {
  z-index: -1;
  background: linear-gradient(90deg, rgba(5, 9, 15, .96), rgba(5, 9, 15, .72) 58%, rgba(5, 9, 15, .48));
}

.server-focus-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--group-accent, #cfff8d) 70%, white 8%);
  border-radius: 22px;
  color: #09130b;
  background: var(--group-accent, #cfff8d);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .36);
  font-size: 22px;
  font-weight: 950;
}

.server-focus-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-focus-hero h1 {
  margin: 7px 0 4px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.server-focus-hero p {
  margin: 0;
  color: #a1adbd;
  font-size: 11px;
}

.server-channel-focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.server-channel-column {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(17, 24, 36, .94), rgba(9, 14, 23, .96));
}

.server-channel-column > header,
.server-channel-column > div > button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.server-channel-column > header {
  margin-bottom: 10px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.server-channel-column > header > span,
.server-channel-column > div > button > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #7edaed;
  background: rgba(126, 218, 237, .09);
  font-size: 14px;
  font-weight: 950;
}

.server-channel-column header strong,
.server-channel-column button strong {
  display: block;
  color: #edf3fa;
  font-size: 12px;
}

.server-channel-column header small,
.server-channel-column button small,
.server-channel-empty small {
  display: block;
  margin-top: 3px;
  color: #8793a5;
  font-size: 10px;
}

.server-channel-column > div {
  display: grid;
  gap: 7px;
}

.server-channel-column > div > button {
  width: 100%;
  min-height: 62px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px;
  color: #dce5f0;
  background: rgba(255, 255, 255, .025);
  text-align: left;
}

.server-channel-column > div > button:hover,
.server-channel-column > div > button:focus-visible {
  border-color: rgba(126, 218, 237, .38);
  background: rgba(126, 218, 237, .07);
}

.server-channel-column > div > button > b,
.server-channel-column > header > b {
  color: #cfff8d;
  font-size: 10px;
}

.server-channel-empty {
  min-height: 130px;
  display: grid;
  place-content: center;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, .10);
  border-radius: 14px;
  color: #dce5f0;
  text-align: center;
}

/* Item 14: every empty primary surface explains one clear next step. */
.guided-empty-state {
  width: 100%;
  min-height: 150px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px dashed color-mix(in srgb, var(--v13-focus) 28%, transparent);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(207, 255, 141, .045), rgba(114, 223, 238, .035));
  color: var(--v13-text-1);
  text-align: left;
}

.guided-empty-state > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--v13-on-accent);
  background: var(--v13-gradient-accent);
  font-size: 22px;
  font-weight: 900;
}

.guided-empty-state strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.guided-empty-state p {
  max-width: 480px;
  margin: 5px 0 0;
  color: var(--v13-text-2);
  font-size: 12px;
  line-height: 1.5;
}

.guided-empty-state .primary-action {
  min-width: 132px;
  justify-self: end;
}

.friends-view-empty.guided-empty-state,
.server-channel-empty.guided-empty-state {
  place-content: initial;
  justify-items: initial;
  text-align: left;
}

@media (max-width: 640px) {
  .guided-empty-state {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 0;
    padding: 17px;
  }

  .guided-empty-state > span {
    width: 38px;
    height: 38px;
  }

  .guided-empty-state .primary-action {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 780px) {
  .server-focus-hero {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 175px;
    padding: 20px;
  }

  .server-focus-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .server-focus-hero > button {
    grid-column: 1 / -1;
  }

  .server-channel-focus-grid {
    grid-template-columns: 1fr;
  }
}

/* Item 10: game choice, play and result have an explicit progression. */
.arcade-stage-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(126, 218, 237, .16);
  border-radius: 14px;
  background: rgba(7, 12, 20, .68);
}

.arcade-stage-progress ol {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arcade-stage-progress li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667286;
  font-size: 9px;
  font-weight: 850;
}

.arcade-stage-progress li:not(:last-child)::after {
  content: "";
  width: 18px;
  height: 1px;
  margin-left: 2px;
  background: rgba(255, 255, 255, .11);
}

.arcade-stage-progress li b {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.arcade-stage-progress li.done {
  color: #9fbdba;
}

.arcade-stage-progress li.done b {
  color: #0b1308;
  border-color: transparent;
  background: rgba(168, 237, 85, .72);
}

.arcade-stage-progress li.active {
  color: #f5f8fc;
}

.arcade-stage-progress li.active b {
  color: #09130b;
  border-color: transparent;
  background: linear-gradient(145deg, #cfff8d, #72dfee);
  box-shadow: 0 0 20px rgba(126, 218, 237, .22);
}

.arcade-stage-progress > strong {
  color: #dce5ef;
  font-size: 11px;
}

.arcade-stage-body {
  min-height: 0;
}

.arcade-result-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.arcade-result-actions button {
  min-height: 40px;
  padding: 8px 16px;
  border-color: rgba(126, 218, 237, .28);
  color: #dffaff;
  background: rgba(126, 218, 237, .08);
}

@media (max-width: 620px) {
  .arcade-stage-progress {
    align-items: flex-start;
    flex-direction: column;
  }

  .arcade-stage-progress li span {
    display: none;
  }
}

/* Item 11: Simple Mode keeps the first-use surface focused without removing features. */
.simple-mode-setting {
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(126, 218, 237, .18);
  border-radius: 13px;
  background: rgba(126, 218, 237, .045);
}

.simple-mode-setting > span {
  display: grid;
  gap: 4px;
}

.simple-mode-setting strong {
  color: #eaf2fa;
  font-size: 12px;
}

.simple-mode-setting small {
  color: #8b98aa;
  font-size: 10px;
  line-height: 1.45;
}

.simple-mode .home-dashboard .home-aurora,
.simple-mode .home-dashboard .hero-emblem,
.simple-mode .home-dashboard .home-activity-feed,
.simple-mode .home-dashboard .home-discovery {
  display: none;
}

.simple-mode .home-dashboard .home-hero {
  min-height: 190px;
}

.simple-mode .home-dashboard .home-stats article {
  min-height: 92px;
  padding: 16px;
}

.simple-mode .home-dashboard .home-stats article:nth-child(4) {
  display: none;
}

.simple-mode .home-dashboard .home-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.simple-mode .friends-dashboard .friend-circles-panel {
  display: none;
}

/* Item 12: advanced tools are grouped and only appear when relevant. */
.top-more > div {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  align-items: start;
}

.top-more-group {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}

.top-more-group:not(:has(button:not(.hidden))) {
  display: none;
}

.top-more-group > strong {
  padding: 4px 5px 7px;
  color: #7edaed;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.top-actions .top-more .top-more-group button {
  min-width: 0;
}

@media (max-width: 920px) {
  .top-more > div {
    grid-template-columns: 1fr;
    max-height: min(520px, calc(100dvh - 90px));
    overflow-y: auto;
  }
}

@media (max-width: 680px) {
  .simple-mode .home-dashboard .home-stats {
    grid-template-columns: 1fr;
  }
}

/* Item 2: secondary tools live behind one clearly labelled entry. */
.rail-tools {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
}

.rail-tools-trigger::before {
  content: attr(data-nav-label);
  position: absolute;
  z-index: 80;
  left: calc(100% + 12px);
  top: 50%;
  min-width: max-content;
  padding: 8px 10px;
  border: 1px solid rgba(126, 218, 237, .24);
  border-radius: 9px;
  color: #f5f8fc;
  background: rgba(8, 13, 22, .97);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .38);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  transform: translate(-4px, -50%);
  transition: opacity .16s ease, transform .16s ease;
}

.rail-tools-trigger:hover::before,
.rail-tools-trigger:focus-visible::before {
  opacity: 1;
  transform: translate(0, -50%);
}

.rail-tools.open .rail-tools-trigger {
  color: #0b1308;
  border-color: rgba(126, 218, 237, .62);
  background: linear-gradient(145deg, #cfff8d, #72dfee);
}

.rail-tools-menu {
  position: absolute;
  z-index: 120;
  left: calc(100% + 12px);
  top: -8px;
  width: min(290px, calc(100vw - 100px));
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(126, 218, 237, .24);
  border-radius: 15px;
  background: linear-gradient(155deg, rgba(18, 26, 39, .98), rgba(7, 12, 21, .99));
  box-shadow: 0 22px 60px rgba(0, 0, 0, .48), inset 0 1px rgba(255, 255, 255, .07);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px) scale(.98);
  transform-origin: left top;
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.rail-tools.open .rail-tools-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
}

.rail-tools-menu .rail-tool-item {
  width: 100%;
  height: auto;
  min-height: 54px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  color: #e8eef7;
  text-align: left;
}

.rail-tools-menu .rail-tool-item::after {
  display: none;
}

.rail-tools-menu .rail-tool-item svg {
  width: 19px;
  height: 19px;
  justify-self: center;
}

.rail-tool-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rail-tool-copy strong {
  font-size: 12px;
  line-height: 1.2;
}

.rail-tool-copy small {
  overflow: hidden;
  color: #8591a4;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-tools-menu .rail-tool-item:hover,
.rail-tools-menu .rail-tool-item:focus-visible {
  color: #0b1308;
}

.rail-tools-menu .rail-tool-item:hover .rail-tool-copy small,
.rail-tools-menu .rail-tool-item:focus-visible .rail-tool-copy small {
  color: rgba(11, 19, 8, .66);
}

@media (max-width: 780px) {
  .rail-tools {
    width: auto;
  }

  .rail-tools-trigger::before {
    display: none;
  }

  .rail-tools-menu {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 72px;
    width: auto;
    max-height: min(360px, calc(100dvh - 100px));
    overflow-y: auto;
    transform: translateY(8px) scale(.98);
    transform-origin: bottom center;
  }

  .rail-tools.open .rail-tools-menu {
    transform: translateY(0) scale(1);
  }
}

/* Contextual message composer */
#messageForm.composer {
  overflow: visible;
  align-items: flex-end;
  gap: 8px;
  padding: 7px;
}

.composer-tools {
  position: relative;
  z-index: 8;
  flex: 0 0 auto;
}

.composer-tools-trigger {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--v13-border-soft);
  border-radius: 12px;
  color: var(--v13-text-1);
  background: var(--v13-surface-2);
  font-size: 22px;
  font-weight: 650;
  line-height: 1;
}

.composer-tools-trigger[aria-expanded="true"] {
  color: var(--v13-on-accent);
  border-color: transparent;
  background: var(--v13-gradient-accent);
  transform: rotate(45deg);
}

.composer-tools-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(340px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--v13-border-strong);
  border-radius: 16px;
  color: var(--v13-text-1);
  background: linear-gradient(155deg, rgba(20, 28, 41, .99), rgba(8, 13, 22, .99));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58);
}

.composer-tools-menu > header {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  padding: 3px 5px 8px;
  border-bottom: 1px solid var(--v13-border-soft);
}

.composer-tools-menu > header strong { font-size: var(--v13-type-body); }
.composer-tools-menu > header small { color: var(--v13-text-2); font-size: var(--v13-type-helper); }

.composer-tool-option {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--v13-text-1);
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
  text-align: left;
}

.composer-tool-option:hover,
.composer-tool-option:focus-within,
.composer-tool-option:focus-visible {
  border-color: var(--v13-border-strong);
  background: rgba(126, 218, 237, .09);
}

.composer-tool-option > b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--v13-accent-cyan);
  background: rgba(126, 218, 237, .1);
  font-size: 16px;
}

.composer-tool-option > span { min-width: 0; display: grid; gap: 3px; }
.composer-tool-option strong { font-size: max(12px, .75rem); line-height: 1.15; }
.composer-tool-option small { color: var(--v13-text-2); font-size: var(--v13-type-helper); line-height: 1.25; }
.composer-tool-option input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.composer-input-shell {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
}

.composer-input-shell #messageInput { width: 100%; }
#messageForm .send-btn { width: 38px; height: 38px; flex: 0 0 auto; }

.message-error {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 14px 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 190, 91, .32);
  border-radius: 14px;
  color: #f4f8fc;
  background: linear-gradient(135deg, rgba(58, 40, 20, .92), rgba(18, 25, 36, .96));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
}
.message-error.hidden { display: none; }
.message-error > div { display: grid; gap: 2px; min-width: 0; flex: 1; }
.message-error strong { color: #ffd37c; font-size: 13px; }
.message-error span { color: #e8eef5; font-size: 12px; }
.message-error small { color: #9eabb9; font-size: 11px; }
.message-error button { flex: 0 0 auto; min-width: 112px; }
.message-error button:disabled { cursor: wait; opacity: .58; }

.voice-connection-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(158, 171, 185, .22);
  border-radius: 999px;
  color: #aeb9c5;
  background: rgba(10, 16, 24, .62);
  font-size: 10px;
  font-weight: 800;
}
.voice-connection-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.voice-connection-state[data-state="connected"] { color: #a8ed55; border-color: rgba(168, 237, 85, .28); }
.voice-connection-state[data-state="requesting_permission"],
.voice-connection-state[data-state="joining"],
.voice-connection-state[data-state="reconnecting"] { color: #63e6f3; border-color: rgba(99, 230, 243, .28); }
.voice-connection-state[data-state="requesting_permission"]::before,
.voice-connection-state[data-state="joining"]::before,
.voice-connection-state[data-state="reconnecting"]::before { animation: voice-connection-pulse 1s ease-in-out infinite; }
.voice-connection-state[data-state="leaving"] { color: #ffd37c; }
.voice-connection-state[data-state="error"] { color: #ff8b9a; border-color: rgba(255, 139, 154, .32); }
@keyframes voice-connection-pulse { 50% { opacity: .25; transform: scale(.72); } }
@media (prefers-reduced-motion: reduce) { .voice-connection-state::before { animation: none !important; } }

.participant-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.participant-identity > span:last-child { display: grid; gap: 1px; min-width: 0; }
.participant-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-identity small { color: #8996a5; font-size: 9px; }
.participant-identity:hover strong { color: #a8ed55; }

@media (max-width: 620px) {
  .message-error { align-items: stretch; flex-direction: column; }
  .message-error button { width: 100%; }
}

@media (max-width: 520px) {
  .composer-tools-menu {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: auto;
  }
}

/* Reply context */
#replyComposer.reply-composer {
  min-height: 58px;
  margin-bottom: -12px;
  padding: 7px 8px 18px;
  border-color: rgba(126, 218, 237, .28);
  background: linear-gradient(145deg, rgba(16, 30, 31, .98), rgba(11, 18, 28, .98));
}

.reply-composer-jump {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border: 0;
  color: var(--v13-text-1);
  background: transparent;
  text-align: left;
}

.reply-composer-jump > b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--v13-accent-cyan);
  background: rgba(126, 218, 237, .11);
  font-size: 16px;
}

.reply-composer-jump > span { min-width: 0; display: grid; gap: 3px; }
.reply-composer-jump small { color: var(--v13-accent-cyan); font-size: var(--v13-type-label); font-weight: 800; }
.reply-composer-jump strong { overflow: hidden; font-size: var(--v13-type-body); text-overflow: ellipsis; white-space: nowrap; }
.reply-composer-jump:hover strong { text-decoration: underline; text-underline-offset: 3px; }

.reply-composer-cancel {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 108, 127, .28) !important;
  border-radius: 10px;
  color: var(--v13-danger) !important;
  background: rgba(255, 108, 127, .07) !important;
  font-size: 18px;
}

/* Safe message editing */
#editMessageDialog form { display: grid; gap: 12px; }
#editMessageDialog h2 { margin-bottom: 0; }
#editMessageDialog label { margin-top: 2px; }

#editMessageInput {
  min-height: 132px;
  max-height: min(36dvh, 280px);
  width: 100%;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 12px;
  color: var(--v13-text-1);
  background: var(--v13-surface-0);
  font-size: var(--v13-type-body);
  line-height: 1.55;
}

#editMessageInput:focus-visible {
  border-color: var(--v13-focus);
  outline: 3px solid rgba(126, 218, 237, .18);
}

.edit-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--v13-text-2);
  font-size: var(--v13-type-helper);
}

.edit-message-actions { margin-top: 5px; }
.edit-message-actions .create-btn { width: auto; margin-top: 0; }
.edit-message-actions button:disabled { opacity: .5; cursor: not-allowed; }

/* Message reactions */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.message-reactions .reaction-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 999px;
  color: var(--v13-text-2);
  background: rgba(255, 255, 255, .035);
}

.message-reactions .reaction-chip span { font-size: 15px; }
.message-reactions .reaction-chip small { font-size: var(--v13-type-helper); font-weight: 750; }
.message-reactions .reaction-chip b { min-width: 1ch; color: var(--v13-text-1); font-size: var(--v13-type-helper); }

.message-reactions .reaction-chip.mine,
.message-reactions .reaction-chip[aria-pressed="true"] {
  border-color: rgba(126, 218, 237, .42);
  color: var(--v13-accent-cyan);
  background: rgba(126, 218, 237, .1);
}

.reaction-picker {
  position: absolute;
  z-index: 12;
  right: 10px;
  top: 34px;
  width: min(360px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--v13-border-strong);
  border-radius: 15px;
  color: var(--v13-text-1);
  background: linear-gradient(155deg, rgba(20, 28, 41, .99), rgba(8, 13, 22, .99));
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
}

.reaction-picker > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 7px;
  border-bottom: 1px solid var(--v13-border-soft);
}

.reaction-picker > header strong { font-size: var(--v13-type-body); }
.reaction-picker > header button { width: 30px; height: 30px; padding: 0; border-radius: 9px; }
.reaction-picker > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }

.reaction-picker > div > button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--v13-text-2);
  background: rgba(255, 255, 255, .035);
}

.reaction-picker > div > button:hover,
.reaction-picker > div > button:focus-visible { border-color: var(--v13-border-strong); background: rgba(126, 218, 237, .09); }
.reaction-picker > div > button span { font-size: 21px; }
.reaction-picker > div > button small { font-size: 9px; font-weight: 750; }

@media (max-width: 460px) {
  .message-reactions .reaction-chip small { display: none; }
  .reaction-picker { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; }
}

/* Conversation-scoped pinned messages */
.pins-context {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin: 2px 0 13px;
  padding: 11px 12px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(126, 218, 237, .08), rgba(161, 245, 88, .045));
}

.pins-context > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--v13-accent-cyan);
  background: rgba(126, 218, 237, .11);
  font-size: 20px;
}

.pins-context > div { min-width: 0; display: grid; gap: 3px; }
.pins-context strong { overflow: hidden; color: var(--v13-text-1); font-size: var(--v13-type-body); text-overflow: ellipsis; white-space: nowrap; }
.pins-context small { overflow: hidden; color: var(--v13-text-2); font-size: var(--v13-type-helper); text-overflow: ellipsis; white-space: nowrap; }

.pins-context > b {
  min-width: 34px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--v13-on-accent);
  background: var(--v13-gradient-accent);
  font-size: var(--v13-type-label);
}

#pinsList.pins-list {
  max-height: min(58dvh, 600px);
  display: grid;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

#pinsList .pin-result {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 13px;
  color: var(--v13-text-1);
  background: rgba(255, 255, 255, .025);
}

#pinsList .pin-result > .user-avatar { width: 38px; height: 38px; border-radius: 12px; }
#pinsList .pin-result > div { min-width: 0; display: grid; gap: 3px; }
#pinsList .pin-result header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

#pinsList .pin-result header span {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--v13-accent-cyan);
  background: rgba(126, 218, 237, .09);
  font-size: var(--v13-type-label);
  font-weight: 800;
}

#pinsList .pin-result header time,
#pinsList .pin-result small { color: var(--v13-text-2); font-size: var(--v13-type-helper); }
#pinsList .pin-result strong { overflow: hidden; font-size: var(--v13-type-body); text-overflow: ellipsis; white-space: nowrap; }
#pinsList .pin-result p { margin: 0; overflow: hidden; color: var(--v13-text-2); font-size: var(--v13-type-body); text-overflow: ellipsis; white-space: nowrap; }

#pinsList .pin-result > button {
  min-height: 36px;
  padding: 7px 11px;
  border-color: var(--v13-border-strong);
  color: var(--v13-accent-cyan);
  background: rgba(126, 218, 237, .06);
  white-space: nowrap;
}

.message.message-revealed {
  outline: 2px solid var(--v13-focus);
  outline-offset: 3px;
  background: linear-gradient(90deg, rgba(126, 218, 237, .12), rgba(161, 245, 88, .055));
}

@media (max-width: 520px) {
  #pinsList .pin-result { grid-template-columns: 34px minmax(0, 1fr); }
  #pinsList .pin-result > .user-avatar { width: 34px; height: 34px; }
  #pinsList .pin-result > button { grid-column: 1 / -1; width: 100%; }
}

/* Shared images and files */
#mediaDialog form { width: min(940px, calc(100vw - 28px)); }

.media-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 13px;
  background: rgba(126, 218, 237, .045);
}

.media-context > div { min-width: 0; display: grid; gap: 3px; }
.media-context strong { overflow: hidden; color: var(--v13-text-1); font-size: var(--v13-type-body); text-overflow: ellipsis; white-space: nowrap; }
.media-context small { color: var(--v13-text-2); font-size: var(--v13-type-helper); }
.media-context > b { min-width: 34px; padding: 6px 9px; border-radius: 999px; color: var(--v13-on-accent); background: var(--v13-gradient-accent); text-align: center; }

.media-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.media-filters button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 10px;
  color: var(--v13-text-2);
  background: rgba(255, 255, 255, .025);
}

.media-filters button b { min-width: 22px; padding: 2px 5px; border-radius: 999px; color: var(--v13-text-1); background: rgba(255, 255, 255, .055); font-size: var(--v13-type-helper); }
.media-filters button.active { border-color: var(--v13-border-strong); color: var(--v13-accent-cyan); background: rgba(126, 218, 237, .09); }

#mediaGrid.media-grid {
  max-height: min(52dvh, 560px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow-x: hidden;
  padding-right: 4px;
}

#mediaGrid .media-card {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(120px, 1fr) auto;
  aspect-ratio: auto;
  padding: 0;
  border-color: var(--v13-border-soft);
  background: var(--v13-surface-0);
}

#mediaGrid .media-card > button:first-child {
  min-width: 0;
  min-height: 142px;
  display: grid;
  place-items: center;
  gap: 5px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 11px 11px 0 0;
  color: var(--v13-text-1);
  background: rgba(255, 255, 255, .025);
}

#mediaGrid .media-card > button:first-child img { width: 100%; height: 100%; min-height: 142px; display: block; object-fit: cover; transition: transform .2s ease; }
#mediaGrid .media-card:hover > button:first-child img { transform: scale(1.025); }

#mediaGrid .media-card footer {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  border-top: 1px solid var(--v13-border-soft);
}

#mediaGrid .media-card footer > span { position: static; min-width: 0; display: grid; gap: 2px; padding: 0; opacity: 1; background: transparent; }
#mediaGrid .media-card footer strong { overflow: hidden; color: var(--v13-text-1); font-size: var(--v13-type-helper); text-overflow: ellipsis; white-space: nowrap; }
#mediaGrid .media-card footer small { color: var(--v13-text-2); font-size: var(--v13-type-helper); }
#mediaGrid .media-card footer button { min-height: 32px; padding: 5px 8px; color: var(--v13-accent-cyan); white-space: nowrap; }

#mediaGrid .media-file-card > button:first-child { align-content: center; padding: 18px 12px; }
#mediaGrid .media-file-card > button:first-child > span { position: static; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border-radius: 14px; color: var(--v13-accent-cyan); background: rgba(126, 218, 237, .1); opacity: 1; font-size: 22px; }
#mediaGrid .media-file-card > button:first-child strong { max-width: 100%; overflow: hidden; font-size: var(--v13-type-body); text-overflow: ellipsis; white-space: nowrap; }
#mediaGrid .media-file-card > button:first-child small { max-width: 100%; overflow: hidden; color: var(--v13-text-2); font-size: var(--v13-type-helper); text-overflow: ellipsis; white-space: nowrap; }

.media-preview-panel {
  position: relative;
  display: grid;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--v13-border-strong);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(15, 24, 31, .98), rgba(8, 13, 22, .98));
}

.media-preview-panel > button { position: absolute; z-index: 2; top: 9px; right: 9px; width: 34px; height: 34px; padding: 0; border-radius: 10px; color: var(--v13-text-1); background: rgba(5, 9, 15, .82); }
#mediaPreviewContent { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
#mediaPreviewContent > img,
#mediaPreviewContent > video { width: 100%; max-height: min(42dvh, 430px); border-radius: 10px; background: #05080d; object-fit: contain; }
#mediaPreviewContent > div:not(.file-preview-icon) { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 3px; }
#mediaPreviewContent strong { overflow-wrap: anywhere; color: var(--v13-text-1); font-size: var(--v13-type-body); }
#mediaPreviewContent small { color: var(--v13-text-2); font-size: var(--v13-type-helper); }
#mediaPreviewContent a { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 11px; border: 1px solid var(--v13-border-strong); border-radius: 9px; color: var(--v13-accent-cyan); text-decoration: none; white-space: nowrap; }
.file-preview-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 16px auto 2px; border-radius: 20px; color: var(--v13-accent-cyan); background: rgba(126, 218, 237, .1); font-size: 30px; }

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

@media (max-width: 500px) {
  .media-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-filters button { justify-content: space-between; }
  #mediaGrid.media-grid { grid-template-columns: minmax(0, 1fr); }
  #mediaPreviewContent > div:not(.file-preview-icon) { align-items: stretch; flex-direction: column; }
}

/* Persistent read position */
.unread-message-divider {
  position: relative;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 8px;
  color: var(--v13-danger);
}

.unread-message-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 108, 127, .62) 12%, rgba(255, 108, 127, .62) 88%, transparent);
}

.unread-message-divider span {
  position: relative;
  z-index: 1;
  padding: 5px 10px;
  border: 1px solid rgba(255, 108, 127, .28);
  border-radius: 999px;
  background: var(--v13-bg-canvas);
  font-size: var(--v13-type-label);
  font-weight: 850;
  letter-spacing: .08em;
}

/* Simple per-room notification levels */
.room-notification-dialog form { width: min(540px, calc(100vw - 28px)); }
.room-notification-dialog form > p { margin: 6px 0 16px; color: var(--v13-text-2); font-size: var(--v13-type-body); line-height: 1.55; }
.room-notification-options { display: grid; gap: 8px; }

.room-notification-options > button {
  min-height: 72px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 13px;
  color: var(--v13-text-1);
  background: rgba(255, 255, 255, .025);
  text-align: left;
}

.room-notification-options > button > b {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--v13-text-2);
  background: rgba(255, 255, 255, .05);
  font-size: 17px;
}

.room-notification-options > button > span { min-width: 0; display: grid; gap: 4px; }
.room-notification-options strong { font-size: var(--v13-type-body); }
.room-notification-options small { color: var(--v13-text-2); font-size: var(--v13-type-helper); line-height: 1.4; }
.room-notification-options > button.active { border-color: var(--v13-border-strong); background: rgba(126, 218, 237, .08); }
.room-notification-options > button.active > b { color: var(--v13-on-accent); background: var(--v13-gradient-accent); }

/* Safe notification bulk actions */
.notification-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.notification-actions > button { min-height: 38px; }
.notification-actions > button:disabled { opacity: .48; cursor: not-allowed; }

.notification-undo {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 0;
  padding: 8px 10px;
  border: 1px solid rgba(161, 245, 88, .24);
  border-radius: 11px;
  color: var(--v13-text-2);
  background: rgba(161, 245, 88, .055);
  font-size: var(--v13-type-helper);
}

.notification-undo button { min-height: 32px; padding: 5px 10px; color: var(--v13-accent-lime); white-space: nowrap; }

@media (max-width: 560px) {
  .notification-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .notification-actions > button { width: 100%; }
}

/* Search filters and result context */
#searchDialog form { width: min(860px, calc(100vw - 28px)); }
.search-filters { margin: 9px 0 11px; border: 1px solid var(--v13-border-soft); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.search-filters summary { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 8px 11px; color: var(--v13-text-1); font-size: var(--v13-type-body); font-weight: 800; cursor: pointer; }
.search-filters summary span { min-width: 24px; padding: 2px 6px; border-radius: 999px; color: var(--v13-text-2); background: rgba(255, 255, 255, .055); font-size: var(--v13-type-helper); text-align: center; }
.search-filters summary span.active { color: var(--v13-on-accent); background: var(--v13-gradient-accent); }
.search-filters > div { display: grid; grid-template-columns: minmax(150px, 1.4fr) repeat(3, minmax(120px, 1fr)) auto; gap: 8px; padding: 0 10px 10px; }
.search-filters label { display: grid; gap: 5px; color: var(--v13-text-2); font-size: var(--v13-type-label); font-weight: 800; letter-spacing: .06em; }
.search-filters :is(input, select) { min-width: 0; min-height: 42px; width: 100%; }
.search-filters > div > button { align-self: end; min-height: 42px; padding: 8px 10px; white-space: nowrap; }

.search-result .search-context { display: block; overflow: hidden; margin-top: 6px; padding: 5px 8px; border-left: 2px solid var(--v13-border-strong); color: var(--v13-text-2); background: rgba(126, 218, 237, .035); font-size: var(--v13-type-helper); line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.search-result .search-context.after { border-left-color: rgba(161, 245, 88, .42); }

@media (max-width: 820px) {
  .search-filters > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-filters > div > button { width: 100%; }
}

@media (max-width: 500px) {
  .search-filters > div { grid-template-columns: minmax(0, 1fr); }
}
/* v1.3 microphone readiness */
.device-readiness-dialog form { width: min(580px, calc(100vw - 24px)); }
.device-readiness-results { display: grid; gap: 8px; margin: 16px 0; }
.device-readiness-results article { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--v13-border); border-radius: 13px; background: var(--v13-surface-1); }
.device-readiness-results article > b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--v13-text-1); background: var(--v13-surface-2); }
.device-readiness-results article[data-state="ok"] > b { color: var(--v13-accent-ink); background: var(--v13-success, #8eea78); }
.device-readiness-results article[data-state="warning"] > b { color: #251600; background: #ffc56d; }
.device-readiness-results article[data-state="error"] { border-color: color-mix(in srgb, var(--v13-danger, #ff7180) 45%, var(--v13-border)); }
.device-readiness-results article[data-state="error"] > b { color: white; background: var(--v13-danger, #ff7180); }
.device-readiness-results strong,
.device-readiness-results small { display: block; }
.device-readiness-results strong { color: var(--v13-text-1); font-size: 13px; }
.device-readiness-results small { margin-top: 2px; color: var(--v13-text-3); font-size: 11px; }
.device-readiness-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.device-readiness-actions button { min-height: 44px; }
.device-readiness-actions button:disabled { cursor: not-allowed; opacity: .5; }
@media (max-width: 480px) { .device-readiness-actions { grid-template-columns: 1fr; } }
.mic-test .mic-test-status,
.mic-test .mic-test-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mic-test .mic-test-status time {
  flex: 0 0 auto;
  color: var(--green);
  font: 800 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.mic-test .mic-test-actions button {
  flex: 1 1 0;
}

.mic-test .mic-test-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
  filter: saturate(.35);
}

.mic-test .mic-test-privacy {
  grid-column: 1 / -1;
  padding-top: 2px;
  color: #7f8b99;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .mic-test .mic-test-actions { align-items: stretch; flex-direction: column; }
}
.audio-device-status {
  display: block;
  margin-top: 7px;
  color: #8f9cab;
  font-size: 10px;
  line-height: 1.45;
}
.ptt-conflict {
  display: block;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, #ffb45e 34%, transparent);
  border-radius: 10px;
  color: #ffd09a;
  background: color-mix(in srgb, #ff9f43 10%, #090e16);
  font-size: 10px;
  line-height: 1.45;
}
.voice-inspector article:has(#voiceBitrate)[data-grade="bad"] strong { color: #ffcf83; }
.voice-inspector article:has(#voiceBitrate)[data-grade="fair"] strong { color: #ffe39d; }
.voice-inspector article:has(#voiceBitrate)[data-grade="good"] strong { color: var(--green); }

/* v1.3 direct-call lifecycle */
.dm-call-entry:is(.missed, .declined, .cancelled) i {
  color: #19080c;
  background: linear-gradient(135deg, #ff6577, #ffd166);
}
.dm-call-entry:is(.connected, .ended) i {
  background: linear-gradient(135deg, #56d6ff, #a8ed55);
}
.dm-call-entry.ringing i {
  color: #07131a;
  background: linear-gradient(135deg, #ffd166, #56d6ff);
  animation: dm-call-ring 1.4s ease-in-out infinite;
}
@keyframes dm-call-ring {
  50% { transform: rotate(7deg) scale(1.06); box-shadow: 0 10px 34px rgba(86, 214, 255, .25); }
}
@media (prefers-reduced-motion: reduce) {
  .dm-call-entry.ringing i { animation: none; }
}

/* v1.3 automatic screen-share cinema */
.voice-stage.screen-sharing.screen-auto-cinema {
  isolation: isolate;
}
.voice-stage.screen-sharing.screen-auto-cinema .screen-preview-wrap {
  border-color: color-mix(in srgb, var(--cyan) 34%, transparent);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .58), 0 0 48px color-mix(in srgb, var(--cyan) 9%, transparent);
}
#cinemaScreenButton[data-auto="true"]::before {
  content: "AUTO";
  margin-right: 6px;
  color: var(--cyan);
  font: 900 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .08em;
}

/* v1.3 screen-share audio handoff */
#screenAudioUnlockButton:not(.hidden) {
  color: #071017;
  border-color: color-mix(in srgb, var(--cyan) 55%, transparent);
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 8px 28px color-mix(in srgb, var(--cyan) 20%, transparent);
}
#screenAudioBadge[data-audio="on"] {
  color: var(--green);
}
#stopScreenShareButton:not(.hidden) {
  color: #ffdce2;
  border-color: color-mix(in srgb, #ff6577 45%, transparent);
  background: color-mix(in srgb, #ff6577 12%, var(--surface-2, #111823));
}

/* v1.3 five-section settings information architecture */
.security-danger-zone {
  margin-top: 34px;
  border-color: color-mix(in srgb, var(--v13-danger) 42%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--v13-danger) 9%, var(--v13-surface-1)), var(--v13-surface-1));
}
.security-danger-zone > .kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--v13-danger);
}

/* v1.3 settings search */
.settings-nav { position: relative; }
.settings-nav .settings-search {
  display: grid;
  gap: 7px;
  margin: 0 0 8px;
  padding: 0 2px;
}
.settings-nav .settings-search > span {
  color: var(--v13-text-2);
  font-size: 10px;
  letter-spacing: .08em;
}
.settings-nav .settings-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-color: var(--v13-border-soft);
  border-radius: 12px;
  color: var(--v13-text-1);
  background: var(--v13-surface-0);
}
.settings-nav .settings-search small {
  color: var(--v13-text-3);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0;
}
.settings-nav .settings-search-results {
  position: absolute;
  z-index: 8;
  top: 144px;
  left: 14px;
  width: 258px;
  max-height: min(430px, calc(100dvh - 190px));
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--v13-border-strong);
  border-radius: 15px;
  background: color-mix(in srgb, var(--v13-surface-1) 96%, transparent);
  box-shadow: var(--v13-shadow-panel);
}
.settings-nav .settings-search-results.hidden { display: none; }
.settings-nav .settings-search-results button {
  min-height: 54px;
  padding: 9px 11px;
  border-radius: 11px;
}
.settings-nav .settings-search-results button strong,
.settings-nav .settings-search-results button small { display: block; }
.settings-nav .settings-search-results button small {
  margin-top: 4px;
  color: var(--v13-text-3);
  font-size: 9px;
  letter-spacing: 0;
}
.settings-nav .settings-search-results p {
  margin: 0;
  padding: 14px;
  color: var(--v13-text-2);
  line-height: 1.5;
}
.settings-search-target {
  animation: settings-search-pulse 1.8s ease-out;
}
@keyframes settings-search-pulse {
  0%, 35% { border-color: var(--v13-accent-cyan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--v13-accent-cyan) 16%, transparent); }
}
@media (max-width: 760px) {
  .settings-nav .settings-search { flex: 0 0 100%; order: -1; min-width: 100%; }
  .settings-nav .settings-search-results { position: fixed; top: 128px; left: 18px; width: calc(100vw - 36px); max-height: 50dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .settings-search-target { animation: none; outline: 2px solid var(--v13-accent-cyan); }
}

/* v1.3 truthful settings persistence state */
.settings-save-state {
  position: sticky;
  z-index: 4;
  top: -18px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin: 16px 0 22px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--settings-state-color) 34%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--settings-state-color) 8%, var(--v13-surface-1));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
  backdrop-filter: blur(16px);
}
.settings-save-state[data-state="saved"] { --settings-state-color: var(--v13-success); }
.settings-save-state[data-state="pending"] { --settings-state-color: var(--v13-warning); }
.settings-save-state[data-state="error"] { --settings-state-color: var(--v13-danger); }
.settings-save-state > i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--v13-on-accent);
  background: var(--settings-state-color);
  font-style: normal;
  font-weight: 1000;
}
.settings-save-state span,
.settings-save-state strong,
.settings-save-state small { display: block; }
.settings-save-state strong { color: var(--v13-text-1); font-size: 12px; }
.settings-save-state small { margin-top: 3px; color: var(--v13-text-2); font-size: 10px; line-height: 1.35; }
.settings-save-state[data-state="pending"] > i { animation: settings-pending-pulse 1.15s ease-in-out infinite; }
@keyframes settings-pending-pulse { 50% { opacity: .55; transform: scale(.9); } }
@media (max-width: 560px) {
  .settings-save-state { grid-template-columns: 32px minmax(0, 1fr); top: -10px; }
  .settings-save-state button { grid-column: 1 / -1; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .settings-save-state[data-state="pending"] > i { animation: none; }
}

/* v1.3 unified two-factor authentication */
.second-factor-chooser {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--cyan) 24%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--cyan) 5%, #080d15);
}
.second-factor-chooser.hidden { display: none; }
.second-factor-chooser > span {
  color: var(--text-soft, #aeb8c9);
  font-size: 10px;
  font-weight: 800;
}
.second-factor-chooser > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.second-factor-chooser button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  text-align: left;
  border-radius: 11px;
  background: #111824;
}
.second-factor-chooser button.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 14%, transparent);
}
.second-factor-chooser button i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #071017;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-style: normal;
  font-weight: 1000;
}
.second-factor-chooser button b,
.second-factor-chooser button small { display: block; }
.second-factor-chooser button b { font-size: 10px; }
.second-factor-chooser button small { margin-top: 3px; color: #8e9aae; font-size: 8px; line-height: 1.3; }

.two-factor-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}
.two-factor-methods article {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 13px;
  background: var(--v13-surface-0);
}
.two-factor-methods article.active { border-color: color-mix(in srgb, var(--v13-success) 42%, transparent); }
.two-factor-methods article > i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--v13-text-1);
  background: var(--v13-surface-2);
  font-style: normal;
  font-weight: 1000;
}
.two-factor-methods article.active > i { color: var(--v13-on-accent); background: var(--v13-success); }
.two-factor-methods b,
.two-factor-methods small,
.two-factor-methods em { display: block; }
.two-factor-methods b { font-size: 11px; }
.two-factor-methods small { margin-top: 3px; color: var(--v13-text-3); font-size: 9px; line-height: 1.35; }
.two-factor-methods em {
  grid-column: 1 / -1;
  color: var(--v13-text-3);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.two-factor-methods article.active em { color: var(--v13-success); }

.recovery-codes-dialog form { width: min(560px, calc(100vw - 32px)); }
.recovery-codes-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.recovery-codes-list code {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 11px;
  color: var(--v13-text-1);
  background: var(--v13-surface-0);
  font-size: 13px;
  letter-spacing: .08em;
}
.recovery-codes-list code small {
  color: var(--v13-text-3);
  font-size: 9px;
  letter-spacing: 0;
}
.recovery-confirm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 13px 0;
  color: var(--v13-text-2);
  font-size: 10px;
  line-height: 1.5;
}
.recovery-confirm input { flex: 0 0 auto; width: 17px; height: 17px; }
@media (max-width: 620px) {
  .second-factor-chooser > div,
  .two-factor-methods,
  .recovery-codes-list { grid-template-columns: 1fr; }
}

/* v1.3 understandable account sessions */
.session-box-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.session-box-heading span,
.session-box-heading strong,
.session-box-heading small { display: block; }
.session-box-heading small { margin-top: 4px; color: var(--v13-text-3); font-size: 9px; }
.session-box-heading > em {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--v13-accent-cyan) 30%, transparent);
  border-radius: 999px;
  color: var(--v13-accent-cyan);
  background: color-mix(in srgb, var(--v13-accent-cyan) 8%, transparent);
  font-size: 10px;
  font-style: normal;
  font-weight: 1000;
}
.account-session-list { display: grid; gap: 8px; margin: 13px 0; }
.account-session {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--v13-border-soft);
  border-radius: 13px;
  background: var(--v13-surface-0);
}
.account-session.current {
  border-color: color-mix(in srgb, var(--v13-success) 38%, transparent);
  background: linear-gradient(125deg, color-mix(in srgb, var(--v13-success) 8%, var(--v13-surface-0)), var(--v13-surface-0));
}
.account-session > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--v13-accent-cyan);
  background: var(--v13-surface-2);
  font-style: normal;
  font-size: 16px;
}
.account-session.current > i { color: var(--v13-on-accent); background: var(--v13-success); }
.account-session span,
.account-session strong,
.account-session small { display: block; min-width: 0; }
.account-session strong { color: var(--v13-text-1); font-size: 11px; }
.account-session small { margin-top: 3px; color: var(--v13-text-3); font-size: 9px; line-height: 1.35; }
.account-session > em {
  color: var(--v13-success);
  font-size: 8px;
  font-style: normal;
  font-weight: 1000;
  letter-spacing: .09em;
}
.account-session > button { min-height: 36px; padding: 0 11px; }
@media (max-width: 580px) {
  .account-session { grid-template-columns: 38px minmax(0, 1fr); }
  .account-session > i { width: 38px; height: 38px; }
  .account-session > button,
  .account-session > em { grid-column: 2; justify-self: start; }
}

/* Persistent server channel categories */
.channel-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px 6px;
  color: var(--v13-text-3);
  font-size: max(10px, var(--v13-type-label));
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.channel-category-heading button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--v13-text-3);
}
.channel-category-heading button:hover,
.channel-category-heading button:focus-visible {
  border-color: var(--v13-border-strong);
  background: var(--v13-surface-2);
  color: var(--v13-text-1);
}
.channel-category-empty {
  display: block;
  padding: 5px 10px 10px;
  color: var(--v13-text-3);
  font-size: max(10px, var(--v13-type-helper));
}
.category-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 7px;
}
.category-select-row > * { margin: 0; }
#categoryDialog { width: min(500px, calc(100vw - 32px)); }
.category-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.category-dialog-actions .danger-action { margin-right: auto; }
.category-order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.channel-category[draggable="true"] > .channel-category-heading,
.channel-row[draggable="true"] > .channel-item { cursor: grab; }
.channel-category.is-dragging,
.channel-row.is-dragging { opacity: .42; }
.channel-category.is-drop-target,
.channel-row.is-drop-target {
  outline: 2px solid var(--v13-accent-cyan);
  outline-offset: 2px;
}
.channel-position {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--v13-text-3);
}
.channel-position:hover,
.channel-position:focus-visible {
  border-color: var(--v13-border-strong);
  background: var(--v13-surface-2);
  color: var(--v13-accent-cyan);
}
#channelMoveDialog { width: min(460px, calc(100vw - 32px)); }
.channel-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--v13-border);
  border-radius: 12px;
  background: var(--v13-surface-0);
}
.channel-permission-grid legend {
  padding: 0 7px;
  color: var(--v13-text-3);
  font-size: max(10px, var(--v13-type-label));
  font-weight: 850;
  letter-spacing: .08em;
}
.channel-permission-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--v13-border);
  border-radius: 10px;
  color: var(--v13-text-2);
}
.channel-permission-grid input { width: 20px; height: 20px; }
.channel-permission-grid label:has(input:disabled) { opacity: .48; }
.role-permission-matrix {
  overflow-x: auto;
  border: 1px solid var(--v13-border);
  border-radius: 14px;
  background: var(--v13-surface-0);
}
.role-matrix-head,
.role-matrix-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) repeat(4, minmax(70px, .55fr)) minmax(130px, .8fr);
  align-items: center;
  gap: 8px;
  min-width: 760px;
  padding: 10px;
}
.role-matrix-head {
  color: var(--v13-text-3);
  font-size: max(10px, var(--v13-type-label));
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.role-matrix-row { border-top: 1px solid var(--v13-border); }
.role-identity {
  display: grid;
  grid-template-columns: 18px minmax(100px, 1fr) 82px;
  align-items: center;
  gap: 7px;
}
.role-identity input,
.role-identity select { min-height: 38px; margin: 0; }
.role-permission-cell {
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--v13-text-2);
  font-size: max(10px, var(--v13-type-helper));
  text-align: center;
}
.role-permission-cell input { width: 20px; height: 20px; }
.role-row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.role-row-actions button { min-height: 38px; padding: 0 10px; }
.role-assignment-row {
  display: grid;
  grid-template-columns: minmax(150px, .6fr) minmax(0, 1.4fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--v13-border);
  border-radius: 12px;
  background: var(--v13-surface-0);
}
.role-assignment-row > span strong,
.role-assignment-row > span small { display: block; }
.role-assignment-row > span small { margin-top: 4px; color: var(--v13-text-3); }
.role-assignment-row > div { display: flex; flex-wrap: wrap; gap: 7px; }
.role-assignment-row > div label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--v13-border);
  border-radius: 10px;
}
.role-assignment-row .role-dot { flex: 0 0 auto; }

.events-dialog { width: min(980px, calc(100vw - 32px)); }
.events-dialog > form { width: 100%; max-height: min(88vh, 850px); overflow: auto; }
.event-create-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(170px, .8fr));
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--v13-border);
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--v13-accent) 7%, var(--v13-surface-1)), var(--v13-surface-0));
}
.event-field { display: grid; align-content: start; gap: 7px; color: var(--v13-text-3); font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.event-field input,
.event-field select,
.event-field textarea { width: 100%; min-height: 46px; font-size: 14px; letter-spacing: 0; }
.event-field textarea { min-height: 82px; resize: vertical; }
.event-field small { color: var(--v13-text-3); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.event-description-field { grid-column: 1 / -1; }
.event-submit { grid-column: 1 / -1; min-height: 48px; font-size: 14px; }
.events-list { max-height: none; margin-top: 18px; gap: 12px; overflow: visible; }
.event-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) minmax(220px, auto);
  gap: 16px;
  padding: 16px;
  border-color: var(--v13-border);
  border-radius: 16px;
  background: var(--v13-surface-1);
}
.event-card time { min-height: 80px; padding: 10px; font-size: 12px; }
.event-card time span { font-size: 12px; text-transform: uppercase; }
.event-card time b { margin-top: 6px; font-size: 20px; }
.event-card-copy { min-width: 0; }
.event-card .event-eyebrow { color: var(--group-accent); font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.event-card strong { display: block; margin-top: 4px; color: var(--v13-text-1); font-size: 18px; }
.event-card p { margin: 6px 0; color: var(--v13-text-2); font-size: 14px; line-height: 1.5; }
.event-card small { color: var(--v13-text-3); font-size: 12px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.event-meta span,
.event-current-status { padding: 5px 8px; border: 1px solid var(--v13-border); border-radius: 999px; color: var(--v13-text-2); background: var(--v13-surface-0); font-size: 12px; }
.event-card-actions { display: grid; align-content: center; justify-items: stretch; gap: 8px; }
.event-rsvp-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.event-card button { min-height: 40px; padding: 8px 10px; font-size: 12px; font-weight: 800; }
.event-card button.active { border-color: var(--group-accent); color: var(--v13-text-1); background: color-mix(in srgb, var(--group-accent) 14%, var(--v13-surface-0)); }
.event-card .event-delete { color: var(--v13-danger, #ff8792); }
.event-empty { display: grid; justify-items: center; gap: 8px; padding: 34px 20px; border: 1px dashed var(--v13-border); border-radius: 16px; text-align: center; }
.event-empty > span { width: 44px; height: 44px; padding: 10px; border-radius: 14px; color: var(--v13-accent); background: var(--v13-surface-2); }
.event-empty svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; }
.event-empty strong { font-size: 18px; }
.event-empty p { margin: 0; color: var(--v13-text-3); font-size: 13px; }
.channel-template-notice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--v13-accent) 38%, var(--v13-border));
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--v13-accent) 12%, var(--v13-surface-1)), var(--v13-surface-0));
}
.channel-template-notice > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--v13-accent); background: var(--v13-surface-2); }
.channel-template-notice svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.channel-template-notice strong,
.channel-template-notice small { display: block; }
.channel-template-notice strong { color: var(--v13-text-1); font-size: 14px; }
.channel-template-notice small { margin-top: 3px; color: var(--v13-text-3); font-size: 12px; line-height: 1.4; }
@media (max-width: 560px) {
  .category-select-row { grid-template-columns: 1fr; }
  .category-dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .category-dialog-actions .danger-action { margin-right: 0; }
  .role-assignment-row { grid-template-columns: 1fr; }
  .channel-permission-grid { grid-template-columns: 1fr; }
  .events-dialog { width: calc(100vw - 16px); }
  .event-create-grid { grid-template-columns: 1fr; padding: 13px; }
  .event-description-field, .event-submit { grid-column: auto; }
  .event-card { grid-template-columns: 70px minmax(0, 1fr); padding: 12px; }
  .event-card-actions { grid-column: 1 / -1; }
}

/* Item 71: the first run has one clear next action instead of a wall of tasks. */
.guided-onboarding-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(360px, 1.5fr) auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--v13-accent) 42%, var(--v13-border));
  border-radius: 18px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--v13-accent) 11%, var(--v13-surface-1)), var(--v13-surface-0) 58%, color-mix(in srgb, var(--v13-cyan) 8%, var(--v13-surface-1)));
}
.guided-onboarding-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--v13-accent), var(--v13-cyan));
  content: "";
}
.guided-onboarding-card > div span,
.guided-onboarding-card > div strong,
.guided-onboarding-card > div small { display: block; }
.guided-onboarding-card > div span { color: var(--v13-accent); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.guided-onboarding-card > div strong { margin-top: 4px; color: var(--v13-text-1); font-size: 18px; }
.guided-onboarding-card > div small { margin-top: 3px; color: var(--v13-text-3); font-size: 12px; }
.guided-onboarding-card ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
.guided-onboarding-card li { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--v13-text-3); font-size: 11px; font-weight: 800; }
.guided-onboarding-card li b { display: grid; flex: 0 0 25px; place-items: center; width: 25px; height: 25px; border: 1px solid var(--v13-border); border-radius: 9px; background: var(--v13-surface-1); }
.guided-onboarding-card li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guided-onboarding-card li.active { color: var(--v13-text-1); }
.guided-onboarding-card li.active b { border-color: var(--v13-accent); color: var(--v13-accent-ink); background: var(--v13-accent); box-shadow: 0 0 18px color-mix(in srgb, var(--v13-accent) 32%, transparent); }
.guided-onboarding-card li.done { color: var(--v13-success, #8eea78); }
.guided-onboarding-actions { display: grid; gap: 6px; min-width: 145px; }
.guided-onboarding-actions button { min-height: 36px; padding: 8px 12px; }
.guided-onboarding-actions .ghost-action { border: 1px solid var(--v13-border); border-radius: 10px; color: var(--v13-text-2); background: var(--v13-surface-1); }
.guided-onboarding-card.is-paused { border-style: dashed; }
#discoveryDialog .discovery-grid article.active { border-color: var(--v13-accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--v13-accent) 35%, transparent), 0 16px 38px color-mix(in srgb, var(--v13-accent) 10%, transparent); }
#discoveryDialog .discovery-grid article.done { opacity: .72; }
#discoveryDialog .discovery-grid article.done > span { color: var(--v13-success, #8eea78); }
#discoveryDialog .onboarding-pulse li.active { border-color: var(--v13-accent); background: color-mix(in srgb, var(--v13-accent) 9%, var(--v13-surface-1)); }
#discoveryDialog .onboarding-pulse li button:disabled { cursor: default; opacity: .76; }
@media (max-width: 920px) {
  .guided-onboarding-card { grid-template-columns: 1fr auto; }
  .guided-onboarding-card ol { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 620px) {
  .guided-onboarding-card { grid-template-columns: 1fr; padding: 15px; }
  .guided-onboarding-card ol { grid-column: auto; grid-template-columns: 1fr; }
  .guided-onboarding-actions { width: 100%; }
}

/* Item 73: contextual help stays small, dismissible and local to its surface. */
.context-hint {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--v13-cyan, #5ee7f2) 34%, var(--v13-border));
  border-radius: 14px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--v13-cyan, #5ee7f2) 8%, var(--v13-surface-1)), var(--v13-surface-0));
}
.context-hint > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--v13-cyan, #5ee7f2); background: color-mix(in srgb, var(--v13-cyan, #5ee7f2) 11%, var(--v13-surface-2)); font-size: 16px; font-weight: 900; }
.context-hint strong,
.context-hint small { display: block; }
.context-hint strong { color: var(--v13-text-1); font-size: 13px; }
.context-hint small { margin-top: 2px; color: var(--v13-text-3); font-size: 11px; line-height: 1.45; }
.context-hint button { min-height: 34px; padding: 7px 11px; border: 1px solid var(--v13-border); border-radius: 10px; color: var(--v13-text-2); background: var(--v13-surface-1); font-size: 11px; font-weight: 800; }
#voiceStage > .context-hint { margin: 8px 14px 0; }
@media (max-width: 620px) {
  .context-hint { grid-template-columns: 32px minmax(0, 1fr); }
  .context-hint > span { width: 32px; height: 32px; }
  .context-hint button { grid-column: 2; justify-self: start; }
}

/* v1.3.2 regression pass: readable hierarchy and collision-free cards. */
.friends-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.friend-card-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 96px;
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.friend-card-main > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
}

.friend-card-main > span:nth-child(2) strong,
.friend-card-main > span:nth-child(2) small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card-main > span:nth-child(2) strong {
  font-size: 16px;
}

.friend-card-main > span:nth-child(2) small {
  margin-top: 5px;
  font-size: 12px;
}

.friend-card-actions {
  position: relative;
  z-index: 2;
  width: 96px;
  min-width: 96px;
}

.friend-card-actions button,
.friend-card-actions select {
  min-height: 36px;
  font-size: 12px;
}

@media (max-width: 760px) {
  .friend-card-main {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .friend-card-actions {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.server-focus-switcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 220px));
  gap: 10px;
  overflow: visible;
  padding: 2px 0 4px;
}

.server-focus-switcher button {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: left;
}

.server-focus-switcher button > span:first-child {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 8px 22px rgba(0, 0, 0, .22);
}

.server-focus-copy {
  width: auto !important;
  height: auto !important;
  min-width: 0;
  display: block !important;
  overflow: hidden;
  border-radius: 0 !important;
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
}

.server-focus-copy strong,
.server-focus-copy small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-focus-copy strong {
  color: var(--v13-text-1);
  font-size: 13px !important;
}

.server-focus-copy small {
  margin-top: 4px;
  color: var(--v13-text-3);
  font-size: 11px;
}

.server-focus-switcher button.active {
  border-color: color-mix(in srgb, var(--group-accent, var(--v13-accent)) 58%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--group-accent, var(--v13-accent)) 13%, var(--v13-surface-2)), var(--v13-surface-1));
  box-shadow: inset 3px 0 var(--group-accent, var(--v13-accent)), 0 14px 34px rgba(0, 0, 0, .22);
}

.server-focus-hero h1 {
  max-width: min(760px, 70vw);
  overflow-wrap: anywhere;
}

.guided-onboarding-card small,
.guided-onboarding-card li span,
.home-primary-actions small,
.home-stats small,
.dashboard-stats small,
.context-hint small,
.server-channel-column header small,
.server-channel-column button small,
.game-panel-head small,
.arcade-leaderboard-empty p {
  font-size: max(12px, .75rem) !important;
  line-height: 1.45 !important;
}

.guided-onboarding-card li span,
.home-primary-actions > button > strong,
.server-channel-column strong,
.server-channel-column button > b {
  font-size: 13px !important;
}

.home-stats span,
.dashboard-stats span,
.game-panel-head > span {
  font-size: 10px !important;
  letter-spacing: 1.35px !important;
}

.game-panel-head {
  gap: 7px;
}

.game-panel-head small {
  display: block;
  margin-top: 5px;
  color: var(--v13-text-3);
}

.arcade-leaderboard-empty b {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #08120b;
  background: linear-gradient(145deg, #d8ff92, #5ee7f2);
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 14px 34px rgba(94, 231, 242, .18);
}

.arcade-leaderboard-empty strong {
  margin-top: 10px;
  font-size: 20px;
}

.arcade-badge-card strong,
.arcade-badge-card b,
.arcade-badge-card span,
.arcade-badge-card small,
.game-leaderboard .eyebrow,
.game-leaderboard > small {
  font-size: max(12px, .75rem) !important;
  line-height: 1.4 !important;
}

#peopleList .person {
  min-width: 0;
}

#peopleList .person > div {
  min-width: 0;
}

#peopleList .person strong,
#peopleList .person small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#peopleList .person strong { font-size: 12px; }
#peopleList .person small { font-size: 10px; }

#toast.toast:not(.show) {
  display: none;
}

/* The content column can be narrow even on a wide monitor when both rails are open. */
.game-hub-screen {
  container-type: inline-size;
}

@container (max-width: 900px) {
  .arcade-screen .game-hero {
    min-height: 230px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 28px;
  }

  .arcade-screen .game-hero > div:first-child {
    min-width: 0;
  }

  .arcade-screen .game-hero h1 {
    max-width: 14ch;
    font-size: clamp(32px, 7cqi, 44px);
  }

  .arcade-screen .games-emblem {
    display: none;
  }
}

@container (max-width: 560px) {
  .arcade-screen .game-hero {
    grid-template-columns: 1fr;
  }

  .arcade-screen .game-hero button {
    width: 100%;
  }
}

/* v1.3.7: unified icons, collision-free channels and readable dashboard cards. */
.ui-icon {
  width: 1.15em;
  height: 1.15em;
  display: block;
  flex: 0 0 auto;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

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

/* Channel rows keep the join target on top and move occupants below it. */
.channel-row,
.selected-server-channels .channel-row {
  width: auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  column-gap: 4px;
}

.channel-row > .channel-item {
  grid-column: 1;
  min-width: 0;
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.channel-item .channel-kind {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 8px;
  color: #6ee8f4;
  background: linear-gradient(145deg, rgba(94, 231, 242, .16), rgba(168, 237, 85, .08));
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}

.channel-item .channel-kind .ui-icon { width: 14px; height: 14px; }
.channel-item .channel-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; }

.channel-row > .channel-position,
.channel-row > .channel-delete {
  position: static;
  grid-row: 1;
  width: 28px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
}
.channel-row > .channel-position { grid-column: 2; }
.channel-row > .channel-delete { grid-column: 3; }
.channel-row > .channel-position .ui-icon { width: 13px; height: 13px; }

.voice-live-pill {
  flex: 0 0 auto;
  padding: 4px 7px;
  font-size: 7px;
}

.voice-member-list {
  grid-column: 1 / -1;
  width: auto;
  min-width: 0;
  display: grid;
  gap: 6px;
  margin: 6px 2px 9px 14px;
  padding: 8px;
  border-left: 1px solid rgba(94, 231, 242, .24);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, rgba(94, 231, 242, .055), transparent);
}

.voice-member-list-title {
  margin: 0 0 1px 3px;
  color: rgba(158, 180, 202, .7);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 1.25px;
}

.voice-member-chip {
  min-width: 0;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  padding: 7px 9px;
  border-color: rgba(94, 231, 242, .16);
  background: linear-gradient(135deg, rgba(19, 30, 39, .98), rgba(9, 14, 22, .98));
  box-shadow: inset 0 1px rgba(255, 255, 255, .07), 0 9px 22px rgba(0, 0, 0, .2);
}
.voice-member-chip::before { display: none; }
.voice-member-chip strong { max-width: 100%; font-size: 10px; }
.voice-member-chip small { font-size: 8px; }

/* Home actions use the same icon and action-chip language. */
.home-primary-actions > button > span {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #07140f;
  box-shadow: 0 10px 26px rgba(94, 231, 242, .18), inset 0 1px rgba(255, 255, 255, .6);
}
.home-primary-actions > button > span .ui-icon { width: 20px; height: 20px; }
.home-primary-actions > button > strong { font-size: 14px !important; }
.home-primary-actions > button > small { font-size: 11px !important; }

.home-card-action,
.home-join-action {
  min-width: 40px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(94, 231, 242, .24);
  border-radius: 11px;
  color: #79eaf5 !important;
  background: rgba(94, 231, 242, .08) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
}
.home-card-action .ui-icon,
.home-join-action .ui-icon { width: 16px; height: 16px; }
.home-join-action span { font-size: 10px; font-weight: 900; }
.home-space-card strong,
.home-voice-card strong { font-size: 13px !important; }
.home-space-card small,
.home-voice-card small { font-size: 11px !important; }

/* Friends need breathing room between avatar, identity and controls. */
.friends-grid { gap: 14px; }
.friend-card-main {
  grid-template-columns: 54px minmax(120px, 1fr) 104px;
  gap: 16px;
  padding: 15px 16px;
  align-items: center;
}
.friend-card-main > .user-avatar { width: 50px; height: 50px; border-radius: 16px; }
.friend-card-main > span:nth-child(2) { padding-left: 1px; }
.friend-card-main > span:nth-child(2) strong { font-size: 15px; line-height: 1.25; }
.friend-card-main > span:nth-child(2) small { font-size: 11px; line-height: 1.35; }
.friend-card-actions { width: 104px; min-width: 104px; gap: 6px; }

/* Server switcher behaves like a polished workspace dock. */
.server-focus-switcher {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  padding: 8px;
  border: 1px solid rgba(94, 231, 242, .12);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 24, 34, .92), rgba(8, 13, 21, .96));
}
.server-focus-switcher button {
  min-height: 82px;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 13px;
  padding: 13px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018));
  box-shadow: inset 0 1px rgba(255, 255, 255, .07);
}
.server-focus-switcher button > span:first-child {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
}
.server-focus-switcher button > span:first-child .ui-icon { width: 22px; height: 22px; }
.server-focus-copy strong { font-size: 14px !important; line-height: 1.25; }
.server-focus-copy small { margin-top: 6px; font-size: 12px !important; line-height: 1.3; }
.server-focus-switcher button.active { transform: translateY(-2px); }
.server-focus-create > span:first-child {
  border: 1px dashed rgba(94, 231, 242, .42);
  color: #77edf7 !important;
  background: linear-gradient(145deg, rgba(94, 231, 242, .15), rgba(168, 237, 85, .09)) !important;
}

.server-channel-column header > span,
.server-channel-column button > span {
  display: grid;
  place-items: center;
  color: #6ee8f4;
}
.server-channel-column header > span .ui-icon,
.server-channel-column button > span .ui-icon { width: 17px; height: 17px; }
.channel-card-action {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 70px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(94, 231, 242, .28);
  border-radius: 10px;
  color: #b8f9ff !important;
  background: linear-gradient(145deg, rgba(94, 231, 242, .13), rgba(168, 237, 85, .06));
}
.channel-card-action .ui-icon { width: 13px; height: 13px; }

/* Composer contains one visible prompt only; tools and send have real icons. */
#messageForm .composer-tools-trigger,
#messageForm .send-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
}
#messageForm .composer-tools-trigger .ui-icon,
#messageForm .send-btn .ui-icon { width: 19px; height: 19px; }
#messageForm .send-btn { color: #07140e; background: linear-gradient(145deg, #cfff8d, #58dff1); }
#messageForm #messageInput { font-size: 13px; }

/* Arcade cards get distinct neon identities and readable stat labels. */
.arcade-grid .arcade-card b { isolation: isolate; overflow: hidden; }
.arcade-grid .arcade-card b::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 5px;
  border: 1px solid rgba(5, 18, 17, .18);
  border-radius: 13px;
}
.arcade-grid .arcade-card b .ui-icon { width: 25px; height: 25px; stroke-width: 1.8; }
.arcade-card-reflex b { background: linear-gradient(145deg, #f8ff9a, #65efd2) !important; }
.arcade-card-memory b { color: #081323 !important; background: linear-gradient(145deg, #9df7ff, #8d9cff) !important; }
.arcade-card-target b { color: #160b25 !important; background: linear-gradient(145deg, #e0a5ff, #67eaff) !important; }
.arcade-card-color b { color: #210b18 !important; background: linear-gradient(145deg, #ff9fca, #ffdd7b) !important; }
.arcade-grid .arcade-card strong { font-size: 18px !important; }
.arcade-grid .arcade-card small { font-size: 12px !important; line-height: 1.45; }
.arcade-grid .arcade-card em { font-size: 10px !important; }
.game-summary article { min-height: 108px; padding: 18px 20px; }
.game-summary span { font-size: 10px !important; letter-spacing: 1.55px; }
.game-summary strong { margin-top: 10px; font-size: 28px !important; }
.game-summary small { margin-top: 8px; font-size: 12px !important; line-height: 1.4; }

@media (max-width: 820px) {
  .server-focus-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .friend-card-main { grid-template-columns: 50px minmax(0, 1fr); }
  .friend-card-actions { grid-column: 1 / -1; width: 100%; min-width: 0; }
}

@media (max-width: 560px) {
  .server-focus-switcher { grid-template-columns: 1fr; }
  .channel-row { margin-left: 17px; }
  .voice-member-list { margin-left: 8px; }
}

/* v1.3.8: readability, stable media alignment and functional overlays */
.home-primary-actions > button {
  grid-template-columns: 46px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 14px !important;
}
.home-action-icon {
  width: 46px !important;
  height: 46px !important;
  display: grid !important;
  place-items: center;
  align-self: center;
  border-radius: 15px;
}
.home-action-icon .ui-icon { width: 21px; height: 21px; }
.home-action-copy {
  grid-row: auto !important;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  display: flex !important;
  flex-direction: column;
  place-items: initial !important;
  align-items: flex-start !important;
  justify-content: center;
  gap: 5px;
  border-radius: 0 !important;
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  text-align: left;
}
.home-action-copy strong,
.home-action-copy small { margin: 0 !important; }
.home-action-copy strong { font-size: 15px !important; line-height: 1.2; }
.home-action-copy small { font-size: 11px !important; line-height: 1.35; }

.home-space-icon {
  overflow: hidden;
  isolation: isolate;
}
.home-space-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.message {
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: start !important;
  column-gap: 13px !important;
}
.message > .user-avatar {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px;
  margin: 0 !important;
  align-self: start;
  overflow: hidden;
}
.message > .user-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.message > div { min-width: 0; }
.message.mine { margin-left: auto; }

.selected-server-add {
  display: grid !important;
  place-items: center;
}
.selected-server-add .ui-icon {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.server-focus-switcher {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 10px;
}
.server-focus-switcher button {
  min-height: 108px;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 16px;
  padding: 17px;
}
.server-focus-switcher button > span:first-child {
  width: 62px;
  height: 62px;
  border-radius: 19px;
  overflow: hidden;
}
.server-focus-switcher button > span:first-child img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.server-focus-switcher button > span:first-child .ui-icon { width: 25px; height: 25px; }
.server-focus-copy strong { font-size: 16px !important; }
.server-focus-copy small { font-size: 12px !important; }

.badge-board article > b {
  display: grid;
  place-items: center;
  overflow: hidden;
}
.badge-board article > b .ui-icon { width: 21px; height: 21px; stroke-width: 1.9; }
.badge-board .badge-reflex > b { color: #11170a; background: linear-gradient(145deg, #f8ff9a, #65efd2); }
.badge-board .badge-target > b { color: #160b25; background: linear-gradient(145deg, #e0a5ff, #67eaff); }
.badge-board .badge-color > b { color: #210b18; background: linear-gradient(145deg, #ff9fca, #ffdd7b); }
.badge-board .badge-memory > b { color: #081323; background: linear-gradient(145deg, #9df7ff, #8d9cff); }

.device-readiness-results article[data-state="ok"] > b {
  color: #bfff8c !important;
  border: 1px solid rgba(168, 237, 85, .34);
  background: rgba(50, 112, 61, .25) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
  text-shadow: none;
}

#adminDialog [data-admin-panel][hidden] { display: none !important; }

.voice-stage { position: relative; }
.voice-stage .soundboard:not(.hidden) {
  position: absolute;
  z-index: 80;
  left: 50%;
  bottom: 94px;
  width: min(880px, calc(100% - 32px));
  margin: 0;
  transform: translateX(-50%);
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  padding: 14px;
  border: 1px solid rgba(94, 231, 242, .28);
  background: linear-gradient(150deg, rgba(13, 24, 32, .98), rgba(8, 13, 22, .99));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 0 40px rgba(94, 231, 242, .10);
}

/* v1.4.3 Lounge room plan: L sofa in front, dining table behind. */
.voice-stage:not(.screen-sharing) {
  max-height: none;
  overflow: visible;
  scrollbar-gutter: auto;
}
.voice-stage:not(.screen-sharing):not(.lounge-collapsed) .participants { display: none; }
.voice-stage:not(.screen-sharing).lounge-collapsed .participants { display: flex; }
.voice-stage:not(.screen-sharing) .lounge-scene { width: min(1100px, calc(100% - 28px)); margin-top: 6px; }
.voice-stage:not(.screen-sharing) .lounge-room {
  position: relative;
  height: 270px;
  min-height: 270px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(126, 218, 237, .22);
  border-radius: 22px;
  background:
    linear-gradient(180deg, transparent 0 66%, rgba(3, 7, 12, .20) 66% 100%),
    linear-gradient(145deg, #172431, #0c151f 58%, #111d19);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 16px 38px rgba(0,0,0,.28);
}
.voice-stage:not(.screen-sharing) .lounge-room::before {
  content: "";
  position: absolute;
  inset: 0 0 34%;
  border-radius: inherit;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: .55;
}
.voice-stage:not(.screen-sharing) .lounge-room::after {
  content: "";
  position: absolute;
  inset: 66% 0 0;
  display: block;
  background: linear-gradient(100deg, rgba(168,237,85,.04), transparent 42%, rgba(94,231,242,.035));
  clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
}
.voice-stage:not(.screen-sharing) .lounge-brand {
  top: 10px;
  left: 14px;
  right: 14px;
  z-index: 8;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(5, 10, 17, .62);
}
.voice-stage:not(.screen-sharing) .lounge-screen-art {
  position: absolute;
  top: 62px;
  left: 17%;
  z-index: 2;
  width: 116px;
  height: 58px;
  display: block;
  overflow: hidden;
  border: 5px solid #24333f;
  border-radius: 8px;
  background: linear-gradient(150deg, rgba(94,231,242,.16), rgba(168,237,85,.08));
  box-shadow: 0 8px 18px rgba(0,0,0,.26), inset 0 0 22px rgba(94,231,242,.08);
}
.voice-stage:not(.screen-sharing) .lounge-screen-art::before,
.voice-stage:not(.screen-sharing) .lounge-screen-art::after { content: ""; position: absolute; bottom: 0; width: 54%; height: 70%; background: #1a2930; clip-path: polygon(0 100%, 50% 12%, 100% 100%); }
.voice-stage:not(.screen-sharing) .lounge-screen-art::before { left: -4%; }
.voice-stage:not(.screen-sharing) .lounge-screen-art::after { right: -6%; height: 56%; background: #23382f; }
.voice-stage:not(.screen-sharing) .lounge-screen-art > * { display: none; }
.voice-stage:not(.screen-sharing) .lounge-sofa-back { position: absolute; z-index: 3; display: block; border: 1px solid rgba(168,237,85,.18); background: linear-gradient(145deg, #31473b, #1c2e27); box-shadow: inset 0 2px rgba(255,255,255,.07), 0 12px 22px rgba(0,0,0,.28); }
.voice-stage:not(.screen-sharing) .lounge-sofa-back.left { left: 4%; bottom: 31px; width: 76px; height: 134px; border-radius: 25px 18px 15px 25px; }
.voice-stage:not(.screen-sharing) .lounge-sofa-back.right { left: 4%; bottom: 20px; width: 54%; height: 78px; border-radius: 22px 28px 18px 18px; }
.voice-stage:not(.screen-sharing) .lounge-table {
  position: absolute;
  top: 100px;
  right: 8%;
  z-index: 3;
  width: 27%;
  height: 76px;
  display: block;
  border: 1px solid rgba(255, 214, 142, .22);
  border-radius: 50%;
  background: linear-gradient(160deg, #7a5c3d, #3f2c20 68%);
  box-shadow: inset 0 4px rgba(255,255,255,.08), 0 15px 0 -9px #241912, 0 20px 26px rgba(0,0,0,.32);
}
.voice-stage:not(.screen-sharing) .lounge-table::before { content: ""; position: absolute; inset: 14px 24%; border-radius: 50%; background: rgba(255,221,160,.08); }
.voice-stage:not(.screen-sharing) .lounge-table > * { display: none; }
.voice-stage:not(.screen-sharing) .lounge-rug { position: absolute; left: 14%; bottom: 3px; z-index: 1; width: 43%; height: 58px; display: block; border-radius: 50%; background: radial-gradient(ellipse, rgba(94,231,242,.10), rgba(94,231,242,.025) 66%, transparent 68%); }
.voice-stage:not(.screen-sharing) .lounge-plant { position: absolute; z-index: 2; bottom: 75px; display: block; width: 24px; height: 48px; border-radius: 70% 20% 60% 30%; background: #315b3f; box-shadow: 8px -9px #274d36, -7px -14px #3b6948; }
.voice-stage:not(.screen-sharing) .lounge-plant.left { left: 2%; }
.voice-stage:not(.screen-sharing) .lounge-plant.right { right: 2%; }
.voice-stage:not(.screen-sharing) .lounge-zone-label { position: absolute; z-index: 7; padding: 4px 7px; border: 1px solid rgba(255,255,255,.10); border-radius: 999px; color: #c6d3df; background: rgba(4,8,13,.70); font-size: 8px; font-weight: 850; }
.voice-stage:not(.screen-sharing) .lounge-zone-label.sofa { left: 11%; bottom: 5px; }
.voice-stage:not(.screen-sharing) .lounge-zone-label.dining { right: 16%; top: 67px; }
.voice-stage:not(.screen-sharing) .lounge-seats {
  position: absolute;
  inset: 48px 0 0;
  z-index: 6;
  min-height: 0;
  display: block;
  padding: 0;
  overflow: visible;
  isolation: auto;
}
.voice-stage:not(.screen-sharing) .lounge-seats::before,
.voice-stage:not(.screen-sharing) .lounge-seats::after { display: none; }
.voice-stage:not(.screen-sharing) .lounge-seat,
.voice-stage:not(.screen-sharing)[data-lounge-layout="circle"] .lounge-seat,
.voice-stage:not(.screen-sharing)[data-lounge-layout="theater"] .lounge-seat,
.voice-stage:not(.screen-sharing) .lounge-seat.empty {
  position: absolute;
  width: 72px;
  min-width: 0;
  height: 72px;
  min-height: 72px;
  display: flex;
  gap: 2px;
  padding: 5px 4px;
  border-color: rgba(255,255,255,.12);
  border-radius: 15px;
  background: rgba(8, 15, 17, .82);
  box-shadow: 0 8px 16px rgba(0,0,0,.30), inset 0 1px rgba(255,255,255,.06);
}
.voice-stage:not(.screen-sharing) .lounge-seat.seat-1 { left: 4.2%; top: 50px; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-2 { left: 4.2%; top: 126px; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-3 { left: 14%; top: 139px; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-4 { left: 26%; top: 139px; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-5 { left: 38%; top: 139px; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-6 { right: 28%; top: 39px; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-7 { right: 7%; top: 119px; }
.voice-stage:not(.screen-sharing) .lounge-seat:hover { transform: translateY(-3px); }
.voice-stage:not(.screen-sharing) .lounge-avatar { width: 34px; height: 34px; border-radius: 11px; }
.voice-stage:not(.screen-sharing) .lounge-seat.empty::before { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
.voice-stage:not(.screen-sharing) .lounge-seat strong { max-width: 62px; font-size: 8px; }
.voice-stage:not(.screen-sharing) .lounge-seat em,
.voice-stage:not(.screen-sharing) .lounge-seat.empty small { font-size: 7px; }

@media (max-width: 900px) {
  .voice-stage:not(.screen-sharing) { max-height: none; overflow: visible; }
  .voice-stage:not(.screen-sharing) .lounge-room { height: 248px; min-height: 248px; }
  .voice-stage:not(.screen-sharing) .lounge-seat,
  .voice-stage:not(.screen-sharing) .lounge-seat.empty { width: 58px; height: 64px; min-height: 64px; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-3 { left: 16%; top: 128px; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-4 { left: 28%; top: 128px; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-5 { left: 40%; top: 128px; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-7 { right: 6%; top: 109px; }
  .voice-stage:not(.screen-sharing) .lounge-table { right: 7%; width: 29%; }
}

@media (max-width: 680px) {
  .voice-stage:not(.screen-sharing) .lounge-room { height: 224px; min-height: 224px; }
  .voice-stage:not(.screen-sharing) .lounge-brand span,
  .voice-stage:not(.screen-sharing) .lounge-zone-label,
  .voice-stage:not(.screen-sharing) .lounge-screen-art { display: none; }
  .voice-stage:not(.screen-sharing) .lounge-sofa-back.left { width: 56px; height: 112px; }
  .voice-stage:not(.screen-sharing) .lounge-sofa-back.right { width: 58%; height: 67px; }
  .voice-stage:not(.screen-sharing) .lounge-table { top: 85px; height: 61px; }
  .voice-stage:not(.screen-sharing) .lounge-seat,
  .voice-stage:not(.screen-sharing) .lounge-seat.empty { width: 48px; height: 56px; min-height: 56px; padding: 3px; }
  .voice-stage:not(.screen-sharing) .lounge-avatar { width: 27px; height: 27px; border-radius: 9px; }
  .voice-stage:not(.screen-sharing) .lounge-seat strong { max-width: 42px; font-size: 7px; }
  .voice-stage:not(.screen-sharing) .lounge-seat em,
  .voice-stage:not(.screen-sharing) .lounge-seat.empty small { display: none; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-1 { top: 38px; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-2 { top: 98px; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-3,
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-4,
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-5 { top: 112px; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-6 { top: 30px; }
  .voice-stage:not(.screen-sharing) .lounge-seat.seat-7 { top: 91px; }
}
.voice-stage.soundboard-open { overflow: visible !important; }
.soundboard-head { grid-column: 1 / -1; }

.notification-card > b,
#notificationList > button > b {
  width: 48px !important;
  height: 48px !important;
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 231, 242, .2);
  border-radius: 16px !important;
  color: #7ef2fb;
  background: linear-gradient(145deg, rgba(94, 231, 242, .16), rgba(168, 237, 85, .1)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}
.notification-card > b .ui-icon,
#notificationList > button > b .ui-icon { width: 22px; height: 22px; stroke-width: 1.8; }
.notification-clear-action {
  color: #ffb9c2 !important;
  border-color: rgba(255, 93, 116, .34) !important;
  background: rgba(255, 70, 98, .08) !important;
}
.notification-clear-action:hover:not(:disabled) {
  color: #fff !important;
  background: rgba(255, 70, 98, .18) !important;
}

@media (max-width: 820px) {
  .server-focus-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voice-stage .soundboard:not(.hidden) { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
@media (max-width: 560px) {
  .server-focus-switcher { grid-template-columns: 1fr; }
  .voice-stage .soundboard:not(.hidden) { grid-template-columns: 1fr; bottom: 86px; }
}

/* v1.4 readability floor: legacy 6-8px copy was disappearing on dark panels. */
#app :where(small, .context-hint p, .home-panel p, .session-box p, .screen-share-copy b),
dialog :where(small, p, .dialog-note) {
  font-size: max(9px, .58rem);
  line-height: 1.4;
}
#app button:not(.rail-btn):not(.top-icon-action):not([aria-label]):not([title]),
dialog button:not(.x) {
  font-size: max(10px, .64rem);
}
#app :where(button, select, input, textarea):focus-visible,
dialog :where(button, select, input, textarea):focus-visible {
  outline: 2px solid rgba(94, 231, 242, .9);
  outline-offset: 2px;
}

/* v1.4.4 illustrated Lounge: generated room art with interactive seating overlays. */
.voice-stage:not(.screen-sharing) .lounge-room {
  height: clamp(240px, 28vw, 340px);
  min-height: 240px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(94, 231, 242, .24);
  background-color: #071018;
  background-image:
    linear-gradient(180deg, rgba(3,7,12,.02), rgba(3,7,12,.12)),
    url("/assets/lounge-furniture-v1.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: inset 0 1px rgba(255,255,255,.10), 0 18px 44px rgba(0,0,0,.34);
}
.voice-stage:not(.screen-sharing) .lounge-room::before,
.voice-stage:not(.screen-sharing) .lounge-room::after,
.voice-stage:not(.screen-sharing) .lounge-ceiling,
.voice-stage:not(.screen-sharing) .lounge-neon,
.voice-stage:not(.screen-sharing) .lounge-screen-art,
.voice-stage:not(.screen-sharing) .lounge-accent-orbs,
.voice-stage:not(.screen-sharing) .lounge-wall,
.voice-stage:not(.screen-sharing) .lounge-shelf,
.voice-stage:not(.screen-sharing) .lounge-sofa-back,
.voice-stage:not(.screen-sharing) .lounge-table,
.voice-stage:not(.screen-sharing) .lounge-rug,
.voice-stage:not(.screen-sharing) .lounge-plant,
.voice-stage:not(.screen-sharing) .lounge-zone-label { display: none; }
.voice-stage:not(.screen-sharing) .lounge-brand {
  top: 10px;
  left: 12px;
  right: auto;
  width: auto;
  max-width: min(48%, 420px);
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  background: rgba(4, 8, 13, .74);
  box-shadow: 0 8px 22px rgba(0,0,0,.26);
  backdrop-filter: blur(8px);
}
.voice-stage:not(.screen-sharing) .lounge-brand span { font-size: 8px; }
.voice-stage:not(.screen-sharing) .lounge-brand strong { font-size: 10px; }
.voice-stage:not(.screen-sharing) .lounge-seats {
  position: absolute;
  inset: 0;
  z-index: 6;
  min-height: 0;
  display: block;
  padding: 0;
  overflow: visible;
}
.voice-stage:not(.screen-sharing) .lounge-seat,
.voice-stage:not(.screen-sharing)[data-lounge-layout="circle"] .lounge-seat,
.voice-stage:not(.screen-sharing)[data-lounge-layout="theater"] .lounge-seat,
.voice-stage:not(.screen-sharing) .lounge-seat.empty {
  position: absolute;
  width: 86px;
  min-width: 0;
  height: 88px;
  min-height: 88px;
  display: flex;
  gap: 3px;
  padding: 5px 4px;
  border: 0;
  border-radius: 18px;
  color: #f5f9ff;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 9px 10px rgba(0,0,0,.42));
}
.voice-stage:not(.screen-sharing) .lounge-seat:hover {
  z-index: 9;
  border: 0;
  background: rgba(94, 231, 242, .05);
  transform: translate(-50%, calc(-50% - 4px));
}
.voice-stage:not(.screen-sharing) .lounge-seat.self { border: 0; background: rgba(168,237,85,.035); }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-1 { left: 10%; top: 63%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-2 { left: 24%; top: 65%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-3 { left: 38%; top: 62%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-4 { left: 52%; top: 61%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-5 { left: 66%; top: 67%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-6 { left: 76%; top: 57%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-7 { left: 92%; top: 59%; }
.voice-stage:not(.screen-sharing) .lounge-avatar {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(94,231,242,.72), 0 7px 18px rgba(0,0,0,.54);
}
.voice-stage:not(.screen-sharing) .lounge-seat.self .lounge-avatar { box-shadow: 0 0 0 3px rgba(168,237,85,.84), 0 0 22px rgba(168,237,85,.30), 0 7px 18px rgba(0,0,0,.52); }
.voice-stage:not(.screen-sharing) .lounge-seat strong,
.voice-stage:not(.screen-sharing) .lounge-seat em,
.voice-stage:not(.screen-sharing) .lounge-seat.empty small {
  max-width: 82px;
  padding: 2px 6px;
  overflow: hidden;
  border-radius: 999px;
  color: #f4f8ff;
  background: rgba(3, 7, 12, .76);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
.voice-stage:not(.screen-sharing) .lounge-seat em,
.voice-stage:not(.screen-sharing) .lounge-seat.empty small { color: #b8c6d3; font-size: 7px; }
.voice-stage:not(.screen-sharing) .lounge-seat.empty { opacity: .88; filter: none; }
.voice-stage:not(.screen-sharing) .lounge-seat.empty::before {
  width: 31px;
  height: 31px;
  border: 1px solid rgba(168,237,85,.55);
  border-radius: 50%;
  color: #dfffb8;
  background: rgba(7, 18, 17, .72);
  box-shadow: 0 0 18px rgba(168,237,85,.18);
  font-size: 15px;
  backdrop-filter: blur(7px);
}

@media (max-width: 900px) {
  .voice-stage:not(.screen-sharing) .lounge-room { height: clamp(220px, 34vw, 285px); min-height: 220px; }
  .voice-stage:not(.screen-sharing) .lounge-seat,
  .voice-stage:not(.screen-sharing) .lounge-seat.empty { width: 68px; height: 72px; min-height: 72px; }
  .voice-stage:not(.screen-sharing) .lounge-avatar { width: 35px; height: 35px; }
  .voice-stage:not(.screen-sharing) .lounge-seat strong,
  .voice-stage:not(.screen-sharing) .lounge-seat em,
  .voice-stage:not(.screen-sharing) .lounge-seat.empty small { max-width: 66px; }
}

@media (max-width: 680px) {
  .voice-stage:not(.screen-sharing) .lounge-room { height: 210px; min-height: 210px; background-position: 47% center; }
  .voice-stage:not(.screen-sharing) .lounge-brand { max-width: 55%; }
  .voice-stage:not(.screen-sharing) .lounge-seat,
  .voice-stage:not(.screen-sharing) .lounge-seat.empty { width: 52px; height: 60px; min-height: 60px; }
  .voice-stage:not(.screen-sharing) .lounge-avatar { width: 29px; height: 29px; }
  .voice-stage:not(.screen-sharing) .lounge-seat strong { max-width: 50px; padding-inline: 4px; font-size: 7px; }
  .voice-stage:not(.screen-sharing) .lounge-seat em,
  .voice-stage:not(.screen-sharing) .lounge-seat.empty small { display: none; }
  .voice-stage:not(.screen-sharing) .lounge-seat.empty::before { width: 25px; height: 25px; font-size: 12px; }
}

/* v1.4.5 designed Lounge component: transparent furniture, not a background scene. */
.voice-stage:not(.screen-sharing) .lounge-room {
  height: clamp(250px, 29vw, 350px);
  min-height: 250px;
  isolation: isolate;
  border: 1px solid rgba(94, 231, 242, .18);
  background:
    radial-gradient(circle at 16% 20%, rgba(94,231,242,.11), transparent 27%),
    radial-gradient(circle at 82% 76%, rgba(168,237,85,.08), transparent 25%),
    linear-gradient(145deg, #101925, #080d15 62%, #0c1716);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 18px 44px rgba(0,0,0,.32);
}
.voice-stage:not(.screen-sharing) .lounge-room::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  border-radius: inherit;
  background: linear-gradient(110deg, rgba(255,255,255,.025), transparent 32%, rgba(94,231,242,.025));
}
.voice-stage:not(.screen-sharing) .lounge-room::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 5%;
  z-index: -1;
  height: 20%;
  display: block;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(94,231,242,.10), transparent 68%);
  filter: blur(10px);
}
.voice-stage:not(.screen-sharing) .lounge-furniture {
  position: absolute;
  left: 1.5%;
  right: 1.5%;
  bottom: 2%;
  z-index: 2;
  width: 97%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 18px 20px rgba(0,0,0,.42));
}
.voice-stage:not(.screen-sharing) .lounge-brand {
  top: 12px;
  left: 14px;
  z-index: 10;
  max-width: 42%;
  border-color: rgba(94,231,242,.15);
  background: rgba(7, 12, 20, .76);
}
.voice-stage:not(.screen-sharing) .lounge-zone-label {
  position: absolute;
  z-index: 9;
  display: block;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: #b8c8d8;
  background: rgba(7,12,20,.70);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .08em;
  backdrop-filter: blur(7px);
}
.voice-stage:not(.screen-sharing) .lounge-zone-label.sofa { left: 3%; bottom: 3%; }
.voice-stage:not(.screen-sharing) .lounge-zone-label.dining { right: 3%; top: 12px; }
.voice-stage:not(.screen-sharing) .lounge-seats { inset: 0; z-index: 7; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-1 { left: 10%; top: 62%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-2 { left: 24%; top: 57%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-3 { left: 38%; top: 57%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-4 { left: 51%; top: 57%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-5 { left: 64%; top: 57%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-6 { left: 76%; top: 42%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-7 { left: 93%; top: 49%; }

@media (max-width: 900px) {
  .voice-stage:not(.screen-sharing) .lounge-room { height: clamp(225px, 35vw, 290px); min-height: 225px; }
  .voice-stage:not(.screen-sharing) .lounge-furniture { left: 0; right: 0; width: 100%; }
}

@media (max-width: 680px) {
  .voice-stage:not(.screen-sharing) .lounge-room { height: 215px; min-height: 215px; }
  .voice-stage:not(.screen-sharing) .lounge-brand { max-width: 58%; }
  .voice-stage:not(.screen-sharing) .lounge-zone-label { display: none; }
}

/* v1.4.5 Lounge polish: one hierarchy, quiet seat markers, single-row controls. */
.voice-stage:not(.screen-sharing) .lounge-brand { display: none; }
.voice-stage:not(.screen-sharing) .lounge-seat.empty small,
.voice-stage:not(.screen-sharing) .lounge-seat em.zone { display: none; }
.voice-stage:not(.screen-sharing) .lounge-seat em.muted,
.voice-stage:not(.screen-sharing) .lounge-seat em.speaking-label { display: block; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-6 { left: 76%; top: 50%; }
.voice-stage:not(.screen-sharing) .lounge-seat.seat-7 { left: 93%; top: 55%; }
.voice-stage:not(.screen-sharing) .call-controls {
  width: min(780px, calc(100% - 24px));
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 8px auto 10px;
  padding: 8px;
  overflow-x: auto;
}
.voice-stage:not(.screen-sharing) .call-controls button {
  flex: 0 0 58px;
  width: 58px;
  min-width: 58px;
  min-height: 56px;
  height: 56px;
}
.voice-stage:not(.screen-sharing) .call-controls select {
  flex: 0 0 142px;
  width: 142px;
  min-width: 142px;
  min-height: 56px;
  height: 56px;
}

@media (max-width: 680px) {
  .voice-stage:not(.screen-sharing) .call-controls { justify-content: flex-start; }
  .voice-stage:not(.screen-sharing) .call-controls button { flex-basis: 52px; width: 52px; min-width: 52px; }
  .voice-stage:not(.screen-sharing) .call-controls select { flex-basis: 122px; width: 122px; min-width: 122px; }
}
