/* ============================
   VISION REALTY TRAINING HUB
   CSS — Production Grade
   ============================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 280px;
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --sidebar-bg: #191919;
  --sidebar-text: #C8C8C8;
  --sidebar-active: #DD1E2D;
  --sidebar-hover: rgba(221,30,45,0.12);
  --accent: #DD1E2D;
  --accent2: #DD1E2D;
  --accent3: #1a2a3c;
  --text-primary: #1C1C1C;
  --text-secondary: #555555;
  --text-muted: #6e6e6e;
  --border: #E4E2DA;
  --shadow: 0 2px 16px rgba(28,28,28,0.08);
  --shadow-lg: 0 8px 40px rgba(28,28,28,0.14);
  --radius: 10px;
  --radius-sm: 6px;
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.logo-mark {
  width: 42px; height: 42px;
  background: var(--accent2);
  color: var(--sidebar-bg);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-name {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.logo-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--sidebar-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(200,200,200,0.45);
  padding: 14px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all 0.18s;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--accent2);
}

.nav-item.active {
  background: var(--sidebar-hover);
  color: var(--accent2);
  border-left-color: var(--accent2);
  font-weight: 600;
}

.nav-icon { font-size: 14px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-footer-text {
  font-size: 11px;
  color: rgba(200,200,200,0.4);
  line-height: 1.7;
}

/* ============================
   MAIN CONTENT
   ============================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================
   SEARCH BAR
   ============================ */
.search-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247,246,242,0.95);
  backdrop-filter: blur(8px);
  padding: 14px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-bar {
  position: relative;
  max-width: 600px;
  flex: 1 1 auto;
}

.portal-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  font: 600 12px/1 var(--font-body);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.portal-link:hover { filter: brightness(1.12); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 8px; top: 8px; border-radius: 8px; }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus { border-color: var(--accent2); }
.search-bar input::placeholder { color: var(--text-muted); }

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #F7F6F2; }

.search-result-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}

.search-result-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

mark {
  background: rgba(221,30,45,0.3);
  color: var(--text-primary);
  border-radius: 2px;
  padding: 0 2px;
}

/* ============================
   PAGES
   ============================ */
#pageContainer {
  flex: 1;
  padding: 40px 40px 80px;
  max-width: 960px;
  width: 100%;
}

.page { display: none; }
.page.active { display: block; }

/* ============================
   PAGE HEADER
   ============================ */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.page-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(221,30,45,0.08);
  padding: 4px 10px;
  border-radius: 50px;
  margin-bottom: 10px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
}

/* ============================
   FORM META BAR
   ============================ */
.form-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.meta-item {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 50px;
}

/* ============================
   CALLOUTS
   ============================ */
.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  border-left: 4px solid;
  font-size: 14px;
  line-height: 1.6;
}

.callout strong { display: block; margin-bottom: 4px; font-size: 14px; }

.callout-blue {
  background: rgba(26,42,60,0.07);
  border-color: var(--accent3);
  color: #14202E;
}

.callout-amber {
  background: rgba(221,30,45,0.1);
  border-color: var(--accent2);
  color: #4A0A0E;
}

.callout-red {
  background: rgba(221,30,45,0.08);
  border-color: var(--accent);
  color: #3A1208;
}

/* ============================
   FIELD SECTIONS
   ============================ */
.field-section {
  margin-bottom: 36px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border);
}

.section-intro {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ============================
   FIELD CARDS
   ============================ */
.field-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-card:hover {
  border-color: rgba(221,30,45,0.4);
  box-shadow: var(--shadow);
}

.field-card.highlight-field {
  border-color: rgba(221,30,45,0.5);
  background: rgba(221,30,45,0.04);
}

.field-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.field-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary);
}

.field-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}

.field-badge.required { background: rgba(221,30,45,0.1); color: var(--accent); }
.field-badge.vision { background: rgba(26,42,60,0.1); color: var(--accent3); }
.field-badge.important { background: rgba(221,30,45,0.15); color: #8A101A; }
.field-badge.critical { background: rgba(221,30,45,0.15); color: var(--accent); }
.field-badge.flexible { background: rgba(90,90,122,0.1); color: var(--text-secondary); }

.field-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 10px;
}

.field-desc:last-child { margin-bottom: 0; }

.field-example {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-mono);
  margin-top: 8px;
}

