body.ofi{
  /* Theme: Dark (Anfitriones-style) */
  --ofb-primary:#004AAD;
  --ofb-primary-soft:#315EFF;
  --ofb-bg:#020716;
  --ofb-card:rgba(3,18,54,0.92);
  --ofb-card-2:rgba(3,14,44,0.72);
  --ofb-slab:rgba(0,0,0,0.18);
  --ofb-text:#F5F7FF;
  --ofb-muted:#A9B3D1;
  --ofb-accent:#00D38F;

  --ofb-border:rgba(190,204,238,0.18);
  --ofb-border-strong:rgba(190,204,238,0.32);

  --ofb-shadow-soft:0 20px 50px rgba(0,0,0,0.45);
  --ofb-shadow-slab:0 14px 30px rgba(0,0,0,0.22);

  --radius-lg:22px;

  /* Wider desktop feel */
  --max:1120px;
}
body.ofi *{box-sizing:border-box}
body.ofi{margin:0; padding:0; min-height:100vh}

body.ofi{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial;
  color:var(--ofb-text);
  background: radial-gradient(circle at top, #1d3a7f 0, #020716 45%, #000000 100%);
  line-height:1.55;
  overflow-x:hidden;
}
body.ofi a{color:inherit}

body.ofi .container{max-width:var(--max); margin:0 auto; padding:0 18px}

/* Topbar */
body.ofi .topbar{
  position:sticky; top:0; z-index:50;
  background:rgba(3,14,44,0.72);
  border-bottom:1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px) saturate(150%);
}
body.ofi .topbar-inner{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0}
body.ofi .brand{display:flex; align-items:center; gap:10px; text-decoration:none}
body.ofi .brand img{width:38px; height:38px; border-radius:10px; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4));}
body.ofi .brand .name{font-weight:900; letter-spacing:.01em}
body.ofi .brand .tag{font-size:.86rem; color:var(--ofb-muted)}

body.ofi .btn-lang{
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:999px;
  padding:8px 14px;
  border:1px solid rgba(190,204,238,0.35);
  background: rgba(3,14,44,0.65);
  color:#fff;
  text-decoration:none;
  font-weight:650;
  font-size:.86rem;
  transition: transform .12s ease, filter .12s ease, border-color .12s ease;
}
body.ofi .btn-lang:hover{ transform: translateY(-1px); filter: brightness(1.06); border-color: rgba(0,211,143,0.6); }

/* Main card */
body.ofi .main-card{
  background:var(--ofb-card);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:var(--radius-lg);
  box-shadow:var(--ofb-shadow-soft);
  padding:18px 18px 16px;
  margin:16px auto 26px;
  position:relative;
  overflow:hidden;
}
body.ofi .main-card::before{
  content:"";
  position:absolute;
  inset:-40%;
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.06), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(0,211,143,0.15), transparent 55%);
  opacity:0.95;
  pointer-events:none;
}
body.ofi .main-card > *{ position:relative; z-index:1; }

/* Logo inside main card: smaller, left, still noticeable */
body.ofi .logo{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  margin:6px 0 10px;
}
body.ofi .logo img{
  max-width:120px; width:100%; height:auto;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4));
}

/* Cards/slabs */
body.ofi .card{
  margin-top:14px;
  background:rgba(4,19,60,0.92);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:var(--radius-lg);
  box-shadow: 0 12px 26px rgba(0,0,0,0.35);
  padding:16px;
}
body.ofi .card-title{font-weight:800; color:#fff; margin-bottom:10px}

body.ofi h1, body.ofi #title{
  margin:0 0 10px;
  font-size:clamp(1.55rem, 2.6vw, 2.1rem);
  line-height:1.15;
  text-align:left;
}
body.ofi .lead{margin:0; color:var(--ofb-muted); font-size:1.0rem}

/* Setup grid: 2 columnas en desktop */
body.ofi .grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px 18px;
  margin-top: 10px;
}
@media (min-width: 900px){
body.ofi .grid{ grid-template-columns: 1fr 1fr; }
}

/* Labels & inputs */
body.ofi .label{display:block; font-weight:650; margin:0 0 6px; color:var(--ofb-muted); font-size:.88rem}
body.ofi .hint{font-size:.86rem; color:var(--ofb-muted); margin-top:6px}

