/* ================================================================== *
 * DRAKOTHEPRODUCER TEAM — monocrome brand layer
 * Loaded after base/lobby/room so it can neutralise every coloured token.
 * ================================================================== */

:root {
  --bg: #000000;
  --stage: #000000;
  --tile: #0c0c0c;
  --panel: #070707;
  --panel-2: #101010;
  --toolbar: #000000;
  --titlebar: #000000;

  --text: #ffffff;
  --text-2: #cfcfcf;
  --muted: #8c8c8c;
  --muted-2: #666666;

  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.28);

  /* Single accent: white. Everything that used blue/green/amber is now mono. */
  --blue: #ffffff;
  --blue-hover: #e8e8e8;
  --blue-soft: #dcdcdc;
  --green: #ffffff;
  --green-soft: rgba(255, 255, 255, 0.1);
  --red: #ffffff;
  --red-hover: #e8e8e8;
  --amber: #ffffff;

  --bubble: #131313;
  --bubble-own: #ffffff;

  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.65);
  --shadow-2: 0 18px 50px rgba(0, 0, 0, 0.75);
  --shadow-3: 0 28px 90px rgba(0, 0, 0, 0.85);
}

/* ---------------- brand marks ---------------- */

.logo-wordmark {
  display: block;
  width: auto;
  height: 58px;
  margin-bottom: 18px;
}

@media (max-width: 860px) {
  .logo-wordmark {
    height: 44px;
    margin-bottom: 12px;
  }
}

.brand {
  gap: 10px;
}

.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 12.5px;
  text-transform: uppercase;
  background: none;
  -webkit-text-fill-color: #ffffff;
  color: #ffffff;
}

.brand-sub {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.22em;
  font-size: 10px;
  text-transform: uppercase;
}

.titlebar-mark {
  height: 15px;
  width: auto;
  opacity: 0.92;
}

.gate-logo {
  display: block;
  width: 168px;
  height: auto;
  margin-bottom: 6px;
}

/* ---------------- buttons ---------------- */

.btn-primary {
  background: #ffffff;
  color: #000000;
}

.btn-primary:hover:not(:disabled) {
  background: #e8e8e8;
}

.btn-primary:disabled {
  background: #131313;
  color: #5f5f5f;
  border: 1px solid var(--line);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: #ffffff;
  color: #000000;
}

/* ---------------- shared surfaces ---------------- */

.input {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
}

.input:focus {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.checkbox input:checked {
  background: #ffffff;
  border-color: #ffffff;
}

.checkbox input:checked::after {
  border-color: #000000;
}

:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.toast {
  background: #0d0d0d;
  border-color: var(--line-strong);
}

.toast.is-error {
  border-color: rgba(255, 255, 255, 0.55);
}

.toast.is-ok {
  border-color: rgba(255, 255, 255, 0.28);
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.74);
}

.modal {
  background: #080808;
}

* {
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

/* ---------------- lobby ---------------- */

body.lobby {
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(255, 255, 255, 0.07), transparent 62%),
    radial-gradient(760px 460px at 92% 8%, rgba(255, 255, 255, 0.04), transparent 64%),
    #000000;
}

.nav {
  background: rgba(0, 0, 0, 0.78);
}

.brand-mark svg {
  border-radius: 9px;
  background: #000;
}

.nav-links a:hover,
.nav-link:hover {
  color: #ffffff;
}

.eyebrow {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: #ededed;
}

