@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Special+Elite&display=swap");

:root {
  --ink-900: #121212;
  --ink-700: #2a2a2a;
  --paper: #f7f6f2;
  --paper-strong: #fcfcfb;
  --line: #8a8a8a;
  --frame: #202020;
  --accent: #ece9df;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  font-family: "Libre Baskerville", "Times New Roman", serif;
  color: var(--ink-900);
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 10%, rgba(0, 0, 0, 0.06), transparent 40%),
    radial-gradient(circle at 84% 14%, rgba(0, 0, 0, 0.05), transparent 34%),
    linear-gradient(180deg, #e2e1dc 0%, #d7d5cf 100%);
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

input,
select,
textarea {
  max-width: 100%;
}

h1,
h2,
h3,
.brand-title {
  font-family: "Libre Baskerville", "Times New Roman", serif;
  letter-spacing: 0.01em;
}

.portal-header {
  background: linear-gradient(180deg, #202020, #121212);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand-title {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-title:hover {
  color: #f0f0f0;
}

.user-chip {
  color: #f6f6f6;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.sinhala-tooltip-enabled #sinhalaTooltipToggle {
  background: #f4f4f4;
  color: #111;
  border-color: #f4f4f4;
}

.page-shell {
  max-width: 1320px;
  margin: 1.5rem auto;
}

.portal-header .container-fluid {
  gap: 0.75rem;
}

.hero-panel {
  border: 2px solid var(--frame);
  background: var(--paper-strong);
  border-radius: 0.3rem;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22);
}

.hero-panel h1 {
  font-size: clamp(1.12rem, 2.4vw, 1.5rem);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.hero-panel p {
  color: var(--ink-700);
  opacity: 0.94;
  font-size: 0.92rem;
}

.exam-brief {
  background-image:
    linear-gradient(180deg, transparent 93%, rgba(32, 32, 32, 0.16) 94%),
    linear-gradient(0deg, rgba(247, 246, 242, 0.94), rgba(247, 246, 242, 0.94));
  background-size: 100% 2.2rem, auto;
}

.exam-top-tabs .nav-link {
  border-radius: 0.2rem;
  border: 1px solid var(--frame);
  color: var(--ink-900);
  background: #f4f2eb;
  font-weight: 700;
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
}

.exam-top-tabs {
  gap: 0.5rem;
}

.exam-top-tabs .nav-item {
  flex: 0 1 auto;
}

.exam-top-tabs .nav-link.active {
  background: #171717;
  color: #fff;
  border-color: #171717;
}

.paper-surface {
  background: linear-gradient(180deg, #fbfaf7, #f4f2eb);
  border-radius: 0.35rem;
  border: 2px solid var(--frame);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.18);
  padding: 1rem;
}

.inner-tabs .nav-link {
  font-weight: 700;
  color: var(--ink-900);
}

.inner-tabs .nav-link.active {
  color: #000;
  border-color: #272727 #272727 transparent;
}

.paper-tab-bar {
  overflow-x: auto;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.55);
  padding-bottom: 0.75rem;
}

.paper-tab-bar .nav-link {
  margin-right: 0.45rem;
  margin-bottom: 0.35rem;
  border: 1px solid #2e2e2e;
  background: #f7f5ee;
  min-width: 2.8rem;
  color: #111;
  font-family: "Special Elite", "Courier New", monospace;
}

.paper-tab-bar .nav-link.active {
  background: #1f1f1f;
  color: #fff;
  border-color: #1f1f1f;
}

.selection-link-row {
  display: flex;
  justify-content: flex-start;
}

.selection-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: #111;
  font-weight: 700;
  border: 1px solid rgba(17, 17, 17, 0.4);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.selection-back-link:hover {
  color: #111;
  border-color: #111;
  transform: translateY(-1px);
}

.selection-shell {
  display: grid;
  gap: 1.2rem;
}

.selection-hero {
  position: relative;
  overflow: hidden;
  border: 2px solid #1a1a1a;
  border-radius: 1rem;
  padding: 1.4rem;
  background:
    radial-gradient(circle at top right, rgba(194, 166, 96, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(255, 251, 242, 0.98), rgba(239, 234, 223, 0.96));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.16);
}

.selection-hero::after {
  content: "";
  position: absolute;
  inset: auto -3rem -3rem auto;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.06);
}

.selection-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-hero h1 {
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
  margin-bottom: 0.7rem;
  max-width: 14ch;
}

.selection-hero p {
  max-width: 70ch;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #2d2d2d;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.selection-card,
.selection-status-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.1);
}

.selection-card {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 1.45rem;
  min-height: 100%;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 242, 234, 0.95));
}

.selection-card:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 88, 38, 0.45);
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.16);
}

.selection-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #8c6a2f, #d0b27b);
}

.selection-card-body {
  display: flex;
  flex: 1;
  align-items: center;
}

