/* Las tipografías se cargan desde ./public/fonts/fonts.css, servidas por este
   mismo origen. Antes había aquí un @import a Google Fonts: además de encadenar
   una petición externa antes de poder pintar, enviaba la ruta completa —con el
   token de entrada— a un tercero en la cabecera Referer. */

:root {
  --app-height: 100dvh;
  --keyboard-inset: 0px;
  --ink: #f2eadb;
  --ink-soft: #b9b5ae;
  --ink-faint: #777d80;
  --night: #071019;
  --night-2: #0b151f;
  --panel: #0f1a24;
  --panel-raised: #131f2a;
  --line: rgba(236, 222, 194, 0.14);
  --line-strong: rgba(236, 194, 99, 0.45);
  --gold: #e8b957;
  --gold-light: #f4d486;
  --gold-dark: #9d7131;
  --green: #6dd69d;
  --amber: #ffba59;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  --serif: 'Libre Baskerville', Georgia, serif;
  --sans: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html,
body,
#root { min-height: 100%; height: var(--app-height, 100dvh); }

html { background: var(--night); scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% -4%, rgba(133, 83, 28, 0.18), transparent 32rem),
    var(--night);
  font-family: var(--sans);
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; cursor: pointer; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

img { display: block; max-width: 100%; }

.skip-link {
  position: absolute;
  z-index: 30;
  left: 1rem;
  top: -4rem;
  padding: .7rem 1rem;
  color: var(--night);
  background: var(--gold-light);
}

.skip-link:focus { top: 1rem; }

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

.icon {
  display: inline-flex;
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell { display: flex; min-height: 100%; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: 0 0 244px;
  flex-direction: column;
  width: 244px;
  height: var(--app-height, 100dvh);
  padding: 2rem 1rem 1.3rem;
  background: rgba(7, 16, 25, .94);
  border-right: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: .75rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-symbol {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
  border-radius: 50%;
}

.brand-symbol .icon { width: 1.5rem; height: 1.5rem; }

.brand strong,
.brand small { display: block; }

.brand strong {
  color: var(--gold-light);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .15em;
  line-height: 1.3;
}

.brand small {
  margin-top: .22rem;
  color: var(--ink-faint);
  font-size: .56rem;
  letter-spacing: .16em;
}

.sidebar-rule { height: 1px; margin: 2rem .3rem 1.7rem; background: var(--line); }

.nav-label,
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.35;
  text-transform: uppercase;
}

.nav-label { padding: 0 .8rem .65rem; color: var(--ink-faint); }

.primary-nav { display: grid; gap: .35rem; }

.nav-item,
.mobile-nav-item,
.sidebar-profile {
  display: flex;
  min-height: 2.9rem;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
}

.nav-item {
  gap: .8rem;
  padding: 0 .8rem;
  border-left: 2px solid transparent;
  font-size: .82rem;
}

.nav-item .icon { color: var(--ink-faint); }

.nav-item:hover,
.nav-item.active { color: var(--ink); background: rgba(232, 185, 87, .08); border-left-color: var(--gold); }

.nav-item.active .icon { color: var(--gold); }

.nav-count,
.mobile-count {
  display: grid;
  width: 1.2rem;
  height: 1.2rem;
  margin-left: auto;
  place-items: center;
  color: var(--night);
  background: var(--gold);
  border-radius: 50%;
  font-size: .58rem;
}

.sidebar-bottom { display: grid; gap: 1rem; margin-top: auto; }

.privacy-note {
  display: flex;
  gap: .65rem;
  padding: .8rem .7rem;
  color: var(--gold);
  background: rgba(232, 185, 87, .05);
  border: 1px solid rgba(232, 185, 87, .16);
}

.privacy-note > span:last-child { min-width: 0; }

.privacy-note strong,
.privacy-note small { display: block; }

.privacy-note strong { color: var(--ink-soft); font-size: .69rem; font-weight: 600; }
.privacy-note small { margin-top: .32rem; color: var(--ink-faint); font-size: .62rem; line-height: 1.4; }

.sidebar-profile {
  width: 100%;
  gap: .65rem;
  padding: .55rem .6rem;
  border-top: 1px solid var(--line);
}

.sidebar-profile > span:nth-child(2) { min-width: 0; margin-right: auto; }
.sidebar-profile strong,
.sidebar-profile small { display: block; }
.sidebar-profile strong { color: var(--ink); font-size: .74rem; font-weight: 500; }
.sidebar-profile small { margin-top: .15rem; color: var(--ink-faint); font-size: .62rem; }
.sidebar-profile > .icon { width: .9rem; height: .9rem; color: var(--ink-faint); }

.avatar {
  display: inline-grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  flex: 0 0 auto;
  color: var(--night);
  background: var(--gold);
  border-radius: 50%;
  font-family: var(--serif);
}

.avatar-user { border: 1px solid var(--gold-light); }

.main-shell {
  min-width: 0;
  flex: 1;
  overflow: auto;
  background: linear-gradient(180deg, rgba(12, 24, 35, .26), transparent 35rem);
  scrollbar-color: rgba(232, 185, 87, .35) transparent;
}

.page-content {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 2.15rem clamp(1.2rem, 3.3vw, 3.8rem) 3rem;
}

.desktop-page-head,
.page-title,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.desktop-page-head { margin-bottom: 1.8rem; }

.desktop-page-head h2,
.section-heading h2,
.conversation-list-head h2 {
  margin: .45rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -.03em;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(19, 31, 42, .58);
}

.icon-button:hover { color: var(--gold-light); border-color: var(--line-strong); }
.icon-button .icon { width: 1.1rem; height: 1.1rem; }
.has-notice b { position: absolute; top: .55rem; right: .55rem; width: .35rem; height: .35rem; background: var(--gold); border-radius: 50%; }

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(330px, 1.1fr);
  min-height: 440px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(236, 222, 194, .1);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 4.5vw, 4.4rem);
  background: radial-gradient(circle at 12% 78%, rgba(151, 94, 26, .11), transparent 18rem), var(--panel);
}

