@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root{
  --navy:#173a59; --muted:#718596; --teal:#19b8ab; --green:#68cf86; --mint:#e9faf6;
  --blue:#5aa7e8; --yellow:#f3b93f; --orange:#f2a43b; --red:#ef696d; --surface:#fff;
  --bg:#eef8f6; --line:#e4efef; --shadow:0 16px 40px rgba(25,76,91,.10);
}
*{box-sizing:border-box}
html{background:#eaf6f4}
body{margin:0;min-height:100vh;font-family:Nunito,Arial,sans-serif;color:var(--navy);background:
radial-gradient(circle at 10% 0,#fff 0,transparent 35%),linear-gradient(145deg,#f7fbfb,#e9f7f4)}
button,input{font:inherit}
button{cursor:pointer}
.svg-defs{position:absolute;width:0;height:0;overflow:hidden}
svg{width:1.35em;height:1.35em;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.app{width:min(100%,460px);min-height:100vh;margin:auto;background:#fbfefe;position:relative;padding:20px 18px 104px;box-shadow:0 0 70px rgba(23,58,89,.14)}
.app-header{display:flex;align-items:center;justify-content:space-between;padding:2px 2px 16px}
.brand-block{display:flex;align-items:center;gap:11px}
.brand-icon{width:52px;height:52px;object-fit:contain;border-radius:17px;filter:drop-shadow(0 6px 10px rgba(25,184,171,.18))}
.brand-name{font-size:26px;line-height:1;font-weight:900;letter-spacing:-1px}.brand-name span{color:var(--teal)}
.tagline{display:flex;align-items:center;gap:6px;font-size:10px;color:#4b83a5;font-weight:800;margin-top:5px}
.tagline i{width:18px;height:2px;border-radius:2px;background:linear-gradient(90deg,var(--teal),var(--green))}
.round-button{width:42px;height:42px;border:0;border-radius:50%;display:grid;place-items:center;background:#fff;color:var(--teal);box-shadow:0 7px 18px rgba(23,58,89,.10)}
.secure-warning{padding:10px 13px;background:#fff3d7;border:1px solid #f7d98a;color:#785917;border-radius:15px;font-size:12px;font-weight:800;margin-bottom:12px}
.hidden{display:none!important}

.screen{display:none;animation:fade .25s ease}.screen.active{display:block}@keyframes fade{from{opacity:.15;transform:translateY(4px)}}
.hero{position:relative;border-radius:29px;padding:25px 22px 20px;min-height:285px;color:white;overflow:hidden;box-shadow:0 18px 38px rgba(25,184,171,.22)}
.hero:before,.hero:after{content:"";position:absolute;border:1px solid rgba(255,255,255,.17);border-radius:50%}
.hero:before{width:210px;height:210px;right:-74px;top:-55px}.hero:after{width:150px;height:150px;right:-43px;top:-25px}
.hero.ready,.compact-status.ready{background:linear-gradient(135deg,#4a8199,#7ea4ab)}
.hero.safe,.compact-status.safe{background:linear-gradient(135deg,#17b5b2,#74d07f)}
.hero.calm,.compact-status.calm{background:linear-gradient(135deg,#eda83b,#f4cb57)}
.hero.exit,.compact-status.exit{background:linear-gradient(135deg,#ec676b,#f08c78)}
.hero-copy{position:relative;z-index:2;max-width:58%}.eyebrow{text-transform:uppercase;letter-spacing:.8px;font-size:11px;font-weight:800;opacity:.9;margin:0 0 4px}
.hero h1{font-size:48px;line-height:1;margin:0 0 6px;letter-spacing:-2px}.hero-copy>p:not(.eyebrow){margin:0;font-size:16px;font-weight:700}
.confidence{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:700;margin-top:18px}.confidence>span:first-child{width:20px;height:20px;border-radius:50%;background:rgba(255,255,255,.2);display:grid;place-items:center}
.hero-mascot{position:absolute;z-index:1;right:5px;top:23px;width:155px;height:155px;object-fit:contain;filter:drop-shadow(0 15px 25px rgba(23,58,89,.14))}
.hero-button{position:absolute;z-index:3;left:22px;right:22px;bottom:18px;height:49px;border:0;border-radius:16px;background:#fff;color:#119c96;font-weight:900;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 8px 20px rgba(23,58,89,.12)}

.section-heading{display:flex;align-items:end;justify-content:space-between;margin:20px 3px 12px}.section-heading h2{margin:0;font-size:17px}.section-heading span{font-size:11px;color:var(--muted);font-weight:700}
.sensor-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.sensor-card{background:#fff;border:1px solid #edf4f4;border-radius:20px;padding:14px;display:grid;grid-template-columns:42px 1fr;gap:9px;min-height:112px;box-shadow:0 9px 25px rgba(27,77,92,.07)}
.sensor-icon{width:42px;height:42px;border-radius:50%;display:grid;place-items:center}.sensor-icon.teal{background:#dff7f4;color:var(--teal)}.sensor-icon.yellow{background:#fff4d6;color:var(--yellow)}.sensor-icon.blue{background:#e5f1fd;color:var(--blue)}.sensor-icon.mint{background:#e6f8ed;color:#4fbf78}
.sensor-copy{display:flex;flex-direction:column}.sensor-copy span{font-size:12px;color:var(--muted);font-weight:800}.sensor-copy strong{font-size:20px;line-height:1.1;margin:2px 0}.sensor-copy small{font-size:10px;color:#51b979;font-weight:800}
.mini-meter{grid-column:1/3;height:5px;border-radius:5px;background:#eef3f3;overflow:hidden}.mini-meter i,.large-meter i{display:block;height:100%;width:0;background:linear-gradient(90deg,#22bcb0,#69cf84);border-radius:inherit;transition:width .3s}.mini-meter.yellow i,.large-meter.yellow i{background:linear-gradient(90deg,#f2c44e,#f1a63b)}.mini-meter.blue i,.large-meter.blue i{background:linear-gradient(90deg,#68b7ea,#598be5)}.mini-meter.mint i,.large-meter.mint i{background:linear-gradient(90deg,#70cf90,#25b8aa)}
.tip-card,.privacy-note,.recommendation-card,.ai-insight-card{margin-top:13px;border-radius:20px;display:flex;align-items:center;gap:12px}
.tip-card{padding:14px;background:linear-gradient(100deg,#eafaf5,#f4fcf8)}.tip-icon{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#d5f4e7}.tip-card span,.recommendation-card span,.ai-insight-card span{font-size:11px;color:var(--teal);font-weight:900;text-transform:uppercase;letter-spacing:.4px}.tip-card p,.recommendation-card p,.ai-insight-card p{margin:2px 0 0;font-size:13px;line-height:1.35;font-weight:700}.headphones{font-size:30px;margin-left:auto}
.privacy-note{align-items:flex-start;padding:12px 14px;background:#fff;border:1px solid var(--line)}.privacy-note svg{color:#f0b43d;flex:0 0 auto}.privacy-note p{margin:0;font-size:11px;line-height:1.45;color:var(--muted)}

.page-title{margin:4px 2px 16px}.page-title h1{margin:1px 0 2px;font-size:30px;letter-spacing:-1px}.page-title p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}.page-kicker{color:var(--teal);font-size:10px;text-transform:uppercase;letter-spacing:.8px;font-weight:900}
.compact-status{min-height:145px;border-radius:24px;padding:20px;color:#fff;display:flex;justify-content:space-between;align-items:center;box-shadow:var(--shadow)}.compact-status span{font-size:11px;text-transform:uppercase;font-weight:900;opacity:.9}.compact-status strong{font-size:38px;display:block;line-height:1}.compact-status p{margin:6px 0 0;font-size:13px;font-weight:700}.compact-status img{width:110px;height:110px;object-fit:contain}
.camera-card{position:relative;height:245px;border-radius:24px;overflow:hidden;background:linear-gradient(135deg,#dff4f1,#c8e9e4);margin-top:13px}.camera-card video{width:100%;height:100%;object-fit:cover}.camera-card canvas{display:none}.camera-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#79aaa8;font-weight:800;gap:7px}.camera-placeholder svg{width:45px;height:45px}.scan-pill,.privacy-pill{position:absolute;top:12px;padding:7px 10px;border-radius:999px;font-size:10px;font-weight:900;background:rgba(255,255,255,.9);backdrop-filter:blur(8px)}.scan-pill{left:12px}.privacy-pill{right:12px;color:#258f86}
.action-row{display:grid;grid-template-columns:1.25fr 1fr .7fr;gap:8px;margin:12px 0}.action-row button{height:44px;border-radius:15px;border:0;font-size:12px;font-weight:900}.primary-action{background:linear-gradient(135deg,var(--teal),var(--green));color:#fff;display:flex;align-items:center;justify-content:center;gap:6px}.secondary-action{background:#edf8f5;color:#159e92}.ghost-action{background:#f2f5f6;color:#718596}
.reading-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.reading-card{background:#fff;border:1px solid #ebf2f2;border-radius:18px;padding:13px;box-shadow:0 8px 22px rgba(27,77,92,.06)}.reading-card>div:first-child{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:11px;font-weight:800}.reading-card>div svg{color:var(--teal)}.reading-card strong{display:block;font-size:21px;margin-top:5px}.reading-card small{color:#55b97b;font-weight:800;font-size:10px}.large-meter{height:5px;background:#edf3f3;border-radius:5px;margin-top:9px;overflow:hidden}
.recommendation-card{padding:14px;background:#eefaf6}.recommendation-icon{font-size:32px}

.profile-list{display:grid;gap:11px}.profile-card{background:#fff;border:1px solid #edf2f2;border-radius:20px;padding:15px;box-shadow:0 8px 22px rgba(27,77,92,.06)}.profile-heading{display:flex;align-items:center;gap:11px}.profile-heading>div:last-child{display:flex;flex-direction:column}.profile-heading strong{font-size:14px}.profile-heading span{font-size:11px;color:var(--teal);font-weight:900}
input[type=range]{width:100%;appearance:none;height:6px;border-radius:6px;background:linear-gradient(90deg,#19b8ab,#86d888);margin:17px 0 5px}input[type=range]::-webkit-slider-thumb{appearance:none;width:22px;height:22px;border-radius:50%;background:#fff;border:5px solid var(--teal);box-shadow:0 3px 8px rgba(23,58,89,.18)}
.range-labels{display:flex;justify-content:space-between;color:#91a0ab;font-size:9px;font-weight:800}
.preferences-card,.summary-card,.chart-card,.triggers-card{background:#fff;border:1px solid #edf3f3;border-radius:22px;padding:16px;margin-top:13px;box-shadow:0 8px 24px rgba(27,77,92,.06)}.preferences-card h2,.summary-card h2,.chart-card h2,.triggers-card h2{margin:0;font-size:16px}
.toggle-row{display:flex;justify-content:space-between;align-items:center;padding:13px 0;border-bottom:1px solid #edf2f2}.toggle-row:last-child{border-bottom:0}.toggle-row div{display:flex;flex-direction:column;max-width:78%}.toggle-row strong{font-size:13px}.toggle-row span{font-size:10px;color:var(--muted);line-height:1.35}.toggle-row input{display:none}.toggle-row i{width:42px;height:24px;border-radius:20px;background:#d7e2e3;position:relative}.toggle-row i:after{content:"";position:absolute;width:18px;height:18px;border-radius:50%;background:#fff;top:3px;left:3px;transition:.2s;box-shadow:0 2px 5px rgba(0,0,0,.15)}.toggle-row input:checked+i{background:linear-gradient(90deg,var(--teal),var(--green))}.toggle-row input:checked+i:after{left:21px}
.adapt-card{margin-top:13px;padding:17px;border-radius:22px;background:linear-gradient(120deg,#dff7ef,#effbf4);display:flex;align-items:center;overflow:hidden}.adapt-card span{font-size:20px;font-weight:900}.adapt-card p{font-size:12px;color:#4c6a72;line-height:1.4}.adapt-card small{color:#d59627;font-weight:900}.adapt-card img{width:125px;margin-left:auto}

.summary-heading,.chart-heading{display:flex;align-items:center;justify-content:space-between}.summary-heading button{border:0;background:#edf8f5;color:var(--teal);border-radius:12px;padding:7px 10px;font-size:10px;font-weight:900}.summary-grid{display:grid;grid-template-columns:repeat(3,1fr);margin-top:16px}.summary-grid>div{text-align:center;border-right:1px solid #edf2f2}.summary-grid>div:last-child{border:0}.summary-grid strong{display:block;font-size:26px}.summary-grid small{font-size:9px;color:var(--muted);font-weight:800}.status-dot{display:grid;place-items:center;margin:0 auto 5px;width:29px;height:29px;border-radius:50%;font-size:13px}.safe-dot{background:#dff7e9;color:#47b975}.calm-dot{background:#e6f1fd;color:#568fda}.exit-dot{background:#fff1d8;color:#e6a028}
.chart-heading span{font-size:9px;color:var(--muted)}.chart{height:150px;display:flex;align-items:end;gap:7px;margin-top:17px;padding:0 3px;border-bottom:1px solid #e8eeee;background:repeating-linear-gradient(to top,transparent 0 36px,#edf2f2 37px)}.chart-bar{flex:1;min-height:8px;border-radius:8px 8px 2px 2px;background:linear-gradient(180deg,#70cf8a,#20b6a9);transition:height .3s}.chart-bar.calm{background:linear-gradient(180deg,#f4cc55,#efa23a)}.chart-bar.exit{background:linear-gradient(180deg,#f18d76,#eb6369)}.chart-key{display:flex;gap:13px;justify-content:center;margin-top:10px;font-size:9px;color:var(--muted);font-weight:800}.chart-key span{display:flex;align-items:center;gap:4px}.chart-key i{width:7px;height:7px;border-radius:50%}.key-safe{background:var(--teal)}.key-calm{background:var(--yellow)}.key-exit{background:var(--red)}
.trigger-row{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid #edf2f2}.trigger-row:last-child{border:0}.trigger-row div:nth-child(2){display:flex;flex-direction:column}.trigger-row strong{font-size:13px}.trigger-row span{font-size:10px;color:var(--muted)}.trigger-row b{font-size:13px;color:var(--teal)}
.ai-insight-card{padding:14px;background:linear-gradient(115deg,#e6f9f2,#f5fcf8)}.ai-insight-card img{width:62px;height:62px;object-fit:contain}.ai-insight-card p{font-size:12px}

.bottom-nav{position:fixed;z-index:20;left:50%;bottom:0;transform:translateX(-50%);width:min(100%,460px);height:84px;padding:9px 13px calc(9px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(4,1fr);background:rgba(255,255,255,.96);border-top:1px solid #e8efef;box-shadow:0 -8px 30px rgba(25,76,91,.08);backdrop-filter:blur(14px)}
.nav-button{position:relative;border:0;background:transparent;color:#91a0aa;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:9px;font-weight:900}.nav-button svg{width:22px;height:22px}.nav-button.active{color:var(--teal)}.nav-button.active:after{content:"";position:absolute;bottom:0;width:28px;height:3px;border-radius:3px;background:linear-gradient(90deg,var(--teal),var(--green))}
dialog{width:min(88vw,380px);border:0;border-radius:26px;padding:25px;color:var(--navy);box-shadow:0 25px 80px rgba(23,58,89,.28)}dialog::backdrop{background:rgba(14,41,55,.38);backdrop-filter:blur(3px)}dialog>img{width:92px;display:block;margin:0 auto}dialog h2{text-align:center}dialog p{font-size:12px;line-height:1.5;color:#5f7584}dialog #closeHelp,dialog #closeInstall{position:absolute;right:14px;top:12px;border:0;background:#eef6f5;width:32px;height:32px;border-radius:50%;font-size:20px;color:var(--navy)}

@media(min-width:520px){body{padding:24px}.app{min-height:900px;border-radius:38px;border:9px solid #152535;overflow:hidden}.bottom-nav{bottom:24px;border-radius:0 0 29px 29px;width:442px}}
@media(max-width:360px){.hero-mascot{width:130px}.hero-copy{max-width:62%}.sensor-grid,.reading-grid{grid-template-columns:1fr}.mini-meter{grid-column:1/3}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

.scan-note{
  margin:-2px 3px 12px;
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
  text-align:center;
  font-weight:700;
}
.action-row.scanning{grid-template-columns:1fr}
.action-row.scanning .ghost-action{
  background:linear-gradient(135deg,#ef696d,#f08c78);
  color:#fff;
  box-shadow:0 8px 18px rgba(239,105,109,.22);
}

/* v3 Mobile/PWA refinements */
html { -webkit-text-size-adjust:100%; }
body { overscroll-behavior-y:contain; }
.app { padding-top:calc(18px + env(safe-area-inset-top)); padding-bottom:calc(112px + env(safe-area-inset-bottom)); }
.bottom-nav { min-height:calc(76px + env(safe-area-inset-bottom)); height:auto; padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
button { touch-action:manipulation; }
button:focus-visible, input:focus-visible { outline:3px solid #173a59; outline-offset:3px; }
.install-card { display:flex; gap:12px; align-items:center; margin-top:13px; background:#e9f8ff; border:1px solid #d5ecf7; border-radius:19px; padding:13px; }
.install-card strong {font-size:13px}
.install-card p {font-size:11px; color:var(--muted); margin:4px 0 10px; line-height:1.4}
.install-art {font-size:35px; flex:0 0 auto}
.install-action {border:0; color:white; background:#168f95; padding:11px 14px; border-radius:13px; font-size:11px; font-weight:900; width:100%;}
.prototype-note {margin:12px 4px 4px; font-size:10px; color:#607686; line-height:1.5;}
#installDialog .install-action {margin-top:8px}
#installDialog p {margin:12px 0}
@media (min-width:520px) { .app {padding-top:20px} }

.repeat-speech { border:1px solid #c6e7e4; background:#fff; color:#168f95; margin-top:9px; border-radius:10px; padding:8px 12px; font-size:11px; font-weight:800; }
.repeat-speech:disabled { opacity:.5; cursor:not-allowed; }

.hero.ready h1 { font-size:32px; letter-spacing:-.8px; }
.compact-status.ready strong { font-size:30px; }
.toggle-row { position:relative; }
.toggle-row input { display:block; position:absolute; width:1px; height:1px; opacity:0; left:0; bottom:15px; }
.toggle-row input:focus-visible+i { outline:3px solid #173a59; outline-offset:3px; }

/* v4 – user-adjustable scan window, personal feedback and real optional on-device vision */
.scan-progress{height:9px;border-radius:9px;background:#dcefea;overflow:hidden;margin:0 5px 8px}
.scan-progress>div{width:0;height:100%;border-radius:9px;background:linear-gradient(90deg,#20b5aa,#7bdc88);transition:width .2s linear}
.scan-stage{text-align:center;color:#538278;font-size:11px;margin:0 3px 14px;font-weight:800;min-height:17px}
.select-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 0;border-bottom:1px solid #edf2f2}
.select-row span{display:flex;flex-direction:column;gap:4px;max-width:54%}
.select-row strong{font-size:13px}.select-row small{font-size:10px;color:var(--muted);line-height:1.35}
.select-row select{max-width:45%;padding:9px 5px;border-radius:11px;background:#eff9f7;color:#164c51;border:1px solid #cee9e2;font-size:11px;font-weight:800}
.vision-card{padding:15px;background:#eff7ff;border:1px solid #d9eaf7;border-radius:19px;margin:12px 0;box-shadow:0 4px 16px rgba(27,77,92,.04)}
.vision-title{display:flex;justify-content:space-between;align-items:center;gap:6px}
.vision-title>span:first-child{color:#245d84;font-size:14px;font-weight:900}
.ai-pill{padding:5px 9px;background:#dfebfc;border-radius:999px;color:#3565a8;font-size:10px;font-weight:900}
.vision-card p{margin:10px 0;font-size:11px;color:#44677c;line-height:1.5}
.vision-card small{font-size:10px;color:#607c8e;line-height:1.4}
.vision-tags{display:flex;flex-wrap:wrap;gap:5px;margin:7px 0}
.vision-tags:empty{display:none}
.vision-tags span{border-radius:999px;background:#fff;padding:6px 9px;color:#27557f;font-size:11px;font-weight:800}
.feedback-card,.feedback-summary{margin-top:13px;background:#fff;border:1px solid #e1eded;border-radius:20px;padding:15px}
.feedback-card strong,.feedback-summary strong{font-size:13px}
.feedback-card p,.feedback-summary p{color:var(--muted);font-size:11px;line-height:1.5}
.feedback-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.feedback-actions button{min-height:42px;border-radius:12px;border:1px solid #a8d8ce;color:#197d79;background:#ebf9f5;font-weight:800;font-size:12px}
.feedback-actions button:disabled{opacity:.45;cursor:not-allowed}
#feedbackNote{font-size:10px;color:#5c7d89}
.insight-buttons{display:flex;gap:5px}.insight-buttons button{white-space:nowrap;font-size:10px}

.vision-suggestion:not(:empty){font-weight:700;color:#2f6684;background:#fff;padding:8px 10px;border-radius:11px;margin-top:8px}

/* v4.1 – practical strategies and consent-based feedback learning */
.strategy-section{margin-top:15px;background:#fff;border:1px solid #d6e9e6;border-radius:22px;padding:15px;box-shadow:0 8px 22px rgba(27,77,92,.05)}
.strategy-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.strategy-heading h2{font-size:17px;line-height:1.2;margin:4px 0}
.strategy-section>p,.profile-learn-intro{font-size:11px;line-height:1.5;color:#587585}
.learning-label{flex-shrink:0;padding:5px 9px;border-radius:99px;background:#e5f5f2;color:#1b7d78;font-size:10px;font-weight:900}
.strategy-list{display:grid;gap:9px;margin-top:13px}
.strategy-option{padding:12px;border:1px solid #e0eded;background:#f6fcfb;border-radius:15px}
.strategy-option strong{display:block;font-size:13px}
.strategy-option p{font-size:11px;line-height:1.45;color:#466b79;margin:6px 0}
.strategy-option small{font-size:10px;color:#397c7a}
.strategy-actions{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.strategy-actions button{border:1px solid #bedfdb;color:#13766e;background:#fff;border-radius:11px;min-height:36px;padding:7px 12px;font-size:11px;font-weight:900}
.strategy-actions button:disabled{opacity:.55;cursor:not-allowed}
.strategy-note{border-top:1px solid #e2eeee;padding-top:9px;margin:13px 0 0!important;font-size:10px!important}
.profile-learn-intro{margin:12px 0 4px}
.memory-actions{display:flex;gap:10px;align-items:center;justify-content:space-between;padding-top:13px}
.memory-actions button,.memory-export{border:1px solid #badbd5;background:#eef9f5;color:#176a67;padding:8px 9px;border-radius:10px;font-size:10px;font-weight:900;flex-shrink:0}
.memory-actions span{color:#587585;font-size:10px;line-height:1.3;text-align:right}
.memory-export{margin-top:5px}
@media(max-width:360px){.strategy-heading{align-items:start}.learning-label{font-size:9px}}


/* Budd-Ai v5: sensory-first layout; large, accessible choices and quiet visual treatment. */
.v5-quick-actions,.v5-panel,.v5-context-summary{background:#fff;border:1px solid #dbece9;border-radius:20px;padding:16px;margin:14px 0;box-shadow:0 6px 20px rgba(27,77,92,.04)}
.v5-quick-heading{display:flex;justify-content:space-between;gap:10px;align-items:baseline;flex-wrap:wrap}
.v5-quick-heading strong{font-size:15px}.v5-quick-heading small{font-size:11px;color:#376f75;font-weight:800}
.v5-quick-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.v5-quick-buttons button,.v5-context-summary button{border:1px solid #a8dcd4;background:#edf9f5;color:#165f64;border-radius:12px;font-size:12px;font-weight:900;min-height:47px;padding:9px 7px}
.v5-quick-actions p,.v5-panel p,.v5-context-summary p,.v5-profile-context>p{font-size:12px;line-height:1.55;color:#526f7d;margin:9px 0}
.v5-context-summary{display:flex;align-items:center;justify-content:space-between;gap:8px}
.v5-context-summary strong{font-size:13px}.v5-context-summary p{margin:3px 0 0}.v5-context-summary button{min-height:40px;padding:8px 12px}
.v5-panel h2{font-size:17px;margin:4px 0 12px}.v5-panel h3{font-size:13px;margin:17px 0 9px}.v5-panel h3 small{font-size:10px;color:#587585}
.v5-feelings{display:grid;grid-template-columns:1fr;gap:8px}
.v5-feelings button{min-height:53px;border:2px solid #d6eae6;border-radius:13px;background:#f8fcfb;color:#214b58;font-size:14px;text-align:left;padding:10px 15px;font-weight:800}
.v5-feelings button[aria-pressed="true"]{background:#d8f6ee;border-color:#118f87;color:#114d49}
.v5-triggers{display:flex;flex-wrap:wrap;gap:9px}
.v5-triggers label{display:flex;align-items:center;gap:6px;padding:11px 12px;border:1px solid #cfe5e1;border-radius:11px;background:#f7fcfa;font-size:12px;font-weight:800;line-height:1.3;cursor:pointer;min-height:43px}
.v5-triggers input{accent-color:#108b82;width:18px;height:18px}
.v5-primary{width:100%;margin-top:13px;padding:13px 14px;border:0;background:#158e86;color:white;font-size:13px;font-weight:900;border-radius:13px;min-height:47px}
.v5-hint{font-size:11px!important;color:#4e737c!important;line-height:1.5!important}
.v5-communication{background:#f2faf8}.v5-communication-preview{background:white;border:1px solid #daece8;border-radius:13px;padding:14px;font-size:16px;font-weight:800;line-height:1.45;overflow-wrap:anywhere}
.v5-driver-gate{background:#fff3df;border:2px solid #dbad5b;border-radius:16px;padding:14px;margin:12px 0;color:#583c17}
.v5-driver-gate strong{font-size:14px}.v5-driver-gate p{font-size:12px;line-height:1.5;margin:6px 0}.v5-driver-gate label{font-size:12px;font-weight:900;display:flex;align-items:center;gap:10px;line-height:1.45}
.v5-driver-gate input{min-width:21px;min-height:21px;accent-color:#9e701e}
.v5-field{display:flex;flex-direction:column;gap:6px;margin-top:15px}
.v5-field>span{font-size:12px;font-weight:900;color:#274b5a}
.v5-field select,.v5-field textarea{width:100%;padding:12px;border-radius:12px;background:#f6fbfa;border:1px solid #bcdad5;color:#244758;font-size:14px;line-height:1.4}
.v5-field textarea{resize:vertical;min-height:95px}
.v5-erase,.v5-diary-actions button{border:1px solid #bddbd5;border-radius:10px;background:#f1f9f6;color:#286a63;padding:9px 10px;font-size:11px;font-weight:900;margin-top:12px}
.v5-diary-actions{display:flex;flex-wrap:wrap;gap:8px}
.v5-diary-actions .memory-export{margin-top:12px}
.bottom-nav{grid-template-columns:repeat(5,1fr);gap:2px;padding-left:7px;padding-right:7px}
.nav-button{font-size:9px}.nav-button svg{height:21px;width:21px}
.hero.safe h1,.hero.calm h1,.hero.exit h1{font-size:28px;letter-spacing:-.7px;line-height:1.05;overflow-wrap:break-word}
.compact-status.safe strong,.compact-status.calm strong,.compact-status.exit strong{font-size:25px;line-height:1.05;overflow-wrap:anywhere}
#communicationDialog{width:min(95vw,430px);max-width:430px;max-height:85vh;padding:25px 20px;text-align:center;border-radius:24px}
#communicationDialog h2{font-size:22px;margin-top:24px}
#communicationDialogText{font-size:clamp(21px,6vw,30px);font-weight:900;color:#183e4a;line-height:1.4;overflow-wrap:anywhere;white-space:pre-wrap}
#communicationDialog .v5-primary{max-width:250px;margin:18px auto 0}
#closeCommunication{position:absolute;right:10px;top:10px;border:0;background:#edf6f5;border-radius:50%;width:39px;height:39px;font-size:23px;color:#244d5b}
@media(max-width:360px){.v5-quick-buttons{grid-template-columns:1fr}.hero.safe h1,.hero.calm h1,.hero.exit h1{font-size:24px}.nav-button{font-size:8px}}

/* Version 5.1: no flashy indicators, readable optional sound-ML information. */
.audio-ai-card {background:#f9fcfd;border:1px solid #d9eef0;}
.audio-ai-card small {display:block;color:#607e88;line-height:1.55;margin-top:6px;}
.audio-ai-card .vision-tags {margin-top:8px;}
@media (prefers-reduced-motion:reduce) { .screen{animation:none} *{scroll-behavior:auto!important;transition:none!important;} }

/* 5.2 - structured, low-stimulation, meaningful personal support. */
.support-response{background:#fff;border:1px solid #cfe5e1;border-radius:20px;padding:17px;margin:15px 0;box-shadow:0 6px 20px rgba(27,77,92,.04)}
.support-response h2{font-size:18px;line-height:1.3;margin:5px 0 14px;color:#214956}
.support-response-item{border-left:3px solid #abdcd4;padding:4px 10px;margin:13px 0;background:#f8fcfb;border-radius:0 9px 9px 0}
.support-response-item strong{font-size:12px;color:#225d63}
.support-response-item p{font-size:13px;line-height:1.65;color:#355965;margin:5px 0 3px;overflow-wrap:anywhere}
.support-message-action{display:block;width:100%;margin:13px 0 9px;background:#e5f6f1;border:1px solid #b8dad1;border-radius:12px;min-height:44px;padding:10px;color:#125f5b;font-size:13px;font-weight:800}
.support-response small{font-size:11px;line-height:1.6;color:#577680;display:block}

/* 5.2.1 – real-time sensor readings are separate from published 30s results */
.live-sensor-note{margin:11px 2px 8px;padding:10px 12px;border-radius:11px;background:#ecf8f5;border:1px solid #d7ece6;color:#346f6a;font-size:11px;line-height:1.5;font-weight:650}
