/* 0302 · Autonomía del asistente: la rueda, el cerebro de IA, los avisos y las cifras. */
.au { width: 100%; max-width: 1180px; min-width: 0; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding-bottom: 40px; }
.au-cab { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.au-cab h1 { margin: 2px 0 6px; font-family: var(--font-marca); font-weight: 500; font-size: clamp(30px, 4vw, 40px); line-height: 1.05; letter-spacing: -.01em; color: var(--text-dark); }
.au-cab p { margin: 0; font-size: 15px; color: var(--text-muted); }
.au-antetitulo { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.au-ultimo { padding: 8px 14px; border-radius: 999px; background: var(--vidrio); border: 1px solid var(--vidrio-borde); font-size: 13px; color: var(--text-muted); }

/* ---------------------------------------------------------------- tarjeta principal */
.au-hero { position: relative; overflow: hidden; padding: 28px; border-radius: 30px; background: var(--vidrio);
  border: 1px solid var(--vidrio-borde); backdrop-filter: var(--desenfoque); -webkit-backdrop-filter: var(--desenfoque);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 30px 70px -40px var(--au-sombra, rgba(0, 7, 219, .4)); transition: box-shadow .6s, border-color .6s; }
.au-hero.au-max { border-color: rgba(224, 83, 60, .55); }
.au-aura { position: absolute; left: -120px; top: -160px; width: var(--au-tam, 620px); height: var(--au-tam, 620px); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, var(--au-aura, rgba(0, 7, 219, .2)), var(--au-aura-0, transparent));
  animation: au-respira 5s ease-in-out infinite; transform-origin: 30% 35%; transition: width .6s, height .6s; }
.au-hero-fila { position: relative; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: center; }
.au-izq { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.au-der { position: relative; flex: 1 1 420px; max-width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

/* ---------------------------------------------------------------- la rueda */
.au-rueda { position: relative; width: min(400px, 82vw); aspect-ratio: 1; color: rgba(19, 38, 90, .28); }
.au-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.au-pista { fill: none; stroke: rgba(19, 38, 90, .1); stroke-width: 22; stroke-linecap: round; }
.au-pomo { position: absolute; left: 22.5%; top: 22.5%; width: 55%; height: 55%; border-radius: 50%; overflow: hidden; background: #12184a;
  animation: au-pomo 4s ease-in-out infinite; }
.au-pomo canvas { width: 100%; height: 100%; display: block; }
.au-latido { position: absolute; left: 17.5%; top: 17.5%; width: 65%; height: 65%; border-radius: 50%; border: 3px solid #e0533c; animation: au-latido 1.8s ease-out infinite; pointer-events: none; }
.au-centro { position: absolute; left: 0; right: 0; top: 79%; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.au-centro span { font-family: var(--font-marca); font-weight: 500; font-size: clamp(32px, 9vw, 44px); line-height: 1; letter-spacing: -.02em; transition: color .5s; }
.au-centro span.au-pct-texto { font-size: clamp(24px, 6vw, 30px); }
.au-centro small { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.au-nivel { position: absolute; transform: translate(-50%, -50%); width: 76px; height: 34px; border-radius: 999px; cursor: pointer; font: 700 13px var(--font-ui);
  background: rgba(255, 255, 255, .8); color: var(--text-dark); border: 1px solid rgba(19, 38, 90, .12); transition: all .3s ease; }
.au-nivel:hover { transform: translate(-50%, calc(-50% - 1px)); }
.au-nivel.activa { background: var(--au-c); color: #fff; border: 0; box-shadow: 0 8px 20px -8px var(--au-c); }
.au-nivel:focus-visible { outline: none; box-shadow: var(--focus); }
.au-botones { display: flex; gap: 10px; }
.au-botones button { min-width: 120px; height: 46px; border-radius: 999px; font: 600 15px var(--font-ui); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.au-menos { border: 1px solid rgba(19, 38, 90, .14); background: rgba(255, 255, 255, .75); color: var(--text-dark); }
.au-mas { border: 0; background: var(--marca); color: #fff; box-shadow: 0 10px 24px -12px var(--marca); }
.au-botones button:disabled { opacity: .45; cursor: default; }
.au-corre { animation: au-corre 3s cubic-bezier(.45, 0, .2, 1) infinite; filter: blur(1.5px); }
.au-chispa { animation: au-chispa 1.6s ease-in-out infinite; }
.au-parpadeo { animation: au-parpadeo 2s steps(1, end) infinite; }

/* ---------------------------------------------------------------- lo que hace el nivel */
.au-titulo { display: flex; flex-direction: column; gap: 6px; }
.au-titulo h2 { margin: 0; font-family: var(--font-marca); font-weight: 500; font-size: 34px; line-height: 1.1; color: var(--text-dark); }
.au-titulo p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--text-muted); }
.au-tag { align-self: flex-start; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--au-c); background: color-mix(in srgb, var(--au-c) 13%, transparent); }
.au-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.au-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .55); color: var(--text-muted); border: 1px dashed rgba(19, 38, 90, .2); transition: all .45s cubic-bezier(.2, .8, .2, 1); }
.au-chip.on { background: color-mix(in srgb, var(--marca) 10%, transparent); color: var(--marca); border: 1px solid color-mix(in srgb, var(--marca) 22%, transparent); }
.au-chip.on.max { background: rgba(224, 83, 60, .14); color: #a8321f; border-color: rgba(224, 83, 60, .35); }
.au-pases { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 18px; background: var(--vidrio-fuerte); border: 1px solid var(--vidrio-borde); }
.au-pases-cab, .au-pases-pie { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.au-pases-cab { font-size: 14px; color: var(--text-muted); align-items: baseline; }
.au-pases-cab > span:first-child { font-weight: 600; }
.au-pases-cab strong { font-size: 22px; transition: color .5s; }
.au-pases-pie { font-size: 13px; color: var(--text-muted); }
.au-barra { position: relative; height: 14px; border-radius: 999px; background: rgba(19, 38, 90, .08); overflow: hidden; }
.au-barra > div { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.au-barra > i { position: absolute; top: 0; bottom: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: au-brillo 2.6s ease-in-out infinite; }
.au-nota { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.au-nota svg { flex: none; }
.au-nota-fase { background: color-mix(in srgb, var(--marca) 8%, transparent); color: var(--text-dark); }
.au-nota-max { background: #fdecea; color: #8a1c12; }
.au-fijos { position: relative; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--divider); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.au-fijos > span:first-child { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #8a1c12; margin-right: 6px; }
.au-fijo { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(238, 127, 106, .14); color: #8a2b18; font-size: 13px; font-weight: 600; }

/* ---------------------------------------------------------------- cifras */
.au-metricas { display: flex; flex-direction: column; gap: 14px; }
.au-sec-cab { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.au-sec-cab h2 { margin: 0; font-family: var(--font-marca); font-weight: 500; font-size: 28px; color: var(--text-dark); }
.au-sec-cab span { font-size: 14px; color: var(--text-muted); }
.au-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.au-kpi, .au-caja { padding: 18px 20px; border-radius: 20px; background: var(--vidrio-fuerte); border: 1px solid var(--vidrio-borde); box-shadow: 0 20px 40px -32px rgba(12, 30, 90, .5); }
.au-kpi { display: flex; flex-direction: column; gap: 6px; }
.au-kpi span { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.au-kpi strong { font-size: 34px; font-weight: 700; letter-spacing: -.02em; color: var(--text-dark); }
.au-kpi strong em { font-style: normal; font-size: 18px; font-weight: 600; color: var(--text-muted); }
.au-kpi strong.azul, .au-kpi strong.azul em { color: var(--marca); }
.au-kpi strong.coral { color: #b4452f; }
.au-kpi small { font-size: 13px; color: var(--text-muted); }
.au-graficas { display: flex; flex-wrap: wrap; gap: 14px; }
.au-caja { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.au-dias { flex: 3 1 520px; max-width: 100%; }
.au-motivos { flex: 2 1 340px; max-width: 100%; }
.au-caja-cab { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 15px; color: var(--text-dark); }
.au-motivos > strong { font-size: 15px; color: var(--text-dark); }
.au-leyenda { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-muted); }
.au-leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.au-leyenda i.solo, .au-col i.solo { background: var(--marca); }
.au-leyenda i.equipo, .au-col i.equipo { background: color-mix(in srgb, var(--marca) 22%, #fff); }
.au-dias-scroll { min-width: 0; }
.au-barras { min-width: 0; height: 190px; display: grid; gap: 8px; align-items: end; }
.au-dia { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.au-col { width: 100%; max-width: 30px; height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
.au-col i { display: block; }
.au-col i:first-child { border-radius: 6px 6px 0 0; }
.au-col i:last-child { border-radius: 0 0 6px 6px; }
.au-col i.equipo[style*="height:0px"] + i.solo { border-radius: 6px; }
.au-dia span { font-size: 11px; color: var(--text-muted); }
.au-motivo { display: flex; flex-direction: column; gap: 5px; }
.au-motivo > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-dark); font-weight: 600; }
.au-motivo b { font-size: 12px; white-space: nowrap; color: var(--text-muted); }
.au-motivo b.equipo { color: #8a2b18; }
.au-motivo > i { display: block; height: 8px; border-radius: 999px; background: rgba(19, 38, 90, .07); overflow: hidden; }
.au-motivo > i u { display: block; height: 100%; border-radius: 999px; background: rgba(19, 38, 90, .22); transition: width .5s, background .5s; }
.au-motivo > i u.equipo { background: rgba(238, 127, 106, .55); }

/* ---------------------------------------------------------------- guardián */
.au-guardian { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 22px 24px; border-radius: 24px; background: var(--vidrio-fuerte); border: 1px solid var(--vidrio-borde); }
.au-g-ico { flex: none; width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--marca) 10%, transparent); color: var(--marca); }
.au-g-txt { flex: 1 1 360px; max-width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.au-g-txt strong { font-size: 17px; color: var(--text-dark); }
.au-g-txt strong em { font-style: normal; margin-left: 8px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(19, 38, 90, .07); color: var(--text-muted); vertical-align: 2px; }
.au-g-txt span { font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.au-g-modo { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; max-width: 320px; }
.au-g-modo small { font-size: 13px; color: var(--text-muted); }
.au-g-tag { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.au-g-tag.n0 { background: color-mix(in srgb, var(--marca) 10%, transparent); color: var(--marca); }
.au-g-tag.n2 { background: #fef3dc; color: #7a4706; }
.au-g-tag.n4 { background: #fdecea; color: #8a1c12; }

/* ---------------------------------------------------------------- avisos al girar la rueda */
.au-capa { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(900px 500px at 50% 0%, rgba(40, 48, 90, .5), rgba(20, 26, 52, .66)); animation: au-entra .2s ease-out; }
.au-dialogo { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: 28px;
  background: var(--card-bg); color: var(--text-dark); backdrop-filter: blur(24px); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6); animation: au-sube .3s cubic-bezier(.2, .8, .2, 1); }
.au-dialogo p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.au-dialogo small { font-size: 12px; color: var(--text-muted); }
.au-d-cab { display: flex; gap: 12px; align-items: center; }
.au-d-cab h2 { margin: 0; font-family: var(--font-marca); font-weight: 500; font-size: 24px; line-height: 1.15; }
.au-d-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.au-d-ante { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.au-d-riesgo { padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.au-d-check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.au-d-check input { width: 20px; height: 20px; accent-color: var(--marca); }
.au-d-conf-l { font-size: 13px; font-weight: 700; }
.au-d-conf { height: 44px; box-sizing: border-box; padding: 0 14px; border-radius: 12px; border: 2px solid #e0533c; font: 700 15px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dark); background: var(--card-bg); }
.au-d-pie { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.au-d-si { border: 0; color: #fff; background: var(--marca); }
.au-d-si:disabled { opacity: .45; cursor: default; }
.au-dialogo.suave { border: 1px solid var(--vidrio-borde); }
.au-dialogo.suave .au-d-ico { background: color-mix(in srgb, var(--marca) 10%, transparent); color: var(--marca); }
.au-dialogo.suave .au-d-ante { color: var(--marca); }
.au-dialogo.ambar { border: 1px solid #f2d49a; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6), 0 0 0 6px rgba(254, 243, 220, .35); }
.au-dialogo.ambar .au-d-ico, .au-dialogo.ambar .au-d-riesgo { background: #fef3dc; color: #7a4706; }
.au-dialogo.ambar .au-d-ante { color: #9a5b08; }
.au-dialogo.rojo { border: 2px solid #e0533c; box-shadow: 0 40px 80px -36px rgba(180, 35, 24, .75), 0 0 0 8px rgba(224, 83, 60, .18); }
.au-dialogo.rojo .au-d-ico { background: #b42318; color: #fff; }
.au-dialogo.rojo .au-d-ante { color: #b42318; }
.au-dialogo.rojo .au-d-riesgo { background: #fdecea; color: #7a1a10; }
.au-dialogo.rojo .au-d-si { background: #b42318; }
.au-dialogo.coral { border: 1px solid #f2b8a8; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6), 0 0 0 6px rgba(238, 127, 106, .2); }
.au-dialogo.coral .au-d-ico { background: rgba(238, 127, 106, .18); color: #b4452f; }
.au-dialogo.coral .au-d-ante { color: #b4452f; }
.au-dialogo.coral .au-d-riesgo { background: rgba(238, 127, 106, .14); color: #7a2a18; }
.au-dialogo.coral .au-d-si { background: #b4452f; }

/* ---------------------------------------------------------------- tema oscuro */
html[data-theme="dark"] .au-rueda { color: rgba(255, 255, 255, .28); }
html[data-theme="dark"] .au-pista { stroke: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .au-nivel:not(.activa), html[data-theme="dark"] .au-menos { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: var(--text-dark); }
html[data-theme="dark"] .au-chip:not(.on) { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .16); }
html[data-theme="dark"] .au-chip.on { color: color-mix(in srgb, var(--marca) 45%, #fff); }
html[data-theme="dark"] .au-barra, html[data-theme="dark"] .au-motivo > i { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .au-hero { box-shadow: 0 30px 70px -40px var(--au-sombra, rgba(0, 7, 219, .4)); }
html[data-theme="dark"] .au-kpi strong.azul, html[data-theme="dark"] .au-kpi strong.azul em,
html[data-theme="dark"] .au-g-ico, html[data-theme="dark"] .au-g-tag.n0 { color: color-mix(in srgb, var(--marca) 45%, #fff); }
html[data-theme="dark"] .au-nota-max, html[data-theme="dark"] .au-fijo { color: #ffb4a6; }
html[data-theme="dark"] .au-fijos > span:first-child { color: #ff9c8a; }

/* ---------------------------------------------------------------- móvil */
@media (max-width: 640px) {
  .au-hero { padding: 18px; border-radius: 24px; }
  .au-titulo h2 { font-size: 28px; }
  .au-nivel { width: 64px; height: 30px; font-size: 12px; }
  .au-botones button { min-width: 108px; }
}

/* ---------------------------------------------------------------- animaciones */
@keyframes au-respira { 0%, 100% { opacity: .55; transform: scale(.93); } 45% { opacity: 1; transform: scale(1.07); } 60% { opacity: .8; transform: scale(1.02); } }
@keyframes au-corre { from { stroke-dashoffset: 118; } to { stroke-dashoffset: 0; } }
@keyframes au-pomo { 0%, 100% { filter: drop-shadow(0 10px 16px var(--c0, transparent)); } 50% { filter: drop-shadow(0 14px 34px var(--c1, transparent)); } }
@keyframes au-parpadeo { 0%, 100% { opacity: 1; } 42% { opacity: 1; } 50% { opacity: .25; } 58% { opacity: 1; } }
@keyframes au-chispa { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes au-latido { 0% { transform: scale(.92); opacity: .55; } 70% { transform: scale(1.12); opacity: 0; } 100% { opacity: 0; } }
@keyframes au-brillo { 0% { transform: translateX(-120%); } 100% { transform: translateX(340%); } }
@keyframes au-entra { from { opacity: 0; } to { opacity: 1; } }
@keyframes au-sube { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .au-aura, .au-pomo, .au-corre, .au-chispa, .au-parpadeo, .au-latido, .au-barra > i, .au-capa, .au-dialogo { animation: none; }
  .au-chip, .au-barra > div, .au-motivo > i u { transition: none; }
}

/* 0305 · El guardián ya funciona. */
.au-g-txt strong em.activo { background: color-mix(in oklab, #2e9d6a 16%, transparent); color: #1f7a4f; }
html[data-theme="dark"] .au-g-txt strong em.activo { color: #8fd6b0; }
