/* Domotiza2 – estilos complementarios a Tailwind (CDN) */

:root {
  --brand: #9b3dff;
  --brand-soft: #d9b3ff;
  --ink: #0d0817;
}

body { background: var(--ink); }

/* ---------- Header ---------- */
#header.is-scrolled {
  background: rgba(13,8,23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-link { color: #cbd5e1; transition: color .2s; position: relative; }
.nav-link:hover { color: var(--brand-soft); }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--brand); transition: width .25s;
}
.nav-link:hover::after { width: 100%; }

/* ---------- Hero ---------- */
.hero-glow {
  background:
    radial-gradient(60% 50% at 80% 10%, rgba(155,61,255, 0.18), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgba(155,61,255, 0.08), transparent 70%);
}
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
.text-gradient {
  background: linear-gradient(90deg, #b567ff, #d9b3ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.float-slow { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.tile {
  display: flex; flex-direction: column; gap: 2px; padding: 14px;
  border-radius: 16px; background: #1f1535; color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.05);
}
.tile b { color: #fff; font-size: 14px; margin-top: 6px; }
.tile small { font-size: 12px; }
.tile-on { background: linear-gradient(160deg, rgba(155,61,255,0.22), rgba(155,61,255,0.06)); color: var(--brand-soft); border-color: rgba(155,61,255,0.35); }

/* ---------- Tarjetas de paquetes ---------- */
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 28px; border-radius: 24px;
  background: linear-gradient(180deg, #170f28, #110a1d);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(155,61,255,0.45); box-shadow: 0 20px 50px -20px rgba(155,61,255,0.35); }
.card-icon {
  display: inline-flex; height: 52px; width: 52px; align-items: center; justify-content: center;
  border-radius: 14px; background: rgba(155,61,255,0.12); color: var(--brand);
}
.card-cta {
  margin-top: auto; padding-top: 24px; font-weight: 700; color: var(--brand-soft);
  display: inline-flex; gap: 6px; align-items: center; transition: gap .2s, color .2s;
}
.card-cta:hover { gap: 12px; color: #fff; }

.check, .cross { position: relative; padding-left: 26px; }
.check::before {
  content: ""; position: absolute; left: 0; top: 3px; height: 16px; width: 16px; border-radius: 50%;
  background: rgba(155,61,255,0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b567ff' stroke-width='3.500' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/10px no-repeat;
}
.cross::before {
  content: ""; position: absolute; left: 0; top: 3px; height: 16px; width: 16px; border-radius: 50%;
  background: rgba(248,113,113,0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='3.500' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center/10px no-repeat;
}

/* ---------- Pasos ---------- */
.step { padding: 28px; border-radius: 20px; background: #150e24; border: 1px solid rgba(255,255,255,0.07); }
.step-n {
  display: inline-flex; height: 40px; width: 40px; align-items: center; justify-content: center;
  margin-bottom: 16px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800;
}

/* ---------- Beneficios ---------- */
.benefit { padding: 24px; border-radius: 20px; background: #150e24; border: 1px solid rgba(255,255,255,0.07); transition: border-color .25s, transform .25s; }
.benefit:hover { border-color: rgba(155,61,255,0.4); transform: translateY(-3px); }
.benefit-icon { display: inline-flex; height: 46px; width: 46px; align-items: center; justify-content: center; border-radius: 12px; background: rgba(155,61,255,0.12); color: var(--brand); }
.benefit h3 { margin-top: 16px; font-size: 1.05rem; font-weight: 700; color: #fff; }
.benefit p { margin-top: 8px; font-size: .9rem; line-height: 1.6; color: #94a3b8; }

/* ---------- Antes / Después ---------- */
.ba { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); background: #150e24; --pos: 50%; touch-action: pan-y; }
.ba-after, .ba-before { position: absolute; inset: 0; background-size: cover; background-position: center; }
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-tag { position: absolute; top: 12px; z-index: 3; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(8,5,15,0.75); color: #fff; backdrop-filter: blur(4px); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #fff; z-index: 2; transform: translateX(-1px); pointer-events: none; }
.ba-handle span {
  position: absolute; top: 50%; left: 50%; height: 40px; width: 40px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--brand); box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.ba-handle span::before, .ba-handle span::after {
  content: ""; position: absolute; top: 50%; border: solid #fff; border-width: 0 2.500px 2.500px 0; padding: 3px; transform-origin: center;
}
.ba-handle span::before { left: 9px; transform: translateY(-50%) rotate(135deg); }
.ba-handle span::after { right: 9px; transform: translateY(-50%) rotate(-45deg); }
.ba-range { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- FAQ ---------- */
.faq { border-radius: 16px; background: #150e24; border: 1px solid rgba(255,255,255,0.07); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 600; color: #fff; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); transition: transform .2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq[open] { border-color: rgba(155,61,255,0.35); }
.faq p { padding: 0 22px 20px; color: #94a3b8; line-height: 1.65; }

/* ---------- Widget flotante de WhatsApp ---------- */
.wa-float { animation: wa-bounce 3.5s ease-in-out infinite; transition: transform .2s; }
.wa-float:hover { transform: scale(1.1); animation-play-state: paused; }
.wa-float::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #25D366; z-index: -1;
  animation: wa-pulse 2.2s ease-out infinite;
}
@keyframes wa-pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes wa-bounce { 0%, 85%, 100% { transform: translateY(0); } 90% { transform: translateY(-6px); } 95% { transform: translateY(0); } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .float-slow, .wa-float, .wa-float::before { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Ficha técnica (tecnologia.html) ---------- */
.spec { padding: 26px; border-radius: 20px; background: #150e24; border: 1px solid rgba(255,255,255,0.07); }
.spec h3 { font-size: 1.15rem; font-weight: 700; color: #fff; }
.spec dl { margin-top: 14px; display: grid; gap: 12px; }
.spec dl > div { display: grid; gap: 4px; }
.spec dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-soft); }
.spec dd { font-size: .92rem; line-height: 1.65; color: #cbd5e1; }
@media (min-width: 768px) { .spec dl > div { grid-template-columns: 150px 1fr; gap: 16px; } }

/* ---------- Utilidades generales ---------- */
[hidden] { display: none !important; }

/* Valores pendientes de completar (garantía) */
mark.ph { background: rgba(250, 204, 21, 0.16); color: #fde68a; border-radius: 4px; padding: 0 5px; outline: 1px dashed rgba(250, 204, 21, 0.6); }

/* ---------- Cotizador ---------- */
.q-step { border: 0; padding: 0; margin: 0; min-width: 0; }
.q-step legend { padding: 0; }
.q-step legend:focus { outline: none; }
.q-detail { margin-top: 22px; }
.q-detail h3 { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 10px; }
.q-detail h3 label { cursor: pointer; }

.opt, .chip { position: relative; display: block; cursor: pointer; }
.opt input, .chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px 16px 52px; position: relative;
  border-radius: 16px; background: #150e24; border: 1.5px solid rgba(255,255,255,0.1); transition: border-color .2s, background .2s; }
.opt-body b { color: #fff; font-size: 1rem; }
.opt-body small { color: #94a3b8; font-size: .85rem; line-height: 1.4; }
.opt-body::before { content: ""; position: absolute; left: 18px; top: 18px; height: 22px; width: 22px; border-radius: 7px; border: 2px solid rgba(255,255,255,0.3); transition: all .2s; }
.opt:hover .opt-body { border-color: rgba(155,61,255,0.6); }
.opt input:checked + .opt-body { border-color: var(--brand); background: rgba(155,61,255,0.14); }
.opt input:checked + .opt-body::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.500' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-block; }
.chip-body { display: inline-block; padding: 11px 18px; border-radius: 999px; background: #150e24; border: 1.5px solid rgba(255,255,255,0.12);
  color: #e2e8f0; font-size: .95rem; transition: border-color .2s, background .2s, color .2s; }
.chip:hover .chip-body { border-color: rgba(155,61,255,0.6); }
.chip input:checked + .chip-body { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.opt input:focus-visible + .opt-body, .chip input:focus-visible + .chip-body { outline: 2px solid var(--brand-soft); outline-offset: 2px; }

.field { width: 100%; padding: 13px 16px; border-radius: 14px; background: #150e24; border: 1.5px solid rgba(255,255,255,0.12); color: #fff; font-size: 16px; font-family: inherit; }
.field::placeholder { color: #64748b; }
.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(155,61,255,0.25); }

/* ---------- Casa demo interactiva ---------- */
.demo-stage { border-radius: 24px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); background: #0d0817; }
.demo-stage > svg { display: block; width: 100%; height: auto; }
.demo-status { padding: 14px 18px; font-size: .92rem; color: #e2e8f0; background: #150e24; border-top: 1px solid rgba(255,255,255,0.08); min-height: 3.2em; }

#demo-svg .lit, #demo-svg .glow { opacity: 0; transition: opacity .45s ease; }
#demo-svg .curtain { transform-box: fill-box; transform-origin: top; transform: scaleY(.1); transition: transform .9s ease; }
#demo-svg.is-curtain-closed .curtain { transform: scaleY(1); }
#demo-svg #gate { transition: transform 1.1s ease; }
#demo-svg.is-gate-open #gate { transform: translateX(212px); }
#demo-svg #gate-led { transition: fill .3s; }
#demo-svg.is-gate-open #gate-led { fill: #25D366; }
#demo-svg #pool-glow { opacity: 0; transition: opacity .6s; }
#demo-svg.is-pool-on #pool-glow { opacity: .75; }
#demo-svg #pool-lamps { opacity: 0; transition: opacity .6s; }
#demo-svg.is-pool-on #pool-lamps { opacity: 1; }


.sw { position: relative; flex: none; width: 54px; height: 30px; border-radius: 999px; background: #2c1f4a; border: 0; cursor: pointer; transition: background .25s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .25s; }
.sw[aria-checked="true"] { background: var(--brand); }
.sw[aria-checked="true"]::after { transform: translateX(24px); }
.demo-slider { display: block; padding: 4px 0 12px; }
.demo-slider span { display: block; font-size: .8rem; color: #94a3b8; margin-bottom: 8px; }
.demo-slider input { width: 100%; accent-color: #9b3dff; height: 28px; cursor: pointer; }

/* ---------- Red en malla (tecnologia) ---------- */
.mesh-stage { border-radius: 24px; border: 1px solid rgba(255,255,255,0.1); background: #0d0817; padding: 8px; }
.mesh-stage svg { display: block; width: 100%; height: auto; }
.mesh-edge { stroke: #3a2470; stroke-width: 2; transition: stroke .3s, opacity .3s; }
.mesh-edge.is-off { stroke-dasharray: 4 6; opacity: .35; }
.mesh-edge.is-hot { stroke: #9b3dff; stroke-width: 3; }
.mesh-dot { fill: #2c1f4a; stroke: #b567ff; stroke-width: 2.500; transition: fill .3s, stroke .3s; }
.is-hub .mesh-dot { fill: #9b3dff; stroke: #d9b3ff; }
.mesh-halo { fill: rgba(155,61,255,0.18); }
.mesh-label { fill: #cbd5e1; font: 600 13px Inter, sans-serif; }
.mesh-node.is-failed .mesh-dot { fill: #1f1535; stroke: #f87171; stroke-dasharray: 3 3; }
.mesh-node.is-failed .mesh-label { fill: #f87171; }
.mesh-pulse { fill: #d9b3ff; filter: drop-shadow(0 0 6px #b567ff); }
.mesh-pulse.is-cmd { fill: #fff; }
.mesh-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; padding: 6px 0 10px; font-size: .8rem; color: #94a3b8; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-hub { background: #9b3dff; } .dot-node { background: #2c1f4a; border: 2px solid #b567ff; } .dot-pulse { background: #d9b3ff; }

@media (prefers-reduced-motion: reduce) {
  #demo-svg *, #demo-svg { transition: none !important; animation: none !important; }
}

/* ---------- Barra de hora: "Un día en tu casa" ---------- */
.daybar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px 18px; padding: 14px 18px; background: #150e24; border-top: 1px solid rgba(255,255,255,0.08); }
.day-play { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: .92rem; color: #fff; background: var(--brand); border: 0; cursor: pointer; white-space: nowrap; transition: background .2s; }
.day-play:hover { background: #b567ff; }
.day-slider { min-width: 0; }
.day-slider input { width: 100%; accent-color: #b567ff; height: 28px; cursor: pointer; }
.day-ticks { display: flex; justify-content: space-between; font-size: .7rem; color: #64748b; margin-top: -2px; }
.day-clock { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 800; color: #fff; min-width: 4.2ch; text-align: right; }
@media (max-width: 560px) { .daybar { grid-template-columns: 1fr auto; } .day-slider { grid-column: 1 / -1; order: 3; } }

/* ---------- Celular con app simulada ---------- */
.phone { width: 300px; max-width: 100%; margin: 0 auto; padding: 11px; border-radius: 46px; position: relative;
  background: linear-gradient(160deg, #3a2470, #0d0817 55%); border: 1px solid rgba(255,255,255,0.16); box-shadow: 0 30px 70px -20px rgba(155,61,255,0.5), inset 0 0 0 2px rgba(0,0,0,0.5); }
.phone-notch { position: absolute; z-index: 8; top: 19px; left: 50%; transform: translateX(-50%); width: 84px; height: 22px; border-radius: 999px; background: #000; }
.phone-screen { position: relative; height: 600px; border-radius: 36px; overflow: hidden; background: #0f0a1c; display: flex; flex-direction: column; }
.ph-status { display: flex; justify-content: space-between; padding: 15px 24px 4px; font-size: 12px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.ph-head { padding: 10px 20px 8px; }
.ph-head h3 { font-size: 1.45rem; font-weight: 800; color: #fff; line-height: 1.1; }
.ph-head p { margin-top: 4px; font-size: .78rem; color: #b4a6d6; line-height: 1.35; min-height: 2.1em; }
.ph-body { flex: 1; overflow-y: auto; padding: 4px 14px 12px; scrollbar-width: thin; scrollbar-color: #3a2470 transparent; }
.ph-panel { display: grid; gap: 10px; }
.ph-row { padding: 12px 14px; border-radius: 16px; background: #1a1230; border: 1px solid rgba(255,255,255,0.06); }
.ph-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ph-row b { display: block; font-size: .9rem; color: #fff; }
.ph-row small { font-size: .75rem; color: #a99bd0; }
.ph-row .demo-slider { padding: 10px 0 0; }
.ph-row .demo-slider span { font-size: .72rem; margin-bottom: 2px; }
.ph-scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph-scene { text-align: left; min-height: 104px; padding: 14px; border-radius: 18px; background: #1a1230; border: 1.5px solid rgba(255,255,255,0.08); color: #fff; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; gap: 6px; }
.ph-scene b { font-size: .95rem; }
.ph-scene small { font-size: .74rem; color: #b4a6d6; line-height: 1.35; }
.ph-scene:hover { border-color: rgba(155,61,255,0.7); }
.ph-scene.is-active { background: var(--brand); border-color: var(--brand); }
.ph-scene.is-active small { color: #f1e6ff; }
.ph-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ph-log li { display: flex; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: 14px; background: #1a1230; font-size: .82rem; color: #e2e8f0; }
.ph-log li b { color: #d9b3ff; font-variant-numeric: tabular-nums; flex: none; }
.ph-log .ph-empty { display: block; color: #94a3b8; text-align: center; padding: 22px 12px; }
.ph-tabs { display: flex; border-top: 1px solid rgba(255,255,255,0.08); background: #0d0817; padding-bottom: 8px; }
.ph-tabs button { flex: 1; padding: 13px 0 9px; font-size: .78rem; font-weight: 700; color: #94a3b8; background: none; border: 0; cursor: pointer; border-top: 2px solid transparent; margin-top: -1px; }
.ph-tabs button[aria-selected="true"] { color: #d9b3ff; border-top-color: var(--brand); }
.ph-toast { position: absolute; z-index: 7; top: 44px; left: 10px; right: 10px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: rgba(44, 31, 74, 0.97); border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.ph-toast.is-in { animation: toast-in .35s ease; }
.ph-toast-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27white%27 stroke-width=%272.500%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M12 3 4 10v10h6v-6h4v6h6V10z%27/%3E%3C/svg%3E") center/17px no-repeat; }
.ph-toast-tx { display: flex; flex-direction: column; min-width: 0; }
.ph-toast-tx b { font-size: .82rem; color: #fff; line-height: 1.25; }
.ph-toast-tx small { font-size: .68rem; color: #b4a6d6; }
@keyframes toast-in { from { transform: translateY(-22px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Comparador de paquetes ---------- */
.cmp-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cmp-card { position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 22px; background: linear-gradient(180deg, #170f28, #110a1d);
  border: 1px solid rgba(255,255,255,0.08); transition: opacity .35s, transform .35s, border-color .35s, box-shadow .35s; }
.cmp-card h3 { font-size: 1.1rem; font-weight: 800; color: #fff; padding-right: 6px; }
.cmp-card dl { margin-top: 14px; display: grid; gap: 12px; }
.cmp-card dt { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-soft); }
.cmp-card dd { margin-top: 2px; font-size: .9rem; line-height: 1.5; color: #cbd5e1; }
.cmp-card .card-cta { padding-top: 20px; font-size: .92rem; }
.cmp-badge { align-self: flex-start; margin-bottom: 10px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #fff; background: var(--brand); }
.cmp-why { margin-top: 8px; padding: 10px 12px; border-radius: 12px; font-size: .88rem; line-height: 1.45; color: #f1e6ff; background: rgba(155,61,255,0.18); border: 1px solid rgba(155,61,255,0.4); }
.cmp-card.is-rec { border-color: var(--brand); box-shadow: 0 18px 50px -18px rgba(155,61,255,0.6); transform: translateY(-4px); }
.cmp-card.is-dim { opacity: .38; transform: scale(.98); }
.cmp-card.is-dim:hover, .cmp-card.is-dim:focus-within { opacity: .75; }

/* ---------- Línea de tiempo: obra vs Domotiza2 ---------- */
.tl { padding: 26px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.1); background: rgba(21,14,36,0.7); }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.tl-head h3 { font-size: 1.15rem; font-weight: 800; color: #fff; }
.tl-controls { display: flex; align-items: center; gap: 12px; }
.tl-day { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--brand-soft); min-width: 5ch; text-align: right; }
.tl-replay { padding: 7px 14px; border-radius: 10px; font-size: .82rem; font-weight: 700; color: #d9b3ff; background: none; border: 1px solid rgba(155,61,255,0.5); cursor: pointer; }
.tl-replay:hover { background: rgba(155,61,255,0.15); color: #fff; }
.tl-row { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; }
.tl-label b { display: block; color: #fff; font-size: .95rem; }
.tl-label small { color: #94a3b8; font-size: .78rem; }
.tl-track { position: relative; height: 44px; border-radius: 12px; background: #0d0817; border: 1px solid rgba(255,255,255,0.08); overflow: hidden; }
.tl-seg { position: absolute; top: 0; bottom: 0; border-right: 2px solid #0d0817; }
.tl-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #6b7280, #9ca3af); }
.tl-seg span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-size: .72rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.tl-track-good .tl-fill { background: linear-gradient(90deg, #9b3dff, #d9b3ff); }
.tl-end { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .78rem; font-weight: 800; color: #fecaca; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.tl-end-good { right: auto; left: calc(3.6% + 14px); color: var(--brand-soft); animation: fade-in .5s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.tl-list { list-style: none; margin: 12px 0 0 184px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .84rem; }
.tl-list-bad { color: #94a3b8; }
.tl-list-good { color: #e2e8f0; }
.tl-axis { display: flex; justify-content: space-between; margin: 18px 0 0 184px; font-size: .72rem; color: #64748b; }
.tl-note { margin: 10px 0 0 184px; font-size: .72rem; color: #64748b; }
@media (max-width: 700px) {
  .tl { padding: 18px; }
  .tl-row { grid-template-columns: 1fr; gap: 8px; }
  .tl-list, .tl-axis, .tl-note { margin-left: 0; }
  .tl-seg span { font-size: .62rem; }
  .tl-end { font-size: .68rem; }
  .tl-end-good { left: calc(3.6% + 10px); }
}
@media (prefers-reduced-motion: reduce) { .ph-toast.is-in, .tl-end-good { animation: none; } .cmp-card { transition: none; } }

/* Interruptor de rutinas automáticas (opcional) */
.ph-auto { border-color: rgba(155,61,255,0.5); background: #201438; }
.ph-auto-note { margin-top: 8px; font-size: .72rem; line-height: 1.4; color: #b4a6d6; }

/* Hora vinculada al dispositivo (rutinas automáticas desactivadas) */
.day-clock-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.day-linked { margin-top: -2px; font-size: .68rem; font-weight: 700; letter-spacing: .02em; color: var(--brand-soft); white-space: nowrap; }
.day-resync { margin-top: 4px; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; color: #d9b3ff; background: none; border: 1px solid rgba(155,61,255,0.55); cursor: pointer; white-space: nowrap; }
.day-resync:hover { background: rgba(155,61,255,0.18); color: #fff; }
.day-resync:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 2px; }