.field-example.vision-default {
  background: rgba(26,42,60,0.07);
  border-color: rgba(26,42,60,0.25);
  color: #14202E;
}

.example-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.field-tip {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(221,30,45,0.07);
  border-left: 3px solid var(--accent2);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 10px;
  line-height: 1.5;
}

/* ============================
   OVERVIEW CARDS
   ============================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.info-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.info-card:hover {
  border-color: var(--accent2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.info-card.highlight-card {
  border-color: var(--accent2);
  background: rgba(221,30,45,0.05);
}

.card-icon { font-size: 28px; margin-bottom: 10px; }
.info-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.info-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.card-link { font-size: 13px; color: var(--accent2); font-weight: 600; }

.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-item {
  background: var(--sidebar-bg);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

/* ============================
   WORKFLOW
   ============================ */
.workflow-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.toggle-btn {
  padding: 9px 20px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  border-color: var(--accent2);
  background: var(--accent2);
  color: var(--sidebar-bg);
}

.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 12px;
  bottom: 20px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sidebar-bg);
  color: var(--accent2);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-family: var(--font-mono);
}

.timeline-content {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.timeline-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.timeline-content p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.timeline-forms { display: flex; flex-wrap: wrap; gap: 8px; }

.form-badge {
  font-size: 12px;
  font-weight: 500;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s;
}

.form-badge:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(221,30,45,0.07);
}

/* ============================
   FIDUCIARY DUTIES GRID
   ============================ */
.duties-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.duty-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.duty-item strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.duty-item p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ============================
   VISION DEFAULTS GRID
   ============================ */
.defaults-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.default-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.default-card:hover {
  border-color: var(--accent2);
  box-shadow: var(--shadow);
}

.default-icon { font-size: 24px; margin-bottom: 8px; }
.default-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px; }
.default-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.default-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* ============================
   GLOSSARY
   ============================ */
.glossary-search {
  margin-bottom: 20px;
}

.glossary-search input {
  width: 100%;
  max-width: 400px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  background: var(--surface);
  transition: border-color 0.2s;
}

.glossary-search input:focus { border-color: var(--accent2); }

.glossary-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.glossary-item.hidden { display: none; }

.glossary-term {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.glossary-def {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================
   MOBILE MENU BTN
   ============================ */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--sidebar-bg);
  color: white;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .search-bar-wrap {
    padding: 12px 16px 12px 64px;
  }
  #pageContainer {
    padding: 24px 16px 60px;
  }
  .overview-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .duties-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-title {
    font-size: 24px;
  }
}

@media (max-width: 580px) {
  .overview-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .defaults-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================
   UTILITIES
   ============================ */
.hidden { display: none !important; }

/* ============================
   FORM VIEWER
   ============================ */

.viewer-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  border: none;
  padding: 11px 22px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 28px;
  transition: all 0.2s;
}
.viewer-toggle-btn:hover { background: #2C2C2C; }
.viewer-toggle-btn .btn-icon { font-size: 16px; }

.viewer-container {
  display: none;
  margin-bottom: 32px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.viewer-container.open { display: block; }

.viewer-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 600px;
}

.viewer-left {
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
}

.viewer-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #F0EFE9;
  border-bottom: 1.5px solid var(--border);
  padding: 8px 10px;
  gap: 6px;
}

.page-nav-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.page-nav-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.page-nav-btn.active {
  background: var(--sidebar-bg);
  color: var(--accent2);
  border-color: var(--sidebar-bg);
}

.viewer-image-wrap {
  position: relative;
  flex: 1;
  overflow: auto;
  background: #888;
}

