@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("assets/fonts/noto-nastaliq-urdu-arabic-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  color-scheme: light;
  --ink: #10243e;
  --ink-soft: #344b62;
  --teal: #0f9b8e;
  --teal-dark: #087f76;
  --forest: var(--teal);
  --forest-dark: var(--teal-dark);
  --forest-wash: #e8f8f5;
  --mint: #e8f8f5;
  --paper: #ffffff;
  --surface: #ffffff;
  --canvas: #f4f8fb;
  --page: #f4f8fb;
  --canvas-deep: #edf4f7;
  --line: #e3ebf2;
  --line-strong: #cbd9e5;
  --muted: #61748b;
  --muted-light: #8797a7;
  --amber: #a96c3a;
  --amber-wash: #fbf5e8;
  --red: #a43f38;
  --red-wash: #fcf2ef;
  --blue: #2557d6;
  --shadow-card: 0 6px 20px rgba(16, 36, 62, 0.025);
  --shadow: 0 14px 40px rgba(16, 36, 62, 0.08);
  --shadow-paper: 0 18px 42px rgba(16, 36, 62, 0.12), 0 2px 6px rgba(16, 36, 62, 0.07);
  --radius-card: 17px;
  --radius-input: 10px;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-paper: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(78, 137, 109, 0.34);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 9px 13px;
  color: white;
  background: var(--forest-dark);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  min-height: 74px;
  border-bottom: 1px solid rgba(212, 220, 214, 0.86);
  background: rgba(250, 251, 248, 0.82);
  backdrop-filter: blur(14px);
}

.topbar-inner,
.page-shell,
.footer-inner {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  color: #f7faf6;
  background: var(--forest);
  border-radius: 12px;
  box-shadow: 0 4px 9px rgba(32, 72, 61, 0.17);
}

.brand-mark svg {
  display: block;
  width: 27px;
  height: 27px;
}

.brand-name {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.055em;
}

.brand-divider {
  width: 1px;
  height: 19px;
  margin-inline: 4px;
  background: var(--line-strong);
}

.brand-caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  letter-spacing: 0.01em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 15px;
}

.local-indicator,
.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #52625b;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.025em;
}

.indicator-dot,
.bank-status-dot,
.preview-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #6c9c79;
  box-shadow: 0 0 0 3px rgba(108, 156, 121, 0.13);
}

.phase-chip {
  padding: 6px 9px;
  color: #64746b;
  background: #eff2ec;
  border: 1px solid #e4e9e1;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 730;
  letter-spacing: 0.11em;
}

.page-shell {
  padding-bottom: 76px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  padding: 52px 0 33px;
}

.hero-copy {
  max-width: 710px;
}

.eyebrow,
.card-kicker,
.micro-label,
.preview-label {
  margin: 0;
  color: var(--forest);
  font-size: 9px;
  font-weight: 770;
  letter-spacing: 0.16em;
  line-height: 1.4;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 15px;
  color: #667a6e;
}

.eyebrow-rule {
  display: inline-block;
  width: 21px;
  height: 1px;
  background: #7f9f89;
}

.eyebrow-separator {
  color: #aab4ac;
}

.hero h1 {
  margin: 0;
  color: #263a33;
  font-size: clamp(39px, 4.2vw, 57px);
  font-weight: 690;
  letter-spacing: -0.073em;
  line-height: 0.99;
}

.hero h1 span {
  color: #6e8276;
  font-weight: 520;
}

.hero-description {
  max-width: 560px;
  margin: 17px 0 0;
  color: #6e7b75;
  font-size: 14px;
  line-height: 1.7;
}

.hero-bank-card {
  display: flex;
  min-width: 244px;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  background: rgba(255, 255, 253, 0.72);
  border: 1px solid #e0e6df;
  border-radius: 13px;
  box-shadow: 0 5px 17px rgba(31, 50, 42, 0.035);
}

.bank-card-icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  color: #4b7562;
  background: #edf4ee;
  border-radius: 11px;
}

.bank-card-icon svg {
  width: 23px;
  height: 23px;
}

.hero-bank-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.micro-label {
  color: #829088;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.hero-bank-copy strong {
  max-width: 220px;
  overflow: hidden;
  color: #2f423a;
  font-size: 13px;
  font-weight: 670;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-bank-copy > span:last-child {
  color: #87928c;
  font-size: 10px;
}

.bank-status-dot {
  margin-left: auto;
}

.bank-status-dot.is-loading {
  background: #c9a26a;
  box-shadow: 0 0 0 3px rgba(201, 162, 106, 0.15);
  animation: breathe 1.3s ease-in-out infinite;
}

.bank-status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(164, 63, 56, 0.12);
}

@keyframes breathe {
  50% { opacity: 0.48; }
}

.data-loader {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 25px;
  padding: 17px 20px;
  background: #fbfcf9;
  border: 1px solid #dfe7df;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(31, 50, 42, 0.035);
}

.loader-mark {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  color: var(--forest);
  background: var(--forest-wash);
  border-radius: 10px;
}

.loader-mark svg {
  width: 20px;
  height: 20px;
}

.loader-copy {
  min-width: 0;
  padding-top: 1px;
}

.loader-copy > strong {
  display: block;
  color: #2d4138;
  font-size: 13px;
  font-weight: 680;
}

.loader-copy p {
  max-width: 730px;
  margin: 3px 0 0;
  color: #738079;
  font-size: 12px;
  line-height: 1.6;
}

.loader-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

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

.builder-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.setup-card {
  padding: 18px 19px 17px;
  background: rgba(255, 255, 253, 0.94);
  border: 1px solid #e1e7e1;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card-heading {
  display: flex;
  min-height: 37px;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
}

.step-number {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  color: #668171;
  background: #eef4ef;
  border: 1px solid #e3ece4;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.card-kicker {
  margin-bottom: 2px;
  color: #84948a;
  font-size: 8px;
  letter-spacing: 0.145em;
}

.card-heading h2 {
  margin: 0;
  color: #293b34;
  font-size: 15px;
  font-weight: 675;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.count-pill {
  margin-left: auto;
  padding: 5px 8px;
  color: #577366;
  background: #f0f5f0;
  border: 1px solid #e1eae2;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 660;
  white-space: nowrap;
}

.select-grid,
.header-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: #596a61;
  font-size: 11px;
  font-weight: 630;
}

.field-label input,
.field-label select,
.compact-field input,
.maximum-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 0 11px;
  color: #2e4038;
  background-color: #fff;
  border: 1px solid #dbe3dc;
  border-radius: var(--radius-input);
  box-shadow: 0 1px 2px rgba(30, 48, 40, 0.025);
  font-size: 12px;
  font-weight: 540;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field-label input::placeholder {
  color: #a1aaa4;
  font-weight: 450;
}

.field-label input:hover,
.field-label select:hover,
.compact-field input:hover,
.maximum-input-wrap input:hover {
  border-color: #b9c8bd;
}

.field-label input:focus,
.field-label select:focus,
.compact-field input:focus,
.maximum-input-wrap input:focus {
  border-color: #80a08c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(93, 135, 108, 0.12);
}

.field-label select {
  padding-right: 30px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m5 7.5 5 5 5-5' stroke='%23728279' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.bank-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 7px;
  margin-top: 12px;
  color: #79867e;
  font-size: 10px;
}

.bank-meta strong {
  color: #52665a;
  font-weight: 650;
}

.meta-separator {
  color: #c2cbc3;
}

.coming-soon-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  padding: 8px 9px;
  color: #7d725c;
  background: #fbf8ef;
  border: 1px solid #f1ecde;
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.4;
}

.sparkle {
  color: #ba8b4f;
  font-size: 13px;
}

.bank-report-details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf0eb;
}

.bank-report-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #62756a;
  cursor: pointer;
  font-size: 10px;
  font-weight: 620;
  list-style: none;
}

