/* ═══════════════════════════════════════════════════════
   닥터세이프 - 카페24 정적 HTML 버전 스타일시트
   ═══════════════════════════════════════════════════════ */

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  background: #f8fafb;
  color: #1a2332;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; }

/* ─── CSS Variables ─── */
:root {
  --primary: #0d9488;
  --primary-light: #ccfbf1;
  --primary-dark: #0f766e;
  --primary-fg: #ffffff;
  --bg: #f8fafb;
  --card-bg: #ffffff;
  --text: #1a2332;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 0.625rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --chart-1: #0d9488;
  --chart-2: #3b82f6;
  --chart-3: #10b981;
  --chart-4: #f59e0b;
  --chart-5: #ef4444;
  --chart-6: #8b5cf6;
  --container-max: 1280px;
}

/* ─── Container ─── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ─── Header ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.nav { display: flex; gap: 0.25rem; }
.nav a, .nav button {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.nav a:hover, .nav button:hover { background: var(--primary-light); color: var(--primary); }
.nav a.active { background: var(--primary-light); color: var(--primary); }
.mobile-menu-btn { display: none; padding: 0.5rem; }
.mobile-nav { display: none; }

@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-menu-btn { display: block; }
  .mobile-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow-md);
  }
  .mobile-nav.open { display: flex; flex-direction: column; gap: 0.5rem; }
  .mobile-nav a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
  }
  .mobile-nav a:hover { background: var(--primary-light); }
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 1.5rem 0;
  margin-top: 4rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ─── Hero Section ─── */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .hero h1 { font-size: 3.25rem; }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
  background: white;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

/* ─── Cards ─── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-header { margin-bottom: 1rem; }
.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── Feature Grid ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}
.feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all 0.3s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.875rem; color: var(--text-muted); }

/* ─── Specialties ─── */
.specialties {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 2rem 0;
}
.specialty-badge {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.specialty-badge:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ─── Steps ─── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
  text-align: center;
}
.step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
}
.step h3 { font-weight: 700; margin-bottom: 0.5rem; }
.step p { font-size: 0.875rem; color: var(--text-muted); }

/* ─── Form Page ─── */
.form-page {
  padding: 3rem 0;
  max-width: 640px;
  margin: 0 auto;
}
.form-page h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.5rem; }
.form-page .subtitle { color: var(--text-muted); margin-bottom: 2rem; }
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.form-label .optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}
.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}
.form-helper { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.5rem; }
.form-submit { width: 100%; margin-top: 1.5rem; }

/* ─── Result Dashboard ─── */
.result-page { padding: 2rem 0; }
.result-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.result-header h1 { font-size: 1.5rem; font-weight: 800; }
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.result-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Score Section */
.score-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 768px) { .score-section { grid-template-columns: 1fr; } }

.score-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.gauge-circle {
  position: relative;
  width: 180px;
  height: 180px;
}
.gauge-circle svg { transform: rotate(-90deg); }
.gauge-circle .bg-ring { stroke: #e2e8f0; }
.gauge-circle .score-ring { transition: stroke-dashoffset 1.5s ease-out; }
.gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gauge-value .number { font-size: 3rem; font-weight: 800; color: var(--primary); }
.gauge-value .max { font-size: 0.875rem; color: var(--text-muted); }
.gauge-label { margin-top: 0.75rem; font-weight: 700; }
.gauge-grade { font-size: 0.875rem; color: var(--primary); font-weight: 600; }

/* Channel Summary Cards */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.channel-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.channel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.channel-card-header h4 { font-weight: 600; font-size: 0.875rem; }
.channel-card-header .score { font-size: 1.5rem; font-weight: 800; }
.channel-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0;
  font-size: 0.8125rem;
}
.channel-metric .label { color: var(--text-muted); }
.channel-metric .value { font-weight: 600; }
.progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width 1s ease-out;
}

