/* ============================================================================
 * FractAIll OS — Shell de omni.fractaill.com
 * ============================================================================
 * Topbar dark fija (44px) + apps fullscreen + dock con todas las apps.
 * Desktop (>=768px) → estilo macOS · Móvil (<768px) → estilo iOS.
 * Versión: 2.1.0 · 2026-04-28
 * ============================================================================ */

/* ─── Reset suave para que el OS ocupe pantalla completa ──────────────────── */
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body[data-fract-shell] { padding-top: 0 !important; padding-bottom: 0 !important; }
/* Ocultar el header sticky del shell — el OS tiene su propio topbar */
.fract-shell { display: none !important; }
/* Ocultar el dock automático del shell — el OS tiene su propio dock */
.fract-dock-spacer, .fract-dock { display: none !important; }

:root {
  --os-topbar-h: 44px;
  --os-topbar-bg: #0E0E10;
  --os-topbar-fg: rgba(255,255,255,0.95);
  --os-topbar-fg-dim: rgba(255,255,255,0.62);
  --os-topbar-border: rgba(255,255,255,0.08);
}

/* ─── Wallpaper ──────────────────────────────────────────────────────────── */
.os-wallpaper {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 90% 70% at 30% 20%, rgba(255,149,80,0.28) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 80% 80%, rgba(255,122,41,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(201,85,26,0.12) 0%, transparent 60%),
    linear-gradient(135deg, #FFE9D6 0%, #FAFAF7 50%, #F4F0E8 100%);
  background-attachment: fixed;
}
[data-theme="dark"] .os-wallpaper {
  background:
    radial-gradient(ellipse 90% 70% at 30% 20%, rgba(255,138,61,0.20) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 80% 80%, rgba(255,122,41,0.12) 0%, transparent 55%),
    linear-gradient(135deg, #14110F 0%, #0E0E10 50%, #1A1611 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .os-wallpaper {
    background:
      radial-gradient(ellipse 90% 70% at 30% 20%, rgba(255,138,61,0.20) 0%, transparent 55%),
      radial-gradient(ellipse 70% 60% at 80% 80%, rgba(255,122,41,0.12) 0%, transparent 55%),
      linear-gradient(135deg, #14110F 0%, #0E0E10 50%, #1A1611 100%);
  }
}
/* dot pattern overlay sutil */
.os-wallpaper::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(10,10,13,0.06) 1px, transparent 1px);
  background-size: 22px 22px; opacity: 0.5; pointer-events: none;
}
[data-theme="dark"] .os-wallpaper::before { background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px); }

/* ============================================================================
 * TOPBAR — dark, sticky, 44px
 * ============================================================================ */
