:root {
  color-scheme: dark;
  --bg-a: #d7e1ec;
  --bg-b: #7f95ad;
  --bg-c: #172231;
  --glass: rgb(245 249 255 / 0.18);
  --glass-strong: rgb(248 251 255 / 0.3);
  --field: rgb(8 14 22 / 0.22);
  --line: rgb(255 255 255 / 0.26);
  --text: #f8fbff;
  --muted: #c4d0df;
  --ink: #132033;
  --accent: #8fc7ff;
  --accent-deep: #4b84c4;
  --success: #9ce9d1;
  --danger: #ff8b96;
  --shadow: rgb(11 22 37 / 0.36);
  --icon-gradient: linear-gradient(145deg, #e9f4ff 0%, #8fc7ff 44%, #9ce9d1 100%);
  --icon-glow: rgb(143 199 255 / 0.38);
  --icon-ring: rgb(255 255 255 / 0.52);
  --icon-text: #102032;
  --font-ui: "Aptos", "Candara", "Trebuchet MS", sans-serif;
  --font-display: "Constantia", "Georgia", serif;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg-a: #ffffff;
  --bg-b: #dce7f1;
  --bg-c: #a3b6ca;
  --glass: rgb(255 255 255 / 0.5);
  --glass-strong: rgb(255 255 255 / 0.72);
  --field: rgb(255 255 255 / 0.44);
  --line: rgb(64 89 116 / 0.2);
  --text: #172334;
  --muted: #627286;
  --ink: #142033;
  --accent: #4d94df;
  --accent-deep: #2e6db2;
  --success: #168a70;
  --danger: #c94758;
  --shadow: rgb(79 101 126 / 0.22);
  --icon-gradient: linear-gradient(145deg, #ffffff 0%, #c9dced 46%, #4d94df 100%);
  --icon-glow: rgb(77 148 223 / 0.24);
  --icon-ring: rgb(46 109 178 / 0.26);
  --icon-text: #132033;
}

body[data-theme="blue"] {
  --bg-a: #c4d9ed;
  --bg-b: #46698e;
  --bg-c: #07111f;
  --glass: rgb(173 203 231 / 0.16);
  --glass-strong: rgb(220 238 255 / 0.24);
  --field: rgb(3 12 24 / 0.22);
  --line: rgb(206 229 255 / 0.2);
  --text: #f0f7ff;
  --muted: #a9bad0;
  --accent: #63b8ff;
  --accent-deep: #2f73b4;
  --success: #8effd8;
  --shadow: rgb(0 0 0 / 0.42);
  --icon-gradient: linear-gradient(145deg, #a7dcff 0%, #3d8bda 43%, #0b2547 100%);
  --icon-glow: rgb(99 184 255 / 0.42);
  --icon-ring: rgb(142 255 216 / 0.36);
  --icon-text: #f2fbff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 18% 12%, var(--bg-a), transparent 30%),
    radial-gradient(circle at 82% 22%, rgb(143 199 255 / 0.42), transparent 26%),
    radial-gradient(circle at 54% 92%, rgb(156 233 209 / 0.24), transparent 24%),
    linear-gradient(145deg, var(--bg-b), var(--bg-c));
  transition: background 260ms ease, color 220ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 44%, rgb(255 255 255 / 0.13) 44% 45%, transparent 45%),
    radial-gradient(circle at 50% 52%, transparent, rgb(0 0 0 / 0.18));
  mix-blend-mode: soft-light;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.theme-switcher {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: 0 18px 48px var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.24);
  backdrop-filter: blur(24px) saturate(1.3);
}

.theme-dot {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(145deg, #dbe7f2, #65809f);
  color: #132033;
  font-size: 11px;
  font-weight: 950;
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.62);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.theme-dot::before {
  content: attr(data-theme-icon);
}

.theme-dot:nth-child(2) {
  background: linear-gradient(145deg, #ffffff, #cad9e8);
  color: #233349;
}

.theme-dot:nth-child(3) {
  background: linear-gradient(145deg, #73bdff, #16365f);
  color: #eff8ff;
}

.theme-dot:hover,
.theme-dot.active {
  transform: translateY(-1px) scale(1.08);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.66), 0 0 0 3px rgb(255 255 255 / 0.22);
}

.auth-card,
.account-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: 0 28px 90px var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.28);
  backdrop-filter: blur(30px) saturate(1.32);
  transform: translateZ(0);
  animation: cardIn 360ms ease both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark,
.success-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--icon-gradient);
  color: var(--icon-text);
  font-size: 24px;
  font-weight: 950;
  box-shadow: inset 0 1px 1px var(--icon-ring), 0 16px 34px var(--shadow), 0 0 0 6px var(--icon-glow);
  transition: background 240ms ease, color 180ms ease, box-shadow 240ms ease, transform 180ms ease;
}

h1,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 0;
}

.brand p,
.message,
.account-handle,
dt {
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(0 0 0 / 0.13);
}

