@font-face {
  font-family: "Anton";
  src: url("vendor/fonts/anton-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: var(--ds-font);
  src: url("vendor/fonts/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

/* Interaction feedback is neutral. Gold belongs to artwork/content, never focus. */
:root { --interaction-strong: #c7cacf; --interaction-wash: #c7cacf1a; }
*, *::before, *::after { -webkit-tap-highlight-color: transparent !important; }
:root[data-input-modality="pointer"] :is(button, a, summary, [role="button"], [tabindex]):focus {
  outline: none !important;
  box-shadow: none !important;
}
:root[data-input-modality="keyboard"] :is(button, a, input, textarea, select, summary, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--bb2-ink, var(--text, #f5f5f5)) !important;
  outline-offset: 3px;
}
input, textarea, select { accent-color: #aeb5bd; caret-color: currentColor; }
::target-text { color: inherit; background: transparent; }

/* App surfaces behave like native controls; editable fields retain selection. */
body, body * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}
body :is(input, textarea, [contenteditable]:not([contenteditable="false"])),
body [contenteditable]:not([contenteditable="false"]) * {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

:root {
  --bg: #09090b;
  --surface: #111114;
  --surface-2: #18181c;
  --surface-3: #212127;
  --text: #f5f3ed;
  --muted: #96969f;
  --accent: #f2b705;
  --accent-2: #ffd84d;
  --border: rgba(255,255,255,.09);
  --shadow: 0 22px 70px rgba(0,0,0,.35);
}

body.light {
  --bg: #ebe8df;
  --surface: #f8f6ef;
  --surface-2: #ffffff;
  --surface-3: #e8e4d8;
  --text: #131313;
  --muted: #686868;
  --border: rgba(0,0,0,.1);
  --shadow: 0 22px 70px rgba(66,50,10,.12);
}

html {
  scroll-behavior: smooth;
  /* Keep pinch zoom available while suppressing the browser's double-tap zoom. */
  touch-action: manipulation;
}

body {
  touch-action: manipulation;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(242,183,5,.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: var(--ds-font);
  transition: background .3s, color .3s;
}

button, input {
  font: inherit;
}

.avatar img,
.profile-visual,
.media-view-button img,
.story-bubble img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

button {
  cursor: pointer;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .025;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  background: rgba(10,10,12,.88);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  z-index: 50;
  transition: width .25s ease, padding .25s ease, transform .25s ease;
}

.sidebar-collapse-button {
  position: absolute;
  top: 34px;
  right: -14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  color: #fff;
  background: #09090b;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
  z-index: 2;
}
.sidebar-collapse-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s ease;
}

body.light .sidebar {
  background: rgba(248,246,239,.9);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  padding: 0 10px 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #111;
  background: var(--accent);
  font-family: "Anton";
  font-size: 21px;
  transform: rotate(-4deg);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1;
}

.brand strong {
  font-family: "Anton";
  letter-spacing: .6px;
  font-size: 18px;
}

.brand small {
  margin-top: 5px;
  color: var(--accent);
  letter-spacing: 4px;
  font-size: 10px;
  font-weight: 800;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: .2s;
}

.nav-link .nav-icon {
  width: 22px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  text-align: center;
}
.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-link b {
  overflow: hidden;
  font: inherit;
  white-space: nowrap;
  opacity: 1;
  transition: opacity .15s ease;
}

.nav-link.active {
  color: var(--text);
  background: var(--surface-2);
}


@media (hover: hover) and (pointer: fine) { .nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
} }

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  background: var(--interaction-strong);
  border-radius: 3px;
}

.notification-dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

body.sidebar-compact .sidebar { width: 84px; padding-inline: 13px; }
body.sidebar-compact .app,
body.sidebar-compact .site-footer { margin-left: 84px; }
body.sidebar-compact .brand { justify-content: center; padding-inline: 0; }
body.sidebar-compact .brand > span:last-child,
body.sidebar-compact .nav-link b,
body.sidebar-compact .mini-user > div:last-child { display: none; }
body.sidebar-compact .nav-link { justify-content: center; gap: 0; padding-inline: 0; }
body.sidebar-compact .nav-link.active::before { left: 1px; }
body.sidebar-compact .notification-dot { position: absolute; top: 9px; right: 9px; }
body.sidebar-compact .sidebar-footer { flex-direction: column; gap: 12px; }
body.sidebar-compact .sidebar-collapse-button svg { transform: rotate(180deg); }
body.sidebar-compact .brand-mark { width: 42px; min-width: 42px; }

.admin-profile-fields {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(214,166,46,.25);
  border-radius: 14px;
  background: rgba(214,166,46,.055);
}
.admin-profile-fields[hidden] { display: none; }
.admin-profile-fields-heading { display: flex; justify-content: space-between; gap: 12px; }
.admin-profile-fields-heading span { color: var(--gold-soft); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.admin-profile-fields-heading small { color: var(--muted); }

.mini-user,
.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-user strong,
.mini-user small {
  display: block;
}

.mini-user strong {
  font-size: 13px;
}

.mini-user small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #7b5900);
  color: #15120a;
  font-weight: 900;
}

.avatar.small {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.icon-button,
.menu-button,
.attach-button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
}

.admin-crown-button {
  font-size: 18px;
}
.admin-crown-button svg { stroke-linejoin: round; }

.monochrome-top-button {
  color: #fff;
  border-color: rgba(255,255,255,.45);
  background: #050506;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.monochrome-top-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (hover: hover) and (pointer: fine) { .monochrome-top-button:hover {
  color: #fff;
  border-color: #fff;
  background: #111114;
  box-shadow: 0 0 16px rgba(255,255,255,.12);
} }

.app {
  margin-left: 250px;
  min-height: 100vh;
}

.topbar {
  height: 92px;
  display: flex;
  align-items: center;
  padding: 0 44px;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 4px 0 0;
  font-family: "Anton";
  font-size: 26px;
  letter-spacing: .5px;
  font-weight: 400;
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.profile-button {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
}

.page-section {
  display: none;
  padding: 36px 44px 60px;
  animation: fade .18s ease-out;
}

.page-section.active {
  display: block;
}

@keyframes fade {
  from {opacity: 0; transform: translateY(8px)}
  to {opacity: 1; transform: none}
}

button,
a,
[role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.hero-card,
.panel {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  padding: 56px;
  border-radius: 24px;
}

.hero-card::before {
  content: "BIG BOY";
  position: absolute;
  right: -20px;
  bottom: -78px;
  font-family: "Anton";
  font-size: 180px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.05);
  white-space: nowrap;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.status-pill,
.online-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  border: 1px solid var(--border);
  padding: 9px 13px;
  border-radius: 99px;
  background: rgba(255,255,255,.025);
}

.status-pill i,
.online-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55dc80;
  box-shadow: 0 0 12px rgba(85,220,128,.8);
}

.hero-copy h2 {
  margin: 24px 0 16px;
  font-family: "Anton";
  font-weight: 400;
  font-size: clamp(42px, 5.6vw, 78px);
  line-height: .96;
  letter-spacing: .2px;
}

.hero-copy h2 em {
  color: var(--accent);
  font-style: normal;
}

.hero-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 15px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button,
.send-button {
  min-height: 48px;
  border-radius: 10px;
  padding: 0 20px;
  font-weight: 800;
  border: 1px solid transparent;
}

.primary-button,
.send-button {
  color: #15110a;
  background: var(--accent);
}

@media (hover: hover) and (pointer: fine) { .primary-button:hover, .send-button:hover {
  background: var(--interaction-strong);
} }

.secondary-button {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-3);
}

.hero-emblem {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}

.emblem-ring {
  width: min(310px, 28vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 12px var(--surface-2), inset 0 0 0 13px rgba(242,183,5,.25), 0 0 80px rgba(242,183,5,.08);
  transform: rotate(4deg);
}

.emblem-ring span,
.emblem-ring small {
  font-weight: 900;
  letter-spacing: 4px;
}

.emblem-ring span {
  font-size: 12px;
}

.emblem-ring strong {
  margin: 4px 0;
  color: var(--accent);
  font-family: "Anton";
  font-size: 100px;
  line-height: 1;
}

.emblem-ring small {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 20px;
  margin-top: 20px;
}

.panel {
  padding: 26px;
  border-radius: 18px;
}

.panel-heading,
.chat-header,
.section-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel h3,
.chat-header h3 {
  margin: 5px 0 0;
  font-size: 20px;
}

.text-button,
.back-button {
  border: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 800;
}

.activity-list {
  display: grid;
  gap: 15px;
  margin-top: 25px;
}

.activity-item,
.online-member {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-item {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border: 0;
  padding-bottom: 0;
}

.activity-text {
  flex: 1;
}

.activity-text strong {
  font-size: 13px;
}

.activity-text p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.activity-time {
  color: var(--muted);
  font-size: 11px;
}

.rules-panel ol {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
}

.rules-panel li {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.rules-panel li:last-child {
  border: 0;
}

.rules-panel b {
  color: var(--accent);
  font-size: 12px;
}

.rules-panel span {
  font-size: 13px;
  font-weight: 600;
}

.featured-members {
  margin-top: 20px;
}

.member-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.member-mini-card {
  position: relative;
  min-height: 145px;
  overflow: hidden;
  isolation: isolate;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 16px;
  transition: .2s;
}

.member-mini-card.has-country-flag::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(8,8,10,.9), rgba(8,8,10,.42));
}

.member-mini-flag {
  position: absolute;
  inset: 50% auto auto 62%;
  z-index: -2;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 9rem;
  line-height: 1;
  transform: translate(-50%, -50%) scale(1.7);
  filter: saturate(1.15);
}

.member-mini-card .avatar,
.member-mini-copy {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) { .member-mini-card:hover {
  transform: translateY(-3px);
  border-color: rgba(183,183,183,.5);
} }

.member-mini-card .avatar {
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
}

.member-mini-card strong,
.member-mini-card small {
  display: block;
}

.member-mini-card.has-country-flag small { color: rgba(255,255,255,.75); }

.member-mini-card small {
  color: var(--muted);
  margin-top: 5px;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
}

.chat-panel {
  min-height: calc(100vh - 190px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.chat-header {
  align-items: center;
  padding: 23px 26px;
  border-bottom: 1px solid var(--border);
}

.chat-channel-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.018);
}

.chat-channels { display: flex; flex: 1; gap: 8px; }
.chat-channel,
.channel-add-button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--surface-3);
  cursor: pointer;
}
.chat-channel.active { border-color: rgba(183,183,183,.55); color: var(--interaction-strong); background: rgba(183,183,183,.09); }
.chat-channel span { margin-right: 4px; color: var(--accent); }
.chat-channel i { margin-left: 8px; font-style: normal; }
.channel-add-button { color: var(--text); }

.messages {
  flex: 1;
  min-height: 460px;
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  padding: 26px;
}

.message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 23px;
}

.message.own {
  grid-template-columns: minmax(0, 1fr) 42px;
  margin-left: 16%;
  text-align: right;
}
.message.own .avatar { grid-column: 2; grid-row: 1; }
.message.own > div:last-child { grid-column: 1; grid-row: 1; justify-self: end; }
.message.own .message-head { justify-content: flex-end; }
.message.own p,
.message.own .message-file { text-align: left; background: rgba(214,166,46,.1); border-radius: 12px; padding: 10px 13px; }
.message.own .message-image { margin-left: auto; }

.message .avatar {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.message-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.message-head strong {
  font-size: 13px;
}

.message-head time {
  color: var(--muted);
  font-size: 10px;
}

.message p {
  margin: 6px 0 0;
  color: #d2d0ca;
  line-height: 1.55;
  font-size: 13px;
}

body.light .message p {
  color: #353535;
}

.message-form {
  display: flex;
  gap: 10px;
  padding: 18px 20px;
  border-top: 1px solid var(--border);
}

.message-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  border-radius: 10px;
  padding: 0 15px;
  outline: none;
}

.message-form input:focus {
  border-color: rgba(183,183,183,.65);
}

.attach-button {
  width: 46px;
  font-size: 22px;
}

.online-panel {
  min-height: 500px;
}

.online-panel h3 {
  margin: 5px 0 25px;
}

.online-member {
  margin-bottom: 17px;
}

.online-member .avatar {
  width: 38px;
  height: 38px;
  font-size: 12px;
}

.online-member strong,
.online-member small {
  display: block;
}

.online-member strong {
  font-size: 12px;
}

.online-member small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.online-member i {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55dc80;
}

.section-intro {
  align-items: end;
  margin-bottom: 30px;
}

.section-intro h2 {
  margin: 7px 0 0;
  font-family: "Anton";
  font-size: clamp(35px, 4vw, 55px);
  font-weight: 400;
}

.section-intro p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.member-card {
  min-height: 340px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(to top, rgba(0,0,0,.93), rgba(0,0,0,.05)),
    var(--member-bg);
  background-size: cover;
  background-position: center;
  transition: .25s;
}

@media (hover: hover) and (pointer: fine) { .member-card:hover {
  transform: translateY(-6px);
  border-color: rgba(183,183,183,.65);
} }

.member-card::before {
  content: attr(data-number);
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: "Anton";
  font-size: 52px;
  color: rgba(255,255,255,.13);
}

.member-card .member-role {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 6px;
  color: #111;
  background: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
}

.member-card h3 {
  margin: 12px 0 5px;
  font-family: "Anton";
  font-size: 32px;
  font-weight: 400;
}

.member-card p {
  margin: 0;
  color: #b9b9b9;
  font-size: 12px;
}

.member-card button {
  width: fit-content;
  margin-top: 18px;
  padding: 0;
  border: 0;
  color: white;
  background: transparent;
  font-weight: 800;
}

.profile-hero {
  min-height: 540px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  overflow: hidden;
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
}

.profile-visual {
  position: relative;
  min-height: 420px;
  background: var(--profile-bg);
  background-size: cover;
  background-position: center;
}

.profile-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 50%, var(--surface));
}

.profile-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px;
}

.profile-number {
  color: var(--accent);
  font-family: "Anton";
  font-size: 22px;
}

.profile-info h2 {
  margin: 8px 0 0;
  font-family: "Anton";
  font-size: clamp(54px, 7vw, 95px);
  line-height: .9;
  font-weight: 400;
}

.profile-country-flag {
  display: inline-block;
  margin-right: 10px;
  background: none;
  color: initial;
  font-family: var(--ds-font);
  font-size: .58em;
  vertical-align: .16em;
  -webkit-text-fill-color: initial;
}

.profile-nickname {
  margin: 12px 0 24px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
}

.profile-info p {
  max-width: 650px;
  color: var(--muted);
  line-height: 1.7;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.profile-tags span {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 30px;
}

.profile-stats div {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.profile-stats strong,
.profile-stats small {
  display: block;
}

.profile-stats strong {
  font-family: "Anton";
  font-size: 28px;
  font-weight: 400;
}

.profile-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
}

.back-button {
  padding: 0;
}

.moments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 230px;
  gap: 16px;
}

.moment-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  display: flex;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--moment-bg);
  background-size: cover;
  background-position: center;
}

.moment-card:nth-child(1),
.moment-card:nth-child(5) {
  grid-row: span 2;
}

.moment-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.9), transparent);
}

.moment-card div {
  position: relative;
  z-index: 2;
}

.moment-card h3 {
  margin: 0;
  font-family: "Anton";
  font-size: 27px;
  font-weight: 400;
}

.moment-card p {
  margin: 5px 0 0;
  color: #c6c6c6;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .members-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-emblem {
    display: none;
  }

  .dashboard-grid,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .online-panel {
    display: none;
  }

  .member-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .sidebar-collapse-button { display: none; }
  .sidebar,
  body.sidebar-compact .sidebar { width: 84px; padding: 28px 13px; }
  body.sidebar-compact .app,
  body.sidebar-compact .site-footer { margin-left: 0; }
  .sidebar .brand,
  body.sidebar-compact .brand { justify-content: center; padding: 0 0 28px; }
  .sidebar .brand > span:last-child,
  .sidebar .nav-link b,
  .sidebar .mini-user > div:last-child,
  body.sidebar-compact .brand > span:last-child,
  body.sidebar-compact .nav-link b,
  body.sidebar-compact .mini-user > div:last-child { display: none; }
  .sidebar .nav-link,
  body.sidebar-compact .nav-link { justify-content: center; gap: 0; padding: 0; }
  .sidebar .notification-dot,
  body.sidebar-compact .notification-dot { position: absolute; top: 9px; right: 9px; margin-left: 0; }
  .sidebar .sidebar-footer,
  body.sidebar-compact .sidebar-footer { flex-direction: column; gap: 12px; }
  .sidebar .sidebar-collapse-button svg,
  body.sidebar-compact .sidebar-collapse-button svg { transform: rotate(0); }
  .sidebar .brand-mark,
  body.sidebar-compact .brand-mark { width: 42px; min-width: 42px; }
  .sidebar {
    transform: translateX(-100%);
    touch-action: pan-y;
    transition: width .25s ease, padding .25s ease, transform .25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .app {
    margin-left: 0;
  }

  .topbar {
    height: 78px;
    padding: 0 18px;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .top-actions .icon-button,
  .profile-button span {
    display: none;
  }

  .page-section {
    padding: 22px 16px 45px;
  }

  .hero-card {
    min-height: auto;
    padding: 35px 24px;
  }

  .hero-copy h2 {
    font-size: 47px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .member-strip,
  .members-grid,
  .moments-grid {
    grid-template-columns: 1fr;
  }

  .section-intro {
    display: block;
  }

  .section-intro p {
    margin-top: 14px;
  }

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

  .profile-visual {
    min-height: 310px;
  }

  .profile-visual::after {
    background: linear-gradient(to bottom, transparent 55%, var(--surface));
  }

  .profile-info {
    padding: 30px 22px;
  }

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

  .moments-grid {
    grid-auto-rows: 260px;
  }

  .moment-card:nth-child(1),
  .moment-card:nth-child(5) {
    grid-row: span 1;
  }

  .send-button {
    padding: 0 12px;
  }
}

/* ========================================================================== */
/* THE BIG BOY RULES · PROFESSIONAL SOCIAL SYSTEM 2026                       */
/* Una sola identidad para feed, club, mensajería, perfiles y administración. */
/* ========================================================================== */

:root {
  --bb-bg: #07080a;
  --bb-surface: #0d0f12;
  --bb-surface-raised: #14171c;
  --bb-surface-soft: #191c22;
  --bb-line: rgba(255,255,255,.085);
  --bb-line-strong: rgba(255,255,255,.15);
  --bb-text: #f7f7f4;
  --bb-text-secondary: #b2b4bc;
  --bb-text-tertiary: #777b85;
  --bb-gold: #e6b93f;
  --bb-gold-light: #f8dc83;
  --bb-gold-dark: #9f6c0f;
  --bb-green: #35d77f;
  --bb-danger: #ff5968;
  --bb-radius-sm: 12px;
  --bb-radius-md: 18px;
  --bb-radius-lg: 26px;
  --bb-ease: cubic-bezier(.22,1,.36,1);
  --bb-shadow-card: 0 18px 55px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.035);
  --bb-shadow-float: 0 24px 80px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.07);
}

html {
  background: var(--bb-bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  color: var(--bb-text);
  background:
    radial-gradient(circle at 80% -10%, rgba(230,185,63,.07), transparent 30rem),
    var(--bb-bg);
  font-feature-settings: "kern" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-x: none;
}

button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
[role="button"] {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--interaction-strong);
  outline-offset: 3px;
}

::selection {
  color: #08090b;
  background: var(--interaction-strong);
}

.noise { opacity: .014; }
.cursor-glow { opacity: .5; }

.eyebrow {
  color: var(--bb-gold);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .17em;
}

.panel,
.hero-card,
.home-news-section,
.profile-hero,
.profile-stories,
.profile-achievements,
.help-create-form,
.admin-tool-disclosure {
  border-color: var(--bb-line);
  background: linear-gradient(155deg, rgba(20,22,27,.98), rgba(9,10,13,.985));
  box-shadow: var(--bb-shadow-card);
}

.panel::before {
  width: 64px;
  background: linear-gradient(90deg, rgba(230,185,63,.74), transparent);
}

.panel-heading h3,
.chat-inbox-heading h2,
.stories-heading h3,
.profile-feed-heading h3 {
  color: var(--bb-text);
  letter-spacing: -.025em;
}

