:root {
  color-scheme: light;
  --bg: #f6f1f3;
  --panel: #ffffff;
  --panel-2: #fcf3f6;
  --text: #2d2227;
  --muted: #75636b;
  --line: #ead8df;
  --brand: #d75b8e;
  --brand-dark: #b13e70;
  --brand-soft: #fae5ed;
  --brand-ink: #a73564;
  --brand-border: #edb7ca;
  --danger: #e64646;
  --good: #4bb34b;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181216;
  --panel: #241b20;
  --panel-2: #30232a;
  --text: #f6edf1;
  --muted: #b9a4ad;
  --line: #49343e;
  --brand: #cb4f82;
  --brand-dark: #ad3a69;
  --brand-soft: #442836;
  --brand-ink: #e991b3;
  --brand-border: #7a4058;
  --danger: #ef6666;
  --good: #62c862;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  transition: background-color .18s ease, color .18s ease;
}

#app, .shell, .layout, #main {
  min-width: 0;
  max-width: 100%;
}
img, video { max-width: 100%; }

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,.32) 0 13%, transparent 13.5%),
    linear-gradient(155deg, #f9c5d7 0%, #f6afc8 52%, #ee9fbd 100%);
}
.app-splash-inner {
  display: grid;
  justify-items: center;
  gap: 30px;
  transform: translateY(-3vh);
}
.app-splash-logo {
  width: clamp(132px, 34vw, 176px);
  aspect-ratio: 1;
  border-radius: 34px;
  box-shadow: 0 20px 50px rgba(119,44,77,.2), 0 0 0 1px rgba(255,255,255,.32);
}
.app-splash-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(177,62,112,.2);
  border-top-color: var(--brand-dark);
  border-right-color: var(--brand-dark);
  border-radius: 50%;
  animation: app-splash-spin .78s linear infinite;
  filter: drop-shadow(0 2px 5px rgba(177,62,112,.18));
}
.app-section-loader { animation: app-loader-appear .16s ease both; }
.app-section-loader .app-splash-inner { gap: 20px; }
.app-loading-label {
  max-width: min(82vw, 340px);
  color: #7f264d;
  font-size: 15px;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,.32);
}
@keyframes app-loader-appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes app-splash-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .app-splash-spinner { animation-duration: 1.6s; }
}

button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: white;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: var(--brand); }
button.secondary, .filepick, .chat-filepick {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
button.secondary:hover, .filepick:hover, .chat-filepick:hover { background: #f7dde7; }
button.ghost {
  background: transparent;
  color: var(--brand-ink);
  padding: 7px 8px;
}
button.ghost:hover { background: var(--brand-soft); }
button.danger { color: #d32f2f; }
button.logo {
  background: transparent;
  padding: 0;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #e5d5dc;
  border-radius: 4px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand-border); }
select { max-width: 220px; }
textarea { resize: vertical; min-height: 86px; }

.shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 48px;
  background: var(--brand);
  color: white;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}
.logo {
  font-size: 20px;
  font-weight: 800;
  color: white;
  letter-spacing: .1px;
}
.hamburger {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(255,255,255,.12);
  font-size: 22px;
}
.tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  background: rgba(255,255,255,.10);
  color: white;
  padding: 8px 11px;
}
.tab.active { background: rgba(255,255,255,.22); }
.userbar { display: flex; align-items: center; gap: 10px; }
.top-ghost { color: white; }
.top-ghost:hover { background: rgba(255,255,255,.14); }

.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: white;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}

.layout {
  max-width: 1280px;
  margin: 18px auto;
  padding: 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.side, .rightcol { display: flex; flex-direction: column; gap: 12px; }
.profile {
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}
.avatar.big { width: 52px; height: 52px; font-size: 18px; }
.avatar-img { object-fit: cover; }
.small { color: var(--muted); font-size: 13px; }

.navlist { padding: 8px; }
.navitem {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--brand-ink);
  font-weight: 600;
  padding: 9px 10px;
  text-align: left;
}
.navitem:hover, .navitem.active { background: var(--brand-soft); }
.mobile-backdrop, .mobile-menu { display: none; }

