/* One Print Box (teacher/print-box.js): the frame every print dialog is
   drawn in. The preview on the left, the settings on the right in Title
   Case sections, and a foot with what comes out, Cancel and Print N Pages.
   960 wide at most and 720 tall at most, so it fits a school Dell at
   1366 × 657 without scrolling (board "Print Dialogs: One Style"). */

.pb-card {
  display: flex;
  flex-direction: column;
  width: 960px;
  max-width: calc(100vw - var(--space-8));
  height: min(720px, calc(100vh - var(--space-6)));
  padding: 0;
  overflow: hidden;
  font-family: var(--font-base);
  color: var(--text);
}

.pb-head {
  flex: 0 0 52px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--divider-medium);
}
.pb-title {
  margin: 0;
  flex: 0 0 auto;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
.pb-subtitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-base);
  color: var(--text-2);
}

.pb-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

/* The preview: the page as it prints, and Previous and Next Page. */
.pb-preview {
  flex: 0 0 360px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  background: var(--bg);
  border-right: 1px solid var(--divider-medium);
  overflow: hidden;
}
.pb-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.pb-at {
  min-width: 112px;
  text-align: center;
  font-size: var(--text-base);
  font-weight: 500;
}
.pb-arrow {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--overlay-hover);
  color: var(--text);
  cursor: pointer;
}
.pb-arrow:disabled {
  opacity: 0.4;
  cursor: default;
}
.pb-arrow:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}

/* The settings. */
.pb-settings {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6) var(--space-2);
  overflow-y: auto;
}
.pb-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.pb-section-name {
  margin: 0;
  padding-left: 2px;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 16px;
  color: var(--text-2);
}
.pb-list {
  border: 1px solid var(--divider-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.pb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 34px;
  box-sizing: border-box;
  padding: 0 var(--space-2) 0 var(--space-4);
  border-bottom: 1px solid var(--divider-subtle);
}
.pb-list > :last-child {
  border-bottom: none;
}
.pb-row-switch {
  padding-right: var(--space-3);
}
/* Rows that belong to the row above: indented and tinted. */
.pb-sub,
.pb-pick {
  padding-left: var(--space-8);
  background: color-mix(in srgb, var(--bg) 50%, var(--surface));
}
.pb-row.is-off {
  opacity: 0.45;
}
.pb-label {
  font-size: var(--text-base);
  color: var(--text);
}
.pb-text {
  padding-right: var(--space-2);
  font-size: var(--text-base);
  color: var(--text);
}
.pb-seg .seg-btn {
  min-width: 72px;
}

/* A value that opens a menu. */
.pb-value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 28px;
  padding: 0 6px 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--link);
  cursor: pointer;
  white-space: nowrap;
}
.pb-value:hover:not(:disabled),
.pb-value[aria-expanded='true'] {
  background: var(--overlay-hover);
}
.pb-value:disabled {
  cursor: default;
}
.pb-value svg {
  flex: 0 0 auto;
}

.pb-menu {
  position: fixed;
  z-index: 10003;
  min-width: 180px;
  max-width: 340px;
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.pb-menu-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: none;
  font-family: var(--font-base);
  font-size: var(--text-base);
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.pb-menu-item:hover,
.pb-menu-item:focus-visible {
  background: var(--overlay-hover);
  outline: none;
}
.pb-menu-item[aria-checked='true'] {
  background: var(--active-fill);
  color: #fff;
}
.pb-menu-help {
  font-size: var(--text-sm);
  color: var(--text-2);
}
.pb-menu-item[aria-checked='true'] .pb-menu-help {
  color: inherit;
  opacity: 0.85;
}

.pb-number {
  width: 64px;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  background: var(--surface);
}
.pb-date {
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  background: var(--surface);
}

/* A pick list under the row above (Pick Assessments, Pick Students). */
.pb-pick {
  max-height: 168px;
  overflow-y: auto;
  padding-top: 6px;
  padding-bottom: var(--space-2);
  padding-right: var(--space-4);
  border-bottom: 1px solid var(--divider-subtle);
}
.pb-pick-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 0;
  font-size: var(--text-sm);
  cursor: pointer;
}
.pb-pick-option input {
  margin: 0;
  accent-color: var(--active);
}
.pb-help {
  color: var(--text-3);
}

/* The foot: what comes out, Cancel and Print N Pages. */
.pb-foot {
  flex: 0 0 56px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-6);
  border-top: 1px solid var(--divider-medium);
}
.pb-summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-base);
  font-weight: 500;
}
.pb-summary.is-warning {
  color: var(--score-1-text, #991b1b);
  white-space: normal;
}
.pb-cancel,
.pb-print {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-base);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
}
.pb-cancel {
  min-width: 104px;
  background: var(--active-light);
  color: var(--link);
}
.pb-print {
  min-width: 156px;
  background: var(--active-fill);
  color: #fff;
}
.pb-print:disabled {
  opacity: 0.5;
  cursor: default;
}
.pb-cancel:focus-visible,
.pb-print:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}

@media screen and (max-width: 760px) {
  .pb-card {
    height: auto;
    max-height: calc(100vh - var(--space-8));
  }
  .pb-body {
    flex-direction: column;
    overflow-y: auto;
  }
  .pb-preview {
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--divider-medium);
  }
  .pb-settings {
    overflow: visible;
  }
}
