:root {
  color-scheme: light;
  --brand-yellow: #ffd400;
  --brand-dark: #3f3100;
  --brand-gold: #ffea61;
  --brand-red: #b52d32;
  --ink: #17212e;
  --line: #d9e0e8;
  --surface: #f3f1ec;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  font-family: "Montserrat", Arial, sans-serif;
}

.document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px clamp(16px, 3vw, 42px);
  color: var(--white);
  background: var(--brand-dark);
  border-bottom: 3px solid var(--brand-yellow);
}

.document-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.document-brand img {
  flex: 0 0 auto;
  object-fit: contain;
}

.document-brand span {
  display: grid;
  gap: 2px;
}

.document-brand small {
  color: var(--brand-gold);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.document-brand strong {
  font-size: clamp(1rem, 2vw, 1.25rem);
  letter-spacing: -.02em;
}

.back-link {
  color: inherit;
  font-size: .8rem;
  font-weight: 700;
  text-underline-offset: 3px;
}

.document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 9px clamp(14px, 2vw, 28px);
  background: var(--brand-yellow);
  border-bottom: 4px solid var(--brand-dark);
}

.document-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.document-toolbar strong {
  overflow: hidden;
  color: var(--brand-dark);
  font-size: .85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-toolbar span {
  color: #625a40;
  font-size: .72rem;
  font-weight: 600;
}

.document-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.document-actions a,
.pdf-fallback a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--brand-dark);
  background: var(--white);
  border: 1px solid var(--brand-dark);
  border-radius: 6px;
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none;
}

.document-actions .download-link {
  color: var(--white);
  background: var(--brand-dark);
}

.document-actions a:hover,
.document-actions a:focus-visible,
.pdf-fallback a:hover,
.pdf-fallback a:focus-visible {
  color: var(--white);
  background: var(--brand-red);
  border-color: var(--brand-red);
  outline: 3px solid rgb(181 45 50 / 22%);
  outline-offset: 1px;
}

.pdf-stage {
  min-height: 0;
  padding: clamp(8px, 1.5vw, 18px);
  background-color: var(--surface);
  background-image: radial-gradient(rgb(63 49 0 / 10%) .7px, transparent .7px);
  background-size: 8px 8px;
}

.pdf-viewer {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgb(23 19 15 / 18%);
}

.pdf-fallback {
  max-width: 560px;
  margin: 8vh auto;
  padding: 32px;
  text-align: center;
  background: var(--white);
  border-radius: 8px;
}

.pdf-fallback h1 {
  margin-top: 0;
}

@media (max-width: 720px) {
  .document-header {
    min-height: 62px;
  }

  .document-brand img {
    width: 40px;
    height: 40px;
  }

  .document-brand small,
  .back-link,
  .document-toolbar > div:first-child {
    display: none;
  }

  .document-toolbar {
    justify-content: stretch;
  }

  .document-actions {
    width: 100%;
  }

  .document-actions a {
    flex: 1;
  }

  .pdf-stage {
    padding: 6px;
  }
}
