/* The template library grows without turning into an endless, unfiltered list. */
.catalog-content .template-intro { margin-bottom:25px; }
.catalog-controls { margin:0 0 22px; }
.catalog-search-row { display:flex; align-items:end; gap:16px; margin-bottom:19px; }
.catalog-search { display:block; flex:1; max-width:660px; }
.catalog-search > span,.catalog-category-select > span {
  display:block;
  color:var(--premium-muted);
  font-size:12px;
  font-weight:500;
  margin-bottom:9px;
}
.catalog-search > div { position:relative; }
.catalog-search .icon {
  position:absolute;
  left:15px;
  top:calc(50% - 9px);
  width:18px;
  height:18px;
  color:var(--premium-dim);
  pointer-events:none;
}
.catalog-search input {
  width:100%;
  min-height:48px;
  padding:12px 15px 12px 44px;
  color:var(--premium-text);
  background:var(--premium-input);
  border:1px solid var(--premium-line);
  border-radius:8px;
  font-size:14px;
  outline:none;
  transition:border-color .15s,box-shadow .15s;
}
.catalog-search input:focus,.catalog-category-select select:focus {
  border-color:#8fa45d;
  box-shadow:0 0 0 3px #95ad5f1a;
}
.catalog-search input:focus-visible,.catalog-category-select select:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.catalog-search input::placeholder { color:var(--premium-dim); opacity:1; }
.catalog-category-select { display:none; min-width:220px; }
.catalog-category-select select {
  width:100%;
  min-height:48px;
  padding:11px 35px 11px 13px;
  color:var(--premium-text);
  background:var(--premium-input);
  border:1px solid var(--premium-line);
  border-radius:8px;
  font-size:14px;
  outline:none;
}
.catalog-categories { display:flex; flex-wrap:wrap; gap:9px; }
.catalog-category {
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  padding:10px 13px;
  font-size:12px;
  font-weight:500;
  color:var(--premium-muted);
  border:1px solid var(--premium-line);
  background:transparent;
  border-radius:7px;
  transition:border-color .15s,background .15s;
}
.catalog-category > span { color:var(--premium-dim); font-size:10px; }
.catalog-category:hover { color:var(--premium-text); background:var(--premium-raised); border-color:#6d7a55; }
.catalog-category.active { color:var(--premium-text); background:var(--premium-soft); border-color:#829453; }
.catalog-category.active > span { color:var(--premium-muted); }
.catalog-results-bar {
  display:flex;
  min-height:53px;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:13px 0 0;
}
.catalog-results-bar > p { font-size:12px; color:var(--premium-dim); margin:0; }
html .workspace-premium .catalog-results-bar .button {
  min-height:40px;
  font-size:12px;
  padding:8px 10px;
}
.catalog-results-bar .is-hidden { display:none !important; }
.catalog-content .catalog-grid { min-height:130px; }
.catalog-content .catalog-grid > .premium-template { animation:none; }
.catalog-empty {
  grid-column:1/-1;
  width:100%;
  padding:43px 25px;
  border:1px dashed var(--premium-line);
  border-radius:12px;
  background:var(--premium-surface);
  text-align:center;
}
.catalog-empty > span {
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  margin:0 auto 17px;
  color:var(--accent);
  background:var(--premium-soft);
  border-radius:12px;
}
.catalog-empty > span .icon { width:23px; height:23px; }
.catalog-empty h2 { color:var(--premium-text); font-size:21px; font-weight:500; letter-spacing:-.5px; margin:0 0 10px; }
.catalog-empty p { max-width:460px; margin:0 auto 22px; color:var(--premium-muted); font-size:13px; line-height:1.9; overflow-wrap:anywhere; }
.catalog-empty .button { white-space:normal; }

/* A native selector keeps all available scenarios usable in the creation dialog. */
.create-template-select { margin-bottom:13px; }
.create-template-summary {
  display:flex;
  align-items:flex-start;
  gap:13px;
  padding:16px;
  margin-bottom:22px;
  background:var(--premium-input);
  border:1px solid var(--premium-line);
  border-radius:9px;
}
.create-template-summary-icon {
  display:grid;
  place-items:center;
  width:37px;
  height:37px;
  flex-shrink:0;
  border-radius:9px;
  background:var(--premium-soft);
  color:var(--accent);
}
.create-template-summary-icon .icon { width:20px; height:20px; }
.create-template-summary-icon.mint { color:#a6ceb2; background:#597c4c25; }
.create-template-summary-icon.peach { color:#dec0a0; background:#9b70402b; }
.create-template-summary-icon.blue { color:#aac5d3; background:#5574872b; }
html[data-theme="light"] .create-template-summary-icon.mint { color:#456d4d; }
html[data-theme="light"] .create-template-summary-icon.peach { color:#865d30; }
html[data-theme="light"] .create-template-summary-icon.blue { color:#426a7d; }
.create-template-summary > div { min-width:0; flex:1; }
.create-template-summary strong { display:block; color:var(--premium-text); font-size:13px; font-weight:600; line-height:1.6; }
.create-template-summary p { color:var(--premium-muted); font-size:12px; line-height:1.85; margin:5px 0 8px; }
.create-template-summary small { color:var(--premium-dim); font-size:10px; line-height:1.8; }

@media(max-width:960px) {
  .catalog-search { max-width:none; }
  .catalog-search-row { gap:13px; }
  .catalog-category { padding-left:11px; padding-right:11px; font-size:11px; }
}
@media(max-width:720px) {
  .catalog-content .template-intro { margin-bottom:25px; }
  .catalog-search-row { display:flex; flex-direction:column; align-items:stretch; gap:18px; margin-bottom:8px; }
  .catalog-search { width:100%; }
  .catalog-category-select { display:block; width:100%; min-width:0; }
  .catalog-categories { display:none; }
  .catalog-search > span,.catalog-category-select > span { font-size:12px; }
  .catalog-search input,.catalog-category-select select { min-height:49px; font-size:16px; line-height:1.6; }
  .catalog-search input { padding-top:11px; padding-bottom:11px; }
  .catalog-results-bar { padding-top:9px; min-height:58px; gap:8px; }
  .catalog-results-bar > p { font-size:11px; }
  html .workspace-premium .catalog-results-bar .button { min-height:44px; font-size:11px; padding:9px 4px; gap:5px; }
  .catalog-results-bar .button .icon { width:14px; height:14px; }
  .catalog-controls { margin-bottom:21px; }
  .catalog-empty { padding:32px 20px; }
  .catalog-empty h2 { font-size:20px; line-height:1.5; }
  .catalog-empty p { font-size:13px; }
  html[data-theme] #create-form input,
  html[data-theme] #create-form select { font-size:16px; min-height:48px; }
  .create-template-summary { padding:14px; gap:11px; }
  .create-template-summary-icon { width:33px; height:33px; }
  .create-template-summary strong { font-size:13px; }
  .create-template-summary p { font-size:12px; }
}
@media(prefers-reduced-motion:reduce) {
  .catalog-search input,.catalog-category { transition:none; }
}
