:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --card: #ffffff;
  --primary: #1e3a8a;
  --secondary: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #38bdf8;
}

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

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--secondary);
  line-height: 1.6;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(120deg, #0f172a, #1e3a8a);
  color: #fff;
  padding: 36px 0 28px;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: #c7d2fe;
  margin-bottom: 8px;
}

.subtitle {
  max-width: 720px;
  color: #e2e8f0;
  margin-top: 8px;
  white-space: nowrap;
}

.header-badge {
  background: rgba(255, 255, 255, 0.15);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  align-self: center;
}

.lang-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-toggle a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-toggle a.active {
  background: rgba(255, 255, 255, 0.2);
}

.main-layout {
  padding: 32px 0 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card,
.wizard-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.card h2,
.wizard-card h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input,
select,
textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: "Inter", sans-serif;
}

textarea {
  resize: vertical;
}

input:disabled {
  background: #f1f5f9;
}

small {
  font-size: 0.78rem;
  color: var(--muted);
}

.loading-text {
  min-height: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
}

.loading-text::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #cbd5f5;
  border-top-color: #1e3a8a;
  animation: spin 0.8s linear infinite;
  opacity: 0;
}

.loading-text.is-loading::before {
  opacity: 1;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.module-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.module-card::after,
.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% + 8px);
  background: #0f172a;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: pre-line;
  z-index: 10;
}

.module-card.show-tooltip::after,
.has-tooltip.show-tooltip::after {
  opacity: 1;
  transform: translateY(0);
}

.module-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.module-title h4 {
  font-size: 1rem;
}

.module-price {
  font-weight: 700;
  color: var(--primary);
}

.tag {
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.summary-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: #f8fafc;
}

.summary-box h4 {
  margin-bottom: 8px;
}

.summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.summary-item strong {
  color: var(--primary);
}

.selected-modules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.9rem;
}

.selected-modules span {
  background: #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
}