.bank-report-details summary::-webkit-details-marker {
  display: none;
}

.report-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #79a486;
}

.report-indicator.has-warnings {
  background: #c48d4e;
}

.report-indicator.has-errors {
  background: #b75b50;
}

.chevron {
  margin-left: auto;
  color: #829087;
  font-size: 13px;
  transition: transform 0.15s ease;
}

.bank-report-details[open] .chevron {
  transform: rotate(180deg);
}

.bank-report {
  display: grid;
  gap: 7px;
  padding-top: 10px;
}

.report-summary {
  margin: 0;
  color: #728078;
  font-size: 10px;
}

.report-issue {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  background: #f7f8f4;
  border: 1px solid #eaeee8;
  border-radius: 7px;
}

.report-issue.is-warning {
  background: #fbf7ef;
  border-color: #f0e9d8;
}

.report-issue.is-error {
  background: #fcf3f0;
  border-color: #f2e0dc;
}

.report-issue strong {
  color: #53675b;
  font-size: 9px;
  font-weight: 660;
  overflow-wrap: anywhere;
}

.report-issue span {
  color: #78847d;
  font-size: 9px;
  line-height: 1.45;
}

.unit-availability-summary,
.small-muted {
  margin: 0;
  color: #88948d;
  font-size: 10px;
}

.unit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -4px 0 11px;
}

.text-button-group {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c0c8c1;
  font-size: 10px;
}

.text-button {
  padding: 2px 0;
  color: #527160;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.text-button:hover {
  color: #263f34;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.unit-list {
  display: grid;
  max-height: 365px;
  gap: 6px;
  overflow-y: auto;
  padding: 1px 3px 1px 1px;
  scrollbar-color: #c7d2c9 transparent;
  scrollbar-width: thin;
}

.unit-item {
  display: grid;
  min-height: 53px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid #e5ebe5;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.unit-item:hover {
  border-color: #c7d6cb;
  background: #fcfdfb;
}

.unit-item:has(input:checked) {
  background: #f8fbf7;
  border-color: #c7d9cb;
}

.unit-item input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #3f7058;
  cursor: pointer;
}

.unit-title-group {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.unit-name {
  overflow: hidden;
  color: #3d5047;
  font-size: 10px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-number {
  color: #8a9690;
  font-size: 8px;
  font-weight: 570;
  letter-spacing: 0.02em;
}

.unit-total {
  align-self: center;
  padding: 4px 6px;
  color: #728279;
  background: #f3f6f2;
  border-radius: 6px;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.field-hint {
  margin: 9px 0 0;
  color: #8a958f;
  font-size: 9px;
  line-height: 1.5;
}

.setup-intro {
  margin: -6px 0 13px;
  color: #7e8b83;
  font-size: 10px;
  line-height: 1.55;
}

.type-config-list {
  display: grid;
  gap: 7px;
}

.type-config-row {
  padding: 10px 10px 9px;
  background: #fbfcfa;
  border: 1px solid #e8ede7;
  border-radius: 11px;
}

.type-config-heading {
  display: flex;
  min-height: 25px;
  align-items: center;
  gap: 8px;
}

.type-marker {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 770;
}

.type-marker-mcq {
  color: #55785f;
  background: #eaf2e8;
}

.type-marker-short {
  color: #8a6a3a;
  background: #f5f0e3;
}

.type-marker-long {
  color: #667991;
  background: #ebeff4;
}

.type-config-heading > div {
  display: grid;
  min-width: 0;
  gap: 0;
}

.type-config-heading strong {
  color: #3b4d44;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
}

.available-count {
  color: #8b9790;
  font-size: 8px;
  line-height: 1.35;
}

.section-total {
  margin-left: auto;
  color: #687a6f;
  font-size: 9px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.numeric-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding-left: 30px;
}

.compact-field {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #77847c;
  font-size: 9px;
}

.compact-field input {
  width: 76px;
  height: 31px;
  padding: 0 7px;
  border-radius: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.compact-field input[aria-invalid="true"],
.maximum-input-wrap input[aria-invalid="true"] {
  border-color: #c97369;
  background: #fffaf8;
  box-shadow: 0 0 0 3px rgba(185, 91, 80, 0.09);
}

.maximum-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 10px;
  background: #f2f6f1;
  border: 1px solid #e3ece2;
  border-radius: 10px;
}

.maximum-field > span:first-child {
  display: grid;
  gap: 1px;
}

.maximum-field strong {
  color: #45604f;
  font-size: 10px;
  font-weight: 660;
}

.maximum-field small {
  color: #88958d;
  font-size: 8px;
}

.maximum-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #76857a;
  font-size: 9px;
}

.maximum-input-wrap input {
  width: 75px;
  height: 31px;
  padding: 0 7px;
  border-radius: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.header-fields {
  gap: 10px;
}

.field-full {
  grid-column: 1 / -1;
}

.header-setup-card .field-label input {
  height: 36px;
  font-size: 11px;
}

.generate-wrap {
  padding: 2px 2px 0;
}

.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

.button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary,
.button-generate {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 5px 13px rgba(32, 72, 61, 0.14);
}

.button-primary:hover:not(:disabled),
.button-generate:hover:not(:disabled) {
  background: var(--forest-dark);
  box-shadow: 0 7px 16px rgba(32, 72, 61, 0.2);
  transform: translateY(-1px);
}

.button-small {
  min-height: 33px;
  padding-inline: 11px;
  border-radius: 8px;
  font-size: 10px;
}

.button-small svg {
  width: 16px;
  height: 16px;
}

.button-quiet {
  color: #576d60;
  background: #f4f7f2;
  border-color: #e4eae3;
}

.button-quiet:hover:not(:disabled) {
  color: #315243;
  background: #edf3ec;
  border-color: #d6e2d6;
}

.button-outline {
  color: #4a6658;
  background: #fffefa;
  border-color: #d8e2d9;
}

.button-outline:hover:not(:disabled) {
  color: #254b3c;
  background: #f7faf6;
  border-color: #bfcfc2;
}

.button-generate {
  width: 100%;
  min-height: 48px;
  justify-content: space-between;
  padding-inline: 17px;
  border-radius: 12px;
  font-size: 12px;
  letter-spacing: -0.01em;
}

.button-generate svg {
  width: 20px;
  height: 20px;
}

.generate-assurance {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 9px 0 0;
  color: #818d85;
  font-size: 9px;
}

.assurance-check {
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  color: #4c7d5e;
  background: #e6f0e7;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.generation-message {
  margin-top: 11px;
  padding: 10px 11px;
  color: #765527;
  background: #fbf6e9;
  border: 1px solid #eee4c8;
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.55;
}

.generation-message.is-error {
  color: #853e37;
  background: #fcf2ef;
  border-color: #f0dcd6;
}

.generation-message.is-success {
  color: #3d6850;
  background: #f0f7ef;
  border-color: #dfeade;
}

.preview-column {
  position: sticky;
  top: 18px;
  min-width: 0;
  overflow: hidden;
  background: #f0f2ee;
  border: 1px solid #dce3dd;
  border-radius: 20px;
  box-shadow: 0 15px 38px rgba(32, 49, 41, 0.065), 0 2px 6px rgba(32, 49, 41, 0.04);
}

.preview-toolbar {
  padding: 20px 22px 0;
  background: #f7f8f5;
  border-bottom: 1px solid #e1e6e0;
}

.preview-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: #78887e;
  font-size: 8px;
}

.preview-pulse {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
  background: #8aa28c;
  box-shadow: 0 0 0 3px rgba(138, 162, 140, 0.12);
}

.preview-toolbar h2 {
  margin: 0;
  color: #30443a;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.045em;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.preview-actions .button {
  min-height: 35px;
  padding-inline: 10px;
  font-size: 9px;
}

.preview-actions .button svg {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.button-key {
  color: #6a6781;
  background: #f4f3f8;
  border-color: #e7e5ee;
}

.button-key:hover:not(:disabled) {
  color: #514c6f;
  background: #eeedf5;
  border-color: #dad7e7;
}

.preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 16px;
}

.view-tab {
  position: relative;
  min-height: 39px;
  padding: 0 1px;
  color: #87928b;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 10px;
  font-weight: 630;
  transition: color 0.14s ease;
}

.view-tab:hover {
  color: #475c50;
}

.view-tab.is-active {
  color: #2f5b45;
}

.view-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: #467455;
  border-radius: 2px 2px 0 0;
  content: "";
}

.key-separation-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 3px;
  vertical-align: 1px;
  background: #aba5c3;
  border-radius: 50%;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #ecefea;
  border: 1px solid #e4e9e3;
  border-radius: 9px;
}