.selection-card h2,
.selection-status-panel h2 {
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  line-height: 1.5;
  margin: 0;
  color: #181818;
}

.selection-card p,
.selection-status-panel p {
  margin: 0;
  color: #2e2e2e;
  line-height: 1.7;
}

.selection-card .btn {
  margin-top: auto;
  align-self: stretch;
  padding: 0.78rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.selection-card-action {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.selection-status-panel {
  padding: 1.25rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 239, 229, 0.98));
}

.selection-status-panel .status-chip {
  display: inline-flex;
  margin-bottom: 0.8rem;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  background: rgba(194, 166, 96, 0.18);
  color: #5a4323;
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .selection-hero {
    padding: 1.1rem;
  }

  .selection-hero h1 {
    max-width: none;
  }
}

.iq-shell {
  display: grid;
  gap: 1.15rem;
}

.iq-header-card {
  display: grid;
  gap: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 1.1rem;
  padding: 1.35rem;
  background:
    radial-gradient(circle at top right, rgba(185, 153, 74, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(243, 238, 229, 0.94));
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
}

.iq-title-block {
  display: grid;
  gap: 0.75rem;
}

.iq-title-block h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  color: #141414;
}

.iq-title-support {
  margin: -0.2rem 0 0;
  color: #6b7280;
  font-size: 1rem;
  font-weight: 600;
}

.iq-page-summary,
.iq-support-copy,
.iq-section-support,
.iq-section-lead,
.iq-focus-support,
.iq-card-subtitle {
  margin: 0;
  line-height: 1.7;
}

.iq-page-summary {
  max-width: 78ch;
  color: #111827;
}

.iq-page-summary-support,
.iq-support-copy,
.iq-section-support,
.iq-focus-support,
.iq-card-subtitle {
  color: #6b7280;
}

.iq-focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.95rem;
}

.iq-focus-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.iq-focus-card h2 {
  margin: 0;
  font-size: 1rem;
}

.iq-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.iq-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(87, 67, 30, 0.24);
  background: rgba(255, 251, 242, 0.95);
  color: #3f2f18;
  font-size: 0.88rem;
  font-weight: 700;
}

.iq-section-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.iq-section-button {
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 0.95rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  color: #172033;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.iq-section-button:hover,
.iq-section-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(140, 106, 47, 0.48);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
}

.iq-section-button.is-active {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  border-color: #0f172a;
}

.iq-content-panel {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 1.1rem;
  padding: 1.3rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.iq-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.iq-section-heading-stack {
  align-items: start;
}

.iq-section-heading h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.iq-paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.iq-paper-card {
  display: grid;
  gap: 0.85rem;
  min-height: 100%;
  padding: 1.15rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 1rem;
  background: linear-gradient(180deg, #fffdf9, #f6f2ea);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.iq-paper-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.iq-paper-code,
.iq-paper-status {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.iq-paper-code {
  background: #1f2937;
  color: #fff;
}

.iq-paper-status {
  background: rgba(160, 120, 47, 0.14);
  color: #6a4e20;
}

.iq-paper-card h3 {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.5;
}

.iq-paper-card p {
  margin: 0;
  color: #313131;
  line-height: 1.65;
}

.iq-practice-bank {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.iq-question-list {
  display: grid;
  gap: 1rem;
}

.iq-question-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 236, 0.95));
}

.iq-question-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.iq-question-number,
.iq-question-skill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.iq-question-number {
  background: #1f2937;
  color: #fff;
}

.iq-question-skill {
  background: rgba(161, 98, 7, 0.12);
  color: #7c4a03;
}

.iq-question-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
}

.iq-option-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.iq-option-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.iq-option-list li span {
  display: block;
}

.iq-option-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.08);
  color: #1e293b;
  font-weight: 800;
}

.iq-answer-toggle {
  justify-self: start;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #8c6a2f, #6d4f1f);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(109, 79, 31, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.iq-answer-toggle:hover,
.iq-answer-toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(109, 79, 31, 0.28);
}

.iq-answer-panel {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 0.95rem;
  background: rgba(250, 245, 236, 0.92);
  border: 1px solid rgba(140, 106, 47, 0.2);
}

.iq-answer-panel p {
  margin: 0;
}

.iq-paper-meta {
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.iq-paper-meta div {
  display: grid;
  grid-template-columns: minmax(120px, 150px) 1fr;
  gap: 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.iq-paper-meta dt {
  font-weight: 700;
  color: #1f2937;
}

.iq-paper-meta dd {
  margin: 0;
  color: #2c2c2c;
}

.iq-table-shell {
  overflow-x: auto;
}

.iq-resource-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.iq-resource-table th,
.iq-resource-table td {
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  text-align: left;
  vertical-align: top;
}

.iq-resource-table thead th {
  background: #f2ede3;
  color: #172033;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.iq-resource-table tbody tr:hover {
  background: rgba(250, 247, 240, 0.82);
}

.iq-resource-table td strong,
.iq-resource-table td span {
  display: block;
}

.iq-resource-table td span {
  margin-top: 0.2rem;
  color: #525252;
}

.iq-guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(255, 251, 244, 0.96), rgba(244, 238, 226, 0.92));
  margin-bottom: 1.15rem;
}