.os-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--os-topbar-h);
  z-index: 100;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: var(--os-topbar-bg);
  color: var(--os-topbar-fg);
  border-bottom: 1px solid var(--os-topbar-border);
  font-family: var(--fract-font-sans, -apple-system, "SF Pro Display", "Inter", sans-serif);
  font-size: 14px;
  user-select: none; -webkit-user-select: none;
}
.os-topbar .tb-brand {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; border: 0; padding: 4px 8px;
  border-radius: 8px; cursor: pointer;
  color: inherit; font-family: inherit;
  transition: background 0.16s ease;
}
.os-topbar .tb-brand:hover { background: rgba(255,255,255,0.08); }
.os-topbar .tb-brand img {
  width: 22px; height: 22px; border-radius: 5px;
  flex-shrink: 0;
}
.os-topbar .tb-app {
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--os-topbar-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 50vw;
}
.os-topbar .tb-spacer { flex: 1; }
.os-topbar .tb-right {
  display: inline-flex; align-items: center; gap: 6px;
}
.os-topbar .tb-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--os-topbar-fg);
  padding: 5px 10px 5px 8px;
  border-radius: 7px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease;
}
.os-topbar .tb-back:hover { background: rgba(255,255,255,0.14); }
.os-topbar .tb-back i { font-size: 14px; }
.os-topbar .tb-icon {
  width: 30px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  color: var(--os-topbar-fg-dim);
  border-radius: 7px; cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.os-topbar .tb-icon:hover { background: rgba(255,255,255,0.08); color: var(--os-topbar-fg); }
.os-topbar .tb-icon i { font-size: 16px; }
.os-topbar .tb-clock {
  font-size: 13px; font-weight: 500;
  color: var(--os-topbar-fg-dim);
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  cursor: default;
}
.os-topbar .tb-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 12px 3px 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
  color: var(--os-topbar-fg);
  font-family: inherit;
  transition: background 0.16s ease;
}
.os-topbar .tb-pill:hover { background: rgba(255,255,255,0.16); }
.os-topbar .tb-pill .av {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--fract-accent, #FF7A29), var(--fract-accent-deep, #C9551A));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; overflow: hidden;
  flex-shrink: 0;
}
.os-topbar .tb-pill .av img { width: 100%; height: 100%; object-fit: cover; }
.os-topbar .tb-pill .nm {
  font-size: 13px; font-weight: 600;
  max-width: 120px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Dropdown del pill ──────────────────────────────────────────────────── */
.os-dropdown {
  position: fixed;
  top: calc(var(--os-topbar-h) + 6px);
  right: 12px;
  z-index: 110;
  background: var(--fract-bg-elev, #fff);
  border: 1px solid var(--fract-border, rgba(0,0,0,0.08));
  border-radius: 12px;
  box-shadow: var(--fract-shadow-lg, 0 18px 40px -12px rgba(10,10,13,0.30));
  min-width: 240px; padding: 6px;
  display: none;
  animation: osDropFade 0.18s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}
.os-dropdown.open { display: block; }
.os-dropdown a, .os-dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--fract-text, #0E0E10);
  text-decoration: none; background: transparent; border: 0; cursor: pointer;
  font-family: inherit; text-align: left;
  transition: background 0.14s ease;
}
.os-dropdown a:hover, .os-dropdown button:hover { background: var(--fract-surface, rgba(0,0,0,0.04)); }
.os-dropdown .sep { height: 1px; background: var(--fract-border, rgba(0,0,0,0.08)); margin: 4px 6px; }
.os-dropdown .head {
  padding: 10px 12px; border-bottom: 1px solid var(--fract-border, rgba(0,0,0,0.08));
  margin-bottom: 4px;
}
.os-dropdown .head strong { display: block; font-size: 14px; font-weight: 700; }
.os-dropdown .head span { font-size: 12px; color: var(--fract-text-dim, rgba(0,0,0,0.55)); }
@keyframes osDropFade {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================================
 * HOME — pantalla cuando no hay app abierta
 * ============================================================================ */
.os-home {
  position: fixed;
  top: var(--os-topbar-h); left: 0; right: 0; bottom: 0;
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  pointer-events: none;
  transition: opacity 0.34s ease, transform 0.34s ease;
}
.os-home.hidden { opacity: 0; transform: scale(0.98); pointer-events: none; }
.os-home-inner {
  text-align: center;
  color: var(--fract-text, #0E0E10);
  pointer-events: auto;
  animation: osHomeIn 0.6s ease both 0.2s;
  max-width: 760px; width: 100%;
}
@keyframes osHomeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.os-home-inner img {
  width: 84px; height: 84px; border-radius: 22px;
  box-shadow: 0 24px 50px -10px rgba(255,122,41,0.35);
  margin-bottom: 22px;
}
/* "BUENAS TARDES" — eyebrow naranja sutil, contraste alto */
.os-home-inner .greet {
  font-family: var(--fract-font-sans, -apple-system, "SF Pro Display", "Inter", sans-serif);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fract-accent, #FF7A29);
  opacity: 0.92;
  margin-bottom: 12px;
}
/* "Bienvenido, Juan" — gran serif, alto contraste */
.os-home-inner h1 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 700;
  font-size: clamp(40px, 7vw, 84px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 28px;
  color: rgba(10, 10, 13, 0.95);
  text-shadow: 0 2px 18px rgba(255,255,255,0.4);
}
.os-home-inner h1 .accent {
  color: var(--fract-accent, #FF7A29);
  font-style: italic;
}
[data-theme="dark"] .os-home-inner h1 {
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .os-home-inner h1 {
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 2px 24px rgba(0,0,0,0.5);
  }
}

/* ─── Input IA estilo ChatGPT ─────────────────────────────────────────────── */
.os-ai-form {
  position: relative;
  display: block;
  width: min(720px, 92vw);
  margin: 0 auto 18px;
}
.os-ai-form .os-ai-icon {
  position: absolute;
  left: 22px; top: 50%; transform: translateY(-50%);
  font-size: 20px;
  color: var(--fract-accent, #FF7A29);
  pointer-events: none;
  opacity: 0.85;
  z-index: 2;
}
.os-ai-form input[type="text"] {
  width: 100%;
  border-radius: 999px;
  padding: 18px 64px 18px 56px;
  background: rgba(255,255,255,0.55);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(10,10,13,0.10);
  color: rgba(10,10,13,0.92);
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  box-shadow:
    0 8px 24px -8px rgba(10,10,13,0.10),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: all .2s ease;
}
.os-ai-form input[type="text"]::placeholder {
  color: rgba(10,10,13,0.42);
  font-weight: 500;
}
.os-ai-form input[type="text"]:focus {
  border-color: var(--fract-accent, #FF7A29);
  background: rgba(255,255,255,0.78);
  box-shadow:
    0 0 0 4px rgba(255,122,41,0.15),
    0 8px 24px -8px rgba(255,122,41,0.20);
}
[data-theme="dark"] .os-ai-form input[type="text"] {
  background: rgba(20,20,22,0.55);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.96);
}
[data-theme="dark"] .os-ai-form input[type="text"]::placeholder {
  color: rgba(255,255,255,0.45);
}
[data-theme="dark"] .os-ai-form input[type="text"]:focus {
  background: rgba(20,20,22,0.78);
  border-color: var(--fract-accent, #FF7A29);
  box-shadow:
    0 0 0 4px rgba(255,122,41,0.20),
    0 8px 24px -8px rgba(255,122,41,0.30);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .os-ai-form input[type="text"] {
    background: rgba(20,20,22,0.55);
    border-color: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.96);
  }
  :root:not([data-theme="light"]) .os-ai-form input[type="text"]::placeholder { color: rgba(255,255,255,0.45); }
}
.os-ai-form .os-ai-send {
  position: absolute;
  right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--fract-accent, #FF7A29), var(--fract-accent-deep, #C9551A));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 14px -4px rgba(255,122,41,0.55);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  z-index: 2;
}
.os-ai-form .os-ai-send:hover { transform: translateY(-50%) scale(1.06); }
.os-ai-form .os-ai-send:active { transform: translateY(-50%) scale(0.96); }
.os-ai-form .os-ai-send i { font-size: 18px; line-height: 1; }

.os-home-inner .hint {
  font-size: 13px;
  color: var(--fract-text-dim, rgba(10,10,13,0.50));
  margin: 14px 0 0;
}

/* ============================================================================
 * APP CONTAINER — iframe fullscreen
 * ============================================================================ */
.os-app-container {
  position: fixed;
  top: var(--os-topbar-h); left: 0; right: 0; bottom: 0;
  z-index: 2;
  background: var(--fract-bg, #FAFAF7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.os-app-container.open { opacity: 1; pointer-events: auto; }
.os-app-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--fract-bg, #FAFAF7);
}

/* ============================================================================
 * APPS GRID (sub-app)
 * ============================================================================ */
.os-apps-grid {
  position: fixed;
  top: var(--os-topbar-h); left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: none;
  overflow-y: auto;
  background: transparent;
}
.os-apps-grid.open { display: block; animation: osHomeIn 0.4s ease both; }
.os-apps-grid .oag-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 32px 140px;
}
.os-apps-grid h2 {
  font-family: var(--fract-font-serif, Georgia, serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--fract-text, #0E0E10);
}
.os-apps-grid .oag-sub {
  font-size: 15px;
  color: var(--fract-text-dim, rgba(0,0,0,0.55));
  margin: 0 0 32px;
}
.os-apps-grid .oag-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
}
.os-apps-grid .oag-item {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 10px;
  background: var(--fract-bg-elev, #fff);
  border: 1px solid var(--fract-border, rgba(0,0,0,0.08));
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1)), box-shadow 0.18s ease;
}
.os-apps-grid .oag-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -10px rgba(10,10,13,0.18);
}
.os-apps-grid .oag-item .ic {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ic-c1, var(--fract-accent)), var(--ic-c2, var(--fract-accent-deep)));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(10,10,13,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
}
.os-apps-grid .oag-item .ic i { font-size: 28px; line-height: 1; color: #fff; }
.os-apps-grid .oag-item .lb {
  font-size: 13px; font-weight: 600;
  color: var(--fract-text, #0E0E10);
  text-align: center;
}

/* ============================================================================
 * DOCK — bottom (default), left, right
 * Estructura: tile coloreado (z-index 1) + ícono blanco encima (z-index 2)
 * ============================================================================ */
.os-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.55);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 20px;
  box-shadow:
    0 24px 50px -12px rgba(10,10,13,0.28),
    inset 0 1px 0 rgba(255,255,255,0.50);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  animation: osDockUp 0.6s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both 0.15s;
}
.os-dock::-webkit-scrollbar { display: none; }
[data-theme="dark"] .os-dock {
  background: rgba(20,20,22,0.55);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 24px 50px -12px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .os-dock {
    background: rgba(20,20,22,0.55);
    border-color: rgba(255,255,255,0.10);
    box-shadow:
      0 24px 50px -12px rgba(0,0,0,0.45),
      inset 0 1px 0 rgba(255,255,255,0.10);
  }
}
@keyframes osDockUp {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ─── Dock posición LEFT ─────────────────────────────────────────────────── */
body[data-dock-position="left"] .os-dock {
  left: 16px;
  top: 50%;
  bottom: auto;
  right: auto;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  max-height: calc(100vh - 32px);
  max-width: none;
  overflow-x: visible;
  overflow-y: auto;
  animation: osDockLeftIn 0.6s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both 0.15s;
}
@keyframes osDockLeftIn {
  from { opacity: 0; transform: translate(-30px, -50%); }
  to   { opacity: 1; transform: translate(0, -50%); }
}
/* ─── Dock posición RIGHT ────────────────────────────────────────────────── */
body[data-dock-position="right"] .os-dock {
  right: 16px;
  top: 50%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  max-height: calc(100vh - 32px);
  max-width: none;
  overflow-x: visible;
  overflow-y: auto;
  animation: osDockRightIn 0.6s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both 0.15s;
}
@keyframes osDockRightIn {
  from { opacity: 0; transform: translate(30px, -50%); }
  to   { opacity: 1; transform: translate(0, -50%); }
}

/* ─── Dock items ─────────────────────────────────────────────────────────── */
.os-dock-item {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: transparent;        /* el color va al .os-dock-tile */
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
  border: 0;
  flex-shrink: 0;
  padding: 0;
  transition:
    transform 0.22s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1)),
    margin 0.22s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
  transform-origin: center bottom;
}
/* Tile coloreado detrás del ícono — z-index 1 */
.os-dock-item .os-dock-tile {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ic-c1, var(--fract-accent, #FF7A29)), var(--ic-c2, var(--fract-accent-deep, #C9551A)));
  box-shadow:
    0 4px 10px -3px rgba(10,10,13,0.30),
    inset 0 1px 0 rgba(255,255,255,0.25);
  z-index: 1;
  pointer-events: none;
}
/* Ícono Phosphor BLANCO encima — z-index 2, force visible */
.os-dock-item > i.ph,
.os-dock-item > i[class*="ph-"] {
  position: relative;
  z-index: 2;
  color: #ffffff !important;
  font-size: 26px !important;
  line-height: 1 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
  pointer-events: none;
}
.os-dock-item:hover {
  transform: translateY(-12px) scale(1.30);
  margin: 0 6px;
}
body[data-dock-position="left"] .os-dock-item:hover,
body[data-dock-position="right"] .os-dock-item:hover {
  transform: scale(1.20);
  margin: 6px 0;
}
.os-dock-item:active { transform: translateY(-4px) scale(1.10); transition-duration: 0.08s; }
body[data-dock-position="left"] .os-dock-item:active,
body[data-dock-position="right"] .os-dock-item:active { transform: scale(0.96); }

.os-dock-item .tooltip {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  background: #0E0E10; color: #fff;
  font-size: 11.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 6px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.14s ease;
  z-index: 3;
}
body[data-dock-position="left"] .os-dock-item .tooltip {
  bottom: auto; top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
}
body[data-dock-position="right"] .os-dock-item .tooltip {
  bottom: auto; top: 50%;
  left: auto; right: calc(100% + 10px);
  transform: translateY(-50%);
}
.os-dock-item:hover .tooltip { opacity: 1; }
.os-dock-item .indicator {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--fract-accent, #FF7A29);
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
  box-shadow: 0 0 6px rgba(255,122,41,0.6);
  z-index: 3;
}
body[data-dock-position="left"] .os-dock-item .indicator {
  bottom: auto; top: 50%;
  left: -8px; right: auto;
  transform: translateY(-50%);
}
body[data-dock-position="right"] .os-dock-item .indicator {
  bottom: auto; top: 50%;
  left: auto; right: -8px;
  transform: translateY(-50%);
}
.os-dock-item.active .indicator { opacity: 1; }

/* ============================================================================
 * MODAL (SoFZip · Settings · genérico)
 * ============================================================================ */
.os-modal-bg {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(10,10,13,0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: osModalFade 0.22s ease both;
}
.os-modal-bg.closing { animation: osModalFadeOut 0.22s ease both; }
@keyframes osModalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes osModalFadeOut { from { opacity: 1; } to { opacity: 0; } }
.os-modal {
  position: relative;
  width: min(420px, 100%);
  background: var(--fract-bg-elev, #fff);
  border: 1px solid var(--fract-border, rgba(0,0,0,0.08));
  border-radius: 20px;
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: 0 32px 64px -16px rgba(10,10,13,0.45);
  animation: osModalIn 0.32s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}
.os-modal.os-modal-wide { width: min(540px, 100%); }
@keyframes osModalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.os-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: 0; background: transparent; cursor: pointer;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--fract-text-dim, rgba(0,0,0,0.55));
  transition: background 0.14s ease;
}
.os-modal-close:hover { background: var(--fract-surface, rgba(0,0,0,0.06)); }
.os-modal-close i { font-size: 18px; }
.os-modal-icon {
  width: 76px; height: 76px;
  border-radius: 20px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--ic-c1, var(--fract-accent)), var(--ic-c2, var(--fract-accent-deep)));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 14px 28px -8px rgba(10,10,13,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
}
.os-modal-icon i { font-size: 36px; color: #fff; }
.os-modal h2 {
  font-family: var(--fract-font-serif, Georgia, serif);
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--fract-text, #0E0E10);
}
.os-modal p {
  font-size: 14.5px; line-height: 1.55;
  color: var(--fract-text-dim, rgba(0,0,0,0.55));
  margin: 0 0 22px;
}
.os-modal-actions {
  display: flex; flex-direction: column; gap: 8px;
}
.os-modal-actions .btn-pri {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 10px;
  background: linear-gradient(135deg, var(--fract-accent, #FF7A29), var(--fract-accent-deep, #C9551A));
  color: #fff; text-decoration: none;
  font-family: inherit; font-size: 14px; font-weight: 700;
  border: 0; cursor: pointer;
  box-shadow: 0 8px 18px -6px rgba(255,122,41,0.5);
  transition: transform 0.14s ease;
}
.os-modal-actions .btn-pri:hover { transform: translateY(-1px); }
.os-modal-actions .btn-sec {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--fract-border, rgba(0,0,0,0.10));
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--fract-text-dim, rgba(0,0,0,0.55));
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease;
}
.os-modal-actions .btn-sec:hover { background: var(--fract-surface, rgba(0,0,0,0.04)); }

/* ─── Settings: posición del dock ────────────────────────────────────────── */
.os-settings-section {
  text-align: left;
  margin: 8px 0 22px;
  padding: 18px;
  border-radius: 14px;
  background: var(--fract-surface, rgba(10,10,13,0.03));
  border: 1px solid var(--fract-border, rgba(0,0,0,0.06));
}
.os-settings-section h3 {
  font-family: var(--fract-font-sans);
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fract-text, #0E0E10);
  margin: 0 0 4px;
}
.os-settings-hint {
  font-size: 12.5px;
  color: var(--fract-text-dim, rgba(0,0,0,0.55));
  margin: 0 0 14px;
  text-align: left;
}
.os-dock-pos-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.os-dock-pos-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--fract-border, rgba(0,0,0,0.08));
  background: var(--fract-bg-elev, #fff);
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
}
.os-dock-pos-opt:hover { transform: translateY(-1px); }
.os-dock-pos-opt input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.os-dock-pos-opt.active {
  border-color: var(--fract-accent, #FF7A29);
  background: rgba(255,122,41,0.06);
  box-shadow: 0 0 0 3px rgba(255,122,41,0.12);
}
.opt-preview {
  width: 60px; height: 44px;
  border-radius: 8px;
  background: rgba(10,10,13,0.06);
  position: relative;
  display: block;
  border: 1px solid rgba(10,10,13,0.08);
}
.opt-preview .opt-bar {
  position: absolute;
  background: linear-gradient(135deg, var(--fract-accent, #FF7A29), var(--fract-accent-deep, #C9551A));
  border-radius: 3px;
}
.opt-preview[data-pos="bottom"] .opt-bar { left: 12px; right: 12px; bottom: 4px; height: 6px; }
.opt-preview[data-pos="left"]   .opt-bar { left: 4px;  top: 8px;    bottom: 8px; width: 6px; }
.opt-preview[data-pos="right"]  .opt-bar { right: 4px; top: 8px;    bottom: 8px; width: 6px; }
.opt-label {
  font-size: 12px; font-weight: 600;
  color: var(--fract-text, #0E0E10);
}

/* ============================================================================
 * Toast simple
 * ============================================================================ */
.os-toast-simple {
  position: fixed;
  top: calc(var(--os-topbar-h) + 12px); left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,22,0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  z-index: 300;
  box-shadow: 0 14px 32px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.12);
  max-width: 90%; text-align: center;
  animation: osToastIn 0.32s var(--fract-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}
.os-toast-simple.out { animation: osToastOut 0.32s ease both; }
@keyframes osToastIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes osToastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* ============================================================================
 * MOVIL (<768px) — iOS-feel · siempre dock abajo
 * ============================================================================ */
@media (max-width: 767px) {
  :root { --os-topbar-h: 50px; }

  .os-topbar {
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0);
    height: calc(var(--os-topbar-h) + env(safe-area-inset-top, 0));
  }
  .os-topbar .tb-clock { display: none; }
  .os-topbar .tb-icon { display: none; }
  .os-topbar .tb-pill .nm { max-width: 70px; }
  .os-topbar .tb-back span { display: none; }
  .os-topbar .tb-back { padding: 6px 8px; }
  .os-topbar .tb-app { font-size: 15px; max-width: 35vw; }

  .os-home-inner img { width: 70px; height: 70px; margin-bottom: 14px; }
  .os-home-inner .greet { font-size: 11.5px; letter-spacing: 0.16em; margin-bottom: 8px; }
  .os-home-inner h1 {
    font-size: clamp(34px, 9vw, 52px);
    margin: 0 0 22px;
  }
  .os-ai-form input[type="text"] {
    padding: 14px 56px 14px 50px;
    font-size: 15px;
  }
  .os-ai-form .os-ai-icon { left: 18px; font-size: 18px; }
  .os-ai-form .os-ai-send { width: 36px; height: 36px; right: 6px; }
  .os-ai-form .os-ai-send i { font-size: 16px; }

  /* Forzar bottom siempre en móvil — espacio limitado */
  body[data-dock-position="left"] .os-dock,
  body[data-dock-position="right"] .os-dock,
  .os-dock {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0)) !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
    max-height: none !important;
    max-width: calc(100vw - 24px) !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 8px 10px;
    gap: 4px;
    border-radius: 24px;
  }
  body[data-dock-position="left"] .os-dock-item .tooltip,
  body[data-dock-position="right"] .os-dock-item .tooltip {
    bottom: calc(100% + 10px); top: auto;
    left: 50%; right: auto;
    transform: translateX(-50%);
  }

  .os-dock-item {
    width: 52px; height: 52px;
    border-radius: 13px;
  }
  .os-dock-item > i.ph,
  .os-dock-item > i[class*="ph-"] { font-size: 28px !important; }
  .os-dock-item:hover { transform: none; margin: 0; }
  .os-dock-item:active {
    transform: scale(0.92);
    transition-duration: 0.08s;
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .os-dock-item .tooltip { display: none; }

  .os-apps-grid .oag-inner { padding: 32px 18px 140px; }
  .os-apps-grid .oag-list {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }

  .os-dock-pos-options { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .os-dock-pos-opt { padding: 10px 4px; }
  .opt-preview { width: 48px; height: 36px; }
}