.eyebrow .dot {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.copy-list svg {
  color: #ffffff;
}

.join-card {
  background: linear-gradient(180deg, #0b0b0b, #040404);
  border-color: var(--line);
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.legal a,
.join-note a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.preview-stage {
  background: radial-gradient(120% 90% at 30% 10%, #1b1b1b, #070707 72%);
}

.preview-fallback {
  color: var(--muted);
}

.avatar {
  background: linear-gradient(145deg, #2c2c2c, #131313);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ctl[aria-pressed='false'] {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

.ctl[aria-pressed='false'] .ctl-icon {
  opacity: 0.75;
}

/* ---------------- room chrome ---------------- */

.titlebar {
  border-bottom-color: var(--line);
}

.security-pill {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.rec-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.rec-dot {
  background: #ffffff;
}

.quality-chip {
  color: #d6d6d6;
}

/* tiles */

.tile {
  background: #0c0c0c;
  border-color: rgba(255, 255, 255, 0.06);
}

.tile.is-speaking {
  border-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 26px rgba(255, 255, 255, 0.12);
}

.tile-avatar {
  background: radial-gradient(120% 100% at 40% 0%, #1d1d1d, #0a0a0a 72%);
}

.tile-label {
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tile-mic {
  color: #e2e2e2;
}

.tile-host {
  color: #ffffff;
}

.tile-badge {
  background: #ffffff;
  color: #000000;
}

.tile-hand {
  background: #ffffff;
  color: #000000;
}

.tile-audio-indicator i {
  background: #ffffff;
}

/* toolbar */

.tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tool[aria-pressed='false'] .tool-icon {
  color: #ffffff;
  opacity: 0.72;
}

.tool[aria-pressed='false'] .tool-label {
  color: var(--muted);
}

.tool.is-active {
  color: #ffffff;
}

.tool.is-active::after {
  background: #ffffff;
}

.tool-badge {
  background: rgba(255, 255, 255, 0.24);
  color: #000000;
  font-weight: 800;
}

.tool-badge.is-dot {
  background: #ffffff;
}

.end-btn {
  color: #ffffff;
}

.end-icon {
  background: #ffffff;
  color: #000000;
}

.end-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.end-btn:hover .end-icon {
  background: #e8e8e8;
}

/* panel + chat */

.panel {
  background: #060606;
  border-color: var(--line);
}

.panel-head {
  border-bottom-color: var(--line);
}

.chat-tab {
  color: var(--muted);
}

.chat-tab.is-active {
  color: #ffffff;
}

.chat-tab.is-active::after {
  background: #ffffff;
}

.tab-avatar {
  border-color: currentColor;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.tab-plus {
  border-color: var(--line-strong);
  color: var(--muted);
}

.chat-system {
  background: rgba(255, 255, 255, 0.07);
  color: #cfcfcf;
}

.msg-avatar {
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.msg-author {
  color: #e6e6e6;
}

.msg-bubble {
  background: #141414;
  color: #e9e9e9;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.msg.is-own .msg-bubble {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.msg.is-own .msg-author {
  color: #ffffff;
}

.msg-private-tag {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.send-btn {
  background: #ffffff;
  color: #000000;
}

.send-btn:disabled {
  background: #151515;
  color: #5f5f5f;
}

.composer-hint {
  color: var(--muted-2);
}

/* participants */

.input-sm {
  background: rgba(255, 255, 255, 0.04);
}

.waiting-block {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: var(--line);
}

.person:hover {
  background: rgba(255, 255, 255, 0.06);
}

.person-tags {
  color: var(--muted);
}

.person-tags .is-host {
  color: #ffffff;
}

.person-menu {
  background: #0b0b0b;
}

.person-menu button.is-danger {
  color: #ffffff;
  font-weight: 650;
}

/* settings */

.settings-group {
  background: rgba(255, 255, 255, 0.035);
}

.switch {
  background: rgba(255, 255, 255, 0.2);
}

.switch:checked {
  background: #ffffff;
}

.switch::after {
  background: #0a0a0a;
}

.switch:not(:checked)::after {
  background: #ffffff;
}

.level-fill {
  background: #ffffff;
}

/* popovers */

.popover {
  background: #0b0b0b;
  border-color: var(--line-strong);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.09);
}

.menu-item.is-on {
  color: #ffffff;
}

.react-grid button,
.float-emoji {
  filter: grayscale(1);
}

.react-grid button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* share view */

.share-view {
  background: #000000;
}

.share-banner {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
}

.sb-dot {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

/* gate + states */

.gate {
  background:
    radial-gradient(900px 480px at 20% -10%, rgba(255, 255, 255, 0.08), transparent 62%),
    radial-gradient(700px 420px at 88% 100%, rgba(255, 255, 255, 0.05), transparent 60%),
    #000000;
}

.gate-card {
  background: #070707;
  border-color: var(--line);
}

.gate-fallback {
  background: radial-gradient(120% 100% at 40% 0%, #1c1c1c, #080808 72%);
}

.gate-label {
  background: rgba(0, 0, 0, 0.62);
}

.gate-mic {
  color: #ffffff;
}

.gate-note {
  color: #d8d8d8;
}

.state-card {
  background: #070707;
}

.state-icon {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.empty-icon {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.stage-empty {
  color: var(--muted);
}

/* 404 */

body:has(.code) {
  background: radial-gradient(700px 400px at 50% -10%, rgba(255, 255, 255, 0.08), transparent 65%), #000;
}

/* ---------------- signaling server control ---------------- */

.server-cfg {
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.server-cfg summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  list-style: none;
}

.server-cfg summary::-webkit-details-marker {
  display: none;
}

.server-cfg summary::after {
  content: '+';
  float: right;
  color: var(--muted-2);
  font-weight: 400;
}

.server-cfg[open] summary::after {
  content: '−';
}

.server-cfg[open] summary {
  color: var(--text);
  margin-bottom: 10px;
}

.server-cfg .field {
  margin-bottom: 8px;
}

.server-cfg .field > label {
  font-size: 11px;
}

.server-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.server-actions .btn {
  flex: 1;
}

/* ---------------- accounts ---------------- */

.acct {
  position: relative;
}

.acct > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.acct > summary::-webkit-details-marker {
  display: none;
}

.acct > summary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.acct-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  padding: 8px;
  border-radius: 12px;
  background: #0b0b0b;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-3);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.acct-mail {
  font-size: 11.5px;
  color: var(--muted);
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acct-pop button {
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}

.acct-pop button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.auth-modal {
  width: min(430px, 100%);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.auth-tab.is-active {
  background: #ffffff;
  color: #000000;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form .field > span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.auth-note {
  min-height: 18px;
  font-size: 12.5px;
  color: #e8e8e8;
  text-align: center;
}

.auth-legal {
  text-align: center;
  line-height: 1.55;
}

/* ---------------- marca en navegación y cabecera ---------------- */

.brand {
  gap: 10px;
}

.brand-logo {
  height: 30px;
  width: 30px;
  border-radius: 8px;
}

.brand-wordmark {
  height: 34px;
  width: auto;
  display: block;
}

.brand-text {
  display: none;
}

.brand-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.logo-hero {
  height: 84px;
  width: auto;
  display: block;
}

.brand-claim {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------- secciones informativas ---------------- */

.steps,
.download-cta {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 44px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--line);
}

.steps-title {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.steps-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.steps-list li {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.step-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted-2);
}

.steps-list h3 {
  margin: 10px 0 6px;
  font-size: 15px;
  font-weight: 650;
}

.steps-list p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.download-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.dl-sub {
  margin-top: 8px;
  max-width: 560px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.dl-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 900px) {
  .brand-wordmark {
    display: none;
  }

  .steps-list {
    grid-template-columns: 1fr;
  }

  .logo-hero {
    height: 56px;
  }

  .brand-strip {
    padding-bottom: 18px;
    margin-bottom: 24px;
  }
}

/* ---------------- descarga ---------------- */

.dl-page {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 32px) 64px;
}

.dl-card {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #0b0b0b, #050505);
  margin-bottom: 18px;
}

.dl-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  flex: none;
}

.dl-meta {
  flex: 1;
  min-width: 0;
}

.dl-meta h2 {
  font-size: 15.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-meta p {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.dl-card .btn {
  margin-left: auto;
  white-space: nowrap;
  flex: none;
}

.dl-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 26px;
}

.dl-fact {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  color: var(--muted);
}

.dl-fact b {
  display: block;
  color: var(--text);
  font-size: 12.5px;
  margin-bottom: 3px;
  font-weight: 600;
}

.dl-hash {
  font-family: var(--mono);
  font-size: 11px;
  word-break: break-all;
  color: var(--muted-2);
}

.dl-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.link-forgot {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px;
}

.link-forgot:hover {
  color: #fff;
}

/* ---------------- qué incluye / FAQ ---------------- */

.features {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 44px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--line);
}

.features-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.feature h3 {
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 6px;
}

.feature p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.faq {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.015);
}

.faq summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

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

.faq summary::after {
  content: '+';
  float: right;
  color: var(--muted);
}

.faq[open] summary::after {
  content: '−';
}

.faq-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.faq-body b {
  color: var(--text-2);
  font-weight: 600;
}

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

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

/* ---------------- modo escritorio (app Electron) ---------------- */
/* Dentro del instalador no se muestra la parte comercial. */

body.is-desktop .nav-links,
body.is-desktop .brand-strip,
body.is-desktop .lobby-copy,
body.is-desktop .steps,
body.is-desktop .download-cta,
body.is-desktop .features,
body.is-desktop .faq,
body.is-desktop .foot-links {
  display: none !important;
}

body.is-desktop .nav {
  justify-content: flex-start;
  gap: 0;
}

/* La app no ofrece descarga: ya es la app. */
body.is-desktop .nav-actions a[href="download.html"],
body.is-desktop .nav-actions a[href="./download.html"] {
  display: none !important;
}

/* El botón de cuenta sí queda: entrar o continuar como invitado. */
body.is-desktop .nav-actions {
  margin-left: auto;
}

body.is-desktop .lobby-main {
  grid-template-columns: minmax(0, 430px) minmax(0, 390px);
  justify-content: center;
  align-items: start;
  gap: 28px;
  padding-top: clamp(24px, 5vh, 64px);
}

body.is-desktop .join-title {
  font-size: 24px;
}

body.is-desktop .lobby-foot {
  justify-content: center;
}

body.is-desktop .lobby-foot p {
  text-align: center;
}

@media (max-width: 900px) {
  body.is-desktop .lobby-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ================================================================== *
 * Móvil / tablet: misma plataforma sin instalar nada
 * ================================================================== */

@media (max-width: 820px) {
  :root {
    --toolbar-h: 68px;
    --titlebar-h: 44px;
  }

  .nav {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .brand-wordmark {
    display: none;
  }

  .brand-logo {
    height: 32px;
    width: 32px;
  }

  .nav-actions .btn {
    height: 36px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .lobby-main {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: 18px;
    gap: 18px;
  }

  .logo-hero {
    height: 46px;
  }

  .copy-title {
    font-size: 26px;
  }

  .join-card {
    padding: 20px;
    border-radius: 16px;
  }

  .join-title {
    font-size: 23px;
  }

  .input,
  .btn-block {
    height: 46px;
  }

  /* barra de herramientas con desplazamiento horizontal y área táctil */
  .toolbar {
    height: auto;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom));
    gap: 4px;
    align-items: stretch;
  }

  .toolbar-group {
    flex: none;
  }

  .toolbar-center {
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .toolbar-center::-webkit-scrollbar {
    display: none;
  }

  /* en móvil: iconos grandes sin etiquetas (como las apps nativas) */
  .tool {
    width: 52px;
    padding: 10px 2px 8px;
    gap: 0;
  }

  .tool-label {
    display: none;
  }

  .tool .icon,
  .tool-icon svg {
    width: 24px;
    height: 24px;
  }

  .tool-badge {
    top: 2px;
    right: 8px;
  }

  #pinToggle {
    display: none;
  }

  .end-label {
    display: block;
    margin-top: 2px;
  }

  .tool-caret {
    margin-bottom: 14px;
    height: 32px;
  }

  .end-btn {
    padding: 6px 6px 4px;
  }

  .end-icon {
    width: 46px;
    height: 34px;
  }

  /* paneles a pantalla completa útil, sin tapar barra de título ni toolbar */
  .stage {
    position: relative;
  }

  .panel {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    border-radius: 0;
    border: 0;
  }

  .chat-thread {
    padding-bottom: 4px;
  }

  .composer-input {
    font-size: 16px; /* evita el zoom automático de iOS */
  }

  .send-btn {
    width: 38px;
    height: 38px;
  }

  .composer-tools .icon-btn {
    width: 34px;
    height: 34px;
  }

  .msg-body {
    max-width: 88%;
  }

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

  .filmstrip {
    height: 84px;
  }

  .filmstrip .tile {
    flex-basis: 132px;
    height: 82px;
  }

  .control-bar {
    top: 8px;
    right: 8px;
    padding: 4px;
  }

  .control-bar .btn {
    height: 30px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  /* gate y estados */
  .gate {
    padding: 0;
    align-items: stretch;
  }

  .gate-card {
    border-radius: 0;
    border: 0;
    min-height: 100dvh;
    max-height: none;
  }

  .gate-preview {
    min-height: 38dvh;
  }

  .gate-body {
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    gap: 12px;
  }

  .gate-title {
    font-size: 19px;
  }

  .state-card {
    padding: 24px 18px;
  }

  .toasts {
    left: 12px;
    right: 12px;
    transform: none;
    bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .toast {
    width: 100%;
    justify-content: center;
  }
}

/* En pantallas táctiles, evita selección accidental al arrastrar */
@media (hover: none) and (pointer: coarse) {
  .tile-label,
  .meeting-title {
    user-select: none;
  }

  .chat-input,
  .composer-input {
    caret-color: #fff;
  }
}

/* ---------------- actualizaciones ---------------- */

.update-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  margin-left: 10px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.update-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.update-btn[data-state='available'] {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

.update-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
}

.update-btn[data-state='available'] .update-dot {
  opacity: 1;
  background: #000000;
  animation: pulse 1.6s var(--ease) infinite;
}

.update-btn[data-state='downloading'] .update-dot {
  opacity: 1;
  animation: pulse 1s linear infinite;
}

.updates-modal {
  width: min(520px, 100%);
}

.update-line {
  font-size: 12.5px;
  color: var(--muted);
}

.update-line b {
  color: var(--text);
  font-weight: 600;
}

.update-sep {
  margin: 0 6px;
  opacity: 0.5;
}

.update-status {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  min-height: 20px;
}

.update-status.is-error {
  color: #ffffff;
  border-left: 2px solid #ffffff;
  padding-left: 10px;
}

.update-progress {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.update-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: #ffffff;
  transition: width 0.2s linear;
}

.update-notes,
.update-repo {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
}

.update-notes summary,
.update-repo summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}

.update-notes summary::-webkit-details-marker,
.update-repo summary::-webkit-details-marker {
  display: none;
}

.update-notes p {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
}

.update-repo .field {
  margin: 12px 0 8px;
}

.update-repo .field > label {
  font-size: 11.5px;
  color: var(--muted);
}

.update-repo code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}

/* ---------------- ID automático ---------------- */

.id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.id-actions {
  display: flex;
  gap: 10px;
  flex: none;
}

.link-mini {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-mini:hover {
  color: #ffffff;
}

@media (max-width: 820px) {
  .id-row {
    flex-wrap: wrap;
    row-gap: 4px;
  }
}
