:root {
  --ink: #17201a;
  --muted: #5d6760;
  --paper: #f7f4ec;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --line: #dcd6c8;
  --line-strong: #b8ae9c;
  --moss: #425f4c;
  --moss-dark: #21382c;
  --moss-soft: #eaf1ec;
  --cinnabar: #a9422f;
  --cinnabar-soft: #fdf1ee;
  --ochre: #b78128;
  --ochre-soft: #fcf6e8;
  --aqua: #276267;
  --aqua-soft: #eaf4f4;
  --shadow: 0 14px 36px rgba(33, 56, 44, 0.09);
  --shadow-lg: 0 24px 64px rgba(23, 32, 26, 0.22);
  --radius: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.65;
  background:
    linear-gradient(90deg, rgba(66, 95, 76, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(66, 95, 76, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 12% 0%, rgba(183, 129, 40, 0.14), transparent 34%),
    linear-gradient(155deg, #f3efe4 0%, #fbfaf6 48%, #ebf2ed 100%);
  background-size: 32px 32px, 32px 32px, auto, auto;
}

button,
a,
input,
textarea {
  font: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==================== Studio Shell & Header ==================== */

.studio-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: max(16px, var(--safe-top)) max(18px, var(--safe-right)) max(40px, var(--safe-bottom)) max(18px, var(--safe-left));
}

.app-header {
  position: sticky;
  top: max(10px, var(--safe-top));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(184, 174, 156, 0.72);
  border-radius: 14px;
  background: rgba(255, 254, 250, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--moss-dark), var(--moss));
  color: #fffdf7;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(33, 56, 44, 0.25);
}

.brand-copy h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--moss-dark);
}

.brand-copy p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.core-nav {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(243, 239, 228, 0.8);
}

.core-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 22px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--moss-dark);
  transition: all 0.16s ease;
}

.core-tab:hover {
  background: rgba(255, 255, 255, 0.65);
}

.core-tab.active {
  background: linear-gradient(135deg, var(--moss-dark), var(--moss));
  color: #fffef9;
  box-shadow: 0 6px 16px rgba(33, 56, 44, 0.22);
}

.core-tab-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.core-tab-sub {
  font-size: 11px;
  opacity: 0.82;
  margin-top: 1px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.provider-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffefa;
  color: var(--moss-dark);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.provider-trigger:hover {
  border-color: var(--moss);
  background: var(--moss-soft);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ochre);
  flex: none;
}

.status-dot.ok {
  background: #2f855a;
}

.status-dot.bad {
  background: var(--cinnabar);
}

/* ==================== Core Pages & Cards ==================== */

.core-page {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.core-page.active {
  display: flex;
}

.hero-card,
.surface-card {
  border: 1px solid rgba(184, 174, 156, 0.72);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 95% 15%, rgba(66, 95, 76, 0.08), transparent 45%),
    rgba(255, 254, 250, 0.92);
}

.hero-copy {
  flex: 1 1 420px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.hero-copy h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

.hero-copy p:last-child {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.surface-card {
  padding: 20px 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h3,
.section-heading h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--moss-dark);
}

.section-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.compact-heading {
  margin-bottom: 10px;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.muted-text {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 13px;
}

.small-text {
  font-size: 12px;
}

/* ==================== Buttons ==================== */

.primary-button,
.secondary-button,
.ghost-button,
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.primary-button {
  border: 1px solid var(--moss-dark);
  background: linear-gradient(135deg, var(--moss-dark), var(--moss));
  color: #fffef9;
  box-shadow: 0 6px 14px rgba(33, 56, 44, 0.2);
}

.primary-button:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--moss);
  background: var(--moss-soft);
  color: var(--moss-dark);
}

.secondary-button:hover:not(:disabled) {
  background: #dce8e0;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: #fffefa;
  color: var(--ink);
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--moss);
  background: #f6f3ea;
}

.danger-button {
  border-color: rgba(169, 66, 47, 0.45);
  color: var(--cinnabar);
}

.danger-button:hover:not(:disabled) {
  background: var(--cinnabar-soft);
  border-color: var(--cinnabar);
}

.upload-button {
  border: 1px dashed var(--aqua);
  background: var(--aqua-soft);
  color: var(--aqua);
}

.upload-button:hover:not(:disabled) {
  background: #daecec;
  border-style: solid;
}

.small-button {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 13px;
}

/* ==================== Annual Year Grid & History ==================== */

