:root {
  --ink: #172026;
  --muted: #64717c;
  --line: #d7dee5;
  --panel: #ffffff;
  --bg: #f4f7f9;
  --nav: #132230;
  --accent: #1768c7;
  --accent-dark: #0f4f9f;
  --warn: #b15f21;
  --danger: #b83a3a;
  --ok: #1768c7;
  --soft: #eaf3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

button,
input {
  font: inherit;
}

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

body.focus-mode .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  color: #fff;
  background: var(--nav);
  overflow-y: auto;
  transition: padding 180ms ease;
}

body.focus-mode .sidebar {
  padding: 18px 14px;
  overflow-x: hidden;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
  min-width: 0;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
}

.brand h1,
.page-header h2 {
  margin: 0;
}

.brand h1 {
  max-width: 190px;
  font-size: 22px;
  line-height: 1.22;
  white-space: normal;
}

body.focus-mode .brand {
  justify-content: center;
  margin-bottom: 22px;
}

body.focus-mode .brand-logo {
  width: 48px;
  height: 48px;
}

body.focus-mode .brand > div,
body.focus-mode .profile-card,
body.focus-mode .nav-item {
  font-size: 0;
}

body.focus-mode .brand > div,
body.focus-mode .profile-card {
  display: none;
}

body.focus-mode .nav {
  gap: 10px;
}

body.focus-mode .nav-item {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0;
  text-align: center;
  line-height: 1;
}

body.focus-mode .nav-item::before {
  content: attr(data-short);
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

body.focus-mode #toggleModuleList {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,0.06);
  text-align: left;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: var(--accent);
}

.profile-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

.profile-card label {
  font-size: 12px;
  color: rgba(255,255,255,0.74);
}

.profile-card input {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: #fff;
  background: rgba(0,0,0,0.18);
}

main {
  min-width: 0;
  padding: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-header h2 {
  max-width: 880px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.24;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.page-header .eyebrow {
  color: var(--accent-dark);
}

.progress-card,
.test-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.compact-button {
  min-width: 118px;
  min-height: 48px;
  white-space: nowrap;
}

.secondary.compact-button {
  min-height: 48px;
  padding: 0 18px;
}

.progress-card {
  min-width: 118px;
}

.progress-card span {
  font-size: 18px;
  font-weight: 700;
}

.test-meta span {
  color: var(--muted);
}

.learning-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 18px;
  transition: grid-template-columns 160ms ease;
}

.learning-layout.content-started,
.learning-layout.modules-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
}

.learning-layout.content-started .module-list,
.learning-layout.modules-collapsed .module-list {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.module-list,
.module-intro,
.module-detail,
.admin-panel,
.result-summary,
.wrong-note,
.quiz-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.module-list {
  overflow: hidden;
  transition: opacity 140ms ease;
}

.module-intro {
  padding: 0;
  overflow: hidden;
}

.learning-layout.content-started .module-intro {
  display: none;
}

.module-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.module-card:last-child {
  border-bottom: 0;
}

.module-card.active {
  background: var(--soft);
}

.module-card strong {
  font-size: 14px;
  line-height: 1.38;
}

.module-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-detail {
  padding: 22px;
}

.module-detail:empty {
  display: none;
}

.intro-hero {
  display: flex;
  flex-direction: column;
  min-height: min(720px, calc(100vh - 176px));
  padding: 32px;
}

.intro-hero h3 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.18;
}

.intro-hero > p {
  max-width: 840px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.intro-grid div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.intro-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.intro-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.intro-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 28px;
}

.detail-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.module-detail h3 {
  margin-top: 0;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.3;
}

.module-detail h4 {
  margin: 22px 0 8px;
}

.module-detail ul,
.module-detail ol {
  padding-left: 20px;
}

.module-detail li {
  margin: 7px 0;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.module-section {
  margin-top: 20px;
}

.module-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lead-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.lead-section p {
  line-height: 1.7;
}

.process-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 0;
  counter-reset: process;
  list-style: none;
}

