.public-sources {
  margin: 36px 0 0;
  padding: 28px 26px;
  border: 1px solid var(--state-line, #d7e2df);
  border-radius: 16px;
  background: #f4f8f7;
  color: #17252d;
}

.public-sources__kicker {
  margin: 0 0 10px;
  color: #0b2340;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.public-sources h2,
.public-sources h3 {
  margin: 0 0 10px;
  color: #0b2340;
}

.public-sources p,
.public-sources legend,
.public-sources label {
  color: #17252d;
}

.public-sources__lead {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.45;
}

.public-sources fieldset {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #d7e2df;
  border-radius: 12px;
  background: #fff;
}

.public-sources legend {
  padding: 0 6px;
  font-weight: 750;
}

.public-sources__lane {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-size: 18px;
  font-weight: 700;
}

.public-sources__query-label {
  display: block;
  margin: 0 0 8px;
  font-weight: 750;
}

.public-sources input[type="search"] {
  width: 100%;
  min-height: 52px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 2px solid #0b2340;
  border-radius: 12px;
  background: #fff;
  color: #17252d;
  font: inherit;
  font-size: 18px;
}

.public-sources__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.public-sources .btn {
  min-height: 48px;
}

.public-sources .btn.ghost {
  background: #fff;
  color: #0b2340;
  border: 2px solid #0b2340;
}

.public-sources .btn.ghost:disabled {
  background: #e7eeec;
  color: #0b2340;
  border-color: #596b70;
  opacity: 1;
  cursor: not-allowed;
}

.public-sources__reason,
.public-sources__status,
#public-handbook-status {
  max-width: 760px;
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.45;
}

.public-sources__status {
  font-weight: 750;
}

.public-sources[data-recording="true"] .public-sources__status {
  padding: 10px 12px;
  border: 2px solid #8c1d1d;
  border-radius: 10px;
  background: #fff;
}

#public-source-answer {
  max-width: 760px;
  margin-top: 16px;
}

#public-source-answer-text {
  margin: 0;
  color: #17252d;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.35;
}

.state-gateway > .public-sources {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .state-gateway {
    padding-top: 28px;
  }

  .state-gateway__intro h1 {
    margin-bottom: 10px;
    font-size: 30px;
  }

  .state-gateway > .public-sources {
    margin-top: 8px;
    padding: 14px 14px 16px;
  }

  .public-sources h2 {
    margin-bottom: 6px;
  }

  .public-sources__lead {
    margin-bottom: 10px;
    font-size: 16px;
  }
}

#public-handbook[data-state="missing"] {
  border: 2px solid #0b2340;
  border-radius: 12px;
  background: #fff;
}

#public-handbook[data-asked="true"] {
  background: #fff4d6;
  padding: 12px 14px;
}

.public-sources[data-recording="true"] .public-sources__status::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border-radius: 50%;
  background: #8c1d1d;
  box-shadow: 0 0 0 4px rgba(140, 29, 29, .18);
  vertical-align: -1px;
}

.public-sources__cite {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 12px 14px;
  border: 2px solid #0b2340;
  border-radius: 12px;
  background: #fff;
  color: #0b2340;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

#public-handbook {
  max-width: 760px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #d7e2df;
}

.public-sources__preview {
  margin: 16px 0 0;
}

.public-sources__limits {
  max-width: 760px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 2px solid #0b2340;
  border-radius: 12px;
  background: #fff4d6;
  color: #17252d;
  font-size: 16px;
  line-height: 1.45;
}

.public-sources__limits h3,
.public-sources__limits p,
.public-sources__limits li {
  color: #17252d;
}

.public-sources__limits h3 {
  margin: 0 0 8px;
}

.public-sources__limits p,
.public-sources__limits ul {
  margin: 8px 0 0;
}

.public-sources__limits ul {
  padding-left: 1.2em;
}

.source-viewer__pdf {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  border: 0;
  background: #d7e2df;
}

#public-source-preview[hidden] {
  display: none !important;
}

