/* R102 — HypatiaOS Lite ergonomics + window-responsive contract.
   Loaded last. All responsive behavior keys off the Lite window, not viewport. */
[data-hyos-host] .os-window .window-body{
  container-type:inline-size;
  container-name:hyos-lite-window;
  min-width:0!important;
  min-height:0!important
}

/* Shared compact density */
[data-hyos-host] .os-window .window-body :is(
 .hyhub-app,.hycrm-os,.hywh-os,.hycal-lite,.hytm-app,.hytk-app,.hyof-app,.hydr-app,
 .hyedit,.hyvox-lite-native,.hydd-lite,.hytvl-app
){
  gap:8px!important
}
[data-hyos-host] .os-window .window-body :is(
 .hyhub-app,.hycrm-os,.hywh-os,.hycal-lite,.hytm-app,.hytk-app,.hyof-app,
 .hyedit,.hyvox-lite-native,.hydd-lite,.hytvl-app
){
  padding:10px!important
}
[data-hyos-host] .os-window .window-body :is(
 .hyhub-header h2,.hycrm-head h2,.hywh-head h2,.hycal-head h2,.hytm-head h2,.hytk-header h2,
 .hyof-head h2,.hyedit-top h2,.hyvox-native-head h2,.hydd-hero h2,.hytvl-head h2
){
  font-size:clamp(17px,2.2cqi,24px)!important;
  line-height:1.08!important;
  margin-block:2px!important
}
[data-hyos-host] .os-window .window-body :is(
 button,.hyhub-btn,.hyedit-btn,.hycal-btn,.hytk-button,.hytm-button,.hycrm-btn,.hywh-btn,
 .hyof-button,.hydr-new-toggle,.hytvl-btn,.hyvox-btn,.hydd-button
){
  min-height:28px!important;
  padding:4px 8px!important;
  border-radius:8px!important;
  font-size:11px!important;
  line-height:1.15!important
}
[data-hyos-host] .os-window .window-body :is(input,select,textarea){
  min-height:30px!important;
  padding:5px 8px!important;
  border-radius:8px!important;
  font-size:11px!important
}
[data-hyos-host] .os-window .window-body textarea{line-height:1.35!important}
[data-hyos-host] .os-window .window-body :is(
 .hyhub-bar,.hycrm-tools,.hywh-tools,.hycal-toolbar,.hytm-bar,.hytk-toolbar,.hyof-toolbar,
 .hydr-bar,.hyedit-toolbar,.hyvox-side-actions,.hydd-toolbar,.hytvl-nav,.hytvl-player-actions
){
  gap:5px!important
}
[data-hyos-host] .os-window .window-body :is(
 .hyhub-detail,.hycrm-card,.hywh-card,.hycal-event,.hytm-card,.hytm-member,.hytk-ticket,.hytk-detail,
 .hyof-file,.hydr-tile,.hyedit-side,.hyedit-media-item,.hyvox-side,.hyvox-turn,.hydd-metric,.hytvl-card
){
  padding:8px!important;
  border-radius:10px!important
}
[data-hyos-host] .os-window .window-body :is(
 .hyhub-meta,.hycrm-status,.hywh-status,.hycal-status,.hytm-status,.hytk-status,.hyof-status,
 .hydr-status,.hyedit-status,.hyvox-native-status,.hydd-status,.hytvl-status
){
  font-size:10px!important
}