.primary-button,
.login-submit,
.send-button {
  border: 1px solid rgba(255,231,160,.3);
  border-radius: 14px;
  color: #100d07;
  background: linear-gradient(135deg, var(--bb-gold-light), #d69d23 72%, #b37710);
  box-shadow: 0 10px 26px rgba(194,136,20,.18), inset 0 1px rgba(255,255,255,.45);
  font-weight: 850;
  transition: transform .14s var(--bb-ease), filter .14s ease, box-shadow .14s ease;
}

.secondary-button,
.text-button {
  transition: color .14s ease, border-color .14s ease, background .14s ease, transform .14s var(--bb-ease);
}

@media (hover: hover) and (pointer: fine) { .primary-button:hover, .login-submit:hover, .send-button:hover {
  filter: brightness(1.055);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(140,140,140,.24), inset 0 1px rgba(255,255,255,.5);
} }

.primary-button:active,
.login-submit:active,
.send-button:active,
.secondary-button:active,
.text-button:active,
.icon-button:active,
.top-create-button:active {
  transform: scale(.965);
}

input,
textarea,
select,
.message-form input {
  border-color: var(--bb-line);
  color: var(--bb-text);
  background: rgba(255,255,255,.035);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

@media (hover: hover) and (pointer: fine) { input:hover, textarea:hover, select:hover { border-color: var(--bb-line-strong); } }

input:focus,
textarea:focus,
select:focus,
.message-form input:focus {
  border-color: rgba(186,186,186,.58);
  background: rgba(255,255,255,.052);
  box-shadow: 0 0 0 4px rgba(186,186,186,.09);
}

/* Cabecera contenida, reconocible y estable en PWA. */
.topbar {
  border-bottom-color: rgba(255,255,255,.065);
  background: rgba(7,8,10,.88);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.topbar-title h1 {
  color: var(--bb-text);
  letter-spacing: -.035em;
}

.top-create-button,
.monochrome-top-button,
.admin-crown-button {
  border: 1px solid var(--bb-line);
  color: var(--bb-text);
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px rgba(255,255,255,.045);
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s var(--bb-ease);
}

.top-create-button {
  color: #11100c;
  border-color: rgba(255,226,135,.28);
  background: linear-gradient(145deg, var(--bb-gold-light), #c98c19);
}

@media (hover: hover) and (pointer: fine) { .monochrome-top-button:hover, .admin-crown-button:hover {
  color: var(--interaction-strong);
  border-color: rgba(186,186,186,.34);
  background: rgba(186,186,186,.07);
} }

.notification-count,
.tab-alert {
  color: #fff;
  background: var(--bb-danger);
  box-shadow: 0 0 0 2px var(--bb-bg), 0 5px 16px rgba(255,89,104,.35);
}

/* Inicio editorial: impacto visual con menos ruido y mejor lectura. */
.hero-card {
  isolation: isolate;
  border-radius: 30px;
  background:
    linear-gradient(112deg, rgba(17,18,22,.98) 0 58%, rgba(9,10,12,.93)),
    radial-gradient(circle at 80% 25%, rgba(230,185,63,.14), transparent 35%);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 70%, rgba(230,185,63,.035));
  pointer-events: none;
}

.hero-copy h2 {
  letter-spacing: -.025em;
  text-wrap: balance;
}

.hero-copy p,
.section-intro p,
.chat-inbox-copy {
  color: var(--bb-text-secondary);
}

.status-pill,
.online-label {
  border-color: rgba(53,215,127,.2);
  color: #c9f8dd;
  background: rgba(53,215,127,.07);
}

.status-pill i,
.online-label i { background: var(--bb-green); box-shadow: 0 0 14px rgba(53,215,127,.55); }

.emblem-ring {
  animation-duration: 7s;
  box-shadow: inset 0 0 0 12px var(--bb-surface), inset 0 0 0 13px rgba(230,185,63,.28), 0 0 70px rgba(230,185,63,.1);
}

/* Navegación: una cápsula precisa, con selector que se desliza sin recargar. */
.floating-tab-bar {
  min-height: 72px;
  border-color: rgba(255,255,255,.14);
  background: rgba(10,11,14,.91);
  box-shadow: var(--bb-shadow-float);
  backdrop-filter: blur(18px) saturate(128%);
  -webkit-backdrop-filter: blur(18px) saturate(128%);
}

.floating-tab-bar::before {
  border-color: rgba(230,185,63,.17);
  background: linear-gradient(150deg, rgba(255,255,255,.105), rgba(230,185,63,.1));
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 7px 22px rgba(0,0,0,.15);
  transition: transform .18s var(--bb-ease), width .14s ease, inset .14s ease;
}

.app-tab {
  color: #858993;
  transition: color .15s ease, transform .15s var(--bb-ease);
}

.app-tab svg { stroke-width: 1.75; }
@media (hover: hover) and (pointer: fine) { .app-tab:hover { color: #d7d9de; transform: none; } }
.app-tab.active { color: var(--bb-text); }
.app-tab.active::after {
  width: 16px;
  height: 2px;
  background: var(--interaction-strong);
  box-shadow: 0 0 10px rgba(186,186,186,.58);
}

.app-tab:active svg,
.app-tab:active .profile-tab-photo { transform: scale(.9); }
.app-tab svg,
.app-tab .profile-tab-photo { transition: transform .15s var(--bb-ease); }

/* Historias: lectura rápida, estados claros y tacto de aplicación nativa. */
.stories-section {
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius-lg);
  background: linear-gradient(145deg, rgba(16,18,22,.94), rgba(9,10,13,.96));
  box-shadow: var(--bb-shadow-card);
}

.stories-strip { scroll-snap-type: x proximity; scrollbar-width: none; }
.stories-strip::-webkit-scrollbar { display: none; }
.story-bubble { scroll-snap-align: start; }
.story-bubble strong {
  color: #dadce1;
  font-size: .66rem;
  font-weight: 700;
}

.story-avatar-ring {
  border: 3px solid var(--bb-bg);
  outline-width: 2px;
  transition: transform .16s var(--bb-ease), opacity .16s ease, box-shadow .16s ease;
}

.story-bubble:active .story-avatar-ring { transform: scale(.96); }


@media (hover: hover) and (pointer: fine) { .story-bubble:hover .story-avatar-ring { transform: scale(.96); } }
.story-avatar-ring.unseen { outline-color: var(--bb-green); box-shadow: 0 0 0 3px rgba(53,215,127,.1); }
.story-avatar-ring.seen { outline-color: #626771; opacity: .74; }

/* Publicaciones: cabecera limpia, contenido protagonista y acciones inmediatas. */
#contenido .publications-feed { gap: 24px; }
#contenido .publications-feed .feed-post-card {
  border-color: var(--bb-line);
  border-radius: 24px;
  background: var(--bb-surface);
  box-shadow: var(--bb-shadow-card);
}

.feed-post-header { min-height: 74px; }
.feed-post-author .avatar.small {
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 0 0 3px var(--bb-surface), 0 0 0 4px rgba(230,185,63,.32);
}
.feed-post-author strong { letter-spacing: -.015em; }
.feed-post-author small { color: var(--bb-text-tertiary); }
.feed-post-menu-button { color: #c9cbd1; }
.feed-post-menu-popover {
  border-color: var(--bb-line-strong);
  background: rgba(18,20,25,.985);
  box-shadow: var(--bb-shadow-float);
}
.feed-post-media { background: #030406 !important; }
.feed-post-info { padding-bottom: 20px; }
.feed-post-info .feed-post-actions button { border-radius: 50%; }
.feed-post-info .feed-post-actions button:active { transform: scale(.84); }
.feed-post-like-summary { color: #f1f2f4; letter-spacing: -.01em; }
.feed-post-caption { color: #dfe0e4 !important; }
.feed-post-info .feed-post-time { color: var(--bb-text-tertiary); }
.media-like-button.liked { color: var(--bb-danger) !important; }

@keyframes bbHeartPop {
  0% { transform: scale(.72); }
  55% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.media-like-button.liked svg { animation: bbHeartPop .28s var(--bb-ease); }

/* Mensajes: separación de conversaciones, burbujas contenidas y compositor sólido. */
.messages-hub,
.private-chat-layout { border-radius: var(--bb-radius-lg); }
.chat-inbox,
.chat-panel,
.private-conversation {
  border-color: var(--bb-line);
  background: #0a0c0f;
}
.chat-inbox-heading { border-bottom-color: var(--bb-line); }
.unified-chat-list { display: grid; gap: 4px; }
.private-contact {
  min-height: 74px;
  margin-inline: 8px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  transition: color .14s ease, border-color .14s ease, background .14s ease, transform .14s var(--bb-ease);
}
.private-contact + .private-contact::before {
  content: "";
  position: absolute;
  top: -3px;
  right: 12px;
  left: 72px;
  height: 1px;
  background: rgba(255,255,255,.055);
}
@media (hover: hover) and (pointer: fine) { .private-contact:hover { border-color: var(--bb-line); background: rgba(255,255,255,.035); } }
.private-contact:active { transform: scale(.985); }
.private-contact.active {
  border-color: rgba(186,186,186,.25);
  background: linear-gradient(135deg, rgba(186,186,186,.11), rgba(255,255,255,.025));
  box-shadow: inset 3px 0 var(--interaction-strong);
}
.private-contact .avatar {
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 5px 18px rgba(0,0,0,.25);
}
.private-contact-copy strong { letter-spacing: -.015em; }
.private-contact-copy small,
.private-contact-copy time { color: var(--bb-text-tertiary); }

.messages {
  background:
    radial-gradient(circle at 50% 0%, rgba(230,185,63,.035), transparent 25rem),
    #080a0c;
}
.message-bubble {
  border-color: rgba(255,255,255,.07);
  border-radius: 18px 18px 18px 6px;
  background: #171a1f;
  box-shadow: 0 5px 18px rgba(0,0,0,.14);
  transition: border-color .14s ease, background .14s ease, transform .14s var(--bb-ease);
}
.message.own .message-bubble,
.private-message.own .message-bubble {
  border-color: rgba(230,185,63,.16);
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(145deg, #2b2415, #211c13);
}
.message-bubble.actions-open { border-color: rgba(186,186,186,.3); background-color: #1c1f25; }

@media (hover: hover) and (pointer: fine) { .message-bubble:hover { border-color: rgba(186,186,186,.3); background-color: #1c1f25; } }
.message-bubble:active { transform: scale(.992); }
.message-head time { color: var(--bb-text-tertiary); }
.message-actions {
  border-color: var(--bb-line-strong);
  background: rgba(20,22,27,.98);
  box-shadow: var(--bb-shadow-card);
}

.message-form {
  border-color: var(--bb-line);
  background: rgba(16,18,22,.96);
  box-shadow: 0 -12px 36px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.message-form input[type="text"] {
  color: var(--bb-text);
  background: rgba(255,255,255,.035);
}
.composer-tool-button { color: #c6c8ce; transition: color .14s ease, background .14s ease, transform .14s var(--bb-ease); }
@media (hover: hover) and (pointer: fine) { .composer-tool-button:hover { color: var(--bb-text); background: rgba(255,255,255,.055); } }
.composer-tool-button:active { transform: scale(.88); }
.composer-camera-button {
  color: #c5cad2;
  background: transparent;
  box-shadow: none;
}
.voice-note {
  border-color: rgba(255,255,255,.09);
  background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(0,0,0,.12));
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.voice-note-toggle { background: linear-gradient(145deg, var(--bb-gold-light), #c98e1a); }

/* Club, miembros, actualidad, búsqueda y calendario comparten la misma escala. */
.news-card,
.member-card,
.member-mini-card,
.search-result,
.calendar-card,
.admin-member-card,
.help-request-item {
  border-color: var(--bb-line);
  background: linear-gradient(150deg, rgba(20,22,27,.96), rgba(11,12,15,.98));
  box-shadow: inset 0 1px rgba(255,255,255,.03);
  transition: border-color .15s ease, background .15s ease, transform .15s var(--bb-ease), box-shadow .15s ease;
}
@media (hover: hover) and (pointer: fine) { .news-card:hover, .member-card:hover, .member-mini-card:hover, .search-result:hover, .admin-member-card:hover, .help-request-item:hover {
  border-color: rgba(186,186,186,.3);
  background: linear-gradient(150deg, rgba(25,27,32,.98), rgba(13,14,17,.98));
  box-shadow: 0 16px 40px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.04);
  transform: translateY(-2px);
} }
.news-card:active,
.member-card:active,
.member-mini-card:active,
.search-result:active,
.admin-member-card:active { transform: scale(.99); }
.news-card-meta span,
.member-role,
.role-chip { color: var(--bb-gold-light); }
.search-hub-input-wrap {
  border-color: var(--bb-line-strong);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.search-hub-input-wrap:focus-within {
  border-color: rgba(186,186,186,.5);
  box-shadow: 0 0 0 4px rgba(186,186,186,.08);
}
.calendar-day {
  transition: border-color .14s ease, background .14s ease, color .14s ease, transform .14s var(--bb-ease);
}
@media (hover: hover) and (pointer: fine) { .calendar-day:hover { border-color: rgba(186,186,186,.3); background: rgba(186,186,186,.07); } }
.calendar-day:active { transform: scale(.95); }
.calendar-day.today { box-shadow: inset 0 0 0 1px var(--bb-gold); }

/* Perfil: presencia social limpia, estadísticas ligeras y cuadrícula protagonista. */
#perfil .profile-hero {
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 2%, rgba(230,185,63,.08), transparent 19rem),
    linear-gradient(155deg, #121419, #090a0d);
}
.profile-social-heading { border-bottom-color: var(--bb-line); }
.profile-social-heading strong { letter-spacing: -.025em; }
#perfil .profile-visual {
  border-color: var(--bb-surface);
  box-shadow: 0 0 0 2px rgba(255,255,255,.16), 0 20px 48px rgba(0,0,0,.34);
}
#perfil .profile-stats div { background: rgba(255,255,255,.028); }
#perfil .profile-stats strong { letter-spacing: -.025em; }
#perfil .profile-stats small { color: var(--bb-text-tertiary); }
#perfil .profile-info h2 { letter-spacing: -.035em; }
#perfil .profile-tags span {
  border-color: rgba(255,255,255,.09);
  color: #d6d7db;
  background: rgba(255,255,255,.035);
}
.profile-story-media { transition: transform .16s var(--bb-ease), border-color .16s ease; }
@media (hover: hover) and (pointer: fine) { .profile-story-tile:hover .profile-story-media { transform: translateY(-2px); border-color: rgba(186,186,186,.45); } }
.profile-story-tile:active .profile-story-media { transform: scale(.94); }
.profile-post-card { transition: filter .15s ease, transform .15s var(--bb-ease); }
@media (hover: hover) and (pointer: fine) { .profile-post-card:hover { filter: brightness(1.06); } }
.profile-post-card:active { transform: scale(.985); }

/* Trofeos vectoriales: metal, rango y detalle personal sin emojis genéricos. */
.achievement-card,
.admin-achievement-card {
  border-color: color-mix(in srgb, var(--achievement-metal) 44%, transparent);
  background:
    radial-gradient(circle at 8% 15%, var(--achievement-glow), transparent 38%),
    linear-gradient(145deg, #15171b, #0c0d10);
  box-shadow: inset 0 1px rgba(255,255,255,.055), 0 12px 32px rgba(0,0,0,.18);
  transition: border-color .18s ease, transform .18s var(--bb-ease), box-shadow .18s ease;
}
@media (hover: hover) and (pointer: fine) { .achievement-card:hover, .admin-achievement-card:hover {
  border-color: color-mix(in srgb, var(--interaction-strong) 72%, transparent);
  transform: translateY(-2px);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 18px 42px rgba(0,0,0,.26), 0 0 30px var(--interaction-wash);
} }
.achievement-emblem {
  position: relative;
  border-color: color-mix(in srgb, var(--achievement-metal) 72%, white 7%);
  color: #17130b;
  background: linear-gradient(145deg, color-mix(in srgb, var(--achievement-metal) 62%, white), var(--achievement-metal));
  box-shadow: 0 0 0 5px var(--achievement-glow), 0 13px 30px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.62);
}
.achievement-emblem::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(15,12,7,.18);
  border-radius: 50%;
  pointer-events: none;
}
.achievement-trophy {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.achievement-trophy svg {
  width: 35px;
  height: 35px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px rgba(255,255,255,.22));
}
.achievement-trophy-cup,
.achievement-trophy-handles,
.achievement-trophy-base { transform-box: fill-box; transform-origin: center; transition: transform .28s cubic-bezier(.22,1,.36,1); }
.achievement-trophy-monogram { stroke-width: 1.25; }
.achievement-trophy-star { fill: currentColor; stroke: none; filter: drop-shadow(0 0 1px rgba(255,255,255,.35)); }
@media (hover: hover) and (pointer: fine) { .achievement-card:hover .achievement-trophy-cup, .admin-achievement-card:hover .achievement-trophy-cup { transform: translateY(-.45px); } }
@media (hover: hover) and (pointer: fine) { .achievement-card:hover .achievement-trophy-handles, .admin-achievement-card:hover .achievement-trophy-handles { transform: scale(1.035); } }
.achievement-card:active .achievement-trophy-cup,
.admin-achievement-card:active .achievement-trophy-cup { transform: translateY(.35px) scale(.98); }
.achievement-custom-mark {
  position: absolute;
  right: -5px;
  bottom: -4px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #101115;
  border-radius: 999px;
  color: var(--achievement-metal);
  background: #08090b;
  font-size: .62rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  .achievement-trophy-cup,
  .achievement-trophy-handles,
  .achievement-trophy-base { transition: none; }
}
.tier-platinum .achievement-emblem { box-shadow: 0 0 0 5px var(--achievement-glow), 0 0 22px rgba(143,225,231,.22), 0 13px 30px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.72); }
.achievement-card > div small,
.admin-achievement-copy > span { letter-spacing: .16em; }

/* Modales y herramientas: páginas limpias, no paneles genéricos superpuestos. */
.modal-backdrop {
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal,
.modal-content,
.profile-editor-modal,
.achievement-assignment-modal {
  border-color: var(--bb-line-strong);
  background: linear-gradient(155deg, #17191e, #0b0c0f);
  box-shadow: var(--bb-shadow-float);
}
.modal-heading { border-bottom-color: var(--bb-line); }
.close-modal,
.back-button,
.post-viewer-back {
  transition: color .14s ease, border-color .14s ease, background .14s ease, transform .14s var(--bb-ease);
}
@media (hover: hover) and (pointer: fine) { .close-modal:hover, .back-button:hover, .post-viewer-back:hover { border-color: rgba(186,186,186,.32); color: var(--interaction-strong); background: rgba(186,186,186,.07); } }
.close-modal:active,
.back-button:active,
.post-viewer-back:active { transform: scale(.92); }

/* Sólo se anima lo que el usuario toca; el contenido fuera de pantalla no pesa. */
.news-card,
.member-card,
.feed-post-card,
.achievement-card,
.admin-achievement-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}

.page-section.active > * {
  animation: bbSectionSettle .24s var(--bb-ease) both;
}
body.tab-switching .page-section.active > *,
body.chat-focus .page-section.active > *,
#inicio.active > * { animation: none; }

@keyframes bbSectionSettle {
  from { opacity: .82; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  body {
    background: var(--bb-bg);
  }
  .aurora,
  .gold-grid,
  .cursor-glow { display: none !important; }
  .topbar {
    background: rgba(7,8,10,.94);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .floating-tab-bar {
    left: 12px;
    right: auto;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px);
    min-height: 64px;
    padding: 5px;
    border-radius: 24px;
    background: rgba(12,13,16,.96);
    transform: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .floating-tab-bar::before { border-radius: 18px; }
  .app-tab { min-height: 52px; padding: 5px 3px; border-radius: 18px; }
  .app-tab svg { width: 24px; height: 24px; }
  .app-tab > span:last-child { display: none; }
  .app-tab.active::after { bottom: 4px; }
  body.mobile-header-hidden:not(.chat-focus) .floating-tab-bar {
    left: 18px;
    width: calc(100vw - 36px);
    min-height: 56px;
    padding: 4px;
    border-radius: 21px;
  }
  body.mobile-header-hidden:not(.chat-focus) .app-tab { min-height: 46px; }

  .page-section { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  .hero-card { border-radius: 24px; }
  .hero-emblem { opacity: .2; }
  .stories-section {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #contenido .publications-feed { gap: 8px; }
  #contenido .publications-feed .feed-post-card {
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.055);
    border-radius: 0;
    background: var(--bb-bg);
    box-shadow: none;
  }
  .feed-post-header { min-height: 60px; padding: 9px 13px; }
  .feed-post-author .avatar.small {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    box-shadow: 0 0 0 2px var(--bb-bg), 0 0 0 3px rgba(230,185,63,.3);
  }
  .feed-post-info { padding: 10px 13px 20px; }
  .feed-post-info .feed-post-actions svg { width: 27px; height: 27px; }

  .messages-hub,
  .private-chat-layout,
  .chat-inbox,
  .chat-panel,
  .private-conversation { border-radius: 0; }
  .private-contact { min-height: 70px; margin-inline: 6px; border-radius: 14px; }
  .message-bubble { max-width: 88%; }
  body.chat-focus .message-form {
    border: 1px solid var(--bb-line-strong);
    border-radius: 24px;
    background: #17191e;
    box-shadow: 0 8px 30px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.045);
  }

  #perfil .profile-hero {
    border-radius: 0;
    background: var(--bb-bg);
  }
  #perfil .profile-stories,
  #perfil .profile-achievements { background: var(--bb-bg); }
  #perfil .profile-actions .edit-profile-button {
    border-color: var(--bb-line);
    background: var(--bb-surface-soft);
  }
  #perfil .achievement-card { flex-basis: min(252px, 78vw); }
  @media (hover: hover) and (pointer: fine) { .achievement-card:hover, .admin-achievement-card:hover { transform: none; } }

  .modal-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .notifications-dropdown,
  .profile-quick-menu,
  .feed-post-menu-popover { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .page-section.active > * { animation-duration: .18s; }
}

@media (hover: none) {
  .news-card:hover,
  .member-card:hover,
  .member-mini-card:hover,
  .search-result:hover,
  .admin-member-card:hover,
  .achievement-card:hover,
  .admin-achievement-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-section.active > *,
  .media-like-button.liked svg { animation: none !important; }
}

/* Navegación inferior: la selección se desplaza físicamente entre pestañas. */
.floating-tab-bar {
  --tab-shell-padding: 8px;
  --active-tab-offset: 0%;
  isolation: isolate;
}
.floating-tab-bar::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: var(--tab-shell-padding);
  bottom: var(--tab-shell-padding);
  left: var(--tab-shell-padding);
  width: calc((100% - (var(--tab-shell-padding) * 2)) / 5);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(214,166,46,.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
  transform: translate3d(var(--active-tab-offset), 0, 0);
  transition: transform .3s cubic-bezier(.2,.85,.25,1.08), width .18s ease, inset .18s ease;
  will-change: transform;
  pointer-events: none;
}
.floating-tab-bar .app-tab { z-index: 1; }
.floating-tab-bar .app-tab.active {
  background: transparent;
  box-shadow: none;
}

/* Las miniaturas del perfil respetan el encuadre original completo. */
#perfil .profile-posts-grid .media-frame,
#perfil .profile-posts-grid .media-view-button { background: #030407; }
#perfil .profile-posts-grid .media-frame img,
#perfil .profile-posts-grid .media-frame video {
  object-fit: contain !important;
  object-position: center;
  background: #030407;
}

/* Los chats cambian en un único renderizado para evitar destellos en WKWebView. */
body.tab-switching .page-section.active { animation: none; }

/* La navegación principal se muestra ya compuesta; evita el fotograma vacío de iOS. */
body.authenticated .page-section,
body.authenticated .page-section.active > * { animation: none !important; }

.search-hub-results .search-result.member-search-result {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}
.search-hub-results .search-result.member-search-result .avatar.small {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
}
.search-hub-results .search-result.member-search-result .search-result-copy {
  grid-row: auto;
  display: grid;
  gap: 4px;
  min-width: 0;
  color: inherit;
  font-size: inherit;
  letter-spacing: normal;
  text-transform: none;
}
.search-hub-results .search-result.member-search-result .search-result-copy strong,
.search-hub-results .search-result.member-search-result .search-result-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .floating-tab-bar { --tab-shell-padding: 6px; }
  body.mobile-header-hidden:not(.chat-focus) .floating-tab-bar { --tab-shell-padding: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .floating-tab-bar::before { transition: none; }
}

/* Foto del grupo: editor independiente con el mismo patrón de navegación del perfil. */
body.group-avatar-editor-open { overflow: hidden; }
body.group-avatar-editor-open .floating-tab-bar { visibility: hidden; }
#groupAvatarEditor,
body.standalone-app #groupAvatarEditor {
  z-index: 2660;
  display: block;
  padding: 0;
  overflow: hidden;
  background: #08090d;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#groupAvatarEditor .group-avatar-editor,
body.standalone-app #groupAvatarEditor .group-avatar-editor {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #08090d;
  box-shadow: none;
  transform: translate3d(32px, 0, 0);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}
#groupAvatarEditor.open .group-avatar-editor,
body.standalone-app #groupAvatarEditor.open .group-avatar-editor { transform: translate3d(0, 0, 0); }
#groupAvatarEditor .modal-heading {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 10px max(22px, calc((100vw - 760px) / 2));
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(8,9,13,.98);
}
#groupAvatarEditor .modal-heading > div {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  text-align: center;
}
#groupAvatarEditor .modal-heading .eyebrow { display: none; }
#groupAvatarEditor .modal-heading h2 {
  margin: 0;
  overflow: hidden;
  color: #f5f5f7;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#groupAvatarEditor .profile-editor-back {
  grid-column: 1;
  grid-row: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  color: #f6f6f7;
  background: #25282e;
}
#groupAvatarEditor .group-avatar-page-form {
  width: min(560px, calc(100% - 36px));
  min-height: calc(100dvh - 72px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  margin: 0 auto;
  padding: 42px 0 max(32px, env(safe-area-inset-bottom, 0px));
}
#groupAvatarEditor .group-avatar-preview {
  width: 184px;
  height: 184px;
  flex: 0 0 184px;
  margin: 0 auto 8px;
  border: 2px solid rgba(255,255,255,.2);
  box-shadow: 0 0 0 6px #08090d, 0 0 0 7px rgba(255,255,255,.13), 0 24px 58px rgba(0,0,0,.42);
}
#groupAvatarEditor .group-avatar-file-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 12px;
}
#groupAvatarEditor .group-avatar-help {
  color: #858891;
  font-size: .66rem;
  line-height: 1.5;
}
#groupAvatarEditor .form-feedback {
  width: 100%;
  min-height: 20px;
  margin: 0;
  text-align: center;
}
#groupAvatarEditor .modal-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 2px 0 0;
}
#groupAvatarEditor .modal-actions button { width: 100%; min-height: 46px; margin: 0; }
#groupAvatarEditor #cancelGroupAvatarEditor { display: none; }
#groupAvatarEditor #removeGroupAvatarButton {
  color: #ff9c9c;
  border: 1px solid rgba(225,77,77,.28);
  border-radius: 12px;
  background: rgba(150,35,35,.1);
}

@media (max-width: 760px) {
  #groupAvatarEditor .modal-heading {
    min-height: calc(64px + env(safe-area-inset-top, 0px));
    padding: max(8px, env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(12px + env(safe-area-inset-left, 0px));
  }
  #groupAvatarEditor .profile-editor-back { width: 42px; height: 42px; }
  #groupAvatarEditor .group-avatar-page-form {
    width: min(100% - 32px, 430px);
    min-height: calc(100dvh - 64px - env(safe-area-inset-top, 0px));
    justify-content: flex-start;
    padding-top: clamp(42px, 9vh, 76px);
  }
  #groupAvatarEditor .group-avatar-preview {
    width: 148px;
    height: 148px;
    flex-basis: 148px;
  }
  #groupAvatarEditor .modal-actions {
    margin-top: auto;
    padding-top: 12px;
  }
}

/* Edición de perfil: pantalla dedicada en móvil, diálogo compacto en escritorio. */
body.profile-editor-open { overflow: hidden; }
body.profile-editor-open .floating-tab-bar { visibility: hidden; }
.profile-editor-back svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 760px) {
  #profileEditor,
  body.standalone-app #profileEditor {
    z-index: 2650;
    display: block;
    padding: 0;
    overflow: hidden;
    background: #08090d;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  #profileEditor .profile-editor-modal,
  body.standalone-app #profileEditor .profile-editor-modal {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #08090d;
    box-shadow: none;
    overscroll-behavior: contain;
    transform: translate3d(100%, 0, 0);
    transition: transform .26s cubic-bezier(.22, 1, .36, 1);
  }
  #profileEditor.open .profile-editor-modal,
  body.standalone-app #profileEditor.open .profile-editor-modal {
    transform: translate3d(0, 0, 0);
  }
  #profileEditor .modal-heading {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: calc(64px + env(safe-area-inset-top, 0px));
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    margin: 0;
    padding: max(8px, env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(12px + env(safe-area-inset-left, 0px));
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(8,9,13,.98);
  }
  #profileEditor .modal-heading > div {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    text-align: center;
  }
  #profileEditor .modal-heading .eyebrow { display: none; }
  #profileEditor .modal-heading h2 {
    margin: 0;
    overflow: hidden;
    color: #f5f5f7;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #profileEditor .profile-editor-back {
    grid-column: 1;
    grid-row: 1;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    color: #f6f6f7;
    background: #25282e;
  }
  #profileEditor .profile-form {
    display: block;
    padding: 0 0 calc(92px + env(safe-area-inset-bottom, 0px));
  }
  #profileEditor .avatar-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 18px 24px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    border-radius: 0;
    background: #08090d;
  }
  #profileEditor .avatar-editor .avatar-preview {
    width: 116px;
    height: 116px;
    flex: 0 0 116px;
    border: 2px solid rgba(255,255,255,.18);
    color: #fff;
    background: linear-gradient(145deg, #d8ad3f, #906b0a);
    box-shadow: 0 0 0 4px #08090d, 0 0 0 5px rgba(255,255,255,.13);
    font-size: 2.4rem;
  }
  #profileEditor .avatar-actions {
    justify-content: center;
    gap: 16px;
  }
  #profileEditor .avatar-actions .file-button,
  #profileEditor .avatar-actions .text-button {
    min-height: 34px;
    padding: 5px 7px;
    border: 0;
    color: #8aa5ff;
    background: transparent;
    box-shadow: none;
    font-size: .75rem;
    font-weight: 800;
  }
  #profileEditor .avatar-actions .danger-text { color: #bdc0c8; }
  #profileEditor .avatar-editor > small {
    margin: -4px 0 0;
    color: #747780;
    font-size: .58rem;
  }
  #profileEditor .avatar-cropper {
    width: min(100%, 360px);
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
    margin-top: 8px;
    padding-top: 20px;
  }
  #profileEditor .avatar-cropper[hidden] { display: none; }
  #profileEditor .avatar-crop-stage { width: min(230px, 70vw); }
  #profileEditor .avatar-crop-controls { width: 100%; }
  #profileEditor .profile-form > label,
  #profileEditor .admin-profile-fields > label {
    min-height: 64px;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    margin: 0;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  #profileEditor .profile-form > label > span,
  #profileEditor .admin-profile-fields > label > span {
    grid-column: 1;
    margin: 0;
    color: #f1f1f3;
    font-size: .74rem;
    font-weight: 650;
  }
  #profileEditor .profile-form input,
  #profileEditor .profile-form textarea,
  #profileEditor .profile-form select {
    grid-column: 2;
    width: 100%;
    min-height: 44px;
    padding: 10px 0;
    border: 0;
    border-radius: 0;
    color: #ececef;
    background: transparent;
    box-shadow: none;
    font-size: .76rem;
  }
  #profileEditor .profile-form input:focus,
  #profileEditor .profile-form textarea:focus,
  #profileEditor .profile-form select:focus {
    border: 0;
    box-shadow: inset 0 -1px #8aa5ff;
  }
  #profileEditor .profile-form input:disabled {
    opacity: 1;
    color: #9b9ea7;
    -webkit-text-fill-color: #9b9ea7;
  }
  #profileEditor .profile-form textarea {
    min-height: 70px;
    resize: none;
  }
  #profileEditor .profile-form > label > small,
  #profileEditor .admin-profile-fields > label > small {
    grid-column: 2;
    margin: -5px 0 5px;
    color: #777a84;
    font-size: .55rem;
    line-height: 1.35;
  }
  #profileEditor .admin-profile-fields {
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  #profileEditor .admin-profile-fields[hidden] { display: none; }
  #profileEditor .admin-profile-fields-heading { display: none; }
  #profileEditor .form-feedback {
    min-height: 24px;
    padding: 8px 16px 0;
    font-size: .65rem;
  }
  #profileEditor .modal-actions {
    position: sticky;
    z-index: 18;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 8px;
    padding: 10px calc(14px + env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px));
    border-top: 1px solid rgba(255,255,255,.09);
    background: rgba(8,9,13,.98);
  }
  #profileEditor #cancelProfileEditor { display: none; }
  #profileEditor .modal-actions .primary-button {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
  }
}

/* Zonas seguras globales de la PWA: ningún panel queda bajo la isla dinámica ni el indicador inferior. */
body.standalone-app {
  --pwa-safe-top: env(safe-area-inset-top, 0px);
  --pwa-safe-right: env(safe-area-inset-right, 0px);
  --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
  --pwa-safe-left: env(safe-area-inset-left, 0px);
}

@media (max-width: 760px) {
  body.standalone-app .page-section {
    padding-right: calc(16px + var(--pwa-safe-right));
    padding-bottom: calc(45px + var(--pwa-safe-bottom));
    padding-left: calc(16px + var(--pwa-safe-left));
  }
  body.standalone-app .sidebar {
    height: 100dvh;
    padding-top: calc(18px + var(--pwa-safe-top));
    padding-right: calc(13px + var(--pwa-safe-right));
    padding-bottom: calc(18px + var(--pwa-safe-bottom));
    padding-left: calc(13px + var(--pwa-safe-left));
    box-sizing: border-box;
  }
  body.standalone-app .site-footer {
    padding-right: calc(22px + var(--pwa-safe-right));
    padding-bottom: calc(22px + var(--pwa-safe-bottom));
    padding-left: calc(22px + var(--pwa-safe-left));
  }
  body.standalone-app .login-screen {
    padding: calc(20px + var(--pwa-safe-top)) calc(18px + var(--pwa-safe-right)) calc(20px + var(--pwa-safe-bottom)) calc(18px + var(--pwa-safe-left));
  }
  body.standalone-app .global-search {
    padding: calc(var(--pwa-safe-top) + 22px) calc(var(--pwa-safe-right) + 16px) calc(var(--pwa-safe-bottom) + 22px) calc(var(--pwa-safe-left) + 16px);
  }
  body.standalone-app .modal-backdrop:not(.media-viewer):not(#mediaUploader) {
    padding: calc(var(--pwa-safe-top) + 12px) calc(var(--pwa-safe-right) + 12px) calc(var(--pwa-safe-bottom) + 12px) calc(var(--pwa-safe-left) + 12px);
  }
  body.standalone-app .modal-backdrop:not(.media-viewer):not(#mediaUploader) .profile-editor-modal {
    max-height: calc(100dvh - var(--pwa-safe-top) - var(--pwa-safe-bottom) - 24px);
  }
  body.standalone-app.chat-focus #chat .chat-header,
  body.standalone-app.chat-focus #privados .private-conversation .chat-header,
  body.standalone-app.chat-focus #privados .private-contacts .panel-heading {
    padding-top: calc(13px + var(--pwa-safe-top));
  }
  body.standalone-app.chat-focus .message-form {
    padding-bottom: calc(14px + var(--pwa-safe-bottom));
  }
  body.standalone-app .media-viewer-close,
  body.standalone-app .moment-options-button { top: calc(var(--pwa-safe-top) + 12px); }
  body.standalone-app .moment-options-menu { top: calc(var(--pwa-safe-top) + 62px); }
  body.standalone-app #mediaUploader.has-media .media-crop-stage {
    top: calc(54px + var(--pwa-safe-top));
    bottom: calc(126px + var(--pwa-safe-bottom));
  }
  body.standalone-app #mediaUploader.has-media .modal-heading {
    height: calc(66px + var(--pwa-safe-top));
    padding-top: calc(10px + var(--pwa-safe-top));
  }
  body.standalone-app #mediaUploader.has-media .media-editor-toolbar {
    bottom: calc(66px + var(--pwa-safe-bottom));
  }
  body.standalone-app #mediaUploader .media-tool-panel.active {
    bottom: calc(126px + var(--pwa-safe-bottom));
  }
  body.standalone-app #mediaUploader.has-media .modal-actions {
    bottom: calc(8px + var(--pwa-safe-bottom));
  }
}

.push-notification-actions { display: flex; align-items: center; gap: 7px; }
.push-notification-actions button[hidden] { display: none; }

/* El chat completo empieza después de la barra de estado de iOS, no debajo de ella. */
@media (max-width: 760px) {
  body.standalone-app.chat-focus .app {
    top: var(--pwa-safe-top);
    height: calc(var(--chat-viewport-height, 100dvh) - var(--pwa-safe-top) - var(--pwa-safe-bottom));
    transform: translateY(var(--chat-viewport-offset, 0px));
  }
  body.standalone-app.chat-focus #chat.active,
  body.standalone-app.chat-focus #privados.active {
    height: 100%;
  }
  body.standalone-app.chat-focus #chat .chat-header,
  body.standalone-app.chat-focus #privados .private-conversation .chat-header,
  body.standalone-app.chat-focus #privados .private-contacts .panel-heading {
    padding-top: 13px;
  }
  body.standalone-app.chat-focus .message-form { padding-bottom: 14px; }
}

/* En la PWA de iPhone los controles deben quedar debajo de hora, señal y batería. */
@media (max-width: 760px) {
  body.standalone-app {
    --pwa-safe-top: env(safe-area-inset-top, 0px);
  }
  body.standalone-app .topbar {
    height: calc(58px + var(--pwa-safe-top));
    padding-top: var(--pwa-safe-top);
    box-sizing: border-box;
  }
  body.standalone-app .notifications-dropdown {
    top: calc(62px + var(--pwa-safe-top));
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  body.standalone-app {
    --pwa-safe-top: max(env(safe-area-inset-top, 0px), 58px);
  }
}

/* Navegación principal flotante · experiencia social 2026 */
.app,
body.sidebar-compact .app,
.site-footer,
body.sidebar-compact .site-footer {
  margin-left: 0;
}

body.authenticated {
  padding-bottom: 124px;
}

.page-section {
  width: min(100%, 1480px);
  margin-inline: auto;
  padding-bottom: 142px;
}

.floating-tab-bar {
  position: fixed;
  z-index: 95;
  right: 50%;
  bottom: 24px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: min(680px, calc(100vw - 40px));
  min-height: 76px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 28px;
  background: rgba(7,7,9,.82);
  box-shadow: 0 22px 70px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(24px) saturate(145%);
  transform: translateX(50%);
}

body:not(.authenticated) .floating-tab-bar {
  display: none;
}

.app-tab {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border-radius: 21px;
  color: #a4a4ad;
  text-decoration: none;
  transition: color .12s ease, background .12s ease, transform .12s ease;
}

.app-tab svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-tab > span:last-child {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .02em;
}

@media (hover: hover) and (pointer: fine) { .app-tab:hover {
  color: #fff;
  transform: translateY(-1px);
} }

.app-tab.active {
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(168,168,168,.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}

.app-tab.active::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--interaction-strong);
  box-shadow: 0 0 12px rgba(168,168,168,.8);
}

.tab-alert {
  position: absolute;
  top: 9px;
  left: calc(50% + 10px);
  width: 7px;
  height: 7px;
  border: 2px solid #09090b;
  border-radius: 50%;
  background: #ff3159;
}

.tab-alert[hidden] { display: none; }


.topbar {
  padding-inline: clamp(18px, 4vw, 54px);
  z-index: 110;
}

#contenido .stories-section {
  max-width: 1040px;
  margin-inline: auto;
}

#contenido .publications-hero,
#contenido .publications-toolbar,
#contenido .publications-feed {
  width: min(760px, 100%);
  margin-inline: auto;
}

#contenido .publications-feed {
  grid-template-columns: 1fr;
}

#contenido .profile-post-card {
  border-radius: 24px;
  box-shadow: 0 24px 65px rgba(0,0,0,.3);
}

.search-calendar-page {
  display: none;
}

.search-calendar-page.active {
  display: block;
}

.search-hub {
  width: min(980px, 100%);
  margin: 0 auto 54px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(214,166,46,.2);
  border-radius: 28px;
  background: radial-gradient(circle at 90% 0, rgba(214,166,46,.1), transparent 38%), rgba(255,255,255,.025);
  box-shadow: 0 26px 80px rgba(0,0,0,.28);
}

.search-hub-heading {
  margin-bottom: 24px;
}

.search-hub-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: #0a0a0d;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}

.search-hub-box:focus-within {
  border-color: var(--interaction-strong);
  box-shadow: 0 0 0 4px rgba(168,168,168,.11);
}

