/* ══════════════════════════════════════════════════════════════════
   Child Safety at Home — page-scoped premium components.
   Loaded AFTER base.css. Red accent (#dc2626). Neutral everywhere; the
   only strong colour is on danger severity + the interactive.
   ══════════════════════════════════════════════════════════════════ */

/* ── 3D home hero ── */
.home-stage { position: relative; width: 100%; aspect-ratio: 4 / 3; max-width: 480px; margin: 0 auto; }
#home-canvas { position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: radial-gradient(75% 75% at 50% 46%, #000 66%, transparent 100%);
          mask-image: radial-gradient(75% 75% at 50% 46%, #000 66%, transparent 100%); }

/* ── Bespoke SVG diagram icons ── */
.card .icon.icon-dgm, .intro-ico.icon-dgm { width: 60px; height: 60px; padding: 10px; border-radius: 15px;
  background: linear-gradient(160deg, var(--accent-wash), #fff); border: 1px solid var(--accent-line); box-shadow: var(--shadow-xs); }
.icon-dgm svg { width: 100%; height: 100%; }
.dgm { display: block; }
.dgm.sev-critical { color: #dc2626; } .dgm.sev-high { color: #ea580c; }
.dgm.sev-moderate { color: #ca8a04; } .dgm.sev-low { color: #65a30d; }
.dgm.accent { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .dgm * { animation: none !important; } #home-canvas { opacity: .7; } }

/* ── Interactive floor-plan hazard explorer ── */
.plan-lab { background: linear-gradient(180deg, #fff, var(--accent-wash)); border: 1px solid var(--accent-line);
  border-radius: var(--radius-xl); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow-md); }
.age-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; }
.age-tab { padding: 9px 18px; border-radius: 100px; border: 1px solid var(--gray-200); background: #fff;
  font-size: 0.86rem; font-weight: 600; color: var(--gray-600); cursor: pointer; font-family: var(--font); transition: all 0.2s; }
.age-tab:hover { border-color: var(--gray-400); color: var(--ink); }
.age-tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.age-tab .sub { display: block; font-size: 0.66rem; font-weight: 500; opacity: 0.7; margin-top: 1px; }

.plan-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; align-items: start; }
@media (max-width: 820px) { .plan-grid { grid-template-columns: 1fr; } }

.plan-stage { position: relative; background: #fbfaf8; border: 1px solid var(--gray-150); border-radius: var(--radius-lg); overflow: hidden; }
.plan-stage svg { width: 100%; height: auto; display: block; }
#plan-svg .room { fill: #fff; stroke: var(--gray-200); stroke-width: 1.5; cursor: pointer; transition: fill 0.2s, stroke 0.2s; }
#plan-svg .room:hover { fill: var(--accent-wash); }
#plan-svg .room.active { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 2.5; }
#plan-svg .room-label { fill: var(--gray-500); font: 600 8.5px var(--font); pointer-events: none; text-transform: uppercase; letter-spacing: .04em; }
#plan-svg .hz { cursor: pointer; }
#plan-svg .hz circle { transition: r 0.3s var(--ease), opacity 0.3s; }
#plan-svg .hz .halo { opacity: 0.28; }
#plan-svg .hz.sev-critical circle { fill: #dc2626; }
#plan-svg .hz.sev-high circle { fill: #ea580c; }
#plan-svg .hz.sev-moderate circle { fill: #ca8a04; }
#plan-svg .hz.sev-low circle { fill: #65a30d; }
#plan-svg .hz .halo { animation: hzPulse 2.4s var(--ease) infinite; }
@keyframes hzPulse { 0%,100% { transform: scale(1); opacity: .3; } 50% { transform: scale(1.7); opacity: 0; } }

.plan-panel { }
.plan-panel .ph { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.plan-panel h3 { font-size: 1.15rem; }
.plan-panel .count { font-size: 0.78rem; font-weight: 700; color: var(--accent-ink); }
.plan-panel .hint { font-size: 0.84rem; color: var(--gray-500); margin-bottom: 14px; }
.haz-list { display: grid; gap: 10px; max-height: 340px; overflow-y: auto; }
.haz { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 14px; background: #fff;
  border: 1px solid var(--gray-150); border-radius: var(--radius); border-left-width: 4px; }
.haz.sev-critical { border-left-color: #dc2626; } .haz.sev-high { border-left-color: #ea580c; }
.haz.sev-moderate { border-left-color: #ca8a04; } .haz.sev-low { border-left-color: #65a30d; }
.haz .hn { font-weight: 700; color: var(--ink); font-size: 0.92rem; }
.haz .ht { font-size: 0.82rem; color: var(--gray-500); margin-top: 2px; }
.haz .htip { font-size: 0.8rem; color: var(--accent-ink); margin-top: 6px; }
.haz .htip b { font-weight: 700; }
.haz .sevpill { align-self: start; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.haz.sev-critical .sevpill { background: #fef2f2; color: #dc2626; } .haz.sev-high .sevpill { background: #fff7ed; color: #ea580c; }
.haz.sev-moderate .sevpill { background: #fefce8; color: #a16207; } .haz.sev-low .sevpill { background: #f7fee7; color: #4d7c0f; }
.plan-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 0.74rem; color: var(--gray-500); }
.plan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plan-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
