/* TALENTA — Aurora Guide v2 + appearance preferences */

html[data-theme="dark"] {
  --ink: #eef7fa;
  --ink-secondary: #a8bac2;
  --ink-tertiary: #7f949d;
  --ink-placeholder: #68808a;
  --surface-0: #0d1519;
  --surface-1: #111c21;
  --surface-2: #17252b;
  --surface-3: #1d2d34;
  --surface-4: #263941;
  --border: #24383f;
  --border-subtle: #1b2c32;
  --border-strong: #38515a;
  --accent-soft: #0d2c34;
  --accent-muted: #0e292d;
  --success-soft: #10291b;
  --warning-soft: #322512;
  --danger-soft: #351a18;
  --info-soft: #13283f;
  --overlay: rgba(0, 0, 0, .58);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.28);
  --shadow-sm: 0 3px 10px rgba(0,0,0,.24);
  --shadow: 0 8px 28px rgba(0,0,0,.28);
  --shadow-md: 0 16px 36px rgba(0,0,0,.34);
  --shadow-lg: 0 24px 58px rgba(0,0,0,.42);
  /* Alias usados por capas legacy/premium para que el tema sea global. */
  --ink-primary: var(--ink);
  --text-muted: var(--ink-secondary);
  --surface-base: var(--surface-1);
  --surface-raised: var(--surface-0);
  --surface-hover: var(--surface-2);
  --bg: var(--surface-1);
  --bg-sidebar: var(--surface-0);
  --bg-header: var(--surface-0);
  --bg-content: var(--surface-1);
  --bg-card: var(--surface-0);
  --bg-hover: var(--surface-2);
  --bg-active: var(--surface-3);

  /* TALENTA 9 */
  --t9-bg: #0d1519;
  --t9-surface: #111c21;
  --t9-line: #24383f;
  --t9-ink: #eef7fa;
  --t9-muted: #a8bac2;
  --t9-accent: #22b8d0;
  --t9-accent-soft: #0d2c34;
  --t9-focus: 0 0 0 3px rgba(34,184,208,.24);
  color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .content-area {
  background: var(--t9-bg);
  color: var(--t9-ink);
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .sidebar-foot {
  background: #101b20 !important;
}

html[data-theme="dark"] .header {
  background: rgba(17,28,33,.94) !important;
}

html[data-theme="dark"] .header-search-input {
  background: var(--surface-2) !important;
  color: var(--t9-ink) !important;
}

html[data-theme="dark"] .page-header h2,
html[data-theme="dark"] .premium-page-title,
html[data-theme="dark"] .dash-hero h1,
html[data-theme="dark"] .pin-card h2,
html[data-theme="dark"] .pin-card label {
  color: var(--t9-ink) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .dash-panel,
html[data-theme="dark"] .dash-kpi-chip,
html[data-theme="dark"] .smart-row,
html[data-theme="dark"] .formato-lib-card,
html[data-theme="dark"] .formato-cat-card,
html[data-theme="dark"] .config-panel,
html[data-theme="dark"] .attendance-team-card,
html[data-theme="dark"] .attendance-event-table,
html[data-theme="dark"] .t9-upgrade,
html[data-theme="dark"] .pending-invitation-card {
  background: var(--t9-surface) !important;
  color: var(--t9-ink);
}

html[data-theme="dark"] .smart-row:hover {
  background: var(--surface-2) !important;
}

html[data-theme="dark"] .attendance-team-summary > div {
  background: var(--surface-2) !important;
}

html[data-theme="dark"] .attendance-state-row {
  border-bottom-color: var(--t9-line);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--surface-1);
  color: var(--t9-ink);
  border-color: var(--t9-line);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--ink-placeholder);
}

html[data-theme="dark"] .employee-tabs button.active {
  background: var(--surface-2);
  color: var(--t9-ink);
}

html[data-theme="dark"] .sidebar-close {
  background: var(--surface-2);
  color: var(--t9-ink);
  border-color: var(--t9-line);
}

html[data-ui-density="compact"] {
  --s-3: 10px;
  --s-4: 13px;
  --s-5: 16px;
  --s-6: 20px;
  --s-8: 26px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --header-h: 52px;
}

html[data-ui-density="comfortable"] {
  --s-3: 14px;
  --s-4: 18px;
  --s-5: 23px;
  --s-6: 28px;
  --s-8: 36px;
  --text-sm: 14px;
  --text-base: 15px;
  --text-md: 16px;
  --header-h: 60px;
}

body,
.card,
.modal,
.header,
.sidebar,
.content-area,
input,
select,
textarea,
button {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.aurora-guide-root {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, calc(72px + env(safe-area-inset-bottom)));
  /* Above mobile nav (95) and sidebar (100); below dropdowns/modals/toasts. */
  z-index: 120;
  pointer-events: none;
}

.aurora-guide-fab {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 12px 32px rgba(8,145,178,.28);
  pointer-events: auto;
  position: relative;
  display: grid;
  place-items: center;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}

.aurora-guide-fab:hover,
.aurora-guide-fab:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 36px rgba(8,145,178,.34);
  outline: none;
}

.aurora-guide-fab.is-touring {
  opacity: .25;
  pointer-events: none;
}

.aurora-guide-fab__label {
  position: absolute;
  right: 66px;
  white-space: nowrap;
  background: var(--surface-0);
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .18s ease, transform .18s ease;
}

