:root {
  --color-bg: #f6f7f9;
  --color-surface: #ffffff;
  --color-surface-soft: #f9fafb;
  --color-text: #1f2328;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-border-strong: #d1d5db;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-soft: #eaf2ff;
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-danger-soft: #fef2f2;
  --font-xs: 12px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-md: 15px;
  --font-lg: 18px;
  --font-xl: 22px;
  --font-2xl: 28px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --sidebar-width: 260px;

  /* Compatibility aliases for older templates. */
  --bg: var(--color-bg);
  --panel: var(--color-surface);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --line: var(--color-border);
  --blue: var(--color-primary);
  --green: var(--color-success);
  --red: var(--color-danger);
  --radius: var(--radius-lg);
}

/* Topic literacy V3: layered industry-useful knowledge, mobile-first L0. */
.topic-cluster-hero,
.topic-v3-linkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.topic-cluster-hero {
  padding: 24px 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(130deg, #f7fbff 0%, #ffffff 52%, #f7fff9 100%);
}

.topic-cluster-hero h2 { margin: 5px 0 7px; font-size: 28px; }
.topic-cluster-hero p { margin: 0; color: var(--color-muted); }

.topic-v3-linkbar {
  padding: 10px 14px;
  border: 1px solid #b9d8ff;
  border-radius: var(--radius-md);
  background: #f4f9ff;
}

.topic-v3-linkbar a { font-weight: 700; }

.topic-level-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 6px;
  color: #075aa8;
  background: #e8f3ff;
  font-size: 12px;
  font-weight: 800;
}

