/* Shared responsive layout, loaded after existing styles. */
@media screen {
img,video,canvas{max-width:100%}input,select,textarea{min-width:0;max-width:100%}
main,.container,.card,.auth,.entry-panel,.food-panel,.recipe-panel,.records-container,.record-card,.appointment-card{min-width:0}
button,.button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
.public-header nav a{display:flex;align-items:center;min-height:44px}
#upiQr{max-width:100%;overflow:auto}#upiQr img,#upiQr svg{max-width:100%;height:auto}
.table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media screen and (max-width:900px){
.public-header{flex-direction:column;align-items:stretch;gap:10px;padding:14px 20px}
.public-header>a{max-width:300px}.public-header nav{gap:4px 16px}
}
@media screen and (max-width:600px){
html{font-size:16px}body{overflow-wrap:break-word}
main{padding:0 12px;margin:18px auto}.container{width:100%;margin:16px auto;padding:0 12px!important}
.public-header{padding:12px}.public-header img{width:250px}.public-header nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.public-header nav a{justify-content:center;text-align:center;padding:7px 4px;border-radius:7px;background:#f1f7f6;font-size:.87rem}
.hero{padding:22px 18px;border-radius:15px}.card{padding:18px!important}.card .card{padding:14px!important}
h1{font-size:1.8rem}h2{font-size:1.22rem}p,a,code{overflow-wrap:anywhere}.grid{grid-template-columns:minmax(0,1fr);gap:12px;margin:18px 0}
input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important;min-height:44px;width:100%}
input[type=checkbox],input[type=radio]{width:20px;height:20px;flex:0 0 20px}
button,.button{min-height:44px;white-space:normal;max-width:100%}
.actions,.button-row,.quick-actions{flex-wrap:wrap;gap:8px}.actions>*,.actions>form{min-width:0;max-width:100%}.actions>.button,.actions>button{flex:1 1 140px;text-align:center}
.actions>label{flex:1 1 100%;margin:6px 0}.actions>form button{width:100%}
.auth{width:100%;max-width:100%}.auth label{overflow-wrap:anywhere}.recovery{font-size:1rem}
footer{padding:22px 14px;line-height:2}
.app-header{flex-direction:column;align-items:stretch!important;gap:10px;padding:12px!important}.app-header .brand{align-items:flex-start}.brand-logo{width:260px}
.save-toolbar{gap:10px;padding:10px 12px}.save-status{flex-basis:100%;overflow-wrap:anywhere}.save-toolbar button{min-height:44px}
.top-bar,.member-controls{width:100%;min-width:0}.member-controls select{flex:1 1 160px;width:100%}
#homeNavigation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}#homeNavigation button{white-space:normal;padding:10px 8px}
.home-welcome{padding:18px;gap:12px}.home-add{width:100%;white-space:normal}.home-vitals{gap:10px}.home-vitals article{padding:13px}.home-vitals strong{font-size:1.25rem;overflow-wrap:anywhere}
.home-tools{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.home-tools button{min-height:145px;padding:13px}.home-status-grid{grid-template-columns:1fr}
.entry-grid,.care-form-grid,.form-row-2,.form-row-3,.form-row-4,.scan-grid,#foodLayout{grid-template-columns:minmax(0,1fr)!important}
.appointment-list,.records-container{grid-template-columns:minmax(0,1fr)!important;max-width:100%}
.care-form-grid>*,.scan-grid>*,.entry-grid>*{min-width:0}.scan-crop{grid-template-columns:repeat(2,minmax(0,1fr))}.scan-grid textarea{min-height:220px}
.report-filters{align-items:stretch}.report-filters label{flex:1 1 100%;min-width:0!important}.report-filters button{flex:1 1 120px}
.day-options{gap:10px}.day-options label{min-height:44px}.care-tabs button{flex:1 1 120px}
.saved-report-text{padding:10px}.home-section-heading{align-items:flex-start;flex-direction:column}
}
@media screen and (max-width:360px){.public-header nav{grid-template-columns:repeat(2,minmax(0,1fr))}.home-tools{grid-template-columns:1fr}.home-vitals{grid-template-columns:1fr}}

/* Keep the desktop header and home hero within the viewport. */
@media screen{
.public-header{width:100%;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:16px max(20px,calc((100% - 1080px)/2));flex-wrap:wrap}
.public-header>a{display:block;flex:0 1 280px;min-width:0;max-width:100%;line-height:0}
.public-header>a>img{display:block;width:280px;max-width:100%;height:auto;object-fit:contain}
.public-header nav{min-width:0;display:flex;flex-wrap:wrap;gap:6px 16px}
.public-header nav a{white-space:normal;text-decoration:none}
body>main{width:100%;max-width:1080px;margin:32px auto;padding:0 22px}
.hero{width:100%;min-width:0;padding:38px;overflow-wrap:break-word}
.hero h1{font-size:clamp(1.8rem,3.4vw,2.7rem);line-height:1.18;max-width:850px}
.hero p{max-width:680px}
}
@media screen and (max-width:900px){
.public-header{flex-direction:column;align-items:stretch;gap:12px;padding:14px 20px}
.public-header>a{flex:none;width:280px}.public-header nav{justify-content:flex-start}
}
@media screen and (max-width:600px){
.public-header{padding:12px}.public-header>a{width:250px}.public-header>a>img{width:250px}
.public-header nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
body>main{padding:0 12px;margin:18px auto}.hero{padding:22px 18px}.hero h1{font-size:1.8rem}
}
@media screen and (max-width:360px){.public-header nav{grid-template-columns:repeat(2,minmax(0,1fr))}}