.annual-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

.annual-year-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
  transition: all 0.15s ease;
}

.annual-year-button:hover {
  border-color: var(--moss);
  transform: translateY(-1px);
}

.annual-year-button.active {
  border-color: var(--moss-dark);
  background: linear-gradient(135deg, var(--moss-dark), var(--moss));
  color: #fffef9;
  box-shadow: 0 8px 18px rgba(33, 56, 44, 0.22);
}

.annual-year-button strong {
  font-size: 17px;
  line-height: 1.1;
}

.annual-year-button span {
  font-size: 12px;
  opacity: 0.85;
}

.annual-year-button small {
  font-size: 11px;
  color: var(--cinnabar);
  font-weight: 700;
}

.annual-year-button.active small {
  color: #f8de9a;
}

.annual-history-list {
  display: grid;
  gap: 10px;
}

.annual-history-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
}

.annual-history-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.annual-history-meta strong {
  font-size: 15px;
  color: var(--moss-dark);
}

.annual-history-meta span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ==================== Annual Workspace ==================== */

.paper-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.paper-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.score-summary-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f2;
  text-align: right;
}

.summary-chip span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.summary-chip strong {
  font-size: 17px;
  color: var(--moss-dark);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 18px;
}

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e6e1d5;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--moss), var(--aqua));
  transition: width 0.25s ease;
}

.progress-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.annual-paper-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.annual-question-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f2;
  max-height: 75vh;
  overflow-y: auto;
}

.annual-nav-section h4 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
}

.annual-nav-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.annual-nav-button {
  min-height: 34px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fffefa;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.annual-nav-button.answered {
  border-color: var(--aqua);
  background: var(--aqua-soft);
  color: var(--aqua);
}

.annual-nav-button.graded {
  border-color: #2f855a;
  background: #e7f5ee;
  color: #1f5c3d;
}

.annual-nav-button.failed {
  border-color: var(--cinnabar);
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
}

.annual-nav-button.active {
  border-color: var(--moss-dark);
  background: var(--moss-dark);
  color: #fffef9;
}

/* ==================== Question Workbench & Image+Text Composer ==================== */

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

.question-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.question-meta-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.question-meta-badge strong {
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--moss-dark);
  color: #fffef9;
  font-size: 13px;
}

.question-meta-badge span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.question-source-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ochre-soft);
  border: 1px solid rgba(183, 129, 40, 0.35);
  color: #7a5210;
  font-size: 12px;
  font-weight: 700;
}

.question-stem {
  margin: 0;
  padding: 16px 18px;
  border-left: 4px solid var(--moss-dark);
  border-radius: 0 10px 10px 0;
  background: #faf8f2;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
  color: var(--ink);
}

.question-warning {
  padding: 10px 14px;
  border: 1px solid rgba(183, 129, 40, 0.45);
  border-radius: 8px;
  background: var(--ochre-soft);
  color: #7c5412;
  font-size: 13px;
}

.question-warning p {
  margin: 0;
}

.answer-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefa;
}

.composer-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.composer-header label {
  font-size: 14px;
  font-weight: 800;
  color: var(--moss-dark);
}

.save-status {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.save-status.error-text {
  color: var(--cinnabar);
}

.answer-composer textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
}

.answer-composer textarea:focus {
  outline: 2px solid rgba(66, 95, 76, 0.25);
  border-color: var(--moss);
}

.image-upload-zone {
  padding: 12px 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  background: #faf9f4;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.image-upload-zone.dragover {
  border-color: var(--aqua);
  background: var(--aqua-soft);
}

.image-upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-upload-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.upload-hint {
  font-size: 12.5px;
  color: var(--muted);
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.image-thumb-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #ffffff;
}

.image-thumb-card img {
  display: block;
  width: 100%;
  height: 108px;
  object-fit: cover;
  cursor: zoom-in;
}

.image-thumb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--muted);
  background: #faf8f2;
}

.image-thumb-footer span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(23, 32, 26, 0.78);
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.image-remove-btn:hover {
  background: var(--cinnabar);
}

/* ==================== Action Bar ==================== */

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.action-group-primary,
.action-group-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ==================== Grading, Reference & Followup Panels ==================== */