.search-hub-box svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-hub-box input {
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.search-hub-results {
  width: 100%;
  max-height: 420px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: none;
}

.calendar-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 0 0 30px;
  color: var(--gold);
  font-size: .68rem;
  letter-spacing: .22em;
}

.calendar-divider span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214,166,46,.34));
}

.calendar-divider span:last-child {
  transform: rotate(180deg);
}

.profile-stories {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.025);
}

.profile-stories-strip {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  padding-bottom: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.profile-story-tile {
  flex: 0 0 104px;
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  color: var(--text);
  text-align: left;
  background: transparent;
}

.profile-story-media {
  display: block;
  width: 104px;
  aspect-ratio: 9 / 14;
  overflow: hidden;
  padding: 3px;
  border: 2px solid #46d27c;
  border-radius: 17px;
  background: #08080a;
}

.profile-story-media img,
.profile-story-media video {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
  object-fit: cover;
}

.profile-story-tile small {
  color: var(--muted);
  font-size: .65rem;
}

.profile-stories-empty {
  flex: 1 0 100%;
  min-height: 120px;
}

body.chat-focus .floating-tab-bar {
  display: flex;
}

body.chat-focus .app {
  height: calc(var(--chat-viewport-height, 100dvh) - 112px);
}

#perfil .back-button[hidden] {
  display: none;
}

@media (max-width: 760px) {
  body.authenticated {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .page-section,
  body.standalone-app .page-section {
    padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px));
  }

  .floating-tab-bar {
    right: auto;
    left: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px);
    min-height: 68px;
    padding: 6px;
    border-radius: 24px;
    transform: none;
  }

  .app-tab {
    gap: 0;
    min-height: 56px;
    padding: 7px 4px;
    border-radius: 18px;
  }

  .app-tab svg {
    width: 25px;
    height: 25px;
  }

  .app-tab > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .app-tab.active::after {
    bottom: 4px;
  }

  .tab-avatar {
    position: static !important;
    width: 28px !important;
    height: 28px !important;
    clip: auto !important;
  }

  .tab-alert {
    top: 10px;
  }

  .topbar {
    padding-inline: 16px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar h1 {
    max-width: 42vw;
  }

  #contenido .stories-section {
    margin-inline: -4px;
    border-radius: 20px;
  }

  #contenido .publications-hero {
    margin-top: 28px;
  }

  #contenido .profile-post-card {
    border-radius: 19px;
  }

  .search-hub {
    margin-bottom: 38px;
    padding: 22px 16px;
    border-radius: 22px;
  }

  .search-hub-heading {
    margin-bottom: 18px;
  }

  .search-hub-box {
    border-radius: 15px;
  }

  .search-hub-results .search-result {
    grid-template-columns: minmax(64px, 78px) minmax(0, 1fr) auto;
    padding-inline: 12px;
  }

  .profile-stories {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .profile-story-tile,
  .profile-story-media {
    width: 88px;
  }

  .profile-story-tile {
    flex-basis: 88px;
  }

  body.chat-focus .app,
  body.standalone-app.chat-focus .app {
    top: var(--pwa-safe-top, 0px);
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    height: auto;
  }

  body.chat-focus #chat.active,
  body.chat-focus #privados.active,
  body.standalone-app.chat-focus #chat.active,
  body.standalone-app.chat-focus #privados.active {
    height: 100%;
  }

  #perfil .profile-hero {
    min-height: 0;
  }

  #perfil .profile-visual {
    min-height: 210px;
  }

  #perfil .profile-info {
    padding: 26px 22px 30px;
  }

  #perfil .profile-info h2 {
    font-size: clamp(3.2rem, 16vw, 4.7rem);
  }
}

/* Cabecera inteligente para móvil y PWA: libera espacio al bajar y vuelve al subir. */
@media (max-width: 760px) {
  .topbar {
    transition: transform .24s cubic-bezier(.22, 1, .36, 1), box-shadow .24s ease;
    will-change: transform;
  }
  body.mobile-header-hidden:not(.chat-focus) .topbar {
    transform: translate3d(0, calc(-100% - 2px), 0);
    pointer-events: none;
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .topbar { transition: none; }
}

/* Portal de herramientas: hijo directo del backdrop, sin recorte en Safari iOS. */
#mediaUploader.has-media > .media-crop-controls {
  position: absolute !important;
  inset: auto !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 2200 !important;
  display: block !important;
  width: 0 !important;
  height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  transform: none !important;
  pointer-events: none !important;
}

/* Portal mínimo: reemplaza por completo el antiguo panel lateral. */
#mediaUploader > .media-tool-portal {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 2200 !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  pointer-events: none !important;
}
#mediaUploader:not(.has-media) > .media-tool-portal { display: none !important; }
#mediaUploader > .media-tool-portal .media-tool-panel { display: none !important; }
#mediaUploader.has-media > .media-tool-portal .media-tool-panel.active {
  position: fixed !important;
  inset: 82px 78px auto auto !important;
  z-index: 2201 !important;
  display: grid !important;
  width: min(360px, calc(100vw - 104px)) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
@media (max-width: 760px) {
  #mediaUploader.has-media > .media-tool-portal .media-tool-panel.active {
    inset: auto 8px 126px !important;
    width: auto !important;
    min-height: 76px;
    max-height: min(46dvh, 390px) !important;
    padding: 17px !important;
    overflow: auto !important;
    border: 1px solid rgba(255,255,255,.22) !important;
    border-radius: 20px !important;
    background: rgba(12,12,15,.97) !important;
    box-shadow: 0 -12px 46px rgba(0,0,0,.72) !important;
  }
}
#mediaUploader:not(.has-media) > .media-crop-controls {
  display: none !important;
}

/* El editor es una pantalla propia: ningún ancestro debe desenfocar sus hijos. */
#mediaUploader,
#mediaUploader *,
#mediaUploader.has-media > .media-crop-controls {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
#mediaUploader,
#mediaUploader .media-uploader-modal,
#mediaUploader .profile-form,
#mediaUploader .media-cropper,
#mediaUploader > .media-crop-controls {
  filter: none !important;
}
#mediaUploader.has-media > .media-crop-controls .media-tool-panel.active {
  position: fixed !important;
  inset: 82px 78px auto auto !important;
  z-index: 2201 !important;
  display: grid !important;
  width: min(360px, calc(100vw - 104px)) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
@media (max-width: 760px) {
  #mediaUploader.has-media > .media-crop-controls .media-tool-panel.active {
    position: fixed !important;
    inset: auto 8px 126px !important;
    width: auto !important;
    min-height: 76px;
    max-height: min(46dvh, 390px) !important;
    padding: 17px !important;
    overflow: auto !important;
    border: 1px solid rgba(255,255,255,.22) !important;
    border-radius: 20px !important;
    background: rgba(12,12,15,.97) !important;
    box-shadow: 0 -12px 46px rgba(0,0,0,.72) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* Herramientas estilo Instagram, integradas sobre el propio lienzo */
#mediaUploader .media-cropper { position: relative; display: block; }
#mediaUploader .media-crop-stage { height: 100dvh; width: 100%; padding: 0 12px; }
#mediaUploader .media-crop-controls {
  position: absolute; z-index: 6; right: 18px; bottom: 88px;
  width: min(430px, calc(100% - 36px)); height: auto; max-height: calc(100dvh - 100px);
  padding: 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 22px;
  background: rgba(12,12,15,.76); box-shadow: 0 20px 70px rgba(0,0,0,.48);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
#mediaUploader .media-customization-grid { grid-template-columns: 1fr; }
#mediaUploader .media-text-tool input { font-size: 17px; font-weight: 700; }
#mediaUploader .media-caption-tool textarea { min-height: 68px; resize: vertical; }
.media-filter-tool { display: grid; gap: 10px; }
.media-filter-tool > span { color: #d7d3c9; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.media-filter-rail { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.media-filter-rail::-webkit-scrollbar { display: none; }
.media-filter-rail button { flex: 0 0 54px; display: grid; gap: 5px; justify-items: center; border: 0; background: none; color: #aaa; cursor: pointer; padding: 0; }
.media-filter-rail button i { width: 48px; height: 48px; border-radius: 50%; border: 2px solid transparent; background: linear-gradient(135deg,#d6a327,#402c12); box-shadow: inset 0 0 0 2px #111; }
.media-filter-rail button[data-editor-filter="vivid"] i { filter: saturate(1.7) contrast(1.12); }
.media-filter-rail button[data-editor-filter="warm"] i { filter: sepia(.5) saturate(1.3); }
.media-filter-rail button[data-editor-filter="cool"] i { filter: hue-rotate(175deg) saturate(.8); }
.media-filter-rail button[data-editor-filter="mono"] i { filter: grayscale(1); }
.media-filter-rail button[data-editor-filter="vintage"] i { filter: sepia(.8) contrast(.85); }
.media-filter-rail button.active { color: white; }
.media-filter-rail button.active i { border-color: var(--interaction-strong); }
#mediaUploader.has-media .modal-actions { right: 18px; bottom: 14px; width: 430px; transform: none; }
#mediaUploader.has-media .form-feedback { right: 24px; bottom: 74px; width: 418px; }
@media (max-width: 760px) {
  #mediaUploader .media-cropper { display: block; height: 100dvh; overflow: hidden; }
  #mediaUploader .media-crop-stage { position: absolute; inset: 0; height: 100dvh; }
  #mediaUploader .media-crop-controls {
    position: absolute; left: 8px; right: 8px; bottom: 76px; width: auto; max-height: 44dvh;
    padding: 14px; border-radius: 20px; overflow-y: auto;
  }
  #mediaUploader .media-crop-controls .media-original-toggle,
  #mediaUploader .media-crop-controls > small { display: none !important; }
  #mediaUploader.has-media .modal-actions { left: 8px; right: 8px; bottom: 8px; width: auto; transform: none; }
  #mediaUploader.has-media .form-feedback { left: 14px; right: 14px; bottom: 68px; width: auto; }
}


/* ===== PREMIUM BLACK & GOLD EXPERIENCE ===== */
:root {
  --gold: #d6a62e;
  --gold-soft: #f3d27a;
  --gold-dark: #72500c;
  --black: #050506;
  --panel-black: #0c0c0e;
  --luxury-border: rgba(214,166,46,.22);
}

body {
  background:
    radial-gradient(circle at 48% -15%, rgba(214,166,46,.10), transparent 28%),
    radial-gradient(circle at 90% 40%, rgba(123,84,9,.08), transparent 25%),
    linear-gradient(180deg, #050506 0%, #08080a 50%, #030304 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(115deg, transparent 0 45%, rgba(255,255,255,.012) 48%, transparent 51% 100%);
  background-size: 500px 100%;
  animation: bodyShine 11s linear infinite;
}
@media (max-width: 760px) {
  body::before { animation: none; display: none; }
}

@keyframes bodyShine {
  from { background-position: -500px 0; }
  to { background-position: calc(100vw + 500px) 0; }
}

.aurora {
  position: fixed;
  z-index: -4;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .16;
  pointer-events: none;
  animation: auroraFloat 14s ease-in-out infinite alternate;
}

.aurora-one {
  width: 440px;
  height: 440px;
  top: -180px;
  right: 5%;
  background: #8a620d;
}

.aurora-two {
  width: 340px;
  height: 340px;
  bottom: -130px;
  left: 18%;
  background: #4a3304;
  animation-delay: -6s;
}

@keyframes auroraFloat {
  to { transform: translate3d(45px, 35px, 0) scale(1.15); }
}

.gold-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: .08;
  background-image:
    linear-gradient(rgba(214,166,46,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214,166,46,.12) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 75%);
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214,166,46,.10), transparent 68%);
  transform: translate3d(-400px, -400px, 0);
  pointer-events: none;
  z-index: 0;
  transition: opacity .3s;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #050506;
  transition: opacity .22s ease-out, visibility .22s ease-out;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-emblem {
  width: 170px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 8px #050506, 0 0 0 9px rgba(214,166,46,.22), 0 0 70px rgba(214,166,46,.16);
  animation: loaderPulse 1.6s ease-in-out infinite;
}

.loader-emblem span,
.loader-emblem small {
  font-size: 8px;
  letter-spacing: 3px;
  font-weight: 900;
}

.loader-emblem strong {
  color: var(--gold);
  font-family: "Anton";
  font-size: 54px;
  line-height: 1;
}

.loader-emblem small {
  color: var(--muted);
}

@keyframes loaderPulse {
  50% { transform: scale(1.04); box-shadow: 0 0 0 8px #050506, 0 0 0 9px rgba(214,166,46,.4), 0 0 95px rgba(214,166,46,.24); }
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(12,12,14,.97), rgba(5,5,6,.98)),
    #080809;
  border-right-color: rgba(214,166,46,.14);
  box-shadow: 20px 0 70px rgba(0,0,0,.25);
}

.brand-mark {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f6dc86, #b47d13 70%);
  box-shadow: 0 0 28px rgba(214,166,46,.18);
}

.brand-mark::after,
.primary-button::after,
.send-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.55), transparent 75%);
  transform: translateX(-130%);
  transition: transform .65s ease;
}

@media (hover: hover) and (pointer: fine) { .brand:hover .brand-mark::after, .primary-button:hover::after, .send-button:hover::after {
  transform: translateX(130%);
} }

.nav-link {
  overflow: hidden;
  border: 1px solid transparent;
}

.nav-link.active {
  border-color: rgba(168,168,168,.12);
  background: linear-gradient(90deg, rgba(168,168,168,.09), rgba(255,255,255,.02));
  box-shadow: inset 0 0 30px rgba(168,168,168,.025);
}


@media (hover: hover) and (pointer: fine) { .nav-link:hover {
  border-color: rgba(168,168,168,.12);
  background: linear-gradient(90deg, rgba(168,168,168,.09), rgba(255,255,255,.02));
  box-shadow: inset 0 0 30px rgba(168,168,168,.025);
} }

.nav-link.active::before {
  background: linear-gradient(180deg, var(--interaction-strong), var(--interaction-strong));
  box-shadow: 0 0 14px rgba(168,168,168,.6);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  background: rgba(5,5,6,.72);
  backdrop-filter: blur(24px) saturate(120%);
  border-bottom-color: rgba(214,166,46,.11);
}

.topbar::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 44px;
  width: 110px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero-card {
  border-color: rgba(214,166,46,.22);
  background:
    radial-gradient(circle at 80% 35%, rgba(214,166,46,.12), transparent 28%),
    linear-gradient(145deg, rgba(17,17,20,.98), rgba(5,5,6,.98));
  box-shadow:
    0 35px 100px rgba(0,0,0,.52),
    inset 0 1px rgba(255,255,255,.035);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(255,255,255,.08), rgba(214,166,46,.45), transparent 42%, rgba(214,166,46,.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hero-kicker {
  margin-top: 20px;
  color: rgba(243,210,122,.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3.4px;
}

.hero-copy h2 {
  text-shadow: 0 10px 45px rgba(0,0,0,.55);
}

.hero-copy h2 em {
  background: linear-gradient(120deg, #8c620e, #f3d27a 45%, #c9911b 75%, #7d560c);
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(214,166,46,.12));
}

.hero-lines {
  position: absolute;
  top: 0;
  right: 35%;
  width: 180px;
  height: 100%;
  opacity: .35;
  transform: skewX(-15deg);
}

.hero-lines span {
  position: absolute;
  top: -20%;
  width: 1px;
  height: 140%;
  background: linear-gradient(to bottom, transparent, rgba(214,166,46,.45), transparent);
  animation: lineFlow 5s ease-in-out infinite;
}

.hero-lines span:nth-child(1) { left: 20%; }
.hero-lines span:nth-child(2) { left: 50%; animation-delay: -1.8s; }
.hero-lines span:nth-child(3) { left: 80%; animation-delay: -3.4s; }

@keyframes lineFlow {
  50% { transform: translateY(12%); opacity: .35; }
}

.primary-button,
.send-button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f0d274, #b77c13);
  box-shadow: 0 10px 35px rgba(214,166,46,.14);
}

@media (hover: hover) and (pointer: fine) { .primary-button:hover, .send-button:hover {
  background: linear-gradient(135deg, #e5e5e5, #919191);
  transform: translateY(-2px);
  box-shadow: 0 15px 42px rgba(168,168,168,.21);
} }

@media (hover: hover) and (pointer: fine) { .secondary-button:hover {
  border-color: rgba(168,168,168,.35);
  background: rgba(168,168,168,.06);
  transform: translateY(-2px);
} }

.primary-button,
.secondary-button,
.send-button,
.icon-button,
.profile-button,
.member-card,
.member-mini-card,
.moment-card {
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.emblem-ring {
  position: relative;
  border-color: var(--gold);
  background: radial-gradient(circle, rgba(214,166,46,.07), transparent 62%);
  box-shadow:
    inset 0 0 0 12px var(--surface-2),
    inset 0 0 0 13px rgba(214,166,46,.32),
    0 0 90px rgba(214,166,46,.12);
  animation: emblemFloat 5s ease-in-out infinite;
}

.emblem-ring::before,
.emblem-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(214,166,46,.22);
  animation: spin 22s linear infinite;
}

.emblem-ring::before { inset: -22px; }
.emblem-ring::after { inset: 24px; animation-direction: reverse; animation-duration: 15s; }

.emblem-crown {
  position: absolute;
  top: 27px;
  color: var(--gold-soft);
  font-size: 12px;
  text-shadow: 0 0 15px rgba(214,166,46,.8);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes emblemFloat { 50% { transform: translateY(-10px) rotate(4deg); } }

.panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(214,166,46,.14);
  background:
    linear-gradient(145deg, rgba(15,15,18,.98), rgba(8,8,10,.98));
  box-shadow: 0 25px 70px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.025);
}

.panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 90px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.member-mini-card,
.profile-stats div {
  border-color: rgba(214,166,46,.12);
  background: linear-gradient(145deg, rgba(255,255,255,.025), rgba(214,166,46,.025));
}

@media (hover: hover) and (pointer: fine) { .member-mini-card:hover, .profile-stats div:hover {
  border-color: rgba(168,168,168,.46);
  box-shadow: 0 18px 45px rgba(0,0,0,.28), 0 0 30px rgba(168,168,168,.04);
} }

.member-card {
  border-color: rgba(214,166,46,.16);
  box-shadow: 0 25px 60px rgba(0,0,0,.35);
}

.member-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 25%, rgba(255,255,255,.07), transparent 55%);
  transform: translateX(-120%);
  transition: transform .7s ease;
}

@media (hover: hover) and (pointer: fine) { .member-card:hover::after {
  transform: translateX(120%);
} }

@media (hover: hover) and (pointer: fine) { .member-card:hover {
  box-shadow: 0 35px 85px rgba(0,0,0,.5), 0 0 45px rgba(168,168,168,.06);
} }

.member-card > * {
  position: relative;
  z-index: 2;
}

.member-card > .member-card-photo,
.member-card > .member-card-photo-shade {
  position: absolute;
  inset: 0;
}

.member-card > .member-card-photo {
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.member-card > .member-card-photo-shade {
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.94), rgba(0,0,0,.08) 72%);
  pointer-events: none;
}

.member-card::before { z-index: 3; }
.member-card::after { z-index: 3; pointer-events: none; }

.member-role {
  box-shadow: 0 7px 20px rgba(214,166,46,.15);
}

.message {
  position: relative;
  padding: 13px 14px;
  margin-left: -14px;
  margin-right: -14px;
  border-radius: 12px;
  transition: background .2s;
}

@media (hover: hover) and (pointer: fine) { .message:hover {
  background: rgba(168,168,168,.035);
} }

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

.messages::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--gold), var(--gold-dark));
  border-radius: 10px;
}

.message-form {
  background: rgba(7,7,8,.9);
  backdrop-filter: blur(15px);
}

.message-form input {
  border-color: rgba(214,166,46,.15);
  background: rgba(255,255,255,.025);
}

.message-form input:focus {
  box-shadow: 0 0 0 3px rgba(168,168,168,.06);
}

.online-member i {
  box-shadow: 0 0 13px rgba(85,220,128,.65);
  animation: onlinePulse 2s infinite;
}

@keyframes onlinePulse {
  50% { opacity: .45; transform: scale(.8); }
}

.profile-hero {
  position: relative;
  border-color: rgba(214,166,46,.22);
  box-shadow: 0 35px 100px rgba(0,0,0,.48);
}

.profile-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(214,166,46,.12);
  border-radius: inherit;
}

.profile-info h2 {
  background: linear-gradient(135deg, #ffffff, #d0c7b2 55%, #c29023);
  -webkit-background-clip: text;
  color: transparent;
}

.profile-tags span {
  border-color: rgba(214,166,46,.2);
  background: rgba(214,166,46,.045);
}

.moment-card {
  border-color: rgba(214,166,46,.15);
  box-shadow: 0 20px 55px rgba(0,0,0,.32);
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}

.moment-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 75% 20%, rgba(214,166,46,.14), transparent 32%);
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) { .moment-card:hover {
  transform: translateY(-7px) scale(1.012);
  border-color: rgba(168,168,168,.45);
  box-shadow: 0 35px 80px rgba(0,0,0,.48), 0 0 50px rgba(168,168,168,.05);
} }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  margin-left: 250px;
  min-height: 120px;
  padding: 28px 44px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(214,166,46,.12);
  background: rgba(4,4,5,.82);
  color: var(--muted);
}

.footer-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "Anton";
  font-size: 19px;
  transform: rotate(-4deg);
}

.site-footer strong,
.site-footer small {
  display: block;
}

.site-footer strong {
  color: var(--text);
  font-family: "Anton";
  font-size: 15px;
  letter-spacing: .7px;
}

.site-footer small {
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: 2px;
}

.site-footer > span {
  margin-left: auto;
  color: rgba(214,166,46,.55);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 2.4px;
}