.hero-copy h1 {
  max-width: 10ch;
  margin: 1.1rem 0 1rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 4.7rem);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: 1.08;
}

.hero-copy h1 em,
.fallback-shell h1 em,
.simple-hero h1 em,
.practice-card h2 em { color: var(--gold-light); font-style: italic; }

.hero-description {
  max-width: 30rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(.92rem, 1.25vw, 1.05rem);
  line-height: 1.7;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }

.button {
  display: inline-flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: .62rem;
  padding: .85rem 1.15rem;
  border: 1px solid transparent;
  border-radius: .25rem;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.button:hover { transform: translateY(-2px); }
.button .icon { width: 1.1rem; height: 1.1rem; }
.button-arrow { width: .95rem !important; height: .95rem !important; margin-left: .15rem; }
.button-primary { color: var(--night); background: linear-gradient(110deg, var(--gold-light), var(--gold)); box-shadow: 0 10px 24px rgba(204, 145, 43, .17); }
.button-primary:hover { background: var(--gold-light); }
.button-secondary { color: var(--ink); background: transparent; border-color: rgba(236, 222, 194, .28); }
.button-secondary:hover { border-color: var(--gold); color: var(--gold-light); background: rgba(232, 185, 87, .06); }
.button-ghost { min-height: 2.7rem; padding-inline: .8rem; color: var(--gold-light); background: transparent; border-color: var(--line-strong); }
.compact-button { min-height: 2.75rem; }
.wide-button { width: 100%; }

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: .46rem;
  align-items: center;
  margin: 1.4rem 0 0;
  color: var(--ink-faint);
  font-size: .67rem;
}

.live-dot,
.presence {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
}

.live-dot,
.presence.online { background: var(--green); box-shadow: 0 0 0 .22rem rgba(109, 214, 157, .1); }
.presence.away { background: #75818a; }
.note-divider { color: var(--gold-dark); }

.hero-media { position: relative; min-height: 440px; overflow: hidden; background: #100e0d; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 58% center; }
.hero-media-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 16, 20, .58), transparent 55%), linear-gradient(0deg, rgba(3, 7, 9, .72), transparent 45%); }
.hero-quote { position: absolute; right: 2rem; bottom: 3.2rem; margin: 0; color: var(--gold-light); font-family: var(--serif); font-size: clamp(.9rem, 1.5vw, 1.15rem); font-style: italic; line-height: 1.55; text-align: right; }
.hero-caption { position: absolute; right: 2rem; bottom: 1.4rem; color: rgba(255, 234, 183, .67); font-size: .56rem; font-weight: 700; letter-spacing: .2em; }
.hero-caption i { padding: 0 .35rem; color: var(--gold); font-style: normal; }

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1.15rem;
  background: rgba(15, 26, 36, .8);
  border: 1px solid var(--line);
}

.status-cell { display: flex; min-height: 4.9rem; gap: .8rem; align-items: center; padding: .85rem 1.2rem; border-right: 1px solid var(--line); }
.status-cell:last-child { border-right: 0; }
.status-cell > span:last-child { min-width: 0; }
.status-cell small,
.status-cell strong { display: block; }
.status-cell small { color: var(--ink-faint); font-size: .64rem; }
.status-cell strong { margin-top: .28rem; color: var(--ink-soft); font-size: .75rem; font-weight: 500; }
.status-icon { display: inline-grid; width: 2rem; height: 2rem; flex: 0 0 auto; place-items: center; color: var(--gold); border: 1px solid rgba(232, 185, 87, .25); border-radius: 50%; }
.status-icon .icon { width: 1rem; height: 1rem; }
.status-online { color: var(--green); border-color: rgba(109, 214, 157, .33); }
.status-soft { color: var(--ink-soft); border-color: var(--line); }

.compatibility-banner {
  display: flex;
  gap: .85rem;
  align-items: center;
  margin-top: 1.15rem;
  padding: .95rem 1.1rem;
  background: rgba(232, 185, 87, .045);
  border: 1px solid rgba(232, 185, 87, .2);
}

