* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  padding: 1rem;
  background: #f5f5f5;
  color: #333;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  line-height: 1.4;
}

.pages {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page {
  position: relative;
  width: 768px;
  height: 1104px;
  margin: 1rem auto;
  overflow: hidden;
  border: 2px solid #999;
  border-radius: 4px;
  background: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  page-break-after: always;
  break-after: page;
}

.page.hidden {
  display: none;
}

.sheet-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.page-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 54px 74px 142px;
  scrollbar-width: none;
}

.page-content::-webkit-scrollbar {
  display: none;
}

.page-content--back {
  padding-top: 150px;
}

.page-heading {
  margin: 0 auto 22px;
  text-align: center;
}

.page-heading h1,
.page-heading h2 {
  margin: 0;
  color: #666;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
}

.page-heading h1 {
  font-size: 1.3rem;
  line-height: 1.25;
}

.page-heading h2 {
  font-size: 1.1rem;
  line-height: 1.3;
}

.page-heading p {
  margin: 4px 0 0;
  color: #666;
  font-size: 0.76rem;
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.column {
  min-width: 0;
}

.sheet-section {
  margin: 0 0 12px;
  break-inside: avoid;
}

.sheet-section h2,
.sheet-section h3,
.sheet-section h4 {
  margin: 0 0 5px;
  color: #666;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
}

.sheet-section h2 {
  font-size: 0.9rem;
  line-height: 1.25;
}

.sheet-section h3 {
  font-size: 0.78rem;
  line-height: 1.25;
}

.sheet-section p,
.sheet-section li {
  margin: 0 0 5px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.sheet-section ul,
.sheet-section ol {
  margin: 0 0 5px 17px;
  padding: 0;
}

.sheet-section strong {
  font-weight: 700;
}

.sheet-divider {
  display: block;
  width: 100%;
  height: 16px;
  margin: 1px auto 7px;
  object-fit: contain;
  opacity: 0.84;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  color: #333;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid #999;
  padding: 4px 5px;
  font-size: 0.66rem;
  line-height: 1.25;
  text-align: left;
  vertical-align: top;
}

.sheet-table th {
  color: #555;
  font-weight: 700;
}

.action-bar {
  position: sticky;
  z-index: 100;
  right: 0;
  bottom: 20px;
  left: 0;
  display: flex;
  width: 100%;
  height: 50px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid #ccc;
  background: #f5f5f5;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.action-bar button {
  display: flex;
  height: 32px;
  align-items: center;
  padding: 6px 14px;
  border: 0;
  border-radius: 3px;
  background: #4a5a20;
  color: #fff;
  cursor: pointer;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background 0.2s;
}

.action-bar button:hover {
  background: #3a4a10;
}

.action-bar button:active {
  background: #2a3a00;
}

.print-group {
  display: flex;
  overflow: hidden;
  gap: 0;
  border: 1px solid #999;
  border-radius: 3px;
}

.ptab {
  height: 32px !important;
  padding: 6px 12px !important;
  border: 0 !important;
  border-right: 1px solid #999 !important;
  border-radius: 0 !important;
  background: #e8e8e8 !important;
  color: #333 !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
}

.ptab:last-child {
  border-right: 0 !important;
}

.ptab.active {
  background: #4a5a20 !important;
  color: #fff !important;
}

@media print {
  @page {
    size: 8in 11.5in;
    margin: 0;
  }

  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  html,
  body {
    width: 8in;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  .pages {
    display: block;
  }

  .page {
    display: block !important;
    width: 8in;
    height: 11.5in;
    margin: 0;
    box-shadow: none;
    page-break-after: always;
    break-after: page;
    overflow: hidden;
  }

  .page.hidden {
    display: none !important;
  }

  .page.print-last {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .page-content {
    height: 100%;
    overflow: visible !important;
  }

  .action-bar,
  html body #cookieConsent.cookie-banner {
    display: none !important;
  }
}