.topic-cluster-grid,
.topic-term-grid,
.topic-map-grid,
.topic-section-grid,
.topic-scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.topic-cluster-tile,
.topic-term-grid article,
.topic-map-grid article,
.topic-section-grid article,
.topic-scenario-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.topic-cluster-tile { display: flex; flex-direction: column; color: inherit; }
.topic-cluster-tile:hover { border-color: #7bb8f7; box-shadow: 0 8px 22px rgba(20, 72, 120, .08); }
.topic-cluster-tile h3,
.topic-term-grid h3,
.topic-map-grid h3,
.topic-section-grid h3,
.topic-scenario-grid h3 { margin: 8px 0 6px; font-size: 16px; }
.topic-cluster-tile p,
.topic-term-grid p,
.topic-map-grid p,
.topic-section-grid p { margin: 0 0 10px; color: var(--color-muted); }
.topic-cluster-tile small { margin-top: auto; color: var(--color-muted); }

.topic-l0-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.topic-l0-grid article {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fbfcfe;
}

.topic-l0-grid article > span { color: var(--color-muted); font-size: 12px; font-weight: 800; }
.topic-l0-grid li { margin-top: 8px; }

.topic-level-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

.topic-level-details > summary span { display: flex; flex-direction: column; gap: 4px; }
.topic-level-details > summary small { color: var(--color-muted); }
.topic-level-details > summary em { color: var(--color-primary); font-style: normal; }
.topic-level-details[open] > summary { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.topic-subheading { margin: 22px 0 12px; }

.topic-phrase-list,
.topic-comparison-list { display: grid; gap: 10px; }
.topic-phrase-list article,
.topic-comparison-list article {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 13px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.topic-phrase-list article > span { grid-row: 1 / span 2; color: #075aa8; font-weight: 800; }
.topic-phrase-list p,
.topic-comparison-list p { margin: 0; }
.topic-phrase-list small,
.topic-comparison-list small { grid-column: 2; color: var(--color-muted); }
.topic-comparison-list article { grid-template-columns: 180px minmax(0, 1fr); }
.topic-comparison-list strong { grid-row: 1 / span 2; }

.topic-scenario-grid article > div { display: grid; grid-template-columns: 24px 1fr; gap: 8px; margin-top: 8px; }
.topic-scenario-grid article > div b { color: var(--color-primary); }
.topic-viewer-line { padding: 10px; border-radius: 6px; background: #f2f5f8; font-weight: 700; }

.topic-translation-summary {
  padding: 17px;
  margin-bottom: 12px;
  border-left: 4px solid #16845b;
  background: #f3fbf7;
}
.topic-translation-summary small { display: block; color: #237255; font-weight: 800; }
.topic-translation-summary strong { display: block; margin: 6px 0; font-size: 17px; }
.topic-translation-summary p { margin: 0; color: var(--color-muted); }
.topic-term-inline { display: grid; gap: 8px; margin-bottom: 12px; }
.topic-term-inline span { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 6px; }
.topic-term-inline b { margin-right: 8px; color: #075aa8; }
.topic-ambiguity-note { margin: 12px 0 0; color: var(--color-muted); font-size: 12px; }

.topic-term-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.topic-term-head h3 { margin: 0; }
.topic-term-head > span { flex: 0 0 auto; color: #28724f; background: #e9f7ef; border-radius: 4px; padding: 3px 6px; font-size: 11px; }
.topic-term-card blockquote { margin: 10px 0; padding: 9px 11px; border-left: 3px solid #79a98d; background: #f7faf8; color: var(--color-muted); font-size: 13px; }
.topic-term-card details { margin: 10px 0; border-top: 1px solid var(--color-border); padding-top: 9px; }
.topic-term-card details summary { cursor: pointer; color: #35604a; font-weight: 600; }
.topic-term-card dl { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 7px 10px; margin: 10px 0; font-size: 13px; }
.topic-term-card dt { color: var(--color-muted); font-weight: 600; }
.topic-term-card dd { margin: 0; }
.topic-phrase-list article > div { min-width: 0; }
.topic-phrase-list article strong,
.topic-phrase-list article em { display: block; margin-top: 7px; font-size: 12px; font-style: normal; }
.topic-phrase-list article em { color: var(--color-muted); }
.topic-compare-focus { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 9px 0; }
.topic-compare-focus span { padding: 8px; background: #f7f8fa; border-radius: 4px; font-size: 12px; }
.topic-compare-focus b { display: block; margin-bottom: 3px; color: var(--color-text); }

@media (max-width: 760px) {
  .topic-cluster-hero,
  .topic-v3-linkbar { align-items: flex-start; flex-direction: column; }
  .topic-cluster-hero { padding: 18px; }
  .topic-cluster-hero h2 { font-size: 22px; }
  .topic-cluster-grid,
  .topic-term-grid,
  .topic-map-grid,
  .topic-section-grid,
  .topic-scenario-grid,
  .topic-l0-grid { grid-template-columns: 1fr; }
  .topic-term-grid { max-height: 620px; overflow-y: auto; }
  .topic-comparison-list article,
  .topic-phrase-list article { grid-template-columns: 42px minmax(0, 1fr); }
  .topic-comparison-list strong { grid-column: 1 / -1; grid-row: auto; }
  .topic-comparison-list p,
  .topic-comparison-list small { grid-column: 1 / -1; }
  .topic-compare-focus { grid-template-columns: 1fr; }
  .topic-term-card dl { grid-template-columns: 1fr; }
}

/* V1.7.0 streamer learning center */
.topic-learning-goal { display: block; margin: 8px 0 14px; font-size: 20px; line-height: 1.55; }
.topic-card-header-compact { align-items: center; padding-top: 14px; padding-bottom: 14px; }
.topic-memory-sentence { padding: 20px; border: 1px solid #b9d8ff; background: #edf6ff; }
.topic-memory-sentence span, .topic-yiming-view span { display: block; margin-bottom: 8px; color: #1467b8; font-size: 13px; font-weight: 800; }
.topic-memory-sentence strong { display: block; font-size: 20px; line-height: 1.55; }
.story-hero, .story-detail-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 28px; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.story-hero h2, .story-detail-hero h2 { margin: 5px 0 9px; font-size: 32px; }
.story-hero p, .story-detail-hero p { max-width: 760px; margin: 0; color: var(--color-muted); line-height: 1.65; }
.story-today-note { border-left: 4px solid #1a73e8; }
.story-today-note strong { color: #135ea7; }
.story-filter-form { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(190px, 1fr) minmax(190px, 1fr) auto; gap: 12px; align-items: end; }
.story-filter-form label, .story-rewrite-grid label { display: grid; gap: 7px; }
.story-filter-form label span, .story-rewrite-grid label span { font-size: 13px; font-weight: 800; }
.story-category-directory summary, .story-review-standards summary { display: flex; justify-content: space-between; cursor: pointer; }
.story-category-directory > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.story-category-directory a { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--color-border); border-radius: 6px; color: var(--color-text); text-decoration: none; }
.story-category-directory a:hover { border-color: #6ca8e8; background: #f5f9ff; }
.story-category-directory small { color: var(--color-muted); }
.story-prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.story-prompt-card { display: flex; min-width: 0; flex-direction: column; gap: 9px; padding: 18px; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.story-prompt-card > span { color: #16725d; font-size: 12px; font-weight: 800; }
.story-prompt-card h3 { margin: 0; font-size: 18px; }
.story-prompt-card p { flex: 1; margin: 0; line-height: 1.65; }
.story-prompt-card small { color: var(--color-muted); line-height: 1.5; }
.story-prompt-card .button-row { margin-top: 4px; }
.story-pack-list { display: grid; gap: 8px; }
.story-pack-list > article { display: grid; grid-template-columns: 76px minmax(0, 1fr) 90px auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 6px; }
.story-pack-list > article > span { color: #16725d; font-size: 12px; font-weight: 800; }
.story-pack-list strong, .story-pack-list small { display: block; }
.story-pack-list small { margin-top: 4px; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-pack-actions { display: flex; gap: 4px; }
.story-pack-actions button { width: 32px; height: 32px; border: 1px solid var(--color-border); border-radius: 5px; background: #fff; cursor: pointer; }
.story-four { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.story-four article { min-width: 0; padding: 22px; border: 1px solid var(--color-border); border-top: 4px solid #16725d; border-radius: 8px; background: #fff; }
.story-four span { display: block; margin-bottom: 12px; color: #16725d; font-size: 13px; font-weight: 800; }
.story-four strong { display: block; font-size: 20px; line-height: 1.6; }
.story-four article div { display: flex; flex-wrap: wrap; gap: 8px; }
.story-four article b { padding: 8px 10px; border-radius: 5px; background: #eaf7f2; font-size: 15px; }
.story-primary-actions { margin-bottom: 18px; }
.story-rewrite-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.story-rewrite-grid input, .story-rewrite-grid textarea { width: 100%; box-sizing: border-box; }
.story-rewrite-grid textarea { min-height: 96px; resize: vertical; }
.story-review-standards > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.story-review-standards article { padding: 14px; border: 1px solid var(--color-border); border-radius: 6px; }
.story-review-standards p { margin: 7px 0 0; color: var(--color-muted); line-height: 1.6; }
.story-prompt-mode .sidebar, .story-prompt-mode .topbar, .story-prompt-mode .mobile-topbar { display: none; }
.story-prompt-mode .content { margin: 0 auto; max-width: 900px; }
.story-prompt-mode .story-four { grid-template-columns: 1fr; }
.story-prompt-mode .story-four strong { font-size: 28px; }

@media (max-width: 980px) {
  .story-filter-form { grid-template-columns: 1fr 1fr; }
  .story-category-directory > div, .story-prompt-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .story-hero, .story-detail-hero { align-items: stretch; flex-direction: column; padding: 20px; }
  .story-hero h2, .story-detail-hero h2 { font-size: 27px; }
  .story-filter-form, .story-category-directory > div, .story-prompt-grid, .story-four, .story-rewrite-grid, .story-review-standards > div { grid-template-columns: 1fr; }
  .story-filter-form .primary-button { width: 100%; }
  .story-pack-list > article { grid-template-columns: 60px minmax(0, 1fr); }
  .story-pack-list select, .story-pack-actions { grid-column: 2; }
  .story-four article { padding: 18px; }
  .story-four strong, .topic-memory-sentence strong, .topic-learning-goal { font-size: 18px; }
  .story-primary-actions .primary-button, .story-primary-actions .small-button { flex: 1; min-height: 48px; }
}

/* V1.4.1 topic literacy: mobile-first, fast scanning, no decorative-only panels. */
.topic-mobile-hero,
.topic-pack-header,
.topic-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-5);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.topic-mobile-hero {
  align-items: flex-end;
  background: #123a32;
  color: #fff;
}

.topic-mobile-hero h2,
.topic-pack-header h2,
.topic-card-header h2 {
  margin: var(--space-2) 0;
  font-size: 38px;
  letter-spacing: 0;
}

.topic-mobile-hero > div:first-child { flex: 1; min-width: 0; }

.topic-mobile-hero p {
  max-width: 680px;
  margin: 0;
  color: #d8eee7;
}

.topic-eyebrow,
.topic-module-code {
  display: inline-block;
  color: #0b7663;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.topic-mobile-hero .topic-eyebrow {
  color: #a9decf;
}

.topic-hero-search {
  width: min(430px, 100%);
  display: grid;
  gap: var(--space-2);
}

.topic-hero-search input {
  min-height: 48px;
  border: 0;
  background: #fff;
}

.topic-quick-nav,
.topic-pack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.topic-quick-nav a,
.topic-pack-card {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
  text-decoration: none;
}

.topic-quick-nav a:hover,
.topic-pack-card:hover,
.topic-link-list a:hover {
  border-color: #0b7663;
}

.topic-quick-nav strong,
.topic-quick-nav span,
.topic-pack-card span,
.topic-pack-card small {
  display: block;
}

.topic-quick-nav span,
.topic-pack-card small {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: 12px;
}

.topic-pack-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topic-pack-card {
  min-height: 168px;
  border-top: 5px solid #0b7663;
}

.topic-pack-card.topic-pack-interests { border-top-color: #2364aa; }
.topic-pack-card.topic-pack-lifestyle { border-top-color: #b34b34; }
.topic-pack-card h3 { margin: var(--space-3) 0 var(--space-2); }
.topic-pack-card p { min-height: 44px; color: var(--color-muted); }

.topic-card-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.topic-card-preview {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.topic-card-preview h3 { margin: var(--space-3) 0 var(--space-2); }
.topic-card-preview > p { min-height: 64px; color: var(--color-muted); }

.topic-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--color-muted);
  font-size: 12px;
}

.topic-pack-tag,
.topic-risk-tag {
  padding: 4px 7px;
  border-radius: 6px;
  background: #e6f4ef;
  color: #08614f;
  font-weight: 800;
}

.topic-risk-tag {
  background: #fff1df;
  color: #934111;
}

.topic-preview-grid {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.topic-preview-grid div {
  min-height: 72px;
  padding: var(--space-3);
  border-radius: 6px;
  background: #f5f8f7;
}

.topic-preview-grid small,
.topic-preview-grid strong {
  display: block;
}

.topic-preview-grid small { margin-bottom: 6px; color: #0b7663; }
.topic-preview-grid strong { font-size: 13px; line-height: 1.55; }

.topic-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

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

.topic-link-list a {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

.topic-link-list span { color: var(--color-muted); font-size: 12px; }
.topic-legacy-note { border-left: 4px solid #77838f; }

.topic-search-panel textarea,
.topic-message-form textarea {
  width: 100%;
  min-height: 112px;
  font-size: 17px;
}

.topic-message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: var(--space-3);
}

.topic-scenario-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.topic-scenario-chip {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #c8d8d3;
  border-radius: 6px;
  background: #f5f8f7;
  color: #17463c;
  font-size: 12px;
}

.topic-answer-hero {
  margin: var(--space-4) 0;
  padding: var(--space-5);
  border-left: 5px solid #0b7663;
  background: #edf8f4;
}

.topic-answer-hero small,
.topic-answer-hero strong { display: block; }
.topic-answer-hero strong { margin-top: var(--space-2); font-size: 20px; line-height: 1.6; }

.topic-six-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.topic-six-grid article {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.topic-six-grid article > span {
  display: block;
  margin-bottom: var(--space-3);
  color: #0b7663;
  font-size: 12px;
  font-weight: 850;
}

.topic-six-grid li,
.topic-six-grid p,
.topic-six-grid dd { line-height: 1.65; }
.topic-six-grid dt { margin-top: 8px; font-weight: 850; }
.topic-six-grid dd { margin: 3px 0 0; color: var(--color-muted); }
.topic-grid-intro { background: #edf8f4 !important; }
.topic-grid-intro strong { font-size: 18px; line-height: 1.6; }
.topic-action-cell { border-top: 4px solid #2364aa !important; }
.topic-risk-cell { border-top: 4px solid #c35b32 !important; background: #fff9f5 !important; }

.topic-card-header { align-items: flex-start; }
.topic-card-header > div:first-child { max-width: 800px; }
.topic-card-header > div:first-child > p { font-size: 17px; line-height: 1.7; color: var(--color-muted); }
.topic-honest-line { font-size: 18px; line-height: 1.7; color: #17463c; }
.topic-sentence-list { display: grid; gap: 10px; padding-left: 22px; }
.topic-usage-panel { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.topic-source-box { color: var(--color-muted); }

.topic-learning-core,
.topic-dialogue-panel { margin-bottom: var(--space-5); }
.topic-core-grid,
.topic-dialogue-grid,
.topic-branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.topic-core-grid article,
.topic-dialogue-grid article,
.topic-branch-grid details,
.topic-variable-block,
.topic-viewpoint-block,
.topic-opening-block {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}
.topic-core-grid span,
.topic-dialogue-grid article > span,
.topic-variable-block > span,
.topic-viewpoint-block span,
.topic-opening-block span {
  display: block;
  margin-bottom: 8px;
  color: #0b7663;
  font-size: 12px;
  font-weight: 850;
}
.topic-core-grid p,
.topic-dialogue-grid p,
.topic-dialogue-grid li,
.topic-branch-grid p { line-height: 1.7; }
.topic-variable-block { margin-top: var(--space-3); }
.topic-variable-block div { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-variable-block b {
  padding: 6px 9px;
  border-radius: 5px;
  background: #edf8f4;
  color: #17463c;
  font-size: 13px;
}
.topic-viewpoint-block,
.topic-opening-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-3);
  border-left: 5px solid #0b7663;
}
.topic-viewpoint-block strong,
.topic-opening-block strong { display: block; font-size: 18px; line-height: 1.65; }
.topic-dialogue-panel .section-title { align-items: flex-start; }
.topic-branch-grid { margin: var(--space-4) 0; }
.topic-branch-grid details { padding: 0; overflow: hidden; }
.topic-branch-grid summary {
  padding: var(--space-4);
  color: #17463c;
  font-weight: 850;
  cursor: pointer;
}
.topic-branch-grid details p { margin: 0; padding: 0 var(--space-4) var(--space-4); }
.topic-safe-close { border-top: 4px solid #2364aa !important; }
.topic-dont-say { border-top: 4px solid #c35b32 !important; background: #fff9f5 !important; }
.topic-copy-source { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: pre-wrap; }
.topic-feedback-row { flex-wrap: wrap; justify-content: flex-end; }

.topic-story-hero {
  padding: var(--space-5) 0 var(--space-4);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
}
.topic-story-hero h2 { max-width: 760px; margin: 7px 0; font-size: 30px; }
.topic-story-hero p { max-width: 760px; color: var(--color-muted); font-size: 16px; line-height: 1.7; }
.topic-story-filters { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(130px, 1fr)); gap: 12px; align-items: end; }
.topic-story-filters label { display: grid; gap: 6px; color: var(--color-muted); font-size: 12px; font-weight: 800; }
.topic-story-filters input,
.topic-story-filters select { width: 100%; min-width: 0; }
.topic-story-filters .topic-check-filter { display: flex; align-items: center; gap: 8px; }
.topic-story-filters .topic-check-filter input { width: auto; }
.topic-story-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.topic-story-card { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.topic-story-card h3 { margin: 12px 0 8px; font-size: 19px; }
.topic-story-card > p { color: var(--color-muted); line-height: 1.7; }
.topic-story-card blockquote { margin: 14px 0; padding: 12px 14px; border-left: 4px solid #0b7663; background: #edf8f4; line-height: 1.7; }
.topic-story-card-footer { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.topic-story-card-footer small { max-width: 60%; color: var(--color-muted); }

.topic-natural-shell { margin-bottom: var(--space-5); }
.topic-tab-list { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--color-border); border-radius: 8px 8px 0 0; background: #f5f8f7; }
.topic-tab-list button { flex: 1; min-height: 44px; border: 0; border-radius: 6px; background: transparent; color: #45645d; font-weight: 850; }
.topic-tab-list button.active { background: #fff; color: #0b6b5b; box-shadow: 0 1px 4px rgba(17, 44, 37, 0.12); }
.topic-tab-panel { padding: var(--space-5); border: 1px solid var(--color-border); border-top: 0; border-radius: 0 0 8px 8px; background: #fff; }
.topic-tab-panel[hidden] { display: none; }
.topic-explainer-grid,
.topic-opener-grid,
.topic-eq-grid,
.topic-natural-dual { display: grid; gap: var(--space-3); }
.topic-explainer-grid,
.topic-eq-grid,
.topic-natural-dual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.topic-opener-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.topic-explainer-grid article,
.topic-opener-grid article,
.topic-eq-grid article,
.topic-natural-dual article,
.topic-story-short,
.topic-story-full,
.topic-story-invite { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: 8px; background: #fdfefe; }
.topic-explainer-grid span,
.topic-opener-grid span,
.topic-eq-grid span,
.topic-natural-dual span,
.topic-story-short span,
.topic-story-full span,
.topic-story-invite span { display: block; margin-bottom: 8px; color: #0b7663; font-size: 12px; font-weight: 850; }
.topic-explainer-grid p,
.topic-opener-grid p,
.topic-eq-grid p,
.topic-natural-dual p,
.topic-natural-dual li,
.topic-story-short p,
.topic-story-full p { line-height: 1.75; }
.topic-natural-dual { margin-top: var(--space-3); }
.topic-boundary-block { border-top: 4px solid #c35b32 !important; background: #fff9f5 !important; }
.topic-story-short { margin-bottom: var(--space-3); border-left: 5px solid #2364aa; }
.topic-story-full { margin-bottom: var(--space-3); }
.topic-story-invite { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); border-left: 5px solid #0b7663; }
.topic-story-invite strong { font-size: 17px; line-height: 1.65; }
.topic-compatibility-card summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.topic-compatibility-card summary span { color: var(--color-muted); font-size: 12px; }

.topic-wiki-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.topic-wiki-lead,
.topic-yiming-view {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}
.topic-wiki-lead > p { margin: 12px 0 18px; font-size: 18px; line-height: 1.8; }
.topic-yiming-view { border-left: 5px solid #0b7663; background: #f3faf7; }
.topic-yiming-view > span,
.topic-wiki-section-grid span,
.topic-wiki-boundary-grid span,
.topic-wiki-chat-grid span,
.topic-wiki-move-list article span,
.topic-wiki-safe-close span,
.topic-wiki-story > span { display: block; margin-bottom: 8px; color: #0b7663; font-size: 12px; font-weight: 850; }
.topic-yiming-view p { margin: 0; font-size: 16px; line-height: 1.8; }
.topic-key-point-list { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-key-point-list span { padding: 7px 10px; border: 1px solid #cce4dc; border-radius: 6px; background: #f4fbf8; color: #17463c; font-size: 12px; font-weight: 800; }
.topic-wiki-folds { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); }
.topic-wiki-folds > details { border: 1px solid var(--color-border); border-radius: 8px; background: #fff; overflow: hidden; }
.topic-wiki-folds > details > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; cursor: pointer; font-weight: 850; }
.topic-wiki-folds > details > summary small { color: var(--color-muted); font-weight: 650; }
.topic-wiki-folds > details[open] > summary { border-bottom: 1px solid var(--color-border); background: #f7f9f8; }
.topic-wiki-folds > details > :not(summary) { margin-left: var(--space-5); margin-right: var(--space-5); }
.topic-wiki-folds > details > :last-child { margin-bottom: var(--space-5); }
.topic-wiki-section-grid,
.topic-wiki-boundary-grid,
.topic-wiki-chat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-5); }
.topic-wiki-section-grid article,
.topic-wiki-boundary-grid article,
.topic-wiki-chat-grid article,
.topic-wiki-move-list article,
.topic-wiki-safe-close,
.topic-wiki-story,
.topic-wiki-sources article { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: 8px; background: #fdfefe; }
.topic-wiki-section-grid p,
.topic-wiki-boundary-grid p,
.topic-wiki-boundary-grid li,
.topic-wiki-chat-grid p,
.topic-wiki-move-list p,
.topic-wiki-safe-close p,
.topic-wiki-story p,
.topic-wiki-sources li { line-height: 1.75; }
.topic-wiki-move-list { margin-top: var(--space-5); }
.topic-wiki-move-list > h3,
.topic-wiki-sources > h3 { margin: 0 0 var(--space-3); font-size: 16px; }
.topic-wiki-move-list article { display: grid; grid-template-columns: 110px 1fr; gap: var(--space-3); margin-bottom: 8px; }
.topic-wiki-move-list article p { margin: 0; }
.topic-wiki-safe-close { margin-top: var(--space-4); border-left: 5px solid #2364aa; }
.topic-wiki-sources { margin-top: var(--space-5); }
.topic-wiki-sources article { margin-bottom: 8px; }
.topic-wiki-sources article > a { display: block; margin-bottom: 4px; font-weight: 800; }
.topic-wiki-sources article > small { display: block; color: var(--color-muted); }
.topic-wiki-sources article ul { margin-bottom: 0; }
.topic-wiki-story { margin-top: var(--space-5); border-left: 5px solid #2364aa; }
.topic-wiki-story h3 { margin: 6px 0 12px; }
.topic-wiki-story strong,
.topic-wiki-story small { display: block; margin-top: 14px; line-height: 1.65; }
.topic-wiki-story small { color: var(--color-muted); }

@media (max-width: 900px) {
  .topic-story-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-opener-grid { grid-template-columns: 1fr; }
  .topic-wiki-overview { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topic-story-hero h2 { font-size: 24px; }
  .topic-story-filters,
  .topic-story-list,
  .topic-explainer-grid,
  .topic-eq-grid,
  .topic-natural-dual,
  .topic-wiki-section-grid,
  .topic-wiki-boundary-grid,
  .topic-wiki-chat-grid { grid-template-columns: 1fr; }
  .topic-tab-list { overflow-x: auto; }
  .topic-tab-list button { flex: 0 0 auto; padding: 0 14px; }
  .topic-tab-panel { padding: var(--space-3); }
  .topic-story-card-footer,
  .topic-story-invite,
  .topic-compatibility-card summary { align-items: flex-start; flex-direction: column; }
  .topic-story-card-footer small { max-width: none; }
  .topic-wiki-folds > details > summary { align-items: flex-start; flex-direction: column; padding: var(--space-4); }
  .topic-wiki-folds > details > :not(summary) { margin-left: var(--space-3); margin-right: var(--space-3); }
  .topic-wiki-move-list article { grid-template-columns: 1fr; }
  .topic-wiki-lead,
  .topic-yiming-view { padding: var(--space-4); }
  .topic-wiki-lead > p { font-size: 16px; }
}

.topic-pack-header.topic-pack-comprehensive { border-left: 6px solid #0b7663; }
.topic-pack-header.topic-pack-interests { border-left: 6px solid #2364aa; }
.topic-pack-header.topic-pack-lifestyle { border-left: 6px solid #b34b34; }
.topic-module-block { scroll-margin-top: 24px; }
.learning-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: var(--space-4); }
.learning-flow span { padding: 10px; border-radius: 6px; background: #f2f5f4; text-align: center; font-size: 12px; font-weight: 750; }
.topic-quiz-form { display: grid; gap: var(--space-4); }
.topic-quiz-form fieldset { display: grid; gap: 8px; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: 8px; }
.topic-quiz-form legend { padding: 0 6px; font-weight: 800; }

@media (max-width: 1100px) {
  .topic-card-list,
  .topic-six-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-core-grid,
  .topic-dialogue-grid,
  .topic-branch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-quick-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .topic-mobile-hero,
  .topic-pack-header,
  .topic-card-header,
  .topic-usage-panel { align-items: stretch; flex-direction: column; padding: var(--space-4); }
  .topic-mobile-hero h2,
  .topic-pack-header h2,
  .topic-card-header h2 { font-size: 28px; }
  .topic-message-form,
  .topic-quick-nav,
  .topic-pack-grid,
  .topic-card-list,
  .topic-six-grid,
  .topic-dual-grid,
  .topic-core-grid,
  .topic-dialogue-grid,
  .topic-branch-grid,
  .learning-flow { grid-template-columns: 1fr; }
  .topic-card-preview > p { min-height: 0; }
  .topic-message-form .primary-button,
  .topic-card-header .button-row > *,
  .topic-usage-panel .button-row > * { width: 100%; }
  .topic-six-grid article { padding: var(--space-4); }
  .topic-viewpoint-block,
  .topic-opening-block { align-items: stretch; flex-direction: column; }
  .topic-viewpoint-block .small-button,
  .topic-opening-block .small-button,
  .topic-dialogue-panel .section-title .primary-button { width: 100%; }
  .topic-search-answer-grid { grid-template-columns: 1fr; }
}

.encyclopedia-hero,
.encyclopedia-detail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.encyclopedia-hero h2,
.encyclopedia-detail-head h2 { margin: 6px 0 8px; font-size: clamp(30px, 4vw, 48px); letter-spacing: 0; }
.encyclopedia-hero p { margin: 0; color: var(--color-muted); }
.encyclopedia-random { width: auto; flex: 0 0 auto; }
.encyclopedia-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: end; }
.encyclopedia-search-form label { min-width: 0; }
.encyclopedia-category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-5); }
.encyclopedia-category-grid a { min-width: 0; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: 8px; color: inherit; background: #fff; }
.encyclopedia-category-grid a.active { border-color: var(--color-primary); background: var(--color-primary-soft); }
.encyclopedia-category-grid strong,.encyclopedia-category-grid span { display: block; overflow-wrap: anywhere; }
.encyclopedia-category-grid span { margin-top: 4px; color: var(--color-muted); font-size: var(--font-sm); }
.encyclopedia-subcategory-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-4); }
.encyclopedia-subcategory-row a { padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 8px; }
.encyclopedia-subcategory-row a.active { color: #fff; border-color: var(--color-primary); background: var(--color-primary); }
.encyclopedia-list-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.encyclopedia-list-card { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.encyclopedia-list-card span { color: var(--color-muted); font-size: var(--font-sm); }
.encyclopedia-list-card h3 { margin: var(--space-3) 0; font-size: var(--font-lg); letter-spacing: 0; overflow-wrap: anywhere; }
.encyclopedia-list-card p { color: #475569; line-height: 1.7; word-break: normal; }
.encyclopedia-list-card a { display: inline-flex; margin-top: var(--space-2); font-weight: 800; }
.encyclopedia-pagination,.encyclopedia-detail-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }
.encyclopedia-pagination a,.encyclopedia-detail-nav a { min-height: 42px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid var(--color-border); border-radius: 8px; }
.encyclopedia-detail { min-width: 0; display: grid; gap: var(--space-5); }
.encyclopedia-detail > section,.encyclopedia-boundary { min-width: 0; padding: var(--space-5); border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.encyclopedia-summary-block { border-left: 4px solid #0f766e !important; background: #f0fdfa !important; }
.encyclopedia-summary-block > span { color: #0f766e; font-weight: 850; }
.encyclopedia-summary-block p { margin: var(--space-3) 0 0; font-size: var(--font-xl); line-height: 1.75; word-break: normal; }
.encyclopedia-points-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.encyclopedia-keywords-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.encyclopedia-example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.encyclopedia-example-grid article { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: 8px; }
.encyclopedia-example-grid article > * { display: block; }
.encyclopedia-example-grid p { color: #475569; line-height: 1.7; overflow-wrap: anywhere; }
.encyclopedia-example-grid small { color: var(--color-muted); margin-bottom: var(--space-3); }
.encyclopedia-card-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.encyclopedia-recent-row { display: flex; flex-wrap: wrap; gap: 8px; }
.encyclopedia-recent-row a { padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.encyclopedia-source-row { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.encyclopedia-source-row > * { display: block; overflow-wrap: anywhere; }
.encyclopedia-source-row span,.encyclopedia-source-row small { margin-top: 4px; color: var(--color-muted); }
.encyclopedia-usage-note h2 { margin-top: 0; }
.encyclopedia-usage-note p { margin-bottom: 0; color: #475569; line-height: 1.8; }
.encyclopedia-review-list { display: grid; gap: var(--space-3); }
.encyclopedia-review-card { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.encyclopedia-review-card h3 { margin: 6px 0; }
.encyclopedia-review-card p { color: #475569; line-height: 1.7; }
.encyclopedia-review-card form { display: grid; gap: var(--space-3); align-content: start; }
.encyclopedia-points-grid article,.encyclopedia-keywords-grid article { min-width: 0; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: 8px; }
.encyclopedia-points-grid p,.encyclopedia-keywords-grid p { margin: 8px 0 0; color: #475569; line-height: 1.7; word-break: normal; overflow-wrap: anywhere; }
.encyclopedia-boundary summary { cursor: pointer; font-weight: 850; }
.encyclopedia-boundary dl div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: var(--space-3); margin-top: var(--space-3); }
.encyclopedia-boundary dt { color: var(--color-muted); }
.encyclopedia-boundary dd { margin: 0; overflow-wrap: anywhere; }
[data-random-story-link].is-loading { opacity: .65; pointer-events: none; }

@media (min-width: 768px) and (max-width: 1279px) {
  .encyclopedia-points-grid,.encyclopedia-example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .encyclopedia-list-grid,.encyclopedia-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .encyclopedia-hero,.encyclopedia-detail-head { align-items: stretch; flex-direction: column; padding: var(--space-4); }
  .encyclopedia-random,.encyclopedia-detail-head .button-row > * { width: 100%; }
  .encyclopedia-search-form,.encyclopedia-category-grid,.encyclopedia-list-grid,.encyclopedia-points-grid,.encyclopedia-keywords-grid,.encyclopedia-example-grid,.encyclopedia-review-card { grid-template-columns: minmax(0, 1fr); }
  .encyclopedia-search-form,.encyclopedia-category-grid,.encyclopedia-list-grid,.encyclopedia-points-grid,.encyclopedia-keywords-grid { grid-template-columns: minmax(0, 1fr); }
  .encyclopedia-detail > section,.encyclopedia-boundary { padding: var(--space-4); }
  .encyclopedia-summary-block p { font-size: var(--font-lg); }
  .encyclopedia-detail-nav { display: grid; grid-template-columns: 1fr; }
  .encyclopedia-detail-nav a { justify-content: center; }
  .encyclopedia-boundary dl div { grid-template-columns: 1fr; }
}

/* V1.4.0 streamer learning center */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-heading h2,
.section-heading h3 { margin: 2px 0 0; }

.filter-row {
  display: flex;
  align-items: end;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.filter-row label { min-width: 180px; }

.learning-page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding-bottom: 72px;
}

.learning-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: 26px;
  margin-bottom: var(--space-5);
  border: 1px solid #dbeafe;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #eff6ff, #ffffff 62%, #f0fdf4);
}

.learning-hero.compact { padding: 22px; }
.learning-hero h2 { margin: 4px 0 6px; font-size: 26px; }
.learning-hero p { margin: 0; color: var(--color-muted); }
.learning-ring { min-width: 96px; min-height: 96px; display: grid; place-content: center; text-align: center; border: 8px solid #bfdbfe; border-radius: 50%; background: #fff; }
.learning-ring strong { display: block; font-size: 19px; }
.learning-ring span { color: var(--color-muted); font-size: var(--font-xs); }
.learning-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.learning-next { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); }
.learning-next h3 { margin: 10px 0 4px; font-size: 21px; }
.learning-primary-action { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.learning-course-list { display: grid; gap: var(--space-3); }
.learning-course-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, 1fr) 54px; align-items: center; gap: var(--space-4); padding: var(--space-3); border-bottom: 1px solid var(--color-border); }
.learning-course-row div:first-child { display: grid; gap: 2px; }
.learning-course-row span { color: var(--color-muted); font-size: var(--font-sm); }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e5e7eb; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--color-primary); }
.learning-timeline { display: grid; gap: var(--space-3); }
.learning-day { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.learning-day.done { border-color: #bbf7d0; }
.learning-day.retry { border-color: #fed7aa; }
.learning-day-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--color-primary); font-weight: 900; }
.learning-day div { display: grid; gap: 3px; }
.learning-content-block h3 { margin-top: 0; }
.learning-content-block li { margin: 7px 0; }
.learning-submit-form { display: grid; gap: var(--space-5); }
.quiz-question { display: grid; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.quiz-question legend { padding: 0 6px; font-weight: 800; }
.quiz-question label { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 8px; background: var(--color-surface-soft); }
.learning-attempt { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.learning-attempt div { display: grid; }
.learning-library-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.6fr); gap: var(--space-4); align-items: start; }
.learning-card-list { display: grid; gap: var(--space-2); max-height: 72vh; overflow: auto; }
.learning-card-list > a { display: grid; gap: 4px; margin: 0; padding: var(--space-4); box-shadow: none; }
.learning-card-list > a.selected { border-color: var(--color-primary); background: var(--color-primary-soft); }
.learning-card-detail section { padding: 12px 0; border-top: 1px solid var(--color-border); }
.learning-card-detail h4 { margin: 0 0 8px; color: var(--color-primary-dark); }
.learning-kv { display: grid; grid-template-columns: minmax(110px, .4fr) 1fr; gap: 8px 12px; }
.learning-kv dt { font-weight: 800; }
.learning-kv dd { margin: 0; }
.practice-scenario blockquote { margin: var(--space-4) 0; padding: var(--space-4); border-left: 4px solid var(--color-primary); background: var(--color-primary-soft); font-size: var(--font-lg); font-weight: 700; }
.learning-output { max-width: 280px; white-space: normal; }
.inline-review { min-width: 280px; display: grid; grid-template-columns: 110px 1fr auto; gap: 6px; }
.learning-mobile-nav { display: none; }

@media (max-width: 760px) {
  .metric-grid,
  .learning-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-page { padding-bottom: 88px; }
  .learning-hero,
  .learning-next { align-items: stretch; flex-direction: column; }
  .learning-hero h2 { font-size: 22px; }
  .learning-ring { min-width: 84px; min-height: 84px; align-self: flex-start; }
  .learning-course-row { grid-template-columns: 1fr 50px; }
  .learning-course-row .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .learning-day { grid-template-columns: 42px 1fr; }
  .learning-day > .status { grid-column: 2; justify-self: start; }
  .learning-library-layout { grid-template-columns: 1fr; }
  .learning-card-list { max-height: none; grid-template-columns: 1fr 1fr; }
  .learning-card-detail { display: block; }
  .learning-kv { grid-template-columns: 1fr; }
  .inline-review { min-width: 260px; grid-template-columns: 1fr; }
  .learning-mobile-nav { position: fixed; z-index: 45; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; border: 1px solid var(--color-border); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 10px 28px rgba(15,23,42,.16); }
  .learning-mobile-nav a { min-height: 44px; display: grid; place-items: center; border-radius: 9px; color: var(--color-muted); font-size: var(--font-sm); font-weight: 800; }
  .learning-mobile-nav a.active { color: var(--color-primary); background: var(--color-primary-soft); }
}

* { box-sizing: border-box; }

html {
  min-width: 0;
  overflow-x: hidden;
  background: var(--color-bg);
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: var(--font-base);
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

img,
svg {
  max-width: 100%;
}

.eyebrow,
.muted,
small {
  color: var(--color-muted);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
}

.login-card,
.panel,
.alert,
.data-card,
.person-card,
.table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.login-card {
  width: min(440px, 100%);
  padding: 28px;
}

.login-card h1,
.login-card h2 {
  margin-top: 0;
}

.mobile-topbar,
.sidebar-backdrop {
  display: none;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  padding: var(--space-5) var(--space-4);
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--color-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 42px;
  margin-bottom: var(--space-6);
  color: var(--color-text);
}

.brand span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--color-primary);
  font-weight: 900;
}

.brand strong {
  font-size: var(--font-lg);
  font-weight: 800;
  line-height: 1.2;
}

.sidebar nav {
  display: grid;
  gap: var(--space-1);
}

.nav-label {
  margin: var(--space-6) 0 var(--space-2);
  padding: 0 var(--space-3);
  color: var(--color-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar nav a {
  position: relative;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-3) 0 var(--space-4);
  border-radius: 10px;
  color: #4b5563;
  font-size: var(--font-md);
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 140ms ease, color 140ms ease;
}

.sidebar nav a:hover {
  color: var(--color-text);
  background: var(--color-surface-soft);
}

.sidebar nav a.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-weight: 800;
}

.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 9px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: var(--color-primary);
}

.workspace {
  min-width: 0;
  width: 100%;
  max-width: 1600px;
  padding: 24px 32px 40px;
}

.topbar {
  min-height: 72px;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar h1 {
  margin: var(--space-1) 0 0;
  font-size: var(--font-2xl);
  line-height: 1.2;
  font-weight: 800;
}

.topbar small {
  font-size: var(--font-sm);
  font-weight: 700;
}

.user-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  color: var(--color-muted);
  font-size: var(--font-sm);
}

.panel,
.alert,
.table-card {
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}

.panel h2,
.panel h3 {
  margin: 0 0 var(--space-4);
  color: var(--color-text);
  line-height: 1.3;
}

.panel h2 {
  font-size: var(--font-xl);
  font-weight: 800;
}

.panel h3 {
  font-size: var(--font-lg);
  font-weight: 750;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: #1e3a8a;
  background: var(--color-primary-soft);
}

.alert strong {
  font-weight: 850;
}

.alert.warning {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.card-grid.compact,
.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.data-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-5);
}

.data-card span,
.data-card small {
  display: block;
}

.data-card span {
  color: var(--color-muted);
  font-size: var(--font-sm);
  font-weight: 750;
}

.data-card strong {
  display: block;
  margin: var(--space-2) 0;
  color: var(--color-text);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 850;
}

.data-card small {
  min-height: 18px;
  font-size: var(--font-sm);
}

.risk-card strong {
  color: var(--color-danger);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: var(--space-5);
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.form-grid.dense {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

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

label {
  display: grid;
  gap: var(--space-2);
  color: #374151;
  font-size: var(--font-sm);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  outline: none;
  color: var(--color-text);
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.review-textarea {
  min-height: 150px;
}

.review-copy {
  min-height: 420px;
  line-height: 1.75;
  background: #f8fafc;
}

.review-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  align-items: stretch;
}

.review-section-grid .panel {
  margin: 0;
}

.review-content {
  margin: 0;
  color: #374151;
  line-height: 1.8;
  white-space: pre-wrap;
}

.review-card-value {
  font-size: 20px !important;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.check-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
}

.field-title {
  display: block;
  color: #374151;
  font-size: var(--font-sm);
}

.review-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.review-submit-bar p {
  margin: 0;
}

.review-action-form {
  margin-top: var(--space-4);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  box-shadow: none;
}

.stacked-input {
  margin-top: var(--space-2);
}

.btn,
.primary-button,
.small-button,
.user-area button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: var(--font-base);
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.btn-primary,
.primary-button {
  color: #fff;
  background: var(--color-primary);
}

.btn-primary:hover,
.primary-button:hover {
  background: var(--color-primary-dark);
}

.btn-secondary,
.small-button {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-color: #dbeafe;
}

.btn-secondary:hover,
.small-button:hover {
  background: #dbeafe;
}

.btn-danger,
.small-button.danger,
.user-area button.danger {
  color: var(--color-danger);
  background: var(--color-danger-soft);
  border-color: #fecaca;
}

.btn-ghost,
.user-area button {
  color: #374151;
  background: #f3f4f6;
  border-color: var(--color-border);
}

.btn-sm,
.small-button {
  min-height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--font-sm);
}

.button-row,
.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.action-stack form {
  margin: 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.inline-form input {
  min-width: 150px;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  contain: inline-size;
}

.panel > .table-scroll,
.table-card > .table-scroll {
  margin: 0;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-base);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface-soft);
}

th,
td {
  height: 52px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #4b5563;
  font-size: var(--font-sm);
  font-weight: 800;
}

td {
  color: var(--color-text);
}

tbody tr:hover {
  background: #fafafa;
}

td:nth-child(4):has(+ td),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7),
td:nth-child(8),
td:nth-child(9) {
  font-variant-numeric: tabular-nums;
}

.empty {
  color: var(--color-muted);
  text-align: center;
}

.status,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: var(--font-xs);
  font-weight: 850;
  white-space: nowrap;
  color: #374151;
  background: #f3f4f6;
}

.status.active,
.badge-success {
  color: #166534;
  background: #dcfce7;
}

.status.disabled,
.badge-danger {
  color: #991b1b;
  background: #fee2e2;
}

.status.warning,
.badge-warning {
  color: #92400e;
  background: #fef3c7;
}

.badge-info {
  color: #1d4ed8;
  background: #dbeafe;
}

.badge-muted {
  color: #4b5563;
  background: #f3f4f6;
}

.notice-box,
.question-block,
.field-options,
.checklist,
.summary-list div,
.timeline-item {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.notice-box {
  color: var(--color-muted);
  font-size: var(--font-sm);
  font-weight: 650;
}

.notice-box a {
  color: var(--color-primary);
  font-weight: 750;
}

.inspect-result,
.people-list,
.timeline {
  display: grid;
  gap: var(--space-4);
}

.inspect-card {
  display: grid;
  gap: var(--space-2);
}

.question-block {
  display: grid;
  gap: var(--space-3);
}

.question-title {
  color: var(--color-text);
  font-weight: 850;
}

.option-list,
.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.option-list label,
.checklist label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: #374151;
  font-size: var(--font-sm);
  font-weight: 650;
}

.label-title {
  width: 100%;
  color: var(--color-muted);
  font-weight: 850;
}

.section-title,
.person-head,
.form-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.section-title {
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.section-title h3,
.person-head h2,
.form-hero h2 {
  margin: 0 0 var(--space-1);
}

.section-title span,
.form-hero p {
  color: var(--color-muted);
  font-size: var(--font-sm);
  font-weight: 650;
}

.interview-panel {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding: var(--space-6);
}

.form-hero {
  align-items: flex-end;
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.interview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.person-card {
  padding: var(--space-5);
}

.person-head strong,
.person-head span,
.summary-list span,
.summary-list strong,
.timeline-item p {
  display: block;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.summary-list span {
  color: var(--color-muted);
  font-size: var(--font-xs);
  font-weight: 850;
}

.summary-list strong {
  margin-top: var(--space-1);
  font-size: var(--font-base);
}

.account-security-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.account-security-strip span,
.account-security-strip small,
.account-security-strip strong {
  display: block;
}

.account-security-strip span,
.account-readonly-grid span,
.one-time-secret > span {
  color: var(--color-muted);
  font-size: var(--font-xs);
  font-weight: 800;
}

.account-security-strip strong {
  margin: var(--space-1) 0;
}

.reset-dialog {
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}

.reset-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.reset-dialog:not([open]) {
  display: none;
}

body.dialog-open {
  overflow: hidden;
}

body.dialog-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.5);
}

.reset-dialog.dialog-fallback-open {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 1000;
  display: block;
  margin: 0;
  transform: translate(-50%, -50%);
}

.reset-password-form {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
}

.dialog-head,
.dialog-actions,
.secret-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.dialog-head h3,
.dialog-head small {
  display: block;
  margin: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-muted);
  background: #f3f4f6;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.account-readonly-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.account-readonly-grid > div {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
}

.account-readonly-grid strong {
  display: block;
  margin-top: var(--space-1);
  overflow-wrap: anywhere;
}

.choice-fieldset {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.choice-fieldset legend {
  padding: 0 var(--space-2);
  font-weight: 800;
}

.choice-fieldset label,
.locked-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.locked-option {
  padding: var(--space-3);
  border-radius: 10px;
  background: #f0fdf4;
}

.compact-alert {
  margin: 0;
  padding: var(--space-3);
  box-shadow: none;
}

.warning-button {
  color: #92400e;
  border-color: #fde68a;
  background: #fef3c7;
}

.warning-button:hover {
  background: #fde68a;
}

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

.password-form {
  margin-top: var(--space-5);
}

.one-time-secret {
  margin: var(--space-5) 0;
  padding: var(--space-5);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
}

.one-time-secret p {
  margin: var(--space-3) 0 0;
  color: #1e3a8a;
}

.secret-copy-row {
  margin-top: var(--space-2);
}

.secret-copy-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--font-md);
  font-weight: 750;
}

.alert.success {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.timeline-item p {
  margin: var(--space-2) 0;
}

.style-disclaimer {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.style-analysis-input .section-title {
  margin-bottom: var(--space-5);
}

.style-analysis-input .section-title p {
  margin: var(--space-2) 0 0;
}

.style-external-test {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: var(--space-2);
  text-align: right;
}

.style-external-test small {
  color: var(--color-muted);
}

.style-analysis-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: var(--space-4);
  align-items: end;
}

.style-analysis-form .primary-button {
  min-width: 148px;
}

.style-analysis-note {
  margin: var(--space-3) 0 0;
  font-size: var(--font-sm);
}

.style-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin: 30px 0 var(--space-5);
}

.style-result-heading h2 {
  margin: var(--space-1) 0 0;
  font-size: var(--font-2xl);
  line-height: 1.25;
}

.style-copy-source {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
}

.style-copy-actions {
  justify-content: flex-end;
}

.style-quick-section,
.style-result-section {
  margin-top: 32px;
}

.style-section-heading {
  margin-bottom: var(--space-4);
}

.style-section-heading h2 {
  margin: var(--space-1) 0 0;
  font-size: var(--font-2xl);
}

.style-section-heading-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.style-section-index {
  color: #cbd5e1;
  font-size: 40px;
  font-weight: 850;
  line-height: 1;
}

.style-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.style-quick-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.style-quick-card span {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-muted);
  font-size: var(--font-sm);
  font-weight: 750;
}

.style-quick-card strong {
  display: block;
  color: #1f2937;
  font-size: var(--font-md);
  line-height: 1.65;
}

.style-quick-positive { border-top: 3px solid #22c55e; }
.style-quick-risk { border-top: 3px solid #f59e0b; }
.style-quick-action { border-top: 3px solid #3b82f6; }

.style-type-section,
.style-role-section {
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.style-type-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
}

.style-type-code {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  color: #fff;
  background: #202632;
  text-align: center;
}

.style-type-code strong {
  font-size: 34px;
  line-height: 1;
}

.style-type-code span {
  margin-top: var(--space-3);
  font-size: var(--font-lg);
  font-weight: 800;
}

.style-type-intro h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--font-xl);
  line-height: 1.5;
}

.style-type-intro p,
.style-role-summary p {
  margin: 0;
  color: #374151;
  line-height: 1.8;
}

.style-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.style-tag-row span {
  padding: 6px 10px;
  border-radius: 999px;
  color: #334155;
  background: #f1f5f9;
  font-size: var(--font-sm);
  font-weight: 700;
}

.style-dimension-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.style-dimension-card {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.style-dimension-card > span {
  display: block;
  color: var(--color-muted);
  font-size: var(--font-xs);
  font-weight: 750;
}

.style-dimension-card strong {
  display: block;
  margin: var(--space-2) 0;
  color: #111827;
}

.style-dimension-card p {
  margin: 0;
  color: #64748b;
  font-size: var(--font-sm);
  line-height: 1.6;
}

.style-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.style-result-card {
  min-width: 0;
  margin-bottom: 0;
}

.style-result-card-wide {
  grid-column: 1 / -1;
}

.style-card-kicker {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-muted);
  font-size: var(--font-sm);
  font-weight: 800;
}

.style-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.style-list {
  margin: 0;
  padding-left: 24px;
  color: #374151;
}

.style-list li {
  margin: 0 0 10px;
  padding-left: var(--space-1);
  line-height: 1.7;
}

.style-list li:last-child {
  margin-bottom: 0;
}

.style-list-columns {
  columns: 3;
  column-gap: 32px;
}

.style-list-columns li {
  break-inside: avoid;
}

.style-positive-card {
  border-top: 3px solid var(--color-success);
}

.style-risk-card {
  border-top: 3px solid var(--color-warning);
}

.style-trait-card {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
  border-color: #bfdbfe;
  background: #f8fbff;
}

.style-trait-card p {
  margin: var(--space-2) 0 0;
  color: #475569;
  line-height: 1.7;
}

.style-reference-note {
  margin-top: var(--space-4);
  padding: var(--space-4) 0 0;
  border-top: 1px dashed var(--color-border);
  color: #64748b;
  font-size: var(--font-sm);
}

.style-reference-note p {
  margin: var(--space-2) 0;
  line-height: 1.7;
}

.style-reference-note a {
  color: var(--color-primary);
  font-weight: 750;
}

.style-role-summary {
  margin-bottom: var(--space-5);
}

.style-direction-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: var(--space-5);
}

.style-direction-item {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.style-direction-item:last-of-type {
  border-bottom: 0;
}

.style-direction-item > strong {
  font-size: var(--font-md);
}

.style-direction-item p {
  margin: var(--space-2) 0 0;
  color: #475569;
  line-height: 1.65;
}

.style-result-disclaimer {
  margin-top: var(--space-5);
}

@media (max-width: 900px) {
  .style-analysis-form,
  .style-result-grid,
  .style-quick-grid,
  .style-direction-grid,
  .style-trait-card {
    grid-template-columns: 1fr;
  }

  .style-type-hero {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .style-dimension-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .style-result-card-wide {
    grid-column: auto;
  }

  .style-result-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .style-copy-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1199px) {
  :root {
    --sidebar-width: 248px;
  }

  .workspace {
    padding: 22px 24px 36px;
  }

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

  .form-grid,
  .interview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: 1fr;
  }

}

@media (min-width: 901px) and (max-width: 1199px) {
  .style-analysis-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .style-analysis-input .section-title,
  .style-section-heading-split,
  .style-type-hero,
  .style-external-test {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
    text-align: left;
  }

  .style-type-code {
    min-height: 116px;
  }

  .style-dimension-grid,
  .style-list-columns {
    grid-template-columns: 1fr;
    columns: auto;
  }

  .style-copy-actions > *,
  .style-external-test .btn {
    width: 100%;
  }

  .style-section-index {
    display: none;
  }

  .account-security-strip,
  .dialog-head,
  .dialog-actions,
  .secret-copy-row {
    align-items: stretch;
    flex-direction: column;
  }

  .account-readonly-grid {
    grid-template-columns: 1fr;
  }

  .reset-password-form {
    padding: var(--space-4);
  }

  .dialog-actions > *,
  .secret-copy-row > * {
    width: 100%;
  }

  .streamer-profile-column {
    display: none;
  }
  .review-section-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

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

  .style-result-heading {
    align-items: stretch;
    flex-direction: column;
    margin-top: var(--space-6);
  }

  .style-result-heading h2 {
    font-size: var(--font-xl);
  }

  .style-copy-actions,
  .style-copy-actions > * {
    width: 100%;
  }

  .review-copy {
    min-height: 340px;
  }
  body.sidebar-open {
    overflow: hidden;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--color-border);
  }

  .mobile-topbar strong {
    font-size: var(--font-md);
    font-weight: 850;
  }

  .mobile-menu-button {
    min-height: 36px;
    padding: 0 var(--space-3);
    border-radius: 10px;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    font-size: var(--font-sm);
    font-weight: 800;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: none;
    background: rgba(15, 23, 42, 0.35);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .shell {
    display: block;
    min-height: calc(100vh - 56px);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(82vw, 320px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 16px 0 32px rgba(15, 23, 42, 0.16);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .workspace {
    max-width: none;
    padding: var(--space-4);
  }

  .topbar {
    min-height: auto;
    margin-bottom: var(--space-4);
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: var(--font-xl);
  }

  .user-area {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .panel,
  .alert,
  .table-card,
  .data-card,
  .person-card {
    border-radius: var(--radius-md);
  }

  .panel,
  .alert,
  .table-card {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .card-grid,
  .card-grid.compact,
  .compact-grid,
  .form-grid,
  .form-grid.dense,
  .interview-grid,
  .two-column,
  .summary-list {
    grid-template-columns: 1fr;
  }

  .data-card {
    min-height: 112px;
    padding: var(--space-4);
  }

  .data-card strong {
    font-size: 28px;
  }

  .section-title,
  .person-head,
  .form-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row,
  .action-stack,
  .inline-form {
    width: 100%;
  }

  .primary-button,
  .btn,
  .button-row > *,
  .action-stack > a,
  .action-stack > form,
  .action-stack button,
  .inline-form button {
    width: 100%;
  }

  .inline-form input {
    min-width: 0;
  }

  .interview-panel {
    padding: var(--space-4);
  }

  th,
  td {
    height: 48px;
    padding: 10px 12px;
  }

  table {
    min-width: 760px;
  }
}
