
/* Phase 24.2 — structural repair and restrained card sizing */
[hidden],
.template-preview-modal[hidden],
.create-command-modal[hidden],
.command-palette[hidden],
.notification-panel[hidden],
.workspace-switcher-menu[hidden],
.sidebar-overlay[hidden]{display:none!important}

.core-template-grid,
.clean-asset-grid,
.stock-media-grid,
.im-record-grid,
.calm-dashboard-row{
  align-items:start!important;
  align-content:start!important
}

.core-template-grid{
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr))!important
}
.core-template-card{
  display:flex;
  flex-direction:column;
  width:100%;
  min-width:0;
  height:auto!important;
  align-self:start
}
.core-template-preview{
  width:100%;
  aspect-ratio:4/3!important;
  min-height:0!important;
  height:auto!important
}
.core-template-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0
}
.core-template-copy h3{overflow-wrap:anywhere}
.core-template-copy p{
  min-height:0!important;
  display:-webkit-box;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3
}
.core-template-copy form{margin-top:auto}

.clean-asset-grid,
.stock-media-grid{
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr))!important
}
.clean-asset-card,
.stock-media-card{
  width:100%;
  min-width:0;
  height:auto!important;
  align-self:start
}
.clean-asset-card .asset-media,
.stock-media-preview{
  width:100%;
  aspect-ratio:4/3!important;
  height:auto!important;
  min-height:0!important
}
.clean-asset-card .asset-media :is(img,video),
.stock-media-preview :is(img,video){
  display:block;
  width:100%;
  height:100%!important;
  object-fit:cover
}

.calm-create-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  align-items:stretch!important
}
.calm-create-grid>a{
  min-width:0;
  min-height:104px!important;
  height:auto!important;
  padding:18px!important
}
.calm-dashboard-row{
  grid-template-columns:minmax(0,1.35fr) minmax(280px,.75fr)!important
}
.calm-dashboard-row>.calm-panel{
  min-width:0;
  height:auto!important
}

.core-template-card *,
.clean-asset-card *,
.stock-media-card *,
.im-record-card *,
.calm-panel *{min-width:0}

.core-template-copy h3,
.core-template-copy p,
.asset-card-body h3,
.stock-media-copy p,
.im-record-card h3,
.im-record-card p{overflow-wrap:anywhere}

.core-toolbar form,
.stock-search-form{
  width:100%;
  max-width:100%
}
.core-toolbar :is(input,select,button),
.stock-search-form :is(input,select,button){min-width:0}

.template-preview-modal{
  position:fixed;
  inset:0;
  z-index:1000
}
.template-preview-modal>section{
  position:relative;
  z-index:2
}
.template-preview-backdrop{z-index:1}

@media(max-width:1100px){
  .calm-create-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .calm-dashboard-row{grid-template-columns:1fr!important}
}

@media(max-width:700px){
  .core-template-grid,
  .clean-asset-grid,
  .stock-media-grid,
  .im-record-grid,
  .calm-create-grid{grid-template-columns:1fr!important}
  .calm-create-grid>a{min-height:88px!important}
}
