@charset "UTF-8";

:root {
  --bg: #fff;
  --white: #fff;
  --text: #1a1d23;
  --sub: #0a0a0a;
  --light: #9aa0a6;
  --border: #d1d5d9;
  --border-soft: #f1f3f5;
  --blue: #067DFD;
  --blue-bg: #e8f0fe;
  --blue-light: #f0f6ff;
  --green: #0d904f;
  --green-bg: #e6f4ea;
  --amber: #e37400;
  --amber-bg: #fff4e0;
  --red: #d93025;
  --red-bg: #fce8e6;
  --purple: #7b1fa2;
  --purple-bg: #f3e8fd;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .10);
  /* Color_Variation */
  --color24: #693BF2;
  /* Color_Dimmed */
  --color18: rgba(0, 0, 0, 0.10);
  --color19: rgba(0, 0, 0, 0.20);
  --color20: rgba(0, 0, 0, 0.60);
  --color21: rgba(0, 0, 0, 0.80);
}

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Header ── */
.header_sr {
  background: var(--white);
  border-bottom: 2px solid var(--blue);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark img {
  width: 180px;
}

.badge {
  background: var(--blue-bg);
  color: var(--blue);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge.warn {
  background: var(--amber-bg);
  color: var(--amber);
}

/* ai-mode layout (좌/우) */
.mock-aimode {
  display: grid;
  border-radius: 10px;
  border: 1px solid var(--border);
  min-height: 280px;
}

.mock-sidebar {
  position: fixed;
  width: 280px;
  top: 84px;
  bottom: 0;
  left: 0;
  background: #F5F6F7;
  padding: 12px 20px;
}

.mock-sidebar .sb-head {
  font-size: 15px;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  margin: 20px 0 28px;
  letter-spacing: -0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mock-sidebar .new-btn {
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 500;
}

.mock-session-item {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 12px 10px;
  margin-bottom: 6px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}

.mock-session-item.active {
  border-color: var(--border);
  background: var(--blue-light);
}

.mock-session-item .s-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.4;
}

.mock-session-item .s-meta {
  color: var(--light);
  font-size: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.mock-session-item .badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 3px;
}

.mock-session-item .badge.bought {
  background: #d4f4dd;
  color: #0a6b35;
}

.mock-session-item .badge.draft {
  background: #e1d4f4;
  color: #5b2d91;
}

.mock-chat {
  background: #fff;
  padding: 0 0 20px 280px;
}

.mock-chat .chat-turn {
  margin-bottom: 10px;
}

.mock-chat .chat-turn .role {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 3px;
}

.mock-chat .chat-turn .role.u {
  background: var(--blue);
  color: #fff;
}

.mock-chat .chat-turn .role.a {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
}

.mock-chat .chat-turn p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}

.mock-chat .last-marker {
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
}

/* ── Scenario Tabs ── */
.scenario-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
  padding: 0 40px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  position: fixed;
  width: 100%;
  top: 83px;
}

.tab {
  background: none;
  border: none;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 400;
  color: var(--sub);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.18s;
  white-space: nowrap;
  justify-content: center;
  align-items: center;
  display: flex;
  gap: 2px;
}

.tab .tab-num {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background: var(--secondary);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  color: var(--white);
}

.tab.active {
  color: var(--sub);
  border-bottom-color: var(--sub);
  font-weight: 600;
}

.tab.active .tab-num {
  background: var(--secondary);
  color: #fff;
}

.tab:hover:not(.active) {
  color: var(--text);
}

/* ── Layout ── */
.layout {
  max-width: 720px;
  margin-left: 160px;
  min-height: calc(100vh - 120px);
}

.chat-section {
  padding: 48px 0;
}

/* Note banner */
.note {
  background: var(--blue-light);
  border-left: 3px solid var(--blue);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--sub);
  border-radius: 6px;
  margin-bottom: 18px;
  line-height: 1.55;
}

.note strong {
  color: var(--blue);
}

/* ── Persona Card ── */
.persona-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.persona-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.persona-meta {
  flex: 1;
  min-width: 0;
}

.persona-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.persona-detail {
  font-size: 13px;
  color: var(--sub);
}