.iq-guide-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(109, 79, 31, 0.1);
  color: #7a561e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.iq-guide-hero-copy {
  display: grid;
  gap: 0.75rem;
}

.iq-guide-hero-copy h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.iq-guide-hero-copy p {
  margin: 0;
  line-height: 1.7;
}

.iq-guide-stat-grid {
  display: grid;
  gap: 0.8rem;
}

.iq-guide-stat-grid article {
  display: grid;
  gap: 0.25rem;
  align-content: center;
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.iq-guide-stat-grid strong {
  font-size: 1.2rem;
  color: #111827;
}

.iq-guide-stat-grid span {
  color: #6b7280;
}

.iq-guide-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.iq-guide-tab {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  min-height: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.iq-guide-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.08);
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 800;
}

.iq-guide-tab strong {
  font-size: 0.96rem;
  line-height: 1.5;
}

.iq-guide-tab:hover,
.iq-guide-tab:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(140, 106, 47, 0.35);
}

.iq-guide-tab.is-active {
  background: linear-gradient(135deg, #1e293b, #111827);
  color: #fff;
  border-color: #111827;
}

.iq-guide-tab.is-active span {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.iq-guide-module-list {
  display: grid;
}

.iq-guide-module {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

.iq-guide-module header {
  display: grid;
  gap: 0.35rem;
}

.iq-guide-module header span {
  color: #8c6a2f;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.iq-guide-module header h3 {
  margin: 0;
  font-size: 1.18rem;
}

.iq-guide-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.iq-guide-module-grid section {
  padding: 1rem;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, rgba(250, 247, 240, 0.96), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.iq-guide-module-grid h4 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.iq-guide-module-grid ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.55rem;
}

.iq-guide-module-grid li {
  line-height: 1.65;
}

.iq-guide-callout {
  padding: 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(140, 106, 47, 0.18);
  background: rgba(250, 245, 236, 0.92);
}

.iq-guide-callout strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #5b4218;
}

.iq-guide-callout p {
  margin: 0;
  line-height: 1.65;
}

@media (max-width: 991.98px) {
  .iq-section-nav {
    grid-template-columns: 1fr;
  }

  .iq-guide-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .iq-header-card,
  .iq-content-panel {
    padding: 1rem;
  }

  .iq-section-heading,
  .iq-section-heading-stack {
    flex-direction: column;
    align-items: start;
  }

  .iq-paper-meta div {
    grid-template-columns: 1fr;
  }

  .iq-resource-table {
    min-width: 100%;
  }

  .iq-resource-table thead {
    display: none;
  }

  .iq-resource-table,
  .iq-resource-table tbody,
  .iq-resource-table tr,
  .iq-resource-table td {
    display: block;
    width: 100%;
  }

  .iq-resource-table tr {
    padding: 0.15rem 0;
  }

  .iq-resource-table td {
    padding: 0.55rem 0;
    border-bottom: none;
  }

  .iq-resource-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #5a5a5a;
  }
}

.question-paper {
  padding: 1rem 0.9rem;
  border-radius: 0.25rem;
  border: 2px solid var(--frame);
  background: var(--paper);
  position: relative;
}

.question-paper::before {
  content: "";
  position: absolute;
  inset: 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.paper-head {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.56);
  position: relative;
  z-index: 1;
}

.paper-head h2 {
  font-size: clamp(1rem, 2vw, 1.28rem);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.exam-sheet-head {
  gap: 0.65rem;
}

.sheet-left-code {
  min-width: 2.6rem;
  min-height: 2.6rem;
  border: 1px solid #111;
  border-radius: 999px;
  display: grid;
  place-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
}

.sheet-head-copy {
  flex: 1;
}

.sheet-auth {
  font-size: 0.8rem;
  text-transform: uppercase;
}

.sheet-duration span {
  display: inline-block;
  border: 1px solid #222;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  font-style: italic;
  font-size: 0.88rem;
}

.marks-box {
  width: min(34vw, 250px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.marks-box table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.marks-box th,
.marks-box td {
  border: 1px solid #1a1a1a;
  padding: 0.2rem 0.35rem;
  text-align: center;
}

.marks-box thead th {
  background: #ece9df;
}

.marks-box .total-row td {
  font-weight: 700;
  background: #f2efe6;
}

.paper-tools {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px dotted #1f1f1f;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.index-line {
  letter-spacing: 0.03em;
  font-weight: 700;
}

.btn-answer-toggle {
  background: #1d1d1d;
  color: #fff;
  border: 1px solid #090909;
  white-space: nowrap;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  padding: 0.28rem 0.65rem;
}

.btn-answer-toggle:hover {
  background: #090909;
  color: #fff;
}

.question-tools {
  display: flex;
  justify-content: flex-end;
}

.answer-panel {
  border-radius: 0.2rem;
  border: 1px solid #333;
  background: #f0ede4;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.question-answer-panel {
  margin-top: 0.65rem;
  margin-bottom: 0.55rem;
}

.sample-answer-text {
  white-space: pre-line;
  line-height: 1.58;
}

.email-answer-card {
  border: 1px solid rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, #ffffff, #f7f3ea);
  border-radius: 0.35rem;
  padding: 0.95rem 1rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 8px 16px rgba(0, 0, 0, 0.08);
}

.email-answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.52rem;
  gap: 0.55rem;
}

.email-answer-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  background: #efede5;
}

.email-answer-stamp {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #444;
  font-family: "Special Elite", "Courier New", monospace;
}

.email-answer-meta {
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: #fdfbf5;
  border-radius: 0.3rem;
  padding: 0.42rem 0.5rem;
  margin-bottom: 0.55rem;
}

.email-meta-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.45rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.email-meta-row + .email-meta-row {
  margin-top: 0.2rem;
}

.email-meta-key {
  font-weight: 700;
}

.email-answer-subject {
  font-weight: 700;
  font-size: 0.98rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.55rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

.email-answer-greeting,
.email-answer-closing,
.email-answer-signature {
  font-size: 0.91rem;
  line-height: 1.6;
}

.email-answer-body {
  margin: 0.35rem 0 0.45rem;
}

.email-answer-body p {
  margin-bottom: 0.5rem;
  line-height: 1.65;
  font-size: 0.91rem;
}

.email-answer-footer {
  border-top: 1px dashed rgba(0, 0, 0, 0.24);
  margin-top: 0.5rem;
  padding-top: 0.45rem;
}

.email-answer-signature {
  font-weight: 700;
}

.email-answer-fallback {
  opacity: 0.88;
}

.analysis-answer-card {
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #fffdf8, #f7f2e8);
  border-radius: 0.35rem;
  padding: 0.85rem 0.9rem;
}

.analysis-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.analysis-answer-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  background: #efe9db;
  padding: 0.15rem 0.5rem;
}

.analysis-answer-note {
  font-size: 0.74rem;
  color: #454545;
}

.analysis-answer-grid {
  display: grid;
  gap: 0.5rem;
}

.analysis-answer-item {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.68);
  padding: 0.5rem 0.6rem;
}

.analysis-answer-title {
  margin: 0 0 0.2rem;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.analysis-answer-text {
  margin: 0;
  line-height: 1.6;
  font-size: 0.91rem;
}

.incident-answer-card {
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #fffef9, #f3ece0);
  border-radius: 0.35rem;
  padding: 0.85rem 0.9rem;
}

.incident-answer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.incident-answer-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  background: #eee6d7;
  padding: 0.15rem 0.5rem;
}

.incident-answer-note {
  font-size: 0.74rem;
  color: #444;
}

.incident-answer-grid {
  display: grid;
  gap: 0.45rem;
}

.incident-answer-item {
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.68);
  padding: 0.46rem 0.58rem;
}