body.ofi .select, body.ofi .input, body.ofi textarea.textarea{
  width:100%;
  border-radius:12px;
  border:1px solid rgba(190,204,238,0.45);
  padding:10px 12px;
  font-size:0.98rem;
  background: rgba(3,14,44,0.90);
  color: var(--ofb-text);
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
body.ofi textarea.textarea{min-height:124px; resize:vertical}
body.ofi .select:focus, body.ofi .input:focus, body.ofi textarea.textarea:focus{
  border-color: var(--ofb-accent);
  box-shadow: 0 0 0 1px rgba(0,211,143,0.35);
  background: rgba(5,20,60,0.98);
}

/* Buttons: definidos (no full-width por default) */
body.ofi .row{display:flex; gap:12px; flex-wrap:wrap; align-items:center}
body.ofi .row > *{flex:0 0 auto}

body.ofi .btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border-radius:999px;
  padding:10px 18px;
  border:1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(245,247,255,0.96);
  text-decoration:none;
  font-weight:650;
  font-size:0.92rem;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, filter .12s ease, border-color .12s ease, box-shadow .12s ease;
  min-width: 200px;
}
body.ofi .btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.06);
  border-color: rgba(0,211,143,0.55);
}
body.ofi .btn.primary{
  border:none;
  background: linear-gradient(135deg, var(--ofb-primary-soft), var(--ofb-primary));
  color:#fff;
  box-shadow: 0 14px 30px rgba(0,0,0,0.55);
}
body.ofi .btn.primary:hover{ box-shadow: 0 18px 36px rgba(0,0,0,0.65); }
body.ofi .btn:disabled{opacity:.55; cursor:not-allowed; transform:none}

/* Toggle */
body.ofi .toggle{
  display:inline-flex; align-items:center; gap:10px;
  font-weight:650;
  padding:8px 10px;
  border:1px solid rgba(190,204,238,0.25);
  border-radius:999px;
  background: rgba(3,14,44,0.55);
}
body.ofi .toggle input{width:18px; height:18px}

/* ===== Chat layout: usa ancho de desktop con 2 columnas ===== */
body.ofi #screenChat{
  display:grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "turn"
    "chat"
    "compose";
  gap: 12px;
}

body.ofi .turn{grid-area:turn; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap}
body.ofi .turn-actions{flex:0 0 auto}
body.ofi #roomTitle{font-size:1.05rem}
body.ofi #peerInfo{margin-top:6px; color: rgba(245,247,255,0.92); font-weight:650}

/* 2 columnas en pantallas grandes */
@media (min-width: 980px){
body.ofi #screenChat{
    grid-template-columns: 1.35fr 0.85fr;
    grid-template-areas:
      "turn turn"
      "chat compose";
    align-items:start;
  }
}

body.ofi .chat{
  grid-area:chat;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px;
  border-radius:18px;
  background: rgba(0,0,0,0.18);
  border:1px solid rgba(190,204,238,0.18);
  box-shadow: var(--ofb-shadow-slab);
  max-height: 58vh;
  overflow:auto;
}

/* Messages: bubble style */
body.ofi .msg{
  border:1px solid rgba(190,204,238,0.18);
  border-radius:18px;
  padding:12px 12px 10px;
  background: rgba(3,14,44,0.78);
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
  max-width: 92%;
}
body.ofi .msg.me{
  align-self:flex-end;
  background: linear-gradient(135deg, rgba(49,94,255,0.24), rgba(0,74,173,0.28));
  border-color: rgba(49,94,255,0.40);
}
body.ofi .msg.them{
  align-self:flex-start;
  background: rgba(3,14,44,0.82);
  border-color: rgba(190,204,238,0.18);
}