.composer, .post, .section { padding: 14px; }
.composer-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.composer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}
.publish-button {
  min-width: 126px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.publish-button:disabled { opacity: .88; cursor: wait; }
.button-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.42);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: publish-spin .75s linear infinite;
}
.publish-progress {
  margin: 12px 0 0 54px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  background: #fcecf2;
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 650;
}
.publish-progress .button-spinner { border-color: #efbbcd; border-top-color: var(--brand-ink); }
.publish-progress[hidden] { display: none; }
.composer.is-publishing textarea,
.composer.is-publishing select,
.composer.is-publishing .filepick { opacity: .62; }
.post-error { margin: 8px 0 0 54px; min-height: 0; }
@keyframes publish-spin { to { transform: rotate(360deg); } }
.file-name { margin: 8px 0 0 54px; }
.filepick {
  border-radius: 4px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 600;
}
.filepick input { display: none; }
.feed { display: flex; flex-direction: column; gap: 12px; }

.notice {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-radius: 4px;
  background: #fff8e5;
  color: #7a5b12;
  border: 1px solid #f0dfaa;
  font-weight: 600;
}
.push-highlight {
  animation: pushGlow 2.4s ease;
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
@keyframes pushGlow {
  0% { box-shadow: 0 0 0 0 rgba(215,91,142,.35); }
  45% { box-shadow: 0 0 0 10px rgba(215,91,142,.12); }
  100% { box-shadow: none; }
}

.post-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.post-title { flex: 1; }
.post-text { white-space: pre-wrap; line-height: 1.45; margin: 8px 0 12px; overflow-wrap: anywhere; }
.media {
  max-height: 620px;
  width: 100%;
  object-fit: contain;
  border-radius: 4px;
  background: #2b1821;
  border: 1px solid var(--line);
}
.media-click { cursor: zoom-in; }

.reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
}
.reaction-picker { position: relative; }
.reaction-summary {
  list-style: none;
  width: 48px;
  min-width: 48px;
  height: 38px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--brand-ink);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-weight: 700;
  font-size: 21px;
  cursor: pointer;
}
.reaction-summary::-webkit-details-marker { display: none; }
.reaction-summary::after { content: ""; }
.reaction-summary.active { background: var(--brand-soft); border-color: var(--brand-border); }
.reaction-menu {
  position: absolute;
  z-index: 20;
  top: 44px;
  left: 0;
  width: 188px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.reaction-option {
  background: var(--panel-2);
  color: var(--brand-ink);
  border: 1px solid transparent;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.reaction-option:hover, .reaction-option.active {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.reaction-icon { font-size: 21px; }
.reaction-totals { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 32px; }
.reaction-total {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-ink);
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 800;
}

.comments { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.comment {
  background: var(--panel-2);
  border-radius: 4px;
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  overflow-wrap: anywhere;
}
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; }

.panel-title {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.people, .chat-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.person, .chat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 4px;
  background: var(--panel-2);
}
.person { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
.person-name {
  background: transparent;
  color: var(--text);
  padding: 0;
  font-weight: 700;
  text-align: left;
}
.person-name:hover { background: transparent; color: var(--brand-ink); }
.mini { padding: 7px 9px; font-size: 13px; white-space: nowrap; }
.person-actions { width: 100%; grid-column: 2; display: flex; align-items: center; justify-self: stretch; gap: 6px; }
.person-actions .mini { min-width: 0; flex: 1 1 0; padding: 8px 9px; overflow: hidden; text-overflow: ellipsis; }

.chat-inbox { border-radius: 14px; overflow: hidden; }
.chat-inbox-head {
  padding: 18px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.chat-inbox-head h2 { margin: 2px 0 0; font-size: 26px; }
.chat-inbox .chat-list { padding: 8px; gap: 4px; }
.chat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 14px 10px 6px;
}
.chat-hint {
  background: var(--panel-2);
  border-radius: 10px;
  padding: 12px;
}
.chat-row {
  width: 100%;
  min-height: 70px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.chat-row:hover { background: #fdf3f6; }
.chat-row.selected { border-color: var(--brand-border); background: #fcecf2; }
.family-chat-row { margin-bottom: 2px; background: #fdf1f5; }
.chat-list-avatar { width: 50px; height: 50px; font-size: 17px; }
.family-chat-avatar { background: linear-gradient(145deg, #e57fa5, #a73564); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.chat-row-body { min-width: 0; display: grid; gap: 5px; }
.chat-row-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.chat-row-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.chat-row-side { display: flex; align-items: center; gap: 7px; }
.chat-row-side time { color: #9c8991; font-size: 11px; font-weight: 500; }
.chat-row-preview { color: var(--muted); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .badge { color: white; }

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-brand { color: var(--brand-ink); font-size: 28px; font-weight: 850; margin-bottom: 12px; }
.auth-card { width: min(430px, 100%); padding: 24px; }
.auth-card h1 { margin: 0 0 6px; }
.form { display: grid; gap: 12px; margin-top: 18px; }
.remember-row { display: inline-flex; align-items: center; gap: 9px; color: #49343e; font-weight: 650; }
.remember-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.error { color: #b91c1c; min-height: 20px; }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

body.vpn-page .layout {
  max-width: 1180px;
  grid-template-columns: minmax(0, 1fr);
}
body.vpn-page .rightcol { display: none; }
.vpn-admin { display: grid; gap: 18px; }
.vpn-hero {
  min-height: 168px;
  padding: 26px 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  position: relative;
  border-radius: 18px;
  color: white;
  background:
    radial-gradient(circle at 82% 22%, rgba(255,255,255,.18), transparent 25%),
    linear-gradient(135deg, #bc3e74 0%, #d75b8e 52%, #e881aa 100%);
  box-shadow: 0 18px 45px rgba(144,42,84,.18);
}
.vpn-hero::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -100px;
  bottom: -150px;
  border: 26px solid rgba(255,255,255,.08);
  border-radius: 50%;
}
.vpn-hero-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 23px;
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.vpn-hero-icon svg { width: 42px; height: 42px; fill: none; stroke: white; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vpn-hero-copy { position: relative; z-index: 1; min-width: 0; }
.vpn-eyebrow, .vpn-step {
  display: block;
  color: var(--brand-ink);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: .12em;
}
.vpn-hero .vpn-eyebrow { color: rgba(255,255,255,.76); }
.vpn-hero h1 { margin: 6px 0 7px; font-size: clamp(28px, 4vw, 38px); line-height: 1.05; letter-spacing: -.035em; }
.vpn-hero p { max-width: 560px; margin: 0; color: rgba(255,255,255,.86); font-size: 15px; line-height: 1.45; }
.vpn-server-state {
  position: relative;
  z-index: 1;
  min-width: 178px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 13px;
  background: rgba(72,18,43,.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.vpn-server-state div { min-width: 0; display: grid; gap: 3px; }
.vpn-server-state strong { font-size: 13px; }
.vpn-server-state small { overflow: hidden; color: rgba(255,255,255,.7); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.vpn-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #55db88;
  box-shadow: 0 0 0 5px rgba(85,219,136,.16);
}
.vpn-server-state.offline .vpn-status-dot, .vpn-status-dot.offline { background: #ff8383; box-shadow: 0 0 0 5px rgba(255,131,131,.14); }
.vpn-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vpn-summary-card {
  min-width: 0;
  padding: 17px 19px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 6px 22px rgba(91,45,65,.045);
}
.vpn-summary-card > span { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-weight: 700; }
.vpn-summary-card strong { color: var(--brand-ink); font-size: 25px; line-height: 1; letter-spacing: -.025em; }
.vpn-summary-card small { justify-self: end; color: var(--muted); font-size: 10px; text-align: right; }
.vpn-summary-card.traffic strong { font-size: 20px; }
.vpn-admin-grid { display: grid; grid-template-columns: minmax(290px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.vpn-create-card, .vpn-users-card { border-radius: 16px; box-shadow: 0 8px 28px rgba(91,45,65,.06); }
.vpn-create-card { padding: 23px; }
.vpn-create-card h2, .vpn-users-head h2 { margin: 6px 0 5px; font-size: 22px; letter-spacing: -.02em; }
.vpn-create-card > p { margin: 0; color: var(--muted); line-height: 1.45; }
.vpn-create-form { margin-top: 22px; display: grid; gap: 12px; }
.vpn-create-form label { display: grid; gap: 7px; }
.vpn-create-form label > span { color: var(--muted); font-size: 12px; font-weight: 750; }
.vpn-create-form input { min-height: 46px; padding: 11px 13px; border-radius: 10px; }
.vpn-create-form button { min-height: 46px; border-radius: 10px; position: relative; }
.vpn-create-form button:disabled { cursor: wait; opacity: .76; }
.vpn-button-spinner { display: none; width: 18px; height: 18px; margin: auto; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: app-splash-spin .7s linear infinite; }
.vpn-create-form button.loading .vpn-button-label { display: none; }
.vpn-create-form button.loading .vpn-button-spinner { display: block; }
.vpn-hint {
  margin-top: 20px;
  padding: 13px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.vpn-hint svg { width: 24px; height: 24px; fill: none; stroke: var(--brand-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vpn-users-card { overflow: hidden; }
.vpn-users-head {
  padding: 21px 22px 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.vpn-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 750;
}
.vpn-user-list { padding: 7px 13px 13px; }
.vpn-user {
  min-width: 0;
  padding: 13px 9px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.vpn-user:last-child { border-bottom: 0; }
.vpn-user.revoked { opacity: .58; }
.vpn-user-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.vpn-user-symbol.system { color: white; background: linear-gradient(145deg, var(--brand), var(--brand-dark)); }
.vpn-user-symbol svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vpn-user-copy { min-width: 0; display: grid; gap: 5px; }
.vpn-user-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.vpn-user-title strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.vpn-user-copy > span { color: var(--muted); font-size: 12px; }
.vpn-user-status { min-height: 17px; font-size: 12px; }
.vpn-online { display: inline-flex; align-items: center; gap: 5px; color: var(--good); font-weight: 750; }
.vpn-online i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 15%, transparent);
}
.vpn-online b { font-weight: 750; }
.vpn-offline { color: var(--muted); }
.vpn-traffic {
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}
.vpn-traffic span, .vpn-traffic strong {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--panel-2);
  white-space: nowrap;
}
.vpn-traffic strong { color: var(--text); font-weight: 800; }
.vpn-tag {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.vpn-user-actions { display: flex; align-items: center; gap: 4px; }
.vpn-user-actions button { min-height: 36px; border-radius: 9px; padding: 8px 11px; font-size: 12px; }
.vpn-revoke-button { white-space: nowrap; }
.vpn-empty { padding: 34px 18px; color: var(--muted); text-align: center; }
.vpn-loading, .vpn-error-card {
  min-height: 190px;
  padding: 28px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.vpn-loader { width: 25px; height: 25px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: app-splash-spin .75s linear infinite; }
.vpn-error-card { justify-content: flex-start; }
.vpn-error-card div { flex: 1; }
.vpn-error-card h2 { margin: 0 0 5px; }
.vpn-error-card p { margin: 0; color: var(--muted); }
.vpn-error-card button { border-radius: 9px; }
.vpn-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(33,15,24,.76);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.vpn-qr-dialog {
  width: min(430px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(22,8,14,.35);
  text-align: center;
}
.vpn-qr-dialog .vpn-step { color: var(--brand); }
.vpn-qr-dialog h2 { margin: 7px 0 5px; font-size: 25px; }
.vpn-qr-dialog > p { max-width: 340px; margin: 0 auto 18px; color: var(--muted); line-height: 1.45; }
.vpn-qr-frame {
  width: min(300px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.vpn-qr-frame img { width: 100%; height: 100%; display: block; border-radius: 9px; }
.vpn-modal-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: white;
  font-size: 29px;
  line-height: 1;
}
.vpn-modal-actions { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.vpn-modal-actions button, .vpn-download {
  min-height: 43px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}
.vpn-download { background: var(--brand-soft); color: var(--brand-ink); }
.vpn-copy-status { min-height: 17px; margin-top: 10px; display: block; color: var(--muted); }

.chat-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; }
.chat-wrap.chat-focus, .chat-wrap.chat-list-only { grid-template-columns: minmax(0, 1fr); }
.chat-window { min-height: 560px; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; }
.chat-conversation-header {
  position: relative;
  z-index: 5;
  min-height: 68px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 46px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.chat-back {
  min-height: 38px;
  padding: 7px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.chat-back:hover { background: #f7dde7; }
.back-chevron {
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.chat-header-avatar { width: 46px; height: 46px; font-size: 16px; }
.chat-header-copy { min-width: 0; display: grid; gap: 3px; }
.chat-header-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.chat-header-copy small { color: var(--muted); font-size: 12px; }
.messages {
  padding: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #fdf7f9;
}
.message {
  position: relative;
  min-width: 150px;
  max-width: 72%;
  padding: 9px 11px 8px;
  border: 1px solid rgba(159,126,140,.14);
  border-radius: 14px 14px 14px 5px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(64,38,49,.06);
  overflow: visible;
}
.message.mine { align-self: flex-end; border-radius: 14px 14px 5px 14px; background: #f9e3ec; }
.message-head { min-height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.message-head > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand-ink); }
.message-reply-button {
  flex: 0 0 auto;
  padding: 3px 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.message-reply-button:hover { background: rgba(167,53,100,.09); color: var(--brand-ink); }
.message-reply-button span:first-child { font-size: 16px; line-height: 1; }
.message-reply-quote {
  width: 100%;
  margin: 6px 0 3px;
  padding: 7px 9px;
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--brand);
  border-radius: 7px;
  background: rgba(215,91,142,.09);
  color: var(--text);
  text-align: left;
}
.message-reply-quote:hover { background: rgba(215,91,142,.14); }
.message-reply-quote strong { color: var(--brand-ink); font-size: 12px; }
.message-reply-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 500; }
.message-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-bottom { margin-top: 7px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.message-reactions { min-width: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.message-reaction-picker { z-index: 4; }
.message-reaction-picker[open] { z-index: 40; }
.message-reaction-picker .reaction-summary {
  width: 34px;
  min-width: 34px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  font-size: 17px;
  background: rgba(255,255,255,.58);
  border-color: rgba(159,126,140,.2);
}
.message-reaction-picker .reaction-menu { top: auto; bottom: 34px; left: 0; border-radius: 12px; }
.message.mine .message-reaction-picker .reaction-menu { right: 0; left: auto; }
.message-reactions .reaction-total { padding: 4px 7px; border-color: rgba(159,126,140,.2); background: rgba(255,255,255,.68); }
.message-meta {
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.message:not(.mine) .message-meta { justify-content: flex-start; }
.message-status { font-weight: 700; color: #7b6670; }
.message-status.read { color: var(--brand-ink); }
.chat-media {
  display: block;
  width: min(320px, 100%);
  max-height: 360px;
  margin-top: 7px;
  border-radius: 4px;
  object-fit: contain;
  background: #2b1821;
}
.chat-media-click { cursor: zoom-in; }
.message-form {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  align-items: center;
  background: #fefafb;
}
.message-form > input[name="text"] { min-width: 0; min-height: 44px; border-radius: 22px; padding-inline: 15px; }
.message-form > button { min-height: 42px; border-radius: 21px; padding-inline: 18px; }
.message-form > button:disabled { cursor: wait; }
.message-send-error { grid-column: 1 / -1; min-height: 0; }
.message-reply-composer {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 8px 10px 8px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  border-left: 3px solid var(--brand);
  border-radius: 9px;
  background: var(--brand-soft);
}
.message-reply-composer[hidden] { display: none; }
.message-reply-composer > div { min-width: 0; display: grid; gap: 2px; }
.message-reply-composer strong { color: var(--brand-ink); font-size: 12px; }
.message-reply-composer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.message-reply-composer button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brand-ink);
  font-size: 23px;
  line-height: 1;
}
.message-reply-composer button:hover { background: rgba(167,53,100,.1); }
.chat-filepick {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 650;
  cursor: pointer;
  line-height: 1;
}
.chat-filepick input { display: none; }
.chat-file-name { grid-column: 2 / 4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

body.chat-page { height: 100svh; overflow: hidden; }
body.chat-page .shell { height: 100svh; min-height: 0; overflow: hidden; }
body.chat-page .layout {
  width: 100%;
  max-width: none;
  height: calc(100svh - 48px);
  min-height: 0;
  margin: 0;
  padding: 12px 18px;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
body.chat-page .side,
body.chat-page .rightcol { display: none; }
body.chat-page #main,
body.chat-page .chat-wrap { width: 100%; height: 100%; min-height: 0; }
body.chat-page .chat-inbox,
body.chat-page .chat-window { height: 100%; min-height: 0; }
body.chat-page .chat-inbox { display: flex; flex-direction: column; }
body.chat-page .chat-inbox .chat-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
body.chat-page .chat-wrap { gap: 0; }
.message.reply-highlight { animation: reply-highlight 1.35s ease; }
@keyframes reply-highlight {
  0%, 35% { box-shadow: 0 0 0 3px rgba(215,91,142,.36), 0 5px 18px rgba(167,53,100,.16); }
  100% { box-shadow: 0 2px 7px rgba(64,38,49,.06); }
}

.empty { padding: 30px; text-align: center; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
}
.stat strong { display: block; font-size: 22px; color: var(--brand-ink); }
.stat span { color: var(--muted); font-size: 13px; }
.push-box { padding: 12px; display: grid; gap: 9px; }
.push-box button:disabled { opacity: .65; cursor: not-allowed; }
.mobile-push-card { display: none; margin-bottom: 14px; }

.photo-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.media-section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.media-section-head h2 { margin: 0 0 5px; }
.media-section-head > button { flex: 0 0 auto; }
.media-library-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.video-album-group { margin-top: 18px; }
.video-album-group + .video-album-group { margin-top: 24px; }
.library-form {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto) auto auto;
  gap: 10px;
  align-items: center;
}
.library-form.video-library-form { grid-template-columns: minmax(0, 1fr) auto auto; }
.music-library-head {
  padding: 4px 2px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.music-library-head h2 { margin: 2px 0 0; font-size: 30px; letter-spacing: -.5px; }
.eyebrow {
  color: #9b657a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.music-library-actions { display: flex; gap: 8px; }
.music-owner-switcher {
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.music-owner {
  min-width: 150px;
  padding: 9px 13px 9px 9px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  box-shadow: 0 4px 14px rgba(91,38,60,.05);
}
.music-owner:hover { background: var(--brand-soft); color: var(--text); }
.music-owner.active { border-color: var(--brand-border); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(215,91,142,.12); }
.music-owner-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  object-fit: cover;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.music-owner > span:last-child { min-width: 0; display: grid; gap: 2px; }
.music-owner strong, .music-owner small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-owner small { color: var(--muted); font-weight: 500; }
.music-tool-panel { margin-bottom: 14px; padding: 16px; }
.music-tool-panel h3 { margin: 0 0 12px; }
.music-album-form {
  display: grid;
  grid-template-columns: minmax(200px, 320px) auto;
  gap: 8px;
  justify-content: start;
}
.music-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto auto;
  gap: 9px;
  align-items: center;
}
.music-upload-form select { max-width: none; }
.music-all-section {
  margin: 4px 0 24px;
  display: grid;
  gap: 12px;
}
.music-all-head {
  padding: 4px 2px 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.music-all-head h3 { margin: 3px 0 4px; font-size: 24px; letter-spacing: -.35px; }
.music-all-head .music-album-actions { margin-top: 0; }
.music-all-player { box-shadow: 0 8px 24px rgba(91,38,60,.08); }
.music-album-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 16px;
}
.music-album-card {
  border: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border-radius: 12px;
}
.music-album-card:hover { background: transparent; color: var(--brand-ink); }
.music-album-card:hover .music-album-cover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(105,41,69,.18); }
.music-album-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #f0a0bd, #aa3d6d);
  color: #fff;
  font-size: clamp(48px, 6vw, 76px);
  box-shadow: 0 8px 22px rgba(105,41,69,.14);
  transition: transform .18s ease, box-shadow .18s ease;
}
.music-album-cover span {
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.17);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.album-tone-1 { background: linear-gradient(145deg, #f3b7cd, #c85d89 58%, #7a294d); }
.album-tone-2 { background: linear-gradient(145deg, #f2cada, #d17a9e 55%, #8d365d); }
.album-tone-3 { background: linear-gradient(145deg, #e997b6, #a83f6b 60%, #67243f); }
.album-tone-4 { background: linear-gradient(145deg, #efb2c8, #bd577f 58%, #7b2c50); }
.music-album-info { min-width: 0; display: grid; gap: 2px; padding: 0 2px; }
.music-album-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.music-album-info small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.music-empty { grid-column: 1 / -1; }
.music-album-page { display: grid; gap: 16px; }
.music-back {
  justify-self: start;
  padding: 6px 2px;
  background: transparent;
  color: var(--brand-ink);
  font-size: 16px;
}
.music-back:hover { background: transparent; color: #7f264d; }
.music-album-hero {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  padding: 2px 4px 10px;
}
.music-album-cover-large { max-width: 240px; font-size: 70px; }
.music-album-summary { min-width: 0; padding-bottom: 4px; }
.music-album-summary h2 { margin: 6px 0; font-size: clamp(30px, 5vw, 48px); line-height: 1.02; letter-spacing: -1.2px; }
.music-album-owner { color: var(--muted); font-size: 15px; }
.music-album-actions { margin-top: 20px; display: flex; gap: 10px; }
.music-album-actions button {
  min-width: 150px;
  min-height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.button-icon { width: 18px; height: 18px; display: grid; place-items: center; }
.shuffle-glyph {
  display: inline-block;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}
.apple-player {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  border-radius: 14px;
}
.now-playing {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}
.now-cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f0a0bd, #aa3d6d);
  color: white;
  font-size: 22px;
}
.now-playing > span:last-child { min-width: 0; display: grid; gap: 3px; }
.now-playing strong, .now-playing small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing small { color: var(--muted); }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 12px; }
.player-icon, .player-play {
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.player-icon {
  width: 42px;
  height: 42px;
  border: 1px solid #edd9e1;
  background: #fcf5f8;
  color: var(--brand-ink);
}
.player-icon:hover { background: #f9e8ef; color: #7f264d; transform: translateY(-1px); }
.player-icon.active { border-color: var(--brand-ink); background: var(--brand-ink); color: white; }
.player-play {
  width: 58px;
  height: 58px;
  background: var(--brand-ink);
  color: #fff;
  box-shadow: 0 7px 18px rgba(167,53,100,.25);
}
.player-play:hover { background: #8e2d58; transform: translateY(-1px); box-shadow: 0 9px 22px rgba(167,53,100,.30); }
.play-state-icon { display: block; position: relative; flex: 0 0 auto; }
.play-state-icon.icon-play {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
  transform: translateX(1px);
}
.play-state-icon.icon-pause { width: 13px; height: 16px; }
.play-state-icon.icon-pause::before,
.play-state-icon.icon-pause::after {
  content: "";
  position: absolute;
  top: 0;
  width: 4px;
  height: 16px;
  border-radius: 1px;
  background: currentColor;
}
.play-state-icon.icon-pause::before { left: 1px; }
.play-state-icon.icon-pause::after { right: 1px; }
.skip-icon { width: 18px; height: 18px; display: block; position: relative; }
.skip-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.skip-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  background: currentColor;
}
.skip-icon.previous::before { left: 4px; border-right: 9px solid currentColor; }
.skip-icon.previous::after { left: 2px; }
.skip-icon.next::before { right: 4px; border-left: 9px solid currentColor; }
.skip-icon.next::after { right: 2px; }
.player-timeline {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}
.player-timeline span:last-child { text-align: right; }
.player-timeline input {
  width: 100%;
  height: 18px;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}
.player-timeline input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--brand-ink) 0 var(--progress), #ecd9e1 var(--progress) 100%);
}
.player-timeline input::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--brand-ink);
  box-shadow: 0 1px 5px rgba(93,36,61,.28);
}
.player-timeline input::-moz-range-track { height: 4px; border-radius: 999px; background: #ecd9e1; }
.player-timeline input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--brand-ink); }
.player-timeline input::-moz-range-thumb { width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: var(--brand-ink); }
.music-track-list { padding: 0 16px; overflow: hidden; border-radius: 14px; }
.music-track-row {
  width: 100%;
  min-height: 62px;
  padding: 9px 4px;
  display: grid;
  grid-template-columns: 28px 0 minmax(0, 1fr);
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.music-track-row:last-child { border-bottom: 0; }
.music-track-row:hover, .music-track-row.active { background: #fdf3f6; }
.music-track-row.active { color: var(--brand-ink); grid-template-columns: 0 28px minmax(0, 1fr); }
.track-number { color: var(--muted); text-align: center; }
.track-play-mark { opacity: 0; color: var(--brand-ink); display: grid; place-items: center; }
.mini-play-triangle {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}
.music-track-row.active .track-number { opacity: 0; }
.music-track-row.active .track-play-mark { opacity: 1; text-align: center; }
.track-copy { min-width: 0; display: grid; gap: 3px; }
.track-copy strong, .track-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-copy small { color: var(--muted); font-weight: 500; }
.library-list-title {
  margin: 18px 2px 8px;
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.library-list-title span {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 12px;
  background: #f9e3ec;
  color: #a75b77;
  font-size: 13px;
  text-align: center;
}
.media-library-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.library-title {
  color: var(--brand-ink);
  font-weight: 800;
  font-size: 17px;
}
.library-player {
  width: 100%;
  max-height: 360px;
  border-radius: 6px;
  background: #000;
}
.call-wrap {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
}
.call-list {
  padding: 8px;
  display: grid;
  gap: 4px;
  align-content: start;
  border-radius: 14px;
}
.call-list-head {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.call-list-head h2 { margin: 2px 0 0; font-size: 24px; }
.call-target {
  width: 100%;
  min-height: 70px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
}
.call-target:hover { background: var(--panel-2); }
.call-target.selected { border-color: var(--brand-border); background: var(--brand-soft); }
.family-call-target { background: var(--panel-2); }
.call-list-avatar { width: 50px; height: 50px; font-size: 17px; }
.call-target-copy { min-width: 0; display: grid; gap: 4px; }
.call-target-copy strong, .call-target-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-target small { color: var(--muted); font-weight: 500; }
.call-row-actions { display: flex; align-items: center; gap: 6px; }
.call-type-button {
  min-width: 54px;
  padding: 7px 8px;
  border: 1px solid var(--brand-border);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1;
  font-weight: 750;
  box-shadow: none;
}
.call-type-video { background: var(--brand); color: #fff; }
.call-type-video:hover { background: var(--brand-dark); }
.call-only-video { min-width: 68px; }
.call-type-button:disabled { opacity: .55; cursor: wait; }
.incoming-call-screen[hidden] { display: none; }
.incoming-call-screen {
  position: fixed;
  z-index: 300;
  inset: 0;
  min-height: 100svh;
  padding: max(36px, env(safe-area-inset-top)) 24px max(34px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 24%, rgba(224,111,157,.38), transparent 30%),
    radial-gradient(circle at 18% 84%, rgba(143,51,91,.34), transparent 38%),
    linear-gradient(160deg, #6b2947 0%, #43202e 48%, #211018 100%);
}
.incoming-call-content {
  width: min(100%, 430px);
  min-height: min(680px, calc(100svh - 70px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.incoming-call-kicker { margin-bottom: 34px; color: rgba(255,255,255,.72); font-size: 16px; font-weight: 700; }
.incoming-call-avatar {
  position: relative;
  width: 156px;
  height: 156px;
  margin-bottom: 25px;
  border: 4px solid rgba(255,255,255,.88);
  border-radius: 50%;
  box-shadow: 0 20px 55px rgba(0,0,0,.34), 0 0 0 13px rgba(255,255,255,.08);
}
.incoming-call-avatar::before,
.incoming-call-avatar::after {
  content: "";
  position: absolute;
  inset: -18px;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 50%;
  animation: incoming-ring-pulse 1.9s ease-out infinite;
}
.incoming-call-avatar::after { animation-delay: .7s; }
.incoming-call-avatar-photo,
.incoming-call-avatar .call-avatar-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.incoming-call-content h2 { margin: 0; color: #fff; font-size: clamp(30px, 8vw, 42px); line-height: 1.08; letter-spacing: -.03em; }
.incoming-call-note { margin-top: 12px; color: rgba(255,255,255,.72); font-size: 16px; }
.incoming-call-actions { width: 100%; margin-top: auto; padding-top: 58px; display: flex; justify-content: center; gap: 52px; }
.incoming-call-choice,
.incoming-call-choice:hover {
  width: 96px;
  min-width: 0;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #fff;
  background: transparent;
  box-shadow: none;
}
.incoming-call-choice-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 34px;
  font-weight: 500;
  box-shadow: 0 12px 28px rgba(0,0,0,.24);
}
.incoming-call-choice > span:last-child { width: 100%; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.incoming-decline .incoming-call-choice-icon { background: #ef4444; }
.incoming-accept .incoming-call-choice-icon { background: #34c759; }
.incoming-call-choice:disabled { opacity: .55; cursor: default; }
.call-wrap.call-ringing .call-avatar-shell { animation: outgoing-ring-pulse 1.8s ease-in-out infinite; }
.call-wrap.call-ringing #toggleMicButton,
.call-wrap.call-ringing #toggleCameraButton { display: none; }
@keyframes incoming-ring-pulse {
  0% { opacity: .65; transform: scale(.9); }
  100% { opacity: 0; transform: scale(1.24); }
}
@keyframes outgoing-ring-pulse {
  0%, 100% { box-shadow: 0 14px 45px rgba(0,0,0,.32), 0 0 0 10px rgba(255,255,255,.08); }
  50% { box-shadow: 0 14px 45px rgba(0,0,0,.32), 0 0 0 20px rgba(255,255,255,.025); }
}
.call-panel { padding: 12px; display: grid; gap: 12px; }
.call-panel-header { display: none; }
.call-stage {
  position: relative;
  min-height: 460px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 15%, rgba(210,91,140,.34), transparent 38%),
    radial-gradient(circle at 80% 88%, rgba(130,42,80,.32), transparent 42%),
    linear-gradient(145deg, #4d2635 0%, #2b1720 46%, #1e0f16 100%);
  display: grid;
  place-items: center;
}

body.call-page { height: 100svh; overflow: hidden; }
body.call-page .shell { height: 100svh; min-height: 0; overflow: hidden; }
body.call-page .layout {
  width: 100%;
  max-width: 1400px;
  height: calc(100svh - 48px);
  min-height: 0;
  margin: 0 auto;
  padding: 14px 18px;
  grid-template-columns: minmax(0, 1fr);
}
body.call-page .side, body.call-page .rightcol { display: none; }
body.call-page #main, body.call-page .call-wrap { height: 100%; min-height: 0; }
body.call-page .call-list { min-height: 0; overflow-y: auto; }
body.call-page .call-panel { min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
body.call-page .call-stage { height: auto; min-height: 0; }
.remote-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #1e0f16;
  opacity: 0;
  transition: opacity .28s ease;
}
.call-stage.remote-camera-on .remote-video { opacity: 1; }
.audio-call-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  color: #fff;
  text-align: center;
  transition: opacity .22s ease;
}
.call-stage.remote-camera-on .audio-call-card { opacity: 0; pointer-events: none; }
.call-avatar-shell {
  width: 148px;
  height: 148px;
  margin-bottom: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 4px solid rgba(255,255,255,.78);
  box-shadow: 0 14px 45px rgba(0,0,0,.32), 0 0 0 10px rgba(255,255,255,.08);
  overflow: hidden;
}
.call-avatar-photo, .call-avatar-fallback {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 52px;
  font-weight: 800;
}
.call-avatar-stack { display: flex; overflow: visible; width: 190px; border: 0; box-shadow: none; }
.call-avatar-stack .call-avatar-photo { width: 112px; height: 112px; flex: 0 0 112px; border: 4px solid rgba(255,255,255,.9); margin-left: -48px; }
.call-avatar-stack .call-avatar-photo:first-child { margin-left: 0; }
.call-person-name { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.local-video {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 112px;
  width: min(180px, 34%);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid rgba(255,255,255,.82);
  background: #2b1821;
  display: none;
}
.call-stage.local-camera-on .local-video { display: block; }
.call-placeholder {
  color: rgba(255,255,255,.72);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.remote-muted-badge { margin-top: 7px; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.13); font-size: 13px; font-weight: 700; }
.remote-muted-badge[hidden] { display: none; }
.call-media-controls {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 72px);
  place-items: start center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 0 4px 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.call-media-controls[hidden], .call-device-controls[hidden], .call-device-hint[hidden] { display: none; }
.call-control {
  position: relative;
  min-width: 68px;
  width: 68px;
  height: 68px;
  padding: 0;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  overflow: visible;
  background: rgba(255,255,255,.94);
  color: #2b1821;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 12px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.72);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.call-control:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 14px 30px rgba(0,0,0,.28), inset 0 1px 0 #fff; }
.call-control:active { transform: scale(.95); }
.call-control:disabled { opacity: .56; }
.call-control-icon {
  --call-icon: none;
  position: relative;
  display: block;
  width: 27px;
  height: 27px;
  color: currentColor;
  background: currentColor;
  -webkit-mask: var(--call-icon) center / contain no-repeat;
  mask: var(--call-icon) center / contain no-repeat;
}
.call-control-label {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  color: #fff;
  font-size: 10.5px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: .01em;
  text-shadow: 0 1px 5px rgba(0,0,0,.72);
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.call-control.control-active { color: #2b1821; background: rgba(255,255,255,.94); border-color: rgba(255,255,255,.7); }
.call-control.control-off {
  color: #fff;
  background: rgba(63,38,49,.92);
  border-color: rgba(255,255,255,.16);
}
.call-control.control-off::after {
  content: "";
  position: absolute;
  width: 32px;
  height: 2.5px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-44deg);
  box-shadow: 0 0 0 1.5px rgba(63,38,49,.76);
}
.call-end-button, .call-end-button:hover {
  grid-column: 2;
  color: #fff;
  background: #ff3b30;
  border-color: #ff5a50;
  box-shadow: 0 6px 18px rgba(255,59,48,.38), inset 0 1px 0 rgba(255,255,255,.22);
}
.mic-glyph { --call-icon: url("/icons/mic.svg"); }
.camera-glyph { --call-icon: url("/icons/video.svg"); }
.phone-glyph { --call-icon: url("/icons/phone.svg"); transform: rotate(135deg); }
.call-device-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fcf5f8;
  border: 1px solid var(--line);
}
.call-device-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.call-device-controls select { width: 100%; }
.call-device-hint { text-align: center; }
.album-form {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}
.album-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.album-card { overflow: hidden; cursor: pointer; }
.album-card img, .album-cover-empty {
  width: 100%;
  aspect-ratio: 1.7;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--brand-ink);
  font-size: 48px;
  font-weight: 900;
}
.album-body { padding: 12px; }
.album-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.album-add-button { flex: 0 0 auto; }
.album-body p { margin: 8px 0 0; color: var(--muted); }
.album-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.album-detail-head h2 { margin: 0; }
.album-upload-card h3 { margin: 0 0 12px; }
.album-upload-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.album-file-name { margin-left: 0; margin-top: 8px; }

.profile-page { overflow: hidden; }
.cover { height: 150px; }
.profile-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 0 18px 18px;
}
.profile-avatar {
  width: 92px;
  height: 92px;
  font-size: 30px;
  margin-top: -38px;
  border: 4px solid white;
}
.profile-main h2 { margin: 0 0 4px; }
.profile-main p { margin: 10px 0 0; color: #49343e; }
.theme-setting { margin: 4px 0; padding: 0; border: 0; }
.theme-setting legend { margin-bottom: 9px; color: var(--muted); font-size: 13px; font-weight: 700; }
.theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-option { min-width: 0; cursor: pointer; }
.theme-option > input { position: absolute; opacity: 0; pointer-events: none; }
.theme-choice-card {
  min-height: 92px;
  padding: 11px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.theme-option:hover .theme-choice-card { transform: translateY(-1px); }
.theme-option > input:checked + .theme-choice-card { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(215,91,142,.22); }
.theme-choice-card > span:last-child { min-width: 0; display: grid; gap: 4px; }
.theme-choice-card strong { font-size: 15px; }
.theme-choice-card small { color: var(--muted); font-size: 12px; line-height: 1.25; }
.theme-preview {
  width: 88px;
  height: 62px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 7px;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(164,126,143,.28);
}
.theme-preview i { display: block; height: 9px; border-radius: 4px; }
.theme-preview b { display: block; width: 78%; height: 6px; border-radius: 3px; }
.theme-preview b:last-child { width: 55%; }
.theme-preview-light { background: #f9f1f4; }
.theme-preview-light i { background: var(--brand); }
.theme-preview-light b { background: #e0cfd6; }
.theme-preview-dark { background: #25191f; }
.theme-preview-dark i { background: #d06c96; }
.theme-preview-dark b { background: #574149; }
.password-settings-card { margin-top: 14px; }
.password-settings-head h2 { margin: 0 0 5px; }
.password-form { max-width: 760px; }
.password-form label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.password-new-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.password-message { min-height: 0; }
.password-message:empty { display: none; }
.success { color: var(--good); font-weight: 700; }
.password-form > button { justify-self: start; min-width: 170px; }

.photo-tile { overflow: hidden; }
.photo-tile img, .photo-tile video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #2b1821;
  cursor: zoom-in;
}
.photo-caption { padding: 9px 10px; color: var(--muted); font-size: 13px; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(39,19,28,.88);
  display: grid;
  place-items: center;
  padding: 22px;
}
.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 20px 70px rgba(0,0,0,.4);
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  font-size: 28px;
  background: rgba(255,255,255,.16);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus { border-color: #d8789e; }
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .filepick,
html[data-theme="dark"] .chat-filepick,
html[data-theme="dark"] button.ghost:not(.top-ghost),
html[data-theme="dark"] .person-name,
html[data-theme="dark"] .chat-back,
html[data-theme="dark"] .music-back,
html[data-theme="dark"] .reaction-summary,
html[data-theme="dark"] .reaction-option,
html[data-theme="dark"] .reaction-total,
html[data-theme="dark"] .library-title,
html[data-theme="dark"] .library-list-title,
html[data-theme="dark"] .stat strong,
html[data-theme="dark"] .message-status.read { color: #e58eb0; }
html[data-theme="dark"] button.secondary:hover,
html[data-theme="dark"] .filepick:hover,
html[data-theme="dark"] .chat-filepick:hover,
html[data-theme="dark"] .chat-back:hover { background: #4a2b37; }
html[data-theme="dark"] .reaction-menu,
html[data-theme="dark"] .reaction-total,
html[data-theme="dark"] .chat-conversation-header,
html[data-theme="dark"] .message-form,
html[data-theme="dark"] .mobile-close { background: var(--panel); }
html[data-theme="dark"] .call-target { background: transparent; }
html[data-theme="dark"] .family-call-target,
html[data-theme="dark"] .call-target:hover { background: var(--panel-2); }
html[data-theme="dark"] .call-target.selected { background: var(--brand-soft); }
html[data-theme="dark"] .call-type-video { border-color: #dc82a6; background: var(--brand); color: #fff; }
html[data-theme="dark"] .chat-row:hover,
html[data-theme="dark"] .music-track-row:hover,
html[data-theme="dark"] .music-track-row.active { background: var(--panel-2); }
html[data-theme="dark"] .chat-row.selected,
html[data-theme="dark"] .family-chat-row,
html[data-theme="dark"] .message.mine,
html[data-theme="dark"] .publish-progress { background: var(--brand-soft); }
html[data-theme="dark"] .messages { background: #25191f; }
html[data-theme="dark"] .message { background: #35262d; }
html[data-theme="dark"] .message-head > strong,
html[data-theme="dark"] .message-reply-quote strong,
html[data-theme="dark"] .message-reply-composer strong { color: #e58eb0; }
html[data-theme="dark"] .message-reply-button { color: #b9a4ad; }
html[data-theme="dark"] .message-reply-button:hover { background: rgba(229,142,176,.12); color: #f1aec7; }
html[data-theme="dark"] .message-reply-quote { background: rgba(215,91,142,.18); }
html[data-theme="dark"] .message-reply-quote:hover { background: rgba(215,91,142,.25); }
html[data-theme="dark"] .message-reaction-picker .reaction-summary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .message-reply-composer button { color: #e58eb0; }
html[data-theme="dark"] .player-icon { border-color: var(--line); background: var(--panel-2); color: #e58eb0; }
html[data-theme="dark"] .player-icon:hover { background: #4a303a; color: #f1aec7; }
html[data-theme="dark"] .player-icon.active { border-color: var(--brand); background: var(--brand); color: white; }
html[data-theme="dark"] .profile-avatar { border-color: var(--panel); }
html[data-theme="dark"] .profile-main p,
html[data-theme="dark"] .remember-row { color: var(--text); }
html[data-theme="dark"] .notice { border-color: #675b31; background: #302b1e; color: #e3ca7d; }
html[data-theme="dark"] .push-highlight { box-shadow: 0 0 0 3px rgba(214,112,154,.45); }
html[data-theme="dark"] .theme-option > input:checked + .theme-choice-card { border-color: #e28bad; box-shadow: 0 0 0 2px rgba(226,139,173,.22); }

@media (max-width: 699px) {
  input, textarea, select { font-size: 16px; }
  input, textarea, select, form, .card, .composer, .message-form { max-width: 100%; }
  body.menu-open { overflow: hidden; }
  .topbar, .topbar-inner { height: 50px; }
  .topbar-inner { padding: 0 12px; }
  .hamburger { display: grid; place-items: center; flex: 0 0 38px; }
  .logo { flex: 1; text-align: left; }
  .tabs { display: none; }
  .userbar { max-width: 42%; justify-content: flex-end; }
  .top-ghost, .userbar span { display: none; }
  .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(39,19,28,.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  .mobile-backdrop.open { opacity: 1; pointer-events: auto; }
  .mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(88vw, 360px);
    height: 100dvh;
    padding: 12px;
    overflow-y: auto;
    background: var(--bg);
    box-shadow: 22px 0 52px rgba(76,39,55,.24);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .mobile-menu.open { transform: translateX(0); }
  .mobile-menu-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
    align-items: start;
  }
  .mobile-profile { margin: 0; }
  .mobile-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    background: white;
    color: var(--brand-ink);
    font-size: 30px;
    line-height: 1;
  }
  .mobile-nav { padding: 8px; }
  .mobile-menu .navitem { min-height: 46px; font-size: 16px; }
  .mobile-menu .card { flex: 0 0 auto; }
  .mobile-logout { width: 100%; margin-bottom: 10px; }
  .layout { grid-template-columns: 1fr; margin: 12px auto; padding: 0 12px; }
  .side, .rightcol, .mobile-push-card { display: none; }
  .chat-wrap, .admin-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-grid, .album-form, .album-upload-form, .media-library-grid, .library-form, .call-wrap { grid-template-columns: 1fr; }
  .library-form.video-library-form { grid-template-columns: 1fr; }
  .music-library-head { align-items: stretch; flex-direction: column; }
  .media-section-head { align-items: stretch; flex-direction: column; }
  .media-section-head > button { width: 100%; }
  .music-library-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .music-owner-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .music-owner { min-width: 0; padding-right: 9px; }
  .music-album-form { grid-template-columns: 1fr; }
  .music-upload-form { grid-template-columns: 1fr; }
  .music-all-section { margin-bottom: 20px; }
  .music-all-head { align-items: stretch; flex-direction: column; }
  .music-all-head .music-album-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .music-album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .music-album-cover { border-radius: 12px; }
  .music-album-hero { grid-template-columns: 1fr; gap: 18px; padding-top: 0; }
  .music-album-cover-large { width: min(68vw, 240px); justify-self: center; }
  .music-album-summary { text-align: center; }
  .music-album-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .music-album-actions button { min-width: 0; }
  .apple-player { grid-template-columns: 1fr; padding: 14px; }
  .player-controls { grid-row: 2; }
  .player-timeline { grid-row: 3; }
  .music-track-list { padding: 0 10px; }
  .album-title-row { align-items: center; }
  .profile-main { grid-template-columns: 1fr; align-items: start; }
  .theme-options { grid-template-columns: 1fr; }
  .password-new-fields { grid-template-columns: 1fr; }
  .password-form > button { width: 100%; }
  .composer-head { grid-template-columns: 1fr; }
  .composer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .composer-actions select { max-width: none; }
  .composer-actions .publish-button { grid-column: 1 / -1; width: 100%; }
  .publish-progress, .post-error { margin-left: 0; }
  .file-name { margin-left: 0; }
  .person { grid-template-columns: 42px minmax(0, 1fr); }
  .person-actions { grid-column: 2; justify-self: start; flex-wrap: wrap; }
  .message { max-width: 86%; }
  .message-form { grid-template-columns: 42px minmax(0, 1fr); }
  .message-form > button, .chat-file-name { grid-column: 1 / 3; }
  body.chat-page .layout { height: calc(100svh - 50px); margin: 0; padding: 0; }
  body.chat-page .chat-inbox,
  body.chat-page .chat-window,
  body.chat-page .chat-conversation-header { border-radius: 0; }
  body.chat-page .messages { padding: 11px 10px; }
  body.chat-page .message-form { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 9px 10px max(9px, env(safe-area-inset-bottom)); }
  body.chat-page .message-form > button { grid-column: auto; min-width: 44px; padding-inline: 12px; }
  body.chat-page .chat-file-name { grid-column: 2 / 4; }
  body.chat-page .message-reply-composer { grid-column: 1 / -1; }
  .call-panel { padding: 8px; }
  body.call-page { height: 100svh; overflow: hidden; }
  body.call-page .shell { height: 100svh; min-height: 0; overflow: hidden; }
  body.call-page .layout { height: calc(100svh - 50px); min-height: 0; margin: 0 auto; padding: 8px 10px; }
  body.call-page #main { height: 100%; min-height: 0; overflow: hidden; }
  body.call-page .call-wrap { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
  body.call-page .call-list {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 8px;
    overflow-y: auto;
  }
  body.call-page .call-target { min-width: 0; min-height: 70px; padding: 9px 10px; }
  body.call-page .call-row-actions { gap: 5px; }
  body.call-page .call-type-button { min-width: 52px; padding: 8px 7px; }
  body.call-page .call-panel { display: none; }
  body.call-page .call-wrap.target-selected .call-list { display: none; }
  body.call-page .call-wrap.target-selected .call-panel { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
  body.call-page .call-panel-header { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
  body.call-page .call-wrap.call-active .call-panel-header { display: none; }
  body.call-page .call-stage { flex: 1 1 auto; min-height: 0; border-radius: 17px; }
  body.call-page #callStatus { flex: 0 0 auto; min-height: 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .local-video { width: 34%; right: 10px; bottom: 104px; }
  body.call-page .call-device-controls {
    position: absolute;
    z-index: 6;
    left: 10px;
    right: 10px;
    bottom: 104px;
    grid-template-columns: 1fr;
    box-shadow: 0 14px 38px rgba(55,22,37,.28);
  }
  .call-media-controls {
    position: absolute;
    bottom: max(14px, env(safe-area-inset-bottom));
    flex: 0 0 auto;
    grid-template-columns: repeat(3, 68px);
    gap: 8px;
    padding: 0 2px 24px;
  }
  .call-control { width: 66px; min-width: 66px; height: 66px; }
  .call-avatar-shell { width: clamp(94px, 19vh, 128px); height: clamp(94px, 19vh, 128px); }
  .call-person-name { font-size: 24px; }
}

@media (min-width: 700px) and (max-width: 1180px) {
  input, textarea, select { font-size: 16px; }
  button, .filepick, .chat-filepick { min-height: 40px; }

  .topbar, .topbar-inner { height: 56px; }
  .topbar-inner {
    width: 100%;
    max-width: none;
    gap: 10px;
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }
  .hamburger, .mobile-backdrop, .mobile-menu { display: none; }
  .logo { flex: 0 0 auto; font-size: 18px; }
  .tabs { display: flex; gap: 4px; }
  .tab { min-height: 40px; padding: 8px 10px; font-size: 14px; }
  .userbar { display: none; }

  .layout {
    width: 100%;
    max-width: none;
    margin: 14px auto;
    padding: 0 14px;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .side { display: none; }
  .rightcol { display: none; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .album-upload-form { grid-template-columns: auto minmax(0, 1fr) auto; }
  .media-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .music-library-head { align-items: center; flex-direction: row; }
  .music-library-actions { flex-wrap: wrap; justify-content: flex-end; }
  .music-owner-switcher { display: flex; }
  .music-owner { min-width: 150px; }
  .music-album-form { grid-template-columns: minmax(200px, 320px) auto; }
  .music-upload-form { grid-template-columns: minmax(0, 1fr) minmax(170px, 220px); }
  .music-upload-form .file-name { grid-column: 1 / -1; }
  .music-all-head { align-items: end; flex-direction: row; }
  .music-all-head .music-album-actions { display: flex; }
  .music-album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
  .music-album-hero { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); gap: 22px; align-items: end; }
  .music-album-cover-large { width: 100%; justify-self: auto; }
  .music-album-summary { text-align: left; }
  .music-album-actions { display: flex; }
  .music-album-actions button { min-width: 0; }
  .apple-player { grid-template-columns: minmax(150px, 1fr) auto; padding: 16px; }
  .player-controls { grid-row: auto; }
  .player-timeline { grid-row: auto; }

  .profile-main { grid-template-columns: 92px minmax(0, 1fr) auto; align-items: end; }
  .theme-options { grid-template-columns: 1fr 1fr; }
  .composer-head { grid-template-columns: 42px minmax(0, 1fr); }
  .composer-actions { display: flex; }
  .composer-actions .publish-button { grid-column: auto; width: auto; }
  .person { grid-template-columns: 42px minmax(0, 1fr); }
  .person-actions { grid-column: 2; justify-self: stretch; flex-wrap: nowrap; }

  .call-wrap { grid-template-columns: 320px minmax(0, 1fr); }
  body.call-page { height: 100svh; overflow: hidden; }
  body.call-page .shell { height: 100svh; min-height: 0; overflow: hidden; }
  body.call-page .layout {
    height: calc(100svh - 56px);
    min-height: 0;
    margin: 0;
    padding: 12px 14px;
    grid-template-columns: minmax(0, 1fr);
  }
  body.call-page .side, body.call-page .rightcol { display: none; }
  body.call-page #main, body.call-page .call-wrap { height: 100%; min-height: 0; }
  body.call-page .call-list { min-height: 0; overflow-y: auto; }
  body.call-page .call-panel { min-height: 0; }
  body.call-page .call-stage { min-height: 0; height: 100%; }

  body.chat-page .layout { height: calc(100svh - 56px); padding: 12px 14px; }
  body.chat-page .chat-inbox,
  body.chat-page .chat-window,
  body.chat-page .chat-conversation-header { border-radius: 14px; }
}

@media (min-width: 1000px) and (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .rightcol { display: flex; min-width: 0; }
  .rightcol .person { grid-template-columns: 42px minmax(0, 1fr); }
  .rightcol .person-actions { grid-column: 2; justify-self: start; }
  body.call-page .layout, body.chat-page .layout { grid-template-columns: minmax(0, 1fr); }
  body.call-page .rightcol, body.chat-page .rightcol { display: none; }
}

@media (max-width: 760px) {
  body.vpn-page .layout { margin: 0; padding: 12px; }
  .vpn-admin { gap: 12px; }
  .vpn-hero {
    min-height: 0;
    padding: 21px;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 15px;
    border-radius: 16px;
  }
  .vpn-hero-icon { width: 58px; height: 58px; border-radius: 18px; }
  .vpn-hero-icon svg { width: 33px; height: 33px; }
  .vpn-hero h1 { margin-top: 4px; font-size: 26px; }
  .vpn-hero p { font-size: 13px; }
  .vpn-server-state { grid-column: 1 / -1; width: 100%; }
  .vpn-summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .vpn-summary-card { padding: 14px; }
  .vpn-summary-card.traffic { grid-column: 1 / -1; }
  .vpn-admin-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .vpn-create-card { padding: 20px; }
  .vpn-users-head { padding: 19px 18px 15px; }
  .vpn-user-list { padding: 5px 10px 10px; }
  .vpn-user {
    padding: 12px 7px;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
  }
  .vpn-user-symbol { width: 44px; height: 44px; }
  .vpn-user-actions { grid-column: 2; justify-content: flex-start; }
  .vpn-user-actions button { min-height: 38px; }
  .vpn-qr-dialog { padding: 23px 18px 20px; border-radius: 19px; }
  .vpn-qr-frame { width: min(280px, 100%); }
}

@media (max-width: 390px) {
  .vpn-hero { grid-template-columns: 1fr; }
  .vpn-hero-icon { display: none; }
  .vpn-server-state { grid-column: auto; }
  .vpn-modal-actions { grid-template-columns: 1fr; }
}
