:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-soft: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2ff;
  --text: #101828;
  --text-2: #334155;
  --muted: #667085;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #4f46e5;
  --primary-2: #3730a3;
  --primary-soft: #eef2ff;
  --cyan: #0ea5e9;
  --emerald: #059669;
  --amber: #d97706;
  --rose: #e11d48;
  --violet: #7c3aed;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 4px rgba(15, 23, 42, .04);
  --shadow: 0 15px 45px rgba(15, 23, 42, .08);
  --shadow-lg: 0 30px 80px rgba(15, 23, 42, .13);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 264px;
  --topbar: 70px;
  --font: Aptos, "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090f1d;
  --bg-soft: #0d1526;
  --surface: #111a2d;
  --surface-2: #151f34;
  --surface-3: #18203b;
  --text: #f8fafc;
  --text-2: #dbe4f2;
  --muted: #9aa9be;
  --muted-2: #718096;
  --line: #25334b;
  --line-strong: #34445f;
  --primary: #818cf8;
  --primary-2: #a5b4fc;
  --primary-soft: #1e2750;
  --cyan: #38bdf8;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --violet: #a78bfa;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow: 0 20px 55px rgba(0, 0, 0, .25);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 2%, rgba(79, 70, 229, .08), transparent 28rem),
    radial-gradient(circle at 5% 95%, rgba(14, 165, 233, .06), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; }
::selection { background: rgba(79, 70, 229, .2); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px 8px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
  font-size: 21px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(79, 70, 229, .27);
}
.brand > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.brand b { font-size: 18px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { display: grid; gap: 5px; margin-top: 14px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 45px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-item span { flex: 1; }
.nav-item kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted-2); background: var(--surface); font-size: 10px; }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.build-chip { display: flex; align-items: center; gap: 9px; padding: 8px 12px; color: var(--muted); }
.build-chip > span { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent); }
.build-chip div { display: flex; flex-direction: column; }
.build-chip b { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.build-chip small { font-size: 10px; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(20px);
}
.topbar-left, .topbar-controls { display: flex; align-items: center; gap: 10px; }
.page-identity { display: flex; flex-direction: column; line-height: 1.2; }
.page-identity small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.page-identity b { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.icon-button:hover { border-color: var(--line-strong); color: var(--primary); transform: translateY(-1px); }
.menu-button { display: none; }
.compact-select, .role-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.compact-select span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.compact-select select, .role-switch select { border: 0; outline: 0; background: transparent; color: var(--text); font-weight: 700; cursor: pointer; }
.role-switch select { max-width: 150px; font-size: 12px; }
.main-content { width: min(1260px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 70px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1260px, calc(100% - 48px)); margin: 0 auto; padding: 22px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.mobile-scrim { display: none; }

h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(36px, 5vw, 64px); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin-bottom: 10px; font-size: clamp(24px, 3vw, 34px); line-height: 1.12; letter-spacing: -.025em; }
h3 { margin-bottom: 8px; font-size: 19px; line-height: 1.25; letter-spacing: -.015em; }
p { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: var(--primary); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.icon { flex: 0 0 auto; }
code { padding: 3px 7px; border-radius: 7px; background: var(--surface-2); color: var(--text-2); font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 62%, var(--cyan))); color: white; box-shadow: 0 11px 28px rgba(79, 70, 229, .22); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); }
.button.ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.button.danger { color: var(--danger); }
.button.wide { width: 100%; }
.button.tiny { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.inline-actions.compact { gap: 6px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.back-link:hover { color: var(--primary); }
.page-back { margin-bottom: 18px; }

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  gap: 42px;
  min-height: 470px;
  padding: clamp(34px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, var(--primary)) 0%, var(--surface) 55%, color-mix(in srgb, var(--surface) 91%, var(--cyan)) 100%);
  box-shadow: var(--shadow);
}
.hero-panel::after { content: ''; position: absolute; width: 360px; height: 360px; right: -190px; top: -190px; border-radius: 50%; border: 55px solid color-mix(in srgb, var(--primary) 8%, transparent); }
.hero-copy { position: relative; z-index: 1; align-self: center; }
.hero-copy p { max-width: 700px; font-size: 19px; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 35px; }
.hero-facts span { display: flex; flex-direction: column; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.hero-facts b { color: var(--text); font-size: 23px; letter-spacing: -.03em; }
.architecture-visual { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 340px; padding: 25px; }
.arch-node { display: grid; place-items: center; min-width: 145px; min-height: 66px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--text-2); text-align: center; font-weight: 750; box-shadow: var(--shadow-sm); }
.arch-node.platform { display: flex; gap: 10px; min-width: 170px; }
.arch-node.platform span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), var(--cyan)); color: white; }
.arch-node.shared { min-width: 260px; border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); background: var(--primary-soft); color: var(--primary); }
.arch-node.mini { min-width: 115px; min-height: 46px; font-size: 12px; }
.arch-line { width: 2px; height: 32px; background: var(--line-strong); }
.arch-line.short { height: 22px; }
.arch-row { display: flex; gap: 18px; }
.arch-row.units { gap: 12px; }
.arch-merge { position: relative; width: 310px; height: 38px; }
.arch-merge::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line-strong); }
.arch-merge i { position: absolute; top: 0; width: calc(50% - 72px); height: 18px; border-bottom: 2px solid var(--line-strong); }
.arch-merge i:first-child { left: 70px; border-left: 2px solid var(--line-strong); border-radius: 0 0 0 8px; }
.arch-merge i:last-child { right: 70px; border-right: 2px solid var(--line-strong); border-radius: 0 0 8px 0; }

.page-section { margin-top: 52px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; }
.subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.subject-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 275px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: .2s ease;
}
.subject-card::after { content: ''; position: absolute; width: 170px; height: 170px; right: -75px; top: -80px; border-radius: 50%; background: color-mix(in srgb, var(--card-accent, var(--primary)) 10%, transparent); }
.subject-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--card-accent, var(--primary)) 35%, var(--line)); box-shadow: var(--shadow); }
.subject-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.subject-card.accent-indigo { --card-accent: var(--primary); }
.subject-card.accent-emerald { --card-accent: var(--emerald); }
.subject-card.accent-amber { --card-accent: var(--amber); }
.subject-card.accent-rose { --card-accent: var(--rose); }
.subject-card.accent-violet { --card-accent: var(--violet); }
.subject-card.is-draft { border-style: dashed; opacity: .88; }
.subject-card-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.subject-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: color-mix(in srgb, var(--card-accent, var(--primary)) 12%, var(--surface)); color: var(--card-accent, var(--primary)); font-size: 24px; font-weight: 800; }
.subject-symbol.large { width: 72px; height: 72px; border-radius: 20px; font-size: 34px; }
.subject-symbol.small { width: 40px; height: 40px; border-radius: 11px; font-size: 20px; }
.subject-card-body { position: relative; z-index: 1; margin-top: 24px; }
.subject-card-body h3 { font-size: 25px; }
.subject-card-body p { max-width: 520px; margin: 0; }
.subject-card-meta { position: relative; z-index: 1; display: grid; gap: 9px; margin-top: auto; padding-top: 22px; }
.subject-card-meta > span { color: var(--muted); font-size: 12px; }
.progress-wrap { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.progress-track { flex: 1; overflow: hidden; height: 7px; border-radius: 999px; background: var(--bg-soft); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--cyan)); }
.progress-wrap b { min-width: 34px; color: var(--text-2); font-size: 12px; text-align: right; }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.status-published, .status-original, .status-human-reviewed { background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); }
.status-draft, .status-outline { background: color-mix(in srgb, var(--warning) 13%, var(--surface)); color: var(--amber); }
.status-archived { background:color-mix(in srgb,#8a5ca8 13%,var(--surface)); color:#7b4f9b; }
.status-missing { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.status-ai-translated { background: color-mix(in srgb, var(--violet) 11%, var(--surface)); color: var(--violet); }
.shared-topic-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 34px;
  padding: 25px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 20px;
  background: linear-gradient(110deg, var(--primary-soft), var(--surface));
}
.shared-topic-band h2 { margin-bottom: 4px; }
.shared-topic-band p { margin: 0; }
.shared-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.reuse-list { display: grid; gap: 7px; min-width: 225px; }
.reuse-list button, .reuse-chip { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); cursor: pointer; text-align: left; }
.reuse-list b, .reuse-chip b { color: var(--primary); }
.reuse-list span { flex: 1; }
.reuse-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.draft-section { padding-top: 36px; border-top: 1px dashed var(--line-strong); }

.notice { display: flex; align-items: flex-start; gap: 11px; margin-top: 20px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text-2); }
.notice p { margin: 3px 0 4px; }
.notice small { color: var(--muted); }
.notice.compact { margin: 14px 0 0; padding: 10px 13px; font-size: 12px; }
.notice.large { margin-top: 42px; }
.notice-info { border-color: color-mix(in srgb, var(--cyan) 25%, var(--line)); background: color-mix(in srgb, var(--cyan) 6%, var(--surface)); }
.notice-warning { border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.notice-neutral { background: var(--surface-2); }

.subject-hero, .topic-hero, .unit-hero, .simple-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.subject-hero::after, .topic-hero::after, .unit-hero::after { content: ''; position: absolute; width: 280px; height: 280px; right: -130px; top: -150px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 7%, transparent); }
.subject-hero-main { position: relative; z-index: 1; display: flex; align-items: center; gap: 22px; max-width: 800px; }
.subject-hero-main p { margin-bottom: 0; font-size: 17px; }
.subject-progress-card { position: absolute; z-index: 2; right: 38px; bottom: 34px; width: 210px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); }
.subject-progress-card > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.subject-progress-card small { color: var(--muted); }
.offering-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(350px, .8fr); gap: 28px; margin-top: 20px; padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.offering-card p { margin-bottom: 0; }
.offering-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.offering-meta span { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.offering-meta small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.offering-meta b { font-size: 12px; line-height: 1.35; }
.topic-list { display: grid; gap: 11px; }
.topic-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  transition: .18s ease;
}
.topic-row:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); box-shadow: var(--shadow-sm); }
.topic-row.outline { opacity: .85; }
.topic-code { display: grid; place-items: center; height: 52px; border-radius: 13px; background: var(--primary-soft); color: var(--primary); font-weight: 850; }
.topic-title-line, .unit-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.topic-title-line h3, .unit-title-line h3 { margin: 0; }
.topic-main p { margin: 6px 0 10px; }
.topic-tags, .object-type-row { display: flex; flex-wrap: wrap; gap: 7px; }
.topic-tags span, .object-type-row span, .depth-label { padding: 4px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.shared-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.topic-action { display: flex; flex-direction: column; align-items: flex-end; color: var(--muted); }
.topic-action b { color: var(--text); font-size: 20px; }
.topic-action .icon { margin-top: 5px; color: var(--primary); }

.topic-hero h1, .unit-hero h1, .simple-hero h1 { max-width: 900px; font-size: clamp(36px, 5vw, 56px); }
.topic-hero p, .unit-hero p, .simple-hero p { max-width: 830px; margin-bottom: 0; font-size: 17px; }
.topic-identity, .object-id { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.topic-identity span { display: inline-flex; align-items: center; gap: 6px; }
.reuse-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.reuse-panel h2 { margin: 0; font-size: 20px; }
.reuse-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.unit-grid { display: grid; gap: 12px; }
.unit-card { display: grid; grid-template-columns: 62px minmax(0, 1fr) 40px; align-items: center; gap: 16px; padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); cursor: pointer; transition: .18s ease; }
.unit-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); box-shadow: var(--shadow-sm); }
.unit-card.completed { border-color: color-mix(in srgb, var(--success) 30%, var(--line)); }
.unit-number { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--surface-2); color: var(--primary); font-weight: 850; }
.unit-card.completed .unit-number { background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); }
.unit-content p { margin: 6px 0 11px; }
.unit-arrow { color: var(--muted); }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 30px; border: 1px dashed var(--line-strong); border-radius: 16px; color: var(--muted); text-align: center; }
.empty-state.large { min-height: 55vh; }
.empty-state p { margin: 8px 0; }