.aurora-guide-fab:hover .aurora-guide-fab__label,
.aurora-guide-fab:focus-visible .aurora-guide-fab__label {
  opacity: 1;
  transform: translateX(0);
}

.aurora-orb {
  --aurora-size: 58px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--aurora-size);
  height: var(--aurora-size);
  flex: 0 0 var(--aurora-size);
}

.aurora-orb--mini { --aurora-size: 38px; }
.aurora-orb--card { --aurora-size: 74px; }
.aurora-orb--tour { --aurora-size: 60px; }

.aurora-orb__glow {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(118,255,241,.72), transparent 30%),
    radial-gradient(circle at 70% 65%, rgba(129,140,248,.62), transparent 44%),
    radial-gradient(circle, rgba(34,211,238,.4), transparent 70%);
  filter: blur(8px);
  animation: auroraGlow 4.8s ease-in-out infinite;
}

.aurora-orb__disc {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.24),
    0 7px 22px rgba(8,145,178,.28);
  animation: auroraFloat 5.2s cubic-bezier(.42,.08,.28,.96) infinite;
}

.aurora-orb__disc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
  filter: brightness(1.05) saturate(1.1);
}

.aurora-orb__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9%;
  padding-top: 6%;
  pointer-events: none;
}

.aurora-orb__face i {
  width: 10%;
  height: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 15%, #40367c 18% 45%, #111327 55% 100%);
  box-shadow: 0 0 5px rgba(255,255,255,.62);
  animation: auroraBlink 5.7s ease-in-out infinite;
}

.aurora-orb__spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 9px rgba(103,232,249,.9);
  z-index: 3;
  animation: auroraSpark 2.8s ease-in-out infinite;
}
.aurora-orb__spark--1 { left: 8%; top: 30%; }
.aurora-orb__spark--2 { right: 7%; top: 20%; animation-delay: .9s; }
.aurora-orb__spark--3 { right: 16%; bottom: 14%; animation-delay: 1.7s; }

@keyframes auroraFloat {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  30% { transform: translate3d(0,-2px,0) scale(1.012); }
  65% { transform: translate3d(1px,-1px,0) scale(.997); }
}
@keyframes auroraGlow {
  0%,100% { opacity: .72; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes auroraBlink {
  0%,44%,48%,100% { transform: scaleY(1); }
  46% { transform: scaleY(.08); }
}
@keyframes auroraSpark {
  0%,100% { opacity: .12; transform: scale(.5); }
  50% { opacity: 1; transform: scale(1.18); }
}

.aurora-guide-menu {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100dvh - 96px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-0) 94%, transparent);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(15,23,42,.22);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  transform-origin: bottom right;
  animation: auroraMenuIn .2s var(--ease);
}
@keyframes auroraMenuIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
}

.aurora-menu-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.aurora-menu-head div { min-width: 0; }
.aurora-menu-head strong,
.aurora-menu-head span { display: block; }
.aurora-menu-head span { color: var(--ink-secondary); font-size: 12px; margin-top: 2px; }
.aurora-menu-head > button {
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink); font-size: 20px;
}
.aurora-menu-progress { margin: 14px 0 12px; }
.aurora-menu-progress > span { color: var(--ink-secondary); font-size: 12px; }
.aurora-menu-progress > strong { float: right; font-size: 12px; }
.aurora-menu-progress > div,
.aurora-start-card__progress {
  height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px;
}
.aurora-menu-progress i,
.aurora-start-card__progress i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg,#22d3ee,#818cf8);
  transition: width .35s var(--ease);
}
.aurora-guide-menu > button:not(.aurora-menu-head button) {
  width: 100%; min-height: 44px; margin-top: 7px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--ink);
  font-weight: 650; cursor: pointer;
}
.aurora-guide-menu .aurora-menu-primary {
  color: white !important; border-color: transparent !important;
  background: linear-gradient(135deg,#0891b2,#6366f1) !important;
}
.aurora-menu-section {
  border-top: 1px solid var(--border); margin-top: 13px; padding-top: 12px;
}
.aurora-menu-section > summary { min-height: 44px; padding: 12px 0; color: var(--ink-secondary); font-size: 13px; font-weight: 700; cursor: pointer; }
.aurora-choice-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 8px; }
.aurora-choice-row button {
  min-height: 44px; padding: 5px 7px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--ink-secondary); font-size: 11px; font-weight: 650; cursor: pointer;
}
.aurora-choice-row button.is-active {
  color: var(--accent); border-color: color-mix(in srgb,var(--accent) 45%,var(--border));
  background: var(--accent-soft);
}

.aurora-start-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0 0 var(--s-5);
  padding: 18px;
  border: 1px solid color-mix(in srgb,var(--accent) 18%,var(--border));
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 15%, rgba(34,211,238,.10), transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(129,140,248,.09), transparent 34%),
    var(--surface-0);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.aurora-start-card__copy > span {
  display: block; margin-bottom: 4px; color: var(--accent); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
}
.aurora-start-card__copy h2 { margin: 0; font-size: clamp(18px,2.4vw,24px); }
.aurora-start-card__copy p { margin: 6px 0 10px; color: var(--ink-secondary); max-width: 680px; }
.aurora-start-card__copy small { display:block; color: var(--ink-tertiary); margin-top: 5px; }
.aurora-start-card__actions { display: flex; flex-direction: column; gap: 7px; min-width: 190px; }