.process-list li {
  position: relative;
  min-height: 72px;
  margin: 0;
  padding: 14px 14px 12px 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.process-list li::before {
  counter-increment: process;
  content: counter(process);
  position: absolute;
  top: 14px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.process-list span {
  display: block;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.inline-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inline-table {
  min-width: 680px;
  background: #fff;
}

.inline-table th {
  background: #f3f7f8;
}

.inline-table td {
  line-height: 1.5;
}
.table-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.checklist label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.5;
}

.practice-box {
  padding: 16px;
  border: 1px solid #c7e2d9;
  border-radius: 8px;
  background: var(--soft);
}

.practice-box p {
  margin-bottom: 0;
  line-height: 1.65;
}

.mini-quiz {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.mini-quiz-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.mini-quiz fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mini-quiz legend {
  padding: 0 4px;
  font-weight: 700;
}

.mini-quiz label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.mini-feedback {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
}

.mini-feedback strong {
  color: var(--accent-dark);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.complete-row,
.quiz-toolbar,
.submit-row,
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.complete-row {
  margin-top: 22px;
}

.primary,
.secondary {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
}

.primary {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
}

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

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.quiz-set-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.quiz-set-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.quiz-set-card.active {
  border-color: var(--accent);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.quiz-set-card strong {
  font-size: 17px;
}

.quiz-set-card span,
.quiz-set-card small {
  color: var(--muted);
  line-height: 1.45;
}

.quiz-toolbar {
  margin-bottom: 14px;
}

.quiz-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.quiz-intro h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.quiz-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.quiz-category-grid span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--muted);
  font-size: 12px;
}

.quiz-category-grid strong {
  color: var(--ink);
  font-size: 13px;
}

.quiz-status {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quiz-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.quiz-progress-copy strong {
  color: var(--accent-dark);
}

.quiz-progress-bar {
  height: 9px;
  border-radius: 999px;
  background: #e6edf5;
  overflow: hidden;
}

.quiz-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.quiz-form {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.question {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.question.needs-answer {
  outline: 2px solid var(--danger);
  outline-offset: -2px;
  background: #fff8f8;
}

.question:last-child {
  border-bottom: 0;
}

.question header {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.question h3 {
  margin: 0;
  font-size: 17px;
}

.question small {
  color: var(--muted);
  white-space: nowrap;
}

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

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.submit-row {
  justify-content: flex-end;
  margin-top: 16px;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

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

.score-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.score-item strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.wrong-note {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
}

.wrong-note-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.wrong-note-header h3,
.wrong-note-header p {
  margin: 0;
}

.wrong-note-header p {
  margin-top: 6px;
  color: var(--muted);
}

.wrong-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wrong-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.wrong-card p {
  margin: 6px 0;
  line-height: 1.55;
}

.status-pass {
  color: var(--ok);
}

.status-fail {
  color: var(--danger);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-summary-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.admin-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.admin-summary-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-summary-card.pass {
  border-color: #9bc9ff;
  background: var(--soft);
}

.admin-summary-card.fail {
  border-color: #f0b8b8;
  background: #fff8f8;
}

.admin-summary-card.pending {
  background: #f8fbfc;
}

.admin-panel {
  padding: 18px;
}

.admin-panel h3 {
  margin-top: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
}

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

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

.stat-bar {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: #e7edf0;
  overflow: hidden;
}

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

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .nav,
  .actions,
  .quiz-toolbar,
  .submit-row {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  main {
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #resultsView {
    display: block !important;
  }
}

@media (max-width: 980px) {
  .learning-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  body.focus-mode .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  body.focus-mode .sidebar {
    position: sticky;
    height: 100vh;
    padding: 16px 13px;
  }

  body.focus-mode .brand {
    justify-content: center;
  }

  body.focus-mode .brand > div {
    display: none;
  }

  body.focus-mode .profile-card {
    display: none;
  }

  body.focus-mode .nav-item {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0;
    font-size: 0;
    text-align: center;
    line-height: 1;
  }

  body.focus-mode .nav-item::before {
    content: attr(data-short);
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
  }

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

  .brand h1 {
    max-width: none;
    font-size: 20px;
  }

  .learning-layout.modules-collapsed {
    grid-template-columns: 1fr;
  }

  .learning-layout.modules-collapsed .module-list {
    display: none;
  }

  .learning-layout.content-started {
    display: block;
  }

  .learning-layout.content-started .module-list {
    display: none;
  }

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

@media (max-width: 620px) {
  main,
  .sidebar {
    padding: 18px;
  }

  .page-header {
    display: grid;
  }

  .page-header h2 {
    font-size: 24px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .learning-layout {
    gap: 12px;
  }

  .module-card {
    padding: 13px 14px;
  }

  .module-detail {
    padding: 16px;
  }

  .intro-hero {
    padding: 22px;
  }

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

  .intro-actions,
  .detail-topbar {
    display: grid;
  }

  .quiz-intro {
    grid-template-columns: 1fr;
  }

  .quiz-set-selector {
    grid-template-columns: 1fr;
  }

  .quiz-category-grid {
    grid-template-columns: 1fr;
  }

  .quiz-progress-copy,
  .wrong-note-header {
    display: grid;
  }

  .admin-summary {
    grid-template-columns: 1fr;
  }

  .process-list {
    grid-template-columns: 1fr;
  }

  .score-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body.focus-mode .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  body.focus-mode .sidebar {
    position: sticky;
    height: 100vh;
    padding: 16px 13px;
  }

  body.focus-mode .brand {
    justify-content: center;
  }

  body.focus-mode .brand > div,
  body.focus-mode .profile-card {
    display: none;
  }

  body.focus-mode .nav-item {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0;
    font-size: 0;
    text-align: center;
    line-height: 1;
  }

  body.focus-mode .nav-item::before {
    content: attr(data-short);
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
  }
}

@media (max-width: 420px) {
  body.focus-mode .app-shell {
    grid-template-columns: 1fr;
  }

  body.focus-mode .sidebar {
    position: relative;
    height: auto;
    padding: 16px 18px;
  }

  body.focus-mode .brand {
    justify-content: flex-start;
  }

  body.focus-mode .brand > div {
    display: block;
    font-size: inherit;
  }

  body.focus-mode .profile-card {
    display: grid;
  }

  body.focus-mode .nav-item {
    display: block;
    min-height: 40px;
    padding: 12px 14px;
    font-size: inherit;
  }

  body.focus-mode .nav-item::before {
    content: none;
  }
}

@media (min-width: 421px) {
  body.focus-mode .nav-item {
    position: relative;
    display: block;
    font-size: 0;
    text-align: center;
    line-height: 0;
  }

  body.focus-mode .nav-item::before {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 100%;
    line-height: 1;
    text-align: center;
    transform: translate(-50%, -50%);
  }
}

/* ===================== v2 추가 스타일 ===================== */

/* 학습 검색 */
.search-wrap { flex: 1 1 220px; min-width: 180px; }
.search-wrap input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23,104,199,0.12);
}
.module-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 14px;
}

/* 참고 화면(스크린샷) */
.screens-section .screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.screen-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.screen-thumb {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  background: #fbfcfe;
  transition: transform 0.15s ease;
}
.screen-thumb:hover { transform: scale(1.01); }
.screen-item figcaption {
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* 라이트박스 */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15,25,35,0.82);
  z-index: 1000;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox-inner { max-width: 92vw; max-height: 92vh; text-align: center; }
.lightbox-inner img {
  max-width: 100%;
  max-height: 84vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.lightbox-inner p { margin: 10px 0 0; color: #eef3f8; font-size: 13px; }

/* 자주 헷갈리는 포인트 */
.pitfalls-box {
  border: 1px solid #f0d9b8;
  background: #fffaf1;
  border-radius: 10px;
  padding: 14px 16px;
}
.pitfalls-box h4 { color: var(--warn); }
.pitfalls-list { margin: 0; padding-left: 18px; }
.pitfalls-list li { margin: 6px 0; }

/* 관리자 – 연동 배지 + 요약 카드 래퍼 (기존 .admin-summary grid 오버라이드) */
.admin-summary { display: block; grid-template-columns: none; }
.admin-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #f3f6f9;
  color: var(--muted);
}
.admin-badge.supabase {
  border-color: #9bc9ff;
  background: var(--soft);
  color: var(--accent-dark);
}
.admin-summary-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .admin-summary-cards { grid-template-columns: 1fr; }
}

/* 인쇄 시 스크린샷/라이트박스 정리 */
@media print {
  .lightbox { display: none !important; }
  .search-wrap { display: none; }
  .screen-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===================== v3 추가 스타일 ===================== */

/* 진입 전: 네비 잠금 */
body.pre-onboarding .nav { opacity: 0.45; pointer-events: none; }

/* 진입 페이지 */
.entry-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 24px 12px; }
.entry-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 30px;
  box-shadow: 0 10px 30px rgba(20,40,60,0.06);
}
.entry-card h2 { margin: 6px 0 10px; }
.entry-lead { color: var(--muted); line-height: 1.6; margin: 0 0 20px; }
.entry-field { margin-bottom: 14px; }
.entry-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.entry-field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
}
.entry-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,104,199,0.12); }
.entry-deadline { font-size: 13px; color: var(--muted); margin: 4px 0 18px; }
.entry-start { width: 100%; padding: 13px; font-size: 15px; }
.entry-error { color: var(--danger); font-size: 13px; margin: 10px 0 0; min-height: 18px; }

/* 사이드바 프로필 */
.profile-empty { color: rgba(255,255,255,0.7); font-size: 13px; line-height: 1.5; margin: 0; }
.profile-info { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.profile-info strong { font-size: 15px; }
.profile-info span { font-size: 12.5px; color: rgba(255,255,255,0.72); }
.profile-info .profile-deadline { margin-top: 6px; font-weight: 700; color: #a9d3ff; }
.profile-info .profile-deadline.overdue { color: #ffb4b4; }

/* 마감 배지 */
.deadline-card {
  padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px;
  border: 1px solid #9bc9ff; background: var(--soft); color: var(--accent-dark);
  display: flex; align-items: center;
}
.deadline-card:empty { display: none; }
.deadline-card.urgent { border-color: #f0d9b8; background: #fffaf1; color: var(--warn); }
.deadline-card.overdue { border-color: #f0b8b8; background: #fff8f8; color: var(--danger); }

/* 학습 카드 잠금/완료 */
.module-card.locked { opacity: 0.6; cursor: not-allowed; }
.module-card.locked:hover { border-color: var(--line); }
.module-card.done strong::after { content: " ✓"; color: var(--accent); }

/* 원본 매뉴얼 다운로드 */
.manuals-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 14px 0; padding: 12px 14px;
  border: 1px dashed var(--line); border-radius: 10px; background: #fbfdff;
}
.manuals-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.manual-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: 8px; text-decoration: none;
  border: 1px solid #9bc9ff; background: var(--soft); color: var(--accent-dark);
  font-size: 13px; font-weight: 600;
}
.manual-btn:hover { background: #dcecff; }

/* 테스트 잠금 패널 */
.lock-panel, .verify-panel {
  max-width: 520px; margin: 8px auto; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px;
}
.lock-icon { font-size: 40px; }
.lock-panel h3, .verify-panel h3 { margin: 10px 0; }
.lock-panel p, .verify-panel p { color: var(--muted); }
.lock-progress { margin: 18px 0; }
.lock-progress-bar { height: 10px; border-radius: 6px; background: #e9eef3; overflow: hidden; margin-bottom: 8px; }
.lock-progress-bar span { display: block; height: 100%; background: var(--accent); }
.verify-panel { text-align: left; }
.verify-panel .entry-field { margin-top: 12px; }
.verify-panel .primary { margin-top: 8px; }

/* 시험 타이머 */
.quiz-timer {
  padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px;
  background: #132230; color: #fff; margin-right: auto;
}

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #132230; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 1200; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 관리자 표: 열이 많아 가로 스크롤 */
.admin-panel .table-wrap { overflow-x: auto; }
.admin-panel table { min-width: 860px; }

@media print {
  .manuals-box, .quiz-timer, .toast { display: none !important; }
}

/* 진입 파트 select */
.entry-field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); appearance: auto;
}
.entry-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,104,199,0.12); }

/* 진입 입력/선택 글자 크기 통일 + 미선택 placeholder 색 */
.entry-field input,
.entry-field select {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  height: 46px;
}
.entry-field select { color: var(--ink); }
.entry-field select:invalid { color: #8a949d; }

/* ===================== v3 레이아웃 정리 ===================== */
/* 학습 헤더 컨트롤 높이/줄바꿈 통일 */
.header-actions { flex-wrap: wrap; row-gap: 10px; }
.header-actions .search-wrap input,
.header-actions .compact-button,
.header-actions .progress-card,
.header-actions .deadline-card {
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.header-actions .search-wrap input { width: 100%; }
.header-actions .progress-card { justify-content: center; padding: 0 16px; }
.header-actions .progress-card span { font-size: 15px; white-space: nowrap; }
.header-actions .deadline-card { justify-content: center; padding: 0 16px; font-size: 14px; }

/* intro-grid: 아주 좁은 화면에서만 1열 */
@media (max-width: 560px) {
  .intro-grid { grid-template-columns: 1fr; }
}

/* 본문 좌상단 뒤로가기 화살표 */
.detail-topbar { align-items: center; }
.back-arrow {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.back-arrow:hover { background: var(--soft); border-color: #9bc9ff; color: var(--accent-dark); }

/* 뒤로가기 화살표 + 제목 왼쪽 정렬 */
.detail-topbar { justify-content: flex-start; gap: 12px; }

/* 검색창 + 완료율 박스 한 줄 고정 */
.header-actions { flex-wrap: nowrap; }
.header-actions .search-wrap { flex: 0 1 280px; min-width: 160px; }
.header-actions .progress-card { flex: 0 0 auto; }

/* ===================== v4: 가독성 · 여백 ===================== */
/* 학습 본문: 줄 길이 제한 + 문단 간 여백 확대 */
.lead-section { padding: 20px 22px; }
.lead-section p {
  max-width: 74ch;
  margin: 0 0 15px;
  line-height: 1.95;
  font-size: 15.5px;
}
.lead-section p:last-child { margin-bottom: 0; }
/* 본문 성격의 문단·리스트도 읽기 좋은 폭으로 */
.module-section > ul,
.module-section > p,
.practice-box p,
.pitfalls-list { max-width: 78ch; }
.module-detail li { line-height: 1.8; margin: 7px 0; }

/* 퀴즈 문제 사이 세로 여백 확대 */
.quiz-form { gap: 14px; }
.question {
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
}
.question:last-child { border-bottom: 1px solid var(--line); }
.question header { margin-bottom: 16px; }

/* ===================== v4: 퀴즈 시작 게이팅 ===================== */
#quizMain.quiz-not-started #quizForm,
#quizMain.quiz-not-started .submit-row,
#quizMain.quiz-not-started #quizStatus,
#quizMain.quiz-not-started #resetQuiz { display: none; }

/* 시작 전 안내 */
#quizMain.quiz-not-started .quiz-toolbar::after {
  content: "‘퀴즈 시작’을 누르면 소요 시간 카운트가 시작되고 문제가 열립니다.";
  order: 5;
  flex-basis: 100%;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.quiz-toolbar { flex-wrap: wrap; }

/* 모든 학습 완료 버튼 강조 */
.complete-row .all-done {
  border-color: #9bc9ff;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 700;
}

/* ===================== v5: 옵션·문제 박스 제거 ===================== */
/* 보기(옵션): 테두리 박스 제거, 깔끔한 행 형태 */
.option {
  border: none;
  border-radius: 6px;
  padding: 9px 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.option:hover { background: #f4f8fc; }
.option:has(input:checked) { background: var(--soft); }

/* 문제: 카드 박스 제거, 얇은 구분선 + 넉넉한 여백으로만 구분 */
.quiz-form { gap: 0; }
.question {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  padding: 24px 6px;
}
.question:last-child { border-bottom: none; }
.question.needs-answer {
  outline: none;
  background: #fff8f8;
  border-radius: 8px;
}

/* ===================== v5: 온보딩 완료 상태 ===================== */
.onboarding-status {
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #f8fbfc;
}
.onboarding-status.done { border-color: #9bc9ff; background: var(--soft); }
.onboarding-status strong { display: block; margin-bottom: 8px; font-size: 15px; }
.onboarding-status ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.onboarding-status li.ok { color: var(--accent-dark); font-weight: 600; }
.onboarding-status li.todo { color: var(--muted); }
.onboarding-status p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.quiz-set-card.passed { border-color: #9bc9ff; }
.set-pass { color: var(--accent-dark); font-size: 12px; font-weight: 700; }

/* ===================== v6: 관리자 표 줄바꿈 방지 ===================== */
.admin-panel .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-panel table { min-width: 1160px; }
.admin-panel th,
.admin-panel td {
  white-space: nowrap;      /* 셀 내부 두 줄 넘어감 방지 */
  overflow-wrap: normal;
  word-break: keep-all;
  vertical-align: middle;
}

/* v6: 관리자 표에 전체 너비 확보 (패널 세로 배치) */
.admin-grid { grid-template-columns: 1fr; }
.admin-panel th,
.admin-panel td { padding: 10px 12px; font-size: 13px; }
.admin-panel table { min-width: 1040px; }

/* ===================== v7: 본문 폭 복원 + 도식 ===================== */
/* 본문이 중간에 잘려 보이던 좁은 폭 제한 해제(패널 폭을 채움) */
.lead-section p { max-width: none; line-height: 1.8; }
.module-section > ul,
.module-section > p,
.practice-box p,
.pitfalls-list { max-width: none; }

/* 도식(다이어그램) */
.diagram-section .diagram { display: flex; flex-direction: column; gap: 12px; }
.diag-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.diag-box {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 10px 14px; min-height: 46px;
  border: 1px solid #9bc9ff; background: var(--soft); color: var(--accent-dark);
  border-radius: 8px; font-weight: 600; font-size: 13.5px;
}
.diag-box.alt { border-color: #f0d9b8; background: #fffaf1; color: var(--warn); }
.diag-arrow { display: flex; align-items: center; color: var(--muted); font-weight: 700; font-size: 16px; }
.diag-cap { margin: 0; color: var(--muted); font-size: 13px; }
.diag-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.diag-node { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.diag-node.muted { background: #f8fbfc; }
.diag-node.accent { border-color: #9bc9ff; background: var(--soft); }
.diag-node h5 { margin: 0 0 6px; font-size: 14px; color: var(--accent-dark); }
.diag-node p { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.6; }
.diag-badge {
  display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 7px;
  border-radius: 999px; background: #fff3e6; color: var(--warn); font-weight: 700; vertical-align: middle;
}
.diag-plus { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
@media (max-width: 560px) { .diag-flow { flex-direction: column; } .diag-arrow { transform: rotate(90deg); } }

/* ===================== v11: 관리자 잠금 · 미리보기 ===================== */
.admin-lock .lock-panel { text-align: center; }

/* 미리보기 모드 배너 (하단 고정) */
.preview-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 12px 20px; background: var(--warn); color: #fff;
  font-size: 14px; font-weight: 600; z-index: 1100;
  transform: translateY(100%); transition: transform 0.25s ease;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
}
.preview-banner.show { transform: translateY(0); }
.preview-banner .compact-button {
  min-height: 34px; min-width: auto; padding: 0 14px;
  background: #fff; color: var(--warn); border-color: #fff;
}
body.preview-mode main { padding-bottom: 64px; }

/* ===================== v12: 역할 배지 · 로스터 ===================== */
.profile-role {
  display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: rgba(255,255,255,0.16); color: #cfe4ff; width: fit-content;
}
.profile-role.prog { background: #a9d3ff; color: #0f2f52; }
.profile-info strong em { font-style: normal; font-weight: 600; font-size: 12px; color: rgba(255,255,255,0.72); }
.role-tag {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700; background: var(--soft); color: var(--accent-dark); vertical-align: middle;
}
.role-tag.prog { background: #fff3e6; color: var(--warn); }
.admin-summary-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .admin-summary-cards { grid-template-columns: 1fr; } }

/* ===================== v13: 직원 정보 관리 ===================== */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h3 { margin: 0; }
.panel-head .compact-button { min-width: auto; min-height: 38px; padding: 0 14px; }

.emp-form {
  border: 1px solid #9bc9ff; background: var(--soft); border-radius: 10px;
  padding: 16px; margin-bottom: 14px;
}
.emp-form h4 { margin: 0 0 12px; }
.emp-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.emp-form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink); }
.emp-form-grid input[type="text"],
.emp-form-grid input[type="email"],
.emp-form-grid select {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400; font-size: 14px;
}
.emp-form-grid input[readonly] { background: #eef2f5; color: var(--muted); }
.emp-form-grid label.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.emp-form-grid label.chk input { width: 16px; height: 16px; }
.emp-form-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.emp-form-actions .entry-error { margin: 0; }

.emp-actions { white-space: nowrap; }
.link-btn {
  border: none; background: none; color: var(--accent); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 2px 6px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* 관리자 상세: 직원별 시험 결과 · 오답노트 */
.detail-attempt {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--surface);
}
.detail-attempt-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; margin-bottom: 8px;
}
.detail-attempt-head strong { font-size: 15px; }
.detail-meta { margin-left: 10px; color: var(--muted); font-size: 12px; }
.detail-scoreline { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; font-weight: 600; }
.detail-weak { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.detail-noerror { color: var(--success, #1a7f5a); font-weight: 600; font-size: 13px; margin: 6px 0 0; }
.detail-wrong { display: grid; gap: 12px; margin-top: 10px; }
.detail-wrong .wrong-card h4 { margin: 0 0 8px; font-size: 14px; }