.persona-mood {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.mood-panic {
  background: var(--red-bg);
  color: var(--red);
}

.mood-curious {
  background: var(--blue-bg);
  color: var(--blue);
}

.mood-focused {
  background: var(--purple-bg);
  color: var(--purple);
}

.mood-blank {
  background: var(--amber-bg);
  color: var(--amber);
}

/* ── Upload Zone (fake OCR for scenario 4) ── */
.upload-zone {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  margin-bottom: 20px;
  text-align: center;
  transition: all 0.2s;
}

.upload-zone.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.upload-title {
  font-size: 14px;
  color: var(--sub);
  margin-bottom: 4px;
}

.upload-subtitle {
  font-size: 12px;
  color: var(--light);
  margin-bottom: 16px;
}

.upload-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.sample-btn {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.sample-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.sample-btn .icon {
  font-size: 16px;
}

.upload-or {
  margin-top: 12px;
  font-size: 12px;
  color: var(--light);
}

.upload-textarea {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  color: var(--text);
  background: var(--white);
}

/* Loading sequence */
.loading-steps {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  animation: fadeUp 0.3s ease;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--light);
  transition: color 0.3s;
}

.loading-step.active {
  color: var(--blue);
  font-weight: 600;
}

.loading-step.done {
  color: var(--green);
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s;
}

.loading-step.active .loading-dot {
  background: var(--blue);
  animation: pulse 1s infinite;
}

.loading-step.done .loading-dot {
  background: var(--green);
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
}

/* ── Chat Messages ── */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin: 60px 0 30px;
}

.msg {
  display: flex;
  gap: 16px;
  animation: fadeUp 0.4s ease;
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.msg.user .msg-avatar {
  background: var(--blue);
  color: #fff;
}

.msg.ai .msg-avatar {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
}

.msg-bubble {
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 16px;
  line-height: 24px;
}

.msg.user .msg-bubble {
  background: #E9ECEF;
  color: #333;
  border-top-right-radius: 4px;
}

.msg.user .msg-bubble.attachment {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px dashed var(--blue);
  font-size: 15px;
  font-style: italic;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Widget container ── */
.widget {
  margin-top: 12px;
  animation: fadeUp 0.5s ease;
}

/* ── Widget: 과제 분해 트리 ── */
.decomp-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  max-width: 560px;
}

.decomp-header {
  background: var(--blue-light);
  color: var(--blue);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.decomp-list {
  padding: 8px 0;
}

.decomp-item {
  padding: 12px 18px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.decomp-item:last-child {
  border-bottom: none;
}

.decomp-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  width: 70px;
  flex-shrink: 0;
  padding-top: 2px;
}

.decomp-value {
  font-size: 14px;
  color: var(--text);
  flex: 1;
}

.decomp-value.missing {
  color: var(--amber);
  font-weight: 600;
}

.decomp-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Widget: 구조 설계 보드 ── */
.structure-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  max-width: 560px;
}

.structure-title {
  font-size: 13px;
  color: var(--sub);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.structure-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: flex-start;
}

.structure-row:last-child {
  border-bottom: none;
}

.structure-section {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  width: 80px;
  flex-shrink: 0;
  padding-top: 2px;
}

.structure-goal {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}

.structure-evidence {
  font-size: 11px;
  color: var(--sub);
  margin-top: 3px;
}

.structure-pages {
  font-size: 11px;
  color: var(--light);
  flex-shrink: 0;
}

.topic-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-choice {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.topic-choice:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.topic-num {
  display: inline-block;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  margin-right: 10px;
}

.topic-text {
  font-size: 14px;
  font-weight: 600;
  display: inline;
}

.topic-hint {
  display: block;
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
  margin-left: 32px;
}

/* ── Widget: 시간 분배 게이지 ── */
.time-gauge-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  max-width: 560px;
  box-shadow: var(--shadow-sm);
}

.time-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.time-gauge-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-gauge-left {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-bg);
  padding: 3px 10px;
  border-radius: 10px;
}

.time-gauge-day {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.time-gauge-day:last-child {
  border-bottom: none;
}

.time-day-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
}

