#toolbar #btn-search img { width: 20px; height: 20px; filter: invert(1); }
#pdf-search {
  position: fixed; inset: 64px 24px auto auto; margin: 0;
  width: 420px; max-width: calc(100vw - 32px);
  height: 580px; max-height: calc(100dvh - 150px);
  padding: 0; border: 1px solid #ddd; border-radius: 8px;
  color: #232323; background: #fff; box-shadow: 0 12px 44px #0005;
  font-family: inherit; user-select: text; letter-spacing: 0;
}
#pdf-search::backdrop { background: #0006; }
#pdf-search[open] { display: flex; flex-direction: column; }
.search-heading {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; flex: 0 0 auto;
}
.search-heading h2 { margin: 0; font-size: 18px; font-weight: 600; }
#pdf-search .search-icon {
  display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px;
  border: 0; border-radius: 4px; background: transparent; cursor: pointer;
}
#pdf-search .search-icon:hover { background: #f0f2f4; }
#pdf-search .search-icon img { width: 20px; height: 20px; }
#pdf-search-form {
  display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px;
  padding: 0 16px 12px; flex: 0 0 auto;
}
#pdf-search-input {
  width: 100%; min-width: 0; height: 42px; padding: 0 12px;
  border: 1px solid #c9cdd3; border-radius: 4px; font: inherit; font-size: 16px;
  color: #232323; background: #fff; appearance: auto;
}
#pdf-search-input:focus { outline: 2px solid #1b83cc; outline-offset: 1px; }
#pdf-search #pdf-search-submit { width: 40px; height: 42px; background: #eaf3fb; }
#pdf-search-state { padding: 0 16px 12px; font-size: 13px; line-height: 1.6; color: #596473; }
#pdf-search-state.error { color: #ac2525; }
#pdf-search-results { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.search-result {
  display: block; width: 100%; border: 0; border-top: 1px solid #e9eaed;
  padding: 14px 16px; color: #202936; background: #fff; text-align: left;
  font: inherit; cursor: pointer;
}
.search-result:hover, .search-result:focus-visible { background: #f0f6fc; }
.search-result strong { display: block; margin-bottom: 7px; font-size: 14px; color: #1264a2; }
.search-result p { margin: 0; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.search-result mark { background: #fff0aa; color: #202936; }
#pdf-search-more {
  flex: 0 0 auto; margin: 10px 16px; min-height: 38px; border: 1px solid #d7dbe0;
  border-radius: 4px; background: #f6f7f8; color: #283747; font: inherit; cursor: pointer;
}
#pdf-search-more[hidden] { display: none; }
.search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#clear-page-highlight {
  position: fixed; top: calc(48px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 31;
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid #ffffff30; border-radius: 4px; background: #242424e8;
  color: #fff; font: inherit; font-size: 12px; cursor: pointer;
}
#clear-page-highlight img { width: 16px; height: 16px; filter: invert(1); }
#clear-page-highlight[hidden], #page-highlight-status[hidden] { display: none; }
#page-highlight-status {
  position: fixed; top: calc(48px + env(safe-area-inset-top, 0px)); left: 16px; z-index: 31;
  max-width: calc(100vw - 170px); padding: 6px 10px; border-radius: 4px;
  color: #fff; background: #242424e8; font-size: 12px; line-height: 1.6;
}
@media (max-width: 560px) {
  #toolbar #btn-search img { width: 18px; height: 18px; }
  #toolbar { gap: 2px; }
  #toolbar button, #toolbar #download-link { flex: 1 1 28px; width: 28px; min-width: 0; }
  #toolbar #btn-first, #toolbar #btn-last { display: none; }
  #pdf-search {
    inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
    border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .search-heading { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
}