.language-button {
  min-width: 34px;
  min-height: 25px;
  padding: 0 7px;
  color: #7c8981;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 640;
  transition: color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.language-button:hover {
  color: #3f5e4c;
}

.language-button.is-active {
  color: #315640;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 50, 42, 0.12);
}

.language-button[data-language="urdu"] {
  font-family: "Noto Nastaliq Urdu", var(--font-ui);
  font-size: 10px;
}

.stale-banner {
  margin: 0 0 12px;
  padding: 8px 10px;
  color: #7b5b28;
  background: #fbf5e8;
  border: 1px solid #efe4c9;
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.45;
}

.stale-banner span {
  margin-right: 5px;
  font-size: 12px;
}

.paper-stage {
  display: flex;
  max-height: min(86vh, 1080px);
  min-height: 650px;
  justify-content: center;
  overflow: auto;
  padding: 24px;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.58), transparent 60%),
    #ecefea;
  scrollbar-color: #c7d0c8 transparent;
  scrollbar-width: thin;
}

.paper-sheet {
  width: 100%;
  max-width: 820px;
  min-height: 995px;
  align-self: flex-start;
  padding: 45px 51px 50px;
  color: #222a26;
  background: var(--paper);
  border: 1px solid #e9e7df;
  box-shadow: var(--shadow-paper);
  font-family: var(--font-paper);
  font-size: 12px;
  line-height: 1.55;
}

.paper-empty-state {
  display: grid;
  min-height: 810px;
  align-content: center;
  justify-items: center;
  padding: 36px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  display: grid;
  width: 74px;
  height: 87px;
  place-items: center;
  margin-bottom: 20px;
  color: #75917e;
  background: #f0f4ee;
  border: 1px solid #e3eae0;
  border-radius: 13px;
  transform: rotate(-4deg);
}

.empty-illustration::before,
.empty-illustration::after {
  position: absolute;
  z-index: -1;
  width: 64px;
  height: 78px;
  background: #f7f7f1;
  border: 1px solid #e8e9df;
  border-radius: 11px;
  content: "";
}

.empty-illustration::before {
  transform: translate(6px, 4px) rotate(9deg);
}

.empty-illustration::after {
  transform: translate(-5px, 4px) rotate(-7deg);
}

.empty-illustration svg {
  width: 38px;
  height: 38px;
}

.paper-empty-state h3 {
  max-width: 360px;
  margin: 0;
  color: #35483d;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.04em;
}

.paper-empty-state p {
  max-width: 330px;
  margin: 8px 0 0;
  color: #849087;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.65;
}

.paper-empty-label {
  margin-top: 19px;
  padding: 6px 9px;
  color: #708076;
  background: #f5f7f2;
  border: 1px solid #e9ede6;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paper-document-header {
  position: relative;
  margin-bottom: 25px;
  padding-bottom: 16px;
  border-bottom: 1.4px solid #272d2a;
  text-align: center;
}

.paper-label-ur {
  font-family: "Noto Nastaliq Urdu", serif;
  line-height: 1.9;
}