.unit-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: center; }
.complete-button { display: flex; align-items: center; gap: 10px; max-width: 190px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text-2); font-weight: 750; cursor: pointer; }
.complete-button.done { border-color: color-mix(in srgb, var(--success) 35%, var(--line)); background: color-mix(in srgb, var(--success) 10%, var(--surface)); color: var(--success); }
.context-callout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; margin-top: 18px; padding: 18px 20px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line)); border-radius: 16px; background: linear-gradient(110deg, var(--primary-soft), var(--surface)); }
.context-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--surface); color: var(--primary); font-size: 22px; font-weight: 800; }
.context-callout p { margin: 0; color: var(--text-2); }
.objectives-panel { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 30px; margin-top: 18px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.objectives-panel h2 { margin: 0; font-size: 22px; }
.objectives-panel ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.objectives-panel li { display: flex; align-items: flex-start; gap: 8px; padding: 11px; border-radius: 11px; background: var(--surface-2); color: var(--text-2); font-size: 12px; }
.objectives-panel li .icon { color: var(--success); margin-top: 1px; }
.learning-tabs { position: sticky; top: calc(var(--topbar) + 10px); z-index: 20; display: flex; gap: 6px; margin-top: 24px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow-sm); overflow-x: auto; }
.learning-tabs button { display: flex; align-items: center; gap: 7px; min-width: max-content; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.learning-tabs button b { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--bg-soft); font-size: 10px; }
.learning-tabs button.active { background: var(--primary-soft); color: var(--primary); }
.learning-surface { margin-top: 16px; }
.learning-object { position: relative; padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.learning-object + .learning-object { margin-top: 16px; }
.learning-object-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.learning-object-meta > span:last-child { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.object-heading { max-width: 860px; }
.object-heading p { font-size: 16px; }
.theory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 28px; }
.theory-grid section { position: relative; min-height: 210px; padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.section-index { color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.theory-grid h3 { margin-top: 35px; }
.theory-grid p { margin: 0; font-size: 14px; }
.takeaway { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding: 13px 15px; border-radius: 12px; background: var(--primary-soft); color: var(--text-2); }
.takeaway .icon { color: var(--primary); margin-top: 1px; }
.table-wrap { overflow-x: auto; margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
caption { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--surface-2); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border-bottom: 0; }
.lecturer-note { border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); background: color-mix(in srgb, var(--amber) 5%, var(--surface)); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.grow { flex: 1; }
.field > span, .scale-field legend { color: var(--text-2); font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); outline: 0; }
input, select { min-height: 42px; padding: 8px 10px; }
textarea { padding: 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent); }
.classifier-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-top: 22px; }
.classification-result, .quiz-feedback { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; padding: 13px 15px; border-radius: 12px; }
.classification-result.correct, .quiz-feedback.correct { background: color-mix(in srgb, var(--success) 10%, var(--surface)); color: var(--success); }
.classification-result.incorrect, .quiz-feedback.incorrect { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); }
.classification-result span, .quiz-feedback span { color: var(--text-2); }
.classifier-grid + .inline-actions { margin-top: 14px; }
.data-lab { margin-top: 22px; }
.data-controls { display: flex; align-items: flex-end; gap: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.metric span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.metric b { overflow: hidden; color: var(--text); font-size: 22px; text-overflow: ellipsis; }
.metric small { color: var(--muted); }
.chart-panel { margin-top: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.data-chart, .scatter-chart { width: 100%; max-height: 310px; }
.chart-bar { fill: var(--primary); opacity: .82; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { stroke: var(--line-strong); stroke-width: 1.5; }
.chart-label { fill: var(--muted); font: 11px var(--font); }
.scatter-dot { fill: var(--cyan); stroke: var(--surface); stroke-width: 2; opacity: .8; }
.chart-empty { display: grid; place-items: center; min-height: 180px; color: var(--muted); }

.quiz-shell { margin-top: 20px; }
.quiz-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.quiz-header h3 { margin-top: 9px; }
.pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.pill.lecturer { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); color: var(--amber); }
.quiz-score { color: var(--muted); }
.quiz-score b { color: var(--text); }
.quiz-progress { overflow: hidden; height: 5px; margin: 5px 0 24px; border-radius: 999px; background: var(--bg-soft); }
.quiz-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--cyan)); }
.quiz-prompt { color: var(--text); font-size: 20px; font-weight: 700; }
.quiz-options { display: grid; gap: 9px; margin-top: 17px; }
.quiz-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text-2); cursor: pointer; text-align: left; }
.quiz-option > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.quiz-option:hover:not(:disabled), .quiz-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.quiz-option.correct { border-color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.quiz-option.incorrect { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.quiz-actions { display: flex; gap: 9px; margin-top: 16px; }
.quiz-finished { display: flex; align-items: center; gap: 24px; min-height: 220px; margin-top: 20px; padding: 24px; border-radius: 16px; background: var(--surface-2); }
.result-ring { --p: 0; display: grid; place-items: center; width: 130px; height: 130px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.result-ring::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.result-ring span { position: relative; z-index: 1; font-size: 26px; font-weight: 850; }

.simple-hero { min-height: 245px; display: flex; flex-direction: column; justify-content: center; }
.library-controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; }
.search-field { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 650px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search-field input { border: 0; box-shadow: none; background: transparent; }
.filter-buttons { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.filter-buttons button { padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.filter-buttons button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.library-results { margin-top: 28px; }
.library-group + .library-group { margin-top: 40px; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.library-card { display: flex; flex-direction: column; min-height: 230px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: .18s ease; }
.library-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
.library-card-head { display: flex; justify-content: space-between; color: var(--primary); }
.library-card h3 { margin-top: 18px; }
.library-card p { flex: 1; }
.usage-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.usage-mini span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.usage-mini b { color: var(--primary); }

.activity-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.activity-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; min-height: 245px; padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); cursor: pointer; transition: .18s ease; }
.activity-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.activity-card-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.activity-card h2 { margin-top: 12px; }
.activity-card-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); }
.activity-card-footer span { display: inline-flex; align-items: center; gap: 6px; }
.activity-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 27px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(115deg, var(--primary-soft), var(--surface)); }
.activity-hero h2 { margin-bottom: 5px; }
.activity-hero p { margin: 0; }
.session-code-card { display: flex; flex-direction: column; align-items: center; min-width: 175px; padding: 15px 18px; border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line)); border-radius: 14px; background: var(--surface); }
.session-code-card span, .session-code-card small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.session-code-card b { margin: 3px 0; color: var(--primary); font: 800 26px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; }
.activity-layout { display: grid; grid-template-columns: minmax(320px, .75fr) minmax(0, 1.25fr); gap: 16px; margin-top: 16px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-heading.split { align-items: center; }
.panel-heading h3, .panel-heading h2 { margin: 7px 0 0; }
.activity-form { display: grid; gap: 14px; }
.scale-field { margin: 0; padding: 0; border: 0; }
.scale-labels { display: flex; justify-content: space-between; margin: 6px 0; color: var(--muted); font-size: 10px; }
.scale-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale-options label { position: relative; cursor: pointer; }
.scale-options input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; cursor: pointer; }
.scale-options span { display: grid; place-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-weight: 750; }
.scale-options input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.privacy-note { display: flex; align-items: flex-start; gap: 8px; padding: 11px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.activity-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.results-grid { display: grid; grid-template-columns: minmax(240px, .65fr) minmax(0, 1.35fr); gap: 10px; margin-bottom: 14px; }
.result-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.result-card h4 { margin-bottom: 12px; }
.choice-chart { display: grid; gap: 9px; }
.choice-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 24px; align-items: center; gap: 8px; font-size: 11px; }
.choice-row > div { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.choice-row i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--cyan)); }
.empty-mini { display: grid; place-items: center; min-height: 300px; color: var(--muted); text-align: center; }
.student-activity-summary p { margin-bottom: 20px; }
.activity-placeholder { display: grid; place-items: center; min-height: 260px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); }