.time-day-tasks {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

/* ── Widget: 필요 자료 체크리스트 ── */
.materials-card {
  padding: 0;
}

.materials-title {
  font-size: 20px;
  color: var(--sub);
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.material-total {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
}

.material-total-label {
  color: var(--sub);
}

.material-total-value {
  color: var(--blue);
}

/* ── Combo recommendations ── */
.material-combos {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
}

.material-combos-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.material-combo-item {
  padding: 12px 14px;
  background: var(--blue-light);
  border-radius: 10px;
  margin-bottom: 8px;
}

.material-combo-item:last-child {
  margin-bottom: 0;
}

.material-combo-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
}

.material-combo-reason {
  font-size: 12px;
  color: var(--sub);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════ */
/* AI 검토 리포트 — review-card (list_demo 2안 v2 기반) */
/* ═══════════════════════════════════════════ */
.review-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}

.review-card:hover {
  border-color: #d0d5da;
}

/* AI 발화 블록 (최상위) */
.review-ai-lead {
  display: flex;
  gap: 10px;
  padding: 20px 28px;
  background: var(--blue-light);
  border-radius: 10px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.review-ai-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.review-ai-text {
  font-size: 16px;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
}

.review-divider {
  border-bottom: 1px dashed var(--border);
  margin: 20px 0;
}

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

.review-meta-left {
  flex: 1;
  min-width: 0;
}

.review-role {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}

.review-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.review-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.review-btn {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
  text-decoration: none;
}

.review-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.review-btn.icon-only {
  padding: 5px 8px;
}

/* 판정형 축 칩 (강점/확인/주의) */
.review-axes {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.axis-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.axis-chip .axis-label {
  font-weight: 600;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.axis-chip .axis-val {
  font-weight: 600;
  color: var(--text);
}

.axis-chip.strength {
  background: var(--green-bg);
}

.axis-chip.strength .axis-label {
  color: var(--green);
}

.axis-chip.check {
  background: var(--blue-bg);
}

.axis-chip.check .axis-label {
  color: var(--blue);
}

.axis-chip.caution {
  background: var(--amber-bg);
}

.axis-chip.caution .axis-label {
  color: var(--amber);
}

/* 자료 섹션 태그 (썸네일 대체) */
.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #fafbfc;
  border-radius: 8px;
}

.review-tags-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  margin-bottom: 2px;
}

.review-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 하단 CTA (구매+작성 시작) */
.review-cta-wrap {
  margin-top: 18px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--blue-light), var(--green-bg));
  border-radius: 10px;
}

.review-cta-primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s;
}

.review-cta-primary:hover {
  background: #1558b8;
}

.review-cta-primary .cta-label {
  flex: 1;
  text-align: left;
}

.review-cta-primary .cta-price {
  font-size: 15px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 10px;
  border-radius: 6px;
}

.review-cta-helper {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--sub);
  text-align: center;
  line-height: 1.5;
}

.review-cta-helper a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.review-cta-helper a:hover {
  text-decoration: underline;
}

/* 과제 매핑 체크리스트 */
.review-mapping {
  margin-bottom: 16px;
  padding: 16px 12px;
  background: #fafbfc;
  border-radius: 8px;
}

.review-mapping-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}

.review-mapping-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.review-mapping-item {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}

.review-mapping-check {
  width: 14px;
  flex-shrink: 0;
  font-weight: 600;
  text-align: center;
}

.review-mapping-check.yes {
  color: var(--green);
}

.review-mapping-check.partial {
  color: var(--amber);
}

/* 하단 썸네일 미리보기 (mini) */
.review-thumbs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 8px 0 0;
  border-top: 1px solid var(--border-soft);
}

.review-thumb {
  width: 42px;
  height: 54px;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--light);
  font-weight: 700;
}

.review-thumb.more {
  background: var(--blue-bg);
  color: var(--blue);
  cursor: pointer;
}

.review-thumb.more:hover {
  background: var(--blue);
  color: #fff;
}

.review-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  font-size: 14px;
  color: var(--light);
  gap: 12px;
}

.review-meta-info {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.review-meta-info .sep {
  color: var(--border);
}

.review-meta-info .rating {
  color: var(--sub);
  font-weight: 600;
}

.review-meta-info .rating strong {
  color: var(--amber);
  font-weight: 600;
}

.review-meta-info .downloads {
  color: var(--sub);
  font-weight: 500;
}

.review-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.review-price-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
  margin-left: 2px;
}

