@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --rp-blue: #003494;
  --rp-blue-hover: #1a4ab3;
  --rp-blue-accent: #2d7dd2;
  --rp-blue-light: #eef3fd;
  --rp-bg: #f1f4fa;
  --rp-border: #dde3ee;
  --rp-border-soft: #eaeff8;
  --fg-1: #0e1929;
  --fg-2: #4a494a;
  --fg-3: #5a7494;
  --ok-bg: #edfbf4;
  --ok-fg: #0d6644;
  --warn-bg: #fff7e6;
  --warn-fg: #8a5a00;
  --err-bg: #fdecea;
  --err-fg: #b42318;
  --font-sans: 'Open Sans', Calibri, Arial, sans-serif;
  /* Single source of truth for the card grid min-column width. JS reads this
     value via getComputedStyle so its page-size calc stays in sync with the
     CSS grid below. Override via media queries to react to the viewport. */
  --card-min-width: 220px;
  --card-gap: 10px;
  --card-row-height: 306px;
  /* Right-padding the search zone reserves room for the absolutely positioned
     Merkliste FAB so the search input never slips behind it. Override via
     media queries when the FAB shrinks. */
  --search-zone-right-pad: 200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  /* Transparent body so the embedding page (CMS iframe) provides the surrounding
     surface color. In standalone use the .app-shell still paints its own light bg. */
  background: transparent;
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { border: 0; }
a { color: inherit; text-decoration: none; border-bottom: 0; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cedc; border-radius: 99px; }

.app-shell {
  /* Full width by default so iframe embeds use the parent's full content
     column. The light background stays inside the tool. position:relative is
     required so the floating "Merkliste" FAB can be positioned against the
     tool itself instead of the browser viewport (which would float wrong
     when embedded). */
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--rp-bg);
}

.search-zone {
  background: linear-gradient(160deg, #eef3fd, #dce7f8);
  border-bottom: 1px solid #d0daea;
  /* Right padding leaves room for the absolutely-positioned Merkliste button
     in the top-right corner of the .app-shell. The custom property is reset
     by the media queries below as the FAB shrinks for narrow viewports. */
  padding: 20px var(--search-zone-right-pad) 16px 24px;
}

.search-title {
  margin-bottom: 12px;
  color: var(--rp-blue);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.search-title span {
  margin-left: 10px;
  color: var(--fg-3);
  font-size: 16px;
  font-weight: 400;
}

.search-row { display: flex; align-items: center; gap: 8px; }
.search-wrap { position: relative; flex: 1; max-width: 680px; }
.search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rp-blue);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 40px;
  border: 2px solid rgba(0, 52, 148, .2);
  border-radius: 8px;
  background: #fff;
  color: var(--fg-1);
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 30, 100, .08);
  transition: border-color 150ms, box-shadow 150ms;
}