.progress-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.big-progress { display: grid; padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.big-progress b { font-size: 44px; letter-spacing: -.04em; }
.big-progress span { color: var(--text-2); font-weight: 750; }
.big-progress small { color: var(--muted); }
.progress-subjects { display: grid; gap: 10px; }
.progress-subjects article { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(180px, .5fr); align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.progress-subjects h3, .progress-subjects p { margin: 0; }
.attempt-list { display: grid; gap: 8px; }
.attempt-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.attempt-list small { color: var(--muted); }
.danger-zone { margin-top: 35px; padding-top: 20px; border-top: 1px solid var(--line); }

.lecturer-hero { border-color: color-mix(in srgb, var(--amber) 25%, var(--line)); background: linear-gradient(110deg, color-mix(in srgb, var(--amber) 7%, var(--surface)), var(--surface)); }
.lecturer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 18px; }
.lecturer-grid + .panel, .validation-panel + .panel, .panel + .panel { margin-top: 15px; }
.definition-list { margin: 0; }
.definition-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.definition-list > div:last-child { border-bottom: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; font-weight: 750; }
.count-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.count-grid > div { display: flex; flex-direction: column; padding: 12px; border-radius: 11px; background: var(--surface-2); }
.count-grid b { font-size: 24px; }
.count-grid span { color: var(--muted); font-size: 10px; }
.validation-ok { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); }
.validation-panel ul, .warning-block ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.warning-block { margin-top: 16px; padding: 15px; border-radius: 12px; background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.warning-block h3 { color: var(--amber); }
.proof-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.proof-list > div { display: flex; align-items: flex-start; gap: 9px; padding: 13px; border-radius: 11px; background: var(--surface-2); color: var(--text-2); }
.proof-list .icon { color: var(--success); }
.translation-table { display: grid; gap: 7px; }
.translation-row { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(90px, .45fr)); align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.translation-row.header { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.translation-row > span { display: flex; justify-content: center; }
.translation-row > span:first-child { justify-content: flex-start; }
.draft-list { display: grid; gap: 7px; }
.draft-list > div { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); }
.draft-list > div > span:first-child { color: var(--muted); font-size: 10px; text-transform: uppercase; }

.toast-region { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: grid; gap: 8px; pointer-events: none; }
.toast { opacity: 0; transform: translateY(8px); min-width: 230px; max-width: 380px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-lg); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: color-mix(in srgb, var(--success) 35%, var(--line)); }
.toast-warning { border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.fatal-error { width: min(900px, calc(100% - 40px)); margin: 80px auto; padding: 30px; border: 1px solid var(--danger); border-radius: 16px; background: var(--surface); }
.fatal-error pre { overflow: auto; padding: 12px; background: var(--surface-2); }

@media (max-width: 1180px) {
  .topbar-controls .compact-select span { display: none; }
  .role-switch span { display: none; }
  .hero-panel { grid-template-columns: 1fr; }
  .architecture-visual { min-height: 300px; }
  .offering-card { grid-template-columns: 1fr; }
  .subject-progress-card { position: static; width: 100%; max-width: 300px; margin-top: 20px; }
  .subject-hero { display: flex; flex-direction: column; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .objectives-panel ul { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow-lg); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim { position: fixed; inset: 0; z-index: 35; display: block; opacity: 0; pointer-events: none; background: rgba(2, 6, 23, .45); transition: opacity .2s ease; }
  .mobile-scrim.show { opacity: 1; pointer-events: auto; }
  .workspace { margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 18px; }
  .main-content, .site-footer { width: min(100% - 30px, 1260px); }
  .subject-grid, .activity-card-grid { grid-template-columns: 1fr; }
  .shared-topic-band { grid-template-columns: auto minmax(0, 1fr); }
  .reuse-list { grid-column: 1 / -1; min-width: 0; }
  .offering-meta { grid-template-columns: 1fr; }
  .activity-layout { grid-template-columns: 1fr; }
  .theory-grid { grid-template-columns: 1fr; }
  .theory-grid section { min-height: 0; }
  .objectives-panel { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lecturer-grid { grid-template-columns: 1fr; }
  .count-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  :root { --topbar: 62px; }
  .main-content { padding-top: 22px; }
  .topbar-controls { gap: 5px; }
  .compact-select { padding: 5px; }
  .compact-select select { width: 48px; font-size: 11px; }
  .role-switch { display: none; }
  .page-identity b { max-width: 160px; }
  .hero-panel { min-height: 0; padding: 28px 22px; border-radius: 22px; }
  .architecture-visual { display: none; }
  .hero-copy p { font-size: 16px; }
  h1 { font-size: 39px; }
  .hero-facts { gap: 16px; }
  .shared-topic-band { grid-template-columns: 1fr; }
  .shared-icon { display: none; }
  .subject-hero-main { align-items: flex-start; }
  .subject-symbol.large { width: 54px; height: 54px; font-size: 25px; }
  .topic-row { grid-template-columns: 54px minmax(0, 1fr); }
  .topic-action { grid-column: 2; flex-direction: row; align-items: center; gap: 5px; }
  .topic-action .icon { margin: 0 0 0 auto; }
  .reuse-panel { align-items: flex-start; flex-direction: column; }
  .unit-card { grid-template-columns: 48px minmax(0, 1fr); }
  .unit-arrow { display: none; }
  .unit-hero-grid { grid-template-columns: 1fr; }
  .complete-button { max-width: none; }
  .classifier-grid { grid-template-columns: 1fr; }
  .data-controls { align-items: stretch; flex-direction: column; }
  .metric-grid, .activity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quiz-finished { flex-direction: column; text-align: center; }
  .library-controls { align-items: stretch; flex-direction: column; }
  .library-grid { grid-template-columns: 1fr; }
  .activity-hero { align-items: flex-start; flex-direction: column; }
  .session-code-card { width: 100%; }
  .progress-summary { grid-template-columns: 1fr; }
  .progress-subjects article { grid-template-columns: auto 1fr; }
  .progress-subjects .progress-wrap { grid-column: 1 / -1; }
  .attempt-list > div { grid-template-columns: 1fr auto; }
  .attempt-list small { grid-column: 1 / -1; }
  .proof-list { grid-template-columns: 1fr; }
  .translation-row { grid-template-columns: minmax(130px, 1fr) repeat(4, 50px); overflow-x: auto; }
  .translation-row .status-badge { width: 18px; min-width: 18px; height: 18px; padding: 0; overflow: hidden; color: transparent; }
  .translation-row .status-badge::after { content: '•'; color: currentColor; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 460px) {
  .topbar { padding: 0 10px; }
  .page-identity { display: none; }
  .install-button { display: none; }
  .main-content, .site-footer { width: calc(100% - 20px); }
  .hero-actions .button { width: 100%; }
  .subject-card { min-height: 250px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .count-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  .sidebar, .topbar, .site-footer, .learning-tabs, .button, .back-link { display: none !important; }
  .workspace { margin: 0; }
  .main-content { width: 100%; padding: 0; }
  body { background: white; color: black; }
  .learning-object, .subject-hero, .topic-hero, .unit-hero, .panel { break-inside: avoid; box-shadow: none; }
}

/* QuantValue Campus 0.2 additions */
.qv-tagline { display: inline-flex; margin-top: 8px; padding: 7px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 800; letter-spacing: .02em; }
.qv-hero .brand-mark, .architecture-visual .platform span { width: auto; min-width: 38px; padding: 0 7px; font-size: 13px; letter-spacing: -.03em; }
.subject-tabs { position: sticky; top: calc(var(--topbar) + 8px); z-index: 15; display: flex; gap: 6px; margin: 18px 0 22px; padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow-sm); backdrop-filter: blur(16px); overflow-x: auto; }
.subject-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1 0 auto; min-height: 42px; padding: 8px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 720; cursor: pointer; }
.subject-tabs button:hover { color: var(--text); background: var(--surface-2); }
.subject-tabs button.active { color: var(--primary); background: var(--primary-soft); }
.subject-tab-content { min-height: 300px; }
.next-event-card { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 18px; margin-top: 16px; padding: 20px 24px; border: 1px solid color-mix(in srgb, var(--cyan) 25%, var(--line)); border-radius: 18px; background: linear-gradient(120deg, color-mix(in srgb, var(--cyan) 8%, var(--surface)), var(--surface)); }
.next-event-card h3 { margin: 3px 0; }
.next-event-card p { margin: 0; }
.date-tile { display: grid; place-items: center; min-width: 66px; min-height: 66px; padding: 7px; border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); }
.date-tile b { color: var(--primary); font-size: 27px; line-height: 1; }
.date-tile span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(260px,.35fr); gap: 16px; margin-top: 16px; }
.course-map-mini { display: grid; gap: 8px; }
.course-map-mini button { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--text-2); cursor: pointer; text-align: left; }
.course-map-mini button:hover { border-color: var(--primary); background: var(--primary-soft); }
.course-map-mini button b { display: grid; place-items: center; width: 38px; height: 34px; border-radius: 9px; color: var(--primary); background: var(--surface); }
.course-map-mini button small { color: var(--muted); }
.progress-panel { display: grid; place-items: center; text-align: center; }
.big-progress-ring { --p:0; position: relative; display: grid; place-items: center; width: 136px; height: 136px; margin: 14px auto; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0); }
.big-progress-ring::after { content:''; position:absolute; inset:13px; border-radius:inherit; background:var(--surface); }
.big-progress-ring span { position:relative; z-index:1; font-size:28px; font-weight:850; }
.topic-use-card { display: grid; grid-template-columns: 66px minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: .18s ease; }
.topic-use-card:hover { transform: translateX(3px); border-color: color-mix(in srgb,var(--primary) 35%,var(--line)); }
.topic-use-card.is-draft { border-style: dashed; opacity:.86; }
.topic-use-body p { margin: 6px 0 9px; }
.topic-card-heading { display: flex; justify-content: space-between; gap: 15px; }
.topic-card-heading h3 { margin:0; font-size:22px; }
.delivery-note { display:flex; align-items:flex-start; gap:7px; color:var(--muted); font-size:12px; }
.topic-meta { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.topic-meta span { display:inline-flex; align-items:center; gap:5px; padding:5px 8px; border-radius:8px; background:var(--surface-2); color:var(--muted); font-size:10px; }
.topic-delivery-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-top:24px; max-width:780px; }
.topic-delivery-grid span { display:flex; flex-direction:column; gap:3px; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
.topic-delivery-grid small { color:var(--muted); text-transform:uppercase; font-size:9px; letter-spacing:.07em; }
.calendar-panel { padding: 26px; }
.calendar-range { color:var(--muted); font-size:12px; }
.calendar-list { display:grid; gap:8px; }
.calendar-row { display:grid; grid-template-columns:88px minmax(0,1fr); gap:15px; padding:15px; border:1px solid var(--line); border-left:4px solid var(--line-strong); border-radius:13px; background:var(--surface-2); }
.calendar-row.type-class { border-left-color:var(--primary); }
.calendar-row.type-assessment { border-left-color:var(--rose); }
.calendar-row.type-holiday { border-left-color:var(--amber); opacity:.83; }
.calendar-row.type-unavailable { border-left-color:var(--violet); background:color-mix(in srgb,var(--violet) 5%,var(--surface)); }
.calendar-row.type-deadline { border-left-color:var(--cyan); }
.calendar-date { display:flex; flex-direction:column; justify-content:center; border-right:1px solid var(--line); }
.calendar-date b { font-size:22px; }
.calendar-date span { color:var(--muted); font-size:10px; text-transform:uppercase; }
.calendar-event h3 { margin:5px 0 2px; font-size:17px; }
.calendar-event p { margin:0; font-size:12px; }
.event-type { color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.topic-chip { display:inline-flex; margin-left:6px; padding:2px 6px; border-radius:6px; background:var(--primary-soft); color:var(--primary); font-size:9px; font-weight:800; }
.assessment-summary { display:grid; grid-template-columns:220px minmax(0,1fr); gap:18px; align-items:start; }
.assessment-ring { display:grid; place-items:center; min-height:220px; border:1px solid var(--line); border-radius:22px; background:conic-gradient(var(--primary) 60%,var(--cyan) 60% 75%,var(--violet) 75% 90%,var(--emerald) 90%); color:white; box-shadow:var(--shadow); }
.assessment-ring span { font-size:42px; font-weight:850; }
.assessment-ring small { margin-top:-55px; font-weight:700; }
.assessment-cards { display:grid; gap:10px; }
.assessment-card { display:grid; grid-template-columns:78px minmax(0,1fr); gap:15px; padding:18px; border:1px solid var(--line); border-radius:15px; background:var(--surface); }
.assessment-weight { display:grid; place-items:center; min-height:68px; border-radius:13px; background:var(--primary-soft); color:var(--primary); font-size:24px; font-weight:850; }
.assessment-card h3 { margin:2px 0 5px; }
.assessment-card p { margin:0; }
.mini-rules { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 0; }
.mini-rules div { padding:7px 9px; border-radius:8px; background:var(--surface-2); }
.mini-rules dt { color:var(--muted); font-size:9px; text-transform:uppercase; }
.mini-rules dd { margin:0; font-weight:800; }
.rule-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.rule-grid article { display:flex; gap:10px; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.rule-grid article .icon { color:var(--success); }
.rule-grid h3 { margin:0 0 4px; font-size:15px; }
.rule-grid p { margin:0; font-size:12px; }
.extra-credit { display:flex; align-items:center; gap:12px; margin-top:14px; padding:15px; border:1px solid color-mix(in srgb,var(--emerald) 25%,var(--line)); border-radius:13px; background:color-mix(in srgb,var(--emerald) 7%,var(--surface)); }
.extra-credit div { display:flex; flex-direction:column; flex:1; }
.extra-credit span { color:var(--muted); }
.extra-credit strong { color:var(--emerald); font-size:25px; }
.resource-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.resource-card { display:grid; grid-template-columns:auto minmax(0,1fr); gap:15px; min-height:200px; padding:20px; border:1px solid var(--line); border-radius:17px; background:var(--surface); }
.resource-icon { display:grid; place-items:center; width:50px; height:50px; border-radius:14px; background:var(--primary-soft); color:var(--primary); }
.resource-head { display:flex; align-items:center; gap:8px; }
.resource-card h3 { margin:10px 0 5px; }
.resource-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:13px; }
.resource-availability { color:var(--muted); font-size:11px; }
.unit-list { display:grid; gap:10px; }
.unit-card { grid-template-columns:58px minmax(0,1fr) auto; }
.unit-card.outline-unit { cursor:default; opacity:.76; border-style:dashed; }
.unit-card.outline-unit:hover { transform:none; box-shadow:none; border-color:var(--line); }
.unit-index { display:grid; place-items:center; width:50px; height:50px; border-radius:13px; background:var(--surface-2); color:var(--primary); font-weight:850; }
.unit-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.unit-heading h3 { margin:0; }
.unit-body p { margin:5px 0 9px; }
.objective-chips { display:flex; flex-wrap:wrap; gap:5px; }
.objective-chips span { padding:4px 7px; border-radius:7px; background:var(--surface-2); color:var(--muted); font-size:9px; }
.completed-chip { display:inline-flex; align-items:center; gap:4px; padding:4px 8px; border-radius:999px; background:color-mix(in srgb,var(--success) 10%,var(--surface)); color:var(--success); font-size:9px; font-weight:800; }
.outline-label { color:var(--muted); font-size:10px; }
.breadcrumbs { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin-bottom:14px; color:var(--muted); font-size:12px; }
.breadcrumbs button { padding:0; border:0; background:transparent; color:var(--primary); cursor:pointer; }
.complete-unit { position:absolute; right:34px; bottom:34px; z-index:2; }
.subject-context { margin-top:18px; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.subject-context span { color:var(--muted); font-size:9px; text-transform:uppercase; }
.subject-context b { display:block; margin-top:3px; }
.subject-context p { margin-top:4px; font-size:12px; }
.objectives-panel { display:grid; grid-template-columns:180px minmax(0,1fr); gap:20px; margin-top:16px; padding:18px 22px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.objectives-panel div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.objectives-panel p { display:flex; gap:7px; margin:0; padding:10px; border-radius:10px; background:var(--surface-2); }
.objectives-panel .icon { color:var(--success); }
.learning-stack { margin-top:16px; }
.learning-object header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:14px; align-items:start; }
.learning-object header h3 { margin:3px 0; }
.learning-object header p { margin:3px 0 0; }
.learning-object-icon { display:grid; place-items:center; width:43px; height:43px; border-radius:12px; background:var(--primary-soft); color:var(--primary); }
.theory-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.theory-grid article { min-height:155px; padding:19px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); }
.theory-grid article h4 { margin:0 0 9px; }
.theory-grid article p { margin:0; }
.example-callout { margin-top:18px; padding:18px; border-left:4px solid var(--cyan); border-radius:0 13px 13px 0; background:color-mix(in srgb,var(--cyan) 6%,var(--surface)); }
.takeaway { display:flex; gap:8px; margin-top:14px; padding:11px; border-radius:10px; background:color-mix(in srgb,var(--success) 8%,var(--surface)); color:var(--text-2); }
.takeaway .icon { color:var(--success); }
.table-wrap { overflow-x:auto; margin-top:14px; border:1px solid var(--line); border-radius:11px; }
.data-table { width:100%; border-collapse:collapse; min-width:620px; }
.data-table th,.data-table td { padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; }
.data-table th { background:var(--surface-2); color:var(--muted); font-size:10px; text-transform:uppercase; }
.data-table tr:last-child td { border-bottom:0; }
.interactive-mount,.quiz-mount { margin-top:18px; }
.activity-inline { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:18px; padding:17px; border-radius:13px; background:var(--primary-soft); }
.activity-inline p { margin:0; }
.video-placeholder { display:flex; gap:15px; align-items:center; margin-top:18px; padding:20px; border:1px dashed var(--line-strong); border-radius:14px; background:var(--surface-2); }
.video-placeholder > .icon { color:var(--primary); }
.video-placeholder p { margin:3px 0; }
.video-placeholder span { color:var(--muted); font-size:11px; }
.lecturer-note { margin-top:16px; padding:14px; border:1px solid color-mix(in srgb,var(--amber) 25%,var(--line)); border-radius:12px; background:color-mix(in srgb,var(--amber) 7%,var(--surface)); }
.library-search,.glossary-toolbar { display:flex; align-items:center; gap:10px; margin-top:20px; padding:8px 12px; border:1px solid var(--line); border-radius:13px; background:var(--surface); }
.library-search input,.glossary-toolbar input { flex:1; border:0; box-shadow:none; background:transparent; }
.library-search .button { flex:0 0 auto; }
.library-card .eyebrow { margin-top:15px; }
.library-card code { margin-top:12px; }
.glossary-toolbar > span:last-child { white-space:nowrap; color:var(--muted); font-size:12px; }
.glossary-list { display:grid; gap:10px; margin-top:18px; }
.glossary-list article { display:grid; grid-template-columns:46px minmax(0,1fr); gap:15px; padding:18px; border:1px solid var(--line); border-radius:15px; background:var(--surface); }
.glossary-letter { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; background:var(--primary-soft); color:var(--primary); font-size:20px; font-weight:850; }
.glossary-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.glossary-head h3 { margin:0; }
.glossary-list p { margin:5px 0 0; }
.related-links { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.related-links button { padding:5px 8px; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); color:var(--primary); font-size:10px; cursor:pointer; }
.interactive-grid { display:grid; grid-template-columns:minmax(260px,.42fr) minmax(0,.58fr); gap:14px; margin-top:18px; }
.control-card { display:grid; align-content:start; gap:15px; padding:18px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); }
.range-field { display:grid; gap:7px; }
.range-field > span { display:flex; justify-content:space-between; color:var(--text-2); font-size:12px; font-weight:700; }
.range-field input[type="range"] { min-height:24px; padding:0; border:0; box-shadow:none; accent-color:var(--primary); }
.compact-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:0; }
.distribution-chart,.interval-chart { width:100%; max-height:330px; }
.dist-bar,.hist-bar { fill:var(--primary); opacity:.72; }
.dist-bar.selected { fill:var(--rose); opacity:1; }
.bayes-result,.sample-size-result { display:grid; place-items:center; min-height:215px; padding:20px; border-radius:18px; background:linear-gradient(135deg,var(--primary),color-mix(in srgb,var(--primary) 55%,var(--cyan))); color:white; text-align:center; }
.bayes-result span,.sample-size-result span { font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.bayes-result b,.sample-size-result b { font-size:48px; line-height:1; }
.bayes-result small,.sample-size-result small { opacity:.82; }
.bayes-population { margin-top:14px; padding:17px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); }
.bayes-stack { display:flex; overflow:hidden; height:36px; border-radius:9px; background:var(--line); }
.bayes-stack div { display:grid; place-items:center; min-width:0; color:white; font-size:11px; font-weight:800; }
.bayes-true { background:var(--success); }
.bayes-false { background:var(--rose); }
.bayes-legend { display:flex; flex-wrap:wrap; gap:14px; margin:10px 0 3px; }
.bayes-legend span { display:inline-flex; align-items:center; gap:5px; color:var(--muted); font-size:11px; }
.bayes-legend i { width:9px; height:9px; border-radius:3px; }
.interval-line,.interval-cap { stroke:var(--primary); stroke-width:5; }
.interval-cap { stroke-width:3; }
.interval-point { fill:var(--rose); stroke:var(--surface); stroke-width:3; }
.planner-tabs { display:inline-flex; gap:5px; margin-top:18px; padding:5px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
.planner-tabs button { padding:8px 13px; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; }
.planner-tabs button.active { background:var(--surface); color:var(--primary); box-shadow:var(--shadow-sm); font-weight:800; }
.results-grid .wide-result { grid-column:1 / -1; }
.brand-mark { font-size:13px; letter-spacing:-.03em; }

@media (max-width: 980px) {
  .dashboard-grid,.assessment-summary,.interactive-grid { grid-template-columns:1fr; }
  .assessment-ring { min-height:150px; }
  .assessment-ring small { margin-top:-30px; }
  .resource-grid,.rule-grid { grid-template-columns:1fr; }
  .topic-delivery-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .subject-progress-card,.complete-unit { position:static; margin-top:20px; }
  .subject-hero { display:block; }
  .objectives-panel { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .subject-tabs { top:calc(var(--topbar) + 2px); }
  .subject-tabs button { flex:0 0 auto; }
  .offering-card,.assessment-card,.resource-card,.calendar-row,.topic-use-card,.unit-card { grid-template-columns:1fr; }
  .offering-meta,.topic-delivery-grid,.compact-metrics { grid-template-columns:1fr 1fr; }
  .topic-use-card > .icon { display:none; }
  .topic-code,.unit-index { width:46px; height:40px; }
  .theory-grid,.objectives-panel div { grid-template-columns:1fr; }
  .learning-object header { grid-template-columns:auto minmax(0,1fr); }
  .learning-object header code { grid-column:1/-1; }
  .activity-inline { align-items:flex-start; flex-direction:column; }
  .library-grid { grid-template-columns:1fr; }
  .glossary-list article { grid-template-columns:1fr; }
  .calendar-date { border-right:0; border-bottom:1px solid var(--line); padding-bottom:8px; }
  .qv-hero .hero-facts { gap:14px; }
}
[hidden] { display: none !important; }

/* 0.3 deep topic study guides */
.topic-guide-chip {
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-top:14px;
  padding:7px 10px;
  border:1px solid color-mix(in srgb,var(--primary) 20%,var(--line));
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:11px;
  font-weight:800;
  letter-spacing:.02em;
}
.topic-guide {
  margin-top:22px;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--surface);
  box-shadow:var(--shadow-sm);
  overflow:clip;
}
.topic-guide-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:28px;
  padding:28px 30px 24px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(135deg,color-mix(in srgb,var(--primary-soft) 70%,var(--surface)),var(--surface));
}
.topic-guide-header h2 { margin:4px 0 8px; font-size:30px; letter-spacing:-.035em; }
.topic-guide-header p { max-width:780px; margin:0; color:var(--text-2); font-size:15px; line-height:1.7; }
.guide-metrics { display:flex; gap:8px; flex:0 0 auto; }
.guide-metrics span {
  display:grid;
  grid-template-columns:auto auto;
  align-items:center;
  gap:2px 7px;
  min-width:94px;
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--surface);
  color:var(--muted);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.07em;
}
.guide-metrics span .icon { grid-row:1 / 3; color:var(--primary); }
.guide-metrics b { color:var(--text); font-size:17px; line-height:1; letter-spacing:-.02em; }
.topic-guide > .notice { margin:16px 30px 0; }
.topic-guide-layout { display:grid; grid-template-columns:245px minmax(0,1fr); align-items:start; }
.guide-toc {
  position:sticky;
  top:calc(var(--topbar) + 16px);
  display:grid;
  gap:5px;
  max-height:calc(100vh - var(--topbar) - 32px);
  overflow:auto;
  padding:26px 18px 28px 22px;
  border-right:1px solid var(--line);
}
.guide-toc > .eyebrow { padding:0 8px 8px; }
.guide-toc button {
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  align-items:start;
  gap:7px;
  width:100%;
  padding:9px 8px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  text-align:left;
  cursor:pointer;
  transition:.16s ease;
}
.guide-toc button:hover { background:var(--surface-2); color:var(--primary); }
.guide-toc button b { color:var(--primary); font-size:10px; letter-spacing:.06em; }
.guide-toc button span { font-size:11px; line-height:1.35; font-weight:700; }
.guide-article { min-width:0; padding:30px 34px 36px; }
.guide-opening {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-bottom:26px;
}
.guide-opening > div {
  padding:17px 18px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-2);
}
.guide-opening ul { margin:9px 0 0; padding-left:19px; color:var(--text-2); }
.guide-opening li + li { margin-top:5px; }
.guide-section {
  scroll-margin-top:calc(var(--topbar) + 24px);
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  gap:17px;
  padding:26px 0 30px;
  border-top:1px solid var(--line);
}
.guide-section:first-of-type { border-top:0; }
.guide-section-marker {
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:13px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
}
.guide-section-body h3 { margin:3px 0 12px; font-size:23px; letter-spacing:-.025em; }
.guide-section-body > p { max-width:880px; margin:0 0 12px; color:var(--text-2); font-size:15px; line-height:1.75; }
.guide-section-body .guide-lead { color:var(--text); font-size:17px; font-weight:650; line-height:1.55; }
.guide-bullets { display:grid; gap:7px; margin:14px 0 16px; padding-left:21px; color:var(--text-2); }
.guide-bullets li::marker { color:var(--primary); }
.guide-formula {
  margin:17px 0;
  padding:17px 19px;
  border:1px solid color-mix(in srgb,var(--primary) 20%,var(--line));
  border-radius:15px;
  background:linear-gradient(135deg,var(--primary-soft),var(--surface));
}
.guide-formula > span { display:block; margin-bottom:8px; color:var(--primary); font-size:10px; font-weight:850; text-transform:uppercase; letter-spacing:.09em; }
.formula-expression {
  overflow-x:auto;
  padding:7px 0;
  color:var(--text);
  font-family:"Cambria Math","STIX Two Math",Georgia,serif;
  font-size:22px;
  font-weight:650;
  letter-spacing:.01em;
  white-space:pre-wrap;
}
.guide-formula p { margin:7px 0 0; color:var(--muted); font-size:12px; line-height:1.55; }
.guide-example,.guide-callout {
  margin:15px 0 0;
  padding:15px 17px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-2);
}
.guide-example > div,.guide-callout > div { display:flex; align-items:center; gap:8px; color:var(--primary); }
.guide-example p,.guide-callout p { margin:7px 0 0; color:var(--text-2); line-height:1.62; }
.guide-callout.key { border-color:color-mix(in srgb,var(--success) 25%,var(--line)); background:color-mix(in srgb,var(--success) 6%,var(--surface)); }
.guide-callout.key > div { color:var(--success); }
.guide-callout.caution { border-color:color-mix(in srgb,var(--warning) 28%,var(--line)); background:color-mix(in srgb,var(--warning) 7%,var(--surface)); }
.guide-callout.caution > div { color:var(--amber); }
.guide-summary-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-top:28px;
  padding-top:26px;
  border-top:1px solid var(--line);
}
.guide-summary-grid section {
  min-width:0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--surface-2);
}
.guide-summary-grid h3 { margin:10px 0 8px; font-size:16px; }
.guide-summary-grid ul,.guide-summary-grid ol { margin:0; padding-left:20px; color:var(--text-2); font-size:12px; line-height:1.58; }
.guide-summary-grid li + li { margin-top:6px; }
.summary-icon { display:grid; place-items:center; width:35px; height:35px; border-radius:10px; background:color-mix(in srgb,var(--success) 12%,var(--surface)); color:var(--success); }
.summary-icon.warning { background:color-mix(in srgb,var(--warning) 12%,var(--surface)); color:var(--amber); }
.summary-icon.question { background:var(--primary-soft); color:var(--primary); }
.guide-provenance { display:flex; gap:12px; align-items:flex-start; margin-top:22px; padding:14px 16px; border:1px dashed var(--line-strong); border-radius:12px; color:var(--muted); font-size:11px; }
.guide-provenance span { display:flex; align-items:center; gap:6px; flex:0 0 auto; font-weight:800; text-transform:uppercase; letter-spacing:.07em; }
.guide-provenance p { margin:0; }
.topic-units-section { margin-top:28px; }