/* ── 전문보기 레이어 ── */
.detail-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.detail-panel-overlay.open {
  opacity: 1;
  visibility: visible;
}

.detail-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 440px;
  max-width: 92vw;
  background: var(--white);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-panel.open {
  transform: translateX(0);
}

.detail-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.detail-panel-role {
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.detail-panel-doctitle {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-right: 40px;
}

.detail-panel-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.detail-panel-close:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.detail-panel-body {
  padding: 18px 24px 40px;
}

.detail-section {
  padding: 14px 0;
  border-bottom: 1px dashed var(--border-soft);
}

.detail-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.detail-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  background: var(--border-soft);
  color: var(--sub);
  border-radius: 4px;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  font-size: 13px;
}

.detail-stats-grid .label {
  color: var(--sub);
  font-size: 11px;
  margin-bottom: 2px;
}

.detail-stats-grid .value {
  font-weight: 700;
  color: var(--text);
}

.detail-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
}

.detail-thumb {
  width: 60px;
  height: 78px;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--sub);
  font-weight: 700;
}

.detail-thumb.more {
  background: var(--blue-bg);
  color: var(--blue);
}

/* 판정형 축 풀이 (세로 스택) */
.detail-axis-block {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-soft);
}

.detail-axis-block:last-child {
  border-bottom: none;
}

.detail-axis-block .chip-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 5px;
}

.detail-axis-block .detail-axis-desc {
  font-size: 14px;
  color: var(--sub);
  line-height: 1.6;
  margin: 0;
  padding-left: 2px;
}

.detail-mapping-item {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  line-height: 1.5;
}

.detail-mapping-item .check {
  width: 14px;
  flex-shrink: 0;
  font-weight: 600;
}

.detail-mapping-item .check.yes {
  color: var(--green);
}

.detail-mapping-item .check.partial {
  color: var(--amber);
}

.detail-keywords {
  font-size: 13px;
  color: var(--sub);
  padding: 10px 12px;
  background: var(--border-soft);
  border-radius: 6px;
  line-height: 1.7;
}

/* 목차 + AI 매핑 오버레이 */
.detail-toc {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc-counter;
}