.incident-answer-title {
  margin: 0 0 0.2rem;
  font-size: 0.84rem;
  text-transform: uppercase;
}

.incident-answer-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.58;
}

.policy-answer-card,
.vocab-answer-card {
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 0.35rem;
  padding: 0.85rem 0.9rem;
}

.policy-answer-card {
  background: linear-gradient(180deg, #fffef8, #f3ecdf);
}

.vocab-answer-card {
  background: linear-gradient(180deg, #ffffff, #f1ece1);
}

.policy-answer-head,
.vocab-answer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.52rem;
}

.policy-answer-label,
.vocab-answer-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  background: #ece4d3;
}

.policy-answer-note,
.vocab-answer-note {
  font-size: 0.74rem;
  color: #444;
}

.policy-answer-body {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.68);
  padding: 0.55rem 0.62rem;
}

.policy-answer-body p {
  margin: 0;
  font-size: 0.91rem;
  line-height: 1.63;
}

.vocab-answer-grid {
  display: grid;
  gap: 0.45rem;
}

.vocab-answer-item {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 0.58rem;
}

.vocab-answer-term {
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  font-size: 0.84rem;
}

.vocab-answer-definition,
.vocab-answer-sentence {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.vocab-answer-definition + .vocab-answer-sentence {
  margin-top: 0.22rem;
}

.sequence-answer-card {
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #fffef8, #f1ece0);
  border-radius: 0.35rem;
  padding: 0.85rem 0.9rem;
}

.answer-key-card {
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #fffef9, #f2ede3);
  border-radius: 0.35rem;
  padding: 0.85rem 0.9rem;
}

.answer-key-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.answer-key-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  background: #ece4d3;
  padding: 0.14rem 0.5rem;
}

