/* === Batch print controls === */
    .print-count-field {
      display: grid;
      gap: 6px;
      padding: 4px 3px 10px;
      border-bottom: 1px solid rgba(146,113,108,.16);
      margin-bottom: 2px;
    }

    .print-count-field label {
      font-size: 12px;
      font-weight: 850;
      color: var(--ink);
    }

    .print-count-field input {
      width: 100%;
      min-height: 40px;
      padding: 9px 11px;
      border-radius: 12px;
      background: #fff;
    }

    .print-count-field .hint {
      margin: 0;
      font-size: 11px;
      line-height: 1.42;
    }

    @media print {
      .print-count-field { display: none !important; }
    }

    :root,
    body[data-theme="pastel"],
    body[data-theme="bw"] .controls {
      --bg: #eaf6f8;
      --bg-2: #f9fdfe;
      --panel: rgba(255,255,255,.88);
      --panel-solid: #ffffff;
      --ink: #17333a;
      --muted: #5f7d84;
      --line: #cfe5ea;
      --line-strong: #a9d2db;
      --accent: #0a82a1;
      --accent-2: #d9f1f5;
      --yellow: #e7f6f8;
      --blue: #0a82a1;
      --green: #198fa8;
      --orange: #287f96;
      --purple: #146f89;
      --ghost: #78949b;
      --field-bg: rgba(255,255,255,.76);
      --select-bg: #ffffff;
      --status-bg: #edf8fa;
      --focus: #0a82a1;
      --shadow: 0 24px 64px rgba(10, 91, 112, .14);
      --soft-shadow: 0 10px 28px rgba(10, 91, 112, .09);
    }

    body,
    body[data-theme="bw"] {
      color: var(--ink);
      background:
        radial-gradient(circle at 12% 8%, rgba(177, 226, 235, .54), transparent 31%),
        radial-gradient(circle at 88% 12%, rgba(211, 241, 246, .74), transparent 28%),
        linear-gradient(135deg, #fbfeff 0%, #eef8fa 52%, #e4f3f6 100%) !important;
    }

    .controls,
    .preview-wrap,
    body[data-theme="bw"] .controls,
    body[data-theme="bw"] .preview-wrap {
      border-color: rgba(10,130,161,.13) !important;
    }

    .controls,
    body[data-theme="bw"] .controls {
      border-right-color: rgba(10,130,161,.18) !important;
    }

    .brand,
    body[data-theme="bw"] .brand,
    body[data-theme="bw"] .controls .brand {
      display: flex;
      align-items: center;
      gap: 13px;
      border-bottom-color: rgba(10,130,161,.18) !important;
    }

  .brand-logo {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  object-fit: contain;
  display: block;

  transform: scale(1.35);
  transform-origin: center;
}

    .brand h1 {
      margin: 0;
      color: #16414d !important;
      font-size: 20px;
      line-height: 1.34;
    }

    .setting-group,
    body[data-theme="bw"] .setting-group,
    body[data-theme="bw"] .controls .setting-group {
      border-bottom-color: rgba(10,130,161,.14) !important;
    }

    .setting-group summary:hover,
    .setting-group summary:hover::after,
    body[data-theme="bw"] .setting-group summary:hover,
    body[data-theme="bw"] .controls .setting-group summary:hover,
    body[data-theme="bw"] .controls .setting-group summary:hover::after {
      color: #0a82a1 !important;
    }

    select,
    input[type="text"],
    input[type="number"],
    body[data-theme="bw"] select,
    body[data-theme="bw"] input[type="text"],
    body[data-theme="bw"] input[type="number"],
    body[data-theme="bw"] .controls select,
    body[data-theme="bw"] .controls input[type="text"],
    body[data-theme="bw"] .controls input[type="number"] {
      border-color: rgba(10,130,161,.20) !important;
      background: rgba(255,255,255,.86) !important;
      color: #17333a !important;
    }

    select:hover,
    input[type="text"]:hover,
    input[type="number"]:hover,
    select:focus,
    input:focus,
    body[data-theme="bw"] .controls select:hover,
    body[data-theme="bw"] .controls input:hover,
    body[data-theme="bw"] .controls select:focus,
    body[data-theme="bw"] .controls input:focus {
      border-color: rgba(10,130,161,.62) !important;
      box-shadow: 0 0 0 4px rgba(10,130,161,.11) !important;
    }

    input[type="radio"],
    input[type="checkbox"],
    body[data-theme="bw"] .controls input[type="radio"] {
      accent-color: #0a82a1;
    }

    .check-list {
      display: grid;
      gap: 8px;
    }

    .check-row {
      display: flex;
      align-items: center;
      gap: 9px;
      min-height: 34px;
      color: #274a53;
      font-size: 13px;
      font-weight: 720;
      cursor: pointer;
    }

    .check-row input {
      width: 17px;
      height: 17px;
      margin: 0;
      flex: 0 0 auto;
    }

    .primary,
    body[data-theme="bw"] .primary,
    body[data-theme="bw"] .controls .primary {
      background: linear-gradient(135deg, #0a82a1, #25a5c0) !important;
    }

    .print-main,
    .print-q,
    body[data-theme="bw"] .print-main,
    body[data-theme="bw"] .print-q,
    body[data-theme="bw"] .controls .print-main,
    body[data-theme="bw"] .controls .print-q {
      background: linear-gradient(135deg, #178da9, #52b7c9) !important;
    }

    .print-a,
    body[data-theme="bw"] .print-a,
    body[data-theme="bw"] .controls .print-a {
      background: linear-gradient(135deg, #146f89, #3499b0) !important;
    }

    .print-both,
    body[data-theme="bw"] .print-both,
    body[data-theme="bw"] .controls .print-both {
      background: linear-gradient(135deg, #0d6680, #238eaa) !important;
    }

    .view-tabs,
    body[data-theme="bw"] .view-tabs,
    body[data-theme="bw"] .preview-toolbar .view-tabs {
      border-color: rgba(10,130,161,.18) !important;
      background: rgba(255,255,255,.84) !important;
      box-shadow: 0 10px 24px rgba(10,91,112,.10) !important;
    }

    .view-tab,
    body[data-theme="bw"] .view-tab,
    body[data-theme="bw"] .preview-toolbar .view-tab {
      color: #5f7d84 !important;
    }

    .view-tab.is-active,
    body[data-theme="bw"] .view-tab.is-active,
    body[data-theme="bw"] .preview-toolbar .view-tab.is-active {
      color: #fff !important;
      background: linear-gradient(135deg, #0a82a1, #28a8c1) !important;
      box-shadow: 0 10px 22px rgba(10,130,161,.22) !important;
    }

    .print-menu,
    body[data-theme="bw"] .controls .print-menu {
      border-color: rgba(10,130,161,.18) !important;
      box-shadow: 0 22px 50px rgba(10,91,112,.16) !important;
    }

    .row-range-item {
      grid-template-columns: 124px minmax(170px, 220px) !important;
      justify-content: start;
      gap: 10px;
    }

    :root {
      --theme-accent: #F3A6C0;
      --theme-accent-dark: #c987a0;
      --theme-accent-mid: #f7c5d6;
      --theme-soft: #fce8ef;
      --theme-bg: #fff7fa;
      --theme-bg-2: #fffbfd;
      --theme-ink: #4a383f;
      --theme-muted: #8a7079;
      --theme-line: #f0d0db;
      --theme-line-strong: #e4b5c5;
      --theme-primary: #E99AB4;
      --theme-print: #F3A6C0;
      --theme-answer: #D987A6;
      --theme-both: #C98AAE;
      --theme-focus: #D87F9D;
      --theme-rgb: 243, 166, 192;
    }

    body,
    body[data-theme="bw"] {
      color: var(--theme-ink) !important;
      background:
        radial-gradient(circle at 12% 8%, rgba(var(--theme-rgb), .20), transparent 31%),
        radial-gradient(circle at 88% 12%, rgba(var(--theme-rgb), .11), transparent 28%),
        linear-gradient(135deg, var(--theme-bg-2) 0%, #ffffff 50%, var(--theme-bg) 100%) !important;
    }

    .controls,
    .preview-wrap,
    body[data-theme="bw"] .controls,
    body[data-theme="bw"] .preview-wrap {
      border-color: rgba(var(--theme-rgb), .16) !important;
    }

    .controls,
    body[data-theme="bw"] .controls {
      border-right-color: rgba(var(--theme-rgb), .22) !important;
    }

    .brand,
    body[data-theme="bw"] .brand,
    body[data-theme="bw"] .controls .brand {
      border-bottom-color: rgba(var(--theme-rgb), .22) !important;
    }

    .brand h1,
    body[data-theme="bw"] .brand h1,
    body[data-theme="bw"] .controls .brand h1 {
      color: var(--theme-ink) !important;
    }

    .setting-group,
    body[data-theme="bw"] .setting-group,
    body[data-theme="bw"] .controls .setting-group {
      border-bottom-color: rgba(var(--theme-rgb), .17) !important;
    }

    .setting-group summary:hover,
    .setting-group summary:hover::after,
    body[data-theme="bw"] .setting-group summary:hover,
    body[data-theme="bw"] .controls .setting-group summary:hover,
    body[data-theme="bw"] .controls .setting-group summary:hover::after {
      color: var(--theme-accent-dark) !important;
    }

    select,
    input[type="text"],
    input[type="number"],
    body[data-theme="bw"] select,
    body[data-theme="bw"] input[type="text"],
    body[data-theme="bw"] input[type="number"],
    body[data-theme="bw"] .controls select,
    body[data-theme="bw"] .controls input[type="text"],
    body[data-theme="bw"] .controls input[type="number"] {
      border-color: rgba(var(--theme-rgb), .22) !important;
      background: rgba(255,255,255,.88) !important;
      color: var(--theme-ink) !important;
    }

    select:hover,
    input[type="text"]:hover,
    input[type="number"]:hover,
    select:focus,
    input:focus,
    body[data-theme="bw"] .controls select:hover,
    body[data-theme="bw"] .controls input:hover,
    body[data-theme="bw"] .controls select:focus,
    body[data-theme="bw"] .controls input:focus {
      border-color: var(--theme-focus) !important;
      box-shadow: 0 0 0 4px rgba(var(--theme-rgb), .12) !important;
    }

    input[type="radio"],
    input[type="checkbox"],
    body[data-theme="bw"] .controls input[type="radio"],
    body[data-theme="bw"] .controls input[type="checkbox"] {
      accent-color: var(--theme-accent) !important;
    }

    .check-row,
    body[data-theme="bw"] .check-row {
      color: var(--theme-ink) !important;
    }

    .primary,
    body[data-theme="bw"] .primary,
    body[data-theme="bw"] .controls .primary {
      background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent)) !important;
    }

    .print-main,
    .print-q,
    body[data-theme="bw"] .print-main,
    body[data-theme="bw"] .print-q,
    body[data-theme="bw"] .controls .print-main,
    body[data-theme="bw"] .controls .print-q {
      background: linear-gradient(135deg, var(--theme-print), var(--theme-accent-mid)) !important;
    }

    .print-a,
    body[data-theme="bw"] .print-a,
    body[data-theme="bw"] .controls .print-a {
      background: linear-gradient(135deg, var(--theme-answer), var(--theme-accent)) !important;
    }

    .print-both,
    body[data-theme="bw"] .print-both,
    body[data-theme="bw"] .controls .print-both {
      background: linear-gradient(135deg, var(--theme-both), var(--theme-accent-mid)) !important;
    }

    .view-tabs,
    body[data-theme="bw"] .view-tabs,
    body[data-theme="bw"] .preview-toolbar .view-tabs {
      border-color: rgba(var(--theme-rgb), .20) !important;
      background: rgba(255,255,255,.87) !important;
      box-shadow: 0 10px 24px rgba(var(--theme-rgb), .10) !important;
    }

    .view-tab,
    body[data-theme="bw"] .view-tab,
    body[data-theme="bw"] .preview-toolbar .view-tab {
      color: var(--theme-muted) !important;
    }

    .view-tab.is-active,
    body[data-theme="bw"] .view-tab.is-active,
    body[data-theme="bw"] .preview-toolbar .view-tab.is-active {
      color: #fff !important;
      background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent)) !important;
      box-shadow: 0 10px 22px rgba(var(--theme-rgb), .22) !important;
    }

    .print-menu,
    body[data-theme="bw"] .controls .print-menu {
      border-color: rgba(var(--theme-rgb), .20) !important;
      box-shadow: 0 22px 50px rgba(var(--theme-rgb), .15) !important;
    }

    .controls::-webkit-scrollbar-thumb,
    .preview-wrap::-webkit-scrollbar-thumb {
      background: var(--theme-line-strong) !important;
    }

    body[data-output-theme="bw"],
    body[data-output-theme="pastel"] {
    }

    .branding-intro {
      margin: 4px 0 12px;
    }

    .branding-item {
      display: grid;
      grid-template-columns: 76px 1fr;
      gap: 12px;
      align-items: center;
      padding: 12px;
      margin: 10px 0;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--field-bg);
    }

    .branding-preview-wrap {
      width: 76px;
      height: 76px;
      display: grid;
      place-items: center;
      overflow: hidden;
      border-radius: 12px;
      background: rgba(255,255,255,.72);
      border: 1px solid var(--line);
    }

    .branding-preview {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      display: block;
    }

    .branding-copy {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .branding-copy strong {
      font-size: 13px;
      color: var(--ink);
    }

    .branding-copy span {
      font-size: 11.5px;
      color: var(--muted);
      line-height: 1.45;
    }

    .branding-actions {
      display: flex;
      gap: 7px;
      flex-wrap: wrap;
      margin-top: 5px;
    }

    .branding-button {
      min-height: 32px;
      padding: 6px 10px;
      border-radius: 10px;
      box-shadow: none;
      background: var(--theme-soft);
      color: var(--ink);
      border: 1px solid var(--line);
      font-size: 11.5px;
      font-weight: 700;
    }

    .branding-reset {
      background: transparent;
    }

    .branding-reset-all {
      width: 100%;
      margin-top: 10px;
      min-height: 38px;
      box-shadow: none;
    }


/* === Authentication and license gate === */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 25, 31, .48);
  backdrop-filter: blur(14px);
}

.auth-gate[hidden] {
  display: none !important;
}

.auth-card {
  width: min(430px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(var(--theme-rgb), .24);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 30px 90px rgba(18, 41, 49, .28);
  color: var(--theme-ink);
}

.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 850;
  color: var(--theme-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.auth-card-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.auth-card h2 {
  margin: 0 0 9px;
  font-size: 23px;
  line-height: 1.3;
  color: var(--theme-ink);
}

.auth-gate-message {
  margin: 0;
  color: var(--theme-muted);
  font-size: 13px;
  line-height: 1.65;
}

.auth-support-code {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 10.5px;
  color: var(--theme-muted);
  opacity: .78;
}

.auth-inline-error {
  margin: 13px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(184, 67, 67, .18);
  border-radius: 12px;
  background: rgba(255, 237, 237, .9);
  color: #9e3434;
  font-size: 12px;
  line-height: 1.5;
}

.auth-login-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.auth-login-form[hidden],
.auth-device-limit-actions[hidden],
.auth-generic-actions[hidden] {
  display: none !important;
}

.auth-login-form label {
  display: grid;
  gap: 6px;
}

.auth-login-form label > span {
  font-size: 12px;
  font-weight: 800;
  color: var(--theme-ink);
}

.auth-login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--theme-rgb), .24);
  border-radius: 12px;
  background: #fff;
  color: var(--theme-ink);
  font: inherit;
  outline: none;
}