.viewer-form-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.viewer-no-image {
  padding: 60px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

.viewer-annotations {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.annot-box {
  position: absolute;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.15s;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  border: 2.5px solid transparent;
}

.annot-box.badge-required {
  background: rgba(221,30,45,0.12);
  border-color: rgba(221,30,45,0.5);
}
.annot-box.badge-vision {
  background: rgba(26,42,60,0.12);
  border-color: rgba(26,42,60,0.5);
}
.annot-box.badge-important {
  background: rgba(221,30,45,0.15);
  border-color: rgba(221,30,45,0.6);
}
.annot-box.badge-critical {
  background: rgba(221,30,45,0.18);
  border-color: rgba(221,30,45,0.7);
}

.annot-box:hover,
.annot-box.active {
  border-width: 3px;
  z-index: 10;
}
.annot-box.badge-required:hover,
.annot-box.badge-required.active { background: rgba(221,30,45,0.25); border-color: var(--accent); }
.annot-box.badge-vision:hover,
.annot-box.badge-vision.active { background: rgba(26,42,60,0.25); border-color: var(--accent3); }
.annot-box.badge-important:hover,
.annot-box.badge-important.active { background: rgba(221,30,45,0.3); border-color: var(--accent2); }
.annot-box.badge-critical:hover,
.annot-box.badge-critical.active { background: rgba(221,30,45,0.3); border-color: var(--accent); }

.annot-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 0.15s;
}

.annot-box:hover .annot-label,
.annot-box.active .annot-label { opacity: 1; }

.annot-box.badge-required .annot-label { background: var(--accent); color: white; }
.annot-box.badge-vision .annot-label { background: var(--accent3); color: white; }
.annot-box.badge-important .annot-label { background: var(--accent2); color: #FFFFFF; }
.annot-box.badge-critical .annot-label { background: var(--accent); color: white; }

/* Right Panel */
.viewer-right {
  padding: 20px;
  background: #FAFAF7;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.viewer-instructions {
  text-align: center;
  padding: 24px 12px;
}
.viewer-hint-icon { font-size: 36px; margin-bottom: 12px; }
.viewer-instructions p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }

.viewer-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid;
  flex-shrink: 0;
}
.legend-dot.badge-required { background: rgba(221,30,45,0.15); border-color: var(--accent); }
.legend-dot.badge-vision { background: rgba(26,42,60,0.15); border-color: var(--accent3); }
.legend-dot.badge-important { background: rgba(221,30,45,0.2); border-color: var(--accent2); }
.legend-dot.badge-critical { background: rgba(221,30,45,0.2); border-color: var(--accent); }

.viewer-detail { padding: 4px 0; }
.viewer-detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.viewer-detail-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.viewer-detail-tip {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border-left: 3px solid var(--accent2);
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.viewer-back-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border);
  padding: 7px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s;
}
.viewer-back-btn:hover { color: var(--text-secondary); border-color: var(--text-muted); }

/* Responsive viewer */
@media (max-width: 900px) {
  .viewer-layout {
    grid-template-columns: 1fr;
  }
  .viewer-left { border-right: none; border-bottom: 2px solid var(--border); }
  .viewer-right { min-height: 200px; }
}

/* ============================================================
   TRANSACTION CHECKLIST
   ============================================================ */

.cl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.cl-toggle {
  display: flex;
  gap: 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 3px;
}
.cl-tab {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border: none;
  border-radius: 50px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.cl-tab.active {
  background: var(--sidebar-bg);
  color: var(--accent2);
}
.cl-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cl-action-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border);
  padding: 7px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s;
}
.cl-action-btn:hover { border-color: var(--text-muted); color: var(--text-secondary); }
.cl-progress-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.cl-transaction-name {
  margin-bottom: 20px;
}
.cl-transaction-name input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.cl-transaction-name input:focus { border-color: var(--accent2); }

.cl-section {
  margin-bottom: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.cl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  background: var(--bg);
  user-select: none;
  gap: 12px;
}
.cl-section-header:hover { background: #F5F3EE; }
.cl-section-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cl-section-arrow { font-size: 11px; color: var(--text-muted); width: 14px; }
.cl-section-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.cl-section-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cl-section-count { font-size: 12px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.cl-section-bar {
  width: 80px;
  height: 5px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.cl-section-fill {
  height: 100%;
  background: var(--accent3);
  border-radius: 10px;
  transition: width 0.3s;
}

.cl-section-items { padding: 6px 8px 8px; }

.cl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
  margin-bottom: 2px;
}
.cl-item:hover { background: var(--bg); }
.cl-item.checked { opacity: 0.6; }
.cl-item.checked .cl-item-text { text-decoration: line-through; color: var(--text-muted); }

.cl-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
  background: white;
}
.cl-item.checked .cl-checkbox {
  background: var(--accent3);
  border-color: var(--accent3);
}

.cl-item-content { flex: 1; min-width: 0; }
.cl-item-text { font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.4; }
.cl-item-note { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.cl-form-link {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent2);
  margin-top: 4px;
  cursor: pointer;
  text-decoration: underline;
}


/* ============================================================
   DECISION TREE
   ============================================================ */

.dt-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 0;
}
.dt-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.dt-crumb {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 50px;
}
.dt-sep { color: var(--border); }
.dt-back-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border);
  padding: 7px 14px;
  border-radius: 50px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.15s;
  display: inline-block;
}
.dt-back-btn:hover { color: var(--text-secondary); border-color: var(--text-muted); }