/* Channel Detail Tabs */
.tabs { margin-bottom: 2rem; }
.tab-list {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Detail Table */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.detail-table th, .detail-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.detail-table th { font-weight: 600; background: #f8fafc; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}
.status-good { background: #10b981; }
.status-warning { background: #f59e0b; }
.status-bad { background: #ef4444; }

/* Recommendations */
.recommendations {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--primary-light);
  border-radius: var(--radius);
}
.recommendations h5 { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.5rem; color: var(--primary-dark); }
.recommendations li {
  font-size: 0.8125rem;
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
}
.recommendations li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* Competitor Table */
.competitor-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.competitor-table th, .competitor-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}
.competitor-table th { font-weight: 600; background: #f8fafc; font-size: 0.75rem; }
.competitor-table .my-row { background: rgba(13,148,136,0.05); font-weight: 600; }
.strength-tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 4px;
  font-size: 0.6875rem;
  margin: 0.125rem;
}

/* Strengths / Weaknesses */
.analysis-section { margin-bottom: 2rem; }
.analysis-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.analysis-cards { display: grid; gap: 1rem; }
.analysis-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.analysis-card h4 { font-weight: 600; margin-bottom: 0.5rem; }
.analysis-card p { font-size: 0.875rem; color: var(--text-muted); }
.impact-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-left: 0.5rem;
}
.impact-high { background: #fee2e2; color: #dc2626; }
.impact-medium { background: #fef3c7; color: #d97706; }
.impact-low { background: #d1fae5; color: #059669; }

/* Solutions */
.solution-list { display: grid; gap: 1rem; }
.solution-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
}
.solution-number {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.solution-content h4 { font-weight: 600; margin-bottom: 0.375rem; }
.solution-content p { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.solution-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.solution-meta span {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: #f1f5f9;
  border-radius: 4px;
  color: var(--text-muted);
}

/* Budget Section */
.budget-section { margin-bottom: 2rem; }
.budget-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 480px) { .budget-totals { grid-template-columns: 1fr; } }
.budget-total-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.budget-total-card .label { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.budget-total-card .amount { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.budget-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) { .budget-charts { grid-template-columns: 1fr; } }
.budget-table {
  width: 100%;
  border-collapse: collapse;
}
.budget-table th, .budget-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}
.budget-table th { font-weight: 600; background: #f8fafc; }

/* Chart Containers */
.chart-container {
  position: relative;
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Keyword Analysis */
.keyword-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.keyword-table th, .keyword-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}
.keyword-table th { font-weight: 600; background: #f8fafc; }
.opportunity-high { color: #059669; font-weight: 600; }
.opportunity-medium { color: #d97706; }
.opportunity-low { color: #64748b; }

/* Loading State */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 1rem; font-weight: 500; color: var(--text-muted); }

/* Page Transitions */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary), #0f766e);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  color: white;
  margin: 3rem 0;
}
.cta-section h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.75rem; }
.cta-section p { opacity: 0.9; margin-bottom: 1.5rem; }
.btn-white { background: white; color: var(--primary); }
.btn-white:hover { background: #f0fdfa; }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


/* ─── Score Evidence & Grade Legend ─── */
.score-gauge {
  justify-content: flex-start;
}
.score-band-legend {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 20px;
}
.score-band {
  min-height: 58px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
}
.score-band.active {
  border-color: var(--band-color, var(--primary));
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(13,148,136,0.12);
  color: var(--text);
}
.score-band-range {
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}
.score-band-label {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}
.score-reasons {
  width: 100%;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  text-align: left;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.035);
}

.score-reasons h4 {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.score-reasons ul {
  display: grid;
  gap: 7px;
}
.score-reasons li {
  position: relative;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.score-reasons li::before {
  content: "•";
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--primary);
  font-weight: 800;
}

.channel-card-header .score-unit {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.channel-reason {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  word-break: keep-all;
}

@media (max-width: 560px) {
  .score-band-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .score-band:last-child {
    grid-column: 1 / -1;
  }
}

@media print {
  .score-band-legend {
    grid-template-columns: repeat(5, 1fr);
  }
  .score-reasons,
  .channel-reason {
    break-inside: avoid;
  }
}

/* ─── Diagnosis Memo Workspace ─── */
.memo-workspace {
  margin-bottom: 2rem;
  padding: 1.75rem;
  border: 2px solid rgba(13, 148, 136, 0.35);
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 180px);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.08);
}
.memo-workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.memo-workspace-kicker {
  display: inline-flex;
  margin-bottom: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.6875rem;
  font-weight: 700;
}
.memo-workspace-header h2 {
  margin-bottom: 0.375rem;
  font-size: 1.375rem;
  font-weight: 800;
}
.memo-workspace-header p {
  max-width: 720px;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
}
.memo-save-all-btn {
  flex-shrink: 0;
}
.memo-workspace-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  background: #f0f9ff;
  color: #0c4a6e;
  font-size: 0.75rem;
}
.memo-workspace-notice strong {
  flex-shrink: 0;
}
.memo-workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.memo-workspace-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.memo-workspace-save-status {
  font-size: 0.75rem;
}

/* ─── Diagnosis Memo System ─── */
.diagnosis-memo {
  width: 100%;
  margin-top: 0;
  padding: 1.125rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  text-align: left;
}
.memo-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.memo-title-group {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.memo-order {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}
.memo-title-row h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}
.memo-item-save-status {
  flex-shrink: 0;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 600;
}
.memo-item-save-status.saved {
  background: #d1fae5;
  color: #047857;
}
.memo-save-status {
  flex-shrink: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.memo-save-status.saving { color: #d97706; }
.memo-save-status.saved { color: #059669; }
.memo-save-status.warning { color: #dc2626; }
.memo-auto-box {
  padding: 0.875rem 1rem;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #ffffff;
}
.memo-type-label {
  margin-bottom: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}
.memo-auto-box p {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #334155;
}
.memo-manual-label {
  display: block;
  margin-top: 0.875rem;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}
.memo-manual-textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.memo-manual-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}
.memo-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}
.memo-action-btn {
  padding: 0.4375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.memo-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.memo-action-btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}
.memo-action-btn.primary:hover {
  background: var(--primary-dark);
  color: #ffffff;
}
.memo-action-btn.danger {
  color: #b91c1c;
}
.memo-action-btn.danger:hover {
  border-color: #ef4444;
  color: #dc2626;
}
.consultation-memo-card > .diagnosis-memo {
  margin-top: 0;
}

@media (max-width: 900px) {
  .memo-workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .memo-workspace {
    padding: 1rem;
  }
  .memo-workspace-header {
    flex-direction: column;
  }
  .memo-save-all-btn {
    width: 100%;
    justify-content: center;
  }
  .memo-workspace-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
  .memo-workspace-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .memo-workspace-footer .btn {
    justify-content: center;
  }

  .memo-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
  .memo-actions {
    justify-content: stretch;
  }
  .memo-action-btn {
    flex: 1;
  }
}


/* ─── 진료과별 마케팅 진단 ─── */
.specialty-diagnosis-card {
  margin-bottom: 2rem;
  padding: 1.75rem;
  border-color: rgba(13, 148, 136, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f8fffd 100%);
}
.specialty-diagnosis-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
}
.specialty-diagnosis-kicker {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.specialty-diagnosis-header h2 {
  font-size: 1.375rem;
  line-height: 1.35;
}
.specialty-diagnosis-badge {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
}
.specialty-diagnosis-summary {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border-left: 3px solid var(--primary);
  background: rgba(13, 148, 136, 0.06);
  color: var(--text);
  font-size: 0.9375rem;
}
.specialty-diagnosis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.specialty-diagnosis-item {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
}
.specialty-diagnosis-item h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
}
.specialty-diagnosis-item p,
.specialty-diagnosis-item li {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.65;
}
.specialty-diagnosis-item ul {
  display: grid;
  gap: 0.25rem;
}
.specialty-diagnosis-item li {
  position: relative;
  padding-left: 0.875rem;
}
.specialty-diagnosis-item li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
}
.specialty-keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.specialty-keyword-list span {
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.specialty-prescription,
.specialty-consultation-point {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
}
.specialty-prescription {
  background: var(--primary-light);
}
.specialty-consultation-point {
  margin-top: 0.625rem;
  background: #f8fafc;
  border: 1px solid var(--border);
}
.specialty-prescription strong,
.specialty-consultation-point strong {
  color: var(--primary-dark);
  font-size: 0.8125rem;
}
.specialty-prescription p,
.specialty-consultation-point p {
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .specialty-diagnosis-card {
    padding: 1.25rem;
  }
  .specialty-diagnosis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .specialty-diagnosis-header {
    flex-direction: column;
  }
  .specialty-prescription,
  .specialty-consultation-point {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media print {
  .memo-workspace {
    padding: 0;
    border: none;
    box-shadow: none;
    background: #ffffff !important;
  }
  .memo-workspace-grid {
    grid-template-columns: 1fr;
  }
  .memo-workspace-header p,
  .memo-workspace-notice,
  .memo-workspace-footer,
  .memo-save-all-btn {
    display: none !important;
  }
  .memo-actions,
  .memo-save-status,
  .tab-list,
  .result-header button,
  .result-page > div:last-child,
  .footer,
  .header {
    display: none !important;
  }
  .tab-content {
    display: block !important;
    page-break-inside: auto;
  }
  .diagnosis-memo {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .memo-manual-textarea {
    min-height: 72px;
    overflow: visible;
    resize: none;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