.tab {
  min-height: 40px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

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

.tab.active {
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25);
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--field);
  color: var(--text);
  padding: 10px 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 24%);
}

input:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent), white 18%);
  background: rgb(255 255 255 / 0.14);
  box-shadow: 0 0 0 4px rgb(143 199 255 / 0.16), inset 0 1px 0 rgb(255 255 255 / 0.14);
}

.primary {
  min-height: 44px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.54), 0 14px 30px var(--shadow);
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.primary:active {
  transform: translateY(0) scale(0.99);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.72;
}

.message {
  min-height: 18px;
  line-height: 1.45;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.verify-link {
  color: var(--success);
  font-weight: 900;
  text-decoration: none;
}

.account-card {
  text-align: center;
  justify-items: center;
}

.app-shell {
  width: min(1400px, calc(100vw - 28px));
  height: min(860px, calc(100vh - 28px));
  min-height: 620px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 292px;
  gap: 12px;
  animation: cardIn 360ms ease both;
}

.channel-sidebar,
.chat-panel,
.member-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: 0 28px 90px var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.24);
  backdrop-filter: blur(30px) saturate(1.32);
}

.channel-sidebar,
.member-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.channel-sidebar {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.workspace-header,
.chat-header,
.member-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-header h1,
.chat-header h2,
.member-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0;
}

.workspace-header h1 {
  font-size: 28px;
}

.chat-header h2,
.member-panel h2 {
  font-size: 24px;
}

.small-button,
.tool-button,
.send-button {
  min-height: 38px;
  border-radius: 14px;
  background: var(--glass-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  padding: 0 12px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18);
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.small-button:hover,
.tool-button:hover,
.send-button:hover,
.member-row:hover,
.channel-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.account-strip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.11);
}

.icon-button {
  min-height: 34px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--glass-strong), var(--icon-glow));
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  padding: 0 10px;
  box-shadow: inset 0 1px 0 var(--icon-ring);
  transition: background 220ms ease, box-shadow 220ms ease, transform 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
}

.friend-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.09);
}

.friend-form label {
  gap: 8px;
}

.friend-form span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.friend-form input {
  min-height: 38px;
}

.home-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.08);
}

.home-tab {
  min-height: 34px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.home-tab:hover {
  transform: translateY(-1px);
  color: var(--text);
}

.home-tab.active {
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18);
}

.friend-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: grid;
  justify-items: end;
  gap: 12px;
  pointer-events: auto;
}

.friend-dock-button {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 25%, var(--icon-ring), transparent 34%),
    var(--glass-strong);
  cursor: pointer;
  box-shadow: 0 22px 58px var(--shadow), inset 0 1px 0 var(--icon-ring), 0 0 0 8px var(--icon-glow);
  backdrop-filter: blur(28px) saturate(1.35);
  transition: transform 180ms ease, filter 180ms ease, box-shadow 220ms ease, background 220ms ease;
}

.friend-dock-button:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.06);
}

.friend-dock-button .mini-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
}

.friend-dock-panel {
  width: min(430px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 118px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--glass);
  box-shadow: 0 28px 90px var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.3);
  backdrop-filter: blur(34px) saturate(1.38);
  overflow: hidden;
  animation: dockIn 180ms ease both;
}

@keyframes dockIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.friend-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.friend-dock-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
}

.dock-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgb(255 255 255 / 0.08);
}

.dock-tab {
  min-height: 38px;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 920;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.dock-tab:hover {
  transform: translateY(-1px);
  color: var(--text);
}

.dock-tab.active {
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2);
}

.friend-tool-panel {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result,
.friend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.user-open-button {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-radius: 15px;
  background: rgb(255 255 255 / 0.1);
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  text-align: left;
}

.user-open-button strong,
.user-open-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-open-button small {
  color: var(--muted);
}

.friend-group {
  display: grid;
  gap: 8px;
}

.friend-group h3 {
  margin: 4px 4px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.friend-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}

.danger-button {
  color: var(--danger);
}

.request-pill {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.site-access-card {
  width: min(720px, 100%);
}

.access-list {
  display: grid;
  gap: 10px;
  max-height: min(360px, 40vh);
  overflow: auto;
}

.compact-access-list {
  max-height: min(260px, 30vh);
}

.panel-subhead {
  margin: 4px 0 -4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.access-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.1);
}

.access-row.active,
.focused-access-row {
  border-color: var(--icon-ring);
  background: linear-gradient(145deg, rgb(255 255 255 / 0.16), var(--icon-glow));
}

.access-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.access-row strong,
.access-row small {
  display: block;
}

.access-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.confirm-card {
  max-width: 420px;
}

.confirm-card > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-primary {
  background: linear-gradient(135deg, #ff9b9b, #ff5a75);
}

.inline-message {
  min-height: 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.inline-message.success {
  color: var(--success);
}

.inline-message.error {
  color: var(--danger);
}

.empty-note {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.09);
  color: var(--muted);
  line-height: 1.42;
}

.account-strip strong,
.member-row strong,
.chat-message strong {
  display: block;
}

.account-strip small,
.member-row small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--icon-gradient);
  color: var(--icon-text);
  font-weight: 950;
  box-shadow: inset 0 1px 1px var(--icon-ring), 0 0 0 4px var(--icon-glow);
  background-size: cover;
  background-position: center;
  object-fit: cover;
  transition: background 240ms ease, color 180ms ease, box-shadow 240ms ease;
}