.detail-toc li {
  counter-increment: toc-counter;
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

.detail-toc li:last-child {
  border-bottom: none;
}

.detail-toc li::before {
  content: counter(toc-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-bg);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
}

.detail-toc .toc-text {
  flex: 1;
}

.detail-toc .toc-map {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-bg);
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.detail-toc .toc-map.partial {
  color: var(--amber);
  background: var(--amber-bg);
}

.detail-toc .toc-map.none {
  color: var(--light);
  background: var(--border-soft);
  font-weight: 500;
}

/* 상세 근거 블록 (Round 12.1 원칙: 원문 인용 금지, 섹션 설명만 사용) */
.detail-excerpts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-excerpt {
  padding: 10px 12px;
  background: #fefcf5;
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
}

.detail-excerpt-location {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--amber);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

/* 구매 후기 */
.detail-reviews {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-review {
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
}

.detail-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.detail-review-stars {
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 1px;
}

.detail-review-meta {
  font-size: 11px;
  color: var(--light);
}

.detail-review-content {
  color: var(--text);
  line-height: 1.55;
}

.detail-reviews-more {
  text-align: center;
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
  padding: 4px 0;
}

/* 하단 CTA 영역 */
.detail-cta-wrap {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  width: 100%;
}

.detail-cta:hover {
  background: #1558b8;
}

.detail-cta.secondary {
  background: var(--white);
  color: var(--sub);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 16px;
}

.detail-cta.secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* ── Widget: Inline Action Receipt ── */
.receipt {
  background: var(--green-bg);
  border: 1px solid #c8e6c9;
  border-radius: 12px;
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 500px;
}

.receipt-check {
  width: 28px;
  height: 28px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.receipt-content {
  flex: 1;
}

.receipt-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 6px;
}

.receipt-detail {
  font-size: 13px;
  color: var(--sub);
}

.receipt-action {
  background: var(--green);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

/* ── Widget: In-place Editable Draft ── */
.draft-card {
  background: var(--white);
  border: 2.5px solid var(--blue);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(26, 115, 232, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 720px;
  width: 100%;
  scroll-margin-top: 140px;
}

.draft-card.is-full {
  animation: draftFullIn 0.5s ease;
}

@keyframes draftFullIn {
  from {
    box-shadow: 0 0 0 rgba(26, 115, 232, 0);
    transform: scale(0.99);
  }

  to {
    box-shadow: 0 10px 32px rgba(26, 115, 232, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: scale(1);
  }
}

.draft-header {
  background: var(--blue-light);
  padding: 13px 22px;
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
  letter-spacing: -0.2px;
}

.draft-version {
  background: var(--white);
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 11px;
  border: 1px solid var(--border);
}

.draft-body {
  padding: 22px 26px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  min-height: 120px;
  transition: opacity 0.3s;
}

.draft-body.swapping {
  opacity: 0.3;
}

.draft-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--border);
  letter-spacing: -0.3px;
}

.draft-heading:first-child {
  margin-top: 0;
}

.draft-citation {
  display: inline-block;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin: 0 2px;
  vertical-align: super;
}

.draft-footer {
  padding: 10px 18px;
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  font-size: 16px;
  color: var(--sub);
  transition: background 0.2s;
}

.draft-footer.active {
  background: var(--blue-light);
  color: var(--text);
  padding: 12px 18px;
}

/* ── Draft actions bar — 복사·Word·마크다운 내보내기 (Round 5 신규) ── */
.draft-actions {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
  border-top: 1.5px solid var(--border-soft);
  align-items: center;
  flex-wrap: wrap;
}

.draft-actions-status {
  flex: 1;
  font-size: 16px;
  color: var(--sub);
  min-width: 130px;
}

.draft-actions-status .warn-count-badge {
  display: inline-block;
  background: var(--amber-bg);
  color: var(--amber);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 4px;
}

.draft-actions-status.all-clear {
  color: var(--green);
  font-weight: 600;
}

.action-btn {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  transform: translateY(-1px);
}

.action-btn.primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.action-btn.primary:hover {
  background: #1557b0;
  color: var(--white);
}

.action-btn .icon {
  font-size: 15px;
}

.action-btn.copied {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green);
}

/* needs-voice 인라인 편집기 */
.voice-editor {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--purple-bg);
  border-left: 3px solid var(--purple);
  border-radius: 8px;
}

.voice-editor-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.voice-editor textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  background: var(--white);
  color: var(--text);
}

.voice-editor textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(123, 31, 162, 0.12);
}

.voice-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

.voice-save,
.voice-cancel {
  background: var(--purple);
  color: var(--white);
  border: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.voice-cancel {
  background: var(--white);
  color: var(--sub);
  border: 1px solid var(--border);
}

/* 대체안 클릭 가능 표시 */
.draft-footer .footer-alt {
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  padding-left: 18px !important;
}

.draft-footer .footer-alt::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 600;
}

.draft-footer .footer-alt:hover {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: var(--blue);
}

/* needs-voice 문장 hover 안내 */
.draft-body .warn-needs-voice {
  cursor: text;
}

.draft-body .warn-needs-voice:hover {
  background: rgba(123, 31, 162, 0.08);
}

/* ── Draft source header — 자료 연동 고정 표시 (demo2 신규) ── */
.draft-source-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--blue-light), #f5f9ff);
  border-bottom: 1px solid var(--border-soft);
}

.draft-source-icon {
  width: 34px;
  height: 42px;
  background: var(--white);
  border: 1px solid var(--blue);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--blue);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.draft-source-meta {
  flex: 1;
  min-width: 0;
}

.draft-source-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-source-sub {
  font-size: 13px;
  color: var(--sub);
}

/* ── Plan draft (목차 제안) ── */
.draft-card.plan {
  border-color: var(--blue);
  border-style: solid;
}