@media (max-width: 1050px) {
  .topic-guide-layout { grid-template-columns:1fr; }
  .guide-toc { position:static; display:flex; gap:7px; max-height:none; overflow-x:auto; padding:16px 22px; border-right:0; border-bottom:1px solid var(--line); }
  .guide-toc > .eyebrow { display:none; }
  .guide-toc button { flex:0 0 190px; }
}
@media (max-width: 760px) {
  .topic-guide-header { display:block; padding:22px; }
  .topic-guide-header h2 { font-size:25px; }
  .guide-metrics { margin-top:16px; }
  .guide-metrics span { min-width:0; flex:1; }
  .guide-article { padding:22px; }
  .guide-opening,.guide-summary-grid { grid-template-columns:1fr; }
  .guide-section { grid-template-columns:1fr; }
  .guide-section-marker { width:36px; height:36px; }
  .guide-section-body h3 { font-size:21px; }
  .formula-expression { font-size:18px; }
  .topic-guide > .notice { margin:14px 22px 0; }
}

/* QuantValue Campus 0.4 - deep Topic 2 units */
.taxonomy-tree,
.measure-taxonomy {
  margin: 8px 0 2px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.taxonomy-root,
.measure-taxonomy-root {
  width: max-content;
  margin: 0 auto;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .02em;
}
.taxonomy-line { width: 2px; height: 18px; margin: 0 auto; background: var(--line-strong); }
.taxonomy-branches { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.taxonomy-branches::before { content:""; position:absolute; left:25%; right:25%; top:-1px; height:2px; background:var(--line-strong); }
.taxonomy-branches article { position:relative; padding:15px; border:1px solid var(--line); border-radius:14px; background:var(--surface); text-align:center; }
.taxonomy-branches article::before { content:""; position:absolute; left:50%; top:-18px; width:2px; height:18px; background:var(--line-strong); }
.taxonomy-branches article > b { display:block; color:var(--primary); font-size:16px; }
.taxonomy-branches article > span { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.taxonomy-leaves { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:12px; }
.taxonomy-leaves i { padding:9px 8px; border-radius:10px; background:var(--primary-soft); color:var(--text); font-style:normal; font-weight:800; }
.taxonomy-leaves small { display:block; margin-top:2px; color:var(--muted); font-size:9px; font-weight:600; }
.measure-taxonomy-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; margin-top:16px; }
.measure-taxonomy-grid span { padding:12px 10px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.measure-taxonomy-grid b { display:block; color:var(--primary); font-size:12px; }
.measure-taxonomy-grid small { display:block; margin-top:4px; color:var(--muted); font-size:10px; line-height:1.35; }
.guide-table-wrap { overflow-x:auto; margin:6px 0; }
.guide-data-table { width:100%; min-width:520px; border-collapse:separate; border-spacing:0; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--surface); font-variant-numeric:tabular-nums; }
.guide-data-table th,.guide-data-table td { padding:9px 11px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); text-align:center; }
.guide-data-table tr > *:last-child { border-right:0; }
.guide-data-table tbody tr:last-child > * { border-bottom:0; }
.guide-data-table thead th { background:var(--primary-soft); color:var(--primary); font-weight:850; }
.guide-data-table tfoot th { background:var(--surface-2); font-weight:850; }
.guide-figure-variable-tree,
.guide-figure-measure-tree,
.guide-figure-frequency-table,
.guide-figure-contingency-table { grid-column:1/-1; }

.frequency-lab-grid,
.means-lab-grid {
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);
  gap:16px;
  align-items:start;
}
.frequency-table-panel,
.means-growth-panel,
.shape-interpretation,
.measure-formula-note {
  padding:16px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--surface-2);
}
.interactive-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
.interactive-heading h3 { margin:2px 0 0; }
.interactive-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.interactive-data-table { width:100%; min-width:560px; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.interactive-data-table th,.interactive-data-table td { padding:9px 10px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); text-align:center; white-space:nowrap; }
.interactive-data-table tr > *:last-child { border-right:0; }
.interactive-data-table thead th { position:sticky; top:0; z-index:1; background:var(--primary-soft); color:var(--primary); font-weight:850; }
.interactive-data-table tbody th,.interactive-data-table tfoot th { background:var(--surface-2); }
.interactive-data-table tfoot tr:last-child > * { border-bottom:0; }
.frequency-count-input { width:72px; padding:6px 7px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface); color:var(--text); text-align:center; }
.formula-strip { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.formula-strip span { padding:7px 10px; border-radius:9px; background:var(--primary-soft); color:var(--primary-2); font-family:"Cambria Math",Georgia,serif; font-size:12px; font-weight:700; }
.formula-strip.vertical { display:grid; }
.formula-strip.vertical span { width:100%; }

.gallery-filters { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:16px; }
.gallery-filters button { padding:8px 12px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--muted); cursor:pointer; }
.gallery-filters button.active { border-color:var(--primary); background:var(--primary-soft); color:var(--primary); font-weight:800; }
.chart-gallery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.chart-card { min-width:0; padding:17px; border:1px solid var(--line); border-radius:17px; background:var(--surface); box-shadow:var(--shadow-sm); }
.chart-card-heading { min-height:62px; }
.chart-card-heading h3 { margin:7px 0 0; font-size:18px; }
.chart-card-visual { display:grid; place-items:center; min-height:310px; margin-top:10px; padding:8px; border-radius:13px; background:var(--surface-2); overflow:hidden; }
.chart-card-visual > * { width:100%; max-width:100%; }
.chart-card dl { display:grid; gap:8px; margin:13px 0 0; }
.chart-card dl > div { display:grid; grid-template-columns:90px 1fr; gap:8px; }
.chart-card dt { color:var(--primary); font-size:11px; font-weight:850; text-transform:uppercase; letter-spacing:.05em; }
.chart-card dd { margin:0; color:var(--text-2); font-size:12px; line-height:1.5; }
.chart-title { fill:var(--text); font:700 13px var(--font); }
.chart-value { fill:var(--text-2); font:700 10px var(--font); }
.categorical-label { font-size:9px; }
.chart-legend { display:flex; flex-wrap:wrap; gap:7px 12px; color:var(--text-2); font-size:10px; }
.chart-legend.inline { justify-content:center; margin-top:-4px; }
.chart-legend span { display:flex; align-items:center; gap:5px; }
.chart-legend i { width:10px; height:10px; border-radius:3px; }
.donut-layout { display:grid; grid-template-columns:minmax(180px, .8fr) minmax(120px,.6fr); gap:6px; align-items:center; }
.donut-total { fill:var(--text); font:800 23px var(--font); }
.series-0 { stroke:var(--primary); fill:var(--primary); }
.series-1 { stroke:var(--cyan); fill:var(--cyan); }
.series-2 { stroke:var(--emerald); fill:var(--emerald); }
.series-3 { stroke:var(--amber); fill:var(--amber); }
.series-4 { stroke:var(--rose); fill:var(--rose); }
.series-5 { stroke:var(--violet); fill:var(--violet); }
.series-fill-0 { fill:var(--primary); }
.series-fill-1 { fill:var(--cyan); }
.series-fill-2 { fill:var(--emerald); }
.series-fill-3 { fill:var(--amber); }
.series-stroke-0 { stroke:var(--primary); }
.series-stroke-1 { stroke:var(--cyan); }
.series-stroke-2 { stroke:var(--emerald); }
.series-stroke-3 { stroke:var(--amber); }
.series-bg-0 { background:var(--primary); }
.series-bg-1 { background:var(--cyan); }
.series-bg-2 { background:var(--emerald); }
.series-bg-3 { background:var(--amber); }
.series-bg-4 { background:var(--rose); }
.series-bg-5 { background:var(--violet); }
.line-series { fill:none; stroke-width:3; stroke-linejoin:round; stroke-linecap:round; }
.line-dot { stroke:var(--surface); stroke-width:2; }
.box-line { stroke:var(--text-2); stroke-width:3; }
.box-rect { fill:color-mix(in srgb,var(--primary) 22%,var(--surface)); stroke:var(--primary); stroke-width:2; }
.box-median { stroke:var(--rose); stroke-width:4; }
.box-outlier { fill:var(--amber); stroke:var(--surface); stroke-width:2; }
.lorenz-line { fill:none; stroke:var(--primary); stroke-width:4; stroke-linejoin:round; }
.equality-line { stroke:var(--muted-2); stroke-width:2; stroke-dasharray:7 6; }
.map-region { stroke:var(--surface); stroke-width:4; }
.map-0 { fill:color-mix(in srgb,var(--emerald) 55%,var(--surface)); }
.map-1 { fill:color-mix(in srgb,var(--amber) 45%,var(--surface)); }
.map-2 { fill:color-mix(in srgb,var(--primary) 67%,var(--surface)); }
.map-3 { fill:color-mix(in srgb,var(--rose) 50%,var(--surface)); }