@media (max-width: 760px) {
  .cursor-glow {
    display: none;
  }

  body::before,
  .aurora,
  .gold-grid {
    animation: none !important;
  }

  .aurora {
    filter: blur(70px);
    opacity: .1;
  }

  .site-footer {
    margin-left: 0;
    padding: 24px 18px;
  }

  .site-footer > span {
    display: none;
  }

  .gold-grid {
    background-size: 46px 46px;
  }

  .hero-card::before {
    font-size: 92px;
    bottom: -30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Acciones sociales inspiradas en la referencia: corazón, comentario y envío. */
.media-social-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  margin-top: 11px;
}
.media-social-actions .media-like-button,
.media-social-actions .media-reply-button,
.media-social-actions .media-share-button {
  min-width: 30px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 3px;
  border: 0;
  border-radius: 8px;
  color: #f5f5f7;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: color .16s ease, transform .16s ease, background .16s ease;
}
@media (hover: hover) and (pointer: fine) { .media-social-actions button:hover { color: #fff; background: rgba(255,255,255,.07); transform: scale(1.06); } }
.media-social-actions svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.media-social-actions .media-like-button.liked { color: #ff4057; background: transparent; }
.media-social-actions .media-like-button svg.filled { fill: currentColor; stroke: currentColor; }
.media-social-actions strong { color: currentColor; font-size: .72rem; }
.media-social-actions small { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Logros: una sala de trofeos compacta y reconocible por rango. */
.profile-achievements { display: grid; gap: 16px; }
.achievement-showcase { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.achievement-card,
.admin-achievement-card {
  --achievement-metal: #b97842;
  --achievement-glow: rgba(185,120,66,.2);
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0,1fr);
  align-items: center;
  gap: 14px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--achievement-metal) 58%, transparent);
  border-radius: 18px;
  background: radial-gradient(circle at 0 0, var(--achievement-glow), transparent 48%), #101115;
  box-shadow: inset 0 1px rgba(255,255,255,.045);
}
.tier-silver { --achievement-metal: #bfc7d2; --achievement-glow: rgba(191,199,210,.18); }
.tier-gold { --achievement-metal: #e2ad26; --achievement-glow: rgba(226,173,38,.22); }
.tier-platinum { --achievement-metal: #8fe1e7; --achievement-glow: rgba(143,225,231,.2); }
.achievement-emblem {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--achievement-metal) 70%, #fff 8%);
  border-radius: 50%;
  color: #0b0b0d;
  background: linear-gradient(145deg, color-mix(in srgb, var(--achievement-metal) 72%, #fff), var(--achievement-metal));
  box-shadow: 0 0 0 5px var(--achievement-glow), 0 12px 28px rgba(0,0,0,.28);
  font-size: 1.65rem;
}
.achievement-card > div,
.admin-achievement-copy { min-width: 0; display: grid; gap: 4px; }
.achievement-card small,
.admin-achievement-copy > span { color: var(--achievement-metal); font-size: .6rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.achievement-card strong,
.admin-achievement-copy strong { font-size: .92rem; }
.achievement-card p,
.admin-achievement-copy p { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.achievement-empty { grid-column: 1/-1; }

.admin-achievements-panel { margin-top: 20px; padding: 24px; }
.achievement-create-form { display: grid; gap: 18px; }
.achievement-fields { display: grid; grid-template-columns: minmax(220px,1fr) 150px 110px; gap: 12px; }
.achievement-fields label { display: grid; gap: 7px; color: var(--muted); font-size: .68rem; font-weight: 800; }
.achievement-fields input,
.achievement-fields select,
.achievement-fields textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #0c0d10; font: inherit; }
.achievement-description-field { grid-column: 1/-1; }
.achievement-fields textarea { min-height: 84px; resize: vertical; }
.achievement-member-picker { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.achievement-member-picker legend { padding: 0 8px; color: var(--gold-soft); font-size: .66rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.achievement-member-picker > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 8px; }
.achievement-member-option { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.025); cursor: pointer; }
.achievement-member-option:has(input:checked) { border-color: rgba(175,175,175,.48); background: rgba(175,175,175,.08); }
.achievement-member-option input { flex: 0 0 auto; width: 17px; height: 17px; accent-color: var(--interaction-strong); }
.achievement-member-option > span { min-width: 0; display: grid; }
.achievement-member-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.achievement-member-option small { color: var(--muted); font-size: .62rem; }
.achievement-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.achievement-submit-row .form-feedback { flex: 1; margin: 0; }
.admin-achievements-list { display: grid; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-achievement-card { grid-template-columns: 58px minmax(0,1fr) auto; }
.admin-achievement-card .achievement-emblem { width: 50px; height: 50px; font-size: 1.35rem; }
.admin-achievement-copy > small { color: #d8d9dd; font-size: .68rem; }
.admin-achievement-actions { display: flex; align-items: center; gap: 8px; }
.achievement-assignment-modal { width: min(620px,100%); }

@media (max-width: 760px) {
  .media-social-actions { gap: 12px; }
  .media-social-actions svg { width: 24px; height: 24px; }
  .achievement-showcase { grid-template-columns: 1fr; }
  .achievement-card { grid-template-columns: 54px minmax(0,1fr); padding: 13px; }
  .achievement-emblem { width: 50px; height: 50px; font-size: 1.4rem; }
  .admin-achievements-panel { padding: 16px 12px; }
  .achievement-fields { grid-template-columns: 1fr 1fr; }
  .achievement-fields label:first-child,
  .achievement-description-field { grid-column: 1/-1; }
  .achievement-member-picker > div { grid-template-columns: 1fr; }
  .achievement-submit-row { align-items: stretch; flex-direction: column; }
  .achievement-submit-row .primary-button { width: 100%; }
  .admin-achievement-card { grid-template-columns: 52px minmax(0,1fr); }
  .admin-achievement-actions { grid-column: 1/-1; justify-content: flex-end; }
}


/* ===== LOGIN AND USER SYSTEM ===== */
body:not(.authenticated) {
  overflow: hidden;
}

body:not(.authenticated) .sidebar,
body:not(.authenticated) .app,
body:not(.authenticated) .site-footer {
  visibility: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 20%, rgba(214,166,46,.12), transparent 28%),
    radial-gradient(circle at 88% 80%, rgba(214,166,46,.07), transparent 24%),
    #050506;
  opacity: 1;
  visibility: visible;
  transition: opacity .7s ease, visibility .7s ease;
}

.login-screen.login-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hidden, not removed: without this their loops keep ticking behind the app. */
.login-screen.login-hidden *, .page-loader.hidden * { animation-play-state: paused; }

html.auth-session-hint .login-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-background::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .12;
  background-image:
    linear-gradient(rgba(214,166,46,.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214,166,46,.2) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(circle at center, black, transparent 70%);
}

.login-orbit {
  position: absolute;
  border: 1px solid rgba(214,166,46,.12);
  border-radius: 50%;
  animation: loginOrbit 18s linear infinite;
}

.orbit-one {
  width: 500px;
  height: 500px;
  left: -190px;
  top: -180px;
}

.orbit-two {
  width: 360px;
  height: 360px;
  right: -120px;
  bottom: -100px;
  animation-direction: reverse;
  animation-duration: 13s;
}

.orbit-three {
  width: 680px;
  height: 680px;
  left: 52%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-style: dashed;
  opacity: .35;
  animation-duration: 35s;
}

@keyframes loginOrbit {
  to { transform: rotate(360deg); }
}

.login-shell {
  position: relative;
  width: min(1050px, 100%);
  min-height: 640px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  border: 1px solid rgba(214,166,46,.24);
  border-radius: 28px;
  background: rgba(10,10,12,.94);
  box-shadow: 0 50px 150px rgba(0,0,0,.72), 0 0 90px rgba(214,166,46,.05);
  backdrop-filter: blur(28px);
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(130deg, rgba(243,210,122,.55), transparent 22%, transparent 72%, rgba(214,166,46,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 55px;
  overflow: hidden;
  border-right: 1px solid rgba(214,166,46,.14);
  background:
    radial-gradient(circle at 52% 38%, rgba(214,166,46,.13), transparent 28%),
    linear-gradient(145deg, #111114, #080809);
}

.login-brand-panel::after {
  content: "RULES";
  position: absolute;
  left: -12px;
  bottom: -43px;
  color: transparent;
  font-family: "Anton";
  font-size: 150px;
  letter-spacing: 5px;
  -webkit-text-stroke: 1px rgba(214,166,46,.08);
}

.login-seal {
  position: relative;
  z-index: 2;
  width: 230px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px #0c0c0e, inset 0 0 0 11px rgba(214,166,46,.25), 0 0 70px rgba(214,166,46,.1);
  animation: loginSealFloat 5s ease-in-out infinite;
}

.login-seal::before {
  content: "";
  position: absolute;
  inset: -18px;
  border: 1px dashed rgba(214,166,46,.22);
  border-radius: inherit;
  animation: spin 30s linear infinite;
}

.login-seal span,
.login-seal small {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 3px;
}

.login-seal strong {
  color: var(--gold);
  font-family: "Anton";
  font-size: 74px;
  line-height: 1;
}

.login-seal small {
  color: var(--muted);
}

@keyframes loginSealFloat {
  50% { transform: translateY(-9px); }
}

.login-brand-copy {
  position: relative;
  z-index: 2;
}

.login-brand-copy h2 {
  margin: 12px 0;
  font-family: "Anton";
  font-size: clamp(47px, 5vw, 70px);
  line-height: .92;
  font-weight: 400;
}

.login-brand-copy h2 em {
  color: transparent;
  font-style: normal;
  background: linear-gradient(130deg, #f4da88, #a66f0e);
  -webkit-background-clip: text;
}

.login-brand-copy p {
  max-width: 380px;
  color: var(--muted);
  line-height: 1.65;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: 55px;
  background: rgba(5,5,6,.6);
}

.login-form {
  width: min(390px, 100%);
}

.login-form h1 {
  margin: 8px 0 7px;
  font-family: "Anton";
  font-size: 42px;
  font-weight: 400;
}

.login-subtitle {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-form > label {
  display: block;
  margin-bottom: 18px;
}

.login-form > label > span {
  display: block;
  margin-bottom: 9px;
  color: #d8d4c9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
}

.login-form input {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(214,166,46,.17);
  border-radius: 11px;
  padding: 0 15px;
  outline: none;
  background: rgba(255,255,255,.025);
  color: var(--text);
  transition: .2s;
}

.login-form input:focus {
  border-color: rgba(168,168,168,.62);
  box-shadow: 0 0 0 4px rgba(168,168,168,.06), 0 15px 35px rgba(0,0,0,.22);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 37px;
  height: 37px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gold);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 5px 0 20px;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.persistent-session-label {
  color: var(--muted);
  font-size: 11px;
}

.remember-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--interaction-strong);
}

.secure-label {
  color: rgba(214,166,46,.65);
  font-size: 9px;
  font-weight: 700;
}

.login-error {
  min-height: 19px;
  margin-bottom: 7px;
  color: #ff8686;
  font-size: 11px;
  font-weight: 700;
}

.login-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 11px;
  padding: 0 19px;
  color: #171208;
  background: linear-gradient(135deg, #f2d77d, #ae7410);
  box-shadow: 0 15px 42px rgba(214,166,46,.14);
  font-weight: 900;
  transition: .25s;
}

@media (hover: hover) and (pointer: fine) { .login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 21px 48px rgba(168,168,168,.21);
} }

.demo-access {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid rgba(214,166,46,.12);
  border-radius: 10px;
  background: rgba(214,166,46,.035);
}

.demo-access strong,
.demo-access span {
  display: block;
}

.demo-access strong {
  color: #d8d4ca;
  font-size: 10px;
  letter-spacing: .5px;
}

.demo-access span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.demo-access b {
  color: var(--gold-soft);
}

.login-shake {
  animation: loginShake .4s ease;
}

@keyframes loginShake {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.user-menu-wrap {
  position: relative;
}

.notifications-wrap { position: relative; }
.notification-button { position: relative; }
.notification-count {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #08080a;
  border-radius: 99px;
  color: #050506;
  background: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}
.notification-count[hidden] { display: none; }
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 13px);
  right: 0;
  width: min(390px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid rgba(214,166,46,.22);
  border-radius: 16px;
  background: rgba(10,10,12,.985);
  box-shadow: 0 28px 75px rgba(0,0,0,.62);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: .2s;
}
.notifications-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.notifications-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}
.notifications-heading > div { display: grid; gap: 4px; }
.notifications-heading > strong { font-size: .95rem; }
.notifications-heading button {
  border: 0;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  font-size: .68rem;
  font-weight: 800;
}
.notifications-heading button:disabled { opacity: .35; cursor: default; }
.notifications-heading-actions { display: flex !important; align-items: center; gap: 10px; }
.notifications-heading-actions button.danger { color: #ff8e8e; }
.notifications-list {
  max-height: min(520px, 68vh);
  overflow-y: auto;
}
.push-notification-settings { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: rgba(214,166,46,.06); }
.push-notification-settings > div { min-width: 0; display: grid; gap: 3px; }
.push-notification-settings strong { font-size: 12px; }
.push-notification-settings small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.push-notification-settings button { flex: 0 0 auto; padding: 8px 11px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; background: #0a0a0c; color: #fff; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
.push-notification-settings button.enabled { border-color: #4ac782; color: #7ee8aa; }
.push-notification-settings button:disabled { opacity: .55; cursor: wait; }
.notification-item {
  position: relative;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.notification-open {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 8px;
  align-items: start;
  gap: 11px;
  padding: 14px 44px 14px 15px;
  border: 0;
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .notification-item:hover { background: rgba(168,168,168,.06); } }
.notification-item.unread { background: rgba(214,166,46,.09); }
.notification-open > span { display: grid; gap: 4px; min-width: 0; }
.notification-open strong { line-height: 1.35; font-size: .76rem; }
.notification-open small {
  overflow: hidden;
  color: var(--muted);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notification-open time { color: #858178; font-size: .62rem; }
.notification-open > i {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(214,166,46,.1);
}
.notification-delete {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  color: #aaa;
  background: rgba(0,0,0,.28);
  transform: translateY(-50%);
  font-size: 18px;
  line-height: 1;
}
@media (hover: hover) and (pointer: fine) { .notification-delete:hover { color: #fff; border-color: #ff8e8e; background: rgba(130,25,25,.38); } }

@media (max-width: 760px) {
  .notifications-heading { align-items: flex-start; padding: 15px 14px; }
  .notifications-heading-actions { gap: 6px; }
  .notifications-heading-actions button { padding: 6px 4px; font-size: .62rem; }
  .notification-open { padding: 13px 44px 13px 12px; }
  .notification-delete { right: 8px; width: 30px; height: 30px; }
}

.profile-button b {
  color: var(--gold);
  font-size: 11px;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 175px;
  padding: 7px;
  border: 1px solid rgba(214,166,46,.18);
  border-radius: 11px;
  background: rgba(10,10,12,.98);
  box-shadow: 0 25px 65px rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-7px);
  transition: .2s;
}

.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown button {
  width: 100%;
  min-height: 39px;
  border: 0;
  border-radius: 7px;
  padding: 0 11px;
  text-align: left;
  color: var(--text);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

@media (hover: hover) and (pointer: fine) { .user-dropdown button:hover {
  background: rgba(168,168,168,.07);
} }

.user-dropdown .logout-option {
  color: #ff9292;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin-bottom: 20px;
}

.admin-stat-card {
  padding: 24px;
  border: 1px solid rgba(214,166,46,.15);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(17,17,20,.98), rgba(7,7,8,.98));
  box-shadow: 0 20px 55px rgba(0,0,0,.25);
}

.admin-stat-card span,
.admin-stat-card strong,
.admin-stat-card small {
  display: block;
}

.admin-stat-card span {
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.7px;
}

.admin-stat-card strong {
  margin-top: 10px;
  font-family: "Anton";
  font-size: 42px;
  font-weight: 400;
}

.admin-stat-card small {
  color: var(--muted);
  font-size: 10px;
}

.admin-badge {
  padding: 8px 11px;
  border: 1px solid rgba(214,166,46,.22);
  border-radius: 99px;
  color: var(--gold-soft);
  background: rgba(214,166,46,.05);
  font-size: 9px;
  font-weight: 800;
}

.superadmin-tools {
  display: none;
  margin-bottom: 20px;
  padding: 22px;
}

.superadmin-tools.visible {
  display: block;
}

.admin-create-user-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-top: 20px;
}

.admin-create-user-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.admin-create-user-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-2);
}

.text-button.danger {
  color: #ff9292;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-top: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table th {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(214,166,46,.14);
  color: var(--muted);
  text-align: left;
  font-size: 9px;
  letter-spacing: 1.4px;
}

.admin-table td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--border);
  color: #d4d1c8;
  font-size: 11px;
}

@media (hover: hover) and (pointer: fine) { .admin-table tr:hover td {
  background: rgba(168,168,168,.025);
} }

.admin-table code {
  color: var(--gold-soft);
  font-family: var(--ds-font);
  font-size: 10px;
}

.table-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 900px) {
  .admin-create-user-form {
    grid-template-columns: 1fr;
  }
}

.role-chip {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .6px;
}

.role-chip.admin {
  color: #171208;
  background: linear-gradient(135deg, #f2d77d, #a86f0d);
}

.role-chip.member {
  color: #cfcbc0;
  background: rgba(255,255,255,.06);
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.account-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58d77d;
  box-shadow: 0 0 10px rgba(88,215,125,.7);
}

.avatar.has-image,
.avatar-preview.has-image {
  overflow: hidden;
  padding: 0;
}

.avatar-fallback { display: none; }
.has-image > .avatar-fallback { display: grid; width: 100%; height: 100%; place-items: center; }
.has-image > .avatar-fallback + img { position: absolute; inset: 0; }
.has-image:has(> .avatar-fallback + img) { position: relative; }

.avatar img,
.avatar-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-visual.has-photo {
  background-size: cover;
  background-position: center;
}

.edit-profile-button {
  width: fit-content;
  margin-top: 28px;
}

.empty-state {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.empty-state strong {
  color: var(--text);
  font-size: 14px;
}

.empty-state span {
  max-width: 420px;
  font-size: 12px;
}

.empty-state.compact {
  min-height: 120px;
  padding: 10px;
  font-size: 11px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.account-status.offline i {
  background: #777;
  box-shadow: none;
}

.news-toolbar,
.news-tabs,
.modal-heading,
.modal-actions {
  display: flex;
  align-items: center;
}

.news-toolbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.news-tabs {
  gap: 7px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.news-tab {
  min-width: 95px;
  padding: 11px 18px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.news-tab.active {
  color: #121212;
  background: var(--interaction-strong);
}

.news-status {
  min-height: 20px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.news-card {
  min-height: 235px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  transition: transform .2s, border-color .2s;
}

@media (hover: hover) and (pointer: fine) { .news-card:hover {
  transform: translateY(-4px);
  border-color: rgba(183,183,183,.55);
} }

.news-card.featured {
  grid-column: span 2;
  background:
    radial-gradient(circle at 85% 20%, rgba(214,166,46,.15), transparent 42%),
    linear-gradient(145deg, var(--surface), var(--surface-2));
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.news-card-meta span {
  color: var(--accent);
}

.news-card h3 {
  margin: 22px 0;
  font-family: "Anton";
  font-size: 26px;
  line-height: 1.18;
  font-weight: 400;
}

.news-card.featured h3 {
  max-width: 720px;
  font-size: clamp(31px, 4vw, 48px);
}

.news-card a {
  width: fit-content;
  margin-top: auto;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.74);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: .2s;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.profile-editor-modal {
  width: min(650px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(214,166,46,.23);
  border-radius: 20px;
  background: #0d0d10;
  box-shadow: 0 36px 100px rgba(0,0,0,.7);
  transform: translateY(14px);
  transition: .2s;
}

.modal-backdrop.open .profile-editor-modal {
  transform: translateY(0);
}

.modal-heading {
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-heading h2 {
  margin: 6px 0 0;
  font-family: "Anton";
  font-size: 36px;
  font-weight: 400;
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.profile-form > label,
.profile-form label > span,
.profile-form label > small {
  display: block;
}

.profile-form > label:nth-of-type(3),
.profile-form > label:nth-of-type(4),
.avatar-editor,
.form-feedback,
.modal-actions {
  grid-column: 1 / -1;
}

.profile-form label > span {
  margin-bottom: 8px;
  color: #d7d3c9;
  font-size: 10px;
  font-weight: 800;
}

.profile-form input,
.profile-form textarea,
.profile-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  background: var(--surface-3);
  outline: none;
  font: inherit;
}

.profile-form textarea {
  resize: vertical;
}

.profile-form input:focus,
.profile-form textarea:focus,
.profile-form select:focus {
  border-color: rgba(183,183,183,.65);
}

.profile-form label > small,
.avatar-editor small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.avatar-editor {
  display: grid;
  grid-template-columns: 72px auto;
  align-items: center;
  justify-content: start;
  gap: 8px 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.avatar-editor .avatar-preview {
  grid-row: span 2;
  width: 72px;
  height: 72px;
  font-size: 23px;
}

.avatar-cropper {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 1fr);
  align-items: center;
  gap: 22px;
  width: 100%;
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.avatar-cropper[hidden] {
  display: none;
}

.avatar-crop-stage {
  position: relative;
  width: min(240px, 100%);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid rgba(242,183,5,.7);
  background: #08080a;
  box-shadow: 0 0 0 7px rgba(242,183,5,.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-stage.dragging {
  cursor: grabbing;
}

.avatar-crop-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar-crop-guide {
  position: absolute;
  inset: 11%;
  border: 1px dashed rgba(255,255,255,.55);
  border-radius: 50%;
  pointer-events: none;
}

.avatar-crop-controls {
  display: grid;
  gap: 14px;
}

.avatar-crop-controls label {
  display: grid;
  gap: 9px;
}

.avatar-crop-controls label > span {
  color: #d7d3c9;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.avatar-crop-controls input[type="range"] {
  padding: 0;
  accent-color: var(--interaction-strong);
  cursor: pointer;
}

.avatar-crop-controls .text-button {
  width: fit-content;
}

.avatar-crop-controls small {
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 620px) {
  .avatar-cropper {
    grid-template-columns: 1fr;
  }

  .avatar-crop-stage {
    justify-self: center;
  }
}

@media (max-width: 760px) {
  #contenido .stories-strip {
    width: auto;
    margin: 0;
    padding: 3px 3px 10px;
    overflow-x: auto;
    scroll-snap-type: none;
  }
}

/* Prioridad final del editor inmersivo tras seleccionar archivo */
#mediaUploader.has-media .media-uploader-modal { overflow: hidden; }
#mediaUploader.has-media .profile-form {
  position: absolute;
  inset: 0;
  display: block;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
#mediaUploader.has-media .media-cropper {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}
#mediaUploader.has-media .media-crop-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100dvh;
  padding: 0;
}
#mediaUploader.has-media .media-crop-stage canvas {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}
@media (max-width: 760px) {
  #mediaUploader.has-media .media-crop-controls {
    position: absolute;
    z-index: 7;
    left: 10px;
    right: 10px;
    bottom: 78px;
    width: auto;
    max-height: 42dvh;
    overflow-y: auto;
  }
}

/* Noticias plegables */
.news-intro-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 18px;
}
.news-intro-actions > p { margin: 0; }
.news-collapse-button {
  min-width: 154px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: var(--text);
  background: #09090b;
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
}
.news-collapse-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform .22s ease;
}
.home-news-section.is-collapsed .news-collapse-button svg { transform: rotate(-90deg); }
.news-collapsible[hidden] { display: none !important; }
.home-news-section.is-collapsed { padding-block: 22px; }

/* Tras elegir una foto, el editor pasa a ser la vista principal */
#mediaUploader.has-media .media-uploader-modal { overflow: hidden; }
#mediaUploader.has-media .profile-form {
  position: absolute;
  inset: 0;
  display: block;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
#mediaUploader.has-media .media-cropper {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}
#mediaUploader.has-media .media-crop-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100dvh;
  padding: 0;
}
#mediaUploader.has-media .media-crop-stage canvas {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

@media (max-width: 760px) {
  .news-intro-actions { width: 100%; align-items: stretch; flex-direction: column; gap: 13px; }
  .news-collapse-button { width: 100%; min-height: 46px; }
  .home-news-section.is-collapsed .section-intro { margin-bottom: 0; }
  #mediaUploader.has-media .media-crop-controls {
    position: absolute;
    z-index: 7;
    left: 10px;
    right: 10px;
    bottom: 78px;
    width: auto;
    max-height: 42dvh;
    overflow-y: auto;
  }
}

/* Editor final: controles superpuestos sobre la fotografía */
#mediaUploader .media-cropper { position: relative; display: block; }
#mediaUploader .media-crop-stage { height: 100dvh; width: 100%; padding: 0 12px; }
#mediaUploader .media-crop-controls {
  position: absolute; z-index: 6; right: 18px; bottom: 88px;
  width: min(430px, calc(100% - 36px)); height: auto; max-height: calc(100dvh - 100px);
  padding: 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 22px;
  background: rgba(12,12,15,.76); box-shadow: 0 20px 70px rgba(0,0,0,.48);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); overflow-y: auto;
}
#mediaUploader .media-customization-grid { grid-template-columns: 1fr; }
#mediaUploader .media-text-tool input { font-size: 17px; font-weight: 700; }
#mediaUploader .media-caption-tool textarea { min-height: 68px; resize: vertical; }
#mediaUploader.has-media .modal-actions { right: 18px; bottom: 14px; width: 430px; transform: none; }
#mediaUploader.has-media .form-feedback { right: 24px; bottom: 74px; width: 418px; }
@media (max-width: 760px) {
  #mediaUploader .media-cropper { display: block; height: 100dvh; overflow: hidden; }
  #mediaUploader .media-crop-stage { position: absolute; inset: 0; height: 100dvh; }
  #mediaUploader .media-crop-controls { position: absolute; left: 8px; right: 8px; bottom: 76px; width: auto; max-height: 44dvh; padding: 14px; border-radius: 20px; overflow-y: auto; }
  #mediaUploader .media-crop-controls .media-original-toggle,
  #mediaUploader .media-crop-controls > small { display: none !important; }
  #mediaUploader.has-media .modal-actions { left: 8px; right: 8px; bottom: 8px; width: auto; transform: none; }
  #mediaUploader.has-media .form-feedback { left: 14px; right: 14px; bottom: 68px; width: auto; }
}

.file-button {
  width: fit-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.form-feedback {
  min-height: 18px;
  color: #ff9d9d;
  font-size: 11px;
}

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

@media (max-width: 850px) {
  .news-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .news-grid,
  .profile-form {
    grid-template-columns: 1fr;
  }

  .news-card.featured,
  .profile-form > label,
  .profile-form > label:nth-of-type(3),
  .profile-form > label:nth-of-type(4) {
    grid-column: auto;
  }

  .news-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .news-tabs {
    width: 100%;
  }

  .news-tab {
    flex: 1;
  }

  .profile-editor-modal {
    padding: 22px;
  }
}

@media (max-width: 850px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 280px;
    padding: 32px;
    border-right: 0;
    border-bottom: 1px solid rgba(214,166,46,.14);
  }

  .login-seal {
    width: 135px;
  }

  .login-seal strong {
    font-size: 44px;
  }

  .login-brand-copy h2 {
    font-size: 42px;
  }

  .login-form-panel {
    padding: 38px 28px;
  }

  .admin-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .login-brand-panel {
    min-height: 235px;
  }

  .login-brand-copy p,
  .login-seal span,
  .login-seal small {
    display: none;
  }

  .login-seal {
    width: 95px;
  }

  .login-seal strong {
    font-size: 38px;
  }

  .login-brand-copy h2 {
    font-size: 35px;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Historias, publicaciones de perfil y adjuntos */
.profile-feed { margin-top: 28px; }
.profile-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.profile-feed-heading,
.moments-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

#contenido {
  --story-accent: #f0b94e;
}

.moments-hero {
  position: relative;
  min-height: 280px;
  align-items: center;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(240,185,78,.2);
  border-radius: 30px;
  background:
    radial-gradient(circle at 84% 20%, rgba(240,185,78,.2), transparent 26%),
    radial-gradient(circle at 72% 110%, rgba(128,67,194,.2), transparent 38%),
    linear-gradient(135deg, #19130d 0%, #101013 52%, #17101c 100%);
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}

.moments-hero::before,
.moments-hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  pointer-events: none;
}

.moments-hero::before {
  width: 250px;
  height: 250px;
  top: -115px;
  right: -45px;
}

.moments-hero::after {
  width: 140px;
  height: 140px;
  right: 145px;
  bottom: -85px;
}

.moments-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.moments-hero h2 {
  margin: 10px 0 16px;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: .93;
}

.moments-hero h2 em {
  color: var(--story-accent);
  font-style: normal;
}

.moments-hero-copy > p {
  max-width: 540px;
  margin: 0;
  color: #bdb8ae;
  line-height: 1.7;
}

.moments-hero-mark {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: clamp(118px, 14vw, 165px);
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid rgba(240,185,78,.36);
  border-radius: 50%;
  background: rgba(5,5,7,.42);
  box-shadow: inset 0 0 35px rgba(240,185,78,.08), 0 18px 50px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
}

.moments-hero-mark span {
  font-family: var(--display);
  color: var(--story-accent);
  font-size: clamp(3.4rem, 7vw, 5.2rem);
  line-height: .8;
}

.moments-hero-mark small {
  margin-top: 10px;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .3em;
}

.moments-toolbar {
  margin-top: 24px;
  padding: 0 4px;
}

.moments-add-button {
  min-height: 48px;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(240,185,78,.16);
}

.moments-add-button span {
  margin-right: 5px;
  font-size: 1.2rem;
}

.moments-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.moments-status:not(:empty)::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #74d99f;
  box-shadow: 0 0 0 5px rgba(116,217,159,.1);
}
.profile-feed-heading h3 {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}
.profile-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.profile-post-card,
.story-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
}
.profile-post-card .media-frame { aspect-ratio: 1; }
.story-card .media-frame {
  aspect-ratio: 9 / 14;
  display: grid;
  place-items: center;
}

.moments-grid {
  gap: clamp(14px, 2vw, 24px);
}

.story-card {
  border-color: rgba(255,255,255,.12);
  border-radius: 24px;
  background: linear-gradient(160deg, #18181c, #0d0d0f);
  box-shadow: 0 22px 55px rgba(0,0,0,.24);
  transform: translateY(0);
  transition: transform .32s ease, border-color .32s ease, box-shadow .32s ease;
}

@media (hover: hover) and (pointer: fine) { .story-card:hover {
  transform: translateY(-7px);
  border-color: rgba(189,189,189,.42);
  box-shadow: 0 30px 65px rgba(0,0,0,.38);
} }

.story-card .media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 14;
  background:
    radial-gradient(circle at 50% 30%, rgba(240,185,78,.09), transparent 40%),
    #09090b;
}

.story-card .media-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0,0,0,.46));
}

.story-card .media-view-button img {
  transition: transform .7s cubic-bezier(.2,.75,.25,1), filter .35s ease;
}

@media (hover: hover) and (pointer: fine) { .story-card:hover .media-view-button img {
  transform: scale(1.035);
} }

.story-progress {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 12px;
  right: 12px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.3);
  pointer-events: none;
}

.story-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transform-origin: left;
  animation: story-progress-in .7s calc(var(--story-index) * 70ms) both;
}

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

.story-card .media-card-info {
  position: relative;
  padding: 16px 17px 18px;
}

.story-card .media-author strong {
  font-size: .85rem;
}

.story-card .avatar.tiny {
  width: 34px;
  height: 34px;
  border: 2px solid var(--story-accent);
  box-shadow: 0 0 0 3px rgba(240,185,78,.12);
}

.story-card .media-card-info p {
  margin: 13px 0 9px;
  color: #ece9e2;
  font-size: .88rem;
}

.story-card .media-card-info time {
  display: inline-block;
  margin-top: 9px;
  color: #918d86;
  font-size: .69rem;
  font-weight: 700;
}
.media-frame { width: 100%; background: #09090b; }
.media-view-button {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: #fff;
  background: #09090b;
  cursor: zoom-in;
}
.media-view-button span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 99px;
  background: rgba(0,0,0,.68);
  opacity: 0;
  transform: translateY(4px);
  transition: .2s;
  font-size: 10px;
  font-weight: 800;
}
.media-view-button:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) { .media-view-button:hover span {
  opacity: 1;
  transform: translateY(0);
} }
.media-frame img,
.media-frame video,
.media-upload-preview img,
.media-upload-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.story-card .media-frame img,
.story-card .media-frame video {
  object-fit: contain;
}
.story-card .media-frame img {
  animation: moment-image-reveal .7s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes moment-image-reveal {
  from {
    opacity: 0;
    filter: blur(18px);
    transform: scale(1.035);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}
.media-card-info { padding: 14px; }
.media-card-info p { margin: 8px 0; line-height: 1.45; }
.media-card-info time { color: var(--muted); font-size: .75rem; }
.media-like-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: transform .2s ease, color .2s ease, border-color .2s ease, background .2s ease;
}
@media (hover: hover) and (pointer: fine) { .media-like-button:hover {
  transform: translateY(-1px);
  color: #ef6d7a;
  border-color: rgba(239,109,122,.45);
} }
.media-like-button span {
  color: #ef6d7a;
  font-size: 1.25rem;
  line-height: 1;
}
.media-like-button strong { font-size: .78rem; }
.media-like-button small {
  font-size: .68rem;
  font-weight: 800;
}
.media-like-button.liked {
  color: #fff;
  border-color: rgba(239,109,122,.55);
  background: rgba(239,109,122,.14);
}
.media-like-button:disabled { opacity: .55; cursor: wait; }
.story-card .media-like-button { margin-right: 8px; }
.media-share-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 99px;
  color: #fff;
  background: #050506;
  cursor: pointer;
  font: inherit;
}
@media (hover: hover) and (pointer: fine) { .media-share-button:hover { border-color: #fff; background: #111114; box-shadow: 0 0 14px rgba(255,255,255,.09); } }
.media-share-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.media-share-button small { font-size: .68rem; font-weight: 800; }
.shared-media-highlight { animation: sharedMediaHighlight 2.2s ease; }
@keyframes sharedMediaHighlight {
  0%, 35% { border-color: #fff; box-shadow: 0 0 0 2px #050506, 0 0 0 3px #fff, 0 0 32px rgba(255,255,255,.2); }
  100% { box-shadow: none; }
}
.media-author,
.message-author {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.media-author { display: flex; align-items: center; gap: 8px; }
.avatar.tiny { width: 28px; height: 28px; font-size: .7rem; }
.delete-media-button {
  float: right;
  border: 0;
  background: transparent;
  color: #d56f6f;
  cursor: pointer;
  font-size: .75rem;
}
.story-card .delete-media-button {
  float: none;
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(213,111,111,.35);
  border-radius: 8px;
  background: rgba(213,111,111,.08);
  font-weight: 800;
}
.story-card .moment-delete-button {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 8px 11px;
  border-color: rgba(255,255,255,.32);
  color: #fff;
  background: rgba(145,24,24,.9);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
}
.story-card .moment-delete-button span {
  font-size: .7rem;
  letter-spacing: .03em;
}
@media (hover: hover) and (pointer: fine) { .story-card .delete-media-button:hover {
  color: #fff;
  background: rgba(190,65,65,.72);
} }
.profile-empty,
.moments-empty { grid-column: 1 / -1; min-height: 260px; }
.moments-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.story-card .media-frame img,
.story-card .media-frame video {
  object-fit: contain !important;
  object-position: center;
}

.chat-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.025);
}
.chat-type-tabs button {
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.chat-type-tabs button.active { color: #111; background: var(--interaction-strong); }

.content-type-tabs {
  position: sticky;
  z-index: 20;
  top: 82px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  max-width: 560px;
  margin: 0 auto 24px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10,10,12,.88);
  backdrop-filter: blur(14px);
}
.content-type-tabs button {
  padding: 12px 16px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}
.content-type-tabs button.active { color: #111; background: var(--interaction-strong); }
[data-content-panel][hidden] { display: none !important; }

.publications-toolbar { display: flex; justify-content: flex-end; margin: -8px 0 22px; }
.publications-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.publications-feed .profile-post-card { border-radius: 18px; }
.publications-feed .profile-post-card .media-frame { aspect-ratio: 1; }
.publications-empty { grid-column: 1 / -1; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.story-card,
.profile-post-card,
.member-card,
.news-card,
.calendar-event-card {
  content-visibility: auto;
  contain-intrinsic-size: 320px 420px;
}
@media (max-width: 760px) {
  .content-type-tabs { top: 68px; margin-bottom: 18px; }
  .publications-feed { grid-template-columns: 1fr; gap: 16px; }
  @media (hover: hover) and (pointer: fine) { .story-card:hover { transform: none; } }
}
.attachment-preview {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}
.attachment-preview button {
  margin-left: 10px;
  border: 0;
  background: transparent;
  color: #d56f6f;
  cursor: pointer;
}
.message-image { display: block; max-width: 420px; margin-top: 10px; }
.message-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
}
.shared-message-media {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 13px;
  color: #fff;
  background: #050506;
  cursor: pointer;
}
.shared-message-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.68), transparent 48%);
  pointer-events: none;
}
.shared-message-media > span {
  position: absolute;
  right: 10px;
  bottom: 9px;
  z-index: 1;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 99px;
  color: #fff;
  background: rgba(0,0,0,.76);
  font-size: .65rem;
  font-weight: 900;
}
@media (hover: hover) and (pointer: fine) { .shared-message-media:hover { border-color: #fff; } }
.shared-message-video { display: block; width: min(100%, 420px); margin-top: 10px; }
.shared-message-video video { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; }
.message-video {
  display: block;
  width: min(100%, 420px);
  max-height: 420px;
  margin-top: 10px;
  border-radius: 12px;
  background: #000;
}
.share-media-modal { width: min(560px, 100%); border-color: rgba(255,255,255,.28); background: #050506; }
.share-media-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #050506;
}
.share-media-preview img,
.share-media-preview video {
  width: 100%;
  max-height: 320px;
  display: block;
  object-fit: contain;
}

@media (min-width: 761px) {
  body.sidebar-compact .sidebar { width: 84px; padding-inline: 13px; }
  body.sidebar-compact .app,
  body.sidebar-compact .site-footer { margin-left: 84px; }
}
.home-members-section,
.home-news-section {
  margin-top: 34px;
  scroll-margin-top: 110px;
}

.home-news-featured {
  margin-top: 28px;
  border-color: rgba(231, 177, 45, .36);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .035);
}
.home-members-section .members-grid { margin-top: 22px; }
.home-news-section {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.025);
}
.member-card[data-member-username="raul"].with-photo {
  background-size: auto 100%;
  background-repeat: no-repeat;
  background-position: center 18%;
  background-color: #15130f;
}
.stories-section {
  margin-bottom: 30px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.025);
}
.stories-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.stories-heading h3 { margin: 5px 0 0; font-family: "Anton"; font-size: 1.55rem; font-weight: 400; }
.stories-row { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.stories-strip {
  min-width: 0;
  display: flex !important;
  flex: 1;
  gap: 14px;
  overflow-x: auto;
  padding: 3px 3px 10px;
  scrollbar-width: thin;
}
.story-add-button,
.story-bubble {
  width: 78px;
  min-width: 78px;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.story-bubble .story-avatar-ring,
.story-bubble .avatar,
.story-bubble img { pointer-events: none; }
.story-add-button > span,
.story-avatar-ring {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #050506;
  border-radius: 50%;
  outline: 2px solid rgba(255,255,255,.75);
  background: #111114;
}
.story-add-button > span { color: #fff; font-size: 1.7rem; }
.story-avatar-ring { outline-color: var(--interaction-strong); }
.story-avatar-ring .avatar { width: 100%; height: 100%; border: 0; font-size: 1.1rem; }
.story-avatar-ring .avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-add-button small,
.story-bubble strong { max-width: 78px; overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.story-bubble-item { position: relative; flex: 0 0 78px; text-align: center; }
@media (hover: hover) and (pointer: fine) { .story-bubble:hover .story-avatar-ring, .story-add-button:hover > span { outline-color: #fff; transform: scale(1.025); } }
.story-bubble-delete {
  position: absolute;
  top: -3px;
  right: 2px;
  z-index: 2;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  color: #fff;
  background: #050506;
  font-size: .75rem;
}
.stories-empty { display: grid; gap: 4px; min-width: 150px; padding: 10px; color: var(--muted); font-size: .75rem; }
.stories-empty strong { color: var(--text); }
.publications-hero { margin-top: 0; }
.news-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.news-card-actions > a { margin-top: 0; }
.news-share-button { margin-top: 0; flex: 0 0 auto; }
.share-news-preview { display: grid; gap: 9px; padding: 20px; }
.share-news-preview span { color: var(--gold); font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.share-news-preview strong { line-height: 1.45; }
.share-news-preview small { color: var(--muted); }
.message-news-link {
  width: min(100%, 420px);
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 13px;
  color: #fff;
  background: #050506;
  text-align: left;
  text-decoration: none;
}
.message-news-link span { color: var(--gold); font-size: .62rem; font-weight: 900; letter-spacing: .1em; }
.message-news-link small { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .message-news-link:hover { border-color: #fff; } }
.media-viewer-dialog video { display: block; max-width: min(92vw, 1050px); max-height: 80vh; background: #000; }
.media-viewer-dialog video[hidden] { display: none; }
.media-viewer-dialog img[hidden] { display: none !important; }

@media (max-width: 760px) {
  .home-members-section,
  .home-news-section { margin-top: 24px; scroll-margin-top: 82px; }
  .home-news-section { padding: 20px 16px; border-radius: 19px; }
  .stories-section { margin-inline: -2px; padding: 17px 14px; }
  .stories-heading { align-items: flex-start; flex-direction: column; }
  .story-add-button,
  .story-bubble { width: 68px; min-width: 68px; }
  .story-add-button > span,
  .story-avatar-ring { width: 58px; height: 58px; }
  .story-bubble-item { flex-basis: 68px; }
  .news-card-actions { align-items: flex-start; flex-direction: column; }
  #contenido .stories-strip {
    width: auto;
    margin: 0;
    padding: 3px 3px 10px;
    overflow-x: auto;
  }
}

.message-file {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin-top: 10px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
.message-file > span { font-size: 1.5rem; }
.message-file > div { display: grid; }
.message-file small { color: var(--muted); }
.avatar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.danger-text { color: #d56f6f; }
.media-dropzone {
  display: grid !important;
  place-items: center;
  min-height: 150px;
  padding: 22px;
  text-align: center;
  border: 1px dashed var(--line);
  cursor: pointer;
}
.media-dropzone > span { font-size: 2rem; color: var(--gold); }
.media-upload-preview {
  max-height: 420px;
  overflow: hidden;
  border-radius: 12px;
}
.media-upload-preview:empty { display: none; }
.media-viewer {
  z-index: 2400;
  padding: 20px;
  background: rgba(0,0,0,.9);
}
.media-viewer-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  justify-items: center;
  gap: 12px;
  touch-action: none;
  transform: translateY(var(--story-drag-y, 0));
  opacity: var(--story-drag-opacity, 1);
}
.media-viewer-dialog.swiping-down { transition: none; }
.media-viewer-dialog.dismissed-down { transition: transform .18s ease-in, opacity .18s ease-in; }
.media-viewer-dialog:not(.swiping-down):not(.dismissed-down) { transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .2s ease; }
.media-viewer-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 100px);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.65);
  object-fit: contain;
}
.media-viewer.open .media-viewer-dialog img {
  animation: moment-viewer-reveal .55s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes moment-viewer-reveal {
  from {
    opacity: 0;
    filter: blur(22px);
    transform: scale(.975);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}
.media-viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.72);
  cursor: pointer;
  font-size: 25px;
}
.moment-options-button {
  position: absolute;
  top: 58px;
  right: 10px;
  z-index: 6;
  min-width: 42px;
  height: 42px;
  padding: 0 9px 5px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.78);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
}
.moment-options-button[hidden],
.moment-options-menu[hidden] { display: none !important; }
.moment-options-menu {
  position: absolute;
  z-index: 7;
  top: 106px;
  right: 10px;
  min-width: 170px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px;
  background: #111114;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.moment-options-menu button {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 9px;
  color: #ff7070;
  background: transparent;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .moment-options-menu button:hover { background: rgba(255,80,80,.12); } }
.media-viewer-caption {
  max-width: 680px;
  color: #eee;
  text-align: center;
  font-size: 12px;
}
.media-upload-preview img,
.media-upload-preview video {
  max-height: 420px;
  object-fit: contain;
  background: #09090b;
}
.media-cropper {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 270px) minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.media-cropper[hidden] { display: none; }
.media-crop-stage {
  position: relative;
  width: min(270px, 100%);
  aspect-ratio: 9 / 14;
  overflow: hidden;
  justify-self: center;
  border: 2px solid rgba(242,183,5,.65);
  border-radius: 14px;
  background: #08080a;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.media-crop-stage.is-square { aspect-ratio: 1; }
.media-crop-stage.dragging { cursor: grabbing; }
.media-crop-stage canvas { display: block; width: 100%; height: 100%; }
.media-crop-guide {
  position: absolute;
  inset: 7%;
  border: 1px dashed rgba(255,255,255,.55);
  border-radius: 10px;
  pointer-events: none;
}
.media-crop-controls { display: grid; gap: 15px; }
.media-crop-controls label { display: grid; gap: 9px; }
.media-crop-controls label > span {
  color: #d7d3c9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.media-crop-controls input[type="range"] { padding: 0; accent-color: var(--interaction-strong); cursor: pointer; }
.media-crop-controls .text-button { width: fit-content; }
.media-crop-controls small { color: var(--muted); line-height: 1.6; }
.media-customization-grid { display: grid; grid-template-columns: minmax(130px, .55fr) 1fr; gap: 12px; }
.media-customization-grid select,
.media-customization-grid input { width: 100%; }
.media-original-toggle { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.media-original-toggle input { width: 18px; height: 18px; accent-color: var(--interaction-strong); }
.media-reply-button,
.media-views-button { color: var(--text); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.media-reply-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.22); border-radius: 11px; background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025)); box-shadow: inset 0 1px rgba(255,255,255,.08); transition: .2s ease; }
@media (hover: hover) and (pointer: fine) { .media-reply-button:hover { border-color: var(--interaction-strong); background: rgba(168,168,168,.1); transform: translateY(-1px); } }
.media-reply-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.media-reply-button small { font: inherit; }
.media-views-button { border: 0; background: transparent; padding: 8px 4px; }
.media-views-button { color: var(--gold); }
@media (max-width: 620px) { .media-customization-grid { grid-template-columns: 1fr; } }

/* Editor multimedia inmersivo */
#mediaUploader { padding: 0; background: #050506; }
#mediaUploader .media-uploader-modal {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: #050506;
}
#mediaUploader .modal-heading { position: absolute; z-index: 8; inset: 0 0 auto; padding: 18px 24px; background: linear-gradient(#000b, transparent); pointer-events: none; }
#mediaUploader .modal-heading > * { pointer-events: auto; }
#mediaUploader .profile-form { min-height: 0; height: 100%; display: grid; align-content: center; padding: 72px 22px 22px; overflow: auto; }
#mediaUploader .media-dropzone { max-width: 620px; width: min(92vw, 620px); min-height: 52vh; margin: auto; justify-content: center; background: #0d0d10; }
#mediaUploader.has-media .media-dropzone,
#mediaUploader.has-media .media-upload-preview { display: none; }
#mediaUploader .media-cropper {
  width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0;
  grid-template-columns: minmax(0, 1fr) 360px; gap: 0; background: #050506;
}
#mediaUploader .media-crop-stage {
  width: 100%; height: calc(100dvh - 44px); max-height: none; aspect-ratio: auto !important;
  border: 0; border-radius: 0; background: #030304; display: grid; place-items: center;
}
#mediaUploader .media-crop-stage canvas { width: auto; height: 100%; max-width: 100%; object-fit: contain; }
#mediaUploader .media-crop-guide { display: none; }
#mediaUploader .media-crop-controls {
  height: 100%; max-height: 100dvh; align-content: start; overflow-y: auto; padding: 84px 22px 24px;
  background: rgba(15,15,18,.98); border-left: 1px solid var(--line);
}
#mediaUploader.has-media .modal-actions { position: fixed; z-index: 10; right: 20px; bottom: 18px; width: 320px; margin: 0; }
#mediaUploader.has-media .form-feedback { position: fixed; z-index: 10; right: 22px; bottom: 74px; width: 316px; }
.media-mention { width: fit-content; border: 0; border-radius: 999px; padding: 5px 9px; background: rgba(231,177,45,.13); color: var(--gold); font-weight: 800; cursor: pointer; }
@media (max-width: 760px) {
  #mediaUploader .media-cropper { grid-template-columns: 1fr; grid-template-rows: minmax(46dvh, 1fr) auto; overflow-y: auto; }
  #mediaUploader .media-crop-stage { height: 55dvh; position: sticky; top: 0; z-index: 2; }
  #mediaUploader .media-crop-controls { max-height: none; padding: 22px 16px 112px; border-left: 0; border-top: 1px solid var(--line); }
  #mediaUploader.has-media .modal-actions { left: 12px; right: 12px; bottom: 10px; width: auto; padding: 10px; border-radius: 16px; background: rgba(10,10,12,.94); backdrop-filter: blur(16px); }
  #mediaUploader.has-media .form-feedback { left: 20px; right: 20px; bottom: 82px; width: auto; }
}
@media (max-width: 620px) {
  .media-cropper { grid-template-columns: 1fr; }
  .media-crop-stage { width: min(230px, 100%); }
}
@media (max-width: 760px) {
  .topbar {
    gap: 9px;
    padding-inline: 12px;
  }
  .topbar > div:nth-child(2) { min-width: 0; }
  .topbar > div:nth-child(2) .eyebrow { display: none; }
  .topbar h1 {
    max-width: 32vw;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-actions { gap: 6px; }
  .top-actions > .icon-button,
  .top-actions .notification-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }
  .profile-button { padding: 0; }
  .profile-button b { display: none; }
  .notifications-dropdown {
    position: fixed;
    top: 70px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 82px);
  }
  .notifications-list { max-height: calc(100vh - 155px); }
  .profile-posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-feed-heading,
  .moments-toolbar { align-items: flex-start; flex-direction: column; }

  .moments-hero {
    min-height: 340px;
    align-items: flex-start;
    padding: 30px 24px 26px;
    border-radius: 24px;
  }

  .moments-hero h2 {
    font-size: clamp(2.65rem, 13vw, 4.2rem);
  }

  .moments-hero-mark {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 92px;
  }

  .moments-hero-mark span {
    font-size: 3.3rem;
  }

  .moments-hero-mark small {
    margin-top: 7px;
    font-size: .48rem;
  }

  .moments-toolbar {
    gap: 12px;
    margin: 18px 0;
  }

  .moments-add-button {
    width: 100%;
    justify-content: center;
  }

  #contenido .moments-grid {
    width: calc(100% + 20px);
    display: flex;
    gap: 14px;
    margin-right: -20px;
    padding: 4px 20px 24px 2px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  #contenido .moments-grid::-webkit-scrollbar {
    display: none;
  }

  #contenido .story-card {
    flex: 0 0 min(78vw, 310px);
    scroll-snap-align: start;
    border-radius: 22px;
  }

  #contenido .moments-empty {
    flex: 0 0 calc(100% - 20px);
    min-height: 230px;
  }
}

/* Búsqueda global */
.global-search {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  padding: 10vh 20px;
  background: rgba(5,5,7,.96);
}
.global-search.open { display: block; }
.search-box,
.search-results {
  width: min(720px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 28px 80px rgba(0,0,0,.55);
}
.search-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px 16px 0 0;
  border-bottom-color: rgba(242,183,5,.35);
}
.search-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: var(--surface-2);
  font: inherit;
  font-size: 1rem;
  padding: 11px 13px;
}
.search-box input:focus {
  border-color: var(--interaction-strong);
  box-shadow: 0 0 0 3px rgba(183,183,183,.12);
}
.search-box button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
}
.search-results {
  max-height: 62vh;
  overflow: auto;
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: var(--surface);
}
.search-result {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.search-result:focus-visible { background: var(--surface-2); outline: none; }

@media (hover: hover) and (pointer: fine) { .search-result:hover { background: var(--surface-2); outline: none; } }
.search-result span { grid-row: 1 / 3; color: var(--accent); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.search-result small { color: var(--muted); }
.search-result b { grid-column: 3; grid-row: 1 / 3; align-self: center; color: var(--accent); font-size: 1.15rem; }

body.light .global-search { background: rgba(235,232,223,.97); }

/* Mensajes privados */
.private-chat-layout {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(0, 1.6fr);
  gap: 18px;
}
.chat-back-button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255,255,255,.045);
  cursor: pointer;
  font-size: 1.35rem;
  transition: border-color .2s, background .2s, transform .2s;
}
@media (hover: hover) and (pointer: fine) { .chat-back-button:hover {
  border-color: var(--interaction-strong);
  background: rgba(168,168,168,.12);
  transform: translateX(-2px);
} }
.chat-header-main,
.private-contacts-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}
.private-contacts-heading { justify-content: flex-start; }

/* Vista inmersiva de chats */
body.chat-focus {
  height: var(--chat-viewport-height, 100dvh);
  padding: 0;
  overflow: hidden;
}
body.chat-focus .sidebar,
body.chat-focus .topbar,
body.chat-focus .site-footer {
  display: none;
}
body.chat-focus .app {
  height: var(--chat-viewport-height, 100dvh);
  min-height: 0;
  margin-left: 0;
}
body.chat-focus #chat.active,
body.chat-focus #privados.active {
  height: var(--chat-viewport-height, 100dvh);
  padding: 0;
}
body.chat-focus #chat .chat-layout,
body.chat-focus #privados .private-chat-layout {
  height: 100%;
  gap: 0;
}
body.chat-focus #chat .chat-layout { grid-template-columns: minmax(0, 1fr); }
body.chat-focus #chat .chat-panel,
body.chat-focus #privados .private-contacts,
body.chat-focus #privados .private-conversation {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
}
body.chat-focus #chat .chat-header { order: 1; }
body.chat-focus #chat .chat-channel-bar { order: 2; }
body.chat-focus #chat .messages { order: 3; }
body.chat-focus #chat .message-form { order: 4; }
body.chat-focus #chat .attachment-preview { order: 5; }
body.chat-focus #privados .private-conversation {
  display: flex;
  flex-direction: column;
}
body.chat-focus #chat .online-panel { display: none; }
body.chat-focus #chat .messages,
body.chat-focus #privados .messages {
  min-height: 0;
  max-height: none;
}
body.chat-focus #privados .private-contacts { border-right: 1px solid var(--line); }
@media (max-width: 760px) {
  body.chat-focus .app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateY(var(--chat-viewport-offset, 0px));
  }
}
.private-contacts { padding: 0; overflow: hidden; }
.private-contacts .panel-heading { padding: 22px; }
#privateContacts { display: grid; gap: 9px; padding: 0 12px 14px; }
.private-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  color: var(--text);
  text-align: left;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  cursor: pointer;
  min-height: 69px;
  overflow: hidden;
}
.private-contact .avatar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  min-height: 42px;
  max-height: 42px;
  overflow: hidden;
}
.private-contact .avatar img {
  width: 42px;
  height: 42px;
  max-width: 42px;
  object-fit: cover;
}
@media (hover: hover) and (pointer: fine) { .private-contact:hover { border-color: rgba(168,168,168,.4); background: rgba(168,168,168,.07); } }
.private-contact.active { border-color: var(--interaction-strong); background: linear-gradient(135deg, rgba(168,168,168,.2), rgba(168,168,168,.06)); box-shadow: inset 3px 0 var(--interaction-strong), 0 8px 22px rgba(0,0,0,.18); }
.private-contact > span { flex: 1 1 auto; min-width: 0; display: grid; gap: 5px; overflow: hidden; }
.private-contact-copy > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.private-contact-copy time { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 700; }
.private-contact small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.private-contact.active small { color: rgba(255,255,255,.78); }

