/* =============================================================
   이마고 실습 3 · 디자인 토큰
   ============================================================= */

:root {
  --paper: #F5F0E4;
  --paper-shade: #EFE8D6;
  --paper-tint: #FBF7EE;
  --ink: #2A2419;
  --ink-soft: #6B5E4B;
  --ink-mute: #9A8E77;
  --rule: #D4C8B0;
  --rule-soft: #E5DBC5;

  --positive: #B8843E;
  --positive-soft: #EBD9B4;
  --positive-tint: #F7EFD9;

  --negative: #6B7885;
  --negative-soft: #C7CFD6;
  --negative-tint: #E7ECF0;

  --circled: #8C3A2A;
  --circled-soft: #E8C9BF;

  --shadow-sm: 0 1px 2px rgba(42, 36, 25, 0.08);
  --shadow-md: 0 4px 16px rgba(42, 36, 25, 0.10);
  --shadow-lg: 0 12px 40px rgba(42, 36, 25, 0.14);

  --serif: 'Noto Serif KR', 'Nanum Myeongjo', 'Malgun Gothic', serif;
  --sans: 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.page.narrow { max-width: 820px; }

/* =============================================================
   View 시스템
   ============================================================= */

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

/* =============================================================
   Masthead
   ============================================================= */

.masthead {
  border-top: 3px double var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 20px 0 16px;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 34px;
  margin: 0;
  letter-spacing: -0.01em;
}
.masthead .meta {
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.masthead .meta span + span::before {
  content: " · ";
  margin: 0 4px;
  color: var(--ink-mute);
}
.masthead-actions {
  display: flex;
  gap: 6px;
}

/* =============================================================
   Select View · 소개 + 모드 선택
   ============================================================= */

.intro {
  margin-bottom: 40px;
}
.intro h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 12px;
}
.intro h2:first-child { margin-top: 0; }
.intro p {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 12px;
}
.intro p.lead {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  line-height: 1.7;
}
.intro strong { color: var(--ink); }
.intro em { color: var(--ink); font-style: italic; }

.steps {
  background: var(--paper-shade);
  border-left: 3px solid var(--positive);
  padding: 24px 28px;
  margin: 24px 0;
}
.step {
  margin-bottom: 18px;
}
.step:last-child { margin-bottom: 0; }
.step-num {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--positive);
  font-size: 13px;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.step-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 6px;
}
.step.current .step-num { color: var(--circled); }
.step.current .step-title::after {
  content: " · 지금 이 단계";
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--circled);
  letter-spacing: 0;
}
.step-body {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.mode-select {
  margin: 40px 0;
}
.mode-select .prompt {
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
  margin-bottom: 24px;
  color: var(--ink);
}
.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mode-card {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: var(--sans);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}
.mode-card:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.mode-card .icon {
  font-family: var(--serif);
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--positive);
}
.mode-card.neg .icon { color: var(--negative); }
.mode-card h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
}
.mode-card .desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}
.mode-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--ink-soft);
}
.mode-card ul li {
  padding: 3px 0;
  padding-left: 14px;
  position: relative;
}
.mode-card ul li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--ink-mute);
}
.mode-card .cta {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
}
.mode-card .cta::after {
  content: " →";
  color: var(--positive);
}
.mode-card.neg .cta::after { color: var(--negative); }