.compatibility-mark { display: inline-grid; width: 2rem; height: 2rem; flex: 0 0 auto; place-items: center; color: var(--gold); background: rgba(232, 185, 87, .1); border-radius: 50%; }
.compatibility-mark .icon { width: 1rem; height: 1rem; }
.compatibility-banner > span:nth-child(2) { min-width: 0; margin-right: auto; }
.compatibility-banner strong,
.compatibility-banner small { display: block; }
.compatibility-banner strong { color: var(--ink); font-size: .77rem; font-weight: 600; }
.compatibility-banner small { margin-top: .26rem; color: var(--ink-faint); font-size: .68rem; line-height: 1.4; }

.text-button,
.inline-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem 0;
  color: var(--gold-light);
  background: transparent;
  border: 0;
  font-size: .7rem;
  white-space: nowrap;
}

.text-button .icon,
.inline-link .icon { width: .85rem; height: .85rem; }
.text-button:hover,
.inline-link:hover { color: var(--ink); }

.home-lower { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr); gap: 1.15rem; margin-top: 3.5rem; }
.masters-section { min-width: 0; }
.section-heading { align-items: flex-end; margin-bottom: 1rem; }
.section-heading h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
.master-list { border-top: 1px solid var(--line); }
.master-row { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto 1rem; gap: .9rem; width: 100%; align-items: center; padding: .86rem .4rem; color: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.master-row:hover { background: rgba(232, 185, 87, .045); }
.master-avatar { position: relative; display: block; width: 3.35rem; height: 3.35rem; }
.master-avatar img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--gold-dark); border-radius: 50%; }
.master-avatar .presence { position: absolute; right: 0; bottom: .12rem; border: 2px solid var(--night); }
.master-info { min-width: 0; }
.master-info strong,
.master-info small,
.master-info em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.master-info strong { color: var(--ink); font-family: var(--serif); font-size: .95rem; font-weight: 400; }
.master-info small { margin-top: .22rem; color: var(--ink-faint); font-size: .7rem; }
.master-info em { margin-top: .28rem; font-size: .63rem; font-style: normal; }
.online-text { color: var(--green); }
.away-text { color: var(--ink-faint); }
.master-response { color: var(--ink-faint); font-size: .63rem; white-space: nowrap; }
.row-arrow { width: .95rem; height: .95rem; color: var(--ink-faint); }
.master-row:hover .row-arrow,
.recent-card:hover .row-arrow { color: var(--gold); }

.practice-card { position: relative; overflow: hidden; min-height: 265px; padding: 1.8rem; background: linear-gradient(140deg, #152231, #0c1721); border: 1px solid var(--line); }
.practice-orbit { display: grid; width: 2.7rem; height: 2.7rem; margin-bottom: 2.7rem; place-items: center; color: var(--gold); border: 1px solid var(--line-strong); border-radius: 50%; }
.practice-orbit:after { position: absolute; top: 1.1rem; left: 3.15rem; width: 4.2rem; height: 1px; content: ''; background: linear-gradient(90deg, var(--gold-dark), transparent); }
.practice-orbit .icon { width: 1.1rem; height: 1.1rem; }
.practice-card h2 { margin: .55rem 0 .75rem; font-family: var(--serif); font-size: 1.55rem; font-weight: 400; line-height: 1.25; }
.practice-card p:not(.eyebrow) { max-width: 24rem; margin: 0; color: var(--ink-soft); font-size: .76rem; line-height: 1.65; }
.practice-card .button { margin-top: 1.6rem; }
.recent-section { margin-top: 3.5rem; }
.recent-card { display: grid; grid-template-columns: 3.1rem minmax(0, 1fr) auto 1rem; gap: .85rem; width: 100%; align-items: center; padding: .75rem .4rem; color: inherit; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.recent-card:hover { background: rgba(232, 185, 87, .045); }
.recent-avatar { width: 3rem; height: 3rem; }
.recent-avatar img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--gold-dark); border-radius: 50%; }
.recent-copy { min-width: 0; }
.recent-copy strong,
.recent-copy small { display: block; }
.recent-copy strong { color: var(--ink); font-family: var(--serif); font-size: .87rem; font-weight: 400; }
.recent-copy small { overflow: hidden; margin-top: .25rem; color: var(--ink-faint); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.recent-time { color: var(--ink-faint); font-size: .62rem; text-align: right; }
.recent-time em { color: var(--ink-soft); font-style: normal; }

.disclosure { display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: center; margin-top: 3.5rem; padding-top: 1rem; color: var(--ink-faint); border-top: 1px solid var(--line); font-size: .62rem; }
.disclosure > span { color: var(--gold-dark); }
.disclosure p { max-width: 42rem; margin: 0 auto 0 0; line-height: 1.5; }
.disclosure a { color: var(--ink-soft); text-decoration: none; }
.disclosure a:hover { color: var(--gold-light); }

.mobile-topbar,
.mobile-nav { display: none; }

.page-title { align-items: flex-end; margin-bottom: 2rem; }
.page-title h1 { margin: .5rem 0 .55rem; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 400; letter-spacing: -.055em; }
.page-title p:not(.eyebrow) { max-width: 38rem; margin: 0; color: var(--ink-soft); font-size: .84rem; line-height: 1.6; }

.conversation-layout { display: grid; grid-template-columns: 315px minmax(0, 1fr); min-height: min(650px, calc(var(--app-height) - 9rem)); background: var(--panel); border: 1px solid var(--line); }
.conversation-list { min-width: 0; padding: 1.15rem; border-right: 1px solid var(--line); }
.conversation-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.conversation-list-head h2 { font-size: 1.32rem; }
.conversation-list-head .icon-button { width: 2.25rem; height: 2.25rem; }
.conversation-list-head .icon-button .icon { width: .95rem; height: .95rem; }
.search-field { display: flex; height: 2.65rem; gap: .55rem; align-items: center; margin-top: 1.1rem; padding: 0 .75rem; background: rgba(7, 16, 25, .58); border: 1px solid var(--line); }
.search-field > .icon { width: .9rem; height: .9rem; color: var(--ink-faint); }
.search-field input { min-width: 0; flex: 1; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: .7rem; }
.search-field input::placeholder { color: var(--ink-faint); }
.thread-list { margin-top: .75rem; }
.thread-row { position: relative; display: grid; grid-template-columns: 2.55rem minmax(0, 1fr) auto; gap: .65rem; width: 100%; align-items: center; padding: .72rem .55rem; color: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid rgba(236, 222, 194, .08); }
.thread-row:hover,
.thread-row.selected { background: rgba(232, 185, 87, .065); }
.thread-row.selected { box-shadow: inset 2px 0 var(--gold); }
.thread-avatar { width: 2.4rem; height: 2.4rem; }
.thread-avatar img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--gold-dark); border-radius: 50%; }
.thread-row > span:nth-child(2) { min-width: 0; }
.thread-row strong,
.thread-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-row strong { color: var(--ink); font-size: .7rem; font-weight: 600; }
.thread-row small { margin-top: .22rem; color: var(--ink-faint); font-size: .61rem; }
.thread-row time { color: var(--ink-faint); font-size: .58rem; align-self: start; }
.thread-row > .presence { position: absolute; top: 2.45rem; left: 2.3rem; width: .45rem; height: .45rem; border: 2px solid var(--panel); }
.full-width { width: 100%; justify-content: space-between; margin-top: 1rem; }