.cta-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.primary-btn,
.ghost-btn {
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

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

.primary-btn:hover {
  background: #1d4ed8;
}

.ghost-btn {
  background: #e2e8f0;
  color: #0f172a;
}

.ghost-btn:hover {
  background: #cbd5f5;
}

.toast {
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #16a34a;
  font-weight: 600;
}

.toast.show {
  opacity: 1;
}

.terms-list {
  margin-top: 12px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.wizard-progress {
  display: flex;
  gap: 8px;
}

.wizard-overview {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.wizard-overview.simple {
  justify-content: center;
}

.wizard-visual {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
  width: min(900px, 100%);
}

.wizard-visual.large {
  width: min(1100px, 100%);
}

.wizard-visual img {
  width: 100%;
  max-width: 980px;
  border-radius: 18px;
  object-fit: cover;
}

.visual-caption {
  font-size: 0.95rem;
  color: var(--muted);
}

.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-weight: 600;
}

.step-indicator.active {
  background: var(--primary);
  color: #fff;
}

.wizard-step {
  display: none;
  animation: fadeIn 0.2s ease;
}

.wizard-step.active {
  display: block;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.query-table {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.query-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.6fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.has-tooltip {
  position: relative;
}

.module-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.query-row input {
  width: 100%;
}

.query-control {
  display: grid;
  gap: 6px;
}

.query-range {
  accent-color: var(--primary);
}

.info-box {
  margin-top: 16px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1e3a8a;
}

.info-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── 견적서 생성 박스 ── */
.quote-generate-box {
  margin-top: 20px;
  border: 2px dashed #c7d2fe;
  border-radius: 16px;
  padding: 28px 24px;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.generate-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
}

.generate-icon {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.generate-info strong {
  font-size: 1.05rem;
  color: #1e3a8a;
  display: block;
  margin-bottom: 4px;
}

.generate-btn {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(30, 58, 138, 0.3);
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.generate-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.4);
}

.generate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ── 견적서 액션 박스 ── */
.quote-actions-box {
  margin-top: 20px;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  padding: 0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.quote-actions-header {
  background: linear-gradient(135deg, #dcfce7, #d1fae5);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #bbf7d0;
}

.success-badge {
  font-size: 1rem;
  font-weight: 700;
  color: #15803d;
}

.small-btn {
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
}

/* ── PDF 미리보기 ── */
.pdf-preview-wrap {
  padding: 20px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  max-height: 640px;
  overflow-y: auto;
}

.pdf-doc {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(15,23,42,0.12);
  padding: 0;
  font-family: "Inter", sans-serif;
}

/* PDF 문서 내부 스타일 */
.pdf-page {
  padding: 32px 36px;
  font-size: 12px;
  color: #0f172a;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 3px solid #1e3a8a;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.pdf-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: 0.08em;
}

.pdf-logo-sub {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.pdf-doc-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  letter-spacing: 0.15em;
}

.pdf-doc-subtitle {
  font-size: 11px;
  color: #64748b;
  text-align: right;
  letter-spacing: 0.2em;
}

.pdf-meta-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.pdf-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-value {
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
}

.pdf-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.pdf-party {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
}

.party-label {
  font-size: 10px;
  font-weight: 700;
  color: #1e3a8a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.pdf-page .info-table {
  width: 100%;
  border-collapse: collapse;
}

.pdf-page .info-table td {
  padding: 4px 6px;
  font-size: 11px;
}

.pdf-page .info-table td:first-child {
  color: #64748b;
  width: 35%;
}

.pdf-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  border-left: 3px solid #1e3a8a;
  padding-left: 8px;
  margin: 14px 0 8px;
}

.pdf-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.pdf-items-table th {
  background: #1e3a8a;
  color: #fff;
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 600;
  text-align: left;
}

.pdf-items-table th.center { text-align: center; }
.pdf-items-table th.right  { text-align: right; }

.pdf-items-table td {
  padding: 6px 8px;
  font-size: 11px;
  border-bottom: 1px solid #f1f5f9;
}

.pdf-items-table td.center { text-align: center; }
.pdf-items-table td.right  { text-align: right; }

.pdf-items-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.pdf-items-table .subtotal-row td {
  border-top: 1px solid #e2e8f0;
  padding: 6px 8px;
  font-size: 11px;
}

.pdf-items-table .total-row td {
  background: #eff6ff;
  padding: 8px;
  font-weight: 700;
}

.grand-total {
  font-size: 15px;
  color: #1e3a8a;
}

.pdf-page .note {
  font-size: 10px;
  color: #64748b;
  margin-bottom: 10px;
}

.pdf-terms {
  margin-bottom: 16px;
}

.pdf-terms ul {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdf-terms li {
  font-size: 11px;
  color: #334155;
}

.pdf-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 8px;
}

.pdf-footer-note {
  margin-top: 3px;
  font-size: 9px;
}

/* ── 발송 액션 영역 ── */
.quote-send-area {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.send-action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
}

.print-btn {
  background: #0f172a;
  color: #fff;
}

.print-btn:hover {
  background: #1e293b;
}

.send-email-row {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.email-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-input-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.email-input-wrap {
  display: flex;
  gap: 10px;
}

.email-input-wrap input {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: "Inter", sans-serif;
}

.email-btn {
  background: #0ea5e9;
  color: #fff;
  white-space: nowrap;
  padding: 10px 20px;
}

.email-btn:hover {
  background: #0284c7;
}

/* 기타 하단 버튼 */
.cta-row.bottom-actions {
  padding: 16px 20px;
}

.quote-actions-box .cta-row {
  padding: 12px 20px 16px;
}

.save-status {
  padding: 0 20px 12px;
  font-size: 0.9rem;
  min-height: 20px;
  font-weight: 500;
}

.save-status.success { color: #16a34a; }
.save-status.error   { color: #dc2626; }
.save-status.loading { color: #1e3a8a; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  width: min(520px, 92%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-content {
  width: min(640px, 92%);
  flex-direction: row;
  gap: 18px;
  align-items: center;
}

.notice-visual img {
  width: 180px;
  border-radius: 14px;
}

.notice-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 900px) {
  .wizard-visual {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .subtitle {
    white-space: normal;
  }
  .wizard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .query-row {
    grid-template-columns: 1fr;
  }
  .lang-toggle {
    margin-top: 0;
  }
  .notice-content {
    flex-direction: column;
    text-align: center;
  }
  .quote-generate-box {
    flex-direction: column;
    align-items: stretch;
  }
  .generate-btn {
    width: 100%;
    text-align: center;
  }
  .pdf-meta-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .pdf-parties {
    grid-template-columns: 1fr;
  }
  .email-input-wrap {
    flex-direction: column;
  }
  .email-btn {
    width: 100%;
  }
  .send-action-row {
    flex-direction: column;
  }
  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── AI 학습 UI ─────────────────────────────────────── */

/* Footer with learn button */
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.learn-fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(99,102,241,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.01em;
}
.learn-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99,102,241,0.5);
}
.learn-fab:active { transform: translateY(0); }

/* Learn modal */
.learn-modal-content {
  max-width: 600px;
  width: 96%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
}

.learn-header {
  align-items: flex-start;
  gap: 12px;
}
.learn-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.learn-icon-lg { font-size: 28px; line-height: 1; margin-top: 2px; }
.learn-header h3 { margin: 0 0 3px; font-size: 17px; color: #1e293b; }
.learn-subtitle { margin: 0; font-size: 12px; color: #64748b; }

/* Sections */
.learn-section { margin-bottom: 20px; }
.learn-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.learn-hint {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 10px;
  line-height: 1.5;
}

/* Intensity selector */
.intensity-track { display: flex; flex-direction: column; gap: 6px; }
.intensity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  padding: 0 2px;
}
.intensity-btns {
  display: flex;
  gap: 8px;
}
.int-btn {
  flex: 1;
  height: 40px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 15px;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.int-btn:hover { border-color: #6366f1; color: #6366f1; background: #eef2ff; }
.int-btn.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: #6366f1;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}
.int-btn[data-val="4"].active { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: #f59e0b; box-shadow: 0 2px 8px rgba(245,158,11,0.35); }
.int-btn[data-val="5"].active { background: linear-gradient(135deg, #ef4444, #dc2626); border-color: #ef4444; box-shadow: 0 2px 8px rgba(239,68,68,0.35); }

.intensity-desc {
  font-size: 12px;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 8px;
  padding: 7px 12px;
  margin: 4px 0 0;
  font-weight: 500;
  border-left: 3px solid #6366f1;
  transition: all 0.2s;
}
.intensity-desc.warn { color: #92400e; background: #fef3c7; border-left-color: #f59e0b; }
.intensity-desc.danger { color: #991b1b; background: #fee2e2; border-left-color: #ef4444; }

/* Example chips */
.learn-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.example-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.example-chip:hover {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4f46e5;
}

/* Textarea */
.learn-textarea {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
  color: #1e293b;
  background: #fafafa;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.learn-textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}
.learn-counter {
  text-align: right;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}
.learn-counter.over { color: #ef4444; font-weight: 700; }

/* History */
.learn-history-section { border-top: 1px solid #f1f5f9; padding-top: 16px; }
.learn-history-list { display: flex; flex-direction: column; gap: 8px; }
.learn-history-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.learn-hist-badge {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.learn-hist-badge.warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.learn-hist-badge.danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.learn-hist-body { flex: 1; min-width: 0; }
.learn-hist-summary { font-size: 12px; font-weight: 600; color: #1e293b; margin: 0 0 2px; }
.learn-hist-date { font-size: 11px; color: #94a3b8; }

/* Result */
.learn-result {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.learn-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.learn-result-icon { font-size: 18px; }
.learn-result-header strong { font-size: 14px; color: #14532d; }
.learn-result-summary { font-size: 12px; color: #166534; margin: 0 0 10px; line-height: 1.5; }
.learn-result-applied {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.applied-tag {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* Actions */
.learn-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}
.learn-right-actions { display: flex; gap: 8px; align-items: center; }
.learn-submit-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  min-width: 110px;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 10px;
}
.learn-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
.learn-submit-btn.loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Step hints strip */
.step-hint-strip {
  background: linear-gradient(90deg, #eef2ff, #f0f9ff);
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 11.5px;
  color: #4338ca;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  animation: fadeInHint 0.4s ease;
}
@keyframes fadeInHint {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.step-hint-strip .hint-icon { font-size: 14px; flex-shrink: 0; }

@media (max-width: 540px) {
  .intensity-labels { display: none; }
  .learn-modal-content { max-height: 95vh; }
  .learn-actions { flex-direction: column; align-items: stretch; }
  .learn-right-actions { justify-content: flex-end; }
}

/* ── 학습 모달 탭 ───────────────────────────────────────── */
.learn-tabs {
  display: flex;
  border-bottom: 2px solid #e2e8f0;
  margin: 0 -28px 0;
  padding: 0 28px;
  background: #f8fafc;
  gap: 0;
}
.learn-tab {
  position: relative;
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.learn-tab:hover { color: #6366f1; }
.learn-tab.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
  background: #fff;
  border-radius: 8px 8px 0 0;
}

/* ── 매뉴얼 패널 ────────────────────────────────────────── */
.manual-panel-body {
  padding: 20px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.manual-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
  color: #fff;
}
.manual-hero-icon { font-size: 36px; line-height: 1; flex-shrink: 0; }
.manual-hero h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.manual-hero p { font-size: 13px; opacity: .88; line-height: 1.5; }

.manual-section {
  margin-bottom: 18px;
}
.manual-section p, .manual-section li {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.65;
}

.manual-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 강도 미니 그리드 */
.manual-int-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.manual-int-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 9px 12px;
}
.manual-int-badge {
  width: 26px; height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.manual-int-item > div {
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
}
.manual-int-item strong { color: #1e293b; }
.manual-rec {
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  background: #f0fdf4;
  color: #15803d;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
}
.manual-rec.warn  { background: #fffbeb; color: #d97706; }
.manual-rec.danger { background: #fef2f2; color: #dc2626; }

/* 예시 박스 */
.manual-ex {
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.manual-ex.good {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  color: #166534;
}
.manual-ex.bad {
  background: #fef2f2;
  border-left: 3px solid #f87171;
  color: #991b1b;
}
.manual-tip {
  font-size: 12.5px;
  color: #6366f1;
  background: #f5f3ff;
  border-radius: 8px;
  padding: 9px 13px;
  margin-top: 8px;
  line-height: 1.5;
}

/* 주의사항 */
.manual-caution-list {
  padding-left: 18px;
  margin: 0;
}
.manual-caution-list li {
  font-size: 13px;
  color: #475569;
  margin-bottom: 5px;
  line-height: 1.55;
}

/* 전체 가이드 링크 버튼 */
.manual-full-link-wrap {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}
.manual-full-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s, transform .12s;
  box-shadow: 0 3px 12px rgba(99,102,241,.3);
}
.manual-full-link:hover {
  opacity: .92;
  transform: translateY(-1px);
  text-decoration: none;
}

/* learn-panel 간격 */
#learn-panel-train { padding-top: 4px; }

@media (max-width: 540px) {
  .learn-tabs { margin: 0 -18px; padding: 0 18px; }
  .learn-tab { padding: 10px 14px; font-size: 13px; }
  .manual-int-grid { gap: 6px; }
}