.resume-banner {
  background: var(--positive-tint);
  border: 1px solid var(--positive-soft);
  border-left: 3px solid var(--positive);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.resume-banner .label {
  font-size: 14px;
  color: var(--ink);
}
.resume-banner .label strong {
  font-family: var(--serif);
  font-weight: 600;
}
.resume-banner .count {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.privacy-note {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed var(--rule);
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
}

/* =============================================================
   Card View
   ============================================================= */

.card-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}
.card-nav .brand {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.progress {
  max-width: 720px;
  margin: 0 auto 32px;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  font-family: var(--serif);
  letter-spacing: 0.05em;
}
.progress-header strong {
  color: var(--ink);
  font-weight: 600;
}
.progress-bar {
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-prompt {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}
.card-prompt h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.card-prompt p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 720px;
  margin: 0 auto 40px;
}

.card-tile {
  aspect-ratio: 3 / 4;
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  word-break: keep-all;
  line-height: 1.4;
  user-select: none;
}
.card-tile::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  pointer-events: none;
  transition: all 0.2s;
}
.card-tile::after {
  content: "✦";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 10px;
  color: var(--ink-mute);
  opacity: 0.5;
}
.card-tile:hover {
  transform: translateY(-4px);
  border-color: var(--ink-soft);
  box-shadow: var(--shadow-md);
  background: white;
}
.card-tile:hover::before {
  border-color: var(--ink-mute);
}
.card-tile.picked {
  background: var(--positive-tint);
  border-color: var(--positive);
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
  color: var(--positive);
}
.card-tile.picked::before {
  border-color: var(--positive-soft);
}
.card-tile.picked::after {
  content: "✓";
  color: var(--positive);
  opacity: 1;
  font-size: 14px;
}

.card-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.card-meta {
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
  padding-top: 20px;
  border-top: 1px dashed var(--rule);
}
.card-meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* =============================================================
   Complete View
   ============================================================= */

.complete {
  text-align: center;
  padding: 60px 20px;
  max-width: 640px;
  margin: 0 auto;
}
.complete-mark {
  font-family: var(--serif);
  font-size: 56px;
  color: var(--positive);
  margin-bottom: 24px;
  line-height: 1;
}
.complete h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.complete .summary {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.7;
}
.complete .summary strong {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
}
.complete .note {
  font-size: 14px;
  color: var(--ink-mute);
  margin: 32px auto 40px;
  max-width: 480px;
  line-height: 1.7;
  padding: 20px;
  background: var(--paper-shade);
  border-radius: 6px;
}

/* =============================================================
   Section labels (main view)
   ============================================================= */

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 48px 0 20px;
}
.section-label .num {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink-mute);
  font-size: 14px;
  letter-spacing: 0.1em;
}
.section-label h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0;
  font-weight: 600;
}
.section-label .rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* =============================================================
   Imago Circle (main view)
   ============================================================= */

.imago-container {
  position: relative;
  padding: 40px 32px;
  background: var(--paper-shade);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.imago-svg-wrap {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}
.imago-svg {
  display: block;
  width: 100%;
  height: auto;
}
.imago-halves {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 8% 10%;
}
.imago-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}
.imago-half .label {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--ink-mute);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.imago-half.pos .label { color: var(--positive); }
.imago-half.neg .label { color: var(--negative); }
.imago-half .letter {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin-right: 8px;
}

.imago-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-content: flex-start;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}
.imago-half.neg .imago-chips { align-content: flex-end; }
.imago-chips::-webkit-scrollbar { width: 4px; }
.imago-chips::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }

.empty-hint {
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
  padding: 12px;
  text-align: center;
}

.placed-chip {
  display: inline-flex;
  align-items: center;
  background: white;
  border: 1px solid var(--rule);
  padding: 4px 10px 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
  gap: 6px;
}
.imago-half.pos .placed-chip { border-color: var(--positive-soft); background: var(--positive-tint); }
.imago-half.neg .placed-chip { border-color: var(--negative-soft); background: var(--negative-tint); }

.placed-chip.circled {
  border: 2px solid var(--circled);
  background: white;
  font-weight: 700;
  color: var(--circled);
  position: relative;
  padding: 3px 9px 3px 11px;
}
.placed-chip.circled::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px dashed var(--circled);
  border-radius: 22px;
  opacity: 0.5;
}
.placed-chip .remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1;
}
.placed-chip:hover .remove { color: var(--ink); }

.meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-mute);
  flex-wrap: wrap;
  gap: 12px;
}
.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper-shade);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.counter strong { color: var(--ink); font-weight: 600; }
.meta-bar .quote {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-mute);
}