.draft-card.plan .draft-source-header {
  background: linear-gradient(135deg, var(--blue-bg), #f0f6ff);
}

.draft-card.plan .draft-source-icon {
  border-color: var(--blue);
  color: var(--blue);
}

.draft-card.plan .draft-header {
  background: var(--blue-bg);
  color: var(--blue);
}

.draft-plan-body {
  padding: 16px 20px 12px;
}

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

.plan-sections {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: plan-step;
}

.plan-section {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  counter-increment: plan-step;
}

.plan-section:last-child {
  border-bottom: none;
}

.plan-section::before {
  content: counter(plan-step);
  background: var(--blue);
  color: var(--white);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

.plan-section-content {
  flex: 1;
  min-width: 0;
}

.plan-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.45;
}

.plan-section-source {
  font-size: 13px;
  color: var(--sub);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.plan-section-source::before {
  content: '📄';
  font-size: 11px;
}

.draft-card.plan .draft-footer {
  padding: 20px 18px;
}

.plan-hint {
  font-size: 17px;
  color: var(--sub);
  margin-bottom: 10px;
}

.plan-actions {
  display: flex;
  gap: 8px;
}

.plan-cta {
  flex: 1;
  background: var(--purple);
  color: var(--white);
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}

.plan-cta:hover {
  background: #681491;
}

.plan-cta:active {
  transform: scale(0.98);
}

.plan-cta-secondary {
  background: var(--white);
  color: var(--purple);
  border: 1px solid var(--purple);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.plan-cta-secondary:hover {
  background: var(--purple-bg);
}

.plan-writing-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--blue-light);
  border: 1px dashed var(--blue);
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--blue);
  flex: 1;
}

.plan-writing-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--blue-bg);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 페이지 레퍼런스 (인용 [1] 대신 섹션 키워드 직접 표시) */
.draft-page-ref {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  padding: 1px 6px 1px 5px;
  border-radius: 4px;
  margin: 0 2px;
  vertical-align: middle;
  white-space: nowrap;
  cursor: help;
}

.draft-page-ref::before {
  content: '📄';
  font-size: 9px;
  margin-right: 1px;
}

/* ── Inline safety warnings inside draft ── */
.draft-body .sent {
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 3px;
  padding: 0 2px;
}

.draft-body .sent:hover {
  background: rgba(26, 115, 232, 0.06);
}

.draft-body .sent.selected {
  background: var(--blue-bg);
}

.draft-body .warn-source-needed {
  border-bottom: 2px dotted var(--amber);
  padding-bottom: 1px;
}

.draft-body .warn-source-needed .warn-tag {
  font-size: 10px;
  color: var(--amber);
  background: var(--amber-bg);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 3px;
  vertical-align: middle;
  font-weight: 700;
  white-space: nowrap;
}

.draft-body .warn-no-evidence {
  border-bottom: 2px dotted var(--light);
  padding-bottom: 1px;
}

.draft-body .warn-no-evidence .warn-tag {
  font-size: 10px;
  color: var(--sub);
  background: #eceff1;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 3px;
  vertical-align: middle;
  font-weight: 700;
  white-space: nowrap;
}