.answer-key-note {
  font-size: 0.74rem;
  color: #444;
}

.answer-key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.45rem;
}

.answer-key-item {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.45rem 0.55rem;
}

.answer-key-index {
  min-width: 1.3rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.answer-key-value {
  font-size: 0.9rem;
  line-height: 1.5;
}

.sequence-answer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.sequence-answer-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  background: #ece4d3;
  padding: 0.14rem 0.5rem;
}

.sequence-answer-note {
  font-size: 0.74rem;
  color: #444;
}

.sequence-answer-grid {
  display: grid;
  gap: 0.45rem;
}

.sequence-answer-item {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.45rem 0.55rem;
}

.sequence-answer-stage,
.sequence-answer-code,
.sequence-answer-option {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.sequence-answer-code {
  font-weight: 700;
}

.sequence-answer-option {
  margin-top: 0.15rem;
}

.sequence-answer-unused {
  margin-top: 0.6rem;
  border: 1px dashed rgba(0, 0, 0, 0.28);
  border-radius: 0.3rem;
  background: rgba(255, 251, 242, 0.92);
  padding: 0.48rem 0.58rem;
}

.sequence-answer-unused-code,
.sequence-answer-unused-reason {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.sequence-answer-unused-code {
  font-weight: 700;
}

.sequence-answer-unused-reason {
  margin-top: 0.12rem;
}

.dialogue-answer-card {
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #fffef9, #f4ede0);
  border-radius: 0.35rem;
  padding: 0.9rem 0.95rem;
}

.dialogue-answer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.dialogue-answer-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  background: #ece4d3;
  padding: 0.14rem 0.5rem;
}

.dialogue-answer-note {
  font-size: 0.74rem;
  color: #444;
}

.dialogue-answer-grid {
  display: grid;
  gap: 0.45rem;
}

.dialogue-answer-item {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.45rem 0.55rem;
}

.dialogue-answer-step,
.dialogue-answer-code,
.dialogue-answer-text,
.dialogue-answer-unused,
.dialogue-answer-rationale,
.dialogue-answer-line {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.dialogue-answer-code,
.dialogue-answer-unused,
.dialogue-answer-speaker {
  font-weight: 700;
}

.dialogue-answer-text {
  margin-top: 0.12rem;
}

.dialogue-answer-meta {
  margin-top: 0.55rem;
  border: 1px dashed rgba(0, 0, 0, 0.28);
  border-radius: 0.3rem;
  background: rgba(255, 251, 242, 0.92);
  padding: 0.48rem 0.58rem;
}

.dialogue-answer-rationale {
  margin-top: 0.18rem;
}

.dialogue-answer-sheet {
  margin-top: 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.32);
  background: #fbf8f1;
  padding: 0.55rem 0.6rem;
}

.dialogue-answer-row {
  display: grid;
  grid-template-columns: 8.6rem 1fr;
  gap: 0.55rem;
  margin-bottom: 0.3rem;
  align-items: start;
}

.dialogue-answer-line {
  border-bottom: 1px dotted rgba(0, 0, 0, 0.55);
  padding-bottom: 0.2rem;
}

.interview-case-sheet {
  border: 1px solid rgba(0, 0, 0, 0.45);
  background: linear-gradient(180deg, #fcfaf4, #f2ede2);
  padding: 0.7rem 0.75rem;
}

.interview-case-header h4,
.response-bank h5 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.interview-case-header p {
  line-height: 1.55;
}

.interview-score-strip {
  margin: 0.6rem 0;
  border-left: 4px solid #876237;
  background: rgba(255, 252, 244, 0.9);
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
}

.response-bank {
  border: 1px solid rgba(0, 0, 0, 0.28);
  background: rgba(255, 255, 255, 0.76);
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.65rem;
}

.response-bank ol {
  margin: 0;
  padding-left: 1.3rem;
}

.response-bank li {
  margin-bottom: 0.22rem;
  line-height: 1.5;
}

.interview-sheet {
  border: 1px solid rgba(0, 0, 0, 0.34);
  background: #faf8f1;
  padding: 0.55rem 0.6rem;
}

.interview-row,
.interview-answer-row {
  display: grid;
  grid-template-columns: 8.6rem 1fr;
  gap: 0.55rem;
  margin-bottom: 0.32rem;
  align-items: start;
}

.interview-speaker,
.interview-answer-speaker {
  font-weight: 700;
  font-size: 0.9rem;
}

.interview-line,
.interview-answer-line {
  min-height: 1.8rem;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding-bottom: 0.2rem;
  line-height: 1.55;
}

.interview-select {
  min-width: min(100%, 320px);
  width: clamp(180px, 32vw, 320px);
  max-width: 100%;
}

.interview-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.check-item {
  border: 1px dashed rgba(0, 0, 0, 0.26);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}

.interview-answer-card {
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #fffef8, #efe9da);
  border-radius: 0.35rem;
  padding: 0.9rem 0.95rem;
}

.interview-answer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.interview-answer-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  background: #e7dcc7;
  padding: 0.14rem 0.5rem;
}

.interview-answer-note {
  font-size: 0.74rem;
  color: #444;
}

.interview-answer-grid {
  display: grid;
  gap: 0.45rem;
}

.interview-answer-item {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.76);
  padding: 0.45rem 0.55rem;
}

