/* Cat Atelier material finish. Load after cat-polish.css.
   Decorative surfaces only: no filters, transforms, or color overlays on assets. */
body {
  --mat-surface: #122639;
  --mat-surface-top: #172e43;
  --mat-paper: #172d41;
  --mat-field: #0c1d2d;
  --mat-line: #395267;
  --mat-line-soft: #2b4358;
  --mat-copy: #edf5fb;
  --mat-muted: #b6c8d5;
  --mat-accent: #9be5cd;
  --mat-accent-soft: #193c3e;
  --mat-shine: #cfeeff14;
  --mat-shadow: 0 2px 5px #020b141c, 0 12px 28px #020b142b;
  --mat-card-shadow: 0 2px 3px #020b1429, 0 6px 16px #020b141f;
  --mat-focus-shadow: 0 0 0 3px #9be5cd24;
  --mat-cta: linear-gradient(145deg, #ffc19b, #f69bb1);
  --mat-cta-copy: #482d38;
  --mat-cta-line: #fac0ae;
  --mat-cta-shadow: 0 2px 3px #020b142e, 0 6px 16px #f69bb118;
  --glass-bg: #102639dc;
  --glass-line: #a6c5d52e;
  --glass-shine: #edfaff18;
  --glass-shadow: var(--mat-shadow);
  --ui-copy: var(--mat-copy);
  --ui-muted: var(--mat-muted);
  --ui-border: var(--mat-line);
  --ui-border-soft: var(--mat-line-soft);
}
body.theme-light {
  --mat-surface: #fffaf4;
  --mat-surface-top: #fffefb;
  --mat-paper: #fffdf9;
  --mat-field: #fffefd;
  --mat-line: #d8c9bf;
  --mat-line-soft: #e9dfd5;
  --mat-copy: #483c42;
  --mat-muted: #796671;
  --mat-accent: #326f5f;
  --mat-accent-soft: #e9f3ed;
  --mat-shine: #ffffff;
  --mat-shadow: 0 2px 4px #7e584b06, 0 12px 28px #7e584b12;
  --mat-card-shadow: 0 2px 3px #7e584b07, 0 6px 16px #7e584b0c;
  --mat-focus-shadow: 0 0 0 3px #428c7526;
  --mat-cta: linear-gradient(145deg, #b84e62, #a94569);
  --mat-cta-copy: #fff;
  --mat-cta-line: #ae4660;
  --mat-cta-shadow: 0 2px 3px #9f3c5a18, 0 6px 16px #c1668226;
  --glass-bg: #fffaf1e3;
  --glass-line: #c4ad9d66;
  --glass-shine: #ffffff;
  --glass-shadow: var(--mat-shadow);
  --ui-copy: var(--mat-copy);
  --ui-muted: var(--mat-muted);
  --ui-border: var(--mat-line);
  --ui-border-soft: var(--mat-line-soft);
}

/* Local glass remains bounded to navigation, search and floating chrome. */
body .cat-hero, body.theme-light .cat-hero,
body .cat-tool-hero, body.cat-page.theme-light .cat-tool-hero,
body.cat-project-page header, body.cat-project-page.theme-light header,
body .search-shell, body.theme-light .search-shell {
  background: linear-gradient(155deg, #ffffff05, #ffffff00 65%), var(--glass-bg);
  border-color: var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-shine), var(--mat-shadow);
}
body .cat-hero, body .cat-tool-hero, body.cat-project-page header { border-radius: 22px; }
body .brand-copy h1, body .tool-brand h1 { letter-spacing: -.025em; }
body .cat-nav a { font-weight: 600; letter-spacing: .01em; }
body .cat-nav a.cat-nav-active { border-bottom-width: 2px; }
body .hero-actions :is(button, .tool-back),
body.cat-project-page .project-actions :is(button, a) {
  box-shadow: inset 0 1px 0 var(--mat-shine), 0 1px 2px #00000008;
}
body .hero-showcase, body.theme-light .hero-showcase {
  box-shadow: inset 0 1px 0 var(--mat-shine), var(--mat-shadow);
}
body .showcase-copy h2 { letter-spacing: -.04em; }
body .showcase-copy p { line-height: 1.8; }
body .showcase-mini-stats { gap: 24px; }
body .showcase-mini-stats span + span { padding-left: 23px; border-left: 1px solid var(--glass-line); }
body .showcase-mini-stats b { letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* A shallow recessed search well provides hierarchy without blurring text. */
body .search-shell .searchbar, body.theme-light .search-shell .searchbar {
  background: var(--mat-field);
  border-color: var(--mat-line);
  box-shadow: inset 0 2px 4px #00000007, 0 1px 0 var(--mat-shine), 0 0 0 4px #b9918108;
  transition: border-color .2s ease, box-shadow .2s ease;
}
body .search-shell .searchbar:focus-within, body.theme-light .search-shell .searchbar:focus-within {
  border-color: var(--mat-accent);
  box-shadow: var(--mat-focus-shadow), inset 0 1px 3px #00000005;
}
body .search-shell .searchbar input { color: var(--mat-copy); }
body .search-shell .searchbar input::placeholder { color: var(--mat-muted); opacity: .9; }
body .quick-searches button, body.theme-light .quick-searches button {
  color: var(--mat-muted);
  background: var(--mat-paper);
  border-color: var(--mat-line-soft);
  box-shadow: inset 0 1px 0 var(--mat-shine);
}
body .quick-searches button:hover, body.theme-light .quick-searches button:hover {
  color: var(--mat-accent); background: var(--mat-accent-soft); border-color: var(--mat-accent);
}
body .section-heading h2, body .search-title h2 { letter-spacing: -.025em; }
body .collection-card, body.theme-light .collection-card {
  background: linear-gradient(155deg, var(--mat-surface-top), var(--mat-surface));
  border-color: var(--mat-line-soft);
  color: var(--mat-copy);
  box-shadow: inset 0 1px 0 var(--mat-shine), var(--mat-card-shadow);
}
body .collection-card::after { display: none; }
body .collection-card:hover, body.theme-light .collection-card:hover {
  border-color: var(--mat-accent);
  box-shadow: inset 0 1px 0 var(--mat-shine), var(--mat-shadow);
}
body .collection-card .collection-icon { box-shadow: inset 0 1px 0 var(--mat-shine); }
body .collection-card small, body.theme-light .collection-card small { color: var(--mat-muted); }
body .collection-card em, body.theme-light .collection-card em { color: var(--mat-accent); font-weight: 600; }

/* Opaque work surfaces protect both reading contrast and image inspection. */
body .filters, body.theme-light .filters,
body .content, body.theme-light .content,
body.cat-page.cat-tool-page .panel, body.cat-page.cat-tool-page.theme-light .panel,
body.cat-page.cat-tool-page .result-toolbar, body.cat-page.cat-tool-page.theme-light .result-toolbar {
  background: linear-gradient(160deg, var(--mat-surface-top), var(--mat-surface) 72%);
  border-color: var(--mat-line-soft);
  color: var(--mat-copy);
  box-shadow: inset 0 1px 0 var(--mat-shine), var(--mat-shadow);
}
body .filters { padding-top: 20px; }
body .filter-heading { padding-bottom: 15px; }
body .field label { color: var(--mat-muted); font-weight: 500; }
body .field select,
body .quick-open-row input,
body.cat-page.cat-tool-page .field :is(input[type=text], input[type=number], input[type=search], select),
body.cat-page.cat-tool-page.theme-light .field :is(input[type=text], input[type=number], input[type=search], select),
body.cat-page.cat-tool-page .result-toolbar :is(select, input),
body.cat-page.cat-tool-page.theme-light .result-toolbar :is(select, input) {
  background-color: var(--mat-field);
  border-color: var(--mat-line);
  color: var(--mat-copy);
  box-shadow: inset 0 1px 2px #00000005, 0 1px 0 var(--mat-shine);
  border-radius: 11px;
  min-height: 40px;
  max-width: 100%;
}
body .field select:hover { border-color: var(--mat-muted); }
body .field :is(input, select):focus-visible { border-color: var(--mat-accent); box-shadow: var(--mat-focus-shadow); }
body .toolbar .badge, body.theme-light .toolbar .badge {
  color: var(--mat-muted); background: transparent; border-color: var(--mat-line-soft);
}
body .chip-removable {
  background: var(--mat-accent-soft); border-color: var(--mat-line-soft); color: var(--mat-accent);
  box-shadow: inset 0 1px 0 var(--mat-shine);
}
body .chip-removable .chip-remove { color: var(--mat-accent); }
body .card, body.theme-light .card,
body.cat-project-page .card, body.cat-project-page.theme-light .card,
body.cat-page.cat-tool-page .tool-card, body.cat-page.cat-tool-page.theme-light .tool-card,
body.cat-page.cat-tool-page .result-card, body.cat-page.cat-tool-page.theme-light .result-card {
  border-color: var(--mat-line-soft);
  background: linear-gradient(160deg, var(--mat-surface-top), var(--mat-paper) 60%);
  color: var(--mat-copy);
  box-shadow: inset 0 1px 0 var(--mat-shine), var(--mat-card-shadow);
}
body .card:hover, body .card:focus-within,
body.theme-light .card:hover, body.theme-light .card:focus-within,
body.cat-project-page .card:hover, body.cat-project-page.theme-light .card:hover,
body.cat-page.cat-tool-page .tool-card:hover, body.cat-page.cat-tool-page.theme-light .tool-card:hover {
  border-color: var(--mat-line);
  box-shadow: inset 0 1px 0 var(--mat-shine), var(--mat-shadow);
}
body.cat-page.cat-tool-page .tool-card.active, body.cat-page.cat-tool-page.theme-light .tool-card.active {
  border-color: var(--mat-accent);
  box-shadow: inset 0 1px 0 var(--mat-shine), inset 3px 0 0 var(--mat-accent), var(--mat-card-shadow);
}
body .card h3 { font-weight: 700; letter-spacing: -.012em; }
body .card .body { gap: 11px; }
body .card .tag { border-color: var(--mat-line-soft); background: var(--mat-surface); color: var(--mat-muted); }
body .card .asset-id code { background: var(--mat-field); border-color: var(--mat-line-soft); color: var(--mat-muted); }
body .card .asset-id-label, body.theme-light .card .asset-id-label { color: var(--mat-muted); }
body .card-details summary { color: var(--mat-muted); }
body .card-details-content { border-color: var(--mat-line-soft); background: var(--mat-field); }
body .card .asset-actions { border-color: var(--mat-line-soft); }
body .card .admin-load {
  background: var(--mat-accent-soft); color: var(--mat-accent); border-color: var(--mat-line-soft);
  box-shadow: inset 0 1px 0 var(--mat-shine);
}
body .card .admin-load:hover { border-color: var(--mat-accent); }

/* Main actions are deliberately more substantial than navigation and links. */
body .showcase-actions .primary, body.theme-light .showcase-actions .primary,
body .search-shell .searchbar .primary, body.theme-light .search-shell .searchbar .primary,
body .floating-search .floating-submit,
body .admin-actions .primary,
body.cat-page.cat-tool-page .primary, body.cat-page.cat-tool-page.theme-light .primary {
  background: var(--mat-cta);
  color: var(--mat-cta-copy);
  border: 1px solid var(--mat-cta-line);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 #ffffff38, var(--mat-cta-shadow);
  font-weight: 700;
  text-shadow: none;
}
body .showcase-actions .primary:hover, body .search-shell .searchbar .primary:hover,
body .floating-search .floating-submit:hover, body .admin-actions .primary:hover,
body.cat-page.cat-tool-page .primary:hover {
  box-shadow: inset 0 1px 0 #ffffff55, var(--mat-cta-hover-shadow, 0 3px 5px #00000012, 0 8px 18px #ba647c2b);
}
body .showcase-actions .primary:active, body .search-shell .searchbar .primary:active,
body .floating-search .floating-submit:active, body .admin-actions .primary:active,
body.cat-page.cat-tool-page .primary:active {
  box-shadow: inset 0 2px 4px #0000001c, 0 1px 2px #0000000d;
}
body :is(.filter-reset, .copy-id, #clearBtn, .floating-filters) {
  box-shadow: inset 0 1px 0 var(--mat-shine), 0 1px 2px #00000005;
}
body .admin-head, body .viewer-toolbar { border-bottom-color: var(--mat-line-soft); }
body .admin-head h2, body .viewer-title { letter-spacing: -.02em; }
body .admin-controls, body .admin-metrics { border-color: var(--mat-line-soft); }

@media (max-width: 860px) {
  body .cat-hero, body .cat-tool-hero, body.cat-project-page header { border-radius: 18px; }
  body .showcase-mini-stats { gap: 18px; }
  body .showcase-mini-stats span + span { padding-left: 17px; }
}
@media (max-width: 560px) {
  body .showcase-mini-stats { gap: 12px; }
  body .showcase-mini-stats span + span { padding-left: 11px; }
  body .collection-card { min-height: 114px; }
  body .card .body { gap: 10px; }
  body .search-shell .searchbar { border-radius: 14px; }
}