/* Chat density */
[data-hyos-host] .os-window .hyos-chat-top{min-height:50px!important;padding:7px 10px!important}
[data-hyos-host] .os-window .hyos-chat-top strong{font-size:17px!important}
[data-hyos-host] .os-window .hyos-chat-top small{font-size:9px!important}
[data-hyos-host] .os-window .hyos-chat-new{min-height:30px!important;padding:5px 9px!important;font-size:10px!important}
[data-hyos-host] .os-window .hyos-chat-sidebar-head{padding:9px 8px 6px!important;gap:6px!important}
[data-hyos-host] .os-window .hyos-chat-search{min-height:30px!important}
[data-hyos-host] .os-window .hyos-chat-threads{padding:76px 7px 8px!important;gap:4px!important}
[data-hyos-host] .os-window .hyos-chat-thread{min-height:32px!important;padding:7px 8px!important;font-size:10px!important;border-radius:9px!important}
[data-hyos-host] .os-window .hyos-chat-toolstrip{padding:6px 8px!important;gap:5px!important}
[data-hyos-host] .os-window .hyos-chat-mode{min-height:28px!important;padding:4px 9px!important;font-size:10px!important}
[data-hyos-host] .os-window .hyos-chat-messages{padding:10px 12px!important;gap:9px!important}
[data-hyos-host] .os-window .hyos-chat-messages .hy-message-bubble{padding:9px!important;border-radius:12px!important}
[data-hyos-host] .os-window .hyos-chat-prompt-tools{padding:5px 10px 0!important;gap:5px!important}
[data-hyos-host] .os-window .hyos-chat-tool{min-height:27px!important;padding:3px 8px!important;font-size:10px!important}
[data-hyos-host] .os-window .hyos-chat-composer{min-height:62px!important;margin:5px 8px 0!important;padding:6px!important;border-radius:14px!important}
[data-hyos-host] .os-window .hyos-chat-composer textarea{min-height:44px!important;padding:9px!important;font-size:12px!important}
[data-hyos-host] .os-window .hyos-chat-actions button{min-height:32px!important;padding:5px 9px!important;font-size:10px!important}
[data-hyos-host] .os-window .hyos-chat-foot{padding:4px 9px 6px!important;font-size:9px!important}

/* Specific desktop compaction */
[data-hyos-host] .os-window .hycrm-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,175px),1fr))!important;gap:7px!important}
[data-hyos-host] .os-window .hycrm-card{min-height:92px!important}
[data-hyos-host] .os-window .hycrm-detail{inset:10px!important;padding:10px!important;gap:6px!important}
[data-hyos-host] .os-window .hywh-cards{grid-template-columns:repeat(auto-fill,minmax(min(100%,145px),1fr))!important;gap:6px!important;max-height:29%!important}
[data-hyos-host] .os-window .hywh-row{min-width:0!important;padding:7px!important;gap:6px!important;font-size:10px!important}
[data-hyos-host] .os-window .hycal-list{grid-template-columns:repeat(auto-fill,minmax(min(100%,210px),1fr))!important;gap:7px!important}
[data-hyos-host] .os-window .hytm-members{grid-template-columns:repeat(auto-fill,minmax(min(100%,145px),1fr))!important;gap:6px!important}
[data-hyos-host] .os-window .hytm-card{min-height:78px!important}
[data-hyos-host] .os-window .hytk-main{gap:7px!important}
[data-hyos-host] .os-window .hytk-ticket{min-height:58px!important}
[data-hyos-host] .os-window .hyhub-layout{gap:7px!important}
[data-hyos-host] .os-window .hyof-list{gap:6px!important}
[data-hyos-host] .os-window .hyof-file{min-height:58px!important}
[data-hyos-host] .os-window .hydr-app{grid-template-columns:clamp(118px,21%,180px) minmax(0,1fr)!important;font-size:11px!important}
[data-hyos-host] .os-window .hydr-side{padding:10px 7px!important;gap:9px!important}
[data-hyos-host] .os-window .hydr-main{padding:10px!important}
[data-hyos-host] .os-window .hydr-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,130px),1fr))!important;gap:7px!important}
[data-hyos-host] .os-window .hydr-tile{min-height:90px!important}
[data-hyos-host] .os-window .hyedit-work{grid-template-columns:minmax(0,1fr) minmax(145px,24%)!important;gap:6px!important}
[data-hyos-host] .os-window .hyedit-side{gap:5px!important;padding:7px!important}
[data-hyos-host] .os-window .hyvox-grid{gap:6px!important}
[data-hyos-host] .os-window .hydd-metrics{grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr))!important;gap:7px!important;margin-bottom:8px!important}
[data-hyos-host] .os-window .hydd-metric{min-height:84px!important}
[data-hyos-host] .os-window .hytvl-app{padding:8px!important}
[data-hyos-host] .os-window .hytvl-card{flex-basis:105px!important}
[data-hyos-host] .os-window .hytvl-card img{height:118px!important}

