/* Layout-only changes. Charts and clinical data continue to use the original controllers. */
#cp-database.mdb-workspace .mdb-toolbar{align-items:stretch}
#cp-database.mdb-workspace .mdb-toolbar .mdb-picker-toggle,
#cp-database.mdb-workspace .mdb-toolbar .db-search-wrap{height:64px;min-height:64px;box-sizing:border-box}
#cp-database.mdb-workspace .mdb-toolbar .db-search-wrap{display:flex;flex-direction:column;justify-content:center;gap:2px;padding:10px 13px;margin:0;min-width:0;border:1px solid var(--mdb-line);border-radius:14px;background:var(--mdb-card)}
#cp-database.mdb-workspace .mdb-toolbar .db-field-label{font-size:11px;line-height:17px;margin:0}
#cp-database.mdb-workspace .mdb-toolbar input.db-search{height:22px;min-height:22px;line-height:22px;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;outline:0;font-size:14px}
#cp-database.mdb-workspace .mdb-toolbar .db-search-wrap:focus-within{outline:3px solid #548eef66;outline-offset:2px}
@media(max-width:700px){#cp-database.mdb-workspace .mdb-toolbar .mdb-picker-toggle,#cp-database.mdb-workspace .mdb-toolbar .db-search-wrap{height:59px;min-height:59px}}

/* A shared row determines the baseline, instead of each column stretching independently. */
@media screen and (min-width:1025px){
 html body #analytics-three-cols-wrapper.analytics-three-cols{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-auto-flow:row!important;gap:18px!important;align-items:stretch!important}
 html body #analytics-three-cols-wrapper.analytics-three-cols>div[class^="analytics-col-"],
 html body #analytics-three-cols-wrapper.analytics-three-cols>div[class^="analytics-col-"]>.charts-row{display:contents!important}
 html body #analytics-three-cols-wrapper.analytics-three-cols .common-dashboard-card{height:auto!important;min-width:0!important;max-width:100%;margin:0!important;align-self:stretch!important;box-sizing:border-box;display:flex;flex-direction:column}
 html body #analytics-three-cols-wrapper.analytics-three-cols .chart-container{height:300px!important;min-height:300px;flex:1;min-width:0}
 html body #analytics-three-cols-wrapper #comparison-results{max-height:320px;overflow:auto;overscroll-behavior:contain}
 html body #analytics-three-cols-wrapper #analytics-smart-calendar-card{order:10}
 html body #analytics-three-cols-wrapper #comparison-card-container{order:20}
 html body #analytics-three-cols-wrapper #chart-finance-card{order:30}
 html body #analytics-three-cols-wrapper #chart-recent-patients-card{order:40}
 html body #analytics-three-cols-wrapper #chart-lab-card{order:50}
 html body #analytics-three-cols-wrapper #chart-week-card{order:60}
 html body #analytics-three-cols-wrapper #chart-top-visitors-card{order:70}
 html body #analytics-three-cols-wrapper #chart-recent-activities-card{order:80}
 html body #analytics-three-cols-wrapper #chart-rx-rep-ref-card{order:90}
 html body #analytics-three-cols-wrapper #chart-month-card{order:100}
 html body #analytics-three-cols-wrapper #chart-lab-activity-card{order:110}
 html body #analytics-three-cols-wrapper #chart-nursing-card{order:120}
 html body #analytics-three-cols-wrapper #chart-age-dist-card{order:130;grid-column:span 2}
 html body #analytics-three-cols-wrapper #chart-referrals-card{order:140}
}
@media screen and (min-width:768px) and (max-width:1024px) and (orientation:portrait){
 html body.analytics-tablet-portrait #analytics-three-cols-wrapper .analytics-col-1{align-items:stretch!important;grid-auto-rows:auto!important}
 html body.analytics-tablet-portrait #analytics-three-cols-wrapper .analytics-col-1>.common-dashboard-card{height:auto!important;min-width:0;align-self:stretch!important;box-sizing:border-box;display:flex;flex-direction:column}
 html body.analytics-tablet-portrait #analytics-three-cols-wrapper .analytics-col-1>.common-dashboard-card .chart-container{height:300px!important;min-height:300px;flex:1;min-width:0}
}
/* Mobile AI: the existing button itself peeks from the edge; no second badge or handle. */
html body #landing-overlay .l-card{position:relative}
html body #landing-overlay .l-card::after{content:'';position:absolute;inset:-1px;border-radius:inherit;padding:1px;pointer-events:none;background:linear-gradient(115deg,transparent 25%,#fff 50%,transparent 75%);background-size:300% 300%;opacity:0;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}
html body #landing-overlay .l-card:is(:hover,:active,:focus-visible)::after{opacity:.85;animation:clinicHubEdge 1.3s ease both}
@keyframes clinicHubEdge{from{background-position:0% 0%;opacity:0}45%{opacity:.85}to{background-position:100% 100%;opacity:.25}}
@media(prefers-reduced-motion:reduce){html body #landing-overlay .l-card:is(:hover,:active,:focus-visible)::after{animation:none;opacity:.45}}
@media screen and (max-width:767px){
 html body #landing-overlay .landing-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
 html body #landing-overlay .landing-cards .l-card{min-width:0;padding:20px 9px!important;gap:10px!important;box-sizing:border-box}
 html body #landing-overlay .landing-cards .l-card h3{font-size:16px;line-height:1.6;overflow-wrap:break-word}
 html body #landing-overlay .landing-cards .l-card p{font-size:11px;line-height:1.5}
 html body #landing-overlay .landing-cards .l-card i{font-size:32px}
 html body #ai-agent-fab.clinic-ai-edge-ready{display:flex!important;visibility:visible!important;pointer-events:auto!important;left:0!important;right:auto!important;width:52px!important;min-width:52px!important;height:52px!important;padding:0!important;border-radius:0 16px 16px 0!important;overflow:hidden!important;translate:none!important;transform:translateX(-42px)!important;touch-action:pan-y;transition:transform .2s ease,opacity .2s ease!important;box-sizing:border-box}
 html body #ai-agent-fab.clinic-ai-edge-ready.clinic-ai-edge-open{transform:translateX(0)!important}
 html body #ai-agent-fab.clinic-ai-edge-ready .ai-text{display:none!important}
 html body #ai-agent-fab.clinic-ai-edge-ready i{font-size:26px!important}
 html body #ai-agent-fab.clinic-ai-edge-ready:focus-visible{outline:3px solid #65b7ff;outline-offset:2px;transform:translateX(0)!important}
 @media(prefers-reduced-motion:reduce){html body #ai-agent-fab.clinic-ai-edge-ready{transition:none!important}}
}
