/* VETmie Mobilansicht – gilt nur auf dem Bildschirm bis 760 px Breite.
   Desktop (> 760 px) und Druck (@media print) bleiben unverändert. */
:root{--m-bar:56px;--m-tabs:60px;--m-safe-top:env(safe-area-inset-top,0px);--m-safe-bottom:env(safe-area-inset-bottom,0px)}

@media screen and (max-width:760px){
/* ---------- Rahmen ---------- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{padding-top:calc(var(--m-bar) + var(--m-safe-top));padding-bottom:calc(var(--m-tabs) + var(--m-safe-bottom));overflow-x:hidden}
.workspace{margin-left:0;min-height:0}
.app-commandbar{display:none!important}
.workspace>header{position:absolute!important;width:1px;height:1px;padding:0!important;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
main{padding:12px 12px 20px;min-height:0}
footer{margin:0 12px;display:block}
footer span{display:block}
[data-workspace=open],[data-ui-task=companion],[data-companion]{display:none!important}

/* App-Leiste oben */
.mobile-appbar{position:fixed;top:0;left:0;right:0;z-index:250;height:var(--m-bar);padding:var(--m-safe-top) 4px 0;box-sizing:content-box;display:flex;align-items:center;gap:2px;background:var(--petrol);color:#fff;box-shadow:0 2px 10px #0b2a3530}
.mobile-title{flex:1;min-width:0;font-size:17px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 6px}
.mobile-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;min-width:48px;padding:0;border:0;border-radius:12px;background:transparent;color:inherit;box-shadow:none}
.mobile-icon:focus-visible{outline:2px solid #91d5cc;outline-offset:-2px}
.mobile-icon .practice-icon{width:24px;height:24px}
.mobile-count{position:absolute;top:5px;right:3px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#f0b44c;color:var(--petrol);font-size:11px;font-weight:800;line-height:18px;text-align:center}
.mobile-count[hidden]{display:none}

/* Tab-Leiste unten */
.mobile-tabbar{position:fixed;left:0;right:0;bottom:0;z-index:250;display:flex;height:var(--m-tabs);padding-bottom:var(--m-safe-bottom);box-sizing:content-box;background:#fff;border-top:1px solid var(--line);box-shadow:0 -3px 14px #0b2a3514}
.mobile-tabbar[hidden]{display:none}
.mobile-tabbar a,.mobile-tabbar button{flex:1 1 0;min-width:0;min-height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:4px 2px;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--muted);font-size:11px;font-weight:600;text-decoration:none}
.mobile-tabbar span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mobile-tabbar .practice-icon{width:22px;height:22px}
.mobile-tabbar a.active{color:var(--teal);box-shadow:inset 0 3px 0 var(--teal)}

/* Schublade (vorhandene Seitenleiste) */
.sidebar{position:fixed;top:0;bottom:0;left:0;z-index:300;width:min(86vw,320px);max-width:none;padding:calc(10px + var(--m-safe-top)) 12px calc(14px + var(--m-safe-bottom));display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;transform:translateX(-105%);visibility:hidden;transition:transform .22s ease,visibility 0s linear .22s;box-shadow:none}
html.mobile-drawer-open .sidebar{transform:none;visibility:visible;transition:transform .22s ease;box-shadow:8px 0 30px #0b2a3550}
.mobile-backdrop{position:fixed;inset:0;z-index:290;background:#092b4066;opacity:0;visibility:hidden;transition:opacity .2s}
html.mobile-drawer-open .mobile-backdrop{opacity:1;visibility:visible}
html.mobile-drawer-open body{overflow:hidden}
.mobile-drawer-close{align-self:flex-end;color:#fff;flex-shrink:0}
.sidebar .brand{font-size:28px;padding:0 8px 8px}
.sidebar .brand small{display:none}
.sidebar-practice-logo{display:none}
.sidebar nav{display:block;overflow:visible}
.nav-group{display:block;width:auto;margin-top:6px}
.nav-group summary{min-height:44px;display:flex;align-items:center;font-size:12px}
.nav-item,.nav-group .nav-item{min-height:44px;padding:8px 10px 8px 14px;font-size:15px;white-space:normal}
.nav-item .symbol{display:flex}
.sidebar-foot{display:none}
.mobile-drawer-actions{margin-top:auto;padding-top:12px;border-top:1px solid #ffffff21;display:grid;gap:6px}
.mobile-drawer-actions button{min-height:44px;display:flex;align-items:center;justify-content:flex-start;gap:10px;padding:8px 12px;border:1px solid #ffffff30;background:#ffffff10;color:#fff;font-size:15px;box-shadow:none}

/* Demo-Banner als einzeilige Plakette */
.demo-banner{padding:6px 12px}
.demo-banner .mobile-demo-text{display:none}
.demo-banner.expanded .mobile-demo-text{display:block;margin-top:6px;font-size:13px}
.mobile-demo-toggle{min-height:32px;padding:4px 12px;border:1px solid #e5c77e;border-radius:16px;background:#f6dc9e;color:#6b4f1d;font-size:12px;font-weight:800;letter-spacing:.3px;box-shadow:none}
.mobile-demo-toggle::after{content:' ▾'}
.demo-banner.expanded .mobile-demo-toggle::after{content:' ▴'}

/* Hinweis-Meldung oberhalb der Tab-Leiste */
.toast{left:12px;right:12px;bottom:calc(var(--m-tabs) + var(--m-safe-bottom) + 10px);max-width:none}

/* ---------- Phase B: Formulare, Akten, Dialoge ---------- */
/* Eingabefelder: 16 px (kein Zoom unter iOS), Tippziele mindestens 44 px */
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{font-size:16px!important;min-height:44px;max-width:100%}
textarea{min-height:88px}
#main button,#main .button,#modal button,.mobile-appbar button{min-height:44px}
#main a[href]:not(.nav-item),#modal a[href]{display:inline-flex;align-items:center;min-height:44px}
input[type=checkbox],input[type=radio]{width:22px;height:22px;flex-shrink:0}
#main input[type=checkbox]:not(label input),#main input[type=radio]:not(label input){width:44px;height:44px;margin:0;accent-color:var(--teal)}
label.inline,label.record-toggle,.module-switch{min-height:44px;display:flex;align-items:center;gap:10px}

/* Einspaltige Raster */
.grid2,.grid3,.columns,.record-grid,.record-contact-row,.record-contact-primary,.record-notes,.record-summary,.treatment-top,.family-patient-grid,.measurement-grid{grid-template-columns:minmax(0,1fr)!important}
.record-grid>*,.record-contact-row>*,.grid2>*,.grid3>*{grid-column:auto!important}
.columns>*{min-width:0}
.toolbar{flex-wrap:wrap}
.toolbar input,.toolbar select{max-width:100%!important;flex:1 1 100%}
.card{padding:14px}

/* Kunden- und Tierakte */
.record-body{padding:14px 12px}
.record-head{flex-wrap:wrap}
.record-head .actions{flex-wrap:wrap;justify-content:flex-start}
.record-tabs{flex-wrap:nowrap!important;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;scrollbar-width:none;padding:8px 8px 0}
.record-tabs::-webkit-scrollbar{display:none}
.record-tabs button{flex:0 0 auto;min-height:44px;white-space:nowrap;scroll-snap-align:start}
.record-animals{overflow-x:auto;flex-wrap:nowrap}
.record-animals button{flex:0 0 auto}
/* Speichern-Leiste fest über der Tab-Leiste */
#recordWorkspace{padding-bottom:76px}
#recordWorkspace .record-footer{position:fixed;left:0;right:0;bottom:calc(var(--m-tabs) + var(--m-safe-bottom));z-index:240;margin:0;padding:8px 12px;background:#fffffff2;border-top:1px solid var(--line);box-shadow:0 -4px 14px #0b2a3514;flex-wrap:nowrap;justify-content:space-between}
#recordWorkspace .record-footer button{flex:1 1 0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Dialoge bildschirmfüllend mit fester Kopfzeile */
dialog#modal{position:fixed;inset:0;width:100%;max-width:none;height:100%;max-height:none;margin:0;border-radius:0;padding:0 14px calc(16px + var(--m-safe-bottom));box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain}
dialog#modal .modal-head{position:sticky;top:0;z-index:5;margin:0 -14px 14px;padding:calc(6px + var(--m-safe-top)) 4px 6px 14px;background:#fff;border-bottom:1px solid var(--line)}
dialog#modal .modal-head h2{font-size:18px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
dialog#modal #closeModal{width:44px;height:44px;min-width:44px;font-size:26px}
dialog#modal .actions{flex-wrap:wrap}
dialog#modal .actions button{flex:1 1 auto}

/* ---------- Phase C: Agenda, Karten, Kacheln ---------- */
/* Tagesplanung als Agenda */
.mobile-agenda-nav{gap:8px;flex-wrap:nowrap}
.mobile-agenda-nav button{flex:0 0 auto;min-width:44px}
.mobile-agenda-nav input{flex:1 1 auto!important;min-width:0}
.mobile-agenda-day{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:4px 0 10px}
.mobile-agenda-day strong{font-size:16px}
.mobile-agenda-filter{gap:8px}
.mobile-agenda-filter .segmented{flex:1 1 100%;display:flex}
.mobile-agenda-filter .segmented button{flex:1 1 0}
.mobile-agenda{display:grid;gap:8px;margin-bottom:12px}
.mobile-agenda-item{display:flex;align-items:center;gap:12px;width:100%;min-height:64px;padding:10px 12px;text-align:left;background:#fff;border:1px solid var(--line);border-left:5px solid var(--teal);border-radius:12px;box-shadow:var(--shadow);color:var(--ink)}
.mobile-agenda-time{display:flex;flex-direction:column;font-weight:800;font-size:15px;min-width:52px}
.mobile-agenda-time small,.mobile-agenda-text small{font-weight:500;font-size:12px;color:var(--muted)}
.mobile-agenda-text{flex:1;min-width:0;display:flex;flex-direction:column}
.mobile-agenda-text strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mobile-agenda-item.kind-op{border-left-color:#c0573f}
.mobile-agenda-item.kind-akut{border-left-color:#d08a1f}
.mobile-agenda-item.kind-diagnostik{border-left-color:#3b7bbf}
.mobile-agenda-item.kind-kontrolle{border-left-color:#6a7fd0}

/* Tabellen als Karten */
.table-wrap{overflow:visible!important}
table.mobile-cards{display:block;width:100%!important;min-width:0!important;border:0;background:transparent}
table.mobile-cards>thead{display:none}
table.mobile-cards>tbody{display:grid;gap:8px}
table.mobile-cards>tbody>tr{display:flex;flex-direction:column;gap:3px;padding:12px 14px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
table.mobile-cards>tbody>tr>td{display:block;padding:0!important;border:0!important;white-space:normal!important;overflow-wrap:anywhere;text-align:left!important;min-width:0}
table.mobile-cards>tbody>tr>td:first-child{font-size:15px;font-weight:700}
table.mobile-cards>tbody>tr>td:not(:first-child):not(.mobile-actions)::before{content:attr(data-label) ': ';color:var(--muted);font-size:12px;font-weight:600}
table.mobile-cards>tbody>tr>td.mobile-extra{display:none}
table.mobile-cards>tbody>tr>td.mobile-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
table.mobile-cards>tbody>tr.mobile-tap{cursor:pointer}
table.mobile-cards>tbody>tr.mobile-tap:active{background:#f3faf9}
table.mobile-cards small{display:block}

/* Aufgaben-Kacheln: eine Zeile (Symbol + Titel) */
.module-task-board{margin-bottom:14px}
.module-task-board>summary{min-height:44px;display:flex;align-items:center}
.module-family-intro{display:none}
.module-task-grid{grid-template-columns:minmax(0,1fr)!important;gap:6px;padding:8px}
.module-task-tile{min-height:48px!important;flex-direction:row;justify-content:flex-start;text-align:left;gap:12px;padding:6px 12px}
.module-task-tile small{display:none}
.module-task-tile strong{font-size:14px}
.module-task-icon{width:34px;height:34px;flex-shrink:0;font-size:20px}
.module-task-icon .practice-icon{width:22px;height:22px}
.workflow{grid-template-columns:minmax(0,1fr)!important}
.workflow button{min-height:48px;flex-direction:row;justify-content:flex-start;text-align:left}
.workflow button small{display:none}
.info-tile-grid{grid-template-columns:1fr 1fr}

/* Anmeldeseite */
#authGate{padding:16px}
#authGate input{font-size:16px;min-height:44px}
#authGate button{min-height:44px}
}