.grade-panel,
.reference-panel,
.hint-panel,
.followup-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.grade-panel {
  border-color: rgba(66, 95, 76, 0.45);
  background: linear-gradient(180deg, #f7fbf8 0%, #ffffff 100%);
}

.grade-loading,
.grade-error {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 2px;
}

.grade-loading strong {
  color: var(--moss-dark);
  font-size: 15px;
}

.grade-error strong {
  color: var(--cinnabar);
  font-size: 15px;
}

.grade-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.grade-score-block span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.grade-score-block strong {
  font-size: 30px;
  line-height: 1.15;
  color: var(--moss-dark);
}

.grade-level-block {
  text-align: right;
}

.grade-level-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--moss-soft);
  color: var(--moss-dark);
  font-size: 13px;
  font-weight: 800;
}

.grade-level-block small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.recognized-box {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(39, 98, 103, 0.32);
  border-radius: 9px;
  background: var(--aqua-soft);
}

.recognized-box summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--aqua);
}

.recognized-box div {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}

.grade-overall {
  margin: 12px 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.dimension-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #faf9f4;
}

.dimension-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.dimension-card-head strong {
  font-size: 13.5px;
  color: var(--moss-dark);
}

.dimension-card-head span {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--cinnabar);
}

.dimension-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.feedback-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
}

.feedback-card h4,
.outline-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--moss-dark);
}

.feedback-card ul,
.outline-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
}

.feedback-card li,
.outline-card li {
  margin-bottom: 4px;
}

.feedback-card p,
.outline-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.outline-card {
  padding: 12px 14px;
  border: 1px solid rgba(66, 95, 76, 0.35);
  border-radius: 9px;
  background: var(--moss-soft);
  margin-top: 10px;
}

.source-basis {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.reference-panel {
  border-color: rgba(183, 129, 40, 0.45);
  background: #fffdf7;
}

.reference-answer-body {
  padding: 12px 14px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 14.5px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.hint-panel {
  background: #f9faf8;
  font-size: 14px;
}

.hint-panel p {
  margin: 0 0 8px;
}

.hint-panel ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

/* ==================== Follow-up Chat ==================== */

.followup-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.chat-empty {
  padding: 12px 14px;
  border-radius: 9px;
  background: #faf8f2;
  font-size: 13px;
  color: var(--muted);
}

.chat-empty strong {
  color: var(--moss-dark);
  margin-right: 6px;
}

.chat-bubble {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.chat-bubble.user {
  background: var(--moss-soft);
  border: 1px solid rgba(66, 95, 76, 0.25);
}

.chat-bubble.assistant {
  background: #faf8f2;
  border: 1px solid var(--line);
}

.chat-role {
  font-size: 12px;
  font-weight: 800;
  color: var(--moss-dark);
  margin-bottom: 4px;
}

.followup-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.followup-input-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  resize: vertical;
  font-size: 14px;
}

.submit-paper-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(66, 95, 76, 0.35);
  border-radius: 10px;
  background: var(--moss-soft);
  margin-top: 4px;
}

.submit-paper-bar strong {
  display: block;
  font-size: 15px;
  color: var(--moss-dark);
}

.submit-paper-bar span {
  font-size: 12.5px;
  color: var(--muted);
}

.submit-status {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ochre-soft);
  color: #6b470c;
  font-size: 13.5px;
  font-weight: 600;
}

/* ==================== Practice Controls & Chapter Picker ==================== */

.practice-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.segmented-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #f5f2e9;
}

.segmented-toggle button {
  min-height: 32px;
  padding: 4px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--moss-dark);
  font-size: 13px;
  font-weight: 700;
}

.segmented-toggle button.active {
  background: var(--moss-dark);
  color: #fffef9;
}

.picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.picker-toolbar input {
  flex: 1 1 240px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
}

.picker-board-tabs {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.picker-board-tabs button {
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.picker-board-tabs button.active {
  border-color: var(--moss-dark);
  background: var(--moss-dark);
  color: #fffef9;
}

.chapter-picker-options {
  display: grid;
  gap: 14px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.picker-group h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--cinnabar);
  font-weight: 800;
}

.picker-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}

.picker-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  cursor: pointer;
}

.picker-option:hover {
  border-color: var(--moss);
}

.picker-option input {
  margin-top: 3px;
  accent-color: var(--moss-dark);
}

.picker-option strong {
  display: block;
  font-size: 13.5px;
  line-height: 1.35;
}

.picker-option small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.practice-workbench {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.practice-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.scope-summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--moss-dark);
}

.sequence-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f2;
}

.sequence-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sequence-heading strong {
  font-size: 14.5px;
  color: var(--moss-dark);
  margin-right: 10px;
}

