.cert-filter-toolbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: start;
  margin: 0 0 28px;
}

.cert-filter-dropdown {
  position: relative;
  min-width: 0;
}

.cert-filter-dropdown summary {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr 18px;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #d8dde1;
  border-radius: 4px;
  background: #fff;
  color: #202326;
  cursor: pointer;
  list-style: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.cert-filter-dropdown summary::-webkit-details-marker { display: none; }
.cert-filter-dropdown summary::marker { display: none; content: ""; }
.cert-filter-dropdown summary:hover,
.cert-filter-dropdown summary:focus-visible,
.cert-filter-dropdown[open] summary {
  border-color: #ff7820;
  box-shadow: 0 0 0 3px rgba(255, 120, 32, .1);
  outline: none;
}

.cert-filter-dropdown summary span {
  grid-column: 1;
  color: #747c84;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
}

.cert-filter-dropdown summary b {
  grid-column: 1;
  color: #202326;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cert-filter-dropdown summary svg {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ff7820;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.cert-filter-dropdown[open] summary svg { transform: rotate(180deg); }

.cert-filter-options {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 6;
  padding: 8px;
  border: 1px solid #d8dde1;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(28, 34, 39, .14);
}

.cert-filter-options label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 3px;
  color: #33383d;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
}

.cert-filter-options label:hover { background: #fff4ea; }
.cert-filter-options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #ff7820;
}

.cert-filter-clear {
  min-height: 58px;
  padding: 10px 18px;
  border: 1px solid #ff7820;
  border-radius: 4px;
  background: #fff;
  color: #ff7820;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.cert-filter-clear:hover,
.cert-filter-clear:focus-visible {
  color: #202326;
  background: linear-gradient(135deg, #fff, #ffead7);
  outline: none;
}

.cert-filter-clear:disabled {
  color: #9ca3a9;
  border-color: #d8dde1;
  background: #eef0f2;
  cursor: default;
}

.cert-filter-results {
  grid-column: 1 / -1;
  margin: 0;
  color: #697079;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.cert-page-doc[hidden],
.cert-page-empty[hidden],
.cert-page-pagination[hidden] { display: none !important; }

.cert-page-doc {
  min-width: 0;
  height: 100%;
}

.cert-page-paper {
  width: 100%;
  min-height: 304px;
  appearance: none;
  font: inherit;
  cursor: zoom-in;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.cert-page-paper:hover,
.cert-page-paper:focus-visible {
  border-color: #ff7820;
  background: linear-gradient(145deg, #fff 72%, #fff3e8 100%);
  box-shadow: 0 12px 28px rgba(39, 43, 47, .13);
  transform: translateY(-2px);
  outline: none;
}

.cert-page-empty {
  padding: 44px 24px;
  border: 1px dashed #cfd4d8;
  background: #fff;
  text-align: center;
}

.cert-page-empty strong,
.cert-page-empty span { display: block; }
.cert-page-empty strong { color: #202326; font-size: 18px; margin-bottom: 7px; }
.cert-page-empty span { color: #697079; font-size: 13px; }

.cert-page-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.cert-page-pagination-status {
  color: #697079;
  font-size: 12px;
  line-height: 1.4;
}

.cert-page-pagination-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.cert-page-pagination button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8dde1;
  border-radius: 50%;
  background: #fff;
  color: #33383d;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.cert-page-pagination button:hover,
.cert-page-pagination button:focus-visible {
  color: #ff7820;
  border-color: #ff7820;
  background: linear-gradient(135deg, #fff, #ffead7);
  outline: none;
}

.cert-page-pagination button[aria-current="page"] {
  color: #fff;
  border-color: #ff7820;
  background: #ff7820;
}

.cert-page-pagination button:disabled {
  color: #abb1b6;
  border-color: #e3e6e9;
  background: #f2f4f5;
  cursor: not-allowed;
}

.cert-preview-dialog {
  width: min(940px, calc(100% - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #202326;
  box-shadow: 0 28px 70px rgba(15, 18, 20, .32);
  overflow: auto;
}

.cert-preview-dialog:not([open]) { display: none; }
.cert-preview-dialog[open] { display: grid; grid-template-columns: minmax(320px, .95fr) minmax(300px, .75fr); }
.cert-preview-dialog::backdrop { background: rgba(17, 20, 22, .72); backdrop-filter: blur(2px); }

.cert-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8dde1;
  border-radius: 50%;
  background: #fff;
  color: #202326;
  font-size: 26px;
  line-height: 1;
}

.cert-preview-close:hover,
.cert-preview-close:focus-visible { color: #ff7820; border-color: #ff7820; outline: none; }

.cert-preview-media {
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #eef0f2;
}

.cert-preview-media img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 690px;
  display: block;
  border: 1px solid #d6dade;
  box-shadow: 0 10px 30px rgba(27, 32, 36, .12);
}

.cert-preview-copy {
  align-self: center;
  padding: 60px 42px 42px;
}

.cert-preview-copy > span {
  display: block;
  margin-bottom: 10px;
  color: #ff7820;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
}

.cert-preview-copy h2 {
  margin: 0 0 10px;
  color: #202326;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
}

.cert-preview-subtitle { margin: 0 0 26px; color: #626a72; font-size: 14px; line-height: 1.6; }
.cert-preview-note { margin: 0 0 24px; color: #747c84; font-size: 12px; line-height: 1.65; }

.cert-preview-download {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 1px solid #ff7820;
  border-radius: 4px;
  background: #fff;
  color: #ff7820;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  transition: color .2s ease, background .2s ease;
}

.cert-preview-download:hover,
.cert-preview-download:focus-visible {
  color: #202326;
  background: linear-gradient(135deg, #fff, #ffead7);
  outline: none;
}

@media (max-width: 1100px) {
  .cert-filter-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cert-filter-clear { grid-column: 1 / -1; min-height: 44px; }
}

@media (max-width: 767px) {
  .cert-filter-toolbar { grid-template-columns: 1fr; }
  .cert-filter-clear,
  .cert-filter-results { grid-column: 1; }
  .cert-filter-results { text-align: left; }
  .cert-filter-options { position: static; margin-top: 5px; box-shadow: none; }
  .cert-page-doc-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  .cert-page-doc:last-child { grid-column: auto !important; width: auto !important; justify-self: stretch !important; }
  .cert-page-paper { min-height: 390px !important; padding: 34px 18px !important; }
  .cert-page-paper-brand { margin-bottom: 48px !important; }
  .cert-page-paper-mark { font-size: 20px !important; }
  .cert-page-paper h3 { font-size: 23px !important; }
  .cert-page-seal { width: 66px !important; height: 66px !important; margin-top: 28px !important; }
  .cert-preview-dialog[open] { display: block; }
  .cert-preview-media { min-height: auto; padding: 52px 18px 18px; }
  .cert-preview-media img { max-height: 62vh; }
  .cert-preview-copy { padding: 28px 22px 30px; }
  .cert-preview-copy h2 { font-size: 24px; }
  .cert-preview-download { width: 100%; }
}

@media (max-width: 575px) {
  .cert-page-pagination { gap: 10px; margin-top: 24px; }
  .cert-page-pagination-status { width: 100%; text-align: center; }
  .cert-page-pagination button { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .cert-page-paper,
  .cert-filter-dropdown summary,
  .cert-filter-dropdown summary svg { transition: none; }
}