.interview-answer-step,
.interview-answer-code,
.interview-answer-text,
.interview-answer-unused,
.interview-answer-line {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.interview-answer-code,
.interview-answer-unused {
  font-weight: 700;
}

.interview-answer-text {
  margin-top: 0.12rem;
}

.interview-answer-meta {
  margin-top: 0.55rem;
  border: 1px dashed rgba(0, 0, 0, 0.28);
  border-radius: 0.3rem;
  background: rgba(255, 251, 242, 0.94);
  padding: 0.48rem 0.58rem;
}

.interview-answer-checklist {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.interview-answer-checklist li {
  margin-bottom: 0.18rem;
}

.interview-answer-sheet {
  margin-top: 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.32);
  background: #fbf8f1;
  padding: 0.55rem 0.6rem;
}

.answer-panel h3 {
  font-size: 1.02rem;
  text-transform: uppercase;
}

.question-card {
  border: none;
  border-radius: 0;
  padding: 0.75rem 0.2rem;
  margin-bottom: 0.7rem;
  background: transparent;
  position: relative;
  z-index: 1;
}

.paper-question {
  border-bottom: 1px dashed rgba(0, 0, 0, 0.32);
}

.question-line {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.35rem;
  min-width: 0;
}

.question-line h3 {
  min-width: 1.3rem;
  font-size: 1.04rem;
  margin: 0;
}

.question-line p {
  margin: 0;
  line-height: 1.55;
  min-width: 0;
}

.utterance-panel {
  border: 1px solid #222;
  background: #f4f2eb;
  padding: 0.55rem 0.7rem;
  margin: 0.4rem 0 0.75rem;
}

.utterance-panel h4 {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.utterance-panel ol {
  margin: 0;
  padding-left: 1.3rem;
  font-size: 0.91rem;
}

.utterance-panel li {
  margin-bottom: 0.08rem;
}

.dialogue-sheet {
  border: 1px solid rgba(0, 0, 0, 0.44);
  background: #faf8f2;
  padding: 0.55rem 0.6rem;
}

.dialogue-row {
  display: grid;
  grid-template-columns: 8.6rem 1fr;
  gap: 0.55rem;
  margin-bottom: 0.3rem;
  align-items: start;
}

.speaker {
  font-weight: 700;
  font-size: 0.9rem;
}

.speech {
  min-height: 1.8rem;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding-bottom: 0.2rem;
}

.blank-label {
  font-weight: 700;
}

.dialogue-blank {
  min-width: min(100%, 360px);
  width: clamp(220px, 44vw, 360px);
  max-width: 100%;
  border: none;
  border-bottom: 1px dotted #1a1a1a;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  padding: 0.05rem 0.2rem;
}

.dialogue-blank:focus {
  border-bottom-style: solid;
}

.dialogue-blank-select {
  min-width: min(100%, 520px);
  width: clamp(280px, 58vw, 520px);
  max-width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 2.5rem 0.45rem 0.7rem;
  border: 1px solid #1c1c1c;
  border-radius: 0;
  background-color: #fffdf7;
  font-size: 0.93rem;
  line-height: 1.35;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.dialogue-blank-select:focus {
  border-color: #111;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 0 0 0.12rem rgba(0, 0, 0, 0.12);
}

.reading-passage {
  border: 1px solid #232323;
  background: #f6f4ed;
  padding: 0.75rem;
  margin: 0.3rem 0 0.8rem;
}

.reading-passage h4 {
  font-size: 0.96rem;
  margin: 0 0 0.45rem;
}

.reading-passage p {
  margin-bottom: 0.55rem;
  line-height: 1.55;
  font-size: 0.91rem;
}

.activity-sheet {
  border: 1px solid rgba(0, 0, 0, 0.44);
  background: #faf8f2;
  padding: 0.7rem;
}

.activity-block {
  border-bottom: 1px dashed rgba(0, 0, 0, 0.32);
  padding-bottom: 0.6rem;
  margin-bottom: 0.65rem;
}

.activity-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.activity-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.activity-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.inline-answer {
  min-width: 140px;
  border: none;
  border-bottom: 1px dotted #1d1d1d;
  background: transparent;
  padding: 0.06rem 0.16rem;
}

.inline-answer.wide {
  min-width: min(100%, 280px);
  width: clamp(210px, 42vw, 360px);
}

.mcq-grid {
  display: grid;
  gap: 0.22rem;
  font-size: 0.9rem;
}

.question-subpart {
  display: block;
  font-size: 0.9rem;
  margin: 0.35rem 0 0.2rem;
}

.short-ruled {
  border: 1px solid rgba(18, 18, 18, 0.2);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0),
      rgba(0, 0, 0, 0) 31px,
      rgba(0, 0, 0, 0.32) 32px,
      rgba(0, 0, 0, 0.32) 33px
    ),
    #faf8f2;
  margin-bottom: 0.35rem;
}

.news-item-box {
  border: 1px solid #252525;
  background: #f4f2ea;
  padding: 0.68rem;
  margin: 0.3rem 0 0.72rem;
}

.news-item-box h4 {
  margin: 0 0 0.42rem;
  font-size: 0.93rem;
}

.news-item-box p {
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.52;
}

.q4-instruction {
  font-size: 0.9rem;
  margin: 0.2rem 0 0.38rem;
}

.q4-ruled {
  margin-top: 0.2rem;
}

.q5-starter-box {
  border: 1px solid #252525;
  background: #f4f2ea;
  padding: 0.66rem;
  margin: 0.3rem 0 0.62rem;
}

.q5-starter-box h4 {
  margin: 0 0 0.36rem;
  font-size: 0.93rem;
}

.q5-starter-box p {
  font-size: 0.9rem;
  line-height: 1.52;
}

.q5-ruled {
  margin-top: 0.15rem;
}

.q6-word-bank {
  border: 1px solid #252525;
  background: #f4f2ea;
  padding: 0.64rem;
  margin: 0.3rem 0 0.62rem;
}

.q6-word-bank h4 {
  margin: 0 0 0.3rem;
  font-size: 0.93rem;
}

.q6-word-bank p {
  font-size: 0.88rem;
  line-height: 1.5;
}

.q6-passage {
  border: 1px solid rgba(0, 0, 0, 0.45);
  background: #faf8f2;
  padding: 0.75rem;
}

.q6-passage p {
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  line-height: 1.62;
}

.blank-tag {
  font-weight: 700;
  margin-left: 0.2rem;
}

.q6-passage .inline-answer {
  min-width: 92px;
  width: clamp(76px, 8vw, 118px);
  margin: 0 0.2rem;
}

.paper-two-panel {
  border: 1px solid #252525;
  background: #f4f2ea;
  padding: 0.65rem;
  margin: 0.25rem 0 0.65rem;
}

.paper-two-panel h4 {
  margin: 0 0 0.35rem;
  font-size: 0.93rem;
}

.paper-two-panel p {
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}

.paper-two-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.paper-two-item label {
  font-size: 0.9rem;
}

.paper-two-select {
  min-width: 220px;
  width: 100%;
}

.paper-two-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.paper-two-list li {
  margin-bottom: 0.2rem;
}

.paper-two-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.3rem 0.55rem;
  align-items: center;
}