.paper-school {
  margin: 0 0 7px;
  color: #1e2924;
  font-family: var(--font-paper);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.3;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.paper-board-label {
  margin: 0 0 4px;
  color: #626963;
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.paper-title {
  margin: 0;
  color: #222b27;
  font-family: var(--font-paper);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.paper-class-subject {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 6px;
  color: #454f49;
  font-family: var(--font-paper);
  font-size: 11px;
  font-weight: 650;
}

.paper-class-subject .separator {
  color: #899189;
}

.paper-header-meta {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 14px;
  color: #424a45;
  font-family: var(--font-paper);
  font-size: 10px;
  font-weight: 600;
  text-align: left;
}

.paper-header-meta span:last-child {
  text-align: right;
}

.paper-line {
  display: block;
  min-width: 60px;
  min-height: 14px;
  color: #1f2823;
  font-weight: 600;
}

.paper-mark-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 13px 0 0;
  padding: 7px 9px;
  color: #39443d;
  background: #f7f7f1;
  border: 1px solid #ebeade;
  font-family: var(--font-paper);
  font-size: 9px;
}

.paper-mark-summary strong {
  font-weight: 700;
}

.paper-mark-difference {
  color: #6f7368;
  font-size: 8px;
}

.paper-mark-difference.is-over {
  color: #8c493d;
}

.paper-section {
  margin-top: 20px;
}

.paper-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 0 0 6px;
  border-bottom: 1px solid #8f9790;
}

.paper-section-heading h3 {
  min-width: 0;
  margin: 0;
  color: #202823;
  font-family: var(--font-paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.paper-section-heading h3 > span {
  white-space: normal;
}

.paper-section-heading h3 .paper-label-ur {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 12px;
  line-height: 1.9;
}

.paper-section-heading > span {
  flex: 0 1 auto;
  color: #555e58;
  font-family: var(--font-paper);
  font-size: 9px;
  font-weight: 600;
  text-align: right;
  white-space: normal;
}

.paper-question-list {
  display: grid;
  gap: 10px;
}

.paper-question {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
  padding: 2px 0 4px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.question-number {
  padding-top: 1px;
  color: #252d28;
  font-family: var(--font-paper);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.question-number[lang="ur"],
.question-mark-value[lang="ur"],
.key-answer[lang="ur"] {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 12px;
  line-height: 1.9;
  text-align: right;
}

.question-body {
  min-width: 0;
}

.question-mark-value {
  padding-top: 1px;
  color: #47514a;
  font-family: var(--font-paper);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.question-panels {
  display: grid;
  gap: 5px 13px;
}

.question-panel-group {
  min-width: 0;
}

.question-panels.is-bilingual {
  grid-template-columns: 1fr 1fr;
}

.question-panel {
  min-width: 0;
  color: #282f2b;
  font-family: var(--font-paper);
  font-size: 11px;
  line-height: 1.52;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.question-panel[lang="ur"] {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 14px;
  line-height: 2.05;
  text-align: right;
  unicode-bidi: plaintext;
}

.question-panel[dir="rtl"] {
  text-align: right;
}

.question-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 11px;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
}

.question-options li {
  color: #353d38;
  font-family: var(--font-paper);
  font-size: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.question-options[lang="ur"] li {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 12px;
  line-height: 2.0;
  text-align: right;
}

.question-figure {
  max-width: 100%;
  max-height: 220px;
  margin: 8px auto 2px;
  display: block;
  object-fit: contain;
}

.figure-missing-note {
  margin: 7px 0 0;
  padding: 5px 7px;
  color: #795f3c;
  background: #fbf7ee;
  border: 1px solid #efe6d2;
  font-family: var(--font-ui);
  font-size: 8px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.paper-document-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 25px;
  padding-top: 8px;
  border-top: 1px solid #d7d9d4;
  color: #7a817a;
  font-family: var(--font-paper);
  font-size: 8px;
}

.paper-document-footer strong {
  color: #4a554e;
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 700;
}

.paper-document-footer .footer-brand-print {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.key-intro {
  margin: -11px 0 17px;
  padding: 10px 12px;
  color: #615b70;
  background: #f5f3f8;
  border: 1px solid #e5e1ed;
  font-family: var(--font-ui);
  font-size: 9px;
  line-height: 1.55;
}

.key-section {
  margin-top: 18px;
}

.key-table {
  width: 100%;
  border-collapse: collapse;
  color: #2c332f;
  font-family: var(--font-paper);
  font-size: 9px;
}

.key-table th,
.key-table td {
  padding: 7px 7px;
  border-bottom: 1px solid #e2e4dd;
  vertical-align: top;
  text-align: left;
}

.key-table th {
  color: #4f5c53;
  background: #f5f6f0;
  border-top: 1px solid #dfe2d9;
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 690;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.key-answer {
  color: #24563d;
  font-family: var(--font-paper);
  font-size: 10px;
  font-weight: 700;
}

.key-answer-copy {
  display: grid;
  gap: 4px;
}

.key-answer-panel[lang="ur"] {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 13px;
  line-height: 2.0;
  text-align: right;
}

.key-prompt {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.key-prompt-panel {
  font-family: var(--font-paper);
  font-size: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.key-prompt-panel[lang="ur"] {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 12px;
  line-height: 2;
  text-align: right;
}

.key-bank-ref {
  display: block;
  margin-top: 3px;
  color: #818a82;
  font-family: var(--font-ui);
  font-size: 7px;
  font-weight: 530;
}

.key-not-provided {
  color: #826638;
  font-family: var(--font-ui);
  font-size: 8px;
  line-height: 1.4;
}

.key-summary {
  margin-top: 19px;
  padding: 10px 11px;
  color: #414d45;
  background: #f7f7f1;
  border: 1px solid #e8e8dc;
  font-family: var(--font-paper);
  font-size: 9px;
}

.preview-footnote {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 12px 17px 14px;
  color: #7c8880;
  background: #f7f8f5;
  border-top: 1px solid #e1e6e0;
  font-size: 9px;
  line-height: 1.5;
}

.footnote-symbol {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  color: #71867a;
  border: 1px solid #b8c7bc;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 9px;
  font-style: italic;
  font-weight: 700;
}

.no-banks-state {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 16px 0 50px;
  padding: 22px;
  background: #fffefa;
  border: 1px solid #e3e6df;
  border-radius: 15px;
  box-shadow: var(--shadow-card);
}

.no-banks-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #9a554b;
  background: #fbefec;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
}

.no-banks-state h2 {
  margin: 0;
  color: #3f4842;
  font-size: 14px;
  font-weight: 680;
}

.no-banks-state p {
  margin: 4px 0 0;
  color: #7a857e;
  font-size: 11px;
}

.site-footer {
  min-height: 68px;
  border-top: 1px solid #e1e6df;
  background: rgba(249, 250, 247, 0.78);
}

.footer-inner {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 11px;
  color: #87928b;
  font-size: 9px;
}

.footer-brand {
  color: #53655b;
  font-size: 10px;
  font-weight: 730;
  letter-spacing: -0.02em;
}

.footer-note {
  padding-left: 11px;
  border-left: 1px solid #d6ddd6;
}

.footer-phase {
  margin-left: auto;
  color: #9aa49d;
  font-size: 8px;
  font-weight: 660;
  letter-spacing: 0.11em;
}

.footer-phase span {
  padding-inline: 4px;
  color: #c0c8bf;
}

@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: minmax(375px, 425px) minmax(0, 1fr);
    gap: 26px;
  }
}

@media (max-width: 1120px) {
  .topbar-inner,
  .page-shell,
  .footer-inner {
    width: min(100% - 44px, 1440px);
  }

  .workspace {
    grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.45fr);
    gap: 15px;
  }

  .setup-card {
    padding-inline: 15px;
  }

  .preview-toolbar {
    padding-inline: 17px;
  }

  .preview-toolbar-top {
    align-items: flex-start;
  }

  .preview-actions {
    max-width: 300px;
  }

  .paper-stage {
    padding: 18px;
  }

  .paper-sheet {
    padding: 39px 36px 44px;
  }
}

@media (max-width: 820px) {
  .topbar-inner,
  .page-shell,
  .footer-inner {
    width: min(100% - 34px, 700px);
  }

  .hero {
    align-items: flex-start;
    padding-top: 40px;
  }

  .hero-bank-card {
    min-width: 210px;
    margin-top: 10px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-column {
    position: static;
  }

  .builder-column {
    gap: 13px;
  }

  .unit-list {
    max-height: 420px;
  }

  .paper-stage {
    max-height: 850px;
  }

  .paper-sheet {
    max-width: 760px;
  }
}

@media (max-width: 560px) {
  .topbar,
  .topbar-inner {
    min-height: 64px;
  }

  .topbar-inner,
  .page-shell,
  .footer-inner {
    width: min(100% - 26px, 470px);
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-divider,
  .brand-caption,
  .phase-chip {
    display: none;
  }

  .topbar-meta {
    gap: 0;
  }

  .local-indicator {
    font-size: 9px;
  }

  .hero {
    display: grid;
    gap: 18px;
    padding: 32px 0 22px;
  }

  .hero h1 {
    font-size: clamp(38px, 11.2vw, 50px);
  }

  .hero-description {
    max-width: 440px;
    margin-top: 12px;
    font-size: 12px;
  }

  .hero-bank-card {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
  }

  .bank-card-icon {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
  }

  .hero-bank-copy strong {
    max-width: none;
  }

  .data-loader {
    gap: 10px;
    margin-bottom: 17px;
    padding: 13px;
  }

  .loader-copy p {
    font-size: 10px;
  }

  .loader-actions {
    align-items: stretch;
  }

  .setup-card {
    padding: 16px 14px 15px;
    border-radius: 15px;
  }

  .card-heading {
    margin-bottom: 14px;
  }

  .card-heading h2 {
    font-size: 14px;
  }

  .select-grid,
  .header-fields {
    gap: 9px;
  }

  .field-label {
    font-size: 10px;
  }

  .field-label input,
  .field-label select {
    height: 37px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .unit-actions {
    align-items: flex-start;
  }

  .small-muted {
    max-width: 165px;
    line-height: 1.45;
  }

  .unit-list {
    max-height: 345px;
  }

  .type-config-row {
    padding-inline: 8px;
  }

  .compact-field input {
    width: 68px;
  }

  .maximum-field {
    align-items: flex-start;
  }

  .maximum-field small {
    max-width: 150px;
    line-height: 1.4;
  }

  .preview-column {
    border-radius: 16px;
  }

  .preview-toolbar {
    padding: 15px 12px 0;
  }

  .preview-toolbar-top {
    display: grid;
    gap: 12px;
    padding-bottom: 12px;
  }

  .preview-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .preview-actions .button {
    flex: 1 1 auto;
    min-height: 34px;
    padding-inline: 8px;
    font-size: 8px;
  }

  .preview-actions .button svg {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  .preview-controls {
    align-items: end;
    gap: 6px;
  }

  .view-tabs {
    gap: 11px;
  }

  .view-tab {
    min-height: 37px;
    font-size: 9px;
  }

  .language-switch {
    gap: 1px;
    padding: 2px;
  }

  .language-button {
    min-width: 29px;
    min-height: 24px;
    padding-inline: 5px;
    font-size: 8px;
  }

  .language-button[data-language="urdu"] {
    font-size: 9px;
  }

  .paper-stage {
    max-height: 76vh;
    min-height: 510px;
    padding: 12px;
  }

  .paper-sheet {
    min-height: 650px;
    padding: 27px 20px 32px;
    font-size: 10px;
  }

  .paper-empty-state {
    min-height: 590px;
    padding: 20px;
  }

  .paper-school {
    font-size: 14px;
  }

  .paper-title {
    font-size: 12px;
  }

  .paper-class-subject {
    font-size: 10px;
  }

  .paper-header-meta {
    font-size: 8px;
  }

  .paper-mark-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 5px 8px;
  }

  .paper-mark-difference {
    grid-column: 1 / -1;
  }

  .question-panels.is-bilingual {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .question-panel[lang="ur"] {
    font-size: 13px;
  }

  .question-options {
    grid-template-columns: 1fr 1fr;
    gap: 2px 7px;
  }

  .question-options li {
    font-size: 8px;
  }

  .question-options[lang="ur"] li {
    font-size: 11px;
  }

  .paper-section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .paper-section-heading > span {
    text-align: left;
  }

  .paper-question {
    grid-template-columns: 25px minmax(0, 1fr) auto;
    gap: 5px;
  }

  .key-table th,
  .key-table td {
    padding: 6px 4px;
  }

  .preview-footnote {
    padding: 10px 12px 12px;
  }

  .footer-inner {
    min-height: 63px;
  }

  .footer-note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@page {
  size: A4 portrait;
  margin: 13mm 14mm 14mm;
}

@media print {
  :root {
    color-scheme: light;
  }

  html,
  body {
    width: auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    color: #000;
    background: #fff !important;
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .topbar,
  .hero,
  .data-loader,
  .builder-column,
  .preview-toolbar,
  .preview-footnote,
  .site-footer,
  .no-banks-state,
  .skip-link {
    display: none !important;
  }

  .page-shell,
  .workspace,
  .preview-column,
  .paper-stage {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body[data-print-target="student"] #student-paper {
    display: block !important;
  }

  body[data-print-target="student"] #answer-key {
    display: none !important;
  }

  body[data-print-target="answer-key"] #student-paper {
    display: none !important;
  }

  body[data-print-target="answer-key"] #answer-key {
    display: block !important;
  }

  .paper-sheet,
  .paper-sheet[hidden] {
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    color: #000 !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 10pt;
  }

  .paper-empty-state {
    min-height: 0 !important;
  }

  .paper-question,
  .paper-section-heading,
  .key-table tr,
  .key-intro,
  .key-summary {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .paper-section {
    break-inside: auto;
    page-break-inside: auto;
  }

  .paper-section + .paper-section {
    break-before: auto;
    page-break-before: auto;
  }

  .paper-section-heading {
    break-after: avoid;
    page-break-after: avoid;
  }

  .question-panels.is-bilingual {
    grid-template-columns: 1fr 1fr;
  }

  .question-panel[lang="ur"],
  .question-options[lang="ur"] li,
  .key-answer-panel[lang="ur"],
  .key-prompt-panel[lang="ur"] {
    font-family: "Noto Nastaliq Urdu", serif !important;
    print-color-adjust: exact;
  }

  .paper-document-footer {
    margin-top: 16px;
  }

  .figure-missing-note {
    color: #58421f !important;
    background: #fff !important;
  }

  a,
  a:visited {
    color: #000;
    text-decoration: none;
  }
}

/* Four-step setup wizard */
.workspace {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 24px;
}

.workspace.has-preview {
  grid-template-columns: minmax(0, 405px) minmax(0, 1fr);
  justify-content: stretch;
}

.builder-column {
  gap: 15px;
}

.wizard-progress {
  padding: 16px 18px 13px;
  background: rgba(255, 255, 253, 0.94);
  border: 1px solid #e1e7e1;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.wizard-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wizard-progress-kicker {
  margin: 0 0 3px;
  color: #829288;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.14em;
}

.wizard-progress-heading h2 {
  margin: 0;
  color: #2c4036;
  font-size: 17px;
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1.3;
}

.wizard-progress-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3f6750;
  font-size: 14px;
  font-weight: 730;
  font-variant-numeric: tabular-nums;
}

.wizard-progress-count span {
  color: #b2bcb3;
  font-size: 11px;
  font-weight: 500;
}

.wizard-progress-track {
  height: 5px;
  margin-top: 13px;
  overflow: hidden;
  background: #ebefea;
  border-radius: 5px;
}

.wizard-progress-track > span {
  display: block;
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, #4f8061, #8fb195);
  border-radius: inherit;
  transition: width 0.22s ease;
}

.wizard-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.wizard-progress-steps li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: #99a39c;
  font-size: 9px;
  font-weight: 570;
  white-space: nowrap;
}

.wizard-progress-steps li > span {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  color: #8c9990;
  background: #f1f4f0;
  border: 1px solid #e7ece6;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 690;
  font-variant-numeric: tabular-nums;
}

.wizard-progress-steps li.is-current {
  color: #365f48;
  font-weight: 720;
}

.wizard-progress-steps li.is-current > span,
.wizard-progress-steps li.is-complete > span {
  color: #fff;
  background: #4b7659;
  border-color: #4b7659;
}

.wizard-progress-steps li.is-complete {
  color: #698071;
}

.wizard-step-stack {
  min-width: 0;
}

.wizard-step {
  min-width: 0;
}

.wizard-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wizard-choice-card {
  display: flex;
  min-width: 0;
  min-height: 116px;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 13px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid #e1e8e0;
  border-radius: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.wizard-choice-card:hover:not(:disabled) {
  background: #fbfdf9;
  border-color: #a9c1ad;
  box-shadow: 0 5px 14px rgba(32, 72, 61, 0.075);
  transform: translateY(-1px);
}

.wizard-choice-card.is-selected {
  background: #f2f7f1;
  border-color: #70977b;
  box-shadow: inset 0 0 0 1px rgba(84, 128, 93, 0.1), 0 3px 10px rgba(32, 72, 61, 0.055);
}

.wizard-choice-card.is-coming-soon,
.wizard-choice-card:disabled {
  color: #7e8982;
  background: #f8f9f6;
  border-color: #e8ece6;
  cursor: not-allowed;
  opacity: 0.78;
}

.choice-card-top {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.choice-card-mark {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  place-items: center;
  color: #50745a;
  background: #edf3ec;
  border: 1px solid #e3ece2;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.wizard-choice-card.is-selected .choice-card-mark {
  color: #fff;
  background: #4b7659;
  border-color: #4b7659;
}

.is-coming-soon .choice-card-mark {
  color: #8c9890;
  background: #f0f2ee;
  border-color: #e8ece6;
}

.choice-card-status {
  overflow: hidden;
  color: #938e7b;
  font-size: 8px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-card-status.is-ready {
  color: #4f765c;
}

.choice-card-title {
  display: block;
  overflow: hidden;
  color: #34473d;
  font-size: 13px;
  font-weight: 690;
  letter-spacing: -0.035em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-card-descriptor {
  display: block;
  overflow: hidden;
  color: #87938b;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-choice-mark {
  font-family: Georgia, serif;
  font-size: 18px;
}

.bank-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf0eb;
}

.blueprint-setup {
  display: grid;
  gap: 14px;
}

.paper-setup-card .setup-intro {
  margin-top: -8px;
  margin-bottom: 14px;
}

.language-config-field {
  display: grid;
  gap: 9px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid #e9eee8;
}

.language-config-field > div:first-child {
  display: grid;
  gap: 2px;
}

.language-config-field > div:first-child strong {
  color: #3e5347;
  font-size: 10px;
  font-weight: 670;
}

.language-config-field small {
  color: #89958d;
  font-size: 9px;
}

.language-config-field .language-switch {
  width: 100%;
}

.language-config-field .language-button {
  min-height: 34px;
  flex: 1 1 0;
  font-size: 9px;
}

.unit-item {
  grid-template-columns: 18px minmax(0, 1fr) minmax(95px, auto);
  min-height: 63px;
  padding: 8px 10px;
}

.unit-count-group {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
}

.unit-question-count {
  color: #526e5d;
  font-size: 9px;
  font-weight: 680;
  white-space: nowrap;
}

.unit-count-group .unit-total {
  max-width: 150px;
  padding: 0;
  overflow: hidden;
  color: #89958d;
  background: transparent;
  font-size: 7px;
  text-overflow: ellipsis;
}

.wizard-navigation {
  position: static;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(100px, 1fr) minmax(130px, 1fr);
  grid-template-areas: "back note next";
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
}

.wizard-back {
  grid-area: back;
  width: 100%;
  min-height: 46px;
  font-size: 11px;
}

.wizard-next,
.wizard-generate {
  grid-area: next;
  width: 100%;
  min-height: 48px;
}

.wizard-navigation-note {
  grid-area: note;
  color: #819087;
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.generate-assurance {
  margin-top: -5px;
}

.preview-column {
  min-width: 0;
}

.edit-paper-button {
  white-space: nowrap;
}

@media (min-width: 821px) {
  .workspace.has-preview {
    grid-template-columns: minmax(360px, 405px) minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .workspace,
  .workspace.has-preview {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .builder-column {
    width: min(100%, 720px);
    margin-inline: auto;
  }

  .preview-column {
    position: static;
  }

  .wizard-navigation {
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr);
    grid-template-areas: "back next" "note note";
    gap: 6px 9px;
    margin: 0 -5px;
    padding: 9px;
    background: rgba(247, 249, 245, 0.96);
    border: 1px solid #dfe7df;
    border-radius: 14px;
    box-shadow: 0 9px 22px rgba(31, 50, 42, 0.11);
    backdrop-filter: blur(12px);
  }

  .wizard-navigation-note {
    min-height: 15px;
    font-size: 8px;
  }
}

@media (max-width: 560px) {
  .workspace,
  .workspace.has-preview {
    gap: 17px;
  }

  .builder-column {
    gap: 12px;
  }

  .wizard-progress {
    padding: 14px 13px 12px;
    border-radius: 14px;
  }

  .wizard-progress-heading h2 {
    font-size: 16px;
  }

  .wizard-progress-steps {
    gap: 2px;
    margin-top: 9px;
  }

  .wizard-progress-steps li {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: 8px;
  }

  .wizard-progress-steps li > span {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    font-size: 7px;
  }

  .wizard-step-stack > .setup-card,
  .blueprint-setup > .setup-card {
    padding: 16px 14px 15px;
    border-radius: 15px;
  }

  .card-heading {
    gap: 9px;
    margin-bottom: 14px;
  }

  .card-heading h2 {
    font-size: 14px;
  }

  .wizard-choice-grid {
    gap: 8px;
  }

  .wizard-choice-card {
    min-height: 108px;
    gap: 7px;
    padding: 10px;
    border-radius: 12px;
  }

  .choice-card-mark {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    border-radius: 9px;
  }

  .choice-card-status {
    font-size: 7px;
  }

  .choice-card-title {
    font-size: 12px;
  }

  .choice-card-descriptor {
    font-size: 8px;
  }

  .unit-actions {
    align-items: flex-start;
  }

  .unit-availability-summary,
  .small-muted {
    max-width: 58%;
    font-size: 9px;
  }

  .text-button {
    font-size: 9px;
  }

  .unit-item {
    grid-template-columns: 18px minmax(0, 1fr) minmax(82px, auto);
    gap: 7px;
    padding-inline: 8px;
  }

  .unit-name {
    font-size: 9px;
  }

  .unit-question-count {
    font-size: 8px;
  }

  .unit-count-group .unit-total {
    max-width: 112px;
    font-size: 6px;
  }

  .type-config-row {
    padding-inline: 8px;
  }

  .numeric-field-row {
    padding-left: 0;
  }

  .compact-field {
    font-size: 8px;
  }

  .compact-field input {
    width: 68px;
  }

  .language-config-field .language-button {
    min-width: 0;
    padding-inline: 4px;
    font-size: 8px;
  }

  .header-fields {
    gap: 9px;
  }

  .wizard-navigation {
    bottom: max(6px, env(safe-area-inset-bottom));
    margin-inline: -3px;
    padding: 8px;
  }

  .wizard-back,
  .wizard-next,
  .wizard-generate {
    min-height: 47px;
  }

  .preview-toolbar-top {
    flex-direction: column;
    align-items: stretch;
  }

  .preview-actions {
    justify-content: flex-start;
  }

  .preview-actions .button {
    flex: 1 1 135px;
  }
}

/* Clean Academic theme: the builder shares the landing page's visual system. */
@media screen {
  body {
    background: var(--canvas);
    font-family: var(--font-ui);
    line-height: 1.5;
  }

  .topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: 76px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .topbar-inner,
  .page-shell,
  .footer-inner {
    width: min(1160px, calc(100% - 40px));
    margin-inline: auto;
  }

  .topbar-inner {
    min-height: 76px;
    gap: 22px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    color: #fff;
    background: linear-gradient(135deg, var(--teal), #2265cc);
    border-radius: 12px;
    box-shadow: 0 7px 18px rgba(15, 155, 142, 0.2);
  }

  .brand-name {
    color: var(--ink);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.045em;
  }

  .brand-divider {
    background: var(--line-strong);
  }

  .brand-caption {
    color: var(--muted);
    font-size: 0.78rem;
  }

  .local-indicator,
  .phase-chip {
    color: #52677e;
    font-size: 0.72rem;
    font-weight: 650;
  }

  .indicator-dot,
  .bank-status-dot,
  .preview-pulse {
    background: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.12);
  }

  .phase-chip {
    padding: 6px 10px;
    color: var(--teal-dark);
    background: var(--mint);
    border: 1px solid #d5eee8;
    border-radius: 8px;
    letter-spacing: 0.09em;
  }

  .page-shell {
    padding-bottom: 64px;
  }

  .hero {
    position: relative;
    overflow: hidden;
    align-items: center;
    gap: 24px;
    margin: 30px 0 24px;
    padding: 31px 34px;
    background:
      radial-gradient(circle at 88% 15%, #d4f3ec 0, transparent 31%),
      linear-gradient(120deg, #f8fcff 0%, #eaf8f6 100%);
    border: 1px solid #dcefeb;
    border-radius: 20px;
  }

  .hero-copy {
    flex: 1 1 auto;
    max-width: 690px;
  }

  .eyebrow {
    color: var(--teal-dark);
  }

  .eyebrow-rule {
    background: var(--teal);
  }

  .hero h1 {
    color: var(--ink);
    font-size: clamp(2.45rem, 4.2vw, 3.6rem);
    font-weight: 760;
    letter-spacing: -0.06em;
    line-height: 1.02;
  }

  .hero h1 span {
    color: var(--teal);
    font-weight: 620;
  }

  .hero-description {
    color: #536a80;
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .hero-bank-card {
    flex: 0 0 auto;
    min-width: 250px;
    padding: 14px 15px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dfe9ef;
    border-radius: 14px;
    box-shadow: 0 7px 22px rgba(16, 36, 62, 0.055);
  }

  .bank-card-icon,
  .loader-mark {
    color: var(--teal-dark);
    background: var(--mint);
  }

  .micro-label {
    color: var(--teal-dark);
  }

  .hero-bank-copy strong {
    color: var(--ink);
    font-size: 0.9rem;
  }

  .hero-bank-copy > span:last-child {
    color: var(--muted);
  }

  .bank-status-dot.is-loading {
    background: #d39c42;
    box-shadow: 0 0 0 3px rgba(211, 156, 66, 0.14);
  }

  .bank-status-dot.is-error {
    background: var(--red);
    box-shadow: 0 0 0 3px rgba(164, 63, 56, 0.12);
  }

  .data-loader {
    gap: 14px;
    padding: 17px 20px;
    background: #fff;
    border-color: var(--line);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(16, 36, 62, 0.035);
  }

  .loader-copy > strong {
    color: var(--ink);
  }

  .loader-copy p {
    color: var(--muted);
  }

  .workspace {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
    gap: 22px;
  }

  .workspace.has-preview {
    grid-template-columns: minmax(360px, 405px) minmax(0, 1fr);
    justify-content: stretch;
  }

  .builder-column {
    gap: 15px;
  }

  .setup-card,
  .wizard-progress {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: var(--shadow-card);
  }

  .setup-card {
    padding: 20px;
  }

  .card-heading {
    gap: 12px;
  }

  .step-number {
    color: var(--teal-dark);
    background: var(--mint);
    border-color: #d6eee8;
    border-radius: 11px;
  }

  .step-number-muted {
    color: var(--muted);
    background: #f0f5f8;
    border-color: var(--line);
  }

  .card-kicker,
  .wizard-progress-kicker {
    color: var(--teal-dark);
  }

  .card-heading h2,
  .wizard-progress-heading h2 {
    color: var(--ink);
  }

  .count-pill {
    color: var(--teal-dark);
    background: var(--mint);
    border-color: #d5eee8;
  }

  .field-label {
    color: #344b62;
  }

  .field-label input,
  .field-label select,
  .compact-field input,
  .maximum-input-wrap input {
    color: var(--ink);
    background-color: #fff;
    border-color: #d6e1e9;
    border-radius: 10px;
  }

  .field-label input:hover,
  .field-label select:hover,
  .compact-field input:hover,
  .maximum-input-wrap input:hover {
    border-color: #a9c5c5;
  }

  .field-label input:focus,
  .field-label select:focus,
  .compact-field input:focus,
  .maximum-input-wrap input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.1);
  }

  .bank-meta strong {
    color: #40576d;
  }

  .coming-soon-note {
    color: #587b77;
    background: #f0faf7;
    border-color: #d8eee8;
    border-radius: 10px;
  }

  .sparkle {
    color: var(--teal);
  }

  .bank-report-details {
    border-top-color: var(--line);
  }

  .bank-report-details summary {
    color: #52677e;
  }

  .report-indicator {
    background: var(--teal);
  }

  .report-issue {
    background: #f7fafc;
    border-color: var(--line);
    border-radius: 9px;
  }

  .report-issue.is-warning {
    background: #fff9ed;
    border-color: #f1e4c7;
  }

  .report-issue.is-error {
    background: #fff5f2;
    border-color: #f2deda;
  }

  .report-issue strong {
    color: #344b62;
  }

  .unit-availability-summary,
  .small-muted,
  .field-hint {
    color: var(--muted);
  }

  .text-button {
    color: var(--teal-dark);
    font-size: 0.76rem;
  }

  .text-button:hover {
    color: #075f59;
  }

  .unit-item {
    background: #fff;
    border-color: var(--line);
    border-radius: 11px;
  }

  .unit-item:hover {
    background: #f8fcfc;
    border-color: #b9dcd6;
  }

  .unit-item:has(input:checked) {
    background: #edf9f6;
    border-color: #9dd3c7;
  }

  .unit-item input {
    accent-color: var(--teal);
  }

  .unit-name {
    color: #344b62;
  }

  .unit-number,
  .unit-count-group .unit-total {
    color: #8797a7;
  }

  .unit-total {
    background: #f1f6f8;
  }

  .unit-question-count {
    color: var(--teal-dark);
  }

  .setup-intro {
    color: var(--muted);
  }

  .type-config-row {
    background: #f8fbfc;
    border-color: var(--line);
    border-radius: 12px;
  }

  .type-config-heading strong {
    color: #344b62;
  }

  .available-count {
    color: #8191a0;
  }

  .section-total {
    color: var(--teal-dark);
  }

  .type-marker-mcq {
    color: var(--teal-dark);
    background: #e8f8f5;
  }

  .type-marker-short {
    color: #8a642d;
    background: #fff5e2;
  }

  .type-marker-long {
    color: #2557a7;
    background: #eaf0ff;
  }

  .maximum-field {
    background: #eef9f6;
    border-color: #d5eee8;
    border-radius: 12px;
  }

  .maximum-field strong {
    color: #245b57;
  }

  .maximum-field small,
  .maximum-input-wrap {
    color: var(--muted);
  }

  .language-config-field {
    border-top-color: var(--line);
  }

  .language-config-field > div:first-child strong {
    color: #344b62;
  }

  .language-config-field small {
    color: var(--muted);
  }

  .language-switch {
    background: #f0f5f8;
    border-color: var(--line);
    border-radius: 10px;
  }

  .language-button {
    color: #61748b;
    border-radius: 7px;
  }

  .language-button:hover {
    color: var(--teal-dark);
  }

  .language-button.is-active {
    color: var(--teal-dark);
    background: #fff;
    box-shadow: 0 1px 4px rgba(16, 36, 62, 0.12);
  }

  .button {
    min-height: 43px;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 11px;
    font-size: 0.84rem;
    font-weight: 720;
    line-height: 1.2;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  }

  .button:focus-visible {
    outline-color: rgba(15, 155, 142, 0.32);
  }

  .button:disabled {
    opacity: 0.52;
  }

  .button-primary,
  .button-generate {
    color: #fff;
    background: var(--teal);
    box-shadow: 0 7px 18px rgba(15, 155, 142, 0.18);
  }

  .button-primary:hover:not(:disabled),
  .button-generate:hover:not(:disabled) {
    color: #fff;
    background: var(--teal-dark);
    box-shadow: 0 8px 21px rgba(15, 155, 142, 0.22);
    transform: translateY(-1px);
  }

  .button-small {
    min-height: 36px;
    padding-inline: 12px;
    border-radius: 9px;
    font-size: 0.78rem;
  }

  .button-quiet {
    color: var(--teal-dark);
    background: var(--mint);
    border-color: #d5eee8;
  }

  .button-quiet:hover:not(:disabled) {
    color: #075f59;
    background: #ddf4ee;
    border-color: #b9e3d9;
  }

  .button-outline {
    color: var(--ink);
    background: #fff;
    border-color: #cbd9e5;
  }

  .button-outline:hover:not(:disabled) {
    color: var(--teal-dark);
    background: #f9fcfc;
    border-color: var(--teal);
  }

  .button-generate {
    min-height: 49px;
    padding-inline: 18px;
    border-radius: 12px;
    font-size: 0.92rem;
  }

  .generate-assurance {
    color: var(--muted);
    font-size: 0.73rem;
  }

  .assurance-check {
    color: var(--teal-dark);
    background: var(--mint);
  }

  .generation-message {
    padding: 11px 13px;
    color: #85601e;
    background: #fff9ed;
    border-color: #f1e4c7;
    border-radius: 10px;
    font-size: 0.8rem;
  }

  .generation-message.is-error {
    color: #853e37;
    background: #fff5f2;
    border-color: #f2deda;
  }

  .generation-message.is-success {
    color: #176e62;
    background: #eaf8f4;
    border-color: #d0eee5;
  }

  .preview-column {
    background: #fff;
    border-color: var(--line);
    border-radius: 19px;
    box-shadow: var(--shadow);
  }

  .preview-toolbar {
    background: #fff;
    border-bottom-color: var(--line);
  }

  .preview-label {
    color: var(--teal-dark);
  }

  .preview-pulse {
    background: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.12);
  }

  .preview-toolbar h2 {
    color: var(--ink);
  }

  .button-key {
    color: #2557a7;
    background: #eff4ff;
    border-color: #dbe6ff;
  }

  .button-key:hover:not(:disabled) {
    color: #173f8a;
    background: #e7efff;
    border-color: #bfd0fa;
  }

  .view-tab {
    color: #7b8b9b;
  }

  .view-tab:hover,
  .view-tab.is-active {
    color: var(--teal-dark);
  }

  .view-tab.is-active::after {
    background: var(--teal);
  }

  .key-separation-dot {
    background: #6d8fe0;
  }

  .stale-banner {
    color: #85601e;
    background: #fff9ed;
    border-color: #f1e4c7;
    border-radius: 9px;
  }

  .paper-stage {
    background:
      radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.76), transparent 60%),
      #edf3f6;
    scrollbar-color: #c2d2dc transparent;
  }

  .paper-sheet {
    color: #222a26;
    background: #fff;
    border-color: #e3ebf2;
    box-shadow: 0 18px 42px rgba(16, 36, 62, 0.12), 0 2px 6px rgba(16, 36, 62, 0.07);
  }

  .empty-illustration {
    color: var(--teal-dark);
    background: #eef9f6;
    border-color: #d5eee8;
  }

  .preview-footnote {
    color: var(--muted);
  }

  .no-banks-state {
    color: var(--ink);
    background: #fff;
    border-color: var(--line);
    border-radius: 17px;
    box-shadow: var(--shadow-card);
  }

  .site-footer {
    border-top-color: var(--line);
  }
}

@media screen and (max-width: 1120px) {
  .topbar-inner,
  .page-shell,
  .footer-inner {
    width: min(1160px, calc(100% - 40px));
  }
}

@media screen and (max-width: 820px) {
  .topbar-inner,
  .page-shell,
  .footer-inner {
    width: min(720px, calc(100% - 40px));
  }

  .workspace,
  .workspace.has-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-column {
    position: static;
  }

  .builder-column {
    width: min(100%, 720px);
    margin-inline: auto;
  }

  .hero {
    align-items: flex-start;
  }
}

@media screen and (max-width: 560px) {
  .topbar,
  .topbar-inner {
    min-height: 64px;
  }

  .topbar-inner,
  .page-shell,
  .footer-inner {
    width: min(470px, calc(100% - 28px));
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .brand-divider,
  .brand-caption,
  .phase-chip {
    display: none;
  }

  .topbar-meta {
    gap: 0;
  }

  .local-indicator {
    font-size: 0.65rem;
  }

  .hero {
    display: grid;
    gap: 15px;
    margin: 19px 0 18px;
    padding: 22px 18px;
    border-radius: 16px;
  }

  .hero h1 {
    font-size: clamp(2.3rem, 11vw, 3rem);
  }

  .hero-description {
    margin-top: 11px;
    font-size: 0.84rem;
  }

  .hero-bank-card {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
  }

  .data-loader {
    gap: 10px;
    margin-bottom: 16px;
    padding: 13px;
    border-radius: 13px;
  }

  .loader-copy p {
    font-size: 0.72rem;
  }

  .setup-card {
    padding: 16px 14px;
    border-radius: 15px;
  }

  .wizard-progress {
    padding: 14px 13px 12px;
    border-radius: 14px;
  }

  .wizard-progress-heading h2 {
    font-size: 1rem;
  }

  .wizard-choice-grid {
    gap: 8px;
  }

  .wizard-choice-card {
    min-height: 108px;
    padding: 10px;
  }

  .unit-item {
    min-height: 61px;
  }

  .unit-list {
    max-height: 345px;
  }

  .preview-column {
    border-radius: 16px;
  }

  .preview-toolbar {
    padding: 15px 12px 0;
  }

  .preview-toolbar-top {
    align-items: flex-start;
  }

  .preview-actions {
    justify-content: flex-start;
  }

  .preview-actions .button {
    min-height: 36px;
    padding-inline: 9px;
    font-size: 0.68rem;
  }

  .preview-controls {
    gap: 6px;
  }

  .view-tabs {
    gap: 11px;
  }

  .view-tab {
    font-size: 0.7rem;
  }

  .language-button {
    min-width: 29px;
    padding-inline: 5px;
    font-size: 0.66rem;
  }

  .paper-stage {
    min-height: 510px;
    padding: 12px;
  }

  .paper-sheet {
    min-height: 650px;
    padding: 27px 20px 32px;
    font-size: 10px;
  }
}

@media screen {
  .wizard-progress-count {
    color: var(--teal-dark);
  }

  .wizard-progress-count span {
    color: #9aabba;
  }

  .wizard-progress-track {
    background: #eaf1f5;
  }

  .wizard-progress-track > span {
    background: linear-gradient(90deg, var(--teal), #5ebeb2);
  }

  .wizard-progress-steps li {
    color: #8a99a8;
  }

  .wizard-progress-steps li > span {
    color: #75879a;
    background: #f2f6f8;
    border-color: var(--line);
  }

  .wizard-progress-steps li.is-current {
    color: var(--teal-dark);
  }

  .wizard-progress-steps li.is-current > span,
  .wizard-progress-steps li.is-complete > span {
    color: #fff;
    background: var(--teal);
    border-color: var(--teal);
  }

  .wizard-progress-steps li.is-complete {
    color: #537d77;
  }

  .wizard-choice-card {
    background: #fff;
    border-color: var(--line);
    border-radius: 13px;
  }

  .wizard-choice-card:hover:not(:disabled) {
    background: #f8fcfb;
    border-color: #a9d7cf;
    box-shadow: 0 6px 16px rgba(16, 36, 62, 0.07);
  }

  .wizard-choice-card.is-selected {
    background: #edf9f6;
    border-color: #8fcdbf;
    box-shadow: inset 0 0 0 1px rgba(15, 155, 142, 0.08), 0 4px 12px rgba(16, 36, 62, 0.055);
  }

  .wizard-choice-card.is-coming-soon,
  .wizard-choice-card:disabled {
    color: #7d8c9b;
    background: #f7f9fb;
    border-color: #e6edf2;
  }

  .choice-card-mark {
    color: var(--teal-dark);
    background: var(--mint);
    border-color: #d5eee8;
  }

  .wizard-choice-card.is-selected .choice-card-mark {
    color: #fff;
    background: var(--teal);
    border-color: var(--teal);
  }

  .is-coming-soon .choice-card-mark {
    color: #8797a7;
    background: #f0f4f7;
    border-color: #e5edf2;
  }

  .choice-card-status {
    color: #8a8e84;
  }

  .choice-card-status.is-ready {
    color: var(--teal-dark);
  }

  .choice-card-title {
    color: #314961;
  }

  .choice-card-descriptor {
    color: var(--muted);
  }

  .subject-choice-mark {
    font-family: var(--font-ui);
    font-size: 15px;
  }

  .wizard-navigation-note {
    color: var(--muted);
  }
}

@media screen and (max-width: 820px) {
  .wizard-navigation {
    background: rgba(255, 255, 255, 0.97);
    border-color: var(--line);
    box-shadow: 0 9px 22px rgba(16, 36, 62, 0.11);
  }
}

@media screen {
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  select:focus-visible,
  summary:focus-visible,
  [tabindex]:focus-visible {
    outline-color: rgba(15, 155, 142, 0.34);
  }

  .field-label input::placeholder {
    color: #9aabba;
  }

  .compact-field,
  .text-button-group {
    color: #8192a3;
  }

  .unit-list {
    scrollbar-color: #c2d2dc transparent;
  }

  .report-indicator.has-warnings {
    background: #d39c42;
  }

  .report-indicator.has-errors {
    background: var(--red);
  }

  .chevron {
    color: #8797a7;
  }

  .report-summary {
    color: var(--muted);
  }

  .site-footer {
    background: rgba(255, 255, 255, 0.78);
  }

  .footer-inner {
    color: var(--muted-light);
  }

  .footer-brand {
    color: #344b62;
  }

  .footer-note {
    border-left-color: var(--line-strong);
  }

  .footer-phase {
    color: #8797a7;
  }

  .footer-phase span {
    color: #a9b8c5;
  }

  .no-banks-mark {
    color: var(--red);
    background: var(--red-wash);
  }

  .no-banks-state h2 {
    color: var(--ink);
  }

  .no-banks-state p {
    color: var(--muted);
  }
}
