:root {
  --ink: #1d2630;
  --muted: #66727f;
  --line: #d9e0e7;
  --paper: #fbfcfd;
  --panel: #ffffff;
  --accent: #206b6f;
  --accent-strong: #114d52;
  --gold: #c58b2a;
  --coral: #c65a45;
  --green: #3d7d57;
  --blue: #366a9f;
  --shadow: 0 18px 45px rgba(33, 43, 54, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(32, 107, 111, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(198, 90, 69, 0.09), transparent 42%),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #17222c;
  color: #f7fafc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--gold);
  color: #1d2630;
  font-weight: 900;
}

.brand h1,
.brand p,
.view-header h2,
.panel-heading h3,
.quiz-topline h2,
.result-panel h2 {
  margin: 0;
}

.brand h1 {
  font-size: 1.3rem;
}

.app-version {
  display: inline-block;
  margin-top: 6px;
  color: #d7e1e8;
  font-size: 0.78rem;
  font-weight: 800;
}

.brand p,
.muted {
  color: var(--muted);
}

.side-panel .brand p,
.side-panel .eyebrow,
.side-panel .score-snapshot p {
  color: #b9c4ce;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab-button,
.ghost-button,
.meta-pill {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-weight: 750;
}

.tab-button {
  text-align: left;
  padding: 0 14px;
  border-color: rgba(255, 255, 255, 0.14);
}

.tab-button.active {
  background: #f7fafc;
  color: #17222c;
}

.score-snapshot {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.score-snapshot strong {
  display: block;
  margin: 6px 0;
  font-size: 3rem;
}

.workspace {
  width: min(1180px, 100%);
  padding: 34px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-header,
.quiz-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.view-header h2,
.quiz-topline h2 {
  margin-top: 4px;
  font-size: clamp(1.75rem, 3vw, 2.55rem);
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.setup-grid,
.progress-layout {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.learn-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.controls-panel {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 760;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.primary-button,
.ghost-button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 850;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  background: #fff;
  color: var(--accent-strong);
}

.coverage-grid,
.result-breakdown,
.library-list,
.weak-list,
.learn-modules,
.term-translation-list,
.related-standards-list,
.standards-catalog-list,
.course-roadmap-days,
.course-sections,
.approach-list,
.scenario-example-grid,
.scenario-signal-grid {
  display: grid;
  gap: 12px;
}

.coverage-card,
.library-card,
.weak-card,
.history-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.coverage-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.coverage-card strong,
.library-card strong,
.weak-card strong {
  display: block;
}

.bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.progress-track {
  height: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #dde5eb;
}

#progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 180ms ease;
}

.question-panel {
  max-width: 920px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.meta-pill {
  padding: 0 12px;
  color: var(--accent-strong);
  background: #f4f8f8;
}

.meta-pill.passive {
  display: inline-flex;
  align-items: center;
  cursor: default;
}

.scenario-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 750;
}

.question-text {
  margin: 0 0 22px;
  font-size: 1.35rem;
  line-height: 1.45;
  font-weight: 780;
}

.choices {
  display: grid;
  gap: 12px;
}

.choice-button {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.choice-letter {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #edf3f4;
  font-weight: 850;
}

.choice-button.correct {
  border-color: var(--green);
  background: #eef7f1;
}

.choice-button.incorrect {
  border-color: var(--coral);
  background: #fff0ed;
}

.feedback {
  margin-top: 18px;
  padding: 18px;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fff8eb;
}

.learning-details {
  margin-top: 14px;
  border: 1px solid rgba(197, 139, 42, 0.38);
  border-radius: 8px;
  background: #fffdf7;
}

.bridge-details {
  margin-top: 14px;
  border: 1px solid rgba(32, 107, 111, 0.3);
  border-radius: 8px;
  background: #f5fbfb;
}

.learning-details summary {
  padding: 12px 14px;
  color: var(--accent-strong);
  font-weight: 850;
  cursor: pointer;
}

.bridge-details summary {
  padding: 12px 14px;
  color: var(--accent-strong);
  font-weight: 850;
  cursor: pointer;
}

.learning-block {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.learning-block h4 {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.learning-block p,
.learning-block ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.learning-block ul {
  padding-left: 20px;
}

.learning-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.learning-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf3f4;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 750;
}

.learn-hero {
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(32, 107, 111, 0.08), rgba(255, 255, 255, 0.94));
}

.learn-menu-panel,
.learn-lesson-block {
  margin-bottom: 18px;
}

.learn-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.learn-menu a,
.learn-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(32, 107, 111, 0.24);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.learn-menu a {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  background: #f4f8f8;
}

.learn-menu a:hover,
.learn-toc a:hover {
  border-color: var(--accent);
  background: #edf7f7;
}

.learn-hero h3 {
  margin: 4px 0 8px;
  font-size: 1.35rem;
}

.learn-hero p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.learn-index {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(32, 107, 111, 0.16);
}

.learn-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.learn-card,
.term-row,
.overview-card,
.clause-overview-card,
.relation-card,
.flow-step,
.standard-card,
.course-day-card,
.course-section-card,
.approach-card,
.scenario-example-card,
.scenario-signal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.overview-themes,
.overview-clauses,
.overview-relations,
.related-standards-list {
  display: grid;
  gap: 12px;
}

.overview-themes {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-bottom: 18px;
}

.overview-card,
.clause-overview-card,
.relation-card,
.standard-card {
  padding: 14px;
  scroll-margin-top: 20px;
}

.overview-card p,
.clause-overview-card p,
.relation-card p,
.standard-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.flow-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  min-height: 132px;
  padding: 12px;
}

.flow-step span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.flow-step strong {
  line-height: 1.35;
}

.flow-step p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.overview-clauses {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.overview-relations {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.related-standards-list {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.standard-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.standard-card h4 {
  margin: 4px 0 0;
  font-size: 1.08rem;
}

.source-link {
  justify-self: start;
  margin-top: 4px;
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.course-day-card {
  padding: 16px;
  scroll-margin-top: 20px;
}

.course-day-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.course-day-header h4,
.course-section-card h5 {
  margin: 4px 0 0;
}

.course-learn-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.course-learn-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(32, 107, 111, 0.24);
  border-radius: 999px;
  background: #f4f8f8;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.course-day-intent {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f7fafc;
}

.course-day-intent p,
.course-section-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.course-sections {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  margin-top: 14px;
}

.course-section-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.course-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.course-topic-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf3f4;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 750;
}

.approach-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.approach-card,
.scenario-example-card,
.scenario-signal {
  padding: 14px;
}

.approach-card h4,
.scenario-example-card h4 {
  margin: 0;
  font-size: 1.04rem;
}

.approach-card p,
.scenario-example-card p,
.scenario-signal p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.scenario-example-card {
  display: grid;
  gap: 14px;
}

.scenario-signal-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.scenario-signal {
  background: #fbfcfd;
}

.nutshell-poster {
  padding: 18px;
  border: 1px solid #bfd9d8;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(32, 107, 111, 0.12), transparent 30%),
    linear-gradient(315deg, rgba(197, 139, 42, 0.12), transparent 38%),
    #fdfefe;
  box-shadow: var(--shadow);
}

.nutshell-banner {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #8bd3c7;
  color: #12212a;
}

.nutshell-banner span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  font-weight: 950;
}

.nutshell-banner h3,
.nutshell-banner p {
  margin: 0;
}

.nutshell-banner h3 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.nutshell-banner p {
  margin-top: 4px;
  max-width: 980px;
  line-height: 1.45;
}

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

.nutshell-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 150px;
  padding: 12px;
  border: 2px solid #d7e6e6;
  border-radius: 8px;
  background: #fff;
}

.nutshell-wide {
  grid-column: span 3;
  background: #fff8e8;
  border-color: rgba(197, 139, 42, 0.38);
}

.nutshell-compact {
  grid-column: span 2;
}

.nutshell-pdca,
.nutshell-clauses,
.nutshell-flow,
.nutshell-matrix {
  grid-column: span 3;
}

.nutshell-pdca {
  background: #f5fbfb;
}

.nutshell-clauses {
  background: #f7fafc;
}

.nutshell-flow {
  background: #f8fbf4;
}

.nutshell-card h4,
.nutshell-card p {
  margin: 0;
}

.nutshell-card h4 {
  font-size: 1rem;
}

.nutshell-card p,
.nutshell-step span,
.nutshell-pair span {
  color: var(--muted);
  line-height: 1.42;
}

.nutshell-points,
.nutshell-steps,
.nutshell-pairs {
  display: grid;
  gap: 6px;
}

.nutshell-points {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.nutshell-points span,
.nutshell-step,
.nutshell-pair {
  padding: 8px;
  border-radius: 8px;
  background: rgba(32, 107, 111, 0.08);
}

.nutshell-step,
.nutshell-pair {
  display: grid;
  grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 4px;
  align-items: start;
}

.nutshell-step strong,
.nutshell-pair strong {
  color: var(--accent-strong);
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.nutshell-step span,
.nutshell-pair span {
  min-width: 0;
}

.nutshell-flow .nutshell-steps {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.nutshell-flow .nutshell-step {
  grid-template-columns: 1fr;
}

.image-map-panel {
  margin-top: 18px;
}

.image-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.image-map-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.image-map-stage img {
  display: block;
  width: 100%;
  height: auto;
}

.image-map-hotspots {
  position: absolute;
  inset: 0;
}

.image-hotspot {
  position: absolute;
  display: grid;
  place-items: start end;
  padding: 4px;
  border: 2px solid rgba(32, 107, 111, 0.12);
  border-radius: 8px;
  background: rgba(32, 107, 111, 0.02);
  z-index: 1;
}

.image-hotspot span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(32, 107, 111, 0.88);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  opacity: 0.72;
}

.image-hotspot-granular {
  border-color: rgba(197, 139, 42, 0.24);
  background: rgba(255, 255, 255, 0.03);
  z-index: 3;
}

.image-hotspot-granular span {
  width: 20px;
  height: 20px;
  background: rgba(197, 139, 42, 0.92);
  color: var(--ink);
  font-size: 0.68rem;
}

.image-hotspot-parent {
  pointer-events: none;
}

.image-hotspot-parent span {
  display: none;
}

.image-hotspot::after {
  content: attr(data-title);
  position: absolute;
  top: 4px;
  left: 4px;
  max-width: 190px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent-strong);
  font-size: 0.62rem;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.image-hotspot:hover,
.image-hotspot:focus-visible,
.image-hotspot.active {
  border-color: var(--gold);
  background: rgba(197, 139, 42, 0.12);
  outline: 0;
}

.image-hotspot:hover span,
.image-hotspot:focus-visible span,
.image-hotspot.active span {
  opacity: 1;
  background: var(--gold);
  color: var(--ink);
}

.image-hotspot:hover::after,
.image-hotspot:focus-visible::after,
.image-hotspot.active::after {
  opacity: 1;
  transform: translateY(0);
}

.image-map-note {
  position: sticky;
  top: 18px;
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.image-map-sidebar {
  display: grid;
  gap: 12px;
}

.image-map-list-wrap {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.image-map-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
}

.image-map-list-item {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.image-map-list-item:hover,
.image-map-list-item:focus-visible {
  border-color: var(--gold);
  background: rgba(197, 139, 42, 0.12);
  outline: 0;
}

.image-map-list-item strong,
.image-map-list-item span {
  display: block;
}

.image-map-list-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.image-map-note h4 {
  margin: 6px 0 8px;
}

.image-map-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.standards-catalog-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.catalog-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.catalog-row span {
  color: var(--muted);
  line-height: 1.4;
}

.catalog-row small {
  color: var(--accent-strong);
  font-weight: 850;
}

.learn-card {
  padding: 16px;
  scroll-margin-top: 20px;
}

.learn-card h4 {
  margin: 0 0 12px;
  font-size: 1.08rem;
}

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

.learn-grid p,
.learn-grid ul,
.term-row p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.learn-grid ul {
  padding-left: 20px;
}

.learn-label {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.learn-footer {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf1f5;
}

.question-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-chip {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(32, 107, 111, 0.24);
  border-radius: 999px;
  background: #f4f8f8;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 800;
}

.question-chip:hover {
  border-color: var(--accent);
  background: #e9f4f4;
}

.term-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
}

.term-row p {
  grid-column: 1 / -1;
}

.bridge-map {
  display: grid;
  gap: 8px;
}

.bridge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid #d9e8e8;
  border-radius: 8px;
  background: #fff;
}

.bridge-row span,
.bridge-row strong {
  line-height: 1.35;
}

@media (max-width: 560px) {
  .bridge-row {
    grid-template-columns: 1fr;
  }
}

.feedback.hidden {
  display: none;
}

.result-panel {
  max-width: 780px;
}

.result-panel h2 {
  margin-top: 6px;
  font-size: 3.5rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.trend-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 210px;
  padding-top: 12px;
}

.trend-bar {
  display: grid;
  align-items: end;
  flex: 1;
  min-width: 28px;
  height: 180px;
}

.trend-bar span {
  display: block;
  min-height: 3px;
  border-radius: 6px 6px 0 0;
  background: var(--blue);
}

.trend-bar small {
  margin-top: 6px;
  text-align: center;
  color: var(--muted);
}

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

.history-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr 1fr;
  gap: 12px;
  align-items: center;
}

.library-card p,
.weak-card p,
.coverage-card p,
#modal-body p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.library-section {
  margin-top: 14px;
}

.library-section:first-child {
  margin-top: 0;
}

.library-card ul {
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.5;
}

.scenario-card {
  width: 100%;
  color: inherit;
  text-align: left;
}

.scenario-card:hover,
.clause-card:hover {
  border-color: rgba(32, 107, 111, 0.45);
  box-shadow: 0 10px 24px rgba(33, 43, 54, 0.08);
}

.clause-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.clause-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.clause-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  padding: 26px;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 34, 44, 0.72);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

#modal-body {
  white-space: pre-wrap;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .app-shell,
  .setup-grid,
  .progress-layout,
  .learn-layout,
  .learn-grid,
  .term-row,
  .catalog-row,
  .course-day-header {
    grid-template-columns: 1fr;
  }

  .course-learn-links {
    justify-content: flex-start;
  }

  .side-panel {
    min-height: auto;
  }

  .workspace {
    padding: 22px;
  }

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

@media (max-width: 560px) {
  .view-header,
  .quiz-topline {
    display: grid;
  }

  .question-text {
    font-size: 1.12rem;
  }

  .result-panel h2 {
    font-size: 2.6rem;
  }

  .nutshell-banner {
    grid-template-columns: 1fr;
  }

  .nutshell-grid,
  .nutshell-wide,
  .nutshell-compact,
  .nutshell-pdca,
  .nutshell-clauses,
  .nutshell-flow,
  .nutshell-matrix {
    grid-template-columns: 1fr;
    grid-column: span 1;
  }

  .image-map-layout {
    grid-template-columns: 1fr;
  }

  .image-map-note {
    position: static;
  }

  .image-map-list {
    max-height: none;
  }

  .image-hotspot span {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }
}