.mini-avatar {
  width: 42px;
  height: 42px;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  font-size: 26px;
}

.channel-list,
.member-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.channel-button,
.dm-row,
.member-row {
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.channel-button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 15px;
  background: transparent;
  padding: 0 12px;
  font-weight: 850;
  text-align: left;
}

.channel-button span {
  color: var(--muted);
}

.channel-button.active,
.dm-row.active,
.member-row.active {
  border-color: var(--line);
  background: var(--glass-strong);
}

.dm-row {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 18px;
  background: rgb(255 255 255 / 0.07);
  cursor: pointer;
  padding: 8px;
  text-align: left;
}

.dm-row strong,
.dm-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-row small {
  color: var(--muted);
}

.dm-row em {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--accent), var(--success));
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-actions {
  display: flex;
  gap: 8px;
}

.message-list {
  display: grid;
  align-content: end;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.chat-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  max-width: 760px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgb(255 255 255 / 0.11);
}

.chat-message.mine {
  justify-self: end;
  background: color-mix(in srgb, var(--accent), transparent 78%);
}

.chat-message p {
  margin-top: 4px;
  line-height: 1.42;
}

.message-form {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.message-form input {
  min-height: 42px;
}

.tool-button {
  padding: 0;
  font-size: 20px;
}

.send-button {
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  color: var(--ink);
}

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

.member-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border-radius: 18px;
  background: transparent;
  padding: 8px;
  text-align: left;
}

.member-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgb(255 255 255 / 0.11);
  text-align: center;
}

.member-card h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
}

.member-card p {
  color: var(--muted);
}

.primary.compact {
  width: 100%;
  min-height: 38px;
  border-radius: 14px;
}

.primary.compact:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(3 8 14 / 0.34);
  backdrop-filter: blur(16px);
}

.settings-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: 0 28px 90px var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.26);
  backdrop-filter: blur(30px) saturate(1.32);
}

.settings-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
}

.compact-popout {
  place-items: center;
}

.profile-popout-card {
  width: min(360px, 100%);
  justify-items: center;
  text-align: center;
  position: relative;
}

.close-popout {
  justify-self: end;
}

#popoutHandle,
#popoutStatus,
#popoutBio {
  color: var(--muted);
}

.app-shell.hide-channels {
  grid-template-columns: 0 minmax(0, 1fr) 292px;
}

.app-shell.hide-channels .channel-sidebar {
  overflow: hidden;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.app-shell.hide-members {
  grid-template-columns: 300px minmax(0, 1fr) 0;
}

.app-shell.hide-members .member-panel {
  overflow: hidden;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 980px) {
  .app-shell {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    min-height: 560px;
    grid-template-columns: 244px minmax(0, 1fr);
    gap: 10px;
  }

  .member-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 4;
    width: min(292px, calc(100vw - 20px));
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .app-shell.hide-members {
    grid-template-columns: 244px minmax(0, 1fr);
  }

  .app-shell.hide-members .member-panel {
    padding: 16px;
    opacity: 0;
    transform: translateX(calc(100% + 14px));
  }

  .app-shell.hide-channels {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  body {
    overflow: auto;
  }

  .auth-shell {
    min-height: 100vh;
    align-items: stretch;
  }

  .app-shell {
    height: auto;
    min-height: calc(100vh - 20px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(360px, auto) minmax(480px, 1fr);
  }

  .channel-sidebar {
    min-height: 360px;
  }

  .chat-panel {
    grid-column: 1;
    min-height: 480px;
  }

  .app-shell.hide-channels {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell.hide-channels .channel-sidebar {
    display: none;
  }

  .app-shell.hide-channels .chat-panel {
    grid-column: 1;
    grid-row: 1 / -1;
  }

  .friend-dock {
    right: 14px;
    bottom: 14px;
  }

  .friend-dock-panel {
    max-height: calc(100vh - 104px);
  }

  .chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-actions {
    width: 100%;
  }

  .chat-actions .small-button {
    flex: 1;
  }
}

.eyebrow {
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-details {
  width: 100%;
  display: grid;
  gap: 10px;
  margin: 6px 0 0;
}

.account-details div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.11);
  text-align: left;
}

dt,
dd {
  margin: 0;
}

dd {
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 14px;
  }

  .theme-switcher {
    top: 12px;
    right: 12px;
  }

  .auth-card,
  .account-card {
    padding: 18px;
  }
}