.source-viewer[hidden] {
  display: none !important;
}

.source-viewer {
  position: fixed;
  z-index: 50;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(960px, calc(100vw - 16px));
  height: min(980px, calc(100vh - 16px));
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  border: 2px solid #0b2340;
  border-radius: 16px;
  background: #fff;
  color: #17252d;
  box-shadow: 0 18px 50px rgba(11, 35, 64, .28);
  overflow: hidden;
  resize: none;
}

.source-viewer__header {
  position: sticky;
  top: 0;
  z-index: 2;
  flex: 0 0 auto;
  min-width: 0;
  background: #fff;
}

.source-viewer__answer {
  margin: 0;
  padding: 8px 12px 0;
  color: #17252d;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.source-viewer__bar,
.source-viewer__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  padding: 8px 10px;
  background: #f4f8f7;
}

.source-viewer__bar {
  flex-wrap: nowrap;
  justify-content: space-between;
  border-bottom: 1px solid #d7e2df;
}

.source-viewer__heading {
  flex: 1 1 auto;
  min-width: 0;
}

.source-viewer__bar h3,
.source-viewer__page {
  margin: 0;
  color: #0b2340;
  overflow-wrap: anywhere;
}

.source-viewer__bar h3 {
  font-size: 18px;
  line-height: 1.2;
}

.source-viewer__page {
  color: #17252d;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.source-viewer__close {
  flex: 0 0 auto;
}

.source-viewer__details {
  min-width: 0;
  padding: 0 12px 8px;
  background: #fff;
}

.source-viewer__details summary {
  min-height: 36px;
  color: #0b2340;
  font-weight: 750;
  line-height: 1.3;
  cursor: pointer;
}

.source-viewer__tool {
  max-width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 2px solid #0b2340;
  border-radius: 10px;
  background: #fff;
  color: #0b2340;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.source-viewer__tool:disabled {
  border-color: #596b70;
  background: #e7eeec;
  color: #0b2340;
  cursor: not-allowed;
}

.source-viewer__meta,
.source-viewer__banner,
.source-viewer__empty {
  margin: 0;
  padding: 6px 0 0;
  color: #17252d;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.source-viewer__banner {
  margin: 8px 0 0;
  padding: 10px;
  border: 2px solid #0b2340;
  border-radius: 10px;
  background: #fff4d6;
  font-weight: 800;
}

.source-viewer__body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 8px;
  padding: 12px;
  overflow: auto;
  border: 1px solid #d7e2df;
  border-radius: 12px;
  background: #fff;
  color: #17252d;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.source-viewer__empty {
  flex: 1 1 auto;
  padding: 16px;
  font-size: 20px;
}

.source-viewer [hidden] {
  display: none !important;
}

.source-viewer--expanded {
  inset: 8px !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  resize: none;
}

@media (min-width: 1100px) {
  body[data-source-viewer="open"] .wrap {
    width: min(560px, max(420px, calc(100vw - 760px)));
    max-width: 560px;
    margin-left: 16px;
    margin-right: auto;
  }

  .source-viewer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    height: auto !important;
    max-width: calc(100vw - min(560px, max(420px, calc(100vw - 760px))) - 36px);
    max-height: calc(100vh - 16px);
  }
}

@media (max-width: 1099px) {
  body[data-source-viewer="open"] {
    overflow: hidden;
  }

  body[data-source-viewer="open"] .wrap {
    width: min(1120px, calc(100% - 16px));
    margin-inline: auto;
  }

  .source-viewer {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto !important;
    height: 100vh !important;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .source-viewer__pdf {
    flex-basis: auto;
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .public-sources {
    padding: 18px 14px;
  }

  .public-sources .btn,
  .public-sources__actions {
    width: 100%;
  }

  .source-viewer--expanded {
    inset: 0 !important;
    height: 100% !important;
    border-radius: 0;
  }

  .source-viewer__answer {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .source-viewer {
    scroll-behavior: auto;
  }
}
