/* Aitana Estimator — sistema visual 3D (inspirado en 21st.dev: Tactile 3D Button, Thinking Prompt Input, glass cards) */
:root {
  --navy: #1b2147; --navy-2: #2b3470; --navy-3: #3a4590; --accent: #a14f9a; --violet: #6d5bd0; --accent-soft: #f6eaf5;
  --bg: #f3f4fa; --card: rgba(255,255,255,.82); --text: #1d2133; --muted: #686d82; --line: #e2e4ef;
  --ok: #0a7a3d; --ok-soft: #e4f5eb; --warn: #9a5a00; --warn-soft: #fff3dc; --bad: #b00020; --bad-soft: #fde8eb;
  --hd: #f96302; --lowes: #004990; --radius: 18px; --ease: cubic-bezier(.22,1,.36,1);
  --bevel-light: 0 1px 1px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.1), 0 6px 12px rgba(0,0,0,.08), inset 0 1px 2px rgba(255,255,255,.9), inset 0 -2px 4px rgba(0,0,0,.08);
  --pressed-light: 0 1px 1px rgba(0,0,0,.05), inset 0 1px 2px rgba(0,0,0,.1), inset 0 2px 4px rgba(0,0,0,.05), inset 0 -1px 2px rgba(0,0,0,.05);
  --bevel-dark: 0 1px 1px rgba(0,0,0,.35), 0 3px 6px rgba(0,0,0,.28), 0 8px 16px rgba(0,0,0,.22), inset 0 1px 2px rgba(255,255,255,.22), inset 0 -3px 6px rgba(0,0,0,.45);
  --pressed-dark: 0 1px 2px rgba(0,0,0,.25), inset 0 2px 6px rgba(0,0,0,.55), inset 0 -1px 1px rgba(255,255,255,.06);
  --glass-shadow: 0 1px 0 rgba(255,255,255,.95) inset, 0 18px 40px -18px rgba(27,33,71,.35), 0 3px 8px rgba(27,33,71,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; color: var(--text); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background:
  radial-gradient(1100px 560px at 0% -10%, #e6e3ff 0%, transparent 60%),
  radial-gradient(900px 520px at 110% 0%, #fae3f5 0%, transparent 55%),
  radial-gradient(800px 600px at 50% 120%, #e2f0ff 0%, transparent 60%), var(--bg); background-attachment: fixed; }
/* estilo dots: rejilla de puntos de fondo + puntos que se encienden cerca del puntero (capa #luz) */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image: radial-gradient(circle, rgba(27,33,71,.17) 1.1px, transparent 1.7px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 0%, #000 15%, transparent 85%); mask-image: radial-gradient(ellipse 90% 75% at 50% 0%, #000 15%, transparent 85%); }
.luz { position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image: radial-gradient(circle, rgba(109,91,208,.75) 1.4px, transparent 2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(220px circle at var(--mx, -500px) var(--my, -500px), #000 0%, transparent 70%);
  mask-image: radial-gradient(220px circle at var(--mx, -500px) var(--my, -500px), #000 0%, transparent 70%); }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; }
.view { max-width: 1180px; margin: 0 auto; padding: 22px 16px 120px; }
.center { text-align: center; padding: 40px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1, h2, h3 { color: var(--navy); margin: 0 0 8px; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: 28px; font-weight: 800; } h2 { font-size: 20px; font-weight: 750; } h3 { font-size: 16.5px; font-weight: 700; }

/* barra superior de vidrio */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; background: rgba(255,255,255,.72); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(27,33,71,.08); box-shadow: 0 6px 24px -18px rgba(27,33,71,.5); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); font-weight: 800; letter-spacing: -.01em; }
.brand img { height: 34px; filter: drop-shadow(0 2px 3px rgba(27,33,71,.15)); }
.brand span { border-left: 2px solid var(--accent); padding-left: 12px; background: linear-gradient(90deg, var(--navy), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topnav { display: flex; align-items: center; gap: 14px; }
.topnav a { text-decoration: none; font-weight: 650; color: var(--navy-2); }
.who { color: var(--muted); font-size: 13px; }
.lang { border: 0; background: #fff; border-radius: 999px; padding: 4px 11px; cursor: pointer; font-weight: 800; color: var(--navy); box-shadow: var(--bevel-light); }
.lang:active { box-shadow: var(--pressed-light); transform: translateY(1px); }
.link { background: none; border: 0; color: var(--navy-2); cursor: pointer; font-weight: 650; padding: 0; }
.banner { background: linear-gradient(90deg, #fff6e3, #fff0d0); color: var(--warn); border-bottom: 1px solid #f1d9ad; padding: 8px 16px; text-align: center; font-size: 13.5px; }

/* tarjetas de vidrio */
.card { background: var(--card); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,.75); border-radius: var(--radius); box-shadow: var(--glass-shadow); padding: 20px; margin-bottom: 18px;
  animation: subir .5s var(--ease) both; }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }

/* botones 3D tipo tecla (Tactile 3D Button) */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; user-select: none;
  background: linear-gradient(180deg, #ffffff, #f2f3f9); color: var(--navy); border-radius: 12px; padding: 10px 16px; font-weight: 700;
  text-decoration: none; box-shadow: var(--bevel-light); transition: box-shadow .2s var(--ease), transform .12s var(--ease), filter .2s; }
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:active { box-shadow: var(--pressed-light); transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(109,91,208,.45); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, var(--navy-3), var(--navy)); color: #fff; box-shadow: var(--bevel-dark); }
.btn.primary:active, .btn.accent:active, .btn.ok:active { box-shadow: var(--pressed-dark); }
.btn.accent { background: linear-gradient(135deg, #b75fae 0%, var(--accent) 45%, var(--violet) 100%); color: #fff; box-shadow: var(--bevel-dark); }
.btn.ok { background: linear-gradient(180deg, #13a057, var(--ok)); color: #fff; box-shadow: var(--bevel-dark); }
.btn.danger { color: var(--bad); }
.btn.big { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn.mini { font-size: 12.5px; padding: 6px 11px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.3); }
.btn svg { width: 18px; height: 18px; }

/* formularios */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 650; font-size: 13.5px; color: var(--navy); }
label.f .help { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  border: 1px solid #d6d9e8; border-radius: 12px; padding: 11px 12px; background: rgba(255,255,255,.9); color: var(--text); width: 100%;
  box-shadow: inset 0 1px 2px rgba(27,33,71,.06); transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(109,91,208,.15), inset 0 1px 2px rgba(27,33,71,.06); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--navy); font-size: 13.5px; padding-top: 22px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--violet); }
.zipinfo { margin-top: 4px; font-size: 12.5px; color: var(--ok); font-weight: 600; }
.zipinfo.bad { color: var(--bad); }
details.adv summary { cursor: pointer; color: var(--navy-2); font-weight: 650; margin: 10px 0; }

/* login */
.login { max-width: 420px; margin: 9vh auto; padding: 30px; }
.login img { width: 240px; display: block; margin: 0 auto 16px; filter: drop-shadow(0 6px 10px rgba(27,33,71,.18)); }
.login .btn { width: 100%; }
.err { color: var(--bad); font-size: 13.5px; min-height: 18px; }

/* asistente de pasos y tipos de trabajo (con inclinación 3D) */
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.7); color: var(--muted); font-size: 13px; font-weight: 700; box-shadow: var(--bevel-light); }
.steps span.on { background: linear-gradient(180deg, var(--navy-3), var(--navy)); color: #fff; box-shadow: var(--bevel-dark); }
.tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; perspective: 900px; }
.tipo { --rx: 0deg; --ry: 0deg; position: relative; border: 1px solid rgba(255,255,255,.8); border-radius: 18px; background: linear-gradient(160deg, #ffffff, #f2f1fb);
  padding: 20px 12px 16px; cursor: pointer; text-align: center; font-weight: 700; color: var(--navy); display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: 0 1px 0 #fff inset, 0 14px 28px -16px rgba(27,33,71,.45), 0 2px 6px rgba(27,33,71,.06);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .15s ease-out, box-shadow .25s; }
.tipo:hover { box-shadow: 0 1px 0 #fff inset, 0 24px 40px -18px rgba(109,91,208,.55), 0 4px 12px rgba(27,33,71,.08); }
.tipo .orb { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; color: #fff; transform: translateZ(30px);
  background: linear-gradient(135deg, var(--navy-3), var(--violet) 60%, var(--accent)); box-shadow: inset 0 2px 3px rgba(255,255,255,.35), inset 0 -4px 8px rgba(0,0,0,.25), 0 10px 18px -8px rgba(109,91,208,.7); }
.tipo .orb svg { width: 30px; height: 30px; }
.tipo span { transform: translateZ(18px); }
.tipo.on { outline: 3px solid var(--violet); }

/* lista de estimados */
.lista { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.lista th { text-align: left; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 6px 10px; }
.lista td { padding: 12px 10px; background: rgba(255,255,255,.75); }
.lista td:first-child { border-radius: 12px 0 0 12px; } .lista td:last-child { border-radius: 0 12px 12px 0; }
.lista tr.click { cursor: pointer; transition: transform .15s var(--ease); }
.lista tr.click:hover { transform: translateY(-2px); }
.lista tr.click:hover td { background: #fff; box-shadow: 0 10px 18px -14px rgba(27,33,71,.6); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.chip.draft { background: var(--warn-soft); color: var(--warn); }
.chip.approved { background: var(--ok-soft); color: var(--ok); }
.chip.sent { background: #e6efff; color: #1d4ed8; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.r { text-align: right; }

/* estimado */
.cab { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 6px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 16px 0; perspective: 900px; }
.kpi { --rx: 0deg; --ry: 0deg; background: var(--card); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.75); border-radius: 16px; padding: 13px 15px;
  box-shadow: var(--glass-shadow); transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .15s ease-out; }
.kpi .lbl { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.kpi .v { font-size: 21px; font-weight: 850; color: var(--navy); letter-spacing: -.02em; }
.kpi.total { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 55%, var(--violet) 100%); border: 0;
  box-shadow: 0 22px 40px -20px rgba(27,33,71,.8), inset 0 1px 1px rgba(255,255,255,.25); }
.kpi.total::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 70%); }
.kpi.total::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, rgba(255,255,255,.22) 1px, transparent 1.5px);
  background-size: 12px 12px; -webkit-mask-image: linear-gradient(115deg, transparent 35%, #000 95%); mask-image: linear-gradient(115deg, transparent 35%, #000 95%); }
.kpi.total .lbl { color: #cdd1f5; } .kpi.total .v { color: #fff; font-size: 28px; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.ajuste { display: flex; align-items: center; gap: 8px; }
.ajuste input { width: 82px; padding: 7px 9px; }
.avisos { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.aviso { border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 550; box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; }
.aviso.warn { background: var(--warn-soft); color: var(--warn); }
.aviso.bad { background: var(--bad-soft); color: var(--bad); }
.aviso.ok { background: var(--ok-soft); color: var(--ok); }
.seccion h3 { display: flex; align-items: center; gap: 10px; }
.seccion h3 svg { width: 22px; height: 22px; padding: 4px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, var(--navy-3), var(--violet)); box-shadow: inset 0 -2px 4px rgba(0,0,0,.25); }
.seccion .sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
table.lineas { width: 100%; border-collapse: collapse; }
table.lineas th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 6px; border-bottom: 1px solid var(--line); letter-spacing: .4px; }
table.lineas td { padding: 10px 6px; border-bottom: 1px solid #eceef6; vertical-align: top; }
table.lineas tr:hover td { background: rgba(255,255,255,.6); }
table.lineas input[type=number] { width: 90px; padding: 7px 9px; }
.ltext { font-weight: 650; }
.ldesc { color: var(--muted); font-size: 12px; }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 7px; margin-top: 4px; }
.src.hd { background: #fff1e8; color: var(--hd); } .src.lowes { background: #e8f0fa; color: var(--lowes); }
.src.book { background: #eef0f7; color: var(--navy-2); } .src.manual { background: var(--accent-soft); color: var(--accent); }
.src.missing { background: var(--bad-soft); color: var(--bad); } .src.rate { background: #eef0f7; color: var(--navy-2); }
.st { font-size: 11px; color: var(--muted); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.flag { font-size: 11px; background: var(--warn-soft); color: var(--warn); border-radius: 7px; padding: 2px 7px; font-weight: 600; }
.flag.bad { background: var(--bad-soft); color: var(--bad); }
.detalle td { background: rgba(246,246,252,.85); }
.opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 8px 0; }
.opcion { border: 1px solid var(--line); border-radius: 14px; padding: 11px; background: #fff; font-size: 13px; box-shadow: var(--bevel-light); }
.opcion.on { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok) inset, var(--bevel-light); }
.icon-btn { background: #fff; border: 0; cursor: pointer; color: var(--navy-2); padding: 5px 9px; border-radius: 9px; box-shadow: var(--bevel-light); }
.icon-btn:active { box-shadow: var(--pressed-light); transform: translateY(1px); }

/* overlay de trabajo, modal y toast */
.overlay { position: fixed; inset: 0; background: rgba(15,18,40,.5); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 60; }
.overlay-card { background: rgba(255,255,255,.95); border-radius: 22px; padding: 28px 30px; width: min(460px, 92vw); text-align: center; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.spinner { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 14px; background: conic-gradient(from 0deg, var(--violet), var(--accent), var(--navy-3), var(--violet));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0); animation: g 1s linear infinite; }
@keyframes g { to { transform: rotate(360deg); } }
.ov-steps { text-align: left; color: var(--muted); font-size: 14px; padding-left: 20px; }
.ov-steps li { padding: 3px 0; } .ov-steps li.done { color: var(--ok); } .ov-steps li.now { color: var(--navy); font-weight: 800; }
.modal { position: fixed; inset: 0; background: rgba(15,18,40,.45); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 55; padding: 12px; }
.modal-card { background: rgba(255,255,255,.97); border-radius: 20px; padding: 22px; width: min(640px, 96vw); max-height: 90vh; overflow: auto; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); animation: subir .35s var(--ease) both; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 0; background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 700; color: var(--navy); box-shadow: var(--bevel-light); }
.tabs button.on { background: linear-gradient(180deg, var(--navy-3), var(--navy)); color: #fff; box-shadow: var(--bevel-dark); }
.res { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.res div { padding: 9px 11px; border-bottom: 1px solid #f0f1f6; cursor: pointer; font-size: 13px; }
.res div:hover, .res div.on { background: var(--accent-soft); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--navy), var(--navy-3)); color: #fff; padding: 11px 18px;
  border-radius: 14px; z-index: 70; box-shadow: 0 16px 30px -12px rgba(0,0,0,.5); max-width: 92vw; font-weight: 600; animation: subir .3s var(--ease) both; }
.toast.bad { background: linear-gradient(135deg, #c3002a, var(--bad)); }

/* ===== asistente de IA ===== */
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; color: #fff;
  padding: 14px 20px 14px 16px; border-radius: 999px; font-weight: 800; font-size: 15px;
  background: linear-gradient(135deg, #b75fae 0%, var(--accent) 35%, var(--violet) 75%, var(--navy-3) 100%); box-shadow: var(--bevel-dark), 0 16px 34px -12px rgba(109,91,208,.8); }
.fab::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 2px solid rgba(161,79,154,.45); animation: pulso 2.4s var(--ease) infinite; pointer-events: none; }
@keyframes pulso { 0% { opacity: .9; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.18); } }
.fab:active { box-shadow: var(--pressed-dark); transform: translateY(1px); }
.fab svg { width: 22px; height: 22px; }
.ai { position: fixed; top: 0; right: 0; bottom: 0; width: min(470px, 100vw); z-index: 50; display: flex; flex-direction: column;
  background: #fafaff; /* opaco y sin backdrop-filter: el desenfoque de todo el alto hacía lento el teclear en equipos modestos */
  border-left: 1px solid rgba(255,255,255,.8); box-shadow: -30px 0 60px -30px rgba(27,33,71,.55); animation: entra .35s var(--ease) both; }
@keyframes entra { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(27,33,71,.08); }
.ai-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--violet) 60%, var(--navy-3)); box-shadow: inset 0 2px 3px rgba(255,255,255,.35), inset 0 -3px 6px rgba(0,0,0,.25); }
.ai-logo svg { width: 22px; height: 22px; }
.ai-title { font-weight: 850; color: var(--navy); line-height: 1.1; } .ai-sub { font-size: 12px; color: var(--muted); }
.ai-head .sp { flex: 1; }
.ai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.ai-hola { text-align: center; padding: 18px 6px; }
.ai-hola h3 { font-size: 19px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.chips button { border: 0; background: #fff; border-radius: 999px; padding: 8px 13px; font-size: 13px; cursor: pointer; color: var(--navy); font-weight: 600; box-shadow: var(--bevel-light); text-align: left; }
.chips button:hover { color: var(--accent); }
.chips button:active { box-shadow: var(--pressed-light); transform: translateY(1px); }
.msg-u { align-self: flex-end; max-width: 88%; background: linear-gradient(135deg, var(--navy-3), var(--navy)); color: #fff; padding: 10px 14px; border-radius: 18px 18px 4px 18px;
  box-shadow: 0 10px 20px -14px rgba(27,33,71,.9); white-space: pre-wrap; animation: burbuja .45s var(--ease) both; }
@keyframes burbuja { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.msg-u .thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.msg-u .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,.4); }
.msg-a { align-self: flex-start; max-width: 96%; }
.pasos { list-style: none; margin: 0 0 6px; padding: 0 0 0 16px; border-left: 2px solid #dcd8f5; }
.pasos li { position: relative; font-size: 12.5px; color: var(--muted); padding: 3px 0; animation: subir .4s var(--ease) both; }
.pasos li::before { content: ""; position: absolute; left: -22px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ok); }
.pasos li.now::before { border-color: var(--violet); background: var(--violet); animation: latido 1s ease-in-out infinite; }
.pasos li.now { color: var(--navy); font-weight: 650; }
@keyframes latido { 50% { transform: scale(1.3); opacity: .6; } }
.brillo { background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 40%, var(--navy) 50%, var(--muted) 60%, var(--muted) 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: brillo 1.8s linear infinite; font-weight: 700; }
@keyframes brillo { from { background-position: 100% 0; } to { background-position: 0% 0; } }
.respuesta { background: #fff; border-radius: 4px 18px 18px 18px; padding: 12px 15px; box-shadow: 0 1px 0 #fff inset, 0 12px 26px -18px rgba(27,33,71,.6); font-size: 14.5px; line-height: 1.55; }
.respuesta p { margin: 0 0 8px; } .respuesta p:last-child { margin: 0; }
.respuesta ul { margin: 4px 0 8px; padding-left: 20px; }
.respuesta strong { color: var(--navy); }
.est-chip { display: inline-flex; margin-top: 8px; }
.ai-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(27,33,71,.06); }
.composer { position: relative; border-radius: 24px; background: #fff; padding: 12px 12px 10px; box-shadow: 0 1px 0 #fff inset, 0 20px 40px -22px rgba(27,33,71,.6), 0 0 0 1px rgba(27,33,71,.06);
  transition: box-shadow .2s; }
.composer.drag { box-shadow: 0 0 0 3px var(--violet), 0 0 40px rgba(109,91,208,.45); }
.composer textarea { border: 0; box-shadow: none; resize: none; min-height: 52px; max-height: 160px; padding: 4px 6px; font-size: 16px; background: transparent; }
.composer textarea:focus { box-shadow: none; }
.adjuntos { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 4px 8px; }
.adjuntos div { position: relative; }
.adjuntos img { width: 58px; height: 58px; object-fit: cover; border-radius: 12px; box-shadow: var(--bevel-light); }
.adjuntos button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; font-size: 12px; line-height: 22px; padding: 0; }
.barra { display: flex; align-items: center; gap: 8px; }
.barra .sp { flex: 1; }
.ibtn { width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; display: grid; place-items: center; color: var(--navy);
  background: linear-gradient(180deg, #ffffff, #f0f1f8); box-shadow: var(--bevel-light); transition: transform .12s, box-shadow .2s; }
.ibtn:active { box-shadow: var(--pressed-light); transform: translateY(1px); }
.ibtn svg { width: 20px; height: 20px; }
.ibtn.on { color: #fff; background: linear-gradient(180deg, #e0355a, var(--bad)); box-shadow: var(--bevel-dark); animation: latido 1.2s ease-in-out infinite; }
.ibtn.voz.on { background: linear-gradient(135deg, var(--accent), var(--violet)); animation: none; }
.ibtn.enviar { color: #fff; background: linear-gradient(135deg, var(--accent), var(--violet) 60%, var(--navy-3)); box-shadow: var(--bevel-dark); }
.ibtn.enviar:disabled { opacity: .35; cursor: not-allowed; }
.ai-nota { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 8px; }

/* ===== estilo dots: matriz de puntos del asistente, puntos de estado y fichas ===== */
.dots { display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 20px; height: 20px; vertical-align: middle; flex: 0 0 auto; }
.dots i { display: block; border-radius: 50%; background: currentColor; animation: punto 1.8s var(--ease) infinite; animation-delay: calc(var(--d) * 110ms); }
@keyframes punto { 0%, 100% { opacity: .35; transform: scale(.62); } 35% { opacity: 1; transform: scale(1); } }
.dots.sm { width: 15px; height: 15px; gap: 2px; color: var(--violet); }
.dots.lg { width: 34px; height: 34px; gap: 5px; }
.dots.xl { width: 52px; height: 52px; gap: 8px; color: var(--violet); margin: 0 auto 14px; display: grid; }
.fab .dots { width: 20px; height: 20px; }
.d { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: #b3b7c9; box-shadow: 0 0 0 3px rgba(179,183,201,.22); }
.d.ok { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.17); }
.d.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.d.bad { background: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.17); }
.d.vio { background: var(--violet); box-shadow: 0 0 0 3px rgba(109,91,208,.2); }
.srcd { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--navy-2); margin-top: 5px; white-space: nowrap; }
.fdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; margin-right: 8px; vertical-align: 1px;
  box-shadow: 0 0 0 3px rgba(245,158,11,.2); cursor: help; }
.fdot.bad { background: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.17); }
table.lineas tr.hl td { background: #fff8e8; }
table.lineas tr.hl td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }

/* inicio: barra de comando «¿Qué cotizamos hoy?» */
.hero { text-align: center; padding: 26px 4px 6px; max-width: 880px; margin: 0 auto; }
.hero-orb { width: 72px; height: 72px; margin: 0 auto; border-radius: 24px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--navy-3), var(--violet) 62%, #8f5cc2); box-shadow: inset 0 2px 3px rgba(255,255,255,.35), inset 0 -5px 10px rgba(0,0,0,.28), 0 18px 34px -14px rgba(109,91,208,.75); }
.hero h1 { font-size: 38px; letter-spacing: -.035em; margin: 16px 0 6px; background: linear-gradient(90deg, var(--navy) 15%, var(--violet) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin: 0 auto 18px; max-width: 640px; }
.cmd { position: relative; text-align: left; border-radius: 22px; background: #fff; padding: 12px 12px 10px;
  box-shadow: 0 1px 0 #fff inset, 0 26px 50px -28px rgba(27,33,71,.65), 0 0 0 1px rgba(27,33,71,.07); transition: box-shadow .25s; }
.cmd:focus-within { box-shadow: 0 1px 0 #fff inset, 0 26px 50px -24px rgba(109,91,208,.55), 0 0 0 2px rgba(109,91,208,.55); }
.cmd textarea { border: 0; box-shadow: none; resize: none; min-height: 56px; max-height: 180px; font-size: 18px; padding: 6px 8px; background: transparent; }
.cmd textarea:focus { box-shadow: none; }
.cmd-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmd-bar .sp { flex: 1; }
.ejemplos { margin-top: 14px; }
.entendi { margin: 16px 0 0; text-align: left; background: rgba(255,255,255,.94); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--glass-shadow); border: 1px solid rgba(109,91,208,.16); animation: subir .45s var(--ease) both; }
.ent-head { display: flex; align-items: center; gap: 10px; color: var(--navy); margin-bottom: 10px; flex-wrap: wrap; }
.tag-local { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 3px 9px; border-radius: 999px; }
.ent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cd { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: #fff; box-shadow: var(--bevel-light);
  font-size: 13.5px; font-weight: 650; color: var(--navy); animation: ficha .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.cd svg { width: 16px; height: 16px; }
@keyframes ficha { from { opacity: 0; transform: translateY(8px) scale(.92); } to { opacity: 1; transform: none; } }
.ent-falta { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--warn); font-size: 13.5px; }
.ent-pide { margin-top: 12px; max-width: 560px; }

/* Copiloto del estimado */
.copiloto { padding: 14px 18px; border: 1px solid rgba(109,91,208,.18); }
.cop-head { display: flex; align-items: center; gap: 10px; color: var(--navy); margin-bottom: 4px; }
.copiloto ul { list-style: none; margin: 0; padding: 0; }
.copiloto li { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid #eef0f6; font-size: 14px;
  animation: subir .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
.copiloto li:first-child { border-top: 0; }
.copiloto li span { flex: 1; }

/* menús desplegables, avatar, estado de precios y regresar */
.mas { position: relative; display: inline-block; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border-radius: 14px; padding: 6px; z-index: 45; text-align: left;
  box-shadow: 0 24px 48px -20px rgba(27,33,71,.55), 0 0 0 1px rgba(27,33,71,.06); animation: subir .2s var(--ease) both; }
.pop a, .pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; border: 0; background: none; color: var(--navy);
  font-weight: 650; text-decoration: none; cursor: pointer; font-size: 14px; }
.pop a:hover, .pop button:hover { background: #f3f2fb; }
.pop .peligro { color: var(--bad); }
.pop .who { display: block !important; padding: 8px 12px 10px; border-bottom: 1px solid #eef0f6; margin-bottom: 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-weight: 800; font-size: 15px;
  background: linear-gradient(135deg, var(--navy-3), var(--violet)); box-shadow: var(--bevel-dark); }
.avatar:active { box-shadow: var(--pressed-dark); transform: translateY(1px); }
.pill-st { display: inline-flex; align-items: center; gap: 8px; border: 0; background: rgba(255,255,255,.85); border-radius: 999px; padding: 5px 12px;
  font-size: 12.5px; font-weight: 700; color: var(--navy-2); cursor: help; box-shadow: var(--bevel-light); }
.volver { display: inline-block; margin-bottom: 8px; font-weight: 700; text-decoration: none; color: var(--muted); font-size: 14px; }
.volver:hover { color: var(--navy); }
label.f.foco { padding: 8px; margin: -8px; border-radius: 14px; background: rgba(109,91,208,.08); box-shadow: 0 0 0 2px rgba(109,91,208,.45); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .tipo, .kpi { transform: none !important; } }
@media (max-width: 760px) {
  h1 { font-size: 23px; }
  .who { display: none; }
  .brand span { display: none; }
  .topnav { gap: 10px; font-size: 14px; }
  table.lineas thead { display: none; }
  table.lineas tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.lineas td { border: 0; padding: 4px 6px; }
  table.lineas td.cdesc { grid-column: 1 / -1; }
  table.lineas td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; }
  .lista thead { display: none; }
  .lista tr { display: grid; grid-template-columns: 1fr auto; margin-bottom: 8px; }
  .lista td { border-radius: 0 !important; padding: 4px 10px; }
  .lista td:first-child { border-radius: 12px 12px 0 0 !important; } .lista td:last-child { border-radius: 0 0 12px 12px !important; }
  .kpi.total .v { font-size: 24px; }
  .fab { right: 14px; bottom: 14px; padding: 16px; }
  .fab span { display: none; }
  .ai { width: 100vw; }
  .hero h1 { font-size: 28px; }
  .cmd textarea { font-size: 16px; }
  .pill-st span { display: none; }
  .pill-st { padding: 9px; }
  .copiloto li { flex-wrap: wrap; }
}
@media print { .topbar, .acciones, .fab, .ai, .luz, .copiloto { display: none !important; } }