.measures-input-grid { align-items:stretch; }
.measure-formula-note { display:grid; align-content:center; gap:8px; }
.measure-formula-note b { color:var(--primary); font-family:"Cambria Math",Georgia,serif; font-size:22px; }
.measure-formula-note span { color:var(--text-2); font-family:"Cambria Math",Georgia,serif; font-size:15px; }
.measure-groups { display:grid; gap:14px; margin:18px 0; }
.measure-groups section { padding:15px; border:1px solid var(--line); border-radius:15px; background:var(--surface); }
.measure-groups h3 { margin:0 0 12px; font-size:16px; }
.two-chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.z-score-strip { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; padding:13px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); }
.z-score-strip b { width:100%; }
.z-score-strip span { padding:5px 8px; border-radius:8px; background:var(--surface); color:var(--text-2); font-family:"Cambria Math",Georgia,serif; font-size:11px; }
.shape-interpretation { display:grid; align-content:center; gap:5px; }
.shape-interpretation b { color:var(--primary); font-size:18px; }
.shape-interpretation span { color:var(--muted); font-family:"Cambria Math",Georgia,serif; }
.means-growth-panel { display:grid; grid-template-columns:1.25fr .75fr; gap:18px; margin-top:16px; }
.means-growth-panel h3 { margin:0 0 5px; }
.means-growth-panel p { margin:0 0 12px; color:var(--text-2); }