.paper-two-grid label {
  font-size: 0.89rem;
}

.paper-three-panel {
  border: 1px solid #1e1e1e;
  background: #f1eee5;
  padding: 0.65rem;
  margin: 0.25rem 0 0.6rem;
}

.paper-three-panel h4 {
  margin: 0 0 0.4rem;
  font-size: 0.93rem;
}

.paper-three-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.paper-three-order {
  width: 110px;
  max-width: 100%;
  border: 1px solid #262626;
  background: #fbfbf9;
  padding: 0.1rem 0.25rem;
}

.paper-three-options {
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 0.3rem;
  background: #fbf9f3;
  padding: 0.45rem 0.55rem;
}

.paper-three-option-item {
  display: grid;
  grid-template-columns: 1.2rem 1fr;
  gap: 0.35rem;
  align-items: start;
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}

.paper-three-option-item:last-child {
  margin-bottom: 0;
}

.paper-three-grid,
.paper-three-qa {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 0.3rem 0.55rem;
  align-items: center;
}

.paper-three-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.paper-three-list {
  margin: 0.3rem 0 0;
  padding-left: 1rem;
  font-size: 0.89rem;
}

.paper-three-table th,
.paper-three-table td {
  vertical-align: middle;
}

.paper-three-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.paper-three-table tbody,
.paper-three-table thead {
  width: 100%;
}

.ruled-answer {
  border: 1px solid rgba(18, 18, 18, 0.2);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0),
      rgba(0, 0, 0, 0) 31px,
      rgba(0, 0, 0, 0.32) 32px,
      rgba(0, 0, 0, 0.32) 33px
    ),
    #faf8f2;
}

.answer-box {
  border-radius: 0;
  border: none;
}

.answer-box:focus {
  box-shadow: none;
}

.ruled-input {
  resize: vertical;
  line-height: 2rem;
  padding: 0.12rem 0.75rem;
  background: transparent;
  font-size: 1rem;
}

.ruled-input::placeholder {
  color: rgba(45, 45, 45, 0.7);
}