.chip-hint {
  font-size: 11px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 12px;
  font-style: italic;
}

/* =============================================================
   Word Bank (main view)
   ============================================================= */

.bank { margin-top: 40px; }
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}
.tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab:hover { color: var(--ink); background: var(--paper-shade); }
.tab.active {
  background: var(--paper-shade);
  border-color: var(--rule);
  color: var(--ink);
  font-weight: 600;
}
.tab.active[data-tab="pos"] { border-top: 3px solid var(--positive); padding-top: 8px; }
.tab.active[data-tab="neg"] { border-top: 3px solid var(--negative); padding-top: 8px; }

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 14px;
  background: white;
  color: var(--ink);
}
.search-box input:focus {
  outline: none;
  border-color: var(--positive);
  box-shadow: 0 0 0 3px rgba(184, 132, 62, 0.15);
}
.search-box::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.5;
}
.custom-add { display: flex; gap: 6px; }
.custom-add input {
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 14px;
  background: white;
  color: var(--ink);
  min-width: 180px;
}
.custom-add input:focus {
  outline: none;
  border-color: var(--ink);
}
.custom-add button {
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.custom-add button:hover { background: var(--circled); }

.category { margin-bottom: 24px; }
.category h3 {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--rule);
  letter-spacing: 0.02em;
}
.category h3 .en {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-mute);
  margin-left: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.word-list { display: flex; flex-wrap: wrap; gap: 6px; }
.word {
  display: inline-flex;
  align-items: center;
  background: white;
  border: 1px solid var(--rule);
  padding: 6px 12px;
  border-radius: 20px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.word:hover {
  background: var(--paper-shade);
  border-color: var(--ink-mute);
  transform: translateY(-1px);
}
.word.selected {
  background: var(--positive-tint);
  border-color: var(--positive);
  color: var(--positive);
  font-weight: 500;
}
.bank.neg-active .word.selected {
  background: var(--negative-tint);
  border-color: var(--negative);
  color: var(--negative);
}
.word.hidden { display: none; }

.bank-panel { display: none; }
.bank-panel.active { display: block; }

/* =============================================================
   Sentences
   ============================================================= */

.sentences {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 32px;
  margin-top: 12px;
}
.sentence-item { margin-bottom: 32px; }
.sentence-item:last-child { margin-bottom: 0; }
.sentence-item .prompt {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.sentence-item .prompt .letter {
  font-weight: 700;
  color: var(--ink-mute);
  font-size: 18px;
  min-width: 24px;
}
.sentence-item textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  resize: vertical;
  min-height: 80px;
  background: var(--paper);
  line-height: 1.6;
}
.sentence-item textarea:focus {
  outline: none;
  border-color: var(--positive);
  background: white;
  box-shadow: 0 0 0 3px rgba(184, 132, 62, 0.15);
}
.sentence-item .suffix {
  color: var(--ink-mute);
  font-size: 14px;
  margin-top: 6px;
  font-style: italic;
}
.feeling-hints {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dotted var(--rule);
}
.feeling-hints .label {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
.feeling-hints .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.feeling-hints .chip {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  background: white;
}
.feeling-hints .chip:hover {
  border-color: var(--negative);
  color: var(--negative);
}

/* =============================================================
   Buttons
   ============================================================= */

.btn {
  padding: 10px 20px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover:not(:disabled) { background: var(--circled); border-color: var(--circled); }
.btn.danger { color: var(--circled); border-color: var(--circled); }
.btn.danger:hover:not(:disabled) { background: var(--circled); color: var(--paper); }
.btn.ghost {
  border-color: transparent;
  color: var(--ink-soft);
  padding: 6px 10px;
  font-size: 13px;
}
.btn.ghost:hover:not(:disabled) {
  background: var(--paper-shade);
  color: var(--ink);
}
.btn.large {
  padding: 14px 32px;
  font-size: 16px;
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* =============================================================
   Toast
   ============================================================= */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* =============================================================
   Responsive
   ============================================================= */

@media (max-width: 720px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-tile { font-size: 17px; padding: 20px 12px; }
}

@media (max-width: 640px) {
  .page { padding: 24px 16px 60px; }
  .masthead h1 { font-size: 26px; }
  .mode-cards { grid-template-columns: 1fr; }
  .imago-container { padding: 24px 12px; }
  .imago-halves { padding: 6% 6%; }
  .imago-chips { max-height: 160px; }
  .sentences { padding: 20px; }
  .placed-chip, .word { font-size: 12px; }
  .card-prompt h2 { font-size: 22px; }
  .complete { padding: 40px 16px; }
  .complete h2 { font-size: 24px; }
  .complete-mark { font-size: 44px; }
}

/* =============================================================
   Index Page (실습 목록)
   ============================================================= */

.part-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 10px;
  margin-top: 56px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.part-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--positive);
  letter-spacing: 0.15em;
}
.part-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  letter-spacing: -0.01em;
}
.part-subtitle {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.part-desc {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 20px;
  line-height: 1.7;
  font-style: italic;
}

.index-list { margin: 0 0 8px; padding: 0; }

.index-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 18px 12px;
  border-bottom: 1px dotted var(--rule);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.index-item:last-child { border-bottom: none; }

.index-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink-mute);
  min-width: 36px;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.index-content { flex: 1; min-width: 0; }
.index-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.4;
}
.index-title .en {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-mute);
  margin-left: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.index-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.index-status {
  align-self: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  padding: 5px 12px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  white-space: nowrap;
  background: var(--paper-shade);
  font-weight: 500;
}