/* Media: controls compact, stage remains dominant */
[data-hyos-host] .os-window .hymedia-btn{min-height:27px!important;padding:3px 7px!important;font-size:10px!important;border-radius:8px!important}
[data-hyos-host] .os-window .hymedia-head{padding:9px 11px!important}
[data-hyos-host] .os-window .hymedia-controls{min-height:40px!important;padding:5px!important;gap:3px!important}
[data-hyos-host] .os-window .hymedia-lower{height:145px!important;max-height:145px!important;gap:6px!important}
[data-hyos-host] .os-window .hymedia-library,
[data-hyos-host] .os-window .hymedia-eq{padding:6px!important;border-radius:9px!important}
[data-hyos-host] .os-window .hymedia-library-head{gap:4px!important}
[data-hyos-host] .os-window .hymedia-library-head input{min-height:27px!important}
[data-hyos-host] .os-window .hymedia-bands small{font-size:8px!important}

/* Window responsive breakpoints */
@container hyos-lite-window (max-width:760px){
 [data-hyos-host] .hyos-native-chat{grid-template-columns:minmax(0,1fr)!important}
 [data-hyos-host] .hyos-chat-sidebar-head,[data-hyos-host] .hyos-chat-threads{display:none!important}
 [data-hyos-host] .hyos-chat-center{grid-column:1!important}
 [data-hyos-host] .hyhub-layout,
 [data-hyos-host] .hytk-main{grid-template-columns:1fr!important;grid-template-rows:minmax(82px,30%) minmax(0,1fr)!important}
 [data-hyos-host] .hyedit-work{grid-template-columns:1fr!important;grid-template-rows:minmax(130px,1fr) minmax(90px,32%)!important}
 [data-hyos-host] .hycrm-detail{grid-template-columns:1fr!important}
 [data-hyos-host] .hydd-columns{grid-template-columns:1fr!important}
}
@container hyos-lite-window (max-width:620px){
 [data-hyos-host] .window-body :is(
  .hyhub-app,.hycrm-os,.hywh-os,.hycal-lite,.hytm-app,.hytk-app,.hyof-app,.hyedit,.hyvox-lite-native,.hydd-lite,.hytvl-app
 ){padding:6px!important;gap:5px!important}
 [data-hyos-host] .window-body :is(
  button,.hyhub-btn,.hyedit-btn,.hycal-btn,.hytk-button,.hytm-button,.hycrm-btn,.hywh-btn,
  .hyof-button,.hydr-new-toggle,.hytvl-btn,.hyvox-btn,.hydd-button
 ){min-height:30px!important;padding:4px 7px!important;font-size:10px!important}
 [data-hyos-host] .window-body :is(input,select,textarea){min-height:30px!important;font-size:11px!important}
 [data-hyos-host] .hycrm-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 [data-hyos-host] .hycrm-detail{inset:5px!important}
 [data-hyos-host] .hywh-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 [data-hyos-host] .hywh-row{
   grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)!important;
   gap:3px 8px!important;
   padding:7px!important
 }
 [data-hyos-host] .hywh-row>*{min-width:0!important;overflow-wrap:anywhere!important}
 [data-hyos-host] .hycal-create{grid-template-columns:1fr!important}
 [data-hyos-host] .hycal-create label{grid-column:1!important}
 [data-hyos-host] .hycal-list{grid-template-columns:1fr!important}
 [data-hyos-host] .hytm-list{max-height:31%!important}
 [data-hyos-host] .hytm-card{min-height:68px!important;flex-basis:104px!important}
 [data-hyos-host] .hyof-toolbar,
 [data-hyos-host] .hycal-toolbar,
 [data-hyos-host] .hycrm-tools,
 [data-hyos-host] .hywh-tools,
 [data-hyos-host] .hytk-toolbar,
 [data-hyos-host] .hytm-bar{flex-wrap:wrap!important}
 [data-hyos-host] .hyof-toolbar>*,
 [data-hyos-host] .hycal-toolbar>*,
 [data-hyos-host] .hycrm-tools>*,
 [data-hyos-host] .hywh-tools>*,
 [data-hyos-host] .hytk-toolbar>*,
 [data-hyos-host] .hytm-bar>*{min-width:0!important}
 [data-hyos-host] .hyof-editor{min-height:150px!important}
 [data-hyos-host] .hydr-app{grid-template-columns:1fr!important;grid-template-rows:auto minmax(0,1fr)!important}
 [data-hyos-host] .hydr-side{flex-direction:row!important;align-items:center!important;gap:4px!important;overflow-x:auto!important;padding:5px!important;white-space:nowrap!important}
 [data-hyos-host] .hydr-nav{display:flex!important;gap:3px!important}
 [data-hyos-host] .hydr-side-note{display:none!important}
 [data-hyos-host] .hydr-main{padding:6px!important}
 [data-hyos-host] .hydr-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 [data-hyos-host] .hydr-tile{min-height:82px!important}
 [data-hyos-host] .hyedit-side{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 [data-hyos-host] .hyvox-grid{grid-template-columns:1fr!important;grid-template-rows:minmax(110px,1fr) minmax(90px,1fr)!important}
 [data-hyos-host] .hyvox-turn{grid-template-columns:1fr!important}
 [data-hyos-host] .hydd-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 [data-hyos-host] .hytvl-strip{gap:5px!important}
 [data-hyos-host] .hytvl-card{flex-basis:92px!important}
 [data-hyos-host] .hytvl-card img{height:102px!important}
 [data-hyos-host] .hytvl-frame{max-height:38cqh!important}
 [data-hyos-host] .hymedia-controls{left:5px!important;right:5px!important;bottom:142px!important}
 [data-hyos-host] .hymedia-lower{left:5px!important;right:5px!important;bottom:5px!important;height:132px!important;max-height:132px!important;grid-template-columns:1fr!important;overflow:auto!important}
}
@container hyos-lite-window (max-width:420px){
 [data-hyos-host] .window-body :is(
  .hyhub-header h2,.hycrm-head h2,.hywh-head h2,.hycal-head h2,.hytm-head h2,.hytk-header h2,
  .hyof-head h2,.hyedit-top h2,.hyvox-native-head h2,.hydd-hero h2,.hytvl-head h2
 ){font-size:16px!important}
 [data-hyos-host] .hycrm-grid,
 [data-hyos-host] .hywh-cards,
 [data-hyos-host] .hydr-grid,
 [data-hyos-host] .hydd-metrics{grid-template-columns:1fr!important}
 [data-hyos-host] .hywh-row{grid-template-columns:1fr!important}
 [data-hyos-host] .hyedit-side{grid-template-columns:1fr!important}
 [data-hyos-host] .hyvox-side-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 [data-hyos-host] .hyos-chat-top small{display:none!important}
 [data-hyos-host] .hyos-chat-messages{padding:7px!important}
 [data-hyos-host] .hyos-chat-prompt-tools{overflow-x:auto!important;white-space:nowrap!important}
 [data-hyos-host] .hyos-chat-tool{flex:0 0 auto!important}
 [data-hyos-host] .hyos-chat-composer{left:auto!important;right:auto!important;position:relative!important;bottom:auto!important;margin:4px 5px 0!important}
 [data-hyos-host] .hyos-chat-foot{font-size:8px!important}
 [data-hyos-host] .hytvl-card{flex-basis:82px!important}
 [data-hyos-host] .hytvl-card img{height:90px!important}
}
@container hyos-lite-window (max-height:520px){
 [data-hyos-host] .hyos-chat-top{min-height:42px!important}
 [data-hyos-host] .hyos-chat-messages{padding-block:6px!important}
 [data-hyos-host] .hyos-chat-composer{min-height:52px!important}
 [data-hyos-host] .hymedia-lower{height:112px!important;max-height:112px!important}
 [data-hyos-host] .hymedia-controls{bottom:120px!important}
}