.aurora-tour {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  isolation: isolate;
}
.aurora-tour__dim {
  position: absolute; inset: 0; background: rgba(6,15,22,.16); pointer-events: none;
}
.aurora-tour__hole {
  position: fixed;
  z-index: 2;
  border-radius: 16px;
  box-shadow:
    0 0 0 9999px rgba(6,15,22,.34),
    0 0 0 3px #22d3ee,
    0 0 30px rgba(34,211,238,.5);
  transition: left .44s var(--ease), top .44s var(--ease), width .35s var(--ease), height .35s var(--ease);
  animation: auroraHolePulse 1.8s ease-in-out infinite;
}
@keyframes auroraHolePulse {
  50% { box-shadow: 0 0 0 9999px rgba(6,15,22,.34),0 0 0 5px #67e8f9,0 0 38px rgba(34,211,238,.66); }
}
.aurora-tour__beam {
  position: fixed; inset: 0; width:100%; height:100%; z-index:3; pointer-events:none; overflow:visible;
}
.aurora-tour__beam line {
  stroke:#67e8f9; stroke-width:2; stroke-dasharray:5 8; stroke-linecap:round;
  animation: auroraBeam .9s linear infinite;
}
.aurora-tour__beam circle { fill:#a5f3fc; filter:drop-shadow(0 0 7px #22d3ee); }
@keyframes auroraBeam { to { stroke-dashoffset:-26; } }

.aurora-tour__orb {
  position: fixed;
  z-index: 7;
  width: 60px; height: 60px;
  pointer-events: none;
  transition: left .65s cubic-bezier(.22,1,.36,1), top .65s cubic-bezier(.22,1,.36,1), transform .25s ease;
}
.aurora-tour__orb.is-centered {
  left: calc(50% - 30px) !important;
  top: calc(50% - 170px) !important;
}

.aurora-tour__speech {
  position: fixed;
  z-index: 8;
  width: min(390px, calc(100vw - 24px));
  padding: 17px 18px 18px;
  border-radius: 20px;
  color: var(--ink);
  background: color-mix(in srgb,var(--surface-0) 96%,transparent);
  border: 1px solid color-mix(in srgb,var(--accent) 15%,var(--border));
  box-shadow: 0 26px 60px rgba(15,23,42,.28);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}
.aurora-tour__speech.is-centered {
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%,-50%);
}
.aurora-tour__kicker {
  display:block; margin-bottom:5px; color:var(--accent); font-size:11px; font-weight:800;
  text-transform:uppercase; letter-spacing:.08em;
}
.aurora-tour__speech h2 { margin:0 0 7px; font-size:20px; }
.aurora-tour__body { margin:0; color:var(--ink-secondary); line-height:1.55; }

.aurora-tour__controls {
  position: fixed; left:50%; bottom:max(14px,env(safe-area-inset-bottom)); z-index:9;
  width:min(560px,calc(100vw - 24px)); transform:translateX(-50%);
  padding:10px 12px 12px; border-radius:18px; border:1px solid var(--border);
  background:color-mix(in srgb,var(--surface-0) 96%,transparent);
  box-shadow:0 18px 46px rgba(15,23,42,.2); backdrop-filter:blur(16px); pointer-events:auto;
}
.aurora-tour__progress { height:4px; background:var(--surface-3); border-radius:999px; overflow:hidden; margin-bottom:8px; }
.aurora-tour__progress i { display:block; height:100%; background:linear-gradient(90deg,#22d3ee,#818cf8); transition:width .3s var(--ease); }
.aurora-tour__actions { display:flex; align-items:center; gap:7px; }
.aurora-tour__actions span { flex:1; }
.aurora-tour__actions button {
  min-height:44px; padding:8px 12px; border-radius:11px; border:1px solid var(--border);
  background:var(--surface-1); color:var(--ink); font-weight:650; cursor:pointer;
}
.aurora-tour__actions button.is-primary {
  color:white; border-color:transparent; background:linear-gradient(135deg,#0891b2,#6366f1);
}
.aurora-tour__actions button:disabled { opacity:.4; cursor:not-allowed; }

/* Editing remains possible while the guide is open, including with a mobile keyboard. */
.aurora-tour.is-editing { visibility: hidden; }
.aurora-tour__fallback { color: var(--ink-secondary); font-size: 14px; }
@media (max-width: 720px) and (max-height: 520px) {
  .aurora-tour__speech { max-height: 110px; overflow-y: auto; padding: 10px 12px; }
  .aurora-tour__speech h2 { font-size: 16px; }
  .aurora-tour__body { font-size: 14px; line-height: 1.3; }
}

@media (max-width: 720px) {
  .aurora-guide-root {
    right: max(12px,env(safe-area-inset-right));
    bottom: max(12px,calc(76px + env(safe-area-inset-bottom)));
  }
  .aurora-guide-fab { width:52px; height:52px; }
  .aurora-orb--fab { --aurora-size:52px; }
  .aurora-guide-fab__label { display:none; }
  .aurora-guide-menu {
    position:fixed;
    left:auto;
    right:max(12px,env(safe-area-inset-right));
    bottom:max(84px,calc(84px + env(safe-area-inset-bottom)));
    width:min(340px,calc(100vw - 24px));
    max-height:min(68dvh,calc(100dvh - 110px - env(safe-area-inset-bottom)));
    overflow:auto;
    overscroll-behavior:contain;
  }
  .aurora-start-card {
    grid-template-columns:auto 1fr;
    align-items:start;
    gap:12px;
    padding:15px;
    border-radius:18px;
  }
  .aurora-start-card__orb .aurora-orb { --aurora-size:56px; }
  .aurora-start-card__actions {
    grid-column:1/-1;
    display:grid;
    grid-template-columns:1fr;
    min-width:0;
  }
  .aurora-tour__speech {
    left:12px !important;
    right:12px !important;
    width:auto !important;
    max-height:36dvh;
    overflow:auto;
    border-radius:20px;
  }
  .aurora-tour__controls {
    width:calc(100vw - 16px);
    bottom:max(8px,env(safe-area-inset-bottom));
    border-radius:16px;
  }
  .aurora-tour__actions button { min-height:44px; }
  .aurora-tour__actions [data-tour-skip] { font-size:0; width:44px; padding:0; }
  .aurora-tour__actions [data-tour-skip]::after { content:'×'; font-size:21px; }
  html[data-ui-density="compact"] .content-area { padding-left:12px; padding-right:12px; }
  html[data-ui-density="comfortable"] .content-area { padding-left:18px; padding-right:18px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-orb__disc,
  .aurora-orb__glow,
  .aurora-orb__face i,
  .aurora-orb__spark,
  .aurora-tour__hole,
  .aurora-tour__beam line {
    animation:none !important;
  }
  .aurora-tour__orb,
  .aurora-tour__hole {
    transition:none !important;
  }
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus-visible {
  background: #066b86 !important;
  border-color: #066b86 !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus-visible {
  background: #0e7490 !important;
  border-color: #0e7490 !important;
  color: #ffffff !important;
}
/* Paint the tour atomically; never expose a tiny, not-yet-positioned panel. */
.aurora-tour.is-preparing .aurora-tour__speech,
.aurora-tour.is-preparing .aurora-tour__controls,
.aurora-tour.is-preparing .aurora-tour__orb,
.aurora-tour.is-preparing .aurora-tour__hole,
.aurora-tour.is-preparing .aurora-tour__beam { visibility: hidden !important; }
.aurora-tour__speech {
  box-sizing: border-box;
  min-height: 148px;
  max-height: min(66dvh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 720px) {
  .aurora-tour__speech {
    min-height: 148px;
    max-height: min(48dvh, 385px);
    backdrop-filter: none;
    background: var(--surface-0);
  }
  .aurora-tour__controls {
    backdrop-filter: none;
    background: var(--surface-0);
  }
}
@media (max-width: 720px) and (max-height: 520px) {
  .aurora-tour__speech {
    max-height: max(148px, min(46dvh, 260px));
    padding: 12px 14px;
  }
  .aurora-tour__speech h2 { font-size: 17px; line-height: 1.25; }
}

/* Aurora: información más concentrada sin disminuir los objetivos táctiles. */
.aurora-guide-menu { padding: 12px; border-radius: 17px; }
.aurora-guide-menu > button:not(.aurora-menu-head button) { margin-top: 5px; border-radius: 9px; }
.aurora-start-card { gap: 12px; padding: 14px; border-radius: 16px; }
.aurora-start-card__copy h2 { font-size: clamp(17px,2vw,21px); }
.aurora-start-card__copy p { font-size: 13px; line-height: 1.42; margin: 5px 0 7px; }
.aurora-start-card__actions { gap: 5px; min-width: 175px; }
.aurora-start-card__actions .btn { min-height: 44px; padding: 7px 10px; font-size: 13px; }
@media (max-width: 720px) {
  .aurora-start-card { padding: 13px; }
  .aurora-start-card__actions { min-width: 0; }
}

/* Aurora practical setup: real saved-state verification, no automatic writes. */
.aurora-setup-dialog{width:min(640px,calc(100vw - 24px));max-height:calc(100dvh - 28px);padding:0;border:1px solid var(--border);border-radius:18px;background:var(--surface-0);color:var(--ink);box-shadow:0 24px 70px rgba(0,0,0,.3);overflow:auto}
.aurora-setup-dialog::backdrop{background:rgba(6,16,23,.68)}
.aurora-setup-shell{padding:20px}
.aurora-setup-head{display:flex;justify-content:space-between;align-items:start;gap:12px}
.aurora-setup-head h2{font-size:clamp(19px,2.8vw,24px);margin:5px 0 0;line-height:1.2;color:var(--ink)}
.aurora-setup-kicker{font-size:11px;letter-spacing:.06em;color:var(--accent);font-weight:800}
.aurora-setup-close{flex:0 0 44px;width:44px;height:44px;font-size:22px;border-radius:50%;border:1px solid var(--border);background:var(--surface-2);color:var(--ink)}
.aurora-setup-intro{font-size:13px;color:var(--ink-secondary);line-height:1.5;margin:10px 0 14px}
.aurora-setup-progress{display:flex;justify-content:space-between;gap:12px;font-size:12px;font-weight:700;color:var(--ink-secondary)}
.aurora-setup-meter{height:5px;border-radius:99px;background:var(--surface-3);overflow:hidden;margin:8px 0 18px}
.aurora-setup-meter i{display:block;height:100%;background:linear-gradient(90deg,#0891b2,#15ab88);transition:width .18s ease}
.aurora-setup-step{padding:14px;border:1px solid var(--border);background:var(--surface-1);border-radius:12px}
.aurora-setup-step h3{font-size:17px;color:var(--ink);margin:0 0 6px}
.aurora-setup-step p{color:var(--ink-secondary);font-size:13px;margin:0 0 10px;line-height:1.5}
.aurora-setup-status{padding:10px 12px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2)}
.aurora-setup-status[data-state="verified"]{border-left:4px solid #118b68}
.aurora-setup-status[data-state="blocked"]{border-left:4px solid #b77e32}
.aurora-setup-method{margin-top:13px}
.aurora-setup-method label{display:block;font-weight:700;font-size:13px;margin-bottom:8px}
.aurora-setup-method select{width:100%;min-height:44px;border-radius:8px;padding:9px;border:1px solid var(--border);color:var(--ink);background:var(--surface-0)}
.aurora-setup-method small{display:block;font-size:12px;margin-top:7px;color:var(--ink-secondary)}
.aurora-setup-links a{display:inline-flex;align-items:center;font-size:13px;font-weight:700;min-height:44px;color:var(--accent)}
.aurora-setup-note{padding:11px 12px;background:var(--surface-2);border-radius:8px;font-size:12px;color:var(--ink-secondary)}
.aurora-setup-actions{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end}
.aurora-setup-actions button{min-height:44px;padding:8px 11px;border:1px solid var(--border);background:var(--surface-1);border-radius:9px;color:var(--ink);font-size:13px;font-weight:700}
.aurora-setup-actions button.is-primary{color:#fff;background:#086e84;border-color:#086e84}
.aurora-setup-actions button:disabled{opacity:.45;cursor:not-allowed}
.aurora-setup-dialog :focus-visible{outline:3px solid #e9ad42;outline-offset:2px}
@media(max-width:600px){
 .aurora-setup-dialog{max-height:calc(100dvh - 12px)}
 .aurora-setup-shell{padding:14px}
 .aurora-setup-step{padding:12px}
 .aurora-setup-actions{display:grid;grid-template-columns:1fr 1fr}
 .aurora-setup-actions button{padding:7px}
}
@media(prefers-reduced-motion:reduce){.aurora-setup-meter i{transition:none}}

/* Keep Ir al módulo / Siguiente visible when the viewport is short (incl. landscape). */
.aurora-setup-dialog:not(.aurora-setup-compact){
  display:flex;
  flex-direction:column;
  overflow:hidden;
  max-height:calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
.aurora-setup-dialog:not(.aurora-setup-compact) .aurora-setup-shell{
  display:flex;
  flex-direction:column;
  min-height:0;
  flex:1;
  overflow:auto;
  max-height:100%;
}
.aurora-setup-dialog:not(.aurora-setup-compact) .aurora-setup-actions{
  position:sticky;
  bottom:0;
  flex-shrink:0;
  background:var(--surface-0);
  padding-top:10px;
  margin-top:auto;
  z-index:1;
}
@media (max-height: 500px) and (orientation: landscape) {
  .aurora-setup-dialog:not(.aurora-setup-compact){
    width:min(720px, calc(100vw - 16px));
    max-height:calc(100dvh - 12px);
  }
  .aurora-setup-dialog:not(.aurora-setup-compact) .aurora-setup-shell{padding:10px 16px 8px}
  .aurora-setup-dialog:not(.aurora-setup-compact) .aurora-setup-intro,
  .aurora-setup-dialog:not(.aurora-setup-compact) .aurora-setup-note{display:none}
}


/* F4 - densidad en contenido, aislada a la preferencia Compacta.
   No usar zoom CSS ni transform:scale, y conservar dianas táctiles móviles. */
@media (min-width: 721px) {
  html[data-ui-density="compact"] .content-area .page-header{
    margin-bottom:14px;
    gap:12px;
  }
  html[data-ui-density="compact"] .content-area .page-header h2{
    font-size:clamp(19px,2vw,23px);
    line-height:1.25;
  }
  html[data-ui-density="compact"] .content-area .page-header p{
    margin:3px 0 0;
    line-height:1.4;
    font-size:13px;
  }
  html[data-ui-density="compact"] .content-area .card{
    padding:14px;
  }
  html[data-ui-density="compact"] .content-area .card-header{
    margin-bottom:11px;
    gap:9px;
  }
  html[data-ui-density="compact"] .content-area .form-grid{
    gap:12px;
  }
  html[data-ui-density="compact"] .content-area .data-table th{
    padding:7px 10px;
  }
  html[data-ui-density="compact"] .content-area .data-table td{
    padding:8px 10px;
  }
  html[data-ui-density="compact"] .content-area .page-header-actions{
    gap:7px;
  }
  html[data-ui-density="compact"] .content-area .btn{
    min-height:36px;
    padding:6px 11px;
    border-radius:8px;
  }
  html[data-ui-density="compact"] .content-area .btn.btn-sm{
    min-height:34px;
    padding:5px 9px;
  }
}
@media (max-width:720px){
  html[data-ui-density="compact"] .content-area .btn{
    min-height:44px;
  }
  html[data-ui-density="compact"] .content-area input,
  html[data-ui-density="compact"] .content-area select,
  html[data-ui-density="compact"] .content-area textarea {
    min-height:44px;
  }
}

/* Aurora sin IA: tarjeta contextual redactada, accesible y sin consultas externas. */
.aurora-context-card{
  margin:10px 0;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-1);
}
.aurora-context-card strong{display:block;color:var(--ink);font-size:13px;line-height:1.35}
.aurora-context-card p{font-size:12px;line-height:1.5;margin:5px 0;color:var(--ink-secondary)}
.aurora-context-card a{font-size:12px;font-weight:750;color:var(--accent);display:inline-flex;align-items:center;min-height:44px}
.aurora-context-card a[hidden]{display:none}

/* Aurora FAQ local. A collapsible choice list avoids noisy chat UI. */
.aurora-faq-box{margin:10px 0;border:1px solid var(--border);border-radius:11px;padding:10px 12px;background:var(--surface-1)}
.aurora-faq-box summary{font-weight:750;font-size:13px;color:var(--ink);cursor:pointer;min-height:44px;padding:12px 0}
.aurora-faq-box label{display:block;margin:12px 0 5px;font-size:12px}
.aurora-faq-box select{display:block;width:100%;min-height:44px;border:1px solid var(--border);color:var(--ink);background:var(--surface-0);border-radius:8px;padding:7px;font-size:13px}
.aurora-faq-box [data-aurora-faq-answer]{padding:10px;border-radius:8px;margin-top:9px;background:var(--surface-2)}
.aurora-faq-box [data-aurora-faq-answer][hidden]{display:none}
.aurora-faq-box [data-aurora-faq-text]{font-size:12px;line-height:1.5;color:var(--ink-secondary);margin:0}
.aurora-faq-box [data-aurora-faq-link]{display:inline-flex;align-items:center;min-height:44px;font-size:12px;color:var(--accent);font-weight:750}
.aurora-faq-box [data-aurora-faq-link][hidden]{display:none}

[data-aurora-current-target] {
  outline: 3px solid #0a829b;
  outline-offset: 3px;
}

.aurora-setup-dialog.aurora-setup-compact[open] {
  position: fixed;
  inset: auto 12px 12px auto;
  margin: 0;
  width: min(320px, calc(100vw - 24px));
  max-height: min(42dvh, 280px);
  /* Below --z-modal (300) so altas and other dialogs remain clickable. */
  z-index: 140;
  box-shadow: 0 6px 22px #0003;
  background: color-mix(in srgb, var(--surface-0) 96%, transparent);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.aurora-setup-dialog.aurora-setup-compact .aurora-setup-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.aurora-setup-dialog.aurora-setup-compact .aurora-setup-step {
  overflow: auto;
  min-height: 0;
}

.aurora-setup-dialog.aurora-setup-compact .aurora-setup-actions {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .aurora-setup-dialog.aurora-setup-compact .aurora-setup-head h2 { display: none; }
  .aurora-setup-dialog.aurora-setup-compact .aurora-setup-shell { padding: 8px 12px; }
  .aurora-setup-dialog.aurora-setup-compact .aurora-setup-step { padding: 6px 9px; }
  .aurora-setup-dialog.aurora-setup-compact .aurora-setup-actions { display: flex; }
  .aurora-setup-dialog.aurora-setup-compact[open] {
    inset: auto max(8px, env(safe-area-inset-right)) calc(84px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: min(40dvh, 248px);
  }

  body:has(.aurora-setup-compact[open]) #content-area::after {
    content: "";
    display: block;
    height: calc(var(--aurora-compact-height, 0px) + 84px + env(safe-area-inset-bottom));
    pointer-events: none;
  }
}

/* Short landscape: dock the compact card to the right so fields keep full height. */
@media (max-height: 500px) and (orientation: landscape) {
  .aurora-setup-dialog.aurora-setup-compact[open] {
    inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) calc(84px + env(safe-area-inset-bottom)) auto;
    width: min(320px, 40vw);
    max-height: calc(100dvh - 24px - 84px - env(safe-area-inset-bottom, 0px));
  }

  body:has(.aurora-setup-compact[open]) #content-area,
  body:has(.aurora-setup-compact[open]) .content-area,
  body:has(.aurora-setup-compact[open]) main {
    padding-right: min(336px, calc(40vw + 16px)) !important;
    box-sizing: border-box;
  }

  body:has(.aurora-setup-compact[open]) #content-area::after {
    height: 0;
  }
}

body:has(.aurora-setup-compact[open]) .toast-container {
  top: max(12px, env(safe-area-inset-top));
  bottom: auto;
}
@media (max-height: 500px) and (orientation: landscape) {
  body:has(.aurora-setup-compact[open]) .toast-container {
    right: auto;
    left: max(12px, env(safe-area-inset-left));
    max-width: min(360px, calc(100vw - min(336px, 40vw) - 32px));
  }
}

/* First-visit overview: the native modal keeps the background read-only. */
.aurora-overview {
  position: fixed; inset: 0; z-index: 5500; width: 100%; height: 100%;
  max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden;
  border: 0; color: var(--ink); background: rgba(6, 20, 31, .46);
}
.aurora-overview[open] { display: block; }
.aurora-overview::backdrop, .aurora-overview.has-spot { background: transparent; }
.aurora-overview [hidden] { display: none !important; }
.aurora-overview__spot {
  position: absolute; border-radius: 13px; pointer-events: none;
  box-shadow: 0 0 0 150vmax rgba(6, 20, 31, .50), 0 0 0 2px #39d5ec, 0 0 26px rgba(34, 211, 238, .65);
  transition: left .42s ease, top .42s ease, width .32s ease, height .32s ease;
}
.aurora-overview__orb {
  position: absolute; z-index: 2; width: 60px; height: 60px; pointer-events: none;
  transition: left .65s cubic-bezier(.22,1,.36,1), top .65s cubic-bezier(.22,1,.36,1);
}
.aurora-overview__card {
  box-sizing: border-box;
  position: absolute; width: min(426px, calc(100vw - 24px));
  max-height: calc(100dvh - 52px); overflow-y: auto; overscroll-behavior: contain;
  padding: 25px 22px 18px; border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--surface-0); box-shadow: 0 24px 60px rgba(6, 20, 31, .30);
}
.aurora-overview__close {
  position: absolute; top: 3px; right: 4px; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-secondary);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.aurora-overview__close:hover { background: var(--surface-2); }
.aurora-overview__kicker {
  margin: 0 34px 6px 0; color: var(--accent); font-weight: 800;
  text-transform: uppercase; letter-spacing: .075em; font-size: 11px;
}
.aurora-overview__card h2 {
  margin: 0 0 8px; font-size: clamp(19px, 3.6vw, 24px);
  line-height: 1.2; letter-spacing: -.02em;
}
.aurora-overview__body {
  margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-secondary);
}
.aurora-overview__hint {
  margin: 10px 0 0; color: var(--ink); font-weight: 650; font-size: 12px;
}
.aurora-overview__progress {
  height: 4px; margin: 15px 0 10px; border-radius: 9px; overflow: hidden; background: var(--surface-3);
}
.aurora-overview__progress i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #818cf8); transition: width .25s ease;
}
.aurora-overview__actions {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px;
}
.aurora-overview__actions--end { margin-top: 5px; justify-content: flex-start; }
.aurora-overview__actions .btn { min-height: 44px; font-size: 13px; padding-inline: 10px; }
.aurora-overview button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) {
  .aurora-overview__card { padding: 22px 15px 14px; border-radius: 18px; }
}
@media (max-height: 450px) {
  .aurora-overview__card { padding-block: 16px 12px; }
  .aurora-overview__body { font-size: 13px; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora-overview__orb, .aurora-overview__spot, .aurora-overview__progress i { transition: none; }
}


/* Read-only tour and practical editing are intentionally separate layers. */
.aurora-overview .talenta-feedback [data-feedback-tab] { display:none; }
.aurora-overview__report { margin-top: 4px; min-height:44px; padding:6px 0; font-size:13px; }
.aurora-overview__menu-preview {
  margin-top: 10px; padding: 8px 10px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px;
}
.aurora-overview__menu-preview ul { margin: 4px 0 0; padding: 0; list-style: none; display:flex; gap:4px; flex-wrap:wrap; }
.aurora-overview__menu-preview li { padding:2px 7px; border-radius:7px; }
.aurora-overview__menu-preview li[aria-current] { color:var(--accent); background:var(--surface-0); font-weight:750; }
.aurora-setup-field-help[hidden], [data-setup-summary][hidden], .aurora-setup-connector[hidden] { display:none!important; }
.aurora-setup-field-help { margin-top:8px; border-top:1px solid var(--border); padding-top:8px; color:var(--ink); }
.aurora-setup-field-help strong { font-size:13px; color:var(--accent); }
.aurora-setup-field-help p { margin:4px 0 0; font-size:12px; line-height:1.4; }
.aurora-setup-field-controls { display:flex; align-items:center; justify-content:flex-start; gap:8px; margin-top:3px; font-size:12px; }
.aurora-setup-field-controls button {
  min-width:44px; min-height:44px; border:1px solid var(--border); border-radius:9px;
  background:var(--surface-0); color:var(--ink); cursor:pointer; font-size:18px;
}
.aurora-setup-field-controls button:disabled { opacity:.5; cursor:default; }
.aurora-setup-connector { position:fixed; inset:0; z-index:120; pointer-events:none; }
.aurora-setup-connector svg { width:100%; height:100%; overflow:visible; }
.aurora-setup-connector path { fill:none; stroke:#0a829b; stroke-width:2; stroke-dasharray:4 5; stroke-linecap:round; }
.aurora-setup-connector circle { fill:#e5fcff; stroke:#0a829b; stroke-width:2; }
.aurora-setup-pointer {
  position:absolute; left:var(--aurora-pointer-x); top:var(--aurora-pointer-y);
  width:25px; height:25px; transform:translate(-50%,-50%); border-radius:50%;
  background:#e5fcff; box-shadow:0 0 0 3px #31c9e543,0 0 14px #31c9e568;
  transition:left .24s ease,top .24s ease;
}
.aurora-setup-pointer img { display:block; width:100%; height:100%; object-fit:contain; }
.aurora-setup-compact [data-setup-hint] { display:none; }
.aurora-setup-dialog.aurora-setup-compact .aurora-setup-head h2 { font-size:16px; }
.aurora-setup-dialog.aurora-setup-compact .aurora-setup-status { margin-block:5px; }
@media (min-width: 1101px) and (min-height: 531px) {
  body:has(.aurora-setup-compact[open]) #content-area { box-sizing:border-box; padding-inline-end: min(354px, 31vw) !important; }
  .aurora-setup-dialog.aurora-setup-compact[open] { inset: 120px 20px auto auto; width:min(312px,28vw); max-height:min(54dvh,375px); }
  .aurora-setup-dialog.aurora-setup-compact .aurora-setup-shell { padding:14px; }
}
@media (min-width: 901px) and (max-width:1100px) and (min-height:531px) {
  .aurora-setup-dialog.aurora-setup-compact[open] { inset:auto 16px 18px auto; max-height:min(44dvh,315px); }
}
@media (max-width:900px) {
  .aurora-setup-field-controls button { min-height:44px; }
}
@media (prefers-reduced-motion:reduce) { .aurora-setup-pointer { transition:none; } }

/* V12.10 — Aurora usa las superficies de Talenta y mantiene las acciones a la vista. */
.aurora-overview__card {
  width:min(458px, calc(100vw - var(--tour-side-reserve, 12px) - 12px));
  border-inline-start:3px solid var(--accent);
  background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 8%,var(--surface-0)),var(--surface-0) 64%);
}
.aurora-overview__body strong { color:var(--ink); font-weight:750; }
.aurora-overview__invite {
  margin:12px 0 0; padding:10px 12px; border-inline-start:3px solid var(--accent);
  border-radius:9px; background:color-mix(in srgb,var(--accent) 9%,var(--surface-0)); font-size:14px;
}
.aurora-overview__invite span { display:block; color:var(--ink-secondary); font-size:13px; margin-top:3px; }
.aurora-overview__pruebas { position:absolute; left:0; z-index:4; min-width:36px; }
.aurora-overview .talenta-feedback { z-index:6; }
.aurora-overview:has([data-feedback-panel]:not([hidden])) .aurora-overview__pruebas { z-index:7; }
.aurora-overview__actions--end [data-overview-configure] { box-shadow:0 3px 12px color-mix(in srgb,var(--accent) 34%,transparent); }
.aurora-overview__actions--end [data-overview-configure] span { margin-inline-start:6px; }
.aurora-setup-dialog [hidden] { display:none!important; }
.aurora-setup-dialog.aurora-setup-compact .aurora-setup-step {
  border:0; background:none; padding:2px 0; scrollbar-width:thin;
}
.aurora-setup-dialog.aurora-setup-compact .aurora-setup-shell { gap:7px; }
.aurora-setup-compact [data-setup-status][data-state="verified"] { display:none; }
.aurora-setup-compact:has([data-setup-field-help]:not([hidden])) [data-setup-status][data-state="pending"] { display:none; }
.aurora-setup-compact [data-setup-status][data-state="blocked"] {
  background:color-mix(in srgb,#d4973b 12%,var(--surface-0)); border-inline-start-color:#b47925;
  color:var(--ink); padding:7px 9px; font-size:13px; font-weight:650;
}
.aurora-setup-field-help strong { font-size:14px; }
.aurora-setup-field-help p { font-size:13px; margin:4px 0 6px; }
.aurora-setup-field-controls button {
  color:var(--accent); background:color-mix(in srgb,var(--accent) 10%,var(--surface-0));
  border-color:color-mix(in srgb,var(--accent) 33%,var(--border)); font-weight:800; line-height:1;
}
.aurora-setup-field-controls button:disabled { opacity:.4; }
.aurora-setup-field-controls button:hover:not(:disabled) { background:color-mix(in srgb,var(--accent) 20%,var(--surface-0)); }
.aurora-setup-pointer { width:38px; height:38px; background:radial-gradient(circle at 34% 26%,#e4fcff,#72d1e9 52%,#137998); }
.aurora-setup-pointer img { border-radius:50%; }
.aurora-setup-connector { z-index:141; }
.aurora-setup-connector path { stroke-dasharray:3 5; stroke-width:1.6; }
.aurora-setup-compact .aurora-setup-actions { padding-top:4px; }
@media (min-width:1101px) and (min-height:531px) {
  body:has(.aurora-setup-compact[open]) #content-area { padding-inline-end:min(440px,35vw)!important; }
  .aurora-setup-dialog.aurora-setup-compact[open] { inset:120px 28px auto auto; width:min(386px,31vw); max-height:calc(100dvh - 100px); }
  .aurora-setup-dialog.aurora-setup-compact .aurora-setup-shell { padding:17px; }
}
@media (max-width:1100px) and (min-height:531px) {
  .aurora-setup-dialog.aurora-setup-compact[open] { max-height:min(57dvh,400px); }
}
@media (max-width:600px) {
  .aurora-setup-compact .aurora-setup-actions:has([data-setup-later][hidden]) { grid-template-columns:minmax(0,1fr); }
  .aurora-setup-field-help p { margin-block:3px; }
}
.aurora-setup-dialog:not([open]) { display:none!important; }

/* The preview provider's feedback bubble must not overlap Talenta's own assistant. */
body:has(.aurora-setup-compact[open]) > vercel-live-feedback,
body:has(.aurora-setup-compact[open]) #aurora-guide-fab { visibility:hidden; pointer-events:none; }
.aurora-setup-pointer-face {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center; gap:4px;
}
.aurora-setup-pointer-face i {
  width:4px; height:6px; border-radius:50%; background:#183757;
  background:radial-gradient(circle at 30% 25%,#cbefff 12%,#2a4c70 29%,#183757 64%);
}
.aurora-setup-compact [data-setup-status][data-state="dirty"] {
  font-size:12px; padding:5px 8px; margin-block:6px;
  border-inline-start:3px solid var(--accent); background:var(--surface-1);
}
@media (max-width:900px) and (orientation:portrait){
  .aurora-setup-dialog.aurora-setup-compact[open]{
    bottom:var(--aurora-soft-bottom,calc(84px + env(safe-area-inset-bottom)));
    max-height:min(57dvh,calc(var(--aurora-visible-vp,100dvh)*.61),400px);
  }
}
