/* ===== 정보관리기술사 단어장 · 전체 학습 카테고리 한눈에 보기 (dotori1995/Professional_Engineer 호환 + 마인드맵 통합) ===== */
.pec-shell {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface2: #eef1f5;
  --text: #1b1f24;
  --muted: #5b6573;
  --line: #dde2e8;
  --accent: #1f6feb;
  --accent-soft: #e3edff;
  --know: #1a7f37;
  --know-soft: #dcf5e3;
  --dont: #c9510c;
  --dont-soft: #fde7d9;
  --dueum: #8250df;
  --dueum-soft: #efe6ff;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.58;
  word-break: keep-all;
  overflow-wrap: anywhere;
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: 76vh;
  display: flex;
  flex-direction: column;
}

.pec-shell[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --text: #e6edf3;
  --muted: #9aa5b1;
  --line: #30363d;
  --accent: #4c9aff;
  --accent-soft: #132a4a;
  --know: #3fb950;
  --know-soft: #12301b;
  --dont: #f0883e;
  --dont-soft: #3a2312;
  --dueum: #b392f0;
  --dueum-soft: #2a1f45;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  color-scheme: dark;
}

.pec-shell[hidden],
.mm-status-strip[hidden],
.mm-workspace-body[hidden] {
  display: none !important;
}

.pec-shell * {
  box-sizing: border-box;
}