/* Pending items · dimmed */
.index-item.pending {
  opacity: 0.55;
  cursor: default;
}

/* Active item · link with hover */
a.index-item.active {
  cursor: pointer;
  background: var(--paper-tint);
  border-radius: 6px;
  border-bottom-color: transparent;
  margin: 4px 0;
}
a.index-item.active + .index-item,
.index-item + a.index-item.active {
  border-top: 1px dotted var(--rule);
  padding-top: 18px;
}
a.index-item.active .index-num { color: var(--positive); }
a.index-item.active .index-title { color: var(--ink); }
a.index-item.active .index-title::after {
  content: " ✦";
  color: var(--positive);
  font-size: 13px;
  margin-left: 2px;
}
a.index-item.active .index-status {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
a.index-item.active:hover {
  background: var(--positive-tint);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
a.index-item.active:hover .index-title { color: var(--positive); }
a.index-item.active:hover .index-status {
  background: var(--circled);
  border-color: var(--circled);
}

.index-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px dashed var(--rule);
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.7;
}
.index-footer em {
  color: var(--ink-soft);
  font-style: italic;
}

/* Back link (on exercise select view) */
.back-nav {
  margin-bottom: 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s;
}
.back-link:hover { color: var(--ink); }

@media (max-width: 640px) {
  .part-header { gap: 8px; }
  .part-title { font-size: 18px; }
  .index-item { gap: 12px; padding: 14px 8px; flex-wrap: wrap; }
  .index-num { font-size: 17px; min-width: 28px; }
  .index-title { font-size: 15px; }
  .index-title .en { display: block; margin-left: 0; margin-top: 2px; }
  .index-desc { font-size: 12px; }
  .index-status { font-size: 11px; padding: 4px 10px; }
}

/* =============================================================
   Print
   ============================================================= */

@media print {
  body { background: white; }
  .page { padding: 20px; max-width: none; }
  .view { display: none !important; }
  .view#view-main { display: block !important; }
  .bank, .actions, .search-row, .toast, .meta-bar, .masthead-actions { display: none !important; }
  .steps { border: 1px solid #ccc; background: #f9f9f9; }
  .imago-chips { max-height: none !important; overflow: visible !important; }
  .sentences textarea { border: 1px solid #999; background: white; }
  .masthead { break-after: avoid; }
  .imago-container { break-inside: avoid; background: #fafafa; }
}