.chat-panel { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; min-width: 0; min-height: 0; background: radial-gradient(circle at 80% 0, rgba(65, 52, 26, .12), transparent 28rem), #0c161f; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.chat-person { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.chat-avatar { width: 2.5rem; height: 2.5rem; flex: 0 0 auto; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--gold-dark); border-radius: 50%; }
.chat-person > span:last-child { min-width: 0; }
.chat-person strong,
.chat-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-person strong { color: var(--ink); font-family: var(--serif); font-size: .9rem; font-weight: 400; }
.chat-person small { margin-top: .27rem; color: var(--ink-faint); font-size: .63rem; }
.chat-person small .presence { width: .4rem; height: .4rem; margin-right: .24rem; }
.chat-actions { display: flex; gap: .45rem; }
.chat-actions .icon-button { width: 2.35rem; height: 2.35rem; }
.chat-actions .icon-button .icon { width: .98rem; height: .98rem; }
.chat-notice { display: flex; gap: .4rem; align-items: center; padding: .52rem 1.25rem; color: var(--ink-faint); background: rgba(232, 185, 87, .025); border-bottom: 1px solid rgba(236, 222, 194, .07); font-size: .62rem; }
.chat-notice > span { color: var(--gold-dark); }
.chat-notice .icon { width: .8rem; height: .8rem; }
.messages { display: flex; flex-direction: column; gap: .7rem; min-height: 0; padding: 1.3rem 1.25rem; overflow-y: auto; }
.message-row { display: flex; max-width: 75%; }
.message-row.from-client { align-self: flex-end; }
.message-row.from-master { align-self: flex-start; }
.message-bubble { padding: .7rem .8rem; color: var(--ink-soft); background: #17232d; border: 1px solid rgba(236, 222, 194, .08); border-radius: .8rem .8rem .8rem .18rem; font-size: .76rem; line-height: 1.5; }
.from-client .message-bubble { color: #0a1219; background: linear-gradient(135deg, var(--gold-light), var(--gold)); border-color: transparent; border-radius: .8rem .8rem .18rem .8rem; }
.message-time { display: block; margin-top: .35rem; color: var(--ink-faint); font-size: .56rem; text-align: right; }
.from-client .message-time { color: rgba(9, 17, 22, .63); }
.composer { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .35rem; align-items: end; margin: 0 1rem; padding: .45rem .45rem .45rem .85rem; background: #151f28; border: 1px solid rgba(236, 222, 194, .15); border-radius: 1.2rem; }
.composer textarea { width: 100%; max-height: 120px; min-height: 2rem; padding: .45rem 0; resize: none; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: .75rem; line-height: 1.35; }
.composer textarea::placeholder { color: var(--ink-faint); }
.composer-icon { display: grid; width: 2.5rem; height: 2.5rem; padding: 0; place-items: center; color: var(--ink-soft); background: transparent; border: 0; border-radius: 50%; }
.composer-icon:hover { color: var(--gold-light); background: rgba(232, 185, 87, .08); }
.composer-icon .icon { width: 1rem; height: 1rem; }
.send-button { display: grid; width: 2.5rem; height: 2.5rem; padding: 0; place-items: center; color: var(--night); background: var(--gold); border: 0; border-radius: 50%; }
.send-button:hover { background: var(--gold-light); }
.send-button .icon { width: 1rem; height: 1rem; }
.composer-hint { min-height: 2.4rem; padding: .65rem 1.25rem 1rem; color: var(--ink-faint); font-size: .61rem; line-height: 1.45; }
.composer-hint > .icon { width: .78rem; height: .78rem; margin-right: .15rem; color: var(--gold-dark); vertical-align: -.16rem; }
.inline-link { padding: 0; font-size: .61rem; }

.call-page,
.simple-page { min-height: 100%; }
.fallback-shell { width: min(100%, 640px); margin: 1rem auto 0; padding: clamp(1rem, 3vw, 2.5rem) 0 1rem; text-align: center; }
.fallback-portrait { position: relative; width: 9rem; height: 9rem; margin: 0 auto 1.6rem; }
.fallback-portrait img { width: 100%; height: 100%; object-fit: cover; border: 2px solid var(--gold); border-radius: 50%; }
.portrait-ring { position: absolute; inset: -.5rem; border: 1px solid rgba(232, 185, 87, .28); border-radius: 50%; }
.fallback-kicker { display: inline-flex; gap: .4rem; align-items: center; color: var(--gold); font-size: .64rem; font-weight: 700; letter-spacing: .16em; }
.fallback-kicker .icon { width: .9rem; height: .9rem; }
.fallback-shell h1 { margin: .85rem 0 .8rem; font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 400; letter-spacing: -.06em; line-height: 1.17; }
.fallback-lead { max-width: 34rem; margin: 0 auto; color: var(--ink-soft); font-size: .86rem; line-height: 1.65; }
.capability-list { display: grid; gap: 0; margin: 2rem 0 1.25rem; padding: .35rem 1rem; text-align: left; background: rgba(15, 26, 36, .8); border: 1px solid var(--line); }
.capability-list li { display: grid; grid-template-columns: 1.75rem 1.4rem minmax(0, 1fr) auto; gap: .7rem; min-height: 3.5rem; align-items: center; border-bottom: 1px solid rgba(236, 222, 194, .09); }
.capability-list li:last-child { border-bottom: 0; }
.capability-state { display: grid; width: 1.45rem; height: 1.45rem; place-items: center; border-radius: 50%; }
.capability-state.ready { color: var(--night); background: var(--green); }
.capability-state.limited { color: #17100a; background: var(--amber); }
.capability-state .icon { width: .84rem; height: .84rem; }
.capability-icon { color: var(--ink-soft); }
.capability-icon .icon { width: 1.15rem; height: 1.15rem; }
.capability-list strong { color: var(--ink); font-size: .8rem; font-weight: 500; }
.capability-list small { color: var(--ink-faint); font-size: .68rem; text-align: right; }
.fallback-actions { display: grid; gap: .65rem; }
.fallback-divider { display: flex; align-items: center; gap: .8rem; margin: 1.6rem 0 .7rem; color: var(--gold-dark); }
.fallback-divider:before,
.fallback-divider:after { height: 1px; flex: 1; content: ''; background: var(--line-strong); }
.fallback-divider .icon { width: 1rem; height: 1rem; }
.fallback-reassurance { margin: 0; color: var(--ink-soft); font-family: var(--serif); font-size: .82rem; line-height: 1.8; }
.return-button { display: inline-flex; gap: .6rem; align-items: center; justify-content: center; width: 100%; min-height: 3.2rem; margin-top: 1.5rem; color: var(--ink); background: rgba(15, 26, 36, .65); border: 1px solid var(--line); border-radius: .25rem; font-family: var(--serif); font-size: .85rem; }
.return-button:hover { color: var(--gold-light); border-color: var(--line-strong); }
.return-button .icon { width: 1.2rem; height: 1.2rem; }

.simple-hero { max-width: 40rem; padding: clamp(3rem, 9vh, 6.5rem) 0 3rem; }
.simple-hero .large { width: 4.5rem; height: 4.5rem; margin-bottom: 2.4rem; }
.simple-hero .large .icon { width: 1.8rem; height: 1.8rem; }
.simple-hero h1 { margin: .8rem 0 1rem; font-family: var(--serif); font-size: clamp(2.5rem, 6vw, 4.3rem); font-weight: 400; letter-spacing: -.07em; line-height: 1.1; }
.simple-hero > p:not(.eyebrow) { max-width: 32rem; margin: 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.7; }
.simple-hero .button { margin-top: 1.7rem; }
.coming-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 50rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.coming-list > div { display: grid; gap: .35rem; }
.coming-list span { color: var(--gold); font-size: .66rem; }
.coming-list strong { color: var(--ink); font-family: var(--serif); font-size: .83rem; font-weight: 400; }
.coming-list small { color: var(--ink-faint); font-size: .68rem; line-height: 1.4; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: 1rem; max-width: 900px; }
.profile-card,
.privacy-card { display: flex; align-items: flex-start; gap: 1rem; padding: 1.4rem; background: var(--panel); border: 1px solid var(--line); }
.profile-card > div,
.privacy-card > div { min-width: 0; }
.profile-card h2,
.privacy-card h2 { margin: .35rem 0 .7rem; font-family: var(--serif); font-size: 1.2rem; font-weight: 400; }
.profile-card p:not(.eyebrow),
.privacy-card p { margin: 0; color: var(--ink-soft); font-size: .75rem; line-height: 1.6; }
.profile-card .button { min-height: 2.5rem; margin-left: auto; padding-inline: .75rem; font-size: .65rem; white-space: nowrap; }
.large-avatar { width: 3.8rem; height: 3.8rem; font-size: 1.4rem; }
.privacy-card > .status-icon { flex: 0 0 auto; }
.storage-status { display: block; margin-top: 1rem; font-size: .65rem; line-height: 1.4; }
.storage-status.ok { color: var(--green); }
.storage-status.warning { color: var(--amber); }

.toast { position: fixed; z-index: 20; right: 1.25rem; bottom: calc(1.25rem + var(--keyboard-inset)); display: flex; gap: .55rem; align-items: center; max-width: min(25rem, calc(100vw - 2rem)); padding: .8rem 1rem; color: var(--night); background: var(--gold-light); box-shadow: var(--shadow); font-size: .72rem; animation: toast-in .28s ease both; }
.toast .icon { width: 1rem; height: 1rem; }
@keyframes toast-in { from { transform: translateY(.5rem); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 980px) {
  .sidebar { flex-basis: 210px; width: 210px; }
  .page-content { padding-inline: 1.4rem; }
  .hero-section { grid-template-columns: minmax(0, 1fr) minmax(290px, .95fr); }
  .hero-copy { padding: 2.35rem; }
  .hero-copy h1 { font-size: clamp(2.4rem, 5vw, 3.55rem); }
  .master-response { display: none; }
}

@media (max-width: 760px) {
  html,
  body,
  #root { min-height: var(--app-height, 100dvh); height: auto; }
  .app-shell { display: block; min-height: var(--app-height, 100dvh); }
  .sidebar { display: none; }
  .main-shell { min-height: var(--app-height, 100dvh); overflow: visible; }
  .page-content { padding: 0 1rem calc(1.3rem + var(--keyboard-inset)); }
  .mobile-topbar { display: flex; min-height: 4.7rem; align-items: center; justify-content: space-between; gap: .7rem; padding: 1rem 0; }
  .mobile-topbar .brand { gap: .55rem; }
  .mobile-topbar .brand-symbol { width: 2rem; height: 2rem; }
  .mobile-topbar .brand-symbol .icon { width: 1.15rem; height: 1.15rem; }
  .mobile-topbar .brand strong { font-size: .58rem; }
  .mobile-topbar .brand small { font-size: .48rem; }
  .mobile-actions { display: flex; gap: .4rem; }
  .mobile-actions .icon-button { width: 2.35rem; height: 2.35rem; }
  .desktop-page-head { margin: .8rem 0 1.2rem; }
  .desktop-page-head h2 { font-size: 1.2rem; }
  .desktop-page-head .icon-button { width: 2.35rem; height: 2.35rem; }
  .hero-section { display: flex; flex-direction: column; margin-inline: -.2rem; }
  .hero-copy { order: 0; padding: 2rem 1.3rem 1.7rem; }
  .hero-media { order: 1; min-height: 300px; }
  .hero-copy h1 { max-width: 12ch; margin-top: .75rem; font-size: clamp(2.25rem, 11vw, 3.4rem); }
  .hero-description { font-size: .86rem; }
  .hero-actions { display: grid; width: 100%; }
  .button { width: 100%; }
  .hero-note { margin-top: 1rem; line-height: 1.5; }
  .hero-quote { right: 1rem; bottom: 2.8rem; font-size: .82rem; }
  .hero-caption { right: 1rem; bottom: 1rem; font-size: .48rem; }
  .status-strip { display: flex; margin-inline: -.2rem; overflow-x: auto; }
  .status-cell { min-width: 190px; flex: 1 0 190px; padding: .7rem .8rem; }
  .compatibility-banner { align-items: flex-start; padding: .85rem; }
  .compatibility-banner .text-button { margin-top: .1rem; }
  .home-lower { grid-template-columns: 1fr; gap: 2rem; margin-top: 2.8rem; }
  .recent-section { margin-top: 2.8rem; }
  .section-heading { align-items: flex-start; }
  .section-heading .text-button { margin-top: .1rem; }
  .practice-card { min-height: 235px; }
  .disclosure { margin-top: 2.8rem; }
  .mobile-nav { position: sticky; z-index: 8; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .2rem; padding: .55rem .55rem calc(.55rem + env(safe-area-inset-bottom)); background: rgba(7, 16, 25, .95); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-nav-item { position: relative; display: grid; min-height: 3.4rem; gap: .25rem; place-items: center; padding: .35rem .15rem; color: var(--ink-faint); border: 0; font-size: .58rem; }
  .mobile-nav-item .icon { width: 1.18rem; height: 1.18rem; }
  .mobile-nav-item.active { color: var(--gold-light); }
  .mobile-nav-item.active:before { position: absolute; top: -.55rem; width: 1.8rem; height: 2px; content: ''; background: var(--gold); }
  .mobile-count { position: absolute; top: .05rem; right: 18%; width: .95rem; height: .95rem; font-size: .48rem; }
  .page-title { display: block; margin: 1rem 0 1.35rem; }
  .page-title h1 { font-size: 2.25rem; }
  .page-title .button { margin-top: 1.15rem; }
  .conversation-layout { display: block; min-height: 0; margin-inline: -.2rem; }
  .conversation-list { padding: .9rem .75rem .5rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation-list-head h2 { font-size: 1.2rem; }
  .search-field { margin-top: .75rem; }
  .thread-list { display: flex; gap: .5rem; margin: .65rem -.75rem 0; padding: 0 .75rem .25rem; overflow-x: auto; }
  .thread-row { min-width: 210px; border: 1px solid rgba(236, 222, 194, .1); }
  .thread-row.selected { box-shadow: inset 0 2px var(--gold); }
  .full-width { display: none; }
  .chat-panel { min-height: 570px; }
  .chat-head { padding: .85rem .8rem; }
  .chat-notice { padding-inline: .8rem; }
  .messages { min-height: 290px; max-height: 42vh; padding-inline: .8rem; }
  .message-row { max-width: 86%; }
  .composer { margin-inline: .65rem; }
  .composer-hint { padding-inline: .8rem; }
  .call-page .mobile-topbar,
  .simple-page .mobile-topbar { margin-bottom: 1rem; }
  .fallback-shell { margin-top: .5rem; padding-inline: .15rem; }
  .fallback-portrait { width: 7rem; height: 7rem; margin-bottom: 1.25rem; }
  .fallback-shell h1 { font-size: 2.15rem; }
  .fallback-lead { font-size: .8rem; }
  .capability-list { padding-inline: .7rem; }
  .capability-list li { grid-template-columns: 1.55rem 1.25rem minmax(0, 1fr) auto; gap: .45rem; min-height: 3.2rem; }
  .capability-list small { max-width: 7rem; font-size: .6rem; }
  .coming-list { grid-template-columns: 1fr; gap: 1rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { flex-wrap: wrap; }
  .profile-card .button { width: 100%; margin-left: 0; }
  .toast { right: 1rem; bottom: calc(5.9rem + var(--keyboard-inset)); }
}

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

/* ==========================================================================
   Espacio privado — /entrar/<token>
   ==========================================================================
   Una sola conversación, un solo Maestro, ninguna credencial. Reutiliza la
   paleta del santuario (azul noche + oro envejecido) y toma de la app de
   referencia la anatomía del chat: burbujas al 80 % con cola, y un compositor
   con UN solo botón circular que alterna entre enviar y micrófono.
   ========================================================================== */

.scoped-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  height: 100%;
  max-width: 46rem;
  margin: 0 auto;
  background:
    radial-gradient(circle at 85% -10%, rgba(232, 185, 87, .1), transparent 26rem),
    radial-gradient(circle at 0 110%, rgba(65, 52, 26, .16), transparent 30rem),
    var(--night);
  border-inline: 1px solid var(--line);
}

/* --- Cabecera ----------------------------------------------------------- */

.scoped-head {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .85rem 1rem;
  padding-top: calc(.85rem + env(safe-area-inset-top));
  background: rgba(7, 16, 25, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.scoped-avatar { position: relative; flex: 0 0 auto; }
.scoped-avatar img { display: block; width: 2.75rem; height: 2.75rem; object-fit: cover; border-radius: 50%; border: 1px solid var(--line-strong); }
.scoped-avatar .presence { position: absolute; right: 0; bottom: .1rem; border: 2px solid var(--night); }

.scoped-identity { display: grid; gap: .1rem; min-width: 0; flex: 1; }
.scoped-identity strong { font-family: var(--serif); font-size: .95rem; font-weight: 700; color: var(--ink); }
.scoped-identity small { color: var(--ink-faint); font-size: .68rem; }

.scoped-ref {
  flex: 0 0 auto;
  padding: .28rem .55rem;
  color: var(--gold-light);
  background: rgba(232, 185, 87, .08);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .08em;
}

.scoped-notice {
  display: flex;
  gap: .45rem;
  align-items: center;
  margin: 0;
  padding: .55rem 1rem;
  color: var(--ink-soft);
  background: rgba(232, 185, 87, .04);
  border-bottom: 1px solid var(--line);
  font-size: .66rem;
}
.scoped-notice .icon { width: .85rem; height: .85rem; color: var(--gold); }

/* --- Mensajes ----------------------------------------------------------- */

.scoped-messages {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.1rem 1rem 1.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(232, 185, 87, .3) transparent;
}

.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }

.bubble {
  max-width: 80%;
  padding: .65rem .9rem;
  border-radius: 1.25rem;
  font-size: .82rem;
  line-height: 1.5;
}

.bubble-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.bubble-meta { display: flex; gap: .35rem; align-items: center; margin-top: .3rem; font-size: .58rem; opacity: .72; }

/* La cola se hace con la esquina del lado propio, no con un triángulo. */
.bubble-mine { color: var(--night); background: linear-gradient(150deg, var(--gold-light), var(--gold)); border-bottom-right-radius: .35rem; }
.bubble-theirs { color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: .35rem; }

.bubble-failed { cursor: pointer; box-shadow: 0 0 0 1px #d9534f inset; }
.bubble-status { font-style: italic; }
.bubble-status.failed { color: #ffd9d7; font-style: normal; font-weight: 600; }

.day-separator { display: flex; justify-content: center; margin: .7rem 0 .2rem; }
.day-separator span {
  padding: .2rem .7rem;
  color: var(--ink-faint);
  background: rgba(236, 222, 194, .06);
  border-radius: 999px;
  font-size: .58rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.scoped-empty { margin: auto; max-width: 18rem; color: var(--ink-faint); font-size: .78rem; line-height: 1.6; text-align: center; }

/* --- Compositor --------------------------------------------------------- */

.scoped-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: end;
  margin: 0 1rem;
  padding: .4rem .4rem .4rem .95rem;
  background: var(--panel-raised);
  border: 1px solid rgba(236, 222, 194, .15);
  border-radius: 1.5rem;
}

.scoped-composer textarea {
  width: 100%;
  min-height: 2.6rem;
  max-height: 50vh;
  padding: .65rem 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  /* 16 px: por debajo de eso iOS hace zoom al enfocar y descuadra el WebView. */
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.4;
}
.scoped-composer textarea::placeholder { color: var(--ink-faint); }

/* Un solo botón, 46×46, que cambia de enviar a micrófono. */
.scoped-action {
  display: grid;
  width: 2.875rem;
  height: 2.875rem;
  padding: 0;
  place-items: center;
  color: var(--night);
  background: linear-gradient(140deg, var(--gold-light), var(--gold));
  border: 0;
  border-radius: 50%;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.scoped-action .icon, .scoped-action svg { width: 1.15rem; height: 1.15rem; }
.scoped-action:hover { transform: translateY(-1px); }
.scoped-action.is-empty { color: var(--ink-soft); background: transparent; border: 1px solid rgba(236, 222, 194, .18); }
.scoped-action.is-empty:hover { color: var(--gold-light); border-color: var(--line-strong); }

.scoped-hint {
  display: flex;
  gap: .4rem;
  align-items: center;
  justify-content: center;
  margin: .6rem 1rem 0;
  color: var(--ink-faint);
  font-size: .62rem;
  text-align: center;
}
.scoped-hint .icon { width: .8rem; height: .8rem; color: var(--gold-dark); }

.scoped-legal {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  margin: 0;
  padding: .9rem 1rem calc(1rem + env(safe-area-inset-bottom));
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font-size: .58rem;
  line-height: 1.6;
}
.scoped-legal .icon { width: .85rem; height: .85rem; margin-top: .1rem; color: var(--gold-dark); }
.scoped-legal p { margin: 0; }

.scoped-toast { right: auto; left: 50%; bottom: calc(6rem + var(--keyboard-inset)); transform: translateX(-50%); text-align: center; }

/* --- Estados de carga y error ------------------------------------------- */

.scoped-centered { display: grid; place-items: center; padding: 2rem 1.5rem; }

.scoped-loading { display: grid; gap: .7rem; justify-items: center; max-width: 24rem; text-align: center; }
.scoped-loading h1 { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 6vw, 2rem); font-weight: 400; line-height: 1.25; }
.scoped-loading .scoped-lead { margin: 0; color: var(--ink-soft); font-size: .82rem; line-height: 1.65; }

.scoped-avatar.large img { width: 4.5rem; height: 4.5rem; }
.scoped-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  color: var(--amber);
  background: rgba(255, 186, 89, .08);
  border: 1px solid rgba(255, 186, 89, .3);
  border-radius: 50%;
}
.scoped-mark .icon { width: 1.3rem; height: 1.3rem; }

@media (min-width: 48rem) {
  .scoped-shell { border-radius: 1.5rem; margin-block: 1.25rem; height: calc(100% - 2.5rem); box-shadow: var(--shadow); }
  .scoped-head { border-radius: 1.5rem 1.5rem 0 0; }
  .scoped-legal { border-radius: 0 0 1.5rem 1.5rem; }
}

@media (max-width: 26rem) {
  .scoped-ref { display: none; }
  .bubble { max-width: 88%; }
}