.pec-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.pec-icon-btn {
  border: 0;
  background: var(--surface2);
  color: var(--text);
  border-radius: 11px;
  min-width: 40px;
  min-height: 40px;
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.pec-icon-btn:hover {
  filter: brightness(0.96);
}

.pec-brand {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: 16.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.pec-cur-dom {
  color: var(--accent);
}

.pec-topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.pec-nav-btn {
  border: 0;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 9px;
  border-radius: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.pec-nav-btn.on {
  color: var(--accent);
  background: var(--accent-soft);
}

.pec-nav-btn.pec-mm-return {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}

.pec-shell[data-theme="dark"] .pec-nav-btn.pec-mm-return {
  background: #2e1065;
  color: #ddd6fe;
  border-color: #5b21b6;
}

.pec-wrap {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 14px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Overview Summary Dashboard Cards */
.pec-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pec-dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pec-dash-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.pec-dash-card.on {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

.pec-dash-card.study-track {
  border-left: 4px solid #7c3aed;
}

.pec-dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.pec-dash-code {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}

.pec-dash-card.study-track .pec-dash-code {
  color: #7c3aed;
}

.pec-shell[data-theme="dark"] .pec-dash-card.study-track .pec-dash-code {
  color: #c4b5fd;
}

.pec-dash-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface2);
  padding: 1px 7px;
  border-radius: 999px;
}

.pec-dash-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.pec-dash-desc {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search & Filter Controls */
.pec-search {
  width: 100%;
  font-size: 16.5px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  min-height: 46px;
}

.pec-search:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.pec-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 0 2px;
  scrollbar-width: thin;
}

.pec-chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0 13px;
  min-height: 36px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pec-chip.on,
.pec-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.pec-chip .pec-chip-n {
  font-size: 11.5px;
  opacity: 0.85;
}

.pec-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 2px;
}

/* List Items */
.pec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pec-cat-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.pec-cat-group > summary {
  padding: 11px 14px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pec-cat-group-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pec-item a,
.pec-item-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
}

.pec-item-card:hover {
  border-color: var(--accent);
}

.pec-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.pec-item-card h3 {
  margin: 4px 0 4px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--text);
}

.pec-item-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pec-badge {
  display: inline-block;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

.pec-badge.code {
  background: var(--surface2);
  color: var(--muted);
}

.pec-badge.cat {
  background: var(--accent-soft);
  color: var(--accent);
}

.pec-badge.star-badge {
  background: #fff3cd;
  color: #9a6b00;
}

.pec-shell[data-theme="dark"] .pec-badge.star-badge {
  background: #3a2e10;
  color: #f0c14b;
}

.pec-badge.dueum {
  background: var(--dueum-soft);
  color: var(--dueum);
}

.pec-badge.mm {
  background: #ede9fe;
  color: #6d28d9;
}

.pec-shell[data-theme="dark"] .pec-badge.mm {
  background: #2e1065;
  color: #c4b5fd;
}

.pec-star {
  color: #d4a017;
  font-weight: 800;
  margin-right: 0.15em;
}

.pec-shell[data-theme="dark"] .pec-star {
  color: #f0c14b;
}

.pec-shell mark {
  background: #ffe58a;
  color: #000;
  border-radius: 3px;
  padding: 0 2px;
}

/* Topic Detail (One-screen Fitbox & Expandable Raw Sections) */
.pec-topic-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pec-fitbox {
  --s: 1;
  font-size: calc(16px * var(--s));
  line-height: 1.48;
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.pec-thead {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8em;
}

.pec-fitbox h1 {
  font-size: 1.35em;
  line-height: 1.28;
  margin: 0.25em 0 0.15em;
  color: var(--text);
}

.pec-lbl {
  font-size: 0.76em;
  font-weight: 800;
  color: var(--accent);
  margin: 0.75em 0 0.2em;
  letter-spacing: 0.02em;
}

.pec-def {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55em 0.8em;
  font-size: 1em;
  line-height: 1.48;
}

.pec-dueum-box {
  background: var(--dueum-soft);
  border-left: 4px solid var(--dueum);
  border-radius: 10px;
  padding: 0.4em 0.75em;
  margin: 0.55em 0;
  font-weight: 700;
  font-size: 0.92em;
}

.pec-kw {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
  padding: 0;
  margin: 0.2em 0;
  list-style: none;
}

.pec-kw li {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 8px;
  padding: 0.2em 0.65em;
  font-size: 0.86em;
  line-height: 1.42;
}

.pec-outline {
  list-style: none;
  padding: 0;
  margin: 0.15em 0;
  font-size: 0.92em;
}

.pec-outline > li {
  margin: 0.22em 0;
  font-weight: 700;
  line-height: 1.38;
}

.pec-outline .rn {
  color: var(--muted);
}

.pec-outline .ol-subs {
  margin: 0.15em 0 0 1.25em;
  padding: 0;
  list-style: none;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.92em;
  line-height: 1.38;
}

.pec-more {
  margin: 0.7em 0 0;
  background: var(--surface2);
  border-radius: 10px;
  padding: 0 0.8em;
}

.pec-more summary {
  cursor: pointer;
  min-height: 2.5em;
  display: flex;
  align-items: center;
  font-size: 0.85em;
  font-weight: 700;
  color: var(--muted);
}

.pec-raw {
  color: var(--text);
  font-size: 0.88em;
  padding-bottom: 0.6em;
}

.pec-rsec {
  margin: 0.6em 0 0.85em;
}

.pec-rsec-t {
  font-size: 1.05em;
  margin: 0.2em 0 0.35em;
  padding-bottom: 0.2em;
  border-bottom: 2px solid var(--line);
  line-height: 1.35;
}

.pec-rsec-t .rn {
  color: var(--accent);
}

.pec-rsub {
  display: block;
  margin: 0.45em 0 0.2em 0.2em;
  padding: 0.25em 0.6em;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95em;
  line-height: 1.35;
}

.pec-ritems {
  margin: 0.1em 0 0.3em;
  padding-left: 1.8em;
  color: var(--text);
}

.pec-ritems li {
  margin: 0.2em 0;
  line-height: 1.45;
}

.pec-shell small.gl {
  font-size: 0.78em;
  color: var(--muted);
  font-weight: 400;
  margin-left: 1px;
}

.pec-tfoot {
  display: flex;
  gap: 8px;
  margin: 10px 0 2px;
  align-items: center;
  flex-wrap: wrap;
}

.pec-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--text);
  padding: 0 12px;
  text-decoration: none;
}

.pec-btn.nav {
  flex: 0 0 48px;
}

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

.pec-btn.mm-btn {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.pec-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pec-pos {
  font-size: 13px;
  color: var(--muted);
  min-width: 64px;
  text-align: center;
  font-weight: 600;
}

/* Flashcards Mode */
.pec-progress {
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.pec-progress-bar {
  height: 100%;
  width: 0;
  background: var(--know);
  transition: width 0.25s ease;
}

.pec-flash {
  position: relative;
  min-height: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 18px;
  display: flex;
  cursor: pointer;
  user-select: none;
  margin: 8px 0;
}

.pec-face {
  width: 100%;
}

.pec-face.front {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.pec-face.front h2 {
  font-size: 26px;
  line-height: 1.32;
  margin: 0;
}

.pec-face.front .tap {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Write / Recall Quiz Mode */
.pec-quiz-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  margin: 8px 0;
}

.pec-wbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.pec-wprompt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 16px 0;
}

.pec-wtitle {
  font-size: 23px;
  line-height: 1.32;
  margin: 0;
  font-weight: 800;
}

.pec-wdump {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  min-height: 110px;
}

.pec-wkws {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pec-wkw {
  border: 1.5px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}

.pec-wkw.on {
  border-color: var(--know);
  background: var(--know-soft);
  font-weight: 700;
}

.pec-wkw.auto {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.pec-must-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  padding: 5px 10px;
  margin-top: 8px;
}

/* Hamburger Slide-out Drawer */
.pec-drawer {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.pec-drawer[hidden] {
  display: none !important;
}

.pec-drawer-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.pec-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(88vw, 380px);
  background: var(--surface);
  color: var(--text);
  overflow-y: auto;
  padding: 12px;
  box-shadow: 2px 0 18px rgba(0,0,0,.25);
}

.pec-dr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pec-dr-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  margin: 10px 2px 4px;
}

.pec-dr-dom {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 6px 0;
  background: var(--bg);
}

.pec-dr-dom > summary {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14.5px;
  min-height: 42px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.pec-dr-n {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.pec-dr-links {
  display: flex;
  gap: 6px;
  padding: 0 10px 8px;
}

.pec-dr-links button {
  flex: 1;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

.pec-dr-topics {
  list-style: none;
  margin: 0;
  padding: 0 6px 8px;
  max-height: 320px;
  overflow-y: auto;
}

.pec-dr-topics li button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text);
  cursor: pointer;
}

.pec-dr-topics li button:hover,
.pec-dr-topics li button.on {
  background: var(--accent-soft);
  font-weight: 700;
}

.pec-dr-id {
  font-size: 11px;
  color: var(--muted);
  margin-right: 4px;
}

@media (max-width: 640px) {
  .pec-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
  .pec-topbar {
    padding: 6px 10px;
  }
  .pec-brand {
    font-size: 14.5px;
  }
  .pec-nav-btn {
    font-size: 12px;
    padding: 5px 6px;
  }
}