.sequence-heading span {
  font-size: 13px;
  color: var(--muted);
}

.sequence-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.sequence-nav button {
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.sequence-nav button.answered {
  border-color: var(--aqua);
  background: var(--aqua-soft);
  color: var(--aqua);
}

.sequence-nav button.graded {
  border-color: #2f855a;
  background: #e7f5ee;
  color: #1f5c3d;
}

.sequence-nav button.active {
  border-color: var(--moss-dark);
  background: var(--moss-dark);
  color: #fffef9;
}

.practice-question-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--moss-dark);
  border-radius: 10px;
  background: #faf8f2;
}

.practice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.practice-meta span {
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--moss-dark);
}

.practice-meta span.score-pill {
  background: var(--ochre-soft);
  border-color: rgba(183, 129, 40, 0.35);
  color: #7c5412;
}

.practice-question-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.55;
  color: var(--ink);
}

.practice-question-card p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ==================== Knowledge Slide-Over Drawer ==================== */

.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(23, 32, 26, 0.48);
  backdrop-filter: blur(4px);
}

.knowledge-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(760px, 96vw);
  display: flex;
  flex-direction: column;
  background: #fbfaf5;
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--line-strong);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.drawer-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--moss-dark);
}

.drawer-node-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: #f5f2e9;
}

.drawer-node-tab {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}

.drawer-node-tab.active {
  border-color: var(--moss-dark);
  background: var(--moss-dark);
  color: #fffef9;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.meta-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
}

.meta-item span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.meta-item strong {
  font-size: 15px;
  color: var(--moss-dark);
}

.section-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.section-block h4 {
  margin: 0 0 10px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--moss-dark);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--moss-soft);
  color: var(--moss-dark);
  font-size: 12.5px;
  font-weight: 700;
}

.source-material-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.source-material-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #faf9f4;
}

.source-material-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.source-edition {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--moss-dark);
  color: #fffef9;
  font-size: 11.5px;
  font-weight: 700;
}

.source-material-heading h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.source-material-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.raw-content {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.raw-heading {
  font-weight: 800;
  color: var(--moss-dark);
  margin: 10px 0 4px;
}

.raw-heading-chapter {
  font-size: 16px;
}

.raw-heading-section {
  font-size: 15px;
}

.supplement-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supplement-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.supplement-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.supplement-index {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--moss-dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.supplement-kind {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ochre-soft);
  color: #7c5412;
  font-size: 11.5px;
  font-weight: 700;
}

.supplement-body {
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}

/* ==================== Provider Modal & Lightbox ==================== */

.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 110;
  width: min(520px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.config-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #faf8f2;
}

.config-line {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.config-line.status-ok {
  color: #216e43;
}

.config-line.status-bad {
  color: var(--cinnabar);
}

.vision-tip-box {
  padding: 11px 13px;
  border: 1px solid rgba(39, 98, 103, 0.3);
  border-radius: 9px;
  background: var(--aqua-soft);
  font-size: 12.5px;
  color: #1f4f53;
  line-height: 1.6;
}

.vision-tip-box code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.8);
  font-family: Consolas, monospace;
}

.provider-settings-grid {
  display: grid;
  gap: 10px;
}

.provider-settings-grid label {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.provider-settings-grid input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(15, 20, 17, 0.88);
}

.lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #ffffff;
}

.lightbox p {
  margin: 0;
  color: #f3f1ea;
  font-size: 13px;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
}

/* ==================== Responsive ==================== */

@media (max-width: 960px) {
  .app-header {
    flex-wrap: wrap;
    position: static;
  }

  .core-nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .annual-paper-layout {
    grid-template-columns: 1fr;
  }

  .annual-question-nav {
    max-height: 220px;
  }

  .annual-nav-buttons {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  }
}