.auth-login-form input:focus {
  border-color: var(--theme-focus);
  box-shadow: 0 0 0 4px rgba(var(--theme-rgb), .12);
}

.auth-primary-button,
.auth-secondary-button,
.auth-small-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.auth-primary-button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  box-shadow: 0 12px 26px rgba(var(--theme-rgb), .22);
}

.auth-secondary-button {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 12px;
  color: var(--theme-ink);
  background: var(--theme-soft);
  border: 1px solid var(--theme-line);
}

.auth-primary-button:disabled,
.auth-secondary-button:disabled,
.auth-small-button:disabled {
  cursor: wait;
  opacity: .6;
}

.auth-device-limit-actions,
.auth-generic-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.auth-device-list,
.account-device-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.auth-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--theme-line);
  border-radius: 12px;
  background: rgba(255,255,255,.76);
}

.auth-device-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.auth-device-copy strong {
  overflow: hidden;
  color: var(--theme-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-device-copy span,
.auth-device-empty {
  margin: 0;
  color: var(--theme-muted);
  font-size: 10.5px;
}

.auth-small-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 9px;
  background: var(--theme-soft);
  color: var(--theme-ink);
  font-size: 10.5px;
}

.auth-danger-button {
  color: #9a3535;
  background: #fff1f1;
}

.auth-offline-badge {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 9000;
  max-width: min(360px, calc(100vw - 36px));
  padding: 8px 12px;
  border: 1px solid rgba(174, 125, 24, .2);
  border-radius: 999px;
  background: rgba(255, 248, 221, .96);
  box-shadow: 0 8px 22px rgba(87, 64, 16, .12);
  color: #76540d;
  font-size: 11px;
  font-weight: 800;
}

.auth-offline-badge[hidden] {
  display: none !important;
}

.account-license-card {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--theme-line);
  border-radius: 12px;
  background: var(--field-bg);
}

