:root{
  --ink:#162820;--muted:#63736a;--darkgreen:#1d7050;--green:#267950;--accent:#168d5d;--page:#edf3ee;--white:#fff;
  --line:#e0e9e1;--soft:#e7f1e9;--warn:#aa6620;--bad:#ba473f;--info:#317390;
  --glass:rgba(255,255,255,.85);--cardshadow:0 15px 38px rgba(36,70,42,.065);--r:26px;
  --nav-height:84px;--top-inset:max(env(safe-area-inset-top,0px),14px);--bottom-inset:env(safe-area-inset-bottom,0px);
  font-family:-apple-system,BlinkMacSystemFont,'SF Pro Display','Segoe UI',Arial,sans-serif;color:var(--ink)
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--page)}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #55af83;outline-offset:2px}button{border:0}h1,h2,h3,p{margin:0}small{font-size:12px}svg{display:block;flex-shrink:0}.icon{display:inline-flex;align-items:center;justify-content:center}.app{display:flex;min-height:100dvh}.shell{width:100%;min-width:0;min-height:100dvh;position:relative;background:var(--page)}.content{min-height:100dvh;position:relative;overflow-x:hidden;padding-bottom:calc(var(--nav-height) + 39px + var(--bottom-inset));}.content.is-home{background:#e9f0e5 url('assets/botanical.jpg') center top/100% auto no-repeat}.content.is-home:before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(244,250,246,.3) 65%,rgba(242,247,243,.25));}.screen{position:relative;z-index:1;max-width:680px;margin:auto;padding:calc(var(--top-inset) + 10px) 16px 30px;}.home-screen{padding-top:calc(var(--top-inset) + 3px)}.glass{background:var(--glass);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);box-shadow:var(--cardshadow);border:1px solid rgba(255,255,255,.78)}.card{background:var(--white);border:1px solid #e3e9e3;border-radius:var(--r);box-shadow:0 8px 22px rgba(24,52,33,.045)}.btn-primary{background:#227351;color:white;padding:12px 17px;border-radius:16px;font-weight:700;display:inline-flex;align-items:center;gap:7px;justify-content:center}.btn-secondary{background:#eaf1ec;color:var(--ink);padding:11px 14px;border-radius:15px;font-weight:650;border:1px solid #d6e1d8;display:inline-flex;gap:7px;align-items:center;justify-content:center}.btn-ghost{background:transparent;color:var(--green);padding:9px 0;font-weight:650;display:inline-flex;align-items:center;gap:4px}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:43px;height:43px;border-radius:15px;background:#edf4ef;color:#394e44;flex-shrink:0}.muted{color:var(--muted)}.mini-kicker{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#7b897e;font-weight:700}.section-title{font-size:19px;letter-spacing:-.04em;font-weight:780}.screen-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:9px 0 19px}.screen-header h1{font-size:30px;letter-spacing:-.055em;line-height:1.08}.screen-header .subtitle{color:var(--muted);margin-top:5px;font-size:14px}.block-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 2px 12px}.block-heading h2{font-size:19px;letter-spacing:-.045em}.badge{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:6px 10px;font-size:12px;font-weight:700;border-radius:999px;background:#eaf2ec;color:#466a54;white-space:nowrap}.badge.warning{background:#fff0df;color:#a76319}.badge.danger{background:#fce9e6;color:#b54038}.badge.info{background:#eaf2f8;color:#356c88}.badge.good{background:#e0f2e6;color:#25794d}.badge.ghost{background:#f1f4f1;color:#6c7a70}.inline-badges{display:flex;flex-wrap:wrap;gap:5px;align-items:center}.count{min-width:24px;height:24px;border-radius:30px;background:#fdf0e4;color:#be6b19;font-size:12px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;font-weight:750}.tap-row{width:100%;display:flex;align-items:center;gap:12px;text-align:left;background:white;border:1px solid #e4ece5;padding:15px;border-radius:20px;color:var(--ink)}.tap-row>span:nth-child(2){flex:1;min-width:0}.tap-row strong{display:block;font-size:15px}.tap-row small{display:block;color:var(--muted);margin-top:3px}.row-list{display:grid;gap:9px}.divider{height:1px;background:var(--line);margin:12px 0}.fineprint{font-size:12px;color:var(--muted);line-height:1.4}.hidden{display:none!important}
/* Home */
.hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(116px,39%);gap:12px;align-items:stretch;margin:0 0 17px}.hero-text{display:flex;flex-direction:column;justify-content:space-between;min-width:0;padding:7px 0 5px}.hero-text p{font-size:clamp(20px,5.8vw,29px);line-height:1.08;color:#50645b;font-weight:450;letter-spacing:-.042em}.hero-text h1{font-size:clamp(33px,9vw,48px);letter-spacing:-.072em;line-height:1.02;overflow-wrap:anywhere}.camera-widget{aspect-ratio:1;min-width:0;width:100%;border-radius:24px;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:17px 5px 15px;position:relative;touch-action:pan-y;gap:17px;color:var(--ink);transition:transform .15s}.camera-widget:active{transform:scale(.985)}.camera-symbol{display:grid;place-items:center;width:78px;height:65px}.camera-symbol .icon svg{width:56px;height:56px}.camera-symbol morph-icon{display:block;width:56px;height:56px}.camera-indicators{display:flex;align-items:center;gap:11px;height:11px}.camera-indicators i{width:21px;height:4px;border-radius:8px;background:#8e9b90;transition:background .2s,width .2s,height .2s}.camera-indicators i.current{width:10px;height:10px;background:#267d52}.assistant-box{width:100%;height:58px;border-radius:22px;display:flex;align-items:center;gap:12px;padding:0 17px;text-align:left;color:#596b61;margin-bottom:17px}.assistant-box .placeholder{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.assistant-box input{border:0;outline:0;min-width:0;flex:1;background:transparent;color:var(--ink);font-size:16px}.assistant-box:focus-within{box-shadow:0 0 0 2px #7bbd92,0 12px 25px #1c4f2c14}.assist-submit{background:var(--green);border-radius:12px;color:white;height:36px;width:36px;display:grid;place-items:center;flex-shrink:0}.overview{width:100%;border-radius:26px;padding:22px 18px 18px;text-align:left;color:var(--ink);margin:0 0 24px}.overview-top{display:flex;gap:12px;align-items:center;min-height:77px;position:relative;padding-right:32px}.overview-number{font-size:75px;letter-spacing:-.095em;font-weight:740;line-height:1}.overview-label{font-size:17px;color:#52665a;font-weight:620;line-height:1.16}.overview-chevron{position:absolute;right:0;top:5px;color:#57655b}.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:17px}.stat{min-width:0;display:flex;flex-direction:column;justify-content:center;background:rgba(255,255,255,.54);border-radius:17px;padding:13px 9px 12px;min-height:79px}.stat-val{display:flex;gap:5px;align-items:center;font-size:26px;letter-spacing:-.05em;font-weight:750}.dot{width:9px;height:9px;border-radius:50%;display:inline-block;background:#328653;flex-shrink:0}.dot.warning{background:#bf7b29}.dot.danger{background:#b94742}.stat-name{font-size:11px;color:#5d7063;line-height:1.25;margin-top:4px;white-space:nowrap}.state-panel{border-radius:25px;padding:15px 12px 14px}.state-head{display:flex;align-items:center;justify-content:space-between;gap:9px;margin:0 4px 11px}.state-head h2{font-size:18px;letter-spacing:-.04em}.state-open{display:flex;align-items:center;gap:4px;color:var(--green);background:#e6f2e8;border-radius:13px;padding:9px 10px;font-size:12px;font-weight:720;max-width:185px;text-align:left;transition:background .2s,transform .2s}.state-open:active{transform:scale(.96)}.state-open.is-flashing{animation:transitionFlash .38s ease}.state-open span{min-width:0}.segmented{display:grid;grid-template-columns:1fr 1fr;background:#e8efea;padding:4px;gap:3px;border-radius:15px;min-height:43px}.segment{border-radius:11px;background:transparent;color:#5c6d60;font-size:12px;font-weight:720;padding:8px 3px;white-space:nowrap;letter-spacing:-.02em;transition:background .2s,color .2s,box-shadow .2s}.segment.active{background:white;color:#155e41;box-shadow:0 2px 8px #0000000b}.state-list{margin-top:11px;display:grid;gap:9px}.attention-item{width:100%;border-radius:19px;background:rgba(255,255,255,.91);border:1px solid rgba(255,255,255,.8);padding:12px;display:flex;align-items:center;gap:11px;text-align:left;color:var(--ink)}.med-picto{border-radius:15px;width:52px;height:52px;background:#e9f0eb;display:grid;place-items:center;color:#547467;flex-shrink:0}.med-picto .icon svg{width:27px;height:27px}.attention-content{min-width:0;flex:1;display:grid;gap:4px}.attention-content strong{font-size:15px;letter-spacing:-.025em}.attention-content small{font-size:12px;color:#65766b;line-height:1.35}.empty-state{text-align:center;padding:29px 16px;border-radius:20px;background:rgba(255,255,255,.88)}.empty-state>.icon{color:var(--green);margin:auto auto 10px}.empty-state strong{display:block;font-size:16px}.empty-state p{color:var(--muted);font-size:13px;line-height:1.45;margin-top:5px}.state-switch-note{margin:8px 2px 1px;color:#6a806c;font-size:11px}
/* Catalog */
.catalog-search{display:flex;align-items:center;gap:10px;background:white;border:1px solid #dfebe2;border-radius:18px;padding:0 12px;height:52px;margin-bottom:12px}.catalog-search input{width:100%;border:0;outline:0;background:transparent;min-width:0;color:var(--ink);font-size:15px}.catalog-segments{display:grid;grid-template-columns:.64fr 1.45fr 1.35fr;gap:5px;background:#e5ede7;border-radius:18px;padding:5px;margin-bottom:11px}.catalog-segments button{padding:10px 4px;font-size:12px;font-weight:725;background:transparent;color:#586a5f;border-radius:13px;white-space:nowrap}.catalog-segments button.active{background:white;color:#176743;box-shadow:0 2px 10px #0000000a}.catalog-info{display:flex;justify-content:space-between;align-items:center;gap:5px;margin-bottom:15px}.catalog-info small{color:#738174}.catalog-list{display:grid;gap:12px}.medicine-tile{padding:16px 15px;display:grid;gap:12px;width:100%;text-align:left;color:var(--ink)}.tile-row{display:flex;align-items:flex-start;gap:12px}.tile-name{flex:1;min-width:0}.tile-name strong{font-size:18px;line-height:1.25;letter-spacing:-.035em;display:block}.tile-meta{font-size:13px;line-height:1.43;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:4px}.tile-bottom{display:flex;gap:12px;justify-content:space-between;align-items:center;flex-wrap:wrap;padding-left:64px;font-size:13px}.tile-bottom b{font-weight:780}.tile-bottom span{color:#637267}.pill-strong{font-weight:760;color:var(--ink)}.tile-reasons{padding-left:64px}.tile-reasons .badge{white-space:normal;text-align:left;font-size:11px}.filter-count{position:relative;flex-shrink:0}.filter-count em{position:absolute;right:-4px;top:-6px;background:#cc7a38;color:white;border-radius:9px;padding:1px 5px;font-size:10px;font-style:normal}.control-row{display:flex;gap:9px}.control-row>*:first-child{flex:1;min-width:0}.control-row input{flex:1}.filter-summary{background:#e9f2eb;border-radius:13px;padding:9px 12px;margin-bottom:11px;font-size:12px;color:#366549;display:flex;align-items:center;justify-content:space-between;gap:10px}
/* Navigation */
.bottom-nav{position:fixed;z-index:20;bottom:calc(6px + var(--bottom-inset));left:10px;right:10px;height:var(--nav-height);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;align-items:center;padding:7px 6px;border-radius:25px;background:rgba(255,255,255,.91);border:1px solid rgba(255,255,255,.91);-webkit-backdrop-filter:blur(22px);backdrop-filter:blur(22px);box-shadow:0 11px 31px rgba(20,54,35,.16)}.nav-item{position:relative;display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;background:transparent;color:#5c6c62;font-size:11px;font-weight:590;min-width:0;height:68px;padding:5px 0;border-radius:17px}.nav-icon{min-width:52px;height:35px;border-radius:16px;display:grid;place-items:center}.nav-icon .icon svg{width:25px;height:25px}.nav-item.active{color:#20754e;font-weight:760}.nav-item.active .nav-icon{background:#dff2e6;box-shadow:inset 0 0 0 1px #aedbbd}.notify-badge{position:absolute;top:0;left:calc(50% + 12px);font-size:10px;font-weight:800;min-width:19px;height:19px;padding:0 4px;border-radius:15px;display:grid;place-items:center;background:#bd403e;color:#fff;border:2px solid white}.desktop-sidebar{display:none}
/* Chat */
.chat-history{display:grid;gap:12px;padding:7px 0 15px}.chat-message{max-width:88%;border-radius:19px;padding:12px 15px;font-size:14px;line-height:1.5;box-shadow:0 5px 16px rgba(23,56,34,.05)}.chat-message.assistant{justify-self:start;background:white;border-bottom-left-radius:6px}.chat-message.user{justify-self:end;background:#d9efe0;border-bottom-right-radius:6px}.chat-message .byline{font-size:11px;color:#669075;margin-bottom:5px;font-weight:730}.chat-prompt-list{display:flex;gap:8px;overflow-x:auto;padding:4px 0 8px;scrollbar-width:none}.chat-prompt-list button{background:white;border:1px solid #dce7df;padding:10px 13px;white-space:nowrap;border-radius:14px;color:#42634d;font-size:12px}.chat-composer{display:flex;gap:9px;align-items:flex-end;position:sticky;bottom:calc(var(--nav-height) + 22px);z-index:3;padding:9px;background:rgba(246,250,247,.97);border-radius:22px;border:1px solid var(--line);box-shadow:0 4px 30px #204b2618}.chat-composer input{resize:none;flex:1;min-width:0;max-height:120px;height:40px;padding:11px 12px;border:0;background:transparent;outline:none;font-size:14px}.chat-composer button{height:40px;width:42px;border-radius:14px;background:var(--green);color:white;display:grid;place-items:center}
/* Profile */
.profile-banner{padding:16px;display:flex;gap:13px;align-items:center;margin-bottom:16px}.avatar{height:52px;width:52px;border-radius:17px;background:#d7ebe0;display:grid;place-items:center;color:#23714b;font-size:23px;font-weight:730;flex-shrink:0}.profile-banner strong{font-size:18px}.profile-banner small{color:var(--muted);display:block;margin-top:3px}.list-section{margin-bottom:20px}.list-section h2{font-size:17px;margin:0 2px 10px;letter-spacing:-.035em}.family-member{display:flex;gap:12px;align-items:center;padding:13px}.family-member .avatar{height:42px;width:42px;font-size:15px;border-radius:14px}.family-member>div:nth-child(2){flex:1}.family-member strong{display:block}.family-member small{color:var(--muted)}
/* Overlays and sheets */
.overlay-backdrop{position:fixed;inset:0;z-index:50;background:rgba(12,30,22,.42);display:flex;align-items:flex-end;justify-content:center;animation:fadeIn .17s ease}.sheet{width:100%;max-width:640px;max-height:calc(100dvh - 35px);min-height:220px;background:#f8fbf8;border-radius:27px 27px 0 0;display:flex;flex-direction:column;box-shadow:0 -20px 80px #0c26152c;animation:sheetIn .23s ease;overflow:hidden}.sheet-handle{width:39px;height:5px;border-radius:20px;background:#d1d8d2;margin:8px auto 6px;flex-shrink:0}.sheet-header{padding:15px 19px 14px;display:flex;align-items:flex-start;gap:11px;justify-content:space-between;border-bottom:1px solid #e6ebe5}.sheet-header h2{font-size:22px;letter-spacing:-.05em}.sheet-header p{font-size:13px;color:var(--muted);margin-top:5px;line-height:1.4}.sheet-content{overflow-y:auto;overscroll-behavior:contain;padding:17px 18px calc(24px + var(--bottom-inset));display:grid;gap:17px}.field{display:grid;gap:7px}.field label{font-size:13px;font-weight:700;color:#4f6657}.field input,.field textarea,.field select{border:1px solid #d8e5da;background:white;border-radius:14px;padding:12px 13px;width:100%;min-height:45px;color:var(--ink)}.field textarea{min-height:85px;resize:vertical}.sheet-actions{display:flex;gap:9px;position:sticky;bottom:0;background:#f8fbf8;padding:11px 17px calc(11px + var(--bottom-inset));box-shadow:0 -8px 20px #00000008}.sheet-actions button{flex:1}.sheet-subtabs{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;background:#ebf2ed;padding:4px;border-radius:14px}.sheet-subtabs button{padding:9px 1px;font-size:11px;border-radius:10px;color:#617366;background:transparent}.sheet-subtabs button.active{background:white;color:#246b48;box-shadow:0 1px 8px #00000008;font-weight:750}.form-note{background:#eaf3ec;padding:12px;border-radius:14px;color:#496c53;font-size:12px;line-height:1.45}.danger-note{background:#fff0ec;color:#a0453d}.visual-camera{min-height:210px;background:#142b24;color:#c1e9d1;border-radius:23px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;padding:20px}.visual-camera .icon svg{width:58px;height:58px}.gallery-thumbs{display:flex;gap:8px;flex-wrap:wrap}.photo-thumb{background:#e3f1e6;width:66px;height:66px;border-radius:13px;display:grid;place-items:center;position:relative;border:1px solid #badac5;color:#478160}.photo-thumb button{position:absolute;right:-4px;top:-7px;border-radius:50%;height:22px;width:22px;background:#fff;color:#365e49;border:1px solid #dae4da}.steps{display:flex;gap:8px;flex-wrap:wrap}.step-chip{background:#e4efe7;border-radius:12px;padding:7px 9px;font-size:12px;color:#376849}.setting-row{display:flex;align-items:center;gap:12px;justify-content:space-between;min-height:52px}.setting-row>div:first-child{flex:1}.setting-row small{display:block;color:var(--muted);margin-top:3px;line-height:1.35}.switch{width:44px;height:26px;border-radius:20px;background:#becdc1;position:relative;display:block;transition:background .2s}.switch.on{background:#2a8b5b}.switch:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:white;transition:left .2s}.switch.on:after{left:21px}.slider{accent-color:#217e53;width:100%}.source-box{padding:14px;border:1px solid #e2ebe3;border-radius:18px;background:white}.source-box h3{font-size:15px;margin-bottom:5px}.source-box p{font-size:13px;color:#697a6b;line-height:1.45}.note-small{font-size:12px;color:#647b69}.qa-panel{position:fixed;z-index:24;top:calc(var(--top-inset) + 2px);right:12px}.qa-toggle{background:#183e2f;color:white;padding:6px 10px;border-radius:12px;font-size:10px;box-shadow:0 4px 12px #143e2740;opacity:.76}.qa-menu{position:absolute;top:32px;right:0;background:white;border:1px solid #dce4da;padding:12px;border-radius:16px;width:220px;box-shadow:0 15px 45px #163a2730}.qa-menu>strong{font-size:13px}.qa-menu select{width:100%;margin:9px 0;background:#f3f8f4;border:1px solid #dce3dc;padding:8px;border-radius:10px}.qa-menu p{font-size:11px;color:#667a69;line-height:1.4}.toast{position:fixed;bottom:calc(var(--nav-height) + var(--bottom-inset) + 24px);left:50%;transform:translateX(-50%);z-index:100;background:#173d2b;color:white;padding:11px 17px;border-radius:16px;box-shadow:0 9px 30px #143e2740;font-size:13px;white-space:nowrap;max-width:90vw;animation:fadeIn .15s ease}.preview-label{position:absolute;right:18px;top:0;background:#2a6c51;color:white;border-radius:0 0 12px 12px;padding:4px 9px;font-size:10px;font-weight:750}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes sheetIn{from{transform:translateY(25px);opacity:.8}to{transform:translateY(0);opacity:1}}@keyframes transitionFlash{0%{background:#d1efe0;transform:scale(.97)}100%{background:#e6f2e8;transform:scale(1)}}
@media(max-width:359px){.screen{padding-left:12px;padding-right:12px}.hero{grid-template-columns:minmax(0,1fr) 38%;gap:8px}.hero-text p{font-size:19px}.hero-text h1{font-size:33px}.state-head h2{font-size:16px}.state-open{font-size:11px;padding:8px}.stat-name{font-size:10px}.catalog-segments button{font-size:11px}.nav-item{font-size:10px}}
@media(min-width:800px){.app{background:linear-gradient(130deg,#e7efe8,#f5f7f1)}.desktop-sidebar{display:flex;position:fixed;top:0;bottom:0;width:246px;flex-direction:column;background:rgba(255,255,255,.94);border-right:1px solid #dae4dc;padding:28px 16px;gap:5px;z-index:10}.desktop-sidebar .brand{display:flex;align-items:center;gap:11px;font-size:17px;font-weight:800;margin-bottom:28px;color:#23553c}.sidebar-item{padding:13px 15px;display:flex;align-items:center;gap:13px;border-radius:14px;background:transparent;text-align:left;color:#647167;font-weight:650}.sidebar-item.active{background:#e3f1e7;color:#1c7548}.shell{margin-left:246px}.bottom-nav{display:none}.content{padding-bottom:45px}.screen{max-width:850px;padding:37px 32px 60px}.home-screen{max-width:650px}.qa-panel{right:16px}.sheet{border-radius:28px;margin:auto;max-height:88dvh}.overlay-backdrop{align-items:center}.sheet-actions{padding-bottom:13px}.chat-composer{bottom:25px}.hero{grid-template-columns:minmax(0,1fr) 155px}.hero-text p{font-size:27px}.hero-text h1{font-size:44px}}
@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* Unified Botanical Glass design language: every tab, detail, dialog and nested sheet. */
:root{--nav-height:70px;--r:24px;--glass:rgba(255,255,255,.84);--shadow:0 12px 34px rgba(26,63,36,.09)}
html{scrollbar-gutter:stable}
.shell{background:#eaf1e9}
.content{background:linear-gradient(180deg,rgba(241,247,240,.26) 0%,rgba(240,246,239,.65) 28%,rgba(238,245,240,.91) 82%),url('assets/botanical.jpg') center top/100% auto no-repeat,#eaf1e9;padding-bottom:calc(var(--nav-height) + var(--bottom-inset) + 30px);}
.content.is-home{background:linear-gradient(180deg,rgba(248,250,245,.04),rgba(243,250,244,.15) 52%,rgba(237,244,239,.5)),url('assets/botanical.jpg') center top/100% auto no-repeat,#e9f0e5}
.screen{padding-top:calc(var(--top-inset) + 10px)}
.home-screen{padding-top:calc(var(--top-inset) + 4px)}
.card,.source-box,.tap-row,.profile-banner,.chat-message.assistant,.sheet{background:rgba(255,255,255,.88);-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);border-color:rgba(255,255,255,.8);box-shadow:0 10px 29px rgba(30,74,48,.065)}
.source-box{border-radius:19px}
.tap-row{box-shadow:0 7px 20px #1b51300c}
.glass{box-shadow:var(--shadow)}
.sheet{background:rgba(248,251,248,.98)}
.sheet-header,.sheet-actions{background:rgba(248,251,248,.97)}
.bottom-nav{height:var(--nav-height);bottom:calc(7px + var(--bottom-inset));border-radius:23px;padding:4px 6px;box-shadow:0 9px 28px #1e3e2630}
.nav-item{height:60px;padding:3px 0;font-size:11px;gap:2px}
.nav-icon{height:32px}.nav-icon .icon svg{width:23px;height:23px}
.nav-item.active .nav-icon{background:#e0f3e8}
.notify-badge{top:-1px}
.camera-symbol .icon svg{width:63px;height:63px}
.camera-symbol morph-icon{width:64px;height:64px}
.icon-switched{animation:iconChange .2s ease}
@keyframes iconChange{0%{opacity:.35;transform:scale(.9)}100%{opacity:1;transform:scale(1)}}
.assist-submit{opacity:0;pointer-events:none;transform:scale(.9);transition:transform .18s,opacity .18s}
.assistant-box:focus-within .assist-submit,.assistant-box.has-text .assist-submit{opacity:1;pointer-events:auto;transform:scale(1)}
.camera-widget{touch-action:pan-y}
.state-list{touch-action:pan-y}
.state-open{min-width:129px;justify-content:center}
.state-open span{white-space:normal}
.state-open.is-flashing{animation:transitionFlash .37s ease}
.state-panel{background:rgba(255,255,255,.78)}
.state-panel .attention-item{background:rgba(255,255,255,.9)}
.attention-item:hover,.tap-row:hover,.medicine-tile:hover{box-shadow:0 11px 30px #143e261c}
/* Forms and all nested detail screens */
.detail-summary{display:flex;align-items:flex-start;gap:12px;padding:4px 0 6px}
.detail-summary .large{width:70px;height:70px;border-radius:19px}
.detail-summary>div{min-width:0;flex:1}.detail-summary h3{font-size:20px;letter-spacing:-.045em;line-height:1.1}.detail-summary p{margin-top:6px;font-size:13px;color:var(--muted);line-height:1.4}
.detail-tab-panel{display:grid;gap:13px}.detail-tab-panel .source-box{width:100%}
.issue-line{padding:10px 0;border-bottom:1px solid #e7ede8;display:grid;gap:6px}
.issue-line:last-child{border-bottom:0;padding-bottom:0}
.issue-line p{font-size:13px;color:#68796d;line-height:1.45}
.summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.summary-grid .source-box{min-width:0}.summary-grid .source-box h3{font-size:17px;margin-top:5px;overflow-wrap:anywhere}
.filter-list{display:grid;gap:4px;margin-top:10px}
.check-row{display:flex;align-items:center;gap:10px;padding:9px 3px;line-height:1.3;font-size:14px;color:#365245;cursor:pointer}
.check-row input{accent-color:#238453;width:19px;height:19px;flex-shrink:0}
.instruction-section{background:rgba(255,255,255,.92);border:1px solid #e1e9e0;border-radius:17px;overflow:hidden;padding:0 13px}
.instruction-section summary{list-style:none;display:flex;align-items:center;justify-content:space-between;padding:13px 0;font-weight:690;cursor:pointer}
.instruction-section summary::-webkit-details-marker{display:none}
.instruction-section[open] summary .icon{transform:rotate(90deg)}
.instruction-section p{line-height:1.5;font-size:13px;color:var(--muted);padding-bottom:8px}
.instruction-section button{margin-bottom:6px}
.select-field{width:100%;border:1px solid var(--line);background:white;border-radius:12px;padding:12px}
.source-box .field{margin-top:10px}
.sheet-content .control-row{align-items:center}
.sheet-content .control-row>*:first-child{flex:1;min-width:0}
.sheet-content .control-row .field{flex:2;min-width:80px}
.sheet-content .control-row>button{white-space:nowrap}
.screen-header .btn-primary{flex-shrink:0}
.has-overlay{overflow:hidden}
.screen-header .subtitle{line-height:1.35}
.profile-screen .tap-row strong{font-size:15px}
.profile-screen .list-section{margin-top:18px}
.profile-screen .row-list{gap:9px}
.profile-screen .tap-row{border-radius:20px}
.profile-screen .source-box{margin-bottom:0}
.chat-screen .form-note{margin-bottom:12px}
.chat-history{min-height:160px}
.chat-message{word-break:break-word}
.chat-message.assistant{border:1px solid rgba(255,255,255,.82)}
.chat-prompt-list{margin-bottom:10px}
.chat-composer{bottom:calc(var(--nav-height) + var(--bottom-inset) + 15px)}
.sheet-content .btn-primary,.sheet-content .btn-secondary{min-height:43px}
.home-screen .state-panel{margin-bottom:16px}
@media(max-width:410px){.screen{padding-left:14px;padding-right:14px}.segment{font-size:11px;letter-spacing:-.04em;padding-inline:1px}.state-head{margin:0 0 10px}.state-head h2{font-size:17px}.state-open{font-size:11px}.summary-grid .source-box{padding:12px}.nav-item{font-size:10px}.nav-icon{min-width:49px}.catalog-segments button{font-size:11px}}
@media(min-width:800px){.content{padding-bottom:65px}.home-screen{padding-top:39px}.bottom-nav{display:none}.chat-composer{bottom:20px}.screen{padding-top:37px}.sheet{background:rgba(250,252,250,.99)}}
@media(prefers-reduced-motion:reduce){.icon-switched,.state-open.is-flashing{animation:none!important}}
/* Appearance selection applies to the entire prototype, not only Home. */
.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:13px}
.theme-option{background:rgba(244,248,244,.96);border:1px solid #deebe0;border-radius:15px;padding:7px;display:grid;gap:5px;text-align:left;color:var(--ink)}
.theme-option.selected{border-color:#439b67;box-shadow:0 0 0 2px #8ccc9c44}
.theme-option strong{font-size:12px}.theme-option small{font-size:10px;color:#6a7c6d}
.theme-preview{display:block;border-radius:11px;height:65px;background:linear-gradient(150deg,#e9f3e8 20%,#92ba91 80%)}
.theme-preview.botanical{background:url('assets/botanical.jpg') center/cover}
.theme-preview.mist{background:linear-gradient(145deg,#eef6f2,#c9e8db,#ecf4e8)}
.theme-preview.forest{background:linear-gradient(135deg,#e1efdd,#6b987d,#dae9df)}
:root[data-theme=mist] .content{background:linear-gradient(135deg,#f1f7f3,#dfeee5 48%,#f3f8f3)}
:root[data-theme=forest] .content{background:linear-gradient(125deg,rgba(224,241,225,.85),rgba(202,227,207,.8)),url('assets/botanical.jpg') center top/cover no-repeat}
.is-dark .content{background:linear-gradient(150deg,#172a22,#294333 80%);color:#f0f8ee}
.is-dark .shell{background:#1b3027}
.is-dark .card,.is-dark .glass,.is-dark .source-box,.is-dark .tap-row,.is-dark .sheet,.is-dark .profile-banner,.is-dark .chat-message.assistant{background:rgba(31,53,42,.97);border-color:#3a5846;color:#f0f8ee}
.is-dark .sheet-header,.is-dark .sheet-actions{background:#20392c;border-color:#425544}
.is-dark .sheet-content{color:#f0f8ee}
.is-dark .screen-header .subtitle,.is-dark .fineprint,.is-dark .source-box p,.is-dark .tap-row small,.is-dark .tile-meta{color:#aec3b2}
.is-dark .screen h1,.is-dark .screen h2,.is-dark .screen h3,.is-dark .sheet h2{color:#f0f8ee}
.is-dark .bottom-nav{background:rgba(29,52,39,.96);border-color:#43604c}
.is-dark .nav-item{color:#bbd0bf}.is-dark .nav-item.active{color:#92e7ac}
.is-dark .stat,.is-dark .segment.active,.is-dark .assistant-box input{background:#294936;color:#f0f8ee}
.is-dark .state-list .attention-item,.is-dark .medicine-tile{background:#294436;color:#f2f8f3}
.is-dark .state-panel,.is-dark .segmented{background:#284336}
.is-dark .field input,.is-dark .field select,.is-dark .field textarea,.is-dark .source-box .field input{background:#314c3a;border-color:#466451;color:white}
.is-dark .row-list .tap-row{background:#2b4736}
.is-dark .overview-label,.is-dark .hero-text p,.is-dark .stat-name,.is-dark .attention-content small{color:#bfcec1}
.is-dark .chat-composer{background:#263e2e;border-color:#47614c}
.is-dark .hero-text h1{color:#f2f8f3}
.is-dark .desktop-sidebar{background:#1b3027;color:#f0f8ee;border-color:#3d604a}
.is-dark .desktop-sidebar .sidebar-item{color:#bdcfc0}
.is-dark .desktop-sidebar .sidebar-item.active{background:#24553a;color:#b0e8c2}

/* =========================================
   Preview v2: scoped bug fixes + liquid-glass system
   The wallpaper is VIEWPORT-FIXED; all actual pages scroll above it.
   ========================================= */
:root{
 --surface-glass:rgba(247,255,249,.45);
 --surface-glass-strong:rgba(248,255,250,.69);
 --surface-lens:rgba(245,255,248,.34);
 --glass-stroke:rgba(255,255,255,.80);
 --glass-highlight:inset 0 1.5px 0 rgba(255,255,255,.95),inset 1px 0 0 rgba(255,255,255,.48),inset 0 -1px 0 rgba(143,183,153,.20);
 --glass-shadow:0 10px 33px rgba(35,81,54,.12),0 2px 7px rgba(38,71,43,.05);
 --glass-blur:blur(18px) saturate(145%);
 --transition-spring:cubic-bezier(.18,.84,.21,1.02);
}
body{background:#eaf2e7;overscroll-behavior-x:none;-webkit-tap-highlight-color:transparent}
body::before{
 content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
 background:linear-gradient(180deg,rgba(246,255,247,.06) 0%,rgba(244,252,244,.2) 56%,rgba(230,241,232,.42) 100%),url('assets/botanical.jpg') center center/cover no-repeat;
}
body::after{content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;background:linear-gradient(180deg,transparent 0%,rgba(238,246,237,.12) 100%)}
.app,.shell,.content,.content.is-home{background:transparent!important}
.content.is-home::before{display:none!important}
:root[data-theme="mist"] body::before{background:linear-gradient(145deg,#eaf5ed,#d9ebdf 60%,#f8fcf8)}
:root[data-theme="forest"] body::before{background:linear-gradient(155deg,rgba(205,234,210,.35),rgba(225,241,221,.3)),url('assets/botanical.jpg') center/cover no-repeat}
.is-dark::before{background:linear-gradient(135deg,#162d24dc,#244335d7),url('assets/botanical.jpg') center/cover no-repeat}
.app{isolation:isolate;min-height:100dvh}.shell{position:relative;z-index:0}
.content{overflow-x:clip;padding-bottom:calc(var(--nav-height) + var(--bottom-inset) + 55px)}
.screen{overflow:visible}
/* Light material is still visibly glass: no solid white slabs. */
:root[data-glass="lite"]{--surface-glass:rgba(244,253,247,.60);--surface-glass-strong:rgba(248,255,250,.77);--surface-lens:rgba(243,253,248,.72);--glass-blur:blur(11px) saturate(123%)}
.glass,.overview,.state-panel,.camera-widget,.assistant-box,.bottom-nav,
.card,.tap-row,.source-box,.profile-banner,.chat-message.assistant,.sheet,
.catalog-search,.segmented,.catalog-segments,.state-open,.sort-menu,.qa-menu,
.instruction-section,.field input,.field textarea,.field select{
 background:var(--surface-glass);border:1px solid var(--glass-stroke);
 -webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);
 box-shadow:var(--glass-shadow),var(--glass-highlight)
}
.card,.tap-row,.source-box,.medicine-tile,.state-panel{background:var(--surface-glass-strong)}
.state-panel{background:var(--surface-glass);}
.state-panel .attention-item,.attention-item,.stat,.empty-state{background:rgba(248,255,249,.46);border:1px solid rgba(255,255,255,.62);box-shadow:inset 0 1px 0 rgba(255,255,255,.58)}
.sheet{background:rgba(246,252,248,.83)}
.sheet-header,.sheet-actions{background:rgba(240,250,241,.54);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}
.instruction-section,.field input,.field textarea,.field select{background:rgba(255,255,255,.5)}
:root[data-glass="lite"] .glass,:root[data-glass="lite"] .state-panel,:root[data-glass="lite"] .bottom-nav,:root[data-glass="lite"] .source-box{box-shadow:0 8px 24px rgba(26,61,38,.08),inset 0 1px 0 rgba(255,255,255,.85)}
/* Real dragging: two 50% pages inside a 200%-wide track. */
.state-viewport{position:relative;overflow:hidden;margin-top:12px;touch-action:pan-y;min-width:0;contain:layout paint}
.state-track{width:200%;display:flex;align-items:flex-start;transform:translate3d(0,0,0);transition:transform .42s var(--transition-spring);will-change:transform}
.state-viewport[data-active="setup"] .state-track{transform:translate3d(-50%,0,0)}
.state-track.is-dragging{transition:none!important}
.state-page{min-width:0;width:50%;flex:0 0 50%;display:grid;gap:9px;align-content:start;padding:1px 0 2px}
.state-tabs{position:relative;isolation:isolate;background:rgba(230,243,234,.38)}
.state-tab-glider{position:absolute;left:4px;top:4px;bottom:4px;width:calc((100% - 8px)/2);border-radius:12px;z-index:0;
 background:var(--surface-lens);border:1px solid var(--glass-stroke);
 box-shadow:0 2px 8px rgba(36,80,43,.08);
 transition:transform .46s var(--transition-spring)}
.state-tabs[data-active="setup"] .state-tab-glider{transform:translate3d(100%,0,0)}
.state-tabs .segment{z-index:1;position:relative;background:transparent!important;box-shadow:none!important}
.state-tabs .segment.active{color:#146640}
.state-list{touch-action:pan-y}
/* First-letter text layout: keep approved size but avoid awkward stretched vertical gap. */
.hero-text{justify-content:space-between;padding:10px 0 6px}
.hero-text p{font-weight:520;letter-spacing:-.045em}
.hero-text h1{font-weight:750}
/* scanner/camera icon and pages */
.camera-symbol{width:82px;height:80px;flex:none}
.camera-symbol morph-icon{width:68px;height:68px}
.camera-symbol .icon svg{width:67px;height:67px}
.camera-widget{gap:10px;overflow:hidden}
.camera-indicators{margin-top:1px}
/* fluid movement of a single nav glass lens; DOM is not recreated between tabs */
.bottom-nav{isolation:isolate;background:rgba(246,255,249,.37)!important;box-shadow:0 11px 32px rgba(37,78,47,.15),inset 0 1px rgba(255,255,255,.97)!important;
 grid-template-columns:repeat(4,minmax(0,1fr));position:fixed}
.nav-glider{position:absolute;top:4px;bottom:4px;left:6px;width:calc((100% - 12px)/4);z-index:0;pointer-events:none;border-radius:19px;
 background:var(--surface-lens);border:1px solid rgba(255,255,255,.62);box-shadow:0 4px 11px rgba(27,71,41,.08);
 transform:translate3d(var(--nav-slide,0%),0,0);transition:transform .49s var(--transition-spring),border-radius .3s ease;will-change:transform}
.nav-item,.nav-label{z-index:1;position:relative}
.nav-item{padding:5px 1px;min-width:0;line-height:1.1;height:60px;gap:1px}
.nav-item.active .nav-icon,.nav-item .nav-icon{background:none!important;box-shadow:none!important}
.nav-icon{min-width:0;width:100%;height:33px;display:grid;place-items:center}
.nav-icon .icon svg{width:23px;height:23px;max-width:100%;aspect-ratio:1;flex:none}
.nav-label{font-size:11px;white-space:nowrap}
.nav-item:focus-visible{outline:2px solid #19835a;outline-offset:-2px}
.notify-badge[hidden]{display:none!important}
/* stop full-screen gray touch selection, preserve keyboard outlines */
button{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button:focus:not(:focus-visible){outline:none;box-shadow:inherit}
/* Search + sort dropdown: custom, not a native popover/select. */
.catalog-info{position:relative;z-index:5}
.sort-anchor{position:relative}
.sort-trigger{display:flex;align-items:center;gap:6px;color:#286446;background:rgba(249,255,250,.45);border:1px solid rgba(255,255,255,.79);border-radius:12px;padding:8px 10px;font-size:13px;font-weight:650}
.sort-trigger .icon:last-child{transform:rotate(90deg)}
.sort-menu{position:absolute;right:0;top:calc(100% + 7px);z-index:15;width:min(285px,calc(100vw - 30px));padding:10px;border-radius:19px;display:grid;gap:4px}
.sort-menu>b{font-size:13px;margin:5px 7px 6px}
.sort-choice{padding:10px;text-align:left;border-radius:12px;display:flex;align-items:center;justify-content:space-between;color:var(--ink);background:transparent;font-size:14px}
.sort-choice.selected,.sort-directions button.selected{background:rgba(70,157,111,.18);color:#13653f;font-weight:760}
.sort-directions{display:grid;grid-template-columns:1fr 1fr;gap:5px;border-top:1px solid rgba(104,143,110,.16);padding-top:9px;margin-top:5px}
.sort-directions button{padding:10px 3px;border-radius:12px;background:rgba(248,255,250,.5);font-size:11px;display:flex;align-items:center;justify-content:center;gap:4px}
.sort-directions button:last-child .icon{transform:rotate(180deg)}
/* Compact headers and readable text without invalid iOS focus zoom. */
.field input,.field textarea,.field select,.catalog-search input,.assistant-box input,.chat-composer input{font-size:16px!important;min-width:0}
.sheet-content{min-width:0;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.sheet .detail-summary{max-width:100%;min-width:0}
.sheet .detail-summary *{min-width:0}
.detail-tab-panel,.detail-summary{transform:none!important;scale:1!important}
/* Keep chat history as the only vertical scroller; prompts and composer stay above navigation. */
.content[data-screen="chat"]{height:100dvh;min-height:100dvh;overflow:hidden;padding-bottom:calc(var(--nav-height) + var(--bottom-inset) + 10px)}
.chat-screen{display:flex;flex-direction:column;height:calc(100dvh - var(--nav-height) - var(--bottom-inset) - var(--top-inset) - 34px);min-height:0;overflow:hidden}
.chat-history{display:grid;gap:12px;align-content:start;flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:12px}
.chat-prompt-list{flex:none;display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-bottom:5px}
.chat-composer{position:relative;bottom:auto;width:100%;margin-top:0;flex:none;z-index:4;
 background:rgba(243,251,245,.76)}
.chat-composer input{height:40px;min-height:40px;max-height:none;padding:0 12px;line-height:1.35}
/* Glass settings */
.glass-choice{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:13px}
.glass-option{text-align:left;display:grid;gap:5px;padding:10px;min-width:0;border-radius:16px;border:1px solid rgba(255,255,255,.9);background:rgba(249,255,250,.35);color:var(--ink)}
.glass-option.selected{border-color:#49a270;box-shadow:0 0 0 2px rgba(62,158,100,.23)}
.glass-option strong{font-size:13px}.glass-option small{font-size:11px;color:var(--muted);line-height:1.25}
.glass-sample{height:46px;border-radius:14px;border:1px solid rgba(255,255,255,.9);background:linear-gradient(127deg,#a4c2a4,#eaf9e9,#87ac9a)}
.glass-sample.liquid{background:linear-gradient(125deg,rgba(255,255,255,.8),rgba(165,208,174,.2),rgba(255,255,255,.85));box-shadow:inset 0 2px 2px white,0 8px 16px rgba(22,63,36,.15)}
.glass-sample.lite{background:rgba(247,255,250,.65);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
/* always respect keyboard-focus & accessibility settings */
@media(max-width:359px){.state-tabs .segment{font-size:10px}.sort-menu{width:255px}.state-open{min-width:115px}}
@media(min-width:800px){.bottom-nav{display:none}.chat-screen{height:calc(100dvh - 96px)}.content{padding-bottom:50px}.content[data-screen="chat"]{height:100dvh;min-height:100dvh;padding-bottom:50px}}
.is-dark{--surface-glass:rgba(32,58,43,.57);--surface-glass-strong:rgba(34,58,46,.78);--surface-lens:rgba(74,111,87,.61);--glass-stroke:rgba(204,236,209,.18);--glass-blur:blur(13px) saturate(145%)}
.is-dark .glass,.is-dark .state-panel,.is-dark .source-box,.is-dark .sheet,.is-dark .tap-row,.is-dark .card,.is-dark .bottom-nav,.is-dark .attention-item,.is-dark .stat{background:var(--surface-glass-strong);border-color:var(--glass-stroke);color:#eef8f0}
.is-dark .state-panel,.is-dark .bottom-nav{background:var(--surface-glass)!important}
.is-dark .nav-glider,.is-dark .state-tab-glider{background:var(--surface-lens)}
.is-dark .sort-choice{color:#edf8ef}
@media(prefers-reduced-transparency:reduce){:root{--surface-glass:rgba(247,252,247,.96);--surface-glass-strong:rgba(250,253,250,.98);--surface-lens:rgba(248,251,248,.96);--glass-blur:none}}
@media(prefers-reduced-motion:reduce){.state-track,.state-tab-glider,.nav-glider{transition:none!important}}

/* V2 QA corrections */
body::before,body::after{z-index:0}
.app{position:relative;z-index:1}
.catalog-segments{position:relative;isolation:isolate;grid-template-columns:minmax(45px,.65fr) minmax(0,1.46fr) minmax(0,1.48fr);white-space:nowrap;overflow:hidden;background:rgba(230,243,234,.40)}
.catalog-glider{position:absolute;left:0;top:5px;bottom:5px;width:var(--catalog-glider-width,33%);transform:translate3d(var(--catalog-glider-left,0px),0,0);border-radius:14px;z-index:0;pointer-events:none;background:var(--surface-lens);border:1px solid var(--glass-stroke);box-shadow:0 3px 9px rgba(31,75,41,.08);transition:transform .45s var(--transition-spring),width .3s var(--transition-spring)}
.catalog-segments button{position:relative;z-index:1;min-width:0;white-space:nowrap;padding:9px 1px;letter-spacing:-.04em}
.catalog-segments button.active{background:none!important;box-shadow:none!important;color:#196a46}
.catalog-list .medicine-tile{animation:catalogEnter .30s cubic-bezier(.21,.79,.24,1)}
@keyframes catalogEnter{from{opacity:.65;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
.state-viewport{transition:height .28s cubic-bezier(.21,.8,.23,1)}
@media(max-width:359px){.catalog-segments button{font-size:10.3px!important}.state-tabs .segment{font-size:10px!important}}
/* Small moving lenses keep a frosted backdrop in CSS fallback browsers. */
.nav-glider,.state-tab-glider,.catalog-glider,.detail-glider{
 -webkit-backdrop-filter:blur(7px) saturate(132%);backdrop-filter:blur(7px) saturate(132%);
}
/* The glass engine is optional; keep all click targets and icon ratios stable. */
.nav-glider,.state-tab-glider,.catalog-glider{pointer-events:none;contain:layout}
.nav-item .icon,.sidebar-item .icon,.bottom-nav .icon{flex-shrink:0}
@media(prefers-reduced-motion:reduce){.catalog-glider,.catalog-list .medicine-tile,.state-viewport{animation:none!important;transition:none!important}}

/* Match the production app's keyboard and scroll ownership in this standalone preview. */
@media(max-width:799px){
 .app.keyboard-visible{position:fixed;inset:auto 0 auto;top:var(--app-viewport-top,0px);width:100%;height:var(--app-viewport-height,100dvh);min-height:0;overflow:hidden;display:flex;flex-direction:column}
 .app.keyboard-visible #sidebar{display:none}
 .app.keyboard-visible .shell{height:100%;min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden}
 .app.keyboard-visible .content{height:100%;min-height:0;flex:1;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:calc(10px + var(--bottom-inset))}
 .app.keyboard-visible .screen{min-height:100%;padding-bottom:12px;scroll-margin-block:12px}
 .app.keyboard-visible .bottom-nav{display:none!important}
 .app.keyboard-visible .overlay-backdrop{top:var(--app-viewport-top,0px);bottom:auto;height:var(--app-viewport-height,100dvh)}
 .app.keyboard-visible .sheet{min-height:0;max-height:calc(var(--app-viewport-height,100dvh) - 12px)}
 .app.keyboard-visible .sheet-content{min-height:0;padding-bottom:16px;scroll-padding-block:12px}
 .app.keyboard-visible[data-keyboard-surface="chat"] .content{overflow:hidden;padding-bottom:0}
 .app.keyboard-visible[data-keyboard-surface="chat"] .chat-screen{height:100%;min-height:0;overflow:hidden;padding-bottom:calc(8px + var(--bottom-inset))}
 .app.keyboard-visible[data-keyboard-surface="chat"] .chat-history{min-height:0;flex:1;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:12px}
 .app.keyboard-visible[data-keyboard-surface="chat"] .chat-prompt-list{flex:none;max-height:48px;margin:0 0 5px}
 .app.keyboard-visible[data-keyboard-surface="chat"] .chat-composer{position:relative;bottom:auto;flex:none;margin-top:0;padding:8px;padding-bottom:calc(8px + var(--bottom-inset))}
}
.catalog-search{min-width:0}
.search-clear-btn{width:30px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;border-radius:11px;background:transparent;color:#294f40}
.search-clear-btn morph-icon{width:24px;height:24px;display:block}
.search-clear-btn:focus-visible{outline:2px solid #4fa87b;outline-offset:1px}
.sheet-subtabs{position:relative;isolation:isolate;background:rgba(219,239,225,.38);border:1px solid rgba(255,255,255,.6)}
.sheet-subtabs .detail-glider{position:absolute;top:4px;bottom:4px;left:4px;width:calc((100% - 8px)/4);transform:translate3d(var(--detail-x,0%),0,0);background:var(--surface-lens);border:1px solid var(--glass-stroke);border-radius:11px;box-shadow:0 3px 8px rgba(21,70,40,.08);z-index:0;pointer-events:none}
.sheet-subtabs button{position:relative;z-index:1;font-size:11px;white-space:nowrap;min-width:0}
.sheet-subtabs button.active{background:transparent!important;box-shadow:none!important;color:#166c46}
.camera-tabs{isolation:isolate;position:relative}
.camera-tabs .segment{background:none!important;box-shadow:none!important;position:relative;z-index:1}
.sort-menu{animation:sortIn .22s cubic-bezier(.22,.77,.25,1)}
@keyframes sortIn{from{opacity:.3;transform:translateY(-5px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
/* Performance: repeated cards do not each allocate an iOS GPU backdrop filter.
   The floating dock, state shell and controls retain the blurred glass material. */
.medicine-tile,.catalog-list .card,.state-page .attention-item,.row-list .tap-row{
 -webkit-backdrop-filter:none;backdrop-filter:none;
 background:linear-gradient(145deg,rgba(252,255,252,.76),rgba(237,248,240,.54));
 box-shadow:0 7px 19px rgba(24,65,39,.07),inset 0 1px rgba(255,255,255,.83)
}
.is-dark .medicine-tile,.is-dark .catalog-list .card,.is-dark .state-page .attention-item,.is-dark .row-list .tap-row{background:linear-gradient(145deg,rgba(38,64,48,.85),rgba(31,53,41,.68))}
/* Touch focus must not inherit a large card shadow (the prior gray flash). */
button:focus:not(:focus-visible){outline:none;box-shadow:none}
/* Keep nested detail sheets inside the phone viewport, even when labels are long. */
.sheet-content{width:100%;grid-template-columns:minmax(0,1fr)}
.sheet-content>*{min-width:0;max-width:100%}
.sheet-header>div{min-width:0;flex:1}
.sheet-header h2,.sheet-header p{overflow-wrap:anywhere}
.sheet-subtabs{grid-template-columns:repeat(4,minmax(0,1fr));min-width:0;width:100%}
.sheet-subtabs button{white-space:normal;overflow-wrap:anywhere;line-height:1.15;padding-inline:3px}
.detail-summary{width:100%;min-width:0}
.detail-summary>div{overflow-wrap:anywhere}
.detail-tab-panel{width:100%;min-width:0;grid-template-columns:minmax(0,1fr)}
.detail-tab-panel>*{min-width:0;max-width:100%}
.detail-tab-panel .control-row{display:flex;flex-wrap:wrap;min-width:0}
.detail-tab-panel .control-row>*{flex:1 1 135px;min-width:0;white-space:normal;overflow-wrap:anywhere}
.sheet-actions button{min-width:0;white-space:normal;line-height:1.2;padding-inline:10px;overflow-wrap:anywhere}