.search-input:focus {
  border-color: var(--rp-blue);
  box-shadow: 0 0 0 3px rgba(0, 52, 148, .12);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 99px;
  background: var(--rp-border);
  color: var(--fg-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover { background: #b8c4d4; }
.app-body { flex: 1; display: flex; min-height: 0; overflow: hidden; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 18px 14px;
  background: #fff;
  border-right: 1px solid var(--rp-border);
}

.filter-group { margin-bottom: 24px; }
.sg-label {
  margin: 0 0 8px;
  padding: 0 6px;
  color: var(--rp-blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  border: 0;
  padding: 5px 6px;
  border-radius: 5px;
  background: transparent;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: background 100ms, color 100ms;
}

.sf:hover { background: var(--rp-blue-light); color: var(--rp-blue); }
.sf.on { background: var(--rp-blue-light); color: var(--rp-blue); font-weight: 800; }
.sf-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-n {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--rp-bg);
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 700;
}
.sf.on .sf-n { background: rgba(0, 52, 148, .12); color: var(--rp-blue); }
.reset-side { width: 100%; justify-content: center; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 47px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--rp-border-soft);
}
.toolbar-spacer { flex: 1; }
.status { color: var(--fg-2); font-size: 14px; font-weight: 500; }
.status strong { color: var(--rp-blue); font-weight: 800; }

.btn-g {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1.5px solid var(--rp-border);
  border-radius: 5px;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 120ms;
}
.btn-g:hover:not(:disabled) { border-color: var(--rp-blue-accent); color: var(--rp-blue); background: var(--rp-blue-light); }
.btn-g:disabled { opacity: .45; cursor: not-allowed; }

.btn-ico {
  width: 26px;
  height: 26px;
  border: 1px solid var(--rp-border);
  border-radius: 5px;
  background: #fff;
  color: var(--fg-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 120ms;
}
.btn-ico:hover { border-color: var(--rp-blue); color: var(--rp-blue); background: var(--rp-blue-light); }

.cb {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border: 1.5px solid #c5cedc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb.on, .cb.mid { background: var(--rp-blue); border-color: var(--rp-blue); }
.cb.on::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.cb.mid::after { content: ""; width: 8px; height: 2px; background: #fff; border-radius: 99px; }

.vtog { display: flex; overflow: hidden; border: 1.5px solid var(--rp-border); border-radius: 6px; }
.vt {
  width: 30px;
  height: 28px;
  background: #fff;
  color: var(--fg-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vt:not(:last-child) { border-right: 1.5px solid var(--rp-border); }
.vt.on { background: var(--rp-blue); color: #fff; }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 0;
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--rp-blue);
  color: #fff;
}
.bulk-txt { flex: 1; font-size: 14px; font-weight: 600; }
.bulk-btn {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 99px;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.bulk-btn:hover { background: rgba(255,255,255,.28); }
.bulk-x {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.bulk-x:hover { background: rgba(255,255,255,.3); }

.results-wrap { flex: 1; overflow: auto; padding: 14px; }
.results-list { display: flex; flex-direction: column; gap: 0; }
.prod-group-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--rp-border-soft);
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 800;
}
.prod-group-hd:first-child { margin-top: 0; }
.prod-select {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.prod-group-meta { color: var(--fg-3); font-weight: 600; }

.dl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding: 10px 14px;
  border: 1px solid var(--rp-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
.dl-row:hover { border-color: #a8b8cc; box-shadow: 0 1px 6px rgba(0,20,80,.07); }
.dl-row.sel { border-color: var(--rp-blue); background: #f4f7ff; }
.row-main { min-width: 0; flex: 1; }
.row-title {
  color: var(--rp-blue);
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 4px; color: var(--fg-3); font-size: 13px; }
.row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr)); gap: var(--card-gap); }
.dl-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 296px;
  border: 1px solid var(--rp-border);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms;
}
.dl-card:hover { border-color: #a8b8cc; box-shadow: 0 2px 10px rgba(0,20,80,.08); }
.dl-card.sel { border-color: var(--rp-blue); box-shadow: 0 0 0 2px rgba(0,52,148,.1); }
.card-thumb {
  position: relative;
  width: 100%;
  height: 110px;
  background: linear-gradient(135deg, rgba(0,52,148,.1), rgba(45,125,210,.18));
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  pointer-events: none;
}
.card-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
/* Icon-fallback variant: neutral light surface, line icon in muted blue.
   Replaces the previous colored letter+digit code badge. */
.prod-thumb.prod-thumb-icon {
  background: #f1f4fa;
  color: var(--rp-blue);
  text-shadow: none;
}
.prod-thumb.prod-thumb-icon svg {
  width: 70%;
  height: 70%;
  display: block;
}
/* Inline icon next to the product-type label inside the group header.
   Same visual vocabulary as the larger thumb-icon, just minified. Acts as
   a quick visual recognition mark when scrolling through long lists. */
.prod-type-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  color: var(--rp-blue);
  vertical-align: -2px;
}
.prod-type-ico svg { width: 100%; height: 100%; }
.prod-group-meta-text { vertical-align: middle; }
/* Doctype badge color for product-image entries. Photos are visual content,
   not document content — use a neutral mid-tone so they read distinctly
   from the colored doctype family (datasheet/manual/declaration/…). */
.dtb-product-image,
.dtb-product-image-cropped,
.dtb-product-image-view {
  background: #eef3fd;
  color: var(--rp-blue);
}
.card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.card-title { color: var(--rp-blue); font-size: 16px; font-weight: 800; }
.card-detail { color: var(--fg-3); font-size: 13px; line-height: 1.35; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.card-action-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-action-right { display: flex; align-items: center; gap: 4px; }
.card-cb { position: absolute; top: 8px; right: 8px; }

.prod-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--rp-blue), var(--rp-blue-accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}

.ft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ft-pdf { background: #fdecea; color: #b42318; }
.ft-dwg, .ft-dxf, .ft-jpg, .ft-png { background: #fff3e0; color: #8a5a00; }
.ft-zip { background: #edfbf4; color: #0d6644; }
.ft-doc, .ft-docx { background: #eef3fd; color: #003494; }
.ft-exe { background: #f3eeff; color: #5c2d8a; }
.ft-step, .ft-stp, .ft-ifc, .ft-rfa, .ft-file { background: #f1f4fa; color: #4a494a; }

.dtb {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--rp-blue-light);
  color: var(--rp-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.btn-product {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--rp-blue);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.btn-product:hover { color: var(--rp-blue-hover); }

.star {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: transparent;
  color: #d0daea;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.star:hover { background: rgba(245,166,35,.1); color: #f5a623; }
.star.on { color: #f5a623; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 20px 0 8px; }
.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1.5px solid var(--rp-border);
  border-radius: 5px;
  background: #fff;
  color: var(--fg-2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}
.page-btn.on { background: var(--rp-blue); border-color: var(--rp-blue); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

.empty {
  padding: 48px 16px;
  color: var(--fg-3);
  text-align: center;
}
.empty h3 { margin-top: 12px; color: var(--fg-2); font-size: 18px; }
.empty p { margin-top: 4px; font-size: 15px; }

.merk-fab {
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: 99px;
  background: var(--rp-blue);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,52,148,.3);
  font-size: 15px;
  font-weight: 800;
}
.merk-fab:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,52,148,.38); }
.merk-fab-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: #f5a623;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(14,25,41,.34);
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(380px, 100vw);
  height: 100vh;
  background: #fff;
  box-shadow: -8px 0 30px rgba(0,20,80,.18);
  display: flex;
  flex-direction: column;
}
.drawer-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--rp-border);
}
.drawer-hd h2 { flex: 1; color: var(--rp-blue); font-size: 20px; }
.drawer-body { flex: 1; overflow: auto; padding: 12px; }
.drawer-foot { padding: 14px; border-top: 1px solid var(--rp-border); }
.drawer-zip {
  padding: 12px 18px;
  border-bottom: 1px solid var(--rp-border);
  background: #f7f9fc;
}
.drawer-zip-btn {
  width: 100%;
  justify-content: center;
  background: var(--rp-blue);
  border-color: var(--rp-blue);
  color: #fff;
}
/* Override the inherited .bulk-btn:hover (which is white-on-blue, designed
   for the blue bulk bar). The drawer ZIP button already sits on a light
   background, so on hover we go DARKER blue, not lighter. */
.drawer-zip-btn:hover {
  background: #002a78;
  border-color: #002a78;
  color: #fff;
}
.merk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rp-border-soft);
}
.merk-row-info { flex: 1; min-width: 0; }
.merk-row-name { overflow: hidden; color: var(--fg-1); font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.merk-row-sub { margin-top: 3px; color: var(--fg-3); font-size: 13px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  z-index: 110;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 7px;
  background: #0e1929;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  font-size: 14px;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ZIP layout alignment: compact search, quiet sidebar, grouped document rows. */
.app-shell {
  /* width override removed -- iframe-friendly full-width version is at the
     top of this file. Keep only the surface color rule here so this section
     remains a no-op for layout. */
  background: var(--rp-bg);
}

.search-zone {
  min-height: 80px;
}

.search-wrap {
  max-width: 600px;
}

.app-body {
  background: var(--rp-bg);
}

.sidebar {
  width: 260px;
  padding: 18px 14px;
}

.filter-group {
  margin-bottom: 20px;
  padding-bottom: 18px;
}

.filter-group:not(:last-of-type) {
  border-bottom: 1px solid var(--rp-border);
}

.sg-label {
  margin-bottom: 4px;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.sf {
  padding: 5px 6px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.sf-label {
  overflow: visible;
  text-overflow: clip;
}

.sf.on {
  font-weight: 700;
}

.content {
  background: var(--rp-bg);
}

.toolbar {
  min-height: 46px;
  padding: 8px 16px;
}

.status {
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 500;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  height: 16px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--rp-blue-light);
  color: var(--rp-blue);
  font-size: 12px;
  font-weight: 800;
}

.results-wrap {
  padding: 14px 14px 16px;
}

.prod-group-hd {
  margin-top: 16px;
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--rp-border-soft);
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 700;
}

.prod-group-hd:first-child {
  margin-top: 0;
}

.prod-select {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.prod-group-meta {
  color: var(--fg-3);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  max-width: min(48vw, 520px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-group {
  margin-bottom: 8px;
}

.prod-group .prod-group-hd {
  position: relative;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 52, 148, 0.04);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.prod-group .prod-group-hd:hover {
  border-color: #b7cbea;
  background: #f8fbff;
  box-shadow: 0 3px 10px rgba(0, 52, 148, 0.08);
}

.prod-group.open .prod-group-hd {
  border-color: #9fb9e4;
  background: #f6f9ff;
}

.prod-group-count {
  margin-left: auto;
  color: var(--fg-3);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.prod-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--fg-3);
  background: transparent;
  cursor: pointer;
  transition: color 0.16s ease, transform 0.16s ease, background 0.16s ease;
  flex-shrink: 0;
}

.prod-toggle svg {
  display: block;
  transition: transform 0.16s ease;
}

.prod-group.open .prod-toggle svg {
  transform: rotate(180deg);
}

.prod-group .prod-group-hd:hover .prod-toggle {
  color: var(--rp-blue);
}

.prod-group-body {
  padding-top: 6px;
}

.prod-thumb-code {
  font-size: 12px;
  font-weight: 800;
}

.dl-row {
  margin-left: 14px;
  margin-bottom: 4px;
  padding: 10px 14px;
}

.row-title {
  color: var(--fg-1);
  font-size: 14px;
  font-weight: 700;
}

.row-sub {
  display: block;
  margin-top: 1px;
  color: var(--fg-3);
  font-size: 13px;
}

.row-actions {
  gap: 6px;
  margin-left: auto;
}

.btn-product {
  color: var(--rp-blue-accent);
  font-size: 13px;
  font-weight: 700;
}

.dtb {
  font-weight: 800;
}

.dtb-bim,
.dtb-technical-drawing {
  background: #fff3e0;
  color: #8a5a00;
}

.dtb-tender {
  background: #edfbf4;
  color: #0d6644;
}

.dtb-declaration {
  background: #fdecea;
  color: #b42318;
}

.dtb-manual {
  background: #f1f4fa;
  color: #4a494a;
}

.dtb-datasheet {
  background: var(--rp-blue-light);
  color: var(--rp-blue);
}

/* Override block intentionally empty — single source of truth lives in the
   .card-grid base rule above and reacts to --card-min-width via media queries. */

.toolbar .bulk-bar {
  flex: 0 0 auto;
  height: 30px;
  margin: 0 0 0 8px;
  padding: 0 8px;
  border-radius: 5px;
}

.toolbar .bulk-txt {
  flex: 0 0 auto;
  white-space: nowrap;
}

.toolbar .bulk-btn {
  height: 22px;
  padding: 0 8px;
}

.toolbar .bulk-x {
  width: 20px;
  height: 20px;
}

/* === Responsive tiers ===
   Goal: stay usable from ~320 px phones up to wide desktop, including the
   embedded iframe variant on rp-group.com (where the iframe column is often
   between 700 and 1200 px). The CSS custom properties drive both the grid
   sizing and the right-padding for the floating Merkliste button. JS reads
   --card-min-width and --card-gap via getComputedStyle so the page-size
   calculation matches what the grid actually renders.

   Tiers:
     >1100 px : default (sidebar 260, cards 220 min)
     820-1100 : sidebar a bit tighter, cards 200 min
     560-820  : sidebar collapses on top, cards 180 min, FAB shrinks
     <560     : single column cards, ultra-compact toolbar, FAB absorbs into
                a small icon-only badge so the search row keeps full width
*/

@media (max-width: 1100px) {
  :root {
    --card-min-width: 200px;
    --search-zone-right-pad: 180px;
  }
  .sidebar { width: 220px; padding: 16px 10px; }
  .search-zone { padding-right: var(--search-zone-right-pad); }
}

@media (max-width: 820px) {
  :root {
    --card-min-width: 180px;
    --search-zone-right-pad: 16px;
  }
  /* The colored doc-type pill in each row repeats the row title, which steals
     horizontal space at narrow widths and visually collides with the title.
     Hide it here — the file-type icon on the left + the row title still
     communicate the doctype clearly. */
  .dl-row .row-actions .dtb { display: none; }

  .app-body { flex-direction: column; overflow: visible; }
  .sidebar {
    width: 100%;
    max-height: 200px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--rp-border);
  }
  /* Side-by-side filter groups so the sidebar doesn't waste vertical space
     on narrow viewports. They stay readable because each group is allowed
     to shrink individually. */
  .sidebar { display: flex; flex-wrap: wrap; gap: 0 18px; align-items: flex-start; }
  .filter-group { flex: 1 1 220px; margin-bottom: 8px; }
  .reset-side { flex-basis: 100%; margin-top: 4px; }

  .content { overflow: visible; }
  .toolbar { flex-wrap: wrap; row-gap: 6px; }
  .toolbar-spacer { display: none; }
  .results-wrap { overflow: visible; }

  /* Compact merk-fab: same blue pill, just tighter. We move it to the bottom
     of the search-zone padding column so it stops fighting the search input
     for horizontal space. */
  .merk-fab {
    top: 16px;
    right: 16px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  /* The search-row needs full width again now that the FAB pad is gone. */
  .search-zone { padding-top: 64px; padding-bottom: 12px; padding-left: 16px; }
}

@media (max-width: 560px) {
  :root {
    --card-min-width: 1fr;
  }
  .card-grid { grid-template-columns: 1fr; }

  .toolbar { padding: 8px 10px; }
  .toolbar .btn-g .label,
  .toolbar #downloadAllBtn { font-size: 12px; }

  /* Drawer takes the full screen on tiny phones. */
  .drawer { width: 100vw; }

  /* Bulk-bar uses the full row when active so the buttons don't get squeezed
     into invisibility next to the toolbar's other controls. */
  .toolbar .bulk-bar { order: 99; flex-basis: 100%; margin-left: 0; }

  /* Side-by-side filter groups would be too cramped — stack them again. */
  .sidebar { flex-direction: column; gap: 0; max-height: 240px; }
  .filter-group { flex-basis: auto; }
}