.account-license-card strong {
  color: var(--theme-ink);
  font-size: 12.5px;
}

.account-license-card span {
  color: var(--theme-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.account-offline-expiry:empty {
  display: none;
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

body.auth-locked .controls,
body.auth-locked .preview-wrap {
  user-select: none;
}

body.auth-locked .app {
  pointer-events: none;
}

@media (max-width: 760px) {
  .auth-card {
    width: min(430px, calc(100vw - 24px));
    padding: 22px;
    border-radius: 20px;
  }
}

@media print {
  .auth-gate,
  .auth-offline-badge {
    display: none !important;
  }
}


/* === Account flow forms === */
.auth-account-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.auth-account-form[hidden] {
  display: none !important;
}

.auth-account-form label {
  display: grid;
  gap: 6px;
}

.auth-account-form label > span {
  font-size: 12px;
  font-weight: 800;
  color: var(--theme-ink);
}

.auth-account-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--theme-rgb), .24);
  border-radius: 12px;
  background: #fff;
  color: var(--theme-ink);
  font: inherit;
  outline: none;
}

.auth-account-form input:focus {
  border-color: var(--theme-focus);
  box-shadow: 0 0 0 4px rgba(var(--theme-rgb), .12);
}

.auth-form-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-link-button {
  appearance: none;
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--theme-accent-dark);
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-back-link {
  justify-self: start;
}