.marks-note {
  text-align: right;
  font-weight: 700;
  font-style: italic;
  margin-top: 0.3rem;
}

.placeholder-pane {
  min-height: 14rem;
  display: grid;
  place-content: center;
  text-align: center;
}

.learning-materials-panel {
  padding: 1.1rem;
}

.learning-materials-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.5);
}

.learning-materials-header h2 {
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.learning-materials-lead {
  margin: 0;
  max-width: 56rem;
  color: var(--ink-700);
}

.learning-materials-chip {
  flex: 0 0 auto;
  border: 1px solid #202020;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-weight: 700;
  background: #f4f1e8;
  white-space: nowrap;
}

.learning-vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.learning-vocab-card {
  background: linear-gradient(180deg, #fcfbf7, #f3efe6);
  border: 1px solid rgba(0, 0, 0, 0.65);
  border-radius: 0.35rem;
  padding: 0.9rem 0.95rem 0.85rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.learning-vocab-category {
  display: inline-block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  margin-bottom: 0.55rem;
  padding-bottom: 0.18rem;
}

.learning-vocab-word {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.learning-vocab-meaning {
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.learning-vocab-example {
  margin: 0;
  color: var(--ink-700);
  font-size: 0.92rem;
  line-height: 1.55;
}

.login-wrap {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(100%, 500px);
  background: #f9f8f4;
  border: 2px solid rgba(0, 0, 0, 0.6);
  border-radius: 0.3rem;
  padding: 2rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.footer-note {
  color: rgba(16, 16, 16, 0.78);
  padding: 1rem 0 2rem;
}

@media (max-width: 768px) {
  .page-shell {
    margin-top: 1rem;
  }

  .portal-header .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
    flex-wrap: wrap;
  }

  .portal-header .ms-auto {
    width: 100%;
    margin-left: 0 !important;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .portal-header .ms-auto > .d-flex {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .portal-header .btn,
  .portal-header .user-chip {
    width: 100%;
  }

  .hero-panel {
    padding: 0.95rem;
  }

  .exam-top-tabs .nav-item {
    flex: 1 1 calc(50% - 0.5rem);
  }

  .exam-top-tabs .nav-link {
    width: 100%;
    margin-right: 0;
    text-align: center;
  }

  .paper-surface,
  .question-paper,
  .login-card {
    padding: 0.8rem;
  }

  .paper-head {
    flex-direction: column;
    align-items: stretch;
  }

  .marks-box {
    width: 100%;
  }

  .paper-tools {
    flex-direction: column;
    align-items: flex-start;
  }

  .question-line {
    flex-direction: column;
    gap: 0.3rem;
  }

  .question-line h3 {
    min-width: 0;
  }

  .learning-materials-header {
    flex-direction: column;
  }

  .learning-vocab-grid {
    grid-template-columns: 1fr;
  }

  .btn-answer-toggle {
    width: 100%;
  }

  .ruled-input {
    font-size: 0.95rem;
    line-height: 1.8rem;
  }

  .dialogue-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .dialogue-blank {
    width: 100%;
    min-width: 0;
  }

  .dialogue-blank-select {
    width: 100%;
    min-width: 0;
  }

  .activity-item {
    align-items: stretch;
  }

  .inline-answer,
  .inline-answer.wide {
    width: 100%;
    min-width: 100%;
  }

  .paper-two-item,
  .paper-two-grid,
  .paper-three-row,
  .paper-three-grid,
  .paper-three-qa,
  .paper-three-columns {
    grid-template-columns: 1fr;
  }

  .paper-two-select {
    min-width: 100%;
  }

  .paper-three-table th,
  .paper-three-table td,
  .marks-box th,
  .marks-box td {
    white-space: nowrap;
  }

  .footer-note .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 15px;
  }

  .page-shell {
    margin-top: 0.85rem;
    margin-bottom: 0.85rem;
  }

  .paper-surface {
    padding: 0.7rem;
  }

  .question-paper::before {
    inset: 0.35rem;
  }

  .paper-head {
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
  }

  .sheet-left-code {
    min-width: 2.2rem;
    min-height: 2.2rem;
    font-size: 0.95rem;
  }

  .exam-top-tabs .nav-item {
    flex-basis: 100%;
  }

  .paper-tab-bar {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .paper-tab-bar .nav-link {
    min-width: 2.5rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .answer-panel,
  .email-answer-card,
  .paper-two-panel,
  .paper-three-panel,
  .reading-passage,
  .activity-sheet,
  .dialogue-sheet,
  .news-item-box,
  .q5-starter-box,
  .q6-word-bank,
  .q6-passage,
  .learning-vocab-card,
  .login-card {
    padding: 0.75rem;
  }

  .btn-answer-toggle {
    font-size: 0.82rem;
  }

  .marks-box {
    width: 100%;
  }

  .marks-box table {
    min-width: 220px;
  }

  .ruled-input {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }
}