body.ofi .msg-h{display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:8px}
body.ofi .msg-h strong{font-weight:800; color:#fff}
body.ofi .msg-meta{font-size:.82rem; color: rgba(169,179,209,0.95)}
body.ofi .msg-label{font-size:.72rem; letter-spacing:.06em; text-transform:uppercase; color: rgba(169,179,209,0.95); margin-bottom:4px}
body.ofi .msg-text{white-space:pre-wrap; word-wrap:break-word; font-size:0.98rem; color: rgba(245,247,255,0.97)}
body.ofi .msg-orig{margin-top:8px; opacity:0.86}
body.ofi .msg-orig .msg-text{color: rgba(169,179,209,0.98); font-size:0.95rem}
body.ofi .msg-trans{margin-top:6px}
body.ofi .msg-trans .msg-label{color: rgba(0,211,143,0.92)}
body.ofi .msg-trans .msg-text{color:#ffffff; font-weight:600}

/* Composer */
body.ofi .compose{
  grid-area:compose;
  border-radius:18px;
  background: rgba(0,0,0,0.18);
  border:1px solid rgba(190,204,238,0.18);
  box-shadow: var(--ofb-shadow-slab);
  padding:12px;
}

/* Timer */
body.ofi .timerRow{display:flex; justify-content:flex-end; margin:2px 0 8px}
body.ofi .timer{display:flex; align-items:center; gap:10px}
body.ofi .timer svg{width:42px; height:42px}
body.ofi .timer .t{font-weight:800}

/* Action stack: secuencia vertical, pero botones con ancho limitado */
body.ofi .action-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:6px;
  align-items:flex-start;
}
body.ofi .action-stack .btn{
  width: min(340px, 100%);
  min-width: 0;
}
@media (max-width: 560px){
body.ofi .action-stack{align-items:stretch}
body.ofi .action-stack .btn{width:100%}
}

/* Notificaciones cerca del borrador */
body.ofi #draftNote{color: rgba(169,179,209,0.95); font-style: italic; font-size:0.90rem}
body.ofi #turnHint{color: rgba(245,247,255,0.92); font-weight:650; font-size:0.92rem}
body.ofi #statusLine{color: rgba(0,211,143,0.92); font-weight:650; font-size:0.92rem}
body.ofi #draftHint{color: rgba(169,179,209,0.95); font-size:0.90rem}

/* Footer */
body.ofi footer .fine{
  font-size:.82rem;
  color: rgba(169,179,209,0.92);
  text-align:center;
  margin-top:16px;
  opacity:0.9;
}

/* Small screens */
@media (max-width: 480px){
body.ofi .container{padding:0 12px}
body.ofi .main-card{padding:16px 14px 14px}
body.ofi .card{padding:14px 12px}
}


/* =========================
   Pro timer (always visible)
   ========================= */
body.ofi .timerRow{ justify-content:flex-start; }

body.ofi .timer{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(190,204,238,0.22);
  background: rgba(3,14,44,0.55);
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
}
body.ofi .timer svg{ width:34px; height:34px; }
body.ofi .timer .t{
  font-weight:800;
  font-size:0.92rem;
  min-width:46px;
  text-align:right;
}

body.ofi .timer.is-idle{ opacity:0.78; filter:saturate(0.92); }
body.ofi .timer.is-active{ opacity:1; }


/* =========================
   Turn header: left info + right editor
   ========================= */
body.ofi .turn{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items:start;
}

/* Desktop */
@media (min-width: 980px){
body.ofi .turn{
    grid-template-columns: 420px 1fr;
    gap: 14px;
  }
}

body.ofi .turn-left{min-width: 260px}
body.ofi .turn-right{min-width: 320px}

/* Toggle "slab" separated under peer info */
body.ofi .orig-toggle-slab{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(190,204,238,0.18);
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
  display: inline-block;
  max-width: 100%;
}

body.ofi .toggle-left{ margin: 0; }

/* Right editor panel feels like a card */
body.ofi .turn-right{
  padding: 12px;
  border-radius: 18px;
  background: rgba(3,14,44,0.55);
  border: 1px solid rgba(190,204,238,0.18);
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
}

body.ofi .turn-right #draft{ min-height: 120px; }

/* Notes in header */
body.ofi #draftNote{ margin-top: 6px; font-style: italic; }

/* Fallback: if old HTML still has turn-actions, force it LEFT + below title */
body.ofi .turn-actions{
  justify-content:flex-start !important;
  flex: 1 1 100% !important;
  order: 3;
  margin-top: 8px;
}
body.ofi .turn-actions .toggle{ margin-left: 0 !important; }



/* Toggle + jump-to-controls button */
body.ofi .orig-toggle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

body.ofi .icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(190,204,238,0.22);
  background: rgba(3,14,44,0.55);
  color: rgba(245,247,255,0.96);
  cursor:pointer;
  font-weight:800;
  line-height:1;
  user-select:none;
  white-space:nowrap;
}
body.ofi .icon-btn:hover{ filter: brightness(1.06); transform: translateY(-1px); }
body.ofi .icon-btn:active{ transform: translateY(0); }
/* =========================
   FIX FAQ: texto legible en tema oscuro
   ========================= */

/* Fondo del acorden (oscuro) */
body.ofi #faq details{
  background: rgba(4,19,60,0.92) !important;   /* igual a .card */
  border: 1px solid rgba(255,255,255,0.10) !important;
}

/* Ttulo (summary) */
body.ofi #faq summary{
  color: var(--ofb-text) !important;
}

/*  Respuestas: fuerza TODO el contenido interno a texto claro */
body.ofi #faq details > *:not(summary),
body.ofi #faq details > *:not(summary) *{
  color: rgba(245,247,255,0.90) !important;
}

/* Resaltados */
body.ofi #faq details strong{
  color: var(--ofb-text) !important;
}

/* Enlaces dentro de respuestas: verde accent, legible */
body.ofi #faq details a,
body.ofi #faq details a *{
  color: var(--ofb-accent) !important;
  text-decoration: underline;
}
/* =========================
   FIX Footer contrast (Turbo/CSS residual)
   ========================= */
body.ofi footer{
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(190,204,238,0.18);
  border-radius: 16px;
  padding: 12px 12px;
}
body.ofi footer,
body.ofi footer *{
  color: rgba(245,247,255,0.92) !important;
}