.dt-question {
  text-align: center;
  margin-bottom: 28px;
}
.dt-icon { font-size: 40px; margin-bottom: 12px; }
.dt-question h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.dt-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 20px;
}
.dt-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dt-option-btn {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  padding: 16px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-primary);
  line-height: 1.4;
}
.dt-option-btn:hover {
  border-color: var(--accent2);
  background: var(--bg);
  color: var(--accent2);
}

/* Result */
.dt-result-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid var(--border);
}
.dt-result-icon { font-size: 40px; margin-bottom: 10px; }
.dt-result-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.dt-result-header p { font-size: 13px; color: var(--text-muted); }

.dt-result-section {
  margin-bottom: 20px;
}
.dt-result-section h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.dt-result-section.dt-optional h3 { color: var(--text-muted); }

.dt-form-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.dt-form-item.optional { opacity: 0.75; }
.dt-form-check {
  font-size: 16px;
  color: var(--accent3);
  flex-shrink: 0;
  margin-top: 2px;
}
.dt-form-item.optional .dt-form-check { color: var(--text-muted); }
.dt-form-info { flex: 1; }
.dt-form-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.dt-form-when { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dt-form-link-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  background: none;
  border: 1px solid var(--accent2);
  padding: 4px 10px;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.dt-form-link-btn:hover { background: var(--accent2); color: var(--sidebar-bg); }

.dt-notes {
  background: rgba(221,30,45,0.08);
  border: 1.5px solid rgba(221,30,45,0.4);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 16px;
  margin-bottom: 20px;
}
.dt-notes h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dt-note {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}
.dt-restart-btn {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 13px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}
.dt-restart-btn:hover { background: #2C2C2C; }


/* ============================================================
   TIMELINE CALCULATOR
   ============================================================ */

.tl-form-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.tl-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.tl-input-group { display: flex; flex-direction: column; gap: 6px; }
.tl-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.tl-required { color: var(--accent); }
.tl-input {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.tl-input:focus { border-color: var(--accent2); }
.tl-input-hint { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.tl-btn-row { display: flex; gap: 10px; }
.tl-calc-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.tl-calc-btn:hover { background: #2C2C2C; }
.tl-clear-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.tl-clear-btn:hover { border-color: var(--text-muted); color: var(--text-secondary); }

.tl-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  flex-wrap: wrap;
}
.tl-state-badge {
  background: var(--accent2);
  color: var(--sidebar-bg);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  letter-spacing: 0.04em;
}
.tl-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.tl-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.tl-item.tl-highlight {
  background: var(--sidebar-bg);
  border-color: var(--sidebar-bg);
  color: white;
}
.tl-item.tl-highlight .tl-item-label { color: var(--accent2); }
.tl-item.tl-highlight .tl-item-desc { color: rgba(255,255,255,0.6); }
.tl-item.tl-highlight .tl-item-date { color: white; }

.tl-item-left { display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 200px; }
.tl-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.tl-item-body { flex: 1; }
.tl-item-label { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.tl-item-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.tl-item-right { text-align: right; flex-shrink: 0; }
.tl-item-date { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.tl-item-countdown { font-size: 12px; font-weight: 700; }

.tl-past { color: var(--text-muted); }
.tl-today { color: var(--accent); font-size: 13px; }
.tl-urgent { color: var(--accent); }
.tl-soon { color: var(--accent2); }
.tl-future { color: var(--accent3); }

.tl-error {
  color: var(--accent);
  font-size: 14px;
  padding: 12px 16px;
  background: rgba(221,30,45,0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(221,30,45,0.3);
}
.tl-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  line-height: 1.5;
}


/* ============================================================
   MN VS ND COMPARISON
   ============================================================ */

.cmp-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cmp-filter {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.cmp-filter:hover { border-color: var(--accent2); color: var(--accent2); }
.cmp-filter.active {
  background: var(--sidebar-bg);
  border-color: var(--sidebar-bg);
  color: var(--accent2);
}
.cmp-header-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 0;
  background: var(--sidebar-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  margin-bottom: 2px;
}
.cmp-cat-col { padding: 12px 16px; }
.cmp-state-col {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent2);
  text-align: center;
}

.cmp-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 6px;
  background: var(--surface);
}
.cmp-row.cmp-differs { border-color: rgba(221,30,45,0.4); }

.cmp-cat {
  padding: 14px 14px;
  background: var(--bg);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cmp-cat strong { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.cmp-diff-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(221,30,45,0.15);
  color: var(--accent2);
  padding: 2px 7px;
  border-radius: 50px;
  border: 1px solid rgba(221,30,45,0.4);
  width: fit-content;
}
.cmp-same-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(26,42,60,0.1);
  color: var(--accent3);
  padding: 2px 7px;
  border-radius: 50px;
  border: 1px solid rgba(26,42,60,0.3);
  width: fit-content;
}
.cmp-mn-cell, .cmp-nd-cell {
  padding: 14px 14px;
}
.cmp-nd-cell { border-left: 1.5px solid var(--border); }
.cmp-state-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.cmp-mn-cell .cmp-state-label { color: #1a2a3c; }
.cmp-nd-cell .cmp-state-label { color: #DD1E2D; }
.cmp-cell-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.cmp-link-btn {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent2);
  background: none;
  border: 1px solid var(--accent2);
  padding: 3px 9px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s;
}
.cmp-link-btn:hover { background: var(--accent2); color: var(--sidebar-bg); }

@media (max-width: 700px) {
  .cmp-header-row, .cmp-row { grid-template-columns: 1fr; }
  .cmp-cat { border-right: none; border-bottom: 1.5px solid var(--border); }
  .cmp-nd-cell { border-left: none; border-top: 1.5px solid var(--border); }
}


/* ============================================================
   ONBOARDING COURSE
   ============================================================ */

.course-home { padding: 4px 0; }
.course-overall-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  flex-wrap: wrap;
}
.course-prog-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); flex: 1; }
.course-prog-bar {
  width: 200px;
  height: 8px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.course-prog-fill {
  height: 100%;
  background: var(--accent3);
  border-radius: 10px;
  transition: width 0.4s;
}
.course-prog-pct { font-size: 14px; font-weight: 700; color: var(--accent3); min-width: 36px; text-align: right; }

.course-modules { display: flex; flex-direction: column; gap: 10px; }
.course-module-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.course-module-card.started { border-color: rgba(221,30,45,0.4); }
.course-module-card.done { border-color: rgba(26,42,60,0.4); }
.course-mod-icon { font-size: 28px; flex-shrink: 0; }
.course-mod-info { flex: 1; }
.course-mod-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.course-mod-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.course-mod-bar {
  width: 100%;
  max-width: 200px;
  height: 5px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 4px;
}
.course-mod-fill { height: 100%; background: var(--accent3); border-radius: 10px; transition: width 0.3s; }
.course-mod-progress { font-size: 11px; color: var(--text-muted); }
.course-start-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.course-start-btn:hover { background: #2C2C2C; }

/* Lesson View */
.lesson-view { padding: 4px 0; }
.lesson-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.lesson-back {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border);
  padding: 7px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s;
}
.lesson-back:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.lesson-breadcrumb { font-size: 13px; color: var(--text-muted); }

.lesson-progress-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.lesson-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.lesson-dot.done { background: var(--accent3); border-color: var(--accent3); }
.lesson-dot.active { background: var(--accent2); border-color: var(--accent2); transform: scale(1.3); }

.lesson-title-bar { margin-bottom: 20px; }
.lesson-type-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 50px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.lesson-title-bar h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.lesson-content { font-size: 14px; line-height: 1.8; color: var(--text-secondary); }
.lesson-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.lesson-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 18px 0 8px;
}
.lesson-content p { margin-bottom: 12px; }
.lesson-key-point {
  background: rgba(221,30,45,0.08);
  border-left: 4px solid var(--accent2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.lesson-duties {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.lesson-duty {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
}
.lesson-duty strong { display: block; margin-bottom: 4px; color: var(--text-primary); font-size: 13px; }
.lesson-duty p { margin: 0; color: var(--text-muted); font-size: 12px; }
.lesson-types { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.lesson-type-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.lesson-type-item.lesson-highlight {
  border-color: rgba(26,42,60,0.4);
  background: rgba(26,42,60,0.05);
}
.lesson-type-item strong { display: block; margin-bottom: 4px; color: var(--text-primary); font-size: 13px; }
.lesson-type-item p { margin: 0; color: var(--text-secondary); font-size: 12.5px; }
.lesson-checklist { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.lesson-check-item {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.lesson-check-item:last-child { border-bottom: none; }

.lesson-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1.5px solid var(--border);
}
.lesson-prev-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.lesson-prev-btn:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.lesson-complete-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.lesson-complete-btn:hover { background: #2C2C2C; }

/* Quiz */
.quiz-container { display: flex; flex-direction: column; gap: 24px; }
.quiz-question {}
.quiz-q-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.5;
}
.quiz-num { color: var(--text-muted); margin-right: 6px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  text-align: left;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent2); background: var(--bg); }
.quiz-opt.quiz-correct { background: rgba(26,42,60,0.1); border-color: var(--accent3); color: var(--accent3); }
.quiz-opt.quiz-wrong { background: rgba(221,30,45,0.08); border-color: var(--accent); color: var(--accent); }
.quiz-opt:disabled { cursor: not-allowed; }
.quiz-opt-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.quiz-explain {
  margin-top: 8px;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  line-height: 1.6;
}
.quiz-explain.hidden { display: none; }
.quiz-explain-correct { background: rgba(26,42,60,0.1); color: var(--accent3); border-left: 3px solid var(--accent3); }
.quiz-explain-wrong { background: rgba(221,30,45,0.08); color: var(--accent); border-left: 3px solid var(--accent); }

.quiz-score {
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
}
.quiz-score.hidden { display: none; }
.quiz-score.quiz-passed { background: rgba(26,42,60,0.1); border: 1.5px solid var(--accent3); color: var(--accent3); }
.quiz-score.quiz-failed { background: rgba(221,30,45,0.1); border: 1.5px solid var(--accent2); color: var(--accent2); }
.quiz-score-icon { font-size: 32px; margin-bottom: 8px; }
.quiz-score-msg { font-size: 13px; font-weight: 400; margin-top: 4px; margin-bottom: 14px; opacity: 0.8; }


/* ============================================================
   FORM FILL SIMULATOR
   ============================================================ */

.sim-home { padding: 4px 0; }
.sim-intro {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}
.sim-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.sim-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sim-card:hover { border-color: var(--accent2); }
.sim-card-icon { font-size: 28px; }
.sim-card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sim-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.sim-start-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
  width: 100%;
}
.sim-start-btn:hover { background: #2C2C2C; }

.sim-view { padding: 4px 0; }
.sim-back-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border);
  padding: 7px 14px;
  border-radius: 50px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.15s;
  display: inline-block;
}
.sim-back-btn:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.sim-form-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.sim-scenario {
  background: rgba(221,30,45,0.08);
  border: 1.5px solid rgba(221,30,45,0.35);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.sim-fields { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.sim-field {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.sim-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.sim-field-hint {
  font-size: 12px;
  color: var(--accent2);
  background: rgba(221,30,45,0.08);
  border-left: 3px solid var(--accent2);
  padding: 6px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 8px;
  line-height: 1.5;
}
.sim-input-row { display: flex; align-items: center; gap: 10px; }
.sim-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.sim-input:focus { border-color: var(--accent2); }
.sim-field-status { font-size: 20px; width: 24px; flex-shrink: 0; }
.sim-correct { color: var(--accent3); }
.sim-wrong { color: var(--accent); }
.sim-feedback { margin-top: 6px; }
.sim-fb-text {
  font-size: 12px;
  color: var(--accent);
  background: rgba(221,30,45,0.06);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  display: inline-block;
}

.sim-footer { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.sim-check-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
  background: var(--sidebar-bg);
  color: var(--accent2);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.sim-check-btn:hover { background: #2C2C2C; }
.sim-hint-btn, .sim-reset-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 16px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.sim-hint-btn:hover, .sim-reset-btn:hover { border-color: var(--text-muted); color: var(--text-secondary); }

.sim-score {
  padding: 16px 18px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.sim-score-pass { background: rgba(26,42,60,0.1); border: 1.5px solid var(--accent3); color: var(--accent3); }
.sim-score-fail { background: rgba(221,30,45,0.1); border: 1.5px solid var(--accent2); color: var(--accent2); }