.media-viewer,
.media-viewer-dialog,
.media-viewer-dialog * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.media-viewer-dialog img { -webkit-user-drag: none; user-drag: none; }

.compact-dialog { width: min(92vw, 560px); }
.reply-context { display: grid; grid-template-columns: 68px 1fr; align-items: center; gap: 14px; padding: 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.035); }
.reply-context img { width: 68px; height: 68px; object-fit: cover; border-radius: 10px; }
.reply-context div { min-width: 0; display: grid; gap: 5px; }
.reply-context small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-intro { margin: 0; padding: 14px 16px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: rgba(214,166,46,.08); color: var(--muted); line-height: 1.55; }

/* Centro de ayuda independiente */
.admin-heading-actions { max-width: 560px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.admin-heading-actions p { margin: 0; }
.help-center-layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.help-requests-panel,
.help-conversation-panel { min-height: 660px; overflow: hidden; }
.help-requests-panel { display: flex; flex-direction: column; padding: 0; }
.help-create-form { display: grid; gap: 14px; padding: 24px; border-bottom: 1px solid var(--line); background: linear-gradient(145deg, rgba(214,166,46,.09), transparent 60%); }
.help-create-form .panel-heading { margin: 0; }
.help-create-form h3,
.help-inbox-heading h3,
.help-conversation-header h3 { margin: 4px 0 0; }
.help-create-form label { display: grid; gap: 7px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.help-create-form select,
.help-create-form textarea,
.help-reply-form textarea,
.help-admin-status select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #09090b;
  font: inherit;
  outline: none;
}
.help-create-form select,
.help-admin-status select { min-height: 44px; padding: 0 12px; }
.help-create-form textarea,
.help-reply-form textarea { resize: vertical; padding: 13px 14px; line-height: 1.5; }
.help-create-form select:focus,
.help-create-form textarea:focus,
.help-reply-form textarea:focus,
.help-admin-status select:focus { border-color: var(--interaction-strong); box-shadow: 0 0 0 3px rgba(168,168,168,.11); }
.help-inbox-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 22px 12px; }
.help-request-count { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #171208; background: var(--accent); font-size: .75rem; font-weight: 900; }
.help-status-tabs { display: grid; grid-template-columns: repeat(5, minmax(max-content, 1fr)); gap: 5px; margin: 0 18px 14px; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #08080a; }
.help-status-tabs button { min-height: 36px; padding: 7px 9px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font: inherit; font-size: .66rem; font-weight: 800; white-space: nowrap; }
.help-status-tabs button.active { color: #121212; background: var(--interaction-strong); }
.help-request-list { min-height: 0; display: grid; align-content: start; gap: 8px; padding: 0 14px 18px; overflow-y: auto; }
.help-request-card { width: 100%; display: grid; gap: 7px; padding: 14px; border: 1px solid transparent; border-radius: 13px; color: var(--text); background: rgba(255,255,255,.035); text-align: left; font: inherit; }
@media (hover: hover) and (pointer: fine) { .help-request-card:hover { border-color: rgba(168,168,168,.35); background: rgba(168,168,168,.07); } }
.help-request-card.active { border-color: var(--interaction-strong); background: rgba(168,168,168,.12); box-shadow: inset 3px 0 var(--interaction-strong); }
.help-request-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.help-request-card b { font-size: .72rem; }
.help-request-card > strong { font-size: .82rem; }
.help-request-card small { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.help-request-card time { color: var(--muted); font-size: .62rem; }
.help-status-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 5px 9px; border: 1px solid currentColor; border-radius: 999px; font-size: .62rem; font-style: normal; font-weight: 900; white-space: nowrap; }
.help-status-badge.new { color: #f0b937; background: rgba(240,185,55,.08); }
.help-status-badge.in-progress { color: #63a7ff; background: rgba(99,167,255,.08); }
.help-status-badge.answered { color: #57d98b; background: rgba(87,217,139,.08); }
.help-status-badge.closed { color: #b8bac1; background: rgba(184,186,193,.08); }
.help-conversation-panel { display: grid; padding: 0; background: radial-gradient(circle at 80% 0, rgba(214,166,46,.08), transparent 34%), var(--surface); }
.help-conversation-empty { place-self: center; display: grid; gap: 8px; padding: 28px; color: var(--muted); text-align: center; }
.help-conversation-empty strong { color: var(--text); font-size: 1.05rem; }
.help-conversation { min-height: 0; display: grid; grid-template-rows: auto minmax(260px, 1fr) auto auto; }
.help-conversation[hidden] { display: none; }
.help-conversation-header { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 22px; border-bottom: 1px solid var(--line); background: rgba(5,5,7,.78); }
.help-conversation-header small { display: block; margin-top: 4px; color: var(--muted); }
.help-admin-status { min-width: 150px; display: grid; gap: 5px; color: var(--muted); font-size: .65rem; font-weight: 800; }
.help-admin-status[hidden],
.help-status-badge[hidden] { display: none; }
.help-admin-status.locked select { color: #8e9097; cursor: not-allowed; opacity: .72; }
.help-message-list { min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 22px; overflow-y: auto; }
.help-message { max-width: min(78%, 680px); display: flex; align-items: flex-end; gap: 9px; }
.help-message.own { align-self: flex-end; flex-direction: row-reverse; }
.help-message > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; background: #101013; }
.help-message.own > div { border-color: rgba(214,166,46,.3); border-radius: 15px 15px 4px; background: rgba(214,166,46,.14); }
.help-message.from-admin:not(.own) > div { border-color: rgba(87,217,139,.28); }
.help-message > div > span { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.help-message strong { font-size: .7rem; }
.help-message time { color: var(--muted); font-size: .58rem; white-space: nowrap; }
.help-message p { margin: 7px 0 0; overflow-wrap: anywhere; font-size: .84rem; line-height: 1.55; }
.help-reply-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line); background: #09090b; }
.help-reply-form[hidden] { display: none; }
.help-reply-form textarea { min-height: 48px; max-height: 140px; resize: none; }
.help-reply-form + .form-feedback { min-height: 0; margin: 0; padding: 0 20px 12px; background: #09090b; }
.help-closed-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 18px 18px;
  padding: 14px 16px;
  border: 1px solid rgba(184,186,193,.24);
  border-radius: 15px;
  color: #d7d8dc;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
}
.help-closed-notice[hidden] { display: none; }
.help-closed-notice > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; border: 1px solid #747780; border-radius: 50%; }
.help-closed-notice > div { display: grid; gap: 3px; }
.help-closed-notice strong { font-size: .78rem; }
.help-closed-notice small { color: #8f9199; font-size: .68rem; line-height: 1.4; }

@media (max-width: 900px) {
  .help-center-layout { grid-template-columns: 1fr; }
  .help-requests-panel,
  .help-conversation-panel { min-height: auto; }
  .help-request-list { max-height: 370px; }
  .help-conversation-panel { min-height: 560px; }
}

@media (max-width: 620px) {
  .compact-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 28px); }
  .media-reply-button { min-height: 40px; padding-inline: 12px; }
  .admin-heading-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .help-center-intro { align-items: flex-start; }
  .help-create-form { padding: 19px 16px; }
  .help-status-tabs { grid-template-columns: repeat(5, max-content); }
  .help-conversation-panel { min-height: 520px; }
  .help-conversation-header { align-items: flex-start; flex-direction: column; padding: 16px; }
  .help-admin-status { width: 100%; }
  .help-message-list { padding: 16px 12px; }
  .help-message { max-width: 92%; }
  .help-message .avatar { display: none; }
  .help-reply-form { grid-template-columns: 1fr; padding: 12px; }
  .help-reply-form button { width: 100%; }
}
.private-conversation { padding: 0; overflow: hidden; }
.private-conversation .chat-header {
  position: relative;
  isolation: isolate;
  min-height: 104px;
  padding: 16px 20px;
  overflow: hidden;
}
.private-conversation .chat-header.has-country-flag::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5,5,7,.44), rgba(5,5,7,.62)),
    linear-gradient(0deg, rgba(5,5,7,.32), rgba(5,5,7,.12));
  pointer-events: none;
}
.private-chat-header-flag {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: -2;
  width: 31%;
  font-size: 148px;
  line-height: 1;
  text-align: left;
  filter: saturate(1.14) contrast(1.04);
  transform: translateY(-50%) scaleX(3.25) scaleY(1.3);
  transform-origin: left center;
  pointer-events: none;
}
.private-chat-person { display: flex; align-items: center; gap: 15px; }
.private-chat-person h3 { margin: 3px 0 0; }
.private-chat-avatar {
  position: relative;
  isolation: isolate;
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(214,166,46,.28);
  border-radius: 18px;
  background: rgba(8,8,10,.42);
  backdrop-filter: blur(3px);
  box-shadow: 0 9px 24px rgba(0,0,0,.3);
}
.private-chat-avatar .avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border: 2px solid rgba(255,255,255,.82);
  box-shadow: 0 5px 18px rgba(0,0,0,.5);
}
.private-chat-person,
.private-conversation .chat-header > .text-button {
  position: relative;
  z-index: 1;
}
.private-conversation .chat-header.has-country-flag .eyebrow,
.private-conversation .chat-header.has-country-flag h3,
.private-conversation .chat-header.has-country-flag > .text-button {
  text-shadow: 0 2px 9px rgba(0,0,0,.88);
}
.private-chat-avatar .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.private-message.own { margin-left: 16%; }
.private-message.own > div:last-child { background: rgba(214,166,46,.13); }

/* Bocadillos y acciones de mensajes */
.message-bubble {
  position: relative;
  justify-self: start;
  width: fit-content;
  max-width: min(76%, 680px);
  padding: 11px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 5px 17px 17px 17px;
  background: var(--surface-2);
  box-shadow: 0 7px 22px rgba(0,0,0,.16);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, transform .2s, background .2s;
}
.message.own .message-bubble {
  justify-self: end;
  border-color: rgba(214,166,46,.28);
  border-radius: 17px 5px 17px 17px;
  background: rgba(214,166,46,.12);
}
.message-bubble.actions-open {
  border-color: rgba(168,168,168,.5);
}

@media (hover: hover) and (pointer: fine) { .message-bubble:hover {
  border-color: rgba(168,168,168,.5);
} }
.message-bubble::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -7px;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.message.own .message-bubble::before {
  right: -7px;
  left: auto;
  border-top-color: rgba(214,166,46,.28);
  background: rgba(46,37,16,.95);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.message-bubble .message-head { margin-bottom: 5px; }
.message-bubble p,
.message.own .message-bubble p {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  border-radius: 0;
  text-align: left;
  overflow-wrap: anywhere;
}
.message-actions {
  max-height: 0;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-3px);
  transition: max-height .2s, margin-top .2s, opacity .2s, transform .2s;
}
.message-bubble.actions-open .message-actions {
  max-height: 42px;
  margin-top: 9px;
  opacity: 1;
  transform: translateY(0);
}
.message-actions button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,.045);
  cursor: pointer;
  font: inherit;
  font-size: .68rem;
  font-weight: 800;
}
@media (hover: hover) and (pointer: fine) { .message-actions button:hover { border-color: var(--interaction-strong); } }
.message-actions button.danger { color: #ef8d8d; }
@media (hover: hover) and (pointer: fine) { .message-actions button.danger:hover {
  color: #fff;
  border-color: rgba(220,70,70,.65);
  background: rgba(170,35,35,.6);
} }

.admin-user-actions { display: flex; flex-wrap: wrap; gap: 5px 10px; min-width: 235px; }

.required-password-backdrop {
  z-index: 9500;
  background: rgba(3,3,4,.92);
  backdrop-filter: blur(16px);
}
.required-password-modal { width: min(520px, 100%); }
.required-password-intro {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}
.required-password-submit {
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 720px) {
  .message.own,
  .private-message.own { margin-left: 7%; }
  .message-bubble { max-width: 88%; }
  .chat-channel-bar { padding-inline: 12px; }
  .private-conversation .chat-header { min-height: 94px; padding: 13px 15px; }
  .private-chat-header-flag { font-size: 132px; transform: translateY(-50%) scaleX(3) scaleY(1.25); }
  .private-chat-avatar { flex-basis: 64px; width: 64px; height: 64px; border-radius: 15px; }
  .private-chat-avatar .avatar { width: 49px; height: 49px; min-width: 49px; min-height: 49px; }
  body.chat-focus #privados .private-chat-layout { display: block; }
  body.chat-focus #privados .private-contacts {
    display: block;
    max-height: none;
    overflow-y: auto;
    border-right: 0;
  }
  body.chat-focus #privados .private-conversation { display: none; }
  body.chat-focus #privados.conversation-open .private-contacts { display: none; }
  body.chat-focus #privados.conversation-open .private-conversation {
    display: flex;
    flex-direction: column;
  }
  .private-conversation-back { display: inline-grid; }
  body.chat-focus .message-form {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 721px) {
  .private-conversation-back { display: none; }
}

/* Calendario */
.calendar-toolbar,
.calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.calendar-toolbar { margin-bottom: 20px; }
.calendar-navigation h3 {
  min-width: 210px;
  margin: 0;
  text-align: center;
  text-transform: capitalize;
}
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, .7fr);
  gap: 18px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 14px;
}
.calendar-weekday {
  padding: 12px;
  color: var(--gold);
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
}
.calendar-day {
  min-height: 112px;
  padding: 9px;
  color: var(--text);
  text-align: left;
  border-top: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  font: inherit;
  transition: background .2s ease, box-shadow .2s ease;
}
.calendar-day:not(.outside):focus-visible {
  z-index: 1;
  outline: none;
  background: rgba(168,168,168,.09);
  box-shadow: inset 0 0 0 1px rgba(168,168,168,.28);
}