@media (max-width: 640px) {
  .studio-shell {
    padding: max(10px, var(--safe-top)) 10px max(28px, var(--safe-bottom)) 10px;
  }

  .hero-card,
  .surface-card {
    padding: 16px;
  }

  .hero-copy h2 {
    font-size: 20px;
  }

  .question-stem,
  .practice-question-card h3 {
    font-size: 16.5px;
  }

  .followup-input-row {
    grid-template-columns: 1fr;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-group-primary,
  .action-group-nav {
    width: 100%;
  }

  .action-group-primary button,
  .action-group-nav button {
    flex: 1 1 auto;
  }
}


/* ==================== v3.1 Clarity Year Tags & Legend ==================== */

.completeness-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.annual-year-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.annual-year-button .year-tag {
  white-space: normal;
  max-width: 100%;
  text-align: left;
  line-height: 1.35;
}

.year-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.year-tag.tone-full {
  background: #e6f4ec;
  color: #1e603d;
  border: 1px solid rgba(30, 96, 61, 0.22);
}

.year-tag.tone-info {
  background: #e7f3f7;
  color: #19566b;
  border: 1px solid rgba(25, 86, 107, 0.25);
}

.year-tag.tone-subjective {
  background: #fdf4e3;
  color: #845811;
  border: 1px solid rgba(183, 129, 40, 0.28);
}

.year-tag.tone-partial {
  background: #f5eee9;
  color: #7d4732;
  border: 1px solid rgba(125, 71, 50, 0.25);
}

.annual-year-button.active .year-tag {
  background: rgba(255, 254, 249, 0.18);
  color: #fff8e6;
  border-color: rgba(255, 254, 249, 0.35);
}

.paper-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.picker-toolbar input {
  flex: 1 1 340px;
}

/* ==================== v3.1 Rich Academic Typography & Color Highlights ==================== */

.reference-panel {
  border-color: rgba(66, 95, 76, 0.36);
  background: linear-gradient(180deg, #fffef9 0%, #ffffff 100%);
}

.reference-answer-rich,
.rich-study-doc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
  word-break: break-word;
}

.reference-answer-rich {
  padding: 16px 18px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.rich-tip-card {
  padding: 12px 15px;
  border: 1px solid rgba(183, 129, 40, 0.42);
  border-left: 4px solid var(--ochre);
  border-radius: 0 10px 10px 0;
  background: #fffaf0;
  font-size: 14px;
  line-height: 1.75;
  color: #5d3f0d;
}

.rich-tip-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--ochre);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  vertical-align: 1px;
}

.rich-chapter-title {
  margin: 8px 0 2px;
  padding: 9px 14px;
  border-left: 4px solid var(--moss-dark);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, #e9f1ec 0%, #f7f9f7 100%);
  font-size: 16.5px;
  font-weight: 800;
  color: var(--moss-dark);
  line-height: 1.45;
}

.rich-h1 {
  margin: 10px 0 2px;
  padding: 6px 12px;
  border-bottom: 1.5px solid rgba(66, 95, 76, 0.28);
  background: rgba(234, 241, 236, 0.55);
  border-radius: 6px 6px 0 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--moss-dark);
  line-height: 1.5;
}

.rich-h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 2px;
  padding: 7px 12px;
  border-left: 3px solid var(--aqua);
  border-radius: 0 8px 8px 0;
  background: #f3f9f9;
  font-size: 14.8px;
  line-height: 1.75;
}

.rich-h2-badge {
  flex: none;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--aqua);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
}

.rich-point,
.rich-subpoint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 9px 12px;
  border-radius: 8px;
}

.rich-point {
  border: 1px solid rgba(220, 214, 200, 0.85);
  background: #fcfbf7;
}

.rich-subpoint {
  margin-left: 12px;
  border-left: 2.5px solid rgba(39, 98, 103, 0.35);
  background: #f8fbfb;
  padding: 7px 12px;
}

.rich-num-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--moss-dark);
  color: #fffef9;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
}

.rich-circled-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--aqua-soft);
  border: 1px solid rgba(39, 98, 103, 0.4);
  color: var(--aqua);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.rich-kv-row {
  padding: 8px 12px;
  border: 1px solid rgba(220, 214, 200, 0.78);
  border-radius: 8px;
  background: #fffefa;
  line-height: 1.8;
}

.rich-kv-label {
  display: inline-block;
  margin-right: 7px;
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--moss-soft);
  border: 1px solid rgba(66, 95, 76, 0.25);
  color: var(--moss-dark);
  font-size: 13.5px;
  font-weight: 800;
}

.rich-para {
  margin: 0;
  padding: 2px 4px;
}

.rich-lead {
  color: var(--moss-dark);
  font-weight: 800;
}

/* Inline Semantic Color Highlights */
.highlights-on .hl-work {
  color: #9e3422;
  font-weight: 700;
}

.highlights-on .hl-term {
  padding: 0 4px;
  border-radius: 4px;
  background: #e9f4f4;
  color: #1a5459;
  font-weight: 700;
}

