/* Mobile presentation only. Shared tokens leave desktop density unchanged. */
.nsd-mobile-filter-toggle,.nsd-mobile-records{display:none}
@media screen and (max-width:600px){
  :root{--ns-mobile-control-height:48px;--ns-control-height:var(--ns-mobile-control-height);--ui-control-height:48px;--density-control-height:48px;--ns-control-font-size:16px;--ui-font-control:16px;--ns-mobile-label-size:14px;--ns-mobile-space:14px}
  :is(#appShell,.tc-wizard-overlay,.ns-media-editor-layer,.ns-media-backdrop,.saf-modal-backdrop) :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),select){min-height:48px!important;font-size:16px!important;max-width:100%;box-sizing:border-box}
  :is(#appShell,.tc-wizard-overlay,.ns-media-editor-layer) textarea{font-size:16px!important}
  .ns-tenant-date{display:block!important;position:relative!important;min-width:0;width:100%}
  .ns-tenant-date>.ns-tenant-date-display{padding-right:48px!important}
  .ns-tenant-date>.ns-date-open{position:absolute!important;right:2px!important;top:50%!important;bottom:auto!important;transform:translateY(-50%);width:44px!important;height:44px!important;min-height:44px!important;display:grid!important;place-items:center;padding:0!important;margin:0!important;z-index:2}
  body:has(.nsd-dashboard-page) #globalBackButton{display:none!important}
  .nsd-header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
  .nsd-header .acore-breadcrumbs{font-size:11px;font-weight:400;margin:0;grid-column:1;grid-row:1}
  .nsd-header>header{display:contents}
  .nsd-header>header>div:first-child{grid-column:1/-1;grid-row:2}
  .nsd-header-actions{grid-column:2;grid-row:1;display:flex;gap:6px;flex-wrap:wrap;justify-content:end}
  .nsd-header-actions>[data-nephscola-dashboard-route=enrolment]{display:none!important}
  .nsd-header-actions button{min-height:44px!important;font-size:12px!important;padding:6px!important;gap:4px}
  .nsd-header-actions button svg{width:16px;height:16px}
  .nsd-dashboard-filters{padding:12px!important}
  .nsd-filter-grid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) auto!important;gap:8px!important}
  .nsd-filter-grid>label{min-width:0;gap:6px!important}.nsd-filter-grid>label>span{font-size:12px}
  .nsd-filter-grid>label:has([data-nephscola-dashboard-filter=sectionId]),.nsd-filter-grid>label:has([data-nephscola-dashboard-filter=optionId]),.nsd-filter-grid>label:has([data-nephscola-dashboard-filter=classId]),.nsd-filter-grid>.nsd-filter-actions,.nsd-dashboard-advanced{display:none!important}
  .nsd-filter-grid select{padding-inline:6px!important;font-size:13px!important;min-width:0;width:100%}
  #appShell .nsd-filter-grid select{font-size:13px!important;padding-right:22px!important}
  .nsd-mobile-filter-toggle{display:flex;align-self:end;align-items:center;justify-content:center;min-height:48px;gap:4px;padding:6px;font-size:12px}
  .tc-wizard-overlay .tc-mobile-record-actions button{height:44px!important;min-height:44px!important;width:auto!important;flex:1!important;display:flex!important;white-space:normal!important;padding:6px!important;font-size:13px!important}
  .tc-wizard-overlay .tc-mobile-record-actions button span{display:inline!important}
  .tc-wizard-overlay .tc-mobile-record-actions button svg{width:16px!important;height:16px!important;flex-shrink:0}
  .tc-wizard-overlay .tc-photo-field>.tw-form-label{font-size:14px!important;font-weight:600}
  .tc-wizard-overlay .tc-wizard-step-heading{padding-top:0!important;padding-right:0;gap:8px}
  .tc-wizard-overlay .tc-wizard-progress{margin-right:0;margin-bottom:4px}
  .tc-wizard-overlay .tc-wizard-step-heading>div{padding-right:48px}
  .tc-wizard-overlay .tc-wizard-close{top:34px!important;right:0!important;width:44px!important;height:44px!important;min-height:44px!important;background:color-mix(in srgb,var(--color-danger,#b42336) 7%,var(--color-surface,#fff))!important;border-color:color-mix(in srgb,var(--color-danger,#b42336) 23%,transparent)!important}
  .nsd-mobile-record{gap:8px;padding:12px 14px}
  .nsd-mobile-record>header{align-items:center;min-height:44px}
  .nsd-mobile-record>header>strong,.nsd-mobile-record>header .nsd-entity-link{font-size:18px!important;font-weight:700;line-height:1.3}
  .nsd-mobile-record dl{gap:8px 10px}
  .nsd-mobile-record dl>div:nth-child(n+3){border-top:1px solid var(--color-border);padding-top:8px}
  .nsd-mobile-record .nsd-row-menu>summary svg{transform:rotate(90deg)}
  .tc-wizard-overlay :is(.tw-button,.tw-mini-button){min-height:44px!important}
  .tc-wizard-overlay .tc-photo-actions :is(button,label){min-height:48px!important;height:48px!important}
  .tc-wizard-overlay .tw-form-field>span{font-size:14px!important;font-weight:600!important;line-height:1.4}
  :is(#appShell,.tc-wizard-overlay,.nsd-mobile-filter-layer,.ns-media-editor-layer) :is(input,textarea)::placeholder{font-size:16px!important;font-weight:400!important}
  .nsd-mobile-filter-layer select{height:48px!important;min-height:48px!important;font-size:16px!important}
  .nsd-mobile-filter-layer button{min-height:44px!important;min-width:44px}
  .nsd-quick-actions{display:none!important}.nsd-kpi-shell{grid-template-columns:minmax(0,1fr)!important}
  .nsd-dashboard-page{padding-bottom:calc(100px + env(safe-area-inset-bottom));min-width:0}
  .nsd-dashboard-page :is(.nsd-chart-card,.nsd-table-card,.nsd-alerts){min-width:0;padding:14px!important;overflow:visible}
  .nsd-table-card>.table-wrap{display:none!important}
  .nsd-mobile-records{display:grid;gap:12px;margin-top:12px}
  .nsd-mobile-record{display:grid;gap:10px;min-width:0;padding:14px;border:1px solid var(--color-border);border-radius:var(--ns-card-radius,8px);background:var(--color-surface)}
  .nsd-mobile-record>header{display:flex;align-items:start;justify-content:space-between;gap:8px}
  .nsd-mobile-record>header>strong{font-size:15px;min-width:0;overflow-wrap:anywhere}
  .nsd-mobile-record dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
  .nsd-mobile-record dt{font-size:12px;color:var(--color-text-secondary)}.nsd-mobile-record dd{margin:3px 0 0;font-size:13px;overflow-wrap:anywhere}
  .nsd-mobile-record .nsd-table-clamp{display:block;white-space:normal;overflow:visible;-webkit-line-clamp:unset;max-width:100%}
  .nsd-mobile-record .nsd-entity-link{text-align:left;min-height:44px;font-size:15px;white-space:normal}
  .nsd-mobile-record :is(.nsd-row-menu>summary,.nsd-row-actions){width:44px;min-width:44px;height:44px;min-height:44px}
  .nsd-mobile-record .nsd-row-menu>div{right:0;left:auto;max-width:230px;z-index:5}
  .nsd-donut-layout{grid-template-columns:1fr!important}.nsd-donut-legend{min-width:0}
  .nsd-mobile-filter-layer{position:fixed;inset:0;z-index:var(--ns-layer-modal,10000);background:rgb(5 20 40 / .5);display:flex;align-items:end}
  .nsd-mobile-filter-layer>section{width:100%;max-height:90dvh;overflow:auto;background:var(--color-surface,#fff);border-radius:16px 16px 0 0;padding:16px 16px max(16px,env(safe-area-inset-bottom));display:grid;gap:14px}
  .nsd-mobile-filter-layer header{display:flex;align-items:center;justify-content:space-between;gap:12px}.nsd-mobile-filter-layer h2{font-size:19px;margin:0}
  .nsd-mobile-filter-layer label{display:grid;gap:7px;font-size:14px;font-weight:600}.nsd-mobile-filter-layer select{height:48px;font-size:16px;width:100%}.nsd-mobile-filter-layer button{min-height:44px}
  .nsd-mobile-filter-layer footer{display:flex;gap:8px}.nsd-mobile-filter-layer footer button{flex:1}
  .ns-camera-capture footer{display:flex;flex-wrap:wrap;gap:8px}.ns-camera-capture footer button{flex:1;min-height:48px;font-size:14px}
}
@media screen and (max-width:768px){
  body.mobile-search-dialog-open{overflow:hidden}
  body.mobile-search-dialog-open #mobileSearchPanel{position:fixed!important;inset:0!important;z-index:var(--ns-layer-modal,10000)!important;width:100%!important;height:100dvh;max-width:none!important;padding:max(16px,env(safe-area-inset-top)) 12px max(16px,env(safe-area-inset-bottom))!important;background:color-mix(in srgb,var(--color-surface,#fff) 88%,transparent)!important;backdrop-filter:blur(8px);display:flex!important;flex-direction:column;gap:14px;overflow:auto;box-sizing:border-box;border-radius:0!important}
  body.mobile-search-dialog-open #mobileSearchPanel .search-box{display:flex!important;align-items:center;position:relative!important;width:100%;order:0!important;flex:0 0 58px!important;height:58px!important;max-height:58px!important;min-height:58px;padding:4px;background:var(--color-surface,#fff);border:1px solid var(--color-border);border-radius:8px!important}
  body.mobile-search-dialog-open #mobileSearchPanel .mobile-advanced-search{order:2;flex:0 0 auto;min-height:44px}
  body.mobile-search-dialog-open #globalSearch{display:block;flex:1;width:0;min-width:0;height:48px;font-size:16px!important;padding:8px;border:0}
  body.mobile-search-dialog-open #globalSearchButton{display:none}
  body.mobile-search-dialog-open #mobileSearchClose{display:grid;place-items:center;position:static;width:48px;min-width:48px;height:48px;color:var(--color-text-primary);background:var(--color-surface-subtle);border-radius:6px}
  body.mobile-search-dialog-open #globalSearchResults{position:static!important;width:100%!important;order:1;flex:0 0 auto;max-width:none!important;max-height:none!important;overflow:visible!important;box-shadow:none;border:0;background:transparent}
  body.mobile-search-dialog-open .global-search-result{min-height:56px;padding:12px;background:var(--color-surface,#fff);white-space:normal}
  body.mobile-search-dialog-open .global-search-result :is(strong,span,small){white-space:normal;overflow-wrap:anywhere}
}
@media screen and (max-width:360px){.nsd-header{grid-template-columns:1fr}.nsd-header-actions{grid-column:1;grid-row:2;justify-content:start}.nsd-header>header>div:first-child{grid-row:3}}
@media screen and (max-width:360px){.nsd-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.nsd-mobile-filter-toggle{grid-column:2;justify-self:end;min-height:44px;width:auto}}
