/* Health & Elderly Care additions on top of style.css (the shared "Modern Robot" theme: navy, electric blue, cyan). */
:root { --heart: #ff5f8f; }

/* status badges */
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; letter-spacing: .5px; padding: 3px 10px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; font-family: Kanit; font-weight: 500; background: rgba(3, 8, 22, .5); align-self: flex-start; }
.st-now { color: var(--ok); } .st-design { color: var(--warn); } .st-roadmap { color: #8fa3c4; }
.legend .st { font-size: 13px; }

/* holographic figure: shown on scenes without a photo */
.holo { position: absolute; right: 7%; top: 50%; width: min(34vw, 470px); aspect-ratio: 1; transform: translateY(-55%); pointer-events: none; display: none; }
.scene.no-photo .holo { display: block; }
.scene.no-photo.layout-care .holo, .scene.no-photo.layout-share .holo, .scene.no-photo.layout-flow .holo, .scene.no-photo.layout-map .holo { display: none; }
.holo-ring { position: absolute; border-radius: 50%; border: 1px solid var(--line-strong); }
.holo-ring.r1 { inset: 0; border-style: dashed; animation: spin 50s linear infinite; }
.holo-ring.r2 { inset: 11%; border-color: rgba(47, 123, 255, .6); animation: spin 30s linear infinite reverse; border-top-color: var(--cyan); border-width: 2px; }
.holo-ring.r3 { inset: 23%; background: radial-gradient(circle, rgba(34, 225, 255, .22), rgba(3, 8, 22, 0) 70%); box-shadow: inset 0 0 60px rgba(34, 225, 255, .25), 0 0 80px rgba(47, 123, 255, .25); }
.holo-core { position: absolute; inset: 30%; display: grid; place-items: center; font-size: clamp(60px, 9vw, 140px); filter: drop-shadow(0 0 24px rgba(34, 225, 255, .8)); animation: float 5s ease-in-out infinite; }
.holo-ecg { position: absolute; left: -6%; bottom: 4%; width: 112%; height: 70px; }
.holo-ecg path { fill: none; stroke: var(--cyan); stroke-width: 2.4; filter: drop-shadow(0 0 6px var(--cyan)); stroke-dasharray: 420; animation: ecg 2.6s linear infinite; }
.holo-base { position: absolute; left: 12%; right: 12%; bottom: -10%; height: 16%; border-radius: 50%; background: radial-gradient(ellipse, rgba(34, 225, 255, .45), transparent 70%); filter: blur(6px); }
@keyframes ecg { from { stroke-dashoffset: 420; } to { stroke-dashoffset: -420; } }
@keyframes float { 50% { transform: translateY(-14px); } }
.scene.no-photo .scene-bg { display: none; }

/* platform orbit */
.orbit { position: relative; aspect-ratio: 1; width: min(100%, 62vh); margin: auto; }
.orbit-ring { position: absolute; border-radius: 50%; border: 1px dashed var(--line-strong); }
.orbit-ring.o1 { inset: 8%; animation: spin 60s linear infinite; }
.orbit-ring.o2 { inset: 26%; border-style: solid; border-color: rgba(47, 123, 255, .35); animation: spin 35s linear infinite reverse; }
.orbit-ring.o1::after { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: var(--glow); }
.orbit-core { position: absolute; inset: 33%; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(circle, rgba(47, 123, 255, .55), rgba(3, 8, 22, .3) 72%); border: 1px solid var(--line-strong); box-shadow: inset 0 0 40px rgba(34, 225, 255, .3), 0 0 60px rgba(47, 123, 255, .35); }
.orbit-core b { font-size: clamp(18px, 1.8vw, 28px); font-weight: 600; } .orbit-core b span { color: var(--cyan); }
.orbit-core small { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.orbit-mod { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; width: 112px; text-align: center; }
.orbit-mod i { font-style: normal; font-size: 26px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #0b2147; border: 1px solid var(--line-strong); box-shadow: 0 0 14px rgba(34, 225, 255, .25); }
.orbit-mod span { font-size: 13px; color: var(--muted); line-height: 1.25; text-shadow: 0 1px 6px #000; }
.orbit-mod.hot i { width: 78px; height: 78px; font-size: 34px; border: 2px solid var(--heart); box-shadow: 0 0 26px rgba(255, 95, 143, .7); animation: beat 1.4s ease-in-out infinite; }
.orbit-mod.hot span { color: #fff; font-weight: 500; font-size: 14px; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }

/* pain → solution map */
.map { display: grid; gap: 7px; max-width: 1260px; }
.map-row { display: grid; grid-template-columns: 92px minmax(0, .85fr) 22px minmax(0, 1.8fr) 190px; gap: 12px; align-items: center; padding: 9px 16px; text-align: left; font-family: Sarabun, Kanit; font-size: 15px; line-height: 1.35; transition: border-color .3s, box-shadow .3s, transform .3s; }
.map-row .who { font-family: Kanit; font-weight: 500; color: var(--cyan); font-size: 14px; }
.map-row .mp { color: #ffb3bd; }
.map-row .arrow { color: var(--cyan); text-align: center; }
.map-row .st { justify-self: end; }
.map-row.now, .map-row:hover { border-color: var(--cyan); box-shadow: var(--glow); transform: translateX(6px); }

/* health twin graph: main node */
.g-node.main circle.core { fill: #123a78; stroke: var(--heart); stroke-width: 3; }
.g-node.main circle.halo { stroke: var(--heart); }
.g-node.main .ico { font-size: 30px; }

/* rule-based state */
.state-chips { display: flex; flex-wrap: wrap; gap: 10px; max-width: 640px; }
.state-chip { --c: var(--cyan); padding: 10px 16px 10px 34px; border-radius: 99px; border: 1px solid var(--line); background: rgba(10, 28, 60, .75); position: relative; font-size: 15px; transition: border-color .3s, box-shadow .3s; }
.state-chip::before { content: ""; position: absolute; left: 14px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.state-chip.sel, .state-chip:hover { border-color: var(--c); box-shadow: 0 0 16px var(--c); }
.hint { font-size: 13px; color: var(--muted); margin-top: 12px; }
.state-card { --c: var(--ok); padding: 26px 28px 22px 34px; max-width: 520px; width: 100%; margin-left: auto; background: rgba(244, 248, 255, .97); color: #0e1c33; border: none; border-left: 6px solid var(--c); box-shadow: 0 30px 60px rgba(0, 0, 0, .5), 0 0 40px var(--c); }
.state-card::before { display: none; }
.state-card small { color: #5a6b85; font-size: 15px; }
.state-card b { display: block; font-size: clamp(24px, 2.2vw, 32px); font-weight: 600; margin: 4px 0 10px; color: #0e1c33; }
.state-card .why { font-family: Sarabun, Kanit; font-size: 18px; margin: 0 0 6px; line-height: 1.5; }
.state-card .det { font-family: Sarabun, Kanit; font-size: 16px; color: #8a5a00; margin: 0 0 14px; }
.state-card .rule { font-size: 13px; color: #5a6b85; margin: 0; padding-top: 10px; border-top: 1px solid #dfe6f2; }
.state-card.flip { animation: flip .6s var(--ease); }
@keyframes flip { from { transform: perspective(800px) rotateX(70deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* care mode mock */
.care-split { grid-template-columns: minmax(0, 1fr) minmax(0, .75fr); }
.real-badge.concept { color: var(--warn); border-color: rgba(255, 200, 87, .55); }
.real-badge.concept::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.feat { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 640px; }
.feat li { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.feat b { font-weight: 600; color: var(--ice); font-size: 16px; } .feat span { font-family: Sarabun, Kanit; font-size: 14px; color: var(--muted); }
.mock-wrap { display: grid; place-items: center; }
.mock { position: relative; width: min(340px, 30vw, calc((100vh - 220px) * .49)); aspect-ratio: 390 / 800; border-radius: 40px; padding: 18px 14px; background: #eef3fa; border: 10px solid #101a30; box-shadow: 0 40px 80px rgba(0, 0, 0, .6), 0 0 50px rgba(34, 225, 255, .35); color: #0e1c33; display: flex; flex-direction: column; gap: 9px; overflow: hidden; font-size: clamp(10px, 1vw, 14.5px); }
.mk-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mk-top b { display: block; font-size: 1.35em; font-weight: 600; line-height: 1.2; } .mk-top small { color: #5a6b85; }
.mk-sos-mini { flex: none; background: #d7263d; color: #fff; font-weight: 700; padding: 6px 10px; border-radius: 12px; font-size: .9em; }
.mk-card { background: #fff; border-radius: 18px; padding: 11px 14px; box-shadow: 0 2px 8px rgba(16, 40, 90, .08); }
.mk-card b { display: block; font-size: 1.12em; font-weight: 600; } .mk-card small { color: #5a6b85; font-family: Sarabun, Kanit; }
.mk-status { display: flex; gap: 10px; align-items: center; border-left: 6px solid #1f9d6c; }
.mk-status i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #1f9d6c; box-shadow: 0 0 0 5px rgba(31, 157, 108, .18); }
.mk-btn { margin-top: 8px; width: 100%; min-height: 3.4em; border: none; border-radius: 14px; background: #1767e5; color: #fff; font-size: 1.2em; font-weight: 600; }
.mk-btn[hidden], .mk-done[hidden] { display: none; }
.mk-done { margin: 8px 0 0; color: #1f9d6c; font-weight: 500; animation: rise .5s var(--ease); }
.mk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.mk-sos, .mk-fell { min-height: 3.6em; border: none; border-radius: 16px; font-size: 1.25em; font-weight: 700; color: #fff; }
.mk-sos { background: #d7263d; animation: sosring 1.8s infinite; } .mk-fell { background: #b3541e; }
@keyframes sosring { 0% { box-shadow: 0 0 0 0 rgba(215, 38, 61, .6); } 70% { box-shadow: 0 0 0 14px rgba(215, 38, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(215, 38, 61, 0); } }
.mk-talk { min-height: 2.8em; border-radius: 16px; border: 2px solid #1767e5; background: #fff; color: #1767e5; font-weight: 600; font-size: 1.05em; opacity: .6; cursor: default; }
.mk-overlay { position: absolute; inset: 0; background: rgba(120, 10, 25, .97); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px; text-align: center; animation: rise .4s var(--ease); }
.mk-overlay[hidden] { display: none; }
.mk-overlay b { font-size: 1.3em; }
.mk-overlay ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; text-align: left; width: 100%; }
.mk-overlay li { padding: 8px 10px 8px 30px; border-radius: 10px; background: rgba(255, 255, 255, .1); position: relative; opacity: .35; transition: opacity .4s; }
.mk-overlay li::before { content: "…"; position: absolute; left: 10px; } .mk-overlay li.on { opacity: 1; } .mk-overlay li.on::before { content: "✓"; color: #7dffb8; }
.mk-pulse { width: 70px; height: 70px; border-radius: 50%; background: #ff4560; animation: sosring 1.2s infinite; }
.mk-call { width: 100%; min-height: 3.2em; border: none; border-radius: 14px; background: #fff; color: #b0122a; font-weight: 700; font-size: 1.15em; }
.mk-cancel { background: none; border: 1px solid rgba(255, 255, 255, .6); border-radius: 12px; padding: 8px 14px; color: #fff; }

/* caregiver sharing */
.share { display: grid; grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); gap: 14px; align-items: stretch; max-width: 1100px; margin-bottom: 14px; }
.share h4 { margin: 0 0 8px; font-weight: 600; font-size: 17px; color: var(--ice); }
.share-ctl, .share-view { padding: 16px 20px; }
.sw-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(64, 196, 255, .18); cursor: pointer; font-family: Sarabun, Kanit; font-size: 16px; position: relative; }
.sw-row input { position: absolute; opacity: 0; pointer-events: none; }
.sw { flex: none; width: 46px; height: 26px; border-radius: 99px; background: rgba(157, 180, 211, .25); position: relative; transition: background .3s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); }
.sw-row input:checked + .sw { background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: var(--glow); }
.sw-row input:checked + .sw::after { transform: translateX(20px); }
.sw-row input:focus-visible + .sw { outline: 2px solid var(--cyan); outline-offset: 3px; }
.share-arrow { font-size: 32px; color: var(--cyan); display: grid; place-items: center; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.share-view { background: rgba(244, 248, 255, .96); color: #0e1c33; border: none; }
.share-view::before { display: none; } .share-view h4 { color: #0e1c33; }
.sv-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #e1e8f3; font-family: Sarabun, Kanit; font-size: 15px; animation: rise .45s var(--ease) both; }
.sv-row b { font-weight: 600; text-align: right; }
.sv-none { color: #5a6b85; font-family: Sarabun, Kanit; }
.audit { margin: 12px 0 0; font-size: 13px; color: #5a6b85; }

/* roadmap */
.road { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 1300px; }
.road-line { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: linear-gradient(90deg, var(--ok), var(--warn) 30%, var(--warn) 70%, #8fa3c4); opacity: .4; }
.road-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; transition: border-color .3s, box-shadow .3s, transform .3s; }
.road-card .code { font-size: 12px; letter-spacing: 1px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.road-card h4 { margin: 0; font-size: 17px; font-weight: 600; }
.road-card p { margin: 0 0 6px; font-family: Sarabun, Kanit; font-size: 13.5px; color: var(--muted); line-height: 1.4; flex: 1; }
.rc-now { border-color: rgba(62, 230, 168, .55); } .rc-now h4 { color: var(--ok); }
.rc-roadmap { opacity: .82; }
.road-card.now { border-color: var(--cyan); box-shadow: var(--glow); transform: translateY(-4px); }

@media (max-width: 900px) {
  .map-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } .map-row .arrow { display: none; } .map-row .st { justify-self: start; }
  .share { grid-template-columns: minmax(0, 1fr); } .share-arrow { transform: rotate(90deg); animation: none; }
  .road, .feat, .care-split { grid-template-columns: minmax(0, 1fr); }
  .mock { width: min(320px, 80vw); }
  .holo { display: none !important; }
  .orbit-mod { width: 80px; } .orbit-mod span { font-size: 11px; } .orbit-mod i { width: 44px; height: 44px; font-size: 20px; }
}

/* keep titles visible when a scene is taller than the viewport */
.scene-inner { justify-content: safe center; }
.layout-map .title, .layout-screens .title { font-size: clamp(26px, 2.9vw, 44px); margin: 8px 0 6px; }
.layout-map .sub { margin-bottom: 14px; }
.layout-screens .phone { width: min(15vw, 230px, calc((100vh - 400px) * 0.4)); }
.layout-orbit .scene-bg { opacity: .3; filter: blur(3px) saturate(.8); }