.draft-body .warn-plagiarism {
  text-decoration: underline wavy var(--red);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.draft-body .warn-plagiarism .warn-tag {
  font-size: 10px;
  color: var(--red);
  background: var(--red-bg);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 3px;
  vertical-align: middle;
  font-weight: 700;
  white-space: nowrap;
}

/* 네 감상 자리 — 자료 기반이지만 학생 목소리가 빠진 문장 */
.draft-body .warn-needs-voice {
  border-bottom: 2px dotted var(--purple);
  padding-bottom: 1px;
  background: rgba(123, 31, 162, 0.04);
}

.draft-body .warn-needs-voice .warn-tag {
  font-size: 10px;
  color: var(--purple);
  background: var(--purple-bg);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 3px;
  vertical-align: middle;
  font-weight: 700;
  white-space: nowrap;
}

/* Dynamic footer content when sentence is selected */
.draft-footer .footer-default {
  color: var(--sub);
}

.draft-footer .footer-explain {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.55;
}

.draft-footer .footer-snippet {
  background: var(--white);
  border-left: 3px solid var(--border);
  padding: 7px 11px;
  font-size: 12px;
  color: var(--text);
  border-radius: 0 6px 6px 0;
  line-height: 1.55;
  margin-top: 6px;
}

.draft-footer .footer-snippet-label {
  font-size: 10px;
  color: var(--light);
  letter-spacing: 0.2px;
  margin-bottom: 3px;
  font-weight: 700;
}

.draft-footer .footer-alt-list {
  margin-top: 6px;
}

.draft-footer .footer-alt {
  background: var(--white);
  border-left: 3px solid var(--blue);
  padding: 6px 11px;
  font-size: 12px;
  color: var(--text);
  margin-top: 4px;
  border-radius: 0 6px 6px 0;
  line-height: 1.55;
}

/* ── Single doc card ── */
.doc-mini {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 8px;
  max-width: 460px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.doc-mini-icon {
  width: 40px;
  height: 50px;
  background: linear-gradient(135deg, #fff, #f5f5f5);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  flex-shrink: 0;
}

.doc-mini-content {
  flex: 1;
  min-width: 0;
}

.doc-mini-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}

.doc-mini-meta {
  font-size: 12px;
  color: var(--sub);
}

.doc-mini-rating {
  color: var(--amber);
}

/* Cheer / encouragement */
.cheer {
  font-size: 13px;
  color: var(--green);
  padding: 10px 14px;
  background: var(--green-bg);
  border-radius: 10px;
  border-left: 3px solid var(--green);
  max-width: 560px;
  margin-top: 8px;
}

/* ── Controls ── */
.controls {
  position: sticky;
  bottom: 0;
  padding: 14px 16px 20px;
  margin: 20px -32px -24px;
  gap: 10px;
  align-items: center;
  z-index: 50;
  background: linear-gradient(to bottom, transparent, var(--white) 30px, var(--white));
}

.btn {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: all 0.15s;
}

.btn:hover {
  background: var(--bg);
  border-color: var(--light);
}

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

.btn.primary:hover {
  background: #1557b0;
  border-color: #1557b0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.controls-info {
  flex: 1;
  text-align: right;
  font-size: 12px;
  color: var(--sub);
}

@media (max-width: 980px) {
  .chat-section {
    padding: 18px 20px;
  }
}

.controls .ai-intro__input-area {
  margin: 10px 0;
  width: 100%;
  padding: 12px 20px;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--white);
  border: 1px solid #dcdfe5;
  border-radius: 20px;
  box-shadow: 0 4px 18px -2px hsl(from rgba(60, 64, 67, 0.16) h s l / .12);
}

.controls .ai-intro__input-area .ai-intro__textarea {
  width: 100%;
  height: 40px;
  max-height: 80px;
  font-size: 16px;
  font-weight: 400;
  color: var(--color7);
  line-height: 26px;
  background-color: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow-y: auto;
}

@media (min-width: 648px) {
  .ai-intro__input-area .ai-intro__textarea {
    height: 72px;
    max-height: none;
    line-height: 24px;
  }
}

.ai-intro__input-area .ai-intro__textarea::placeholder {
  color: var(--color9);
}

.ai-intro__input-area .ai-intro__submit-btn {
  width: 46px;
  height: 32px;
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: center;
  gap: 0;
  background: var(--primary);
  border-radius: 20px;
}

.ai-intro__input-area .ai-intro__submit-btn:hover {
  background: #0066D4;
}

.ai-intro__input-area .ai-intro__submit-btn>img {
  width: 20px;
  height: 20px;
}

.keywords-tag {
  font-size: 14px;
  font-weight: 600;
  color: var(--sub);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.box-section {
  max-width: 400px;
  padding: 20px;
  background: var(--blue-light);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.box-section:hover {
  background: #e6eefb;
  transition: all 0.15s;
}

.box-section .num {
  display: inline-flex;
  width: 24px;
  height: 24px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  font-size: 13px;
}

.box-section .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.box-section .sub {
  font-size: 14px;
  color: var(--light);
  margin-top: 2px;
  line-height: 1.55;
}

.msg-bubble .time {
  display: block;
  font-size: 12px;
  color: var(--light);
}

.sds_box {
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  max-width: 300px;
}

/* guest state */
.mock-guest-hint { 
  padding: 14px; 
  font-size: 13px; 
  color: var(--text);
  line-height: 1.6; 
  text-align: center; 
  display: flex;
  flex-direction: column;
}
.mock-guest-hint .icon { 
  font-size: 20px; 
  display: block; 
  margin-bottom: 6px; 
}
.mock-guest-hint .login-cta { 
  display: inline-block; 
  margin-top: 8px; 
  background: var(--blue); 
  color: #fff; 
  font-size: 12px; 
  font-weight: 700; 
  padding: 5px 12px; 
  border-radius: 5px; 
}