/* Screen composition only. Native values, handlers and business statuses stay module-owned. */
@media screen {
  .users-shell .user-toolbar { gap:12px!important;align-items:end!important; }
  .users-shell .user-toolbar .metric { min-width:0; }
  .users-shell .user-toolbar .metric strong { font-size:32px; }
  .users-shell #newUser { margin:0!important;min-height:44px;white-space:nowrap; }
  .users-shell .table-panel { padding:0!important; }
  #root .dashboard-grid > .panel { min-width:0; }
  .contract-generate-layout { grid-template-columns:minmax(0,1fr)!important; }
  .contract-generate-layout > .generate-card { max-width:none!important;width:100%; }
  .contract-generate-layout .generate-form { align-items:start;gap:16px; }
  .contract-generate-layout .collaborator-list { max-height:340px; }
  .contract-generate-layout .form-actions { justify-content:flex-end; }
  .vacation-request-panel { display:grid;gap:18px;align-items:start; }
  .vacation-request-panel .request-head { display:contents!important; }
  .vacation-request-panel .request-head > div { grid-column:1/-1;grid-row:1; }
  .vacation-request-panel .request-user-summary { width:100%!important;min-width:0;max-width:none!important;margin:0; }
  .vacation-request-panel .stacked-form { margin:0;min-width:0; }
  .vacation-request-panel fieldset { margin:0; }
  #users .roster-workbench { gap:14px; }
  #users .roster-tools { gap:12px!important; }
  #users .roster-visible-actions { gap:10px;align-items:center; }
  #users .roster-action-buttons { display:flex;flex-wrap:wrap;gap:8px;align-items:center; }
  #reports .lr-workspace { gap:18px;align-items:start; }
  #reports .lr-editor { min-width:0; }
  .audit-shell { max-width:none;padding:18px 20px 28px; }
  .audit-shell .main-column { min-width:0; }
  .audit-shell .history-grid {display:flex!important;flex-direction:column;gap:16px;min-height:0;overflow:auto;}
  .audit-shell .history-section {display:block!important;flex:0 0 auto!important;min-height:0!important;height:auto!important;min-width:0;}
  .audit-shell .history-title {margin:0 0 8px;}
  .audit-shell .history-list {max-height:220px;overflow:auto;}
  .audit-shell .visit-actions { gap:8px;flex-wrap:wrap; }
  .catalog-grid { gap:14px!important;align-items:start; }
  .catalog-grid > .catalog-card { display:flex;flex-direction:column;gap:12px;min-width:0; }
  .catalog-grid .catalog-items { min-height:0;max-height:350px;overflow:auto;overscroll-behavior:contain; }
  .catalog-grid .catalog-title { margin:0;align-items:center;gap:8px; }
  .catalog-grid .inline-add { margin:0;gap:8px; }
  .catalog-grid .catalog-search-status { margin:0; }
  .org-shell { display:grid;grid-template-rows:auto minmax(420px,1fr);gap:14px;min-width:0; }
  .org-shell .org-toolbar { margin:0!important;padding:12px 16px; }
  .org-shell .org-controls { display:flex;justify-content:space-between;align-items:center;gap:16px; }
  .org-shell .org-tabs { flex:0 1 auto;width:auto!important;min-width:0;max-width:100%; }
  .org-shell .org-stage { padding:12px;min-height:420px; }
  .org-shell .org-canvas { min-height:400px;max-height:calc(100dvh - 150px);overflow:auto; }
  #appView > .topbar { display:flex;align-items:center;padding:8px 0 14px;margin-bottom:14px; }
  #appView > .topbar h1 { font-size:28px;line-height:1.2; }
  body:has(#tab-generate) #usersTable .screen-tags { max-height:64px;overflow:auto;align-content:start; }
  body:has(#tab-generate) #usersTable .action-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:4px; }
  body:has(#tab-generate) #usersTable td { padding-block:8px;height:auto; }
  body:has(#tab-generate) #usersTable .action-grid button { min-height:36px;font-size:12px;padding:5px 6px;white-space:normal;overflow-wrap:anywhere; }
  .catalog-grid .catalog-item {grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"main actions" "controls controls"!important;gap:8px!important;}
  .catalog-grid .catalog-actions {width:auto!important;justify-content:flex-end!important;}
  .catalog-grid .catalog-item-controls:empty {display:none!important;}
  #devices .device-gateways { display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px; }
  #devices .clock-form { padding:16px;margin-top:18px; }
  @media(min-width:1100px) {
    .users-shell .user-toolbar { grid-template-columns:90px minmax(220px,1fr) auto 44px 44px auto!important; }
    .users-shell .user-toolbar .metric { grid-column:1;grid-row:1; }
    .users-shell .user-toolbar .search-field { grid-column:2;grid-row:1; }
    .users-shell #startGuide { grid-column:3;grid-row:1; }
    .users-shell #hierarchyView { grid-column:4;grid-row:1; }
    .users-shell #archiveToggle { grid-column:5;grid-row:1; }
    .users-shell #newUser { grid-column:6;grid-row:1; }
    #root .dashboard-grid { grid-template-columns:320px minmax(0,1fr)!important;gap:18px; }
    #root .dashboard-grid > form.panel { position:sticky;top:14px;max-height:calc(100dvh - 32px);overflow:auto; }
    #root .dashboard-grid > form.panel .form-grid { grid-template-columns:minmax(0,1fr)!important; }
    #root .dashboard-grid > form.panel .form-grid > label {grid-column:1!important;}
    .contract-generate-layout .generate-form { display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important; }
    .contract-generate-layout .contract-source-field { grid-column:1!important;grid-row:1; }
    .contract-generate-layout .collaborator-picker { grid-column:1/-1!important;grid-row:2; }
    .contract-generate-layout .collaborator-list {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-content:start;max-height:260px;}
    .contract-generate-layout .collaborator-row {margin:0;min-width:0;}
    .contract-generate-layout .collaborator-empty {grid-column:1/-1;}
    .contract-generate-layout .generate-form > label:nth-of-type(2) { grid-column:2;grid-row:1; }
    .contract-generate-layout .salary-period-field { grid-column:3;grid-row:1; }
    .contract-generate-layout .generate-form > label:nth-of-type(4) { grid-column:4;grid-row:1; }
    .contract-generate-layout .generate-form > label:nth-of-type(5) { grid-column:5;grid-row:1; }
    .vacation-request-panel { grid-template-columns:minmax(0,1fr) 280px; }
    .vacation-request-panel .request-user-summary { grid-column:2;grid-row:2; }
    .vacation-request-panel .stacked-form { grid-column:1;grid-row:2; }
    .vacation-request-panel .stacked-form > fieldset > .form-grid { grid-template-columns:repeat(3,minmax(0,1fr))!important; }
    .vacation-request-panel .form-grid > label:first-child { grid-column:1/-1!important; }
    .vacation-request-panel .form-grid > label:nth-child(2) { grid-column:span 2; }
    .vacation-request-panel .form-grid > label:nth-child(7),
    .vacation-request-panel .vacation-signature-choice { grid-column:1/-1!important; }
    #users .roster-tools { display:grid!important;grid-template-columns:minmax(240px,1.25fr) repeat(3,minmax(150px,1fr));align-items:end; }
    #users #rosterFilters:not([hidden]), #users .roster-filter-fields { display:contents!important; }
    #users #rosterActions { grid-column:1/-1;display:flex!important;flex-wrap:wrap;justify-content:space-between; }
    #users .user-summary { grid-template-columns:135px minmax(220px,1fr) minmax(170px,.65fr) 110px!important;min-height:80px;padding:12px 48px 12px 16px; }
    #reports .lr-workspace { grid-template-columns:minmax(300px,.7fr) minmax(0,1.3fr)!important; }
    .audit-shell > .workspace { display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px; }
    .audit-shell .history-panel { position:sticky;top:14px;max-height:calc(100dvh - 28px); }
    .audit-shell .history-grid {grid-template-columns:minmax(0,1fr)!important;min-height:0;overflow:auto;gap:12px;}
    .audit-shell .history-section {min-width:0;}
    .audit-shell .history-list {max-height:220px;}
    .audit-shell .visit-notes { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
    .audit-shell .visit-notes > label:first-child { grid-column:1/-1; }
    .catalog-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  }
  @media(min-width:761px) and (max-width:1099px) {
    .users-shell .user-toolbar { grid-template-columns:90px minmax(200px,1fr) 44px 44px!important; }
    .users-shell .user-toolbar .metric { grid-column:1;grid-row:1; }
    .users-shell .user-toolbar .search-field { grid-column:2;grid-row:1; }
    .users-shell #hierarchyView { grid-column:3;grid-row:1; }
    .users-shell #archiveToggle { grid-column:4;grid-row:1; }
    .users-shell #newUser { grid-column:2/-1;grid-row:2;justify-self:end; }
    .vacation-request-panel { grid-template-columns:minmax(0,1fr); }
    .vacation-request-panel .request-user-summary { grid-column:1;grid-row:2; }
    .vacation-request-panel .stacked-form { grid-column:1;grid-row:3; }
  }
  @media(max-width:760px) {
    .users-shell .user-toolbar { grid-template-columns:44px 44px minmax(0,1fr)!important;gap:8px!important; }
    .users-shell .user-toolbar .metric { grid-column:1/-1;grid-row:1;display:flex;align-items:baseline;gap:8px; }
    .users-shell .user-toolbar .metric strong { font-size:26px; }
    .users-shell .user-toolbar .search-field { grid-column:1/-1;grid-row:2; }
    .users-shell #hierarchyView { grid-column:1;grid-row:3; }
    .users-shell #archiveToggle { grid-column:2;grid-row:3; }
    .users-shell #newUser { grid-column:3;grid-row:3; }
    #root .dashboard-grid { grid-template-columns:minmax(0,1fr)!important; }
    #root .dashboard-grid > form.panel { position:static;max-height:none; }
    .contract-generate-layout .generate-form { grid-template-columns:minmax(0,1fr)!important; }
    .contract-generate-layout .generate-form > * { grid-column:1!important;grid-row:auto;min-width:0; }
    .vacation-request-panel { grid-template-columns:minmax(0,1fr);gap:12px; }
    .vacation-request-panel .request-user-summary { grid-column:1;grid-row:2; }
    .vacation-request-panel .stacked-form { grid-column:1;grid-row:3; }
    .vacation-request-panel .request-user-summary { padding:12px; }
    .vacation-request-panel .request-user-summary > div { display:flex;gap:8px;align-items:baseline; }
    #users .roster-tools { display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px!important; }
    #users .roster-tools > .field { grid-column:1/-1; }
    #users #rosterFilters:not([hidden]), #users .roster-filter-fields { display:contents!important; }
    #users .roster-filter-fields > .field:last-child { grid-column:1/-1; }
    #users #rosterActions { grid-column:1/-1; }
    #users .roster-action-buttons { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%; }
    #users #openContractorModal { grid-column:1/-1; }
    .audit-shell { padding:12px; }
    .audit-shell > .workspace { grid-template-columns:minmax(0,1fr);gap:14px; }
    .audit-shell .visit-notes { display:grid;grid-template-columns:minmax(0,1fr);gap:12px; }
    .audit-shell .history-panel { position:static;max-height:none; }
    .catalog-grid { grid-template-columns:minmax(0,1fr)!important; }
    .catalog-grid .catalog-items { max-height:300px; }
    .org-shell .org-controls { flex-wrap:wrap;gap:8px; }
    .org-shell .org-tabs { flex:1;min-width:0; }
    .org-shell .org-stage { padding:8px; }
    .org-shell .org-canvas { max-height:calc(100dvh - 170px); }
    #devices .device-gateways { grid-template-columns:minmax(0,1fr); }
    #appView > .topbar h1 { font-size:24px; }
    body:has(#tab-generate) #usersTable .action-grid button {min-height:44px;}
  }
}