.auth-flow-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--theme-soft);
  color: var(--theme-muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* Keep-academy-branding preference belongs directly below the academy name. */
.branding-keep-toggle{display:flex;align-items:center;gap:8px;margin-top:10px;cursor:pointer;font-size:12px;font-weight:650;line-height:1.5;color:inherit}
.branding-keep-toggle input{width:15px;height:15px;margin:0;flex:0 0 auto;accent-color:#333}

/* Locrian generated screen UI font-size uplift; do not edit. */
@media screen {
.print-count-field label{font-size:calc(12px + 2pt)}
.print-count-field label{font-weight:800}
.print-count-field .hint{font-size:calc(11px + 2pt)}
.brand h1{font-size:calc(20px + 2pt)}
.check-row{font-size:calc(13px + 2pt)}
.check-row{font-weight:670}
.branding-copy strong{font-size:calc(13px + 2pt)}
.branding-copy span{font-size:calc(11.5px + 2pt)}
.branding-button{font-size:calc(11.5px + 2pt)}
.branding-button{font-weight:650}
.auth-card-brand{font-size:calc(12px + 2pt)}
.auth-card-brand{font-weight:800}
.auth-card h2{font-size:calc(23px + 2pt)}
.auth-gate-message{font-size:calc(13px + 2pt)}
.auth-support-code{font-size:calc(10.5px + 2pt)}
.auth-inline-error{font-size:calc(12px + 2pt)}
.auth-login-form label > span{font-size:calc(12px + 2pt)}
.auth-login-form label > span{font-weight:750}
.auth-primary-button,
.auth-secondary-button,
.auth-small-button{font-weight:750}
.auth-device-copy strong{font-size:calc(12px + 2pt)}
.auth-device-copy span,
.auth-device-empty{font-size:calc(10.5px + 2pt)}
.auth-small-button{font-size:calc(10.5px + 2pt)}
.auth-offline-badge{font-size:calc(11px + 2pt)}
.auth-offline-badge{font-weight:750}
.account-license-card strong{font-size:calc(12.5px + 2pt)}
.account-license-card span{font-size:calc(10.5px + 2pt)}
.auth-account-form label > span{font-size:calc(12px + 2pt)}
.auth-account-form label > span{font-weight:750}
.auth-link-button{font-size:calc(11.5px + 2pt)}
.auth-link-button{font-weight:750}
.auth-flow-note{font-size:calc(11.5px + 2pt)}
.branding-keep-toggle{font-size:calc(12px + 2pt)}
.branding-keep-toggle{font-weight:600}
}