@media (hover: hover) and (pointer: fine) { .calendar-day:not(.outside):hover {
  z-index: 1;
  outline: none;
  background: rgba(168,168,168,.09);
  box-shadow: inset 0 0 0 1px rgba(168,168,168,.28);
} }
.calendar-day:nth-child(7n + 1) { border-left: 0; }
.calendar-day.outside { opacity: .25; }
.calendar-day > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 7px;
  font-size: .78rem;
}
.calendar-day.today > span { color: #111; background: var(--gold); border-radius: 50%; }
.calendar-event-pill {
  display: block;
  width: 100%;
  margin: 3px 0;
  padding: 4px 6px;
  overflow: hidden;
  color: var(--text);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 2px solid var(--gold);
  background: rgba(214,166,46,.1);
  font-size: .68rem;
  font-style: normal;
}
.calendar-event-pill.birthday { border-left-color: #ef8fb2; background: rgba(239,143,178,.11); }
.calendar-day small { color: var(--muted); font-size: .65rem; }
.event-list-panel { padding: 22px; }
.calendar-event-card { padding: 16px 0; border-bottom: 1px solid var(--line); }
.calendar-event-card time { color: var(--gold); font-size: .72rem; text-transform: uppercase; }
.calendar-event-card h4 { margin: 7px 0; font-size: 1rem; }
.calendar-event-card p { margin: 5px 0; color: var(--muted); line-height: 1.45; font-size: .82rem; }
.event-date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.event-date-fields[hidden],
.profile-form label[hidden] { display: none !important; }
.event-modal-actions { display: grid; grid-template-columns: auto 1fr auto auto; }
.birthday-all-day-note {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid rgba(239,143,178,.28);
  border-radius: 13px;
  background: rgba(239,143,178,.08);
}
.birthday-all-day-note[hidden] { display: none; }
.birthday-all-day-note > span { font-size: 1.7rem; }
.birthday-all-day-note strong,
.birthday-all-day-note small { display: block; }
.birthday-all-day-note small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.calendar-day-modal { width: min(680px, 100%); }
.calendar-day-modal .modal-heading h2 { text-transform: capitalize; }
.calendar-day-detail-list { display: grid; gap: 14px; max-height: min(65vh, 650px); overflow-y: auto; }
.calendar-day-detail-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
.calendar-day-detail-card.birthday {
  border-color: rgba(239,143,178,.3);
  background: linear-gradient(135deg, rgba(239,143,178,.12), rgba(255,255,255,.025));
}
.calendar-day-detail-time { color: var(--gold); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.calendar-day-detail-card.birthday .calendar-day-detail-time { color: #f2a7c2; }
.calendar-day-detail-card h3 { margin: 8px 0 12px; font-family: "Anton"; font-size: 1.6rem; font-weight: 400; }
.calendar-day-detail-card p { margin: 7px 0; color: var(--muted); line-height: 1.5; }
.calendar-day-detail-card .secondary-button { margin-top: 13px; }
.calendar-day-detail-duration { color: var(--text) !important; font-weight: 700; }

.spotify-panel { margin-top: 22px; }
.spotify-panel iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
}
#spotifyPlayer .empty-state {
  min-height: 210px;
  border: 1px dashed var(--line);
}

@media (max-width: 900px) {
  .private-chat-layout,
  .calendar-layout { grid-template-columns: 1fr; }
  .private-contacts { max-height: 330px; overflow: auto; }
}
@media (max-width: 620px) {
  .calendar-toolbar {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .calendar-navigation {
    width: 100%;
    gap: 8px;
  }
  .calendar-navigation h3 {
    min-width: 0;
    flex: 1;
    font-size: .95rem;
  }
  #addEventButton {
    width: 100%;
    min-height: 46px;
  }
  .calendar-grid { padding: 4px; }
  .calendar-day { min-height: 76px; padding: 4px; }
  .calendar-event-pill { min-height: 8px; padding: 0; font-size: 0; }
  .calendar-day > span { width: 22px; height: 22px; }
  .event-date-fields { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  #contenido .stories-strip {
    width: auto;
    margin: 0;
    padding: 3px 3px 10px;
    overflow-x: auto;
    scroll-snap-type: none;
  }
}

/* Estado seleccionado: la foto reemplaza por completo el selector */
#mediaUploader.has-media .media-uploader-modal { overflow: hidden; }
#mediaUploader.has-media .profile-form { position: absolute; inset: 0; display: block; height: 100%; min-height: 0; padding: 0; overflow: hidden; }
#mediaUploader.has-media .media-cropper { position: absolute; inset: 0; display: block; width: 100%; height: 100dvh; overflow: hidden; }
#mediaUploader.has-media .media-crop-stage { position: absolute; inset: 0; width: 100%; height: 100dvh; padding: 0; }
#mediaUploader.has-media .media-crop-stage canvas { width: 100%; height: 100%; max-width: none; object-fit: contain; }
@media (max-width: 760px) {
  #mediaUploader.has-media .media-crop-controls { position: absolute; z-index: 7; left: 10px; right: 10px; bottom: 78px; width: auto; max-height: 42dvh; overflow-y: auto; }
}

/* Editor por herramientas: pantalla independiente inspirada en historias */
#mediaDropzone[hidden],
#mediaUploadPreview[hidden] { display: none !important; }
#mediaUploader:not(.has-media) .media-upload-preview:empty,
#mediaUploader:not(.has-media) .media-cropper,
#mediaUploader:not(.has-media) .form-feedback:empty,
#mediaUploader:not(.has-media) .modal-actions { display: none !important; }
#mediaUploader.has-media {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100dvh;
  overscroll-behavior: none;
}
#mediaUploader.has-media .modal-heading {
  height: 68px;
  padding: 12px 18px;
  box-sizing: border-box;
  background: linear-gradient(#050506e8, transparent);
}
#mediaUploader.has-media .modal-heading > div { display: none; }
#mediaUploader.has-media #closeMediaUploader {
  width: 46px;
  height: 46px;
  border-color: rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(9,9,11,.72);
  backdrop-filter: blur(12px);
  font-size: 1.75rem;
}
#mediaUploader.has-media .media-crop-stage {
  top: 58px;
  bottom: 154px;
  height: auto;
  display: grid;
  place-items: center;
  padding: 12px 74px 12px 18px;
  background: radial-gradient(circle at center, #1a1a1e, #070708 68%);
  touch-action: none;
}
#mediaUploader.has-media .media-crop-stage canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.media-editor-toolbar {
  position: absolute;
  z-index: 12;
  top: 82px;
  right: 16px;
  display: none;
  gap: 12px;
}
#mediaUploader.has-media .media-editor-toolbar { display: grid; }
.media-editor-toolbar button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: #fff;
  background: rgba(10,10,12,.72);
  box-shadow: 0 6px 22px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.media-editor-toolbar button.active { color: #111; border-color: var(--interaction-strong); background: var(--interaction-strong); }

@media (hover: hover) and (pointer: fine) { .media-editor-toolbar button:hover { color: #111; border-color: var(--interaction-strong); background: var(--interaction-strong); } }
.media-editor-toolbar strong { font-size: 1.05rem; }
.media-editor-toolbar svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#mediaUploader.has-media .media-crop-controls {
  position: static;
  width: auto;
  height: auto;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  pointer-events: none;
}
#mediaUploader .media-tool-panel { display: none; }
#mediaUploader .media-tool-panel.active {
  position: absolute;
  z-index: 11;
  top: 82px;
  right: 78px;
  width: min(360px, calc(100vw - 104px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(8,8,10,.9);
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}
#mediaUploader .media-customization-grid { display: contents; }
#mediaUploader .media-adjust-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#mediaUploader.has-media .media-caption-tool {
  pointer-events: auto;
}
#mediaUploader.has-media .media-caption-tool textarea {
  min-height: 92px;
  max-height: 180px;
  padding: 13px 16px;
  resize: vertical;
  border-color: rgba(255,255,255,.18);
  border-radius: 16px;
  background: rgba(9,9,11,.76);
  backdrop-filter: blur(12px);
}
#mediaUploader.has-media .modal-actions {
  left: auto;
  right: 16px;
  bottom: 13px;
  width: auto;
  padding: 0;
  background: transparent;
}
#mediaUploader.has-media .modal-actions #cancelMediaUploader { display: none; }
#mediaUploader.has-media .modal-actions .primary-button { min-width: 150px; min-height: 48px; border-radius: 999px; }
#mediaUploader.has-media .form-feedback { left: 18px; right: 180px; bottom: 22px; width: auto; }

@media (max-width: 760px) {
  #mediaUploader.has-media .media-uploader-modal { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  #mediaUploader.has-media .media-crop-stage { top: 54px; bottom: 126px; padding: 8px; }
  #mediaUploader.has-media .media-editor-toolbar {
    position: fixed;
    z-index: 1016;
    inset: auto 8px 66px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    background: rgba(8,8,10,.88);
    box-shadow: 0 12px 34px rgba(0,0,0,.36);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    touch-action: manipulation;
  }
  #mediaUploader.has-media .media-editor-toolbar button { width: 100%; height: 44px; border-radius: 13px; }
  #mediaUploader.has-media .media-crop-controls { pointer-events: auto; }
  #mediaUploader .media-tool-panel.active {
    position: fixed;
    z-index: 1017;
    inset: auto 8px 126px;
    width: auto;
    max-height: min(46dvh, 390px);
    padding: 17px;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: 0 -10px 40px rgba(0,0,0,.5);
    overscroll-behavior: contain;
    pointer-events: auto;
    touch-action: pan-y;
    animation: mobileToolSheetIn .2s ease-out;
  }
  #mediaUploader .media-tool-panel.active input,
  #mediaUploader .media-tool-panel.active textarea,
  #mediaUploader .media-tool-panel.active select,
  #mediaUploader .media-tool-panel.active button { pointer-events: auto; touch-action: manipulation; }
  #mediaUploader .media-filter-rail,
  #mediaUploader .media-tool-panel.active input[type="range"] { touch-action: pan-x; }
  #mediaUploader.has-media .media-caption-tool textarea { min-height: 88px; max-height: 150px; }
  #mediaUploader.has-media .modal-actions { left: 10px; right: 10px; bottom: 8px; }
  #mediaUploader.has-media .modal-actions .primary-button { width: 100%; min-height: 50px; }
  #mediaUploader.has-media .form-feedback { left: 14px; right: 14px; bottom: 124px; text-align: center; }
}

@keyframes mobileToolSheetIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

#mediaCropCanvas.filter-previewing { animation: filterPreviewPulse .22s ease-out; }
@keyframes filterPreviewPulse {
  from { opacity: .72; transform: scale(.995); }
  to { opacity: 1; transform: scale(1); }
}

/* Paneles fuera del lienzo: evita que Safari iOS los recorte. */
#mediaUploader.has-media .media-crop-controls {
  position: fixed;
  inset: 0;
  z-index: 1015;
  width: auto;
  height: auto;
  max-height: none;
  padding: 0;
  overflow: visible;
  pointer-events: none;
}
#mediaUploader.has-media .media-crop-controls .media-tool-panel.active { pointer-events: auto; }

.story-avatar-ring.unseen {
  outline-color: #32d878;
  box-shadow: 0 0 0 2px rgba(50,216,120,.18), 0 0 18px rgba(50,216,120,.2);
}
.story-avatar-ring.seen {
  outline-color: #74777d;
  opacity: .82;
}
.story-count {
  position: absolute;
  top: 43px;
  right: 5px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #09090b;
  border-radius: 999px;
  color: #fff;
  background: #24262a;
  font-size: .62rem;
  font-weight: 900;
}
.moment-progress {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 14px;
  right: 64px;
  display: flex;
  gap: 4px;
}
.moment-progress[hidden] { display: none; }
.moment-progress span {
  height: 3px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.32);
}
.moment-progress i { display: block; width: 0; height: 100%; background: #fff; }
.moment-progress .complete i { width: 100%; }
.moment-progress .active i { animation: momentProgress 6s linear forwards; }
.moment-progress.paused .active i { animation-play-state: paused; }
@keyframes momentProgress { to { width: 100%; } }
.moment-navigation {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 50%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.moment-navigation[hidden] { display: none; }
.moment-navigation-previous { left: 0; }
.moment-navigation-next { right: 0; }
.media-viewer-dialog > img,
.media-viewer-dialog > video { position: relative; z-index: 0; }
.media-viewer-caption { position: relative; z-index: 3; }

@media (max-width: 760px) {
  #mediaUploader .media-tool-panel.active {
    left: 8px;
    right: 8px;
    bottom: 126px;
    top: auto;
    width: auto;
    max-height: min(46dvh, 390px);
    visibility: visible;
    opacity: 1;
  }
  .media-viewer { padding: 0; }
  .media-viewer-dialog { width: 100vw; max-height: 100dvh; min-height: 100dvh; align-content: center; }
  .media-viewer-dialog img,
  .media-viewer-dialog video { max-width: 100vw; max-height: calc(100dvh - 72px); border-radius: 0; }
  .media-viewer-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 14px;
    right: auto;
    z-index: 2410;
  }
  .moment-options-button {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
    z-index: 2411;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px 6px;
    touch-action: manipulation;
  }
  .moment-options-button[hidden] { display: none !important; }
  .moment-options-menu {
    position: fixed;
    top: calc(max(12px, env(safe-area-inset-top)) + 50px);
    right: 14px;
    z-index: 2412;
  }
}

/* Prioridad final del nuevo armazón: neutraliza la antigua navegación lateral. */
.app,
body.sidebar-compact .app,
.site-footer,
body.sidebar-compact .site-footer {
  margin-left: 0;
}

body.authenticated .page-section {
  padding-bottom: 142px;
}

body.chat-focus .floating-tab-bar {
  display: flex;
}

body.chat-focus .app {
  height: calc(var(--chat-viewport-height, 100dvh) - 112px);
}

@media (max-width: 760px) {
  body.authenticated .page-section,
  body.authenticated.standalone-app .page-section {
    padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px));
  }

  body.chat-focus .app,
  body.standalone-app.chat-focus .app {
    top: var(--pwa-safe-top, 0px);
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    height: auto;
  }
}

#perfil .back-button[hidden] { display: none; }

@media (max-width: 760px) {
  #perfil .profile-hero { min-height: 0; }
  #perfil .profile-visual { min-height: 210px; }
  #perfil .profile-info { padding: 26px 22px 30px; }
  #perfil .profile-info h2 { font-size: clamp(3.2rem, 16vw, 4.7rem); }
}

.topbar { z-index: 110; }

/* Rendimiento y cuenta: la navegación evita filtros GPU costosos durante el scroll. */
.floating-tab-bar {
  background: rgba(8, 8, 10, .97);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .52), inset 0 1px rgba(255,255,255,.07);
  backdrop-filter: none;
  contain: layout paint;
}

.topbar {
  background: rgba(5, 5, 6, .97);
  backdrop-filter: none;
}

body.chat-focus #chat.active,
body.chat-focus #privados.active {
  height: 100%;
  min-height: 0;
}

@media (max-width: 760px) {
  .noise { display: none; }
  .page-section.active { animation-duration: .16s; }
}

/* Mensajería unificada: bandeja y conversaciones inmersivas. */
.messages-hub {
  width: min(100%, 780px);
  margin: 0 auto;
}

.chat-inbox {
  min-height: min(720px, calc(100dvh - 210px));
  padding: 0;
  overflow: hidden;
  background: radial-gradient(circle at 90% 0, rgba(214,166,46,.1), transparent 30%), #090a0d;
}

.chat-inbox-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 26px 12px;
}

.chat-inbox-heading h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  line-height: .9;
  text-transform: uppercase;
}

.chat-inbox-copy {
  margin: 0;
  padding: 0 26px 22px;
  color: var(--muted);
  font-size: .8rem;
}

.unified-chat-list {
  display: grid;
  gap: 0;
  padding: 0 14px 20px;
}

.unified-chat-list .private-contact {
  min-height: 76px;
  gap: 14px;
  padding: 12px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.075);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.unified-chat-list .private-contact.active {
  border-color: rgba(255,255,255,.09);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  box-shadow: none;
}


@media (hover: hover) and (pointer: fine) { .unified-chat-list .private-contact:hover {
  border-color: rgba(255,255,255,.09);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  box-shadow: none;
} }

.unified-chat-list .private-contact .avatar,
.chat-group-avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  background: #17181d;
}

.unified-chat-list .private-contact > .chat-group-avatar {
  flex: 0 0 52px;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
}

.unified-chat-list .private-contact .avatar img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.chat-group-avatar {
  position: relative;
  display: grid;
  place-items: center;
  color: #0b0b0d;
  border-color: rgba(214,166,46,.58);
  background: linear-gradient(145deg, #f2d06b, #b67a08);
  box-shadow: 0 0 0 3px rgba(214,166,46,.1);
}

.chat-group-avatar b { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: .03em; }
.chat-group-avatar i {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid #090a0d;
  border-radius: 50%;
  background: #50d884;
}

.unified-chat-list .private-contact-copy { min-width: 0; }
.unified-chat-list .private-contact-copy strong { font-size: .86rem; }
.unified-chat-list .private-contact-copy small { font-size: .7rem; }

.chat-list-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 10px 8px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.chat-list-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.08); }

#chat .group-conversation { display: none; }
#chat.conversation-open .chat-inbox { display: none; }
#chat.conversation-open .group-conversation { display: flex; }

.private-chat-layout { grid-template-columns: minmax(0, 1fr); }
.private-chat-header-flag { display: none !important; }
.private-conversation .chat-header,
.group-conversation .chat-header {
  min-height: 76px;
  padding: 12px 18px;
  overflow: visible;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: #0a0b0e;
}

.private-chat-person { gap: 12px; }
.private-chat-person h3 { margin-top: 1px; font-size: 1rem; }
.private-chat-person .eyebrow { font-size: .55rem; }
.private-chat-person .chat-username { display: block; margin-top: 3px; color: var(--muted); font-size: .62rem; }
.private-conversation-back { display: inline-grid !important; }
.private-chat-avatar {
  flex-basis: 48px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.private-chat-avatar .avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: none;
}