.highlights-on .hl-keyword {
  padding: 0 3px;
  border-radius: 3px;
  background: #fcf1cf;
  color: #1d281f;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(183, 129, 40, 0.45);
}

.highlight-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 7px 11px;
  border-radius: 8px;
  background: #f7f4ec;
  font-size: 12px;
  color: var(--muted);
}

.highlight-legend-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ==================== v3.1 Drawer Book Tabs & Quick TOC ==================== */

.drawer-book-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  background: #faf8f2;
}

.drawer-book-tab {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--moss-dark);
  font-size: 12.5px;
  font-weight: 700;
}

.drawer-book-tab.active {
  border-color: var(--moss-dark);
  background: var(--moss-dark);
  color: #fffef9;
}

.drawer-toc {
  padding: 12px 14px;
  border: 1px solid rgba(66, 95, 76, 0.28);
  border-radius: 9px;
  background: #f6faf7;
}

.drawer-toc-title {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--moss-dark);
}

.drawer-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-toc-pill {
  padding: 3px 10px;
  border: 1px solid rgba(66, 95, 76, 0.3);
  border-radius: 999px;
  background: #ffffff;
  color: var(--moss-dark);
  font-size: 12px;
  font-weight: 700;
}

.drawer-toc-pill:hover {
  background: var(--moss-dark);
  color: #fffef9;
}

@media (max-width: 640px) {
  .rich-subpoint {
    margin-left: 4px;
  }
  .annual-year-grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  }
}


/* ==================== v3.2 First-Glance Memorization Cards & Corrections ==================== */

.core-memorize-card,
.chapter-core-card {
  margin-bottom: 12px;
  padding: 15px 17px;
  border: 1.5px solid rgba(33, 56, 44, 0.32);
  border-left: 5px solid var(--moss-dark);
  border-radius: 0 11px 11px 0;
  background: linear-gradient(135deg, #f1f7f3 0%, #fcfbf6 100%);
  box-shadow: 0 6px 18px rgba(33, 56, 44, 0.06);
}

.core-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.core-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--moss-dark);
  color: #fffef9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.core-card-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.core-oneline {
  margin: 0 0 11px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(66, 95, 76, 0.2);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--moss-dark);
  line-height: 1.7;
}

.core-memorize-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.core-memorize-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 214, 200, 0.85);
  font-size: 14.2px;
  line-height: 1.72;
}

.core-memorize-idx {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 50%;
  background: var(--cinnabar);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
}

.core-exam-focus {
  margin: 10px 0 0;
  padding: 8px 11px;
  border-radius: 8px;
  background: #fff9eb;
  border: 1px solid rgba(183, 129, 40, 0.32);
  font-size: 12.8px;
  color: #6b490f;
  line-height: 1.65;
}

.core-exam-focus strong {
  color: #8a5609;
}

.corrections-disclosure {
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9f4;
  font-size: 12.5px;
  color: var(--muted);
}

.corrections-disclosure summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--moss-dark);
}

.corrections-disclosure ul {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.65;
}

/* ==================== v3.3 Multi-line Prompts & Honest Empty Answer Card ==================== */

.question-stem,
.practice-question-card h3 {
  white-space: pre-line;
}

.no-direct-answer-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(46, 94, 78, 0.28);
  background: linear-gradient(135deg, #f6faf7 0%, #fffdf8 100%);
}

.no-direct-answer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.no-direct-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #6b5324;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
}

.no-direct-answer-head strong {
  font-size: 13.5px;
  color: var(--moss-dark);
}

.no-direct-answer-card > p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--ink);
}

.chapter-shortcut-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* ==================== v3.4 Newly Written Answer Badges & Banners ==================== */

.new-answer-pill,
.new-answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #364e8c;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  vertical-align: middle;
}

.question-source-pill.is-newly-written {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #2c4175;
  background: #eef2fc;
  border-color: rgba(54, 78, 140, 0.28);
}

.new-answer-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(54, 78, 140, 0.3);
  border-left: 4px solid #364e8c;
  background: linear-gradient(135deg, #f3f6fe 0%, #fffdf8 100%);
  font-size: 13px;
  line-height: 1.65;
  color: #24355e;
}

.new-answer-banner .new-answer-badge {
  flex: 0 0 auto;
  margin-top: 1px;
}

.reference-panel.is-newly-written {
  border-color: rgba(54, 78, 140, 0.34);
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 36%);
}