@media (max-width: 980px) {
  .measure-taxonomy-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .frequency-lab-grid,.means-lab-grid,.means-growth-panel,.two-chart-grid { grid-template-columns:1fr; }
  .chart-gallery { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
  .taxonomy-branches { grid-template-columns:1fr; }
  .taxonomy-branches::before { display:none; }
  .taxonomy-branches article::before { display:none; }
  .taxonomy-leaves,.measure-taxonomy-grid { grid-template-columns:1fr; }
  .chart-card { padding:12px; }
  .chart-card-visual { min-height:250px; padding:4px; }
  .chart-card dl > div { grid-template-columns:1fr; gap:2px; }
  .donut-layout { grid-template-columns:1fr; }
  .donut-chart { max-height:230px; }
  .interactive-data-table { min-width:500px; }
  .formula-strip span { font-size:10px; }
}

/* QuantValue Campus 0.5 · continuous topic study */
.topic-tabs { margin-top:18px; }
.topic-tab-content { margin-top:20px; }
.topic-study-index {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:10px;
  padding:18px;
  margin-bottom:24px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--surface);
  box-shadow:var(--shadow-sm);
}
.topic-study-index > .eyebrow { grid-column:1/-1; }
.topic-study-index button {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:54px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-2);
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.topic-study-index button:hover { border-color:var(--primary); transform:translateY(-1px); }
.topic-study-index button b { color:var(--primary); font-variant-numeric:tabular-nums; }
.topic-study-index button span { font-weight:700; }
.topic-study-chapters { display:grid; gap:34px; }
.topic-study-unit { scroll-margin-top:86px; }
.topic-study-unit-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:14px;
  padding:22px 24px;
  border-radius:18px;
  color:#fff;
  background:linear-gradient(135deg,#18213b,#293660);
}
.topic-study-unit-head h2 { margin:4px 0 6px; font-size:27px; letter-spacing:-.025em; }
.topic-study-unit-head p { max-width:760px; margin:0; color:#dce4ff; line-height:1.55; }
.topic-study-unit-head .eyebrow { color:#aebfff; }
.topic-study-unit-head .button { flex:0 0 auto; background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.28); color:#fff; }
.embedded-unit-guide { margin:0; }
.embedded-unit-guide .topic-guide-header { border-radius:18px 18px 0 0; }
.embedded-learning-stack { margin-top:16px; }
.topic-map-panel {
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(280px,.7fr);
  gap:22px;
  padding:28px;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--surface);
}
.topic-map-intro h2 { margin:6px 0 10px; font-size:30px; }
.topic-map-intro p { max-width:800px; color:var(--text-2); line-height:1.7; }
.topic-map-intro .button { margin-top:10px; }
.topic-map-facts { display:grid; gap:10px; }
.topic-map-facts span { padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); }
.topic-map-facts small { display:block; color:var(--text-3); }
.topic-map-facts b { display:block; margin-top:4px; font-size:21px; }
.practice-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }

@media (max-width:900px) {
  .topic-map-panel { grid-template-columns:1fr; }
  .topic-study-unit-head { display:block; }
  .topic-study-unit-head .button { margin-top:16px; }
}
@media (max-width:620px) {
  .topic-study-index { grid-template-columns:1fr; padding:12px; }
  .topic-study-unit-head { padding:18px; }
  .topic-study-unit-head h2 { font-size:23px; }
}

/* QuantValue Campus 0.5 · content workflow and review */
.workflow-overview { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:18px 0; }
.workflow-overview article { display:flex; gap:14px; padding:18px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.workflow-overview b { display:block; margin-bottom:5px; }
.workflow-overview p { margin:0; color:var(--text-2); line-height:1.5; }
.workflow-step { display:grid; place-items:center; flex:0 0 38px; height:38px; border-radius:12px; background:var(--primary-soft); color:var(--primary); font-weight:800; }
.content-workflow-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.workflow-panel { min-width:0; }
.installed-package-list { display:grid; gap:10px; }
.installed-package-list > div { display:flex; align-items:center; gap:12px; padding:13px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); }
.installed-package-list > div div { min-width:0; flex:1; }
.installed-package-list b,.installed-package-list code { display:block; }
.installed-package-list code { margin-top:3px; color:var(--text-3); font-size:11px; }
.package-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:10px; background:#1c2850; color:#fff; font-weight:800; }
.panel-note { margin:14px 0 0; color:var(--text-3); font-size:13px; line-height:1.5; }
.package-file-drop { display:block; margin-bottom:12px; cursor:pointer; }
.package-file-drop input { position:absolute; width:1px; height:1px; opacity:0; }
.package-file-drop span { display:flex; align-items:center; gap:12px; padding:18px; border:1px dashed var(--primary); border-radius:14px; background:var(--primary-soft); }
.package-file-drop b,.package-file-drop small { display:block; }
.package-file-drop small { margin-top:3px; color:var(--text-2); }
.workflow-field { display:grid; gap:5px; margin-bottom:12px; }
.workflow-field span { color:var(--text-3); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.workflow-field select { width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); }
.workflow-actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:14px; }
.mini-package-facts { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:16px 0 0; }
.mini-package-facts div { padding:10px; border-radius:10px; background:var(--surface-2); }
.mini-package-facts dt { color:var(--text-3); font-size:11px; }
.mini-package-facts dd { margin:3px 0 0; font-weight:700; }
.package-inspection { margin-top:16px; padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); }
.package-inspection header { display:flex; justify-content:space-between; gap:12px; }
.package-inspection h3 { margin:4px 0; }
.package-inspection p { margin:0; color:var(--text-3); }
.package-change-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:14px; }
.package-change-grid article { min-width:0; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--surface); }
.package-change-grid article>b { display:block; font-size:24px; }
.package-change-grid article>span { color:var(--text-3); font-size:12px; }
.package-change-grid ul { max-height:130px; overflow:auto; margin:9px 0 0; padding-left:17px; }
.package-change-grid code { font-size:10px; word-break:break-all; }
.workflow-loading { padding:16px; color:var(--text-2); }
.notice-success { background:#edf9f2; border-color:#9bd6b5; color:#1f6b43; }
.notice-error { background:#fff0f0; border-color:#efb0b0; color:#9b2c2c; }
.visibility-panel { margin:0 0 16px; padding:20px; }
.visibility-intro { max-width:900px; margin:0 0 16px; color:var(--text-2); line-height:1.55; }
.visibility-toolbar { display:grid; grid-template-columns:minmax(260px,420px) 1fr; align-items:end; gap:18px; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); }
.visibility-toolbar .workflow-field { margin:0; }
.visibility-legend { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:12px; padding-bottom:10px; color:var(--text-3); font-size:12px; font-weight:700; }
.visibility-legend span { display:inline-flex; align-items:center; gap:6px; }
.visibility-dot { width:9px; height:9px; border-radius:50%; background:var(--muted); }
.visibility-dot.published { background:#2f9b66; }
.visibility-dot.outline { background:#c88a20; }
.visibility-dot.draft { background:#8d96a9; }
.visibility-dot.archived { background:#8a5ca8; }
.visibility-tree { margin-top:14px; border:1px solid var(--line); border-radius:15px; overflow:hidden; background:var(--surface); }
.visibility-subject-row,.visibility-topic-row,.visibility-unit-row { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.visibility-subject-row { padding:16px 18px; background:linear-gradient(110deg,var(--primary-soft),var(--surface)); }
.visibility-topic { border-top:1px solid var(--line); }
.visibility-topic-row { padding:14px 18px; background:var(--surface-2); }
.visibility-unit-list { padding-left:34px; }
.visibility-unit-row { min-height:68px; padding:10px 18px 10px 14px; border-top:1px solid var(--line); }
.visibility-row-main { display:flex; align-items:center; gap:12px; min-width:0; }
.visibility-row-main>div { min-width:0; }
.visibility-row-main b,.visibility-row-main code,.visibility-row-main .visibility-level { display:block; }
.visibility-row-main b { overflow:hidden; text-overflow:ellipsis; }
.visibility-row-main code { margin-top:3px; color:var(--text-3); font-size:10px; }
.visibility-level { margin-bottom:3px; color:var(--text-3); font-size:10px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.visibility-code,.visibility-unit-index { display:grid; place-items:center; flex:0 0 38px; height:38px; border-radius:10px; background:var(--surface); color:var(--primary); font-size:12px; font-weight:800; }
.visibility-unit-index { width:32px; flex-basis:32px; height:32px; background:var(--surface-2); color:var(--text-3); }
.visibility-status { width:172px; flex:0 0 172px; padding:9px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); font:inherit; font-size:12px; font-weight:700; }
.visibility-savebar { position:sticky; bottom:10px; z-index:8; display:flex; align-items:center; justify-content:space-between; gap:18px; margin:14px 0 0; padding:13px 15px; border:1px solid color-mix(in srgb,var(--primary) 25%,var(--line)); border-radius:14px; background:color-mix(in srgb,var(--surface) 92%,var(--primary-soft)); box-shadow:0 8px 30px rgb(20 30 60 / 12%); }
.visibility-savebar b,.visibility-savebar small { display:block; }
.visibility-savebar small { margin-top:3px; color:var(--text-3); }
.visibility-savebar .workflow-actions { margin:0; }
.visibility-preview { margin-top:14px; }
.visibility-preview-card { padding:17px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); }
.visibility-preview-card>header { display:flex; justify-content:space-between; gap:14px; }
.visibility-preview-card h3 { margin:4px 0; }
.visibility-preview-card p { margin:0; color:var(--text-3); }
.visibility-preview-counts { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:14px; }
.visibility-preview-counts span { padding:11px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text-3); font-size:11px; }
.visibility-preview-counts b { display:block; color:var(--text); font-size:21px; }
.visibility-preview-list { display:grid; gap:7px; margin-top:12px; }
.visibility-preview-list>div { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:12px; align-items:center; padding:9px 11px; border-radius:9px; background:var(--surface); }
.visibility-preview-list .is-hidden { opacity:.55; }
.visibility-preview-list span,.visibility-preview-list small { color:var(--text-3); font-size:11px; }
.review-mode-panel { margin-bottom:16px; }
.review-control { display:none; clear:both; margin:12px 0 4px; padding:10px; border:1px solid #aebbf0; border-radius:11px; background:#f3f5ff; color:#172033; }
.review-mode .review-control { display:block; }
.review-control-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.review-control code { color:#5269d8; font-size:10px; word-break:break-all; }
.review-control select { padding:7px 9px; border:1px solid #cbd3ee; border-radius:8px; background:#fff; }
.review-control textarea { display:block; width:100%; margin-top:8px; padding:9px; border:1px solid #cbd3ee; border-radius:8px; resize:vertical; font:inherit; }
.review-control[data-reviewed="approve"] { border-color:#7bc39b; background:#edf9f2; }
.review-control[data-reviewed="revise"],.review-control[data-reviewed="remove"] { border-color:#e2aa75; background:#fff7ed; }
.review-control[data-reviewed="question"] { border-color:#b59be8; background:#f7f2ff; }

@media (max-width:900px) {
  .workflow-overview,.content-workflow-grid { grid-template-columns:1fr; }
  .visibility-toolbar { grid-template-columns:1fr; }
  .visibility-legend { justify-content:flex-start; padding:0; }
  .visibility-preview-counts { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:620px) {
  .package-change-grid,.mini-package-facts { grid-template-columns:1fr; }
  .review-control-head { align-items:stretch; flex-direction:column; }
  .visibility-subject-row,.visibility-topic-row,.visibility-unit-row,.visibility-savebar { align-items:stretch; flex-direction:column; }
  .visibility-unit-list { padding-left:16px; }
  .visibility-status { width:100%; flex-basis:auto; }
  .visibility-savebar .workflow-actions { width:100%; }
  .visibility-savebar .button { flex:1; }
  .visibility-preview-list>div { grid-template-columns:1fr; gap:3px; }
}
.histogram-bar { fill: var(--accent); stroke: var(--surface); stroke-width: 1; }

/* QuantValue Campus 0.4.1 - detailed Descriptive Statistics laboratories */
.histogram-frequency-bar {
  fill: color-mix(in srgb, var(--primary) 75%, var(--cyan));
  stroke: var(--surface);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.grouped-histogram .chart-label { font-size: 10px; }

.classification-prompt {
  margin-bottom: 16px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
}
.classification-prompt h3 { margin: 4px 0 6px; font-size: 23px; }
.classification-prompt p { margin: 0; color: var(--text-2); }
.deep-classifier { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.classification-correct-path { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 10px 0; }
.classification-correct-path span { padding: 6px 9px; border-radius: 999px; background: var(--surface); color: var(--primary); font-weight: 800; }
.classification-correct-path i { color: var(--muted); font-style: normal; }
.classification-result p { margin: 7px 0 0; line-height: 1.55; }

.interactive-data-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.frequency-definitions { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.frequency-definitions summary,
.formula-reference summary { color: var(--primary); cursor: pointer; font-weight: 800; }
.frequency-definitions > div { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 9px; }
.frequency-definitions p { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 11px; line-height: 1.45; }
.frequency-definitions p b { display: block; margin-bottom: 2px; color: var(--primary); font-family: "Cambria Math", Georgia, serif; font-size: 14px; }
.conditional-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.independence-callout { margin: 0 0 14px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--cyan) 35%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--cyan) 9%, var(--surface)); }
.independence-callout p { margin: 5px 0; color: var(--text-2); }
.independence-callout small { color: var(--muted); line-height: 1.45; }

.measure-formula-note p { margin: 2px 0 0; color: var(--text-2); line-height: 1.55; }
.measure-taxonomy-inline { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 9px; margin: 17px 0; }
.measure-taxonomy-inline span { padding: 12px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.measure-taxonomy-inline b { display: block; color: var(--primary); font-size: 12px; }
.measure-taxonomy-inline small { display: block; margin-top: 4px; color: var(--muted); font-family: "Cambria Math", Georgia, serif; font-size: 10px; line-height: 1.35; }
.formula-reference { margin: 17px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.formula-reference-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.formula-reference-grid span { padding: 9px 10px; border-radius: 10px; background: var(--surface); color: var(--text-2); font-family: "Cambria Math", Georgia, serif; font-size: 11px; line-height: 1.45; }
.formula-reference-grid b { display: block; margin-bottom: 3px; color: var(--primary); font-family: var(--font); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.rank-table-panel { margin-top: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.rank-table-panel h3 { margin: 0 0 11px; font-size: 16px; }
.rank-table { min-width: 420px; }

@media (max-width: 980px) {
  .deep-classifier { grid-template-columns: 1fr; }
  .measure-taxonomy-inline { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .formula-reference-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .frequency-definitions > div,
  .measure-taxonomy-inline,
  .formula-reference-grid { grid-template-columns: 1fr; }
  .classification-prompt h3 { font-size: 19px; }
  .classification-correct-path { align-items: flex-start; }
  .classification-correct-path i { display: none; }
}
/* Mobile containment for deep study guides */
.guide-section-body,
.guide-figures,
.guide-figure,
.guide-comparison,
.guide-formula,
.guide-example,
.guide-callout,
.guide-mini-check,
.guide-table-wrap {
  min-width: 0;
  max-width: 100%;
}
.guide-section-body { width: 100%; }
.guide-figure { overflow: hidden; }
.guide-table-wrap { width: 100%; }
@media (max-width: 760px) {
  .guide-section { min-width: 0; }
  .guide-section-body { overflow: hidden; }
  .guide-toc { max-width: 100%; }
}

/* Preserve mathematical case in statistical notation. Generic interface labels may be
   uppercase elsewhere, but x(i), n_i, f_i, a_x and related symbols are case-sensitive. */
.metric span {
  text-transform: none;
  letter-spacing: .035em;
}
.interactive-data-table th,
.guide-data-table th,
.rank-table th,
.formula-reference-grid b {
  text-transform: none;
  letter-spacing: 0;
}

/* QuantValue Campus 0.4.2 - robust mobile containment for interactive laboratories */
.learning-stack,
.learning-object,
.learning-object > *,
.interactive-mount,
.interactive-mount > *,
.frequency-lab-grid,
.frequency-lab-grid > *,
.frequency-table-panel,
.chart-panel,
.chart-card,
.chart-card-visual,
.interactive-table-wrap {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.frequency-table-panel,
.chart-panel,
.interactive-table-wrap {
  width: 100%;
}
.interactive-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.chart-panel svg,
.chart-card svg,
.chart-card-visual svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
@media (max-width: 620px) {
  .learning-object {
    overflow: hidden;
    padding-inline: 16px;
  }
  .frequency-table-panel,
  .chart-panel {
    padding: 12px;
  }
  .interactive-table-wrap {
    max-width: 100%;
  }
}