.composer-tool-button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #d8d9dd;
  background: transparent;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .composer-tool-button:hover { color: #fff; background: rgba(255,255,255,.08); } }
.composer-tool-button:disabled { opacity: .35; cursor: default; }
.composer-tool-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.record-audio-button.recording { color: #fff; background: #dd3f4f; animation: recordingPulse 1.35s ease-in-out infinite; }
@keyframes recordingPulse { 50% { box-shadow: 0 0 0 7px rgba(221,63,79,.14); } }
.recording-time { color: #ff7e89; font-size: .72rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.recording-time[hidden] { display: none; }

.message-form {
  display: flex;
  grid-template-columns: 42px 42px 42px auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 3px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #0a0b0e;
}
.message-form .attach-button { width: 42px; height: 42px; border-radius: 50%; }
.message-form input[type="text"] { min-width: 0; flex: 1 1 auto; height: 44px; border-radius: 22px; background: #15161b; }
.message-form .send-button { min-height: 42px; border-radius: 21px; }

.attachment-preview {
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: #101116;
}
.attachment-preview:not([hidden]) { display: flex; }
.attachment-preview-content { min-width: 0; flex: 1; display: grid; gap: 7px; }
.attachment-preview-content > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview audio { width: min(420px, 100%); height: 34px; }

.message-audio {
  min-width: min(310px, 62vw);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(0,0,0,.22);
}
.message-audio > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #171208; background: var(--accent); font-weight: 900; }
.message-audio audio { width: 100%; height: 36px; }

body.chat-focus .floating-tab-bar { display: none !important; }
body.chat-focus .app {
  height: var(--chat-viewport-height, 100dvh);
  min-height: 0;
  padding: 0;
}
body.chat-focus #chat.active,
body.chat-focus #privados.active {
  height: 100%;
  padding: 0;
}
body.chat-focus #chat .messages-hub,
body.chat-focus #privados .private-chat-layout { height: 100%; width: 100%; max-width: none; }
body.chat-focus #chat .group-conversation,
body.chat-focus #privados .private-conversation {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: #08090c;
}
body.chat-focus #chat .chat-header { order: 1; }
body.chat-focus #chat .chat-channel-bar { order: 2; }
body.chat-focus #chat .messages,
body.chat-focus #privados .messages { order: 3; flex: 1 1 auto; min-height: 0; max-height: none; background: #08090c; }
body.chat-focus #chat .attachment-preview,
body.chat-focus #privados .attachment-preview { order: 4; }
body.chat-focus #chat .message-form,
body.chat-focus #privados .message-form { order: 5; }
body.chat-focus #privados .chat-header { order: 1; }

@media (max-width: 760px) {
  .messages-hub { width: 100%; }
  .chat-inbox { min-height: calc(100dvh - 190px); border-radius: 0; }
  .chat-inbox-heading { padding: 22px 18px 10px; }
  .chat-inbox-copy { padding: 0 18px 16px; }
  .unified-chat-list { padding: 0 8px 16px; }
  .unified-chat-list .private-contact { min-height: 70px; padding: 9px 10px; }
  .unified-chat-list .private-contact .avatar,
  .chat-group-avatar { flex-basis: 48px; width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
  .unified-chat-list .private-contact > .chat-group-avatar { flex-basis: 48px; width: 48px; min-width: 48px; max-width: 48px; }
  body.chat-focus .app,
  body.standalone-app.chat-focus .app {
    top: var(--pwa-safe-top, 0px);
    bottom: 0;
    height: auto;
    transform: translateY(var(--chat-viewport-offset, 0px));
  }
  .private-conversation .chat-header,
  .group-conversation .chat-header { min-height: 68px; padding: 8px 10px; }
  .private-chat-avatar,
  .private-chat-avatar .avatar { flex-basis: 42px; width: 42px; height: 42px; min-width: 42px; min-height: 42px; }
  .private-conversation .chat-header > .text-button { font-size: .68rem; }
  .message-form {
    display: flex;
    grid-template-columns: 38px 38px 38px auto minmax(70px, 1fr) auto;
    padding: 7px 8px max(8px, env(safe-area-inset-bottom));
  }
  .message-form .attach-button,
  .composer-tool-button { width: 38px; height: 38px; flex-basis: 38px; }
  .message-form input[type="text"] { height: 40px; padding-inline: 13px; font-size: 16px; }
  .message-form .send-button { min-height: 38px; padding-inline: 13px; font-size: .72rem; }
  .message-form.is-recording input[type="text"] { opacity: .45; }
  .message-audio { min-width: min(260px, 72vw); }
  .message .avatar { width: 30px; height: 30px; min-width: 30px; min-height: 30px; }
}

/* Compositor móvil nativo: una sola cápsula integrada sobre el teclado. */
:root { color-scheme: dark; }

.composer-send-button svg {
  display: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 760px) {
  body.chat-focus .message-form {
    flex: 0 0 auto;
    width: auto;
    min-height: 54px;
    margin: 6px 8px max(8px, env(safe-area-inset-bottom, 0px));
    padding: 4px;
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 29px;
    background: #1d1e23;
    box-shadow: 0 8px 26px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.035);
  }

  body.chat-focus .message-form input[type="text"] {
    order: 2;
    min-width: 62px;
    height: 44px;
    padding: 0 7px;
    border: 0;
    border-radius: 0;
    color: #f6f6f8;
    background: transparent;
    box-shadow: none;
    caret-color: #afafaf;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
  }

  body.chat-focus .message-form input[type="text"]::placeholder { color: #9b9ca3; opacity: 1; }
  body.chat-focus .message-form input[type="text"]:focus { border: 0; outline: 0; box-shadow: none; }

  body.chat-focus .message-form .composer-tool-button,
  body.chat-focus .message-form .attach-button,
  body.chat-focus .message-form .send-button {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #f4f4f6;
    background: transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  body.chat-focus .message-form .composer-camera-button {
    order: 1;
    color: #111216;
    background: linear-gradient(145deg, #f5cf61, #c98b12);
    box-shadow: 0 4px 14px rgba(212,158,31,.25);
  }

  body.chat-focus .message-form .composer-camera-button svg { width: 23px; height: 23px; stroke-width: 2; }
  body.chat-focus .message-form .record-audio-button { order: 3; }
  body.chat-focus .message-form [id*="MediaButton"] { order: 4; }
  body.chat-focus .message-form .attach-button { order: 5; font-size: 29px; font-weight: 300; line-height: 1; }
  body.chat-focus .message-form .composer-send-button { order: 6; display: none; color: #12100a; background: var(--gold); }
  body.chat-focus .message-form .composer-send-button span { display: none; }
  body.chat-focus .message-form .composer-send-button svg { display: block; }
  body.chat-focus .message-form.has-content .composer-send-button { display: grid; }
  body.chat-focus .message-form.has-content .attach-button { display: none; }
  body.chat-focus .message-form .recording-time { order: 2; min-width: 0; flex: 1; padding-left: 10px; font-size: .82rem; }
  body.chat-focus .message-form.is-recording input[type="text"] { display: none; }
  body.chat-focus .message-form.is-recording [id*="MediaButton"],
  body.chat-focus .message-form.is-recording .attach-button,
  body.chat-focus .message-form.is-recording .composer-camera-button,
  body.chat-focus .message-form.is-recording .composer-send-button { display: none; }

  body.standalone-app.chat-focus .message-form { padding-bottom: 4px; }
  body.chat-keyboard-open.chat-focus .message-form,
  body.standalone-app.chat-keyboard-open.chat-focus .message-form {
    margin-top: 4px;
    margin-bottom: 4px;
    padding-bottom: 4px;
  }

  body.standalone-app.chat-focus.chat-keyboard-open .app {
    height: calc(var(--chat-viewport-height, 100dvh) - var(--pwa-safe-top, 0px));
  }

body.chat-keyboard-open.chat-focus .attachment-preview { padding-block: 7px; }
}

/* Cuenta contextual: accesos discretos al mantener pulsado el perfil. */
.profile-tab {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.profile-quick-menu {
  position: fixed;
  z-index: 180;
  right: max(20px, calc((100vw - 680px) / 2));
  bottom: 112px;
  width: min(320px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  color: var(--text);
  background: linear-gradient(160deg, #18191e, #090a0d 78%);
  box-shadow: 0 26px 80px rgba(0,0,0,.68), inset 0 1px rgba(255,255,255,.055);
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transform-origin: right bottom;
  transition: opacity .16s ease, transform .16s ease;
}

.profile-quick-menu[hidden] { display: none; }
.profile-quick-menu.open { opacity: 1; transform: translateY(0) scale(1); }
.profile-quick-menu::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-right: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid rgba(255,255,255,.14);
  background: #0a0b0e;
  transform: rotate(45deg);
}

.profile-quick-menu-heading { display: grid; gap: 3px; padding: 12px 13px 10px; }
.profile-quick-menu-heading span { color: var(--gold); font-size: .57rem; font-weight: 900; letter-spacing: .17em; }
.profile-quick-menu-heading strong { font-size: 1rem; }
.profile-quick-menu > button {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 15px;
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.profile-quick-menu > button:focus-visible { outline: 0; background: rgba(255,255,255,.065); }

@media (hover: hover) and (pointer: fine) { .profile-quick-menu > button:hover { outline: 0; background: rgba(255,255,255,.065); } }
.profile-quick-menu > button > span:last-child { min-width: 0; display: grid; gap: 4px; }
.profile-quick-menu > button strong { font-size: .82rem; }
.profile-quick-menu > button small { color: var(--muted); font-size: .65rem; }
.profile-quick-menu > button.danger strong { color: #ff8585; }
.profile-quick-menu-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  color: var(--gold);
  background: #08090b;
  font-size: 1rem;
  font-weight: 900;
}
.profile-quick-menu > button.danger .profile-quick-menu-icon { color: #ff7373; }
.profile-quick-menu-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-quick-menu-tip { margin: 5px 9px 7px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.07); color: #72737b; font-size: .58rem; text-align: center; }

/* Mensajes propios: solo el contenido, sin repetir avatar ni nombre. */
.message.own-message,
.private-message.own-message {
  display: flex;
  justify-content: flex-end;
  gap: 0;
  margin-left: 16%;
  text-align: left;
}
.message.own-message .message-bubble { max-width: min(82%, 680px); }

/* Notas de voz personalizadas; se evita el reproductor genérico del navegador. */
.voice-note {
  --voice-progress: 0%;
  width: min(280px, 68vw);
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.voice-note audio { display: none; }
.voice-note-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #171208;
  background: linear-gradient(145deg, #f1cd67, #c38a16);
  box-shadow: none;
  cursor: pointer;
}
.voice-note-toggle svg { grid-area: 1 / 1; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.voice-pause-icon { display: none; }
.voice-note.is-playing .voice-play-icon { display: none; }
.voice-note.is-playing .voice-pause-icon { display: block; }
.voice-note-main { min-width: 0; display: grid; gap: 2px; }
.voice-waveform-shell { position: relative; height: 23px; }
.voice-waveform {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}
.voice-waveform i { flex: 1 1 0; min-width: 2px; height: var(--bar-height); max-height: 22px; border-radius: 99px; background: #62636b; }
.voice-waveform-progress { clip-path: inset(0 calc(100% - var(--voice-progress)) 0 0); }
.voice-waveform-progress i { background: #e4b63d; }
.voice-note-seek { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.voice-note-time { display: flex; justify-content: flex-start; color: #a0a5af; font-size: 10px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.voice-attachment-preview .attachment-preview-content > small { color: var(--muted); font-size: .57rem; font-weight: 900; letter-spacing: .11em; }
.voice-preview-remove { flex: 0 0 34px; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(255,115,115,.32); border-radius: 50%; color: #ff8585; background: rgba(110,20,25,.17); font-size: 1.25rem; }

/* Grabación: borrar, tiempo, onda viva, pausa y envío directo. */
.record-send-icon,
.resume-icon { display: none; }
.recording-action {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #f2f2f4;
  background: transparent;
  cursor: pointer;
}
.recording-action[hidden],
.recording-wave[hidden] { display: none !important; }
.recording-action svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.recording-delete { order: 1; color: #ff777f; }
.message-form.is-recording .recording-time { order: 2; min-width: 42px; color: #f4f4f6; font-size: .82rem; font-weight: 700; }
.recording-wave { order: 3; min-width: 76px; flex: 1; height: 32px; display: flex; align-items: center; justify-content: center; gap: 4px; overflow: hidden; }
.recording-wave i { width: 3px; height: 8px; border-radius: 99px; background: #c5c5ca; animation: liveVoiceWave .72s ease-in-out infinite alternate; }
.recording-wave i:nth-child(2n) { animation-delay: -.18s; }
.recording-wave i:nth-child(3n) { animation-delay: -.36s; }
.recording-wave i:nth-child(4n) { animation-delay: -.52s; }
@keyframes liveVoiceWave { from { height: 5px; opacity: .5; } to { height: 27px; opacity: 1; } }
.recording-pause { order: 4; border: 2px solid #ff4f69; color: #ff4f69; }
.message-form.is-recording .record-audio-button { order: 5; flex-basis: 42px; color: #171208; background: linear-gradient(145deg, #edd09a, #c7a06b); animation: none; box-shadow: 0 6px 18px rgba(202,164,106,.22); }
.message-form.is-recording .record-microphone-icon { display: none; }
.message-form.is-recording .record-send-icon { display: block; }
.message-form.is-recording-paused .recording-wave i { animation-play-state: paused; height: 7px; opacity: .5; }
.message-form.is-recording-paused .recording-pause .pause-icon { display: none; }
.message-form.is-recording-paused .recording-pause .resume-icon { display: block; }
.message-form.is-recording .composer-camera-button,
.message-form.is-recording input[type="text"],
.message-form.is-recording [id*="MediaButton"],
.message-form.is-recording .attach-button,
.message-form.is-recording .composer-send-button { display: none !important; }

@media (max-width: 760px) {
  .profile-quick-menu {
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: min(310px, calc(100vw - 24px));
  }
  .profile-quick-menu::after { right: 28px; }
  .message.own-message,
  .private-message.own-message { margin-left: 7%; }
  .message.own-message .message-bubble { max-width: 88%; }
  .voice-note { width: min(280px, 73vw); min-width: 0; grid-template-columns: 36px minmax(0, 1fr); gap: 9px; padding: 0; }
  .voice-note-toggle { width: 36px; height: 36px; }
  body.chat-focus .message-form.is-recording { gap: 3px; padding-inline: 7px; overflow: visible; }
  body.chat-focus .message-form.is-recording .recording-time { padding-left: 2px; }
  body.chat-focus .message-form.is-recording .recording-action,
  body.chat-focus .message-form.is-recording .record-audio-button { flex-basis: 40px; width: 40px; height: 40px; }
}

/* Cámara de historias: vista independiente, sin paneles de la aplicación. */
body.story-camera-open {
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}
body.story-camera-open:not(.camera-entering) > :not(#storyCamera) { visibility: hidden !important; }
/* Mantiene la aplicación tapada durante el fotograma que intercambia cámara y editor. */
body.camera-editor-transition {
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}
body.camera-editor-transition > :not(#storyCamera):not(#mediaUploader):not(#cameraTransitionGuard) { visibility: hidden !important; }
body.story-camera-open.camera-editor-transition > #mediaUploader { visibility: visible !important; }
.story-camera {
  position: fixed;
  top: var(--story-viewport-top, 0px);
  right: auto;
  bottom: auto;
  left: var(--story-viewport-left, 0px);
  z-index: 2147483647;
  width: var(--story-viewport-width, 100vw);
  height: 100vh;
  height: var(--story-viewport-height, 100dvh);
  display: none;
  place-items: stretch center;
  overflow: hidden;
  color: #fff;
  background: #000;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.story-camera.open { display: grid; }
.story-camera-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #24262a, #08090a 64%);
}
#storyCameraPreview {
  position: absolute;
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  z-index: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  object-fit: fill !important;
  object-position: center center;
  background: #090a0b;
  transform: translate3d(-50%, -50%, 0);
  -webkit-transform: translate3d(-50%, -50%, 0);
}
.story-camera-shell.front-camera #storyCameraPreview {
  transform: translate3d(-50%, -50%, 0) scaleX(-1);
  -webkit-transform: translate3d(-50%, -50%, 0) scaleX(-1);
}
.story-camera-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.56), transparent 22%, transparent 64%, rgba(0,0,0,.7));
}
.story-camera-topbar {
  position: absolute;
  z-index: 4;
  top: max(16px, env(safe-area-inset-top, 0px));
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
}
.story-camera-topbar > span {
  justify-self: center;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-shadow: 0 2px 10px rgba(0,0,0,.7);
}
.story-camera-control,
.story-switch-camera {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(13,14,16,.48);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  touch-action: manipulation;
}
.story-camera-control svg,
.story-switch-camera svg,
.story-gallery-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.story-camera-control.active { color: #121212; border-color: #b5b5b5; background: #b5b5b5; }
.story-camera-control[disabled],
.story-switch-camera[disabled],
.story-shutter[disabled] { cursor: not-allowed; opacity: .42; }
.story-camera-status {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: min(340px, calc(100% - 44px));
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(8,9,10,.72);
  box-shadow: 0 14px 42px rgba(0,0,0,.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
  transform: translate(-50%, -50%);
}
.story-camera-status[hidden] { display: none; }
.story-camera-status.error { border-color: rgba(255,190,75,.4); color: #ffe4a8; }
.story-recording-indicator {
  position: absolute;
  z-index: 5;
  top: max(24px, calc(env(safe-area-inset-top, 0px) + 8px));
  left: 50%;
  min-width: 84px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 999px;
  color: #fff;
  background: rgba(12,12,14,.68);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: .73rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}
.story-recording-indicator[hidden] { display: none; }
.story-recording-indicator i { width: 9px; height: 9px; border-radius: 50%; background: #ff4057; box-shadow: 0 0 0 5px rgba(255,64,87,.13); animation: storyRecordingPulse 1s ease-in-out infinite; }
@keyframes storyRecordingPulse { 50% { opacity: .42; transform: scale(.8); } }
.story-camera-bottom {
  position: absolute;
  z-index: 4;
  left: 22px;
  right: 22px;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
}
.story-gallery-button,
.story-switch-camera {
  justify-self: center;
  cursor: pointer;
}
.story-gallery-button {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,.2), rgba(0,0,0,.35));
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: manipulation;
}
.story-shutter {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  justify-self: center;
  padding: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
  touch-action: manipulation;
}
.story-shutter span { width: 66px; height: 66px; border-radius: 50%; background: #f5f5f5; transition: transform .1s ease, background .1s ease; }
.story-shutter:active span,
.story-shutter.holding span { background: #ff4057; transform: scale(.88); }
.story-camera.recording .story-shutter { border-color: rgba(255,255,255,.88); }
.story-camera.recording .story-shutter span { width: 38px; height: 38px; border-radius: 11px; background: #ff4057; transform: none; }
.story-camera.recording .story-camera-topbar > span,
.story-camera.recording #toggleStoryFlash,
.story-camera.recording .story-gallery-button,
.story-camera.recording .story-switch-camera { pointer-events: none; opacity: .28; }

/* Los vídeos elegidos en galería también ocupan el editor, sin un panel vacío. */
#mediaUploader.has-media.has-video .media-cropper,
#mediaUploader.has-media.has-video .media-editor-toolbar,
#mediaUploader.has-media.has-video .media-tool-portal { display: none !important; }
#mediaUploader.has-media.has-video .media-upload-preview {
  position: fixed;
  inset: 58px 0 74px;
  z-index: 3;
  display: grid !important;
  place-items: center;
  padding: 12px;
  background: radial-gradient(circle at center, #1a1a1e, #070708 68%);
}
#mediaUploader.has-media.has-video .media-upload-preview video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
  background: #000;
}

@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .story-camera { background: radial-gradient(circle at center, #15171a, #020303 72%); }
  .story-camera-shell {
    width: min(100%, 560px);
    border-inline: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 0 80px rgba(0,0,0,.8);
  }
}

body.standalone-app .story-camera-shell {
  width: 100%;
  border: 0;
  box-shadow: none;
}

@media (max-width: 760px) {
  .story-camera-shell {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    border: 0;
    border-radius: 0;
  }
  .story-camera-topbar { top: max(12px, env(safe-area-inset-top, 0px)); }
  .story-recording-indicator { top: max(18px, calc(env(safe-area-inset-top, 0px) + 4px)); }
  .story-camera-bottom { bottom: max(34px, calc(18px + env(safe-area-inset-bottom, 0px))); }
  #mediaUploader.has-media .modal-heading {
    height: calc(66px + env(safe-area-inset-top, 0px));
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 8px;
  }
  #mediaUploader.has-media.has-video .media-upload-preview { inset: 54px 0 70px; padding: 8px; }
}

@media (max-width: 760px) and (orientation: portrait) {
  body.standalone-app .story-camera-topbar { top: calc(var(--pwa-safe-top) + 10px); }
  body.standalone-app .story-recording-indicator { top: calc(var(--pwa-safe-top) + 16px); }
}

/* Cabecera social: crear a la izquierda, título realmente centrado y acciones a la derecha. */
.topbar {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
  align-items: center;
}
.topbar-title { min-width: 0; text-align: center; }
.topbar-title h1 { max-width: none; }
.top-actions { justify-self: end; margin-left: 0; }
.top-create-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  justify-self: start;
  padding: 0;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 50%;
  color: #fff;
  background: #0c0d10;
  box-shadow: inset 0 1px rgba(255,255,255,.06);
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .top-create-button:hover { border-color: var(--interaction-strong); background: rgba(168,168,168,.1); } }
.top-create-button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Avatares de chat: la imagen es el acceso al perfil y conserva siempre su tamaño. */
.message-avatar-link,
.private-chat-avatar,
.group-header-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}
.message-avatar-link { align-self: flex-start; border-radius: 50%; cursor: pointer; }
.message-avatar-link .avatar { margin: 0; }
.private-chat-avatar { cursor: pointer; }
.group-header-avatar { width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.group-header-avatar:disabled { opacity: 1; cursor: default; }
.chat-group-avatar img,
.group-header-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.chat-group-avatar.has-image { color: transparent; background: #111217; }
.group-header-avatar .chat-group-avatar { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }

.group-avatar-editor { width: min(470px, 100%); }
.group-avatar-preview {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  justify-self: center;
  overflow: hidden;
  border: 3px solid rgba(214,166,46,.65);
  border-radius: 50%;
  color: #12100a;
  background: linear-gradient(145deg, #f2d06b, #b67a08);
  box-shadow: 0 0 0 8px rgba(214,166,46,.08), 0 22px 55px rgba(0,0,0,.42);
  font-family: var(--font-display);
  font-size: 3.2rem;
}
.group-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.group-avatar-file-button { justify-content: center; cursor: pointer; }
.group-avatar-help { color: var(--muted); text-align: center; }

/* Selector único dentro de cámara para elegir el destino de la captura. */
.story-camera-mode {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(8,9,11,.68);
  box-shadow: 0 10px 32px rgba(0,0,0,.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateX(-50%);
}
.story-camera-mode button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: rgba(255,255,255,.7);
  background: transparent;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
}
.story-camera-mode button.active { color: #111; background: var(--interaction-strong); }
.story-camera-mode button:disabled { opacity: .42; cursor: default; }
.story-camera-bottom { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

/* Safari puede desmontar la cámara antes de componer el editor: esta capa conserva la captura. */
.camera-transition-guard {
  position: fixed;
  top: var(--story-viewport-top, 0px);
  left: var(--story-viewport-left, 0px);
  z-index: 999;
  width: var(--story-viewport-width, 100vw);
  height: var(--story-viewport-height, 100dvh);
  display: none;
  overflow: hidden;
  pointer-events: none;
  background: #000;
}
.camera-transition-guard.active { display: block; }
.camera-transition-guard img { width: 100%; height: 100%; display: none; object-fit: cover; }
.camera-transition-guard.has-image img { display: block; }
body.story-camera-open.camera-editor-transition > #cameraTransitionGuard,
body.story-camera-open.camera-editor-transition > #mediaUploader { visibility: visible !important; }

@media (max-width: 760px) {
  body {
    --pwa-safe-top: env(safe-area-inset-top, 0px);
    --pwa-safe-right: env(safe-area-inset-right, 0px);
    --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
    --pwa-safe-left: env(safe-area-inset-left, 0px);
  }
  body.authenticated .topbar {
    height: calc(64px + var(--pwa-safe-top));
    padding: var(--pwa-safe-top) 14px 0;
    box-sizing: border-box;
  }
  .topbar { grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr); }
  .topbar-title .eyebrow { display: none; }
  .topbar-title h1 { max-width: 42vw; font-size: 19px; }
  .top-create-button { width: 40px; height: 40px; }
  .top-actions { gap: 5px; }
  .story-camera-bottom { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  .story-camera-mode { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .group-avatar-preview { width: 126px; height: 126px; }
}

@media (max-width: 760px) and (orientation: portrait) {
  body.standalone-app { --pwa-safe-top: max(env(safe-area-inset-top, 0px), 58px); }
}

/* La creación entra como una vista nativa: la cámara empuja la pantalla actual hacia la izquierda. */
body.story-camera-open.camera-entering > .app,
body.story-camera-open.camera-entering > .floating-tab-bar {
  visibility: visible !important;
  pointer-events: none;
  will-change: transform, opacity;
  animation: cameraPageDragLeft .44s cubic-bezier(.22,.72,.18,1) both;
}
body.story-camera-open.camera-entering > #storyCamera {
  animation: cameraViewSlideIn .44s cubic-bezier(.22,.72,.18,1) both;
}
@keyframes cameraPageDragLeft {
  from { transform: translate3d(0,0,0); opacity: 1; }
  to { transform: translate3d(-24vw,0,0); opacity: .72; }
}
@keyframes cameraViewSlideIn {
  from { transform: translate3d(100%,0,0); }
  to { transform: translate3d(0,0,0); }
}

.messages { overflow-anchor: none; scroll-behavior: auto; }

@media (prefers-reduced-motion: reduce) {
  body.story-camera-open.camera-entering > .app,
  body.story-camera-open.camera-entering > .floating-tab-bar,
  body.story-camera-open.camera-entering > #storyCamera { animation: none; }
}

/* Mantiene los controles sociales minimalistas frente a estilos heredados. */
.media-card-info .media-social-actions .media-like-button,
.media-card-info .media-social-actions .media-reply-button,
.media-card-info .media-social-actions .media-share-button {
  min-width: 30px;
  height: 34px;
  margin: 0;
  padding: 3px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.media-card-info .media-social-actions .media-like-button svg,
.media-card-info .media-social-actions .media-reply-button svg,
.media-card-info .media-social-actions .media-share-button svg {
  width: 25px;
  height: 25px;
}

/* Publicaciones del muro: formato social vertical inspirado en la referencia. */
#contenido .publications-feed {
  width: min(680px, 100%);
  gap: 28px;
}
#contenido .publications-feed .feed-post-card {
  overflow: visible;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 22px;
  background: #090a0e;
  box-shadow: 0 26px 72px rgba(0,0,0,.38);
  content-visibility: auto;
  contain-intrinsic-size: 680px 880px;
}
.feed-post-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 17px;
}
.feed-post-author {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.feed-post-author .avatar.small {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: 0 0 0 2px #090a0e;
}
.feed-post-author > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.feed-post-author strong {
  overflow: hidden;
  color: #f7f7f8;
  font-size: .92rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-post-author small {
  overflow: hidden;
  color: #a9abb2;
  font-size: .72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-post-menu { position: relative; flex: 0 0 auto; }
.feed-post-menu-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #f5f5f6;
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.feed-post-menu-button[aria-expanded="true"] { background: rgba(255,255,255,.075); }

@media (hover: hover) and (pointer: fine) { .feed-post-menu-button:hover { background: rgba(255,255,255,.075); } }
.feed-post-menu-button:active { transform: scale(.94); }
.feed-post-menu-button svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.feed-post-menu-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: 190px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(19,20,25,.96);
  box-shadow: 0 18px 50px rgba(0,0,0,.48);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.feed-post-menu-popover[hidden] { display: none; }
.feed-post-menu-popover button {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  color: #f2f2f4;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: .75rem;
  font-weight: 750;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .feed-post-menu-popover button:hover { background: rgba(255,255,255,.07); } }
.feed-post-menu-popover button.danger { color: #ff7480; }
#contenido .publications-feed .feed-post-card .feed-post-media {
  width: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  border-block: 1px solid rgba(255,255,255,.08);
  background: #030407;
}
.publications-feed .feed-post-media .media-view-button {
  height: auto;
  min-height: 0;
  max-height: min(78vh, 860px);
  max-height: min(78svh, 860px);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.publications-feed .feed-post-media img,
.publications-feed .feed-post-media video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(78vh, 860px);
  max-height: min(78svh, 860px);
  display: block;
  object-fit: contain;
  background: #030407;
}
.feed-post-info { padding: 12px 17px 18px; }
.feed-post-info .feed-post-actions {
  min-height: 40px;
  gap: 13px;
  margin: 0 0 7px;
}
.feed-post-info .feed-post-actions button { color: #f5f5f7; }
@media (hover: hover) and (pointer: fine) { .feed-post-info .feed-post-actions button:hover { color: #fff; background: transparent; transform: scale(1.08); } }
.feed-post-info .feed-post-actions .media-like-button.liked { color: #ff4057; }
.feed-post-info .feed-post-actions svg { width: 27px; height: 27px; stroke-width: 1.75; }
.feed-post-like-summary {
  display: block;
  padding: 0;
  border: 0;
  color: #f0f0f2;
  background: transparent;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.feed-post-info .feed-post-caption {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 9px 0 0;
  color: #e9e9ec;
  font-size: .82rem;
  line-height: 1.48;
}
.feed-post-caption button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.feed-post-caption span { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.feed-post-mention { display: block; margin-top: 7px; }
.feed-post-info .feed-post-time {
  display: block;
  margin-top: 10px;
  color: #777a84;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  /* En móvil el muro usa el ancho físico de la pantalla, como un feed social. */
  #contenido .publications-feed {
    width: calc(100% + 32px);
    margin-inline: -16px;
    gap: 12px;
  }
  #contenido .publications-feed .feed-post-card {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #08090d;
    box-shadow: none;
    contain-intrinsic-size: 390px 720px;
  }
  .feed-post-header {
    min-height: 58px;
    padding: 8px 14px;
  }
  .feed-post-author { gap: 9px; }
  .feed-post-author .avatar.small {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    box-shadow: none;
  }
  .feed-post-author strong { font-size: .82rem; }
  .feed-post-author small { font-size: .65rem; }
  .feed-post-menu-button { width: 36px; height: 36px; }
  #contenido .publications-feed .feed-post-card .feed-post-media {
    border: 0;
    background: #08090d;
  }
  .publications-feed .feed-post-media .media-view-button,
  .publications-feed .feed-post-media img,
  .publications-feed .feed-post-media video {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
    background: #08090d;
  }
  .feed-post-info { padding: 9px 14px 18px; }
  .feed-post-info .feed-post-actions { gap: 11px; }
  .feed-post-info .feed-post-actions svg { width: 26px; height: 26px; }

}

/* Perfil social: identidad, actividad y galería en una jerarquía compacta. */
#perfil { overflow-anchor: none; }
#perfil .profile-hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  max-width: 980px;
  margin: 22px auto 0;
  padding: 28px;
  overflow: visible;
}
#perfil .profile-hero::after,
#perfil .profile-visual::after { display: none; }
.profile-social-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.profile-social-heading strong {
  overflow: hidden;
  font-size: 1.15rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-social-heading small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
}
.profile-overview {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
}
#perfil .profile-visual {
  width: 180px;
  min-height: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid #090a0e;
  border-radius: 50%;
  background-color: #c79408;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 2px rgba(255,255,255,.2), 0 18px 44px rgba(0,0,0,.38);
}
.profile-avatar-initial {
  color: #fff;
  font-family: var(--display);
  font-size: 4rem;
}
.profile-visual.has-photo .profile-avatar-initial { display: none; }
#perfil .profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
#perfil .profile-stats div {
  min-width: 0;
  padding: 15px 10px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  text-align: center;
}
#perfil .profile-stats strong {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 850;
}
#perfil .profile-stats small {
  overflow: hidden;
  color: #a6a8b0;
  font-size: .67rem;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#perfil .profile-info {
  display: block;
  padding: 0;
}
#perfil .profile-info h2 {
  margin: 5px 0 0;
  background: none;
  color: #f7f7f8;
  font-family: inherit;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.15;
  font-weight: 850;
  -webkit-text-fill-color: #f7f7f8;
}
#perfil .profile-info p { margin: 0; }
#perfil .profile-nickname { margin: 8px 0 13px; }
#perfil .profile-actions { margin-top: 20px; }
#perfil .edit-profile-button { margin-top: 0; }
.profile-story-add .profile-story-media {
  display: grid;
  place-items: center;
  border-color: rgba(255,255,255,.18);
  background: #0b0c10;
}
.profile-story-add .profile-story-media b {
  color: #f7f7f8;
  font-size: 2rem;
  font-weight: 300;
}

@media (max-width: 760px) {
  /* Al bajar se compacta; nunca desaparece. */
  .floating-tab-bar,
  .floating-tab-bar .app-tab,
  .floating-tab-bar .app-tab svg,
  .floating-tab-bar .profile-tab-photo {
    transition: left .14s ease, width .14s ease, min-height .14s ease,
      padding .14s ease, border-radius .14s ease, transform .14s ease;
  }
  body.mobile-header-hidden:not(.chat-focus) .floating-tab-bar {
    left: 20px;
    width: calc(100vw - 40px);
    min-height: 58px;
    padding: 4px;
    border-radius: 21px;
  }
  body.mobile-header-hidden:not(.chat-focus) .app-tab {
    min-height: 48px;
    padding-block: 4px;
    border-radius: 15px;
  }
  body.mobile-header-hidden:not(.chat-focus) .app-tab svg {
    width: 22px;
    height: 22px;
  }
  body.mobile-header-hidden:not(.chat-focus) .profile-tab-photo {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  #perfil {
    overflow-x: hidden;
    overflow-y: auto;
  }
  #perfil .profile-hero {
    gap: 14px;
    width: calc(100% + 32px);
    max-width: none;
    margin: 0 -16px;
    padding: 8px 16px 20px;
    border: 0;
    border-radius: 0;
    background: #08090d;
    box-shadow: none;
  }
  .profile-social-heading {
    min-height: 48px;
    justify-content: center;
    padding: 4px 44px 8px;
    border-bottom: 0;
    text-align: center;
  }
  .profile-social-heading strong { font-size: 1rem; }
  .profile-social-heading small { display: none; }
  .profile-overview {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 17px;
  }
  #perfil .profile-visual {
    width: 94px;
    height: 94px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.22);
  }
  .profile-avatar-initial { font-size: 2.5rem; }
  #perfil .profile-stats { gap: 3px; }
  #perfil .profile-stats div {
    padding: 8px 2px;
    background: transparent;
  }
  #perfil .profile-stats strong { font-size: .94rem; }
  #perfil .profile-stats small {
    margin-top: 3px;
    font-size: clamp(.5rem, 2.3vw, .62rem);
  }
  #perfil .profile-info { padding: 0; }
  #perfil .profile-number { font-size: .68rem; letter-spacing: .08em; }
  #perfil .profile-info h2 {
    margin-top: 5px;
    font-size: 1.05rem;
  }
  #perfil .profile-nickname {
    margin: 4px 0 9px;
    font-size: .63rem;
    letter-spacing: .08em;
  }
  #perfil .profile-info p {
    color: #d0d1d5;
    font-size: .76rem;
    line-height: 1.45;
  }
  #perfil .profile-tags { gap: 6px; margin-top: 12px; }
  #perfil .profile-tags span {
    padding: 6px 9px;
    font-size: .58rem;
  }
  #perfil .profile-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 16px;
  }
  #perfil .profile-actions .edit-profile-button {
    width: 100%;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    color: #f4f4f5;
    background: #292b31;
    box-shadow: none;
    font-size: .72rem;
  }
  #perfil .profile-stories {
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 16px;
    border: 0;
    border-radius: 0;
    background: #08090d;
  }
  #perfil .profile-stories .profile-feed-heading {
    display: block;
    margin-bottom: 12px;
  }
  #perfil .profile-stories .profile-feed-heading .eyebrow { display: none; }
  #perfil .profile-stories .profile-feed-heading h3 {
    margin: 0;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 800;
  }
  #perfil .profile-stories-strip {
    gap: 14px;
    margin-top: 0;
    padding-bottom: 2px;
  }
  #perfil .profile-story-tile {
    width: 74px;
    flex-basis: 74px;
    justify-items: center;
    gap: 7px;
    text-align: center;
  }
  #perfil .profile-story-media {
    width: 72px;
    aspect-ratio: 1;
    padding: 3px;
    border-color: #555b65;
    border-radius: 50%;
  }
  #perfil .profile-story-media img,
  #perfil .profile-story-media video { border-radius: 50%; }
  #perfil .profile-story-tile small {
    width: 100%;
    overflow: hidden;
    color: #e0e1e4;
    font-size: .58rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #perfil .profile-achievements {
    width: calc(100% + 32px);
    margin-inline: -16px;
    padding: 16px;
    background: #08090d;
  }
  #perfil .profile-achievements .profile-feed-heading {
    display: block;
    margin-bottom: 12px;
  }
  #perfil .profile-achievements .profile-feed-heading .eyebrow { display: none; }
  #perfil .profile-achievements .profile-feed-heading h3 {
    margin: 0;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 800;
  }
  #perfil .achievement-showcase {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #perfil .achievement-showcase::-webkit-scrollbar { display: none; }
  #perfil .achievement-card { flex: 0 0 230px; }
  #perfil .profile-feed {
    width: calc(100% + 32px);
    margin: 6px -16px 0;
  }
  #perfil .profile-feed > .profile-feed-heading {
    min-height: 48px;
    display: grid;
    place-items: center;
    margin: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  #perfil .profile-feed > .profile-feed-heading .eyebrow { display: none; }
  #perfil .profile-feed > .profile-feed-heading h3 {
    margin: 0;
    color: #f0f0f2;
    font-family: inherit;
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  #perfil .profile-posts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
  }
  #perfil .profile-posts-grid .profile-post-card {
    border: 0;
    border-radius: 0;
    background: #08090d;
  }
  #perfil .profile-posts-grid .media-frame { aspect-ratio: 1; }
  #perfil .profile-posts-grid .media-frame img,
  #perfil .profile-posts-grid .media-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  #perfil .profile-posts-grid .media-card-info { display: none; }
  #perfil .profile-empty { grid-column: 1 / -1; }
}

/* Publicación inmersiva abierta desde la cuadrícula del perfil. */
body.post-viewer-open { overflow: hidden; }
body.post-viewer-open .floating-tab-bar { visibility: hidden; }
.post-viewer {
  position: fixed;
  z-index: 2450;
  inset: 0;
  display: grid;
  justify-items: center;
  overflow: hidden;
  background: #08090d;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.post-viewer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.post-viewer-shell {
  width: min(760px, 100%);
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #f5f5f7;
  background: #08090d;
  scrollbar-width: thin;
}
.post-viewer-topbar {
  position: sticky;
  z-index: 35;
  top: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(8,9,13,.97);
}
.post-viewer-topbar > div {
  grid-column: 2;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}
.post-viewer-topbar strong {
  font-size: .92rem;
  font-weight: 850;
}
.post-viewer-topbar small {
  max-width: 100%;
  overflow: hidden;
  color: #bec0c7;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-viewer-back {
  grid-column: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  color: #f6f6f7;
  background: #22252b;
  cursor: pointer;
}
.post-viewer-back svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.post-viewer-author-row {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
}
.post-viewer-author {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.post-viewer-author .avatar.small {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(255,255,255,.3);
}
.post-viewer-author > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.post-viewer-author strong,
.post-viewer-author small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-viewer-author strong { font-size: .88rem; }
.post-viewer-author small { color: #b1b3ba; font-size: .68rem; }
.post-viewer-media {
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #030407;
}
.post-viewer-media img,
.post-viewer-media video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #030407;
}
.post-viewer-details {
  display: grid;
  gap: 9px;
  padding: 12px 17px 32px;
}
.post-viewer-actions {
  min-height: 38px;
  gap: 14px;
}
.post-viewer-actions button { color: #f5f5f7; }
.post-viewer-actions svg { width: 29px; height: 29px; stroke-width: 1.7; }
.post-viewer-actions .media-like-button.liked { color: #ff4057; }
.post-viewer-likes {
  width: fit-content;
  padding: 0;
  border: 0;
  color: #f2f2f4;
  background: transparent;
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}
.post-viewer-caption {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  color: #e7e8eb;
  font-size: .8rem;
  line-height: 1.45;
}
.post-viewer-caption strong { flex: 0 0 auto; color: #fff; }
.post-viewer-caption span { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-viewer-details time {
  color: #858891;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}
body.post-viewer-open #mediaReplyModal,
body.post-viewer-open #shareMediaModal { z-index: 2700; }

@media (max-width: 760px) {
  .post-viewer-shell { width: 100vw; }
  .post-viewer-topbar {
    min-height: calc(62px + env(safe-area-inset-top, 0px));
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
  }
  .post-viewer-back { width: 40px; height: 40px; }
  .post-viewer-author-row {
    min-height: 64px;
    padding: 9px calc(13px + env(safe-area-inset-right, 0px)) 9px calc(13px + env(safe-area-inset-left, 0px));
  }
  .post-viewer-details {
    padding-right: calc(14px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(14px + env(safe-area-inset-left, 0px));
  }
}

/* Administración compacta: las herramientas permanecen plegadas y cada miembro abre su ficha. */
.admin-tool-disclosure {
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}
.admin-tool-disclosure > summary {
  min-height: 74px;
  margin: 0;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.admin-tool-disclosure > summary::-webkit-details-marker { display: none; }
.admin-tool-disclosure > summary h3 { margin: 4px 0 0; }
.admin-disclosure-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  color: #d9d9dc;
  font-size: 1.3rem;
  transition: transform .2s ease, background .2s ease;
}
.admin-tool-disclosure[open] .admin-disclosure-icon {
  background: rgba(214,166,46,.1);
  transform: rotate(180deg);
}
.admin-tool-content {
  padding: 0 20px 22px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.admin-users-panel { padding: 20px; }
.admin-member-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.admin-member-card {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 15px;
  color: var(--text);
  background: rgba(255,255,255,.025);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.admin-member-card:focus-visible {
  border-color: rgba(168,168,168,.38);
  background: rgba(168,168,168,.055);
  outline: none;
  transform: translateY(-1px);
}

@media (hover: hover) and (pointer: fine) { .admin-member-card:hover {
  border-color: rgba(168,168,168,.38);
  background: rgba(168,168,168,.055);
  outline: none;
  transform: translateY(-1px);
} }
.admin-member-avatar,
.admin-member-avatar .avatar {
  width: 46px;
  height: 46px;
}
.admin-member-avatar .avatar { border: 1px solid rgba(255,255,255,.2); }
.admin-member-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.admin-member-copy strong,
.admin-member-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-member-copy strong { font-size: .8rem; }
.admin-member-copy small { color: #8f9199; font-size: .65rem; }
.admin-member-card .account-status { color: #aaaeb6; font-size: .64rem; }

.profile-admin-actions {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.profile-admin-actions[hidden] { display: none !important; }
.profile-admin-actions-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.profile-admin-actions-heading span {
  color: var(--gold-soft);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
}
.profile-admin-actions-heading small { color: var(--muted); font-size: .62rem; }
.profile-admin-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.profile-admin-action-grid button {
  width: 100%;
  min-height: 42px;
  margin: 0;
}
.profile-admin-action-grid .danger {
  color: #ff9c9c;
  border-color: rgba(225,77,77,.3);
  background: rgba(150,35,35,.11);
}

/* Al gestionar a otro miembro, el editor es una página independiente también en escritorio. */
@media (min-width: 761px) {
  #profileEditor.admin-member-editor {
    place-items: stretch;
    padding: 0;
    background: #08090d;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  #profileEditor.admin-member-editor .profile-editor-modal {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding: 24px max(24px, calc((100vw - 840px) / 2));
    border: 0;
    border-radius: 0;
    background: #08090d;
    box-shadow: none;
  }
  #profileEditor.admin-member-editor .modal-heading,
  #profileEditor.admin-member-editor .profile-form {
    width: min(840px, 100%);
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 760px) {
  #administracion {
    padding-right: 14px;
    padding-left: 14px;
  }
  #administracion .section-intro { gap: 12px; }
  #administracion .section-intro h2 { font-size: clamp(2rem, 12vw, 3rem); }
  #administracion .admin-heading-actions p { display: none; }
  #administracion .admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  #administracion .admin-stat-card {
    min-width: 0;
    padding: 13px 8px;
    border-radius: 12px;
    text-align: center;
  }
  #administracion .admin-stat-card span { font-size: .48rem; letter-spacing: .06em; }
  #administracion .admin-stat-card strong { margin-top: 6px; font-size: 1.55rem; }
  #administracion .admin-stat-card small { display: none; }
  .admin-tool-disclosure > summary { min-height: 64px; padding: 14px; }
  .admin-tool-disclosure > summary h3 { font-size: .86rem; }
  .admin-tool-content { padding: 0 14px 16px; }
  .admin-users-panel { padding: 14px; }
  .admin-users-panel .panel-heading { align-items: flex-start; }
  .admin-users-panel .admin-badge { max-width: 145px; text-align: right; line-height: 1.35; }
  .admin-member-list { margin-top: 13px; }
  .admin-member-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 68px;
    padding: 10px;
    border-radius: 13px;
  }
  .admin-member-card .account-status { display: none; }
  .admin-member-card .role-chip { font-size: .48rem; }
  #profileEditor .profile-admin-actions {
    gap: 11px;
    padding: 16px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    border-radius: 0;
    background: #08090d;
  }
  #profileEditor .profile-admin-actions-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  #profileEditor .profile-admin-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #profileEditor .profile-admin-action-grid button {
    min-height: 44px;
    padding: 9px 8px;
    border-radius: 10px;
    font-size: .65rem;
  }
}

/* Capa final de autoridad visual. Se mantiene al final para neutralizar estilos heredados. */
body.authenticated .topbar {
  border-bottom-color: var(--bb-line);
  background: rgba(7,8,10,.9);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}
body.authenticated .top-create-button {
  color: #11100c;
  border-color: rgba(255,226,135,.28);
  background: linear-gradient(145deg, var(--bb-gold-light), #c98c19);
}
body.authenticated .floating-tab-bar {
  min-height: 72px;
  border-color: rgba(255,255,255,.14);
  background: rgba(10,11,14,.94);
  box-shadow: var(--bb-shadow-float);
  backdrop-filter: blur(18px) saturate(128%);
  -webkit-backdrop-filter: blur(18px) saturate(128%);
}
body.authenticated .floating-tab-bar::before {
  border-color: rgba(230,185,63,.17);
  background: linear-gradient(150deg, rgba(255,255,255,.105), rgba(230,185,63,.1));
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 7px 22px rgba(0,0,0,.15);
  transition: transform .3s cubic-bezier(.2,.85,.25,1.08), width .18s ease, inset .18s ease;
}
body.authenticated .app-tab { color: #858993; transition: color .15s ease, transform .15s var(--bb-ease); }
body.authenticated .app-tab.active { color: var(--bb-text); background: transparent; box-shadow: none; }
body.authenticated .app-tab.active::after { background: var(--interaction-strong); box-shadow: 0 0 10px rgba(186,186,186,.58); }
body.authenticated .app-tab.active svg,
body.authenticated .app-tab.active .profile-tab-photo { transform: none; }

/* Avatar de perfil independiente: dimensiones y recorte fijos en el dock iOS. */
body.authenticated .profile-tab-photo {
  box-sizing: border-box;
  display: block;
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 3px solid #09090b;
  border-radius: 50%;
  background: #272017;
  box-shadow: 0 0 0 2px rgba(0,0,0,.65);
  color: #f5c94e;
  font-size: .8rem;
  font-weight: 700;
  line-height: 36px;
  text-align: center;
}
body.authenticated .profile-tab-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

body.authenticated .panel,
body.authenticated .hero-card,
body.authenticated .home-news-section,
body.authenticated .profile-hero,
body.authenticated .profile-stories,
body.authenticated .profile-achievements {
  border-color: var(--bb-line);
  background: linear-gradient(155deg, rgba(20,22,27,.98), rgba(9,10,13,.985));
  box-shadow: var(--bb-shadow-card);
}
body.authenticated .primary-button,
body.authenticated .send-button {
  border: 1px solid rgba(255,231,160,.3);
  border-radius: 14px;
  color: #100d07;
  background: linear-gradient(135deg, var(--bb-gold-light), #d69d23 72%, #b37710);
  box-shadow: 0 10px 26px rgba(194,136,20,.18), inset 0 1px rgba(255,255,255,.45);
}

body.authenticated #contenido .stories-section {
  border-color: var(--bb-line);
  background: linear-gradient(145deg, rgba(16,18,22,.96), rgba(9,10,13,.98));
  box-shadow: var(--bb-shadow-card);
}
body.authenticated #contenido .publications-feed .feed-post-card {
  border-color: var(--bb-line);
  background: var(--bb-surface);
  box-shadow: var(--bb-shadow-card);
}
body.authenticated .feed-post-author .avatar.small {
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 0 0 3px var(--bb-surface), 0 0 0 4px rgba(230,185,63,.32);
}
body.authenticated .feed-post-menu-popover {
  border-color: var(--bb-line-strong);
  background: rgba(18,20,25,.985);
  box-shadow: var(--bb-shadow-float);
}
body.authenticated .feed-post-info .feed-post-actions button:active { transform: scale(.84); }
body.authenticated .media-like-button.liked { color: var(--bb-danger) !important; }

body.authenticated .chat-inbox,
body.authenticated .chat-panel,
body.authenticated .private-conversation { border-color: var(--bb-line); background: #0a0c0f; }
body.authenticated .private-contact {
  min-height: 74px;
  margin-inline: 8px;
  border-color: transparent;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  transition: border-color .14s ease, background .14s ease, transform .14s var(--bb-ease);
}
@media (hover: hover) and (pointer: fine) { body.authenticated .private-contact:hover { border-color: var(--bb-line); background: rgba(255,255,255,.035); } }
body.authenticated .private-contact.active {
  border-color: rgba(186,186,186,.25);
  background: linear-gradient(135deg, rgba(186,186,186,.11), rgba(255,255,255,.025));
  box-shadow: inset 3px 0 var(--interaction-strong);
}
body.authenticated .messages {
  background: radial-gradient(circle at 50% 0%, rgba(230,185,63,.035), transparent 25rem), #080a0c;
}
body.authenticated .message-bubble {
  border-color: rgba(255,255,255,.07);
  border-radius: 18px 18px 18px 6px;
  background: #171a1f;
  box-shadow: 0 5px 18px rgba(0,0,0,.14);
}
body.authenticated .message.own .message-bubble,
body.authenticated .private-message.own .message-bubble {
  border-color: rgba(230,185,63,.16);
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(145deg, #2b2415, #211c13);
}
body.authenticated .message-form {
  border-color: var(--bb-line);
  background: rgba(16,18,22,.97);
  box-shadow: 0 -12px 36px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.authenticated .news-card,
body.authenticated .member-card,
body.authenticated .member-mini-card,
body.authenticated .search-result,
body.authenticated .admin-member-card,
body.authenticated .help-request-item {
  border-color: var(--bb-line);
  background: linear-gradient(150deg, rgba(20,22,27,.96), rgba(11,12,15,.98));
  box-shadow: inset 0 1px rgba(255,255,255,.03);
  transition: border-color .15s ease, background .15s ease, transform .15s var(--bb-ease), box-shadow .15s ease;
}
@media (hover: hover) and (pointer: fine) { body.authenticated .news-card:hover, body.authenticated .member-card:hover, body.authenticated .member-mini-card:hover, body.authenticated .search-result:hover, body.authenticated .admin-member-card:hover {
  border-color: rgba(186,186,186,.3);
  box-shadow: 0 16px 40px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.04);
  transform: translateY(-2px);
} }

body.authenticated #perfil .profile-hero {
  border-radius: 28px;
  background: radial-gradient(circle at 88% 2%, rgba(230,185,63,.08), transparent 19rem), linear-gradient(155deg, #121419, #090a0d);
}
body.authenticated #perfil .profile-stats div { background: rgba(255,255,255,.028); }
body.authenticated #perfil .profile-info h2 { color: var(--bb-text); letter-spacing: -.035em; }
body.authenticated #perfil .profile-tags span {
  border-color: rgba(255,255,255,.09);
  color: #d6d7db;
  background: rgba(255,255,255,.035);
}

body.authenticated .achievement-card,
body.authenticated .admin-achievement-card {
  border-color: color-mix(in srgb, var(--achievement-metal) 44%, transparent);
  background: radial-gradient(circle at 8% 15%, var(--achievement-glow), transparent 38%), linear-gradient(145deg, #15171b, #0c0d10);
  box-shadow: inset 0 1px rgba(255,255,255,.055), 0 12px 32px rgba(0,0,0,.18);
}
body.authenticated .achievement-emblem {
  position: relative;
  color: #17130b;
  background: linear-gradient(145deg, color-mix(in srgb, var(--achievement-metal) 62%, white), var(--achievement-metal));
  box-shadow: 0 0 0 5px var(--achievement-glow), 0 13px 30px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.62);
}

@media (max-width: 760px) {
  body.authenticated .topbar { background: rgba(7,8,10,.96); backdrop-filter: none; -webkit-backdrop-filter: none; }
  body.authenticated .floating-tab-bar {
    left: 12px;
    right: auto;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px);
    min-height: 64px;
    padding: 5px;
    border-radius: 24px;
    background: rgba(12,13,16,.97);
    transform: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.authenticated .floating-tab-bar::before { border-radius: 18px; }
  body.authenticated .app-tab { min-height: 52px; padding: 5px 3px; border-radius: 18px; }
  body.authenticated .app-tab > span:last-child { display: none; }
  body.authenticated.mobile-header-hidden:not(.chat-focus) .floating-tab-bar {
    left: 18px;
    width: calc(100vw - 36px);
    min-height: 56px;
  }
  body.authenticated #contenido .stories-section {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body.authenticated #contenido .publications-feed .feed-post-card {
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.055);
    border-radius: 0;
    background: var(--bb-bg);
    box-shadow: none;
  }
  body.authenticated .feed-post-author .avatar.small {
    box-shadow: 0 0 0 2px var(--bb-bg), 0 0 0 3px rgba(230,185,63,.3);
  }
  body.authenticated .chat-inbox,
  body.authenticated .chat-panel,
  body.authenticated .private-conversation { border-radius: 0; }
  body.authenticated.chat-focus .message-form {
    border: 1px solid var(--bb-line-strong);
    border-radius: 24px;
    background: #17191e;
    box-shadow: 0 8px 30px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.045);
  }
  body.authenticated #perfil .profile-hero,
  body.authenticated #perfil .profile-stories,
  body.authenticated #perfil .profile-achievements { border-radius: 0; background: var(--bb-bg); box-shadow: none; }
}

/* iOS amplía al enfocar controles con texto menor de 16 px. Estos tamaños evitan
   el zoom de teclado en la PWA sin alterar etiquetas, botones ni iconos. */
@media (max-width: 760px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  textarea,
  select,
  [contenteditable="true"] {
    font-size: 16px !important;
  }

  body.standalone-app input,
  body.standalone-app textarea,
  body.standalone-app select,
  body.standalone-app [contenteditable="true"] {
    touch-action: manipulation;
  }
}

/* Own profile editor: compact field cards and a full-screen account page. */
#profileEditor:not(.admin-member-editor) {
  z-index:2650;
  display:block;
  padding:0;
  overflow:hidden;
  background:var(--club-paper,#101216);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
#profileEditor:not(.admin-member-editor) .profile-editor-modal {
  width:100%;
  height:100dvh;
  max-height:none;
  padding:0;
  overflow-x:hidden;
  overflow-y:auto;
  border:0;
  border-radius:0;
  background:var(--club-paper,#101216);
  box-shadow:none;
  overscroll-behavior:contain;
}
#profileEditor:not(.admin-member-editor) .modal-heading {
  position:sticky;
  top:0;
  z-index:20;
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 44px;
  align-items:center;
  min-height:calc(64px + env(safe-area-inset-top,0px));
  margin:0;
  padding:max(8px,env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 8px max(16px,env(safe-area-inset-left,0px));
  border-bottom:1px solid var(--club-line,#ffffff14);
  background:var(--club-paper,#101216);
}
#profileEditor:not(.admin-member-editor) .modal-heading > div { grid-area:1 / 2; text-align:center; min-width:0; }
#profileEditor:not(.admin-member-editor) .modal-heading .eyebrow { display:none; }
#profileEditor:not(.admin-member-editor) .modal-heading h2 { margin:0; font:600 17px/1.3 var(--font-body,sans-serif); letter-spacing:-.02em; }
#profileEditor:not(.admin-member-editor) .profile-editor-back { grid-area:1 / 1; width:44px; height:44px; padding:10px; border:1px solid var(--club-line,#ffffff24); border-radius:50%; background:#25282e; color:var(--club-white,#f1eee7); }
#profileEditor:not(.admin-member-editor) .profile-form { display:block; width:min(100%,580px); margin:auto; padding:0 max(18px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(18px,env(safe-area-inset-left,0px)); }
#profileEditor:not(.admin-member-editor) .avatar-editor { display:flex; flex-direction:column; align-items:center; gap:12px; padding:28px 0; border:0; background:transparent; }
#profileEditor:not(.admin-member-editor) .avatar-preview { width:96px; height:96px; flex:0 0 96px; border:1px solid #bca46c70; border-radius:50%; box-shadow:none; }
#profileEditor:not(.admin-member-editor) .avatar-actions { justify-content:center; gap:12px; }
#profileEditor:not(.admin-member-editor) .avatar-actions .file-button,
#profileEditor:not(.admin-member-editor) .avatar-actions .text-button { min-height:36px; padding:5px 8px; border:0; background:transparent; color:var(--club-gold,#c4ad7e); box-shadow:none; font-size:13px; font-weight:500; }
#profileEditor:not(.admin-member-editor) .avatar-actions .danger-text { color:var(--club-muted,#959aa3); }
#profileEditor:not(.admin-member-editor) .avatar-editor > small { margin:0; color:var(--club-muted,#959aa3); font-size:10px; }
#profileEditor:not(.admin-member-editor) .profile-form > label,
#profileEditor:not(.admin-member-editor) .admin-profile-fields > label { display:block; min-height:0; margin:0 0 14px; padding:12px 15px 9px; border:1px solid var(--club-line,#ffffff24); border-radius:14px; background:#ffffff02; }
#profileEditor:not(.admin-member-editor) .profile-form > label > span,
#profileEditor:not(.admin-member-editor) .admin-profile-fields > label > span { display:block; margin:0 0 2px; color:var(--club-muted,#959aa3); font-size:12px; font-weight:400; }
#profileEditor:not(.admin-member-editor) .profile-form > label > :is(input,textarea,select),
#profileEditor:not(.admin-member-editor) .admin-profile-fields > label > :is(input,select) { width:100%; min-height:34px; margin:0; padding:5px 0; border:0; border-radius:0; background:transparent; color:#f1eee7; box-shadow:none; font:400 15px/1.5 var(--font-body,sans-serif); }
#profileEditor:not(.admin-member-editor) .profile-form > label > textarea { min-height:80px; resize:vertical; }
#profileEditor:not(.admin-member-editor) .profile-form label:focus-within { border-color:var(--interaction-strong); }
#profileEditor:not(.admin-member-editor) .profile-form > label > :is(input,textarea,select):focus,
#profileEditor:not(.admin-member-editor) .admin-profile-fields > label > :is(input,select):focus { box-shadow:none; }
#profileEditor:not(.admin-member-editor) .profile-form > label > small,
#profileEditor:not(.admin-member-editor) .admin-profile-fields > label > small { display:block; margin:4px 0 0; color:var(--club-muted,#959aa3); font-size:10px; line-height:1.5; }
#profileEditor:not(.admin-member-editor) .admin-profile-fields { display:block; padding:0; border:0; background:transparent; }
#profileEditor:not(.admin-member-editor) .admin-profile-fields-heading { display:none; }
#profileEditor:not(.admin-member-editor) .form-feedback { min-height:0; padding:8px 0; font-size:12px; }
#profileEditor:not(.admin-member-editor) .modal-actions { position:sticky; bottom:0; z-index:18; display:block; margin:12px 0 0; padding:12px 0 max(12px,env(safe-area-inset-bottom,0px)); border:0; background:var(--club-paper,#101216); }
#profileEditor:not(.admin-member-editor) #cancelProfileEditor { display:none; }
#profileEditor:not(.admin-member-editor) .modal-actions .primary-button { width:100%; min-height:46px; border-radius:14px; }

/* Agenda del club: mes compacto y edición específica para cada fecha. */
#calendario { --agenda-accent: #d3b46a; --agenda-pink: #e4a8bd; }
#calendario .club-calendar-heading { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:22px; }
#calendario .club-calendar-heading h2 { margin:8px 0; font-size:clamp(1.7rem,4vw,2.6rem); letter-spacing:-.04em; }
#calendario .club-calendar-heading p { margin:0; color:var(--muted); font-size:.88rem; line-height:1.5; }
#calendario .calendar-actions { margin:0 0 22px; }
#calendario .calendar-actions button { min-height:44px; border-radius:13px; }
#calendario .calendar-layout { grid-template-columns:minmax(0,1.3fr) minmax(300px,1fr); align-items:start; gap:24px; }
#calendario .calendar-month-panel { padding:24px; border-radius:24px; background:linear-gradient(145deg,#191c21,#111419); }
#calendario .calendar-toolbar { margin:0 0 22px; }
#calendario .calendar-navigation { width:100%; }
#calendario .calendar-navigation h3 { min-width:0; flex:1; font-size:1.15rem; font-family:inherit; font-weight:650; }
#calendario .calendar-navigation .icon-button { width:40px; height:40px; min-height:40px; border:1px solid rgba(255,255,255,.09); border-radius:12px; background:#202329; font:300 1.8rem/1 inherit; }
#calendario .calendar-grid { padding:0; gap:5px; }
#calendario .calendar-weekday { padding:0 0 12px; color:#91979f; font-size:.68rem; }
#calendario .calendar-day { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:66px; padding:8px 2px; border:1px solid transparent; border-radius:12px; background:transparent; text-align:center; box-shadow:none; }
#calendario .calendar-day.outside { opacity:0; pointer-events:none; }
#calendario .calendar-day:focus-visible { border-color:rgba(181,181,181,.4); background:rgba(181,181,181,.07); }

@media (hover: hover) and (pointer: fine) { #calendario .calendar-day:hover { border-color:rgba(181,181,181,.4); background:rgba(181,181,181,.07); } }
#calendario .calendar-day > .calendar-day-number { width:30px; height:30px; margin:0; font-size:.88rem; font-weight:600; background:none; color:var(--text); }
#calendario .calendar-day.today > .calendar-day-number { color:var(--agenda-accent); }
#calendario .calendar-day.selected { border-color:rgba(181,181,181,.6); background:rgba(181,181,181,.14); box-shadow:inset 0 0 0 1px rgba(181,181,181,.1); }
#calendario .calendar-day.selected > .calendar-day-number { color:#e6e6e6; }
#calendario .calendar-day > .calendar-dots { display:flex; align-items:center; justify-content:center; gap:3px; width:auto; height:7px; margin:5px 0 0; background:none; }
#calendario .calendar-dots i,.calendar-legend i { display:inline-block; width:4px; height:4px; border-radius:50%; background:var(--agenda-accent); }
#calendario .calendar-dots i.birthday,.calendar-legend i.birthday { background:var(--agenda-pink); }
#calendario .calendar-legend { display:flex; justify-content:center; flex-wrap:wrap; gap:20px; padding-top:18px; margin:18px 0 0; border-top:1px solid rgba(255,255,255,.06); font-size:.7rem; color:var(--muted); }
#calendario .calendar-legend span { display:flex; align-items:center; gap:7px; }
#calendario .calendar-legend i { width:6px; height:6px; }
#calendario .calendar-agenda-panel { padding:24px; border-radius:24px; background:#101318; }
.calendar-agenda-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.calendar-count { color:#a5a9b1; font-size:.68rem; font-weight:600; }
#calendarSelectedTitle { margin:13px 0 20px; font-size:1.15rem; letter-spacing:-.025em; text-transform:capitalize; }
.calendar-agenda-event { display:flex; align-items:flex-start; gap:14px; padding:18px 0; border-top:1px solid rgba(255,255,255,.07); }
.calendar-agenda-event:first-child { border-top:0; padding-top:0; }
.calendar-event-date { display:flex; flex-direction:column; flex:0 0 46px; align-items:center; padding:8px 3px; border-radius:12px; background:rgba(211,180,106,.08); color:#d3b46a; }
.calendar-event-date strong { font-size:1.15rem; font-weight:600; }
.calendar-event-date span { font-size:.62rem; text-transform:uppercase; margin-top:3px; }
.calendar-agenda-event.birthday .calendar-event-date { background:rgba(228,168,189,.07); color:#e4a8bd; }
.calendar-event-copy { min-width:0; flex:1; }
.calendar-event-type { color:#959ba4; font-size:.66rem; }
.calendar-event-copy h4 { margin:5px 0 7px; font-size:.94rem; line-height:1.35; font-family:inherit; letter-spacing:-.015em; overflow-wrap:anywhere; }
.calendar-event-copy p { color:var(--muted); margin:5px 0; font-size:.78rem; line-height:1.5; overflow-wrap:anywhere; }
.calendar-edit-event { border:0; background:none; padding:5px 0; color:#d3b46a; font-size:.7rem; font-family:inherit; cursor:pointer; }
.calendar-month-agenda { margin-top:24px; padding-top:22px; border-top:1px solid rgba(255,255,255,.09); }
.calendar-month-agenda .calendar-agenda-heading { margin-bottom:20px; }
.calendar-agenda-event.compact { padding:14px 0; }
.calendar-agenda-event.compact h4 { font-size:.82rem; }
.calendar-agenda-event.compact .calendar-event-date { flex-basis:36px; padding:6px 2px; }
.calendar-agenda-event.compact .calendar-event-date strong { font-size:.96rem; }
.calendar-empty-day { padding:20px 0 8px; }
.calendar-empty-day > span { display:grid; place-items:center; width:38px; height:38px; margin-bottom:15px; background:rgba(211,180,106,.08); color:#d3b46a; border-radius:12px; }
.calendar-empty-day strong { font-size:.9rem; }
.calendar-empty-day p,.calendar-month-empty { color:var(--muted); font-size:.78rem; line-height:1.6; }
#eventEditor { --editor-accent:#d3b46a; }
#eventEditor.is-birthday { --editor-accent:#e4a8bd; }
#eventEditor .calendar-editor { width:min(590px,100%); padding:28px; border-radius:26px; background:radial-gradient(ellipse at top left,rgba(211,180,106,.065),transparent 55%),#101318; border-color:rgba(211,180,106,.2); }
#eventEditor.is-birthday .calendar-editor { border-color:rgba(228,168,189,.22); background:radial-gradient(ellipse at top left,rgba(228,168,189,.075),transparent 55%),#101318; }
#eventEditor .modal-heading { display:flex; align-items:flex-start; margin-bottom:8px; gap:16px; }
#eventEditor .eyebrow { color:var(--editor-accent); }
#eventEditor h2 { font-family:inherit; font-weight:650; letter-spacing:-.04em; font-size:1.65rem; margin:9px 0 0; }
#eventEditor .calendar-editor-intro { margin:0 0 24px; color:#9199a5; line-height:1.5; font-size:.84rem; }
#eventEditor .icon-button { flex-shrink:0; width:38px; height:38px; min-height:38px; background:rgba(255,255,255,.04); border-color:rgba(255,255,255,.08); border-radius:50%; }
#eventEditor .calendar-event-form { gap:18px; }
#eventEditor .event-kind-picker { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0 0 3px; }
#eventEditor [hidden] { display:none!important; }
#eventEditor .event-kind-picker button { display:flex; align-items:center; gap:10px; padding:14px 12px; background:#171b21; border:1px solid rgba(255,255,255,.08); border-radius:15px; color:#999faa; text-align:left; font-family:inherit; cursor:pointer; }
#eventEditor .event-kind-picker button[aria-pressed="true"] { color:var(--text); background:color-mix(in srgb,var(--interaction-strong) 10%,#101318); border-color:color-mix(in srgb,var(--interaction-strong) 65%,transparent); }
#eventEditor .event-kind-picker button:disabled { cursor:default; opacity:1; }
#eventEditor .event-kind-icon { color:var(--editor-accent); font-size:1.3rem; }
#eventEditor .event-kind-picker strong { display:block; font-size:.8rem; font-weight:600; }
#eventEditor .event-kind-picker small { display:block; font-size:.67rem; color:var(--muted); margin-top:4px; }
#eventEditor .calendar-event-form label { gap:9px; }
#eventEditor .calendar-event-form label > span { color:#c3c7cd; font-weight:500; font-size:.75rem; }
#eventEditor label small { font-weight:400; font-size:.66rem; color:#737c88; margin-left:5px; }
#eventEditor input:not([type="hidden"]),#eventEditor textarea { min-width:0; width:100%; min-height:49px; border-radius:12px; background:#0c0f14; border:1px solid #2a3039; padding:12px 13px; color:var(--text); font-family:inherit; font-size:.87rem; box-sizing:border-box; color-scheme:dark; }
#eventEditor textarea { resize:vertical; line-height:1.5; min-height:84px; }
#eventEditor input:focus,#eventEditor textarea:focus { outline:none; border-color:var(--interaction-strong); box-shadow:0 0 0 3px color-mix(in srgb,var(--interaction-strong) 10%,transparent); }
#eventEditor .event-title-field input { font-size:1rem; }
#eventEditor input::placeholder,#eventEditor textarea::placeholder { color:#69717e; }
#eventEditor .birthday-all-day-note { border:0; padding:14px; background:rgba(228,168,189,.06); border-radius:13px; }
#eventEditor .birthday-all-day-note > span { color:var(--editor-accent); font-size:1.4rem; }
#eventEditor .birthday-all-day-note strong { font-size:.8rem; font-weight:500; }
#eventEditor .birthday-all-day-note small { font-size:.72rem; }
#eventEditor .event-modal-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding-top:16px; margin-top:0; border-top:1px solid rgba(255,255,255,.07); }
#eventEditor .event-modal-actions .danger-text { margin-right:auto; font-size:.72rem; }
#eventEditor .event-modal-actions .primary-button { margin-left:auto; min-height:46px; border-radius:12px; background:var(--editor-accent); color:#101318; }
#eventEditor .event-modal-actions .secondary-button { min-height:46px; border-radius:12px; font-size:.8rem; }
#eventEditor .form-feedback:empty { display:none; }
#eventEditor .form-feedback { font-size:.77rem; }
@media(max-width:900px) { #calendario .calendar-layout { grid-template-columns:1fr; } }
@media(max-width:620px) {
  #calendario .club-calendar-heading { gap:12px; }
  #calendario .club-calendar-heading .secondary-button { min-width:52px; min-height:40px; padding:8px 12px; }
  #calendario .calendar-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
  #calendario .calendar-actions button { width:100%; padding:10px 8px; font-size:.72rem; min-height:45px; }
  #calendario .calendar-month-panel,#calendario .calendar-agenda-panel { padding:18px 14px; border-radius:20px; }
  #calendario .calendar-toolbar { margin-bottom:20px; }
  #calendario .calendar-navigation h3 { font-size:1.05rem; }
  #calendario .calendar-grid { gap:3px; }
  #calendario .calendar-day { min-height:48px; border-radius:10px; padding:4px 0; }
  #calendario .calendar-day > .calendar-day-number { font-size:.82rem; height:25px; width:25px; }
  #calendario .calendar-day > .calendar-dots { margin-top:3px; }
  #eventEditor .calendar-editor { padding:22px 18px; border-radius:22px; }
  #eventEditor .event-kind-picker button { padding:13px 10px; gap:8px; }
  #eventEditor .event-date-fields { grid-template-columns:1fr; gap:18px; }
  #eventEditor input[type="datetime-local"],#eventEditor input[type="date"] { display:block; appearance:none; -webkit-appearance:none; line-height:24px; }
  #eventEditor .event-modal-actions { gap:8px; }
  #eventEditor .event-modal-actions .primary-button { flex:1; }
  #eventEditor .event-modal-actions .danger-text:not([hidden]) { width:100%; text-align:left; margin-bottom:4px; }
}

/* Keep the event field inside the available keyboard viewport on iOS. */
body.event-editor-open { overflow:hidden; overscroll-behavior:none; }
#eventEditor { top:var(--event-editor-offset,0px); bottom:auto; height:var(--event-editor-height,100dvh); box-sizing:border-box; }
#eventEditor .calendar-editor { overscroll-behavior:contain; overflow-anchor:none; scroll-padding-block:16px; }
@media(max-width:760px) {
  #eventEditor { align-items:start; padding:calc(var(--pwa-safe-top,0px) + 12px) 12px calc(var(--pwa-safe-bottom,0px) + 12px); }
  #eventEditor .calendar-editor,
  body.standalone-app #eventEditor .calendar-editor {
    max-height:calc(var(--event-editor-height,100dvh) - var(--pwa-safe-top,0px) - var(--pwa-safe-bottom,0px) - 24px);
    transform:none;
  }
  #eventEditor input:not([type="hidden"]),#eventEditor textarea,#eventEditor select { font-size:16px; }
}

/* Account preference supplements the system setting without changing layout or touch targets. */
.motion-preference{padding:16px;border:1px solid #ffffff18;border-radius:18px;background:#ffffff04;display:grid;gap:8px}.motion-preference small{font-size:.74rem;line-height:1.5;color:var(--muted,#9b9ba3)}
.form-draft-note{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:.74rem;color:var(--muted,#9b9ba3);padding:8px 2px}.form-draft-note[hidden]{display:none}.form-draft-note button{background:transparent;color:inherit;border:0;text-decoration:underline;font:inherit;padding:6px}
html[data-reduced-motion="true"] *,html[data-reduced-motion="true"] *::before,html[data-reduced-motion="true"] *::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-delay:0ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0ms!important}
html[data-reduced-motion="true"] .full-art-foil,html[data-reduced-motion="true"] .pack-rarity-vfx{opacity:0!important}
.motion-preference{grid-column:1/-1}.motion-preference[hidden]{display:none}

/* Android supplies its actual system-bar/cutout insets; do not apply the iPhone minimum. */
body.native-android.standalone-app {
  --pwa-safe-top: env(safe-area-inset-top, 0px);
  --pwa-safe-right: env(safe-area-inset-right, 0px);
  --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
  --pwa-safe-left: env(safe-area-inset-left, 0px);
}
