@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

/* ──────────────────────────────────────────────────────────────────
   Consult Suite — clinical design system
   monochrome (charcoal/grays) + restrained navy accent
   ────────────────────────────────────────────────────────────────── */

:root {
    --ink-900: #0a0a0b;
    --ink-800: #16181d;
    --ink-700: #1f2330;
    --ink-600: #374151;
    --ink-500: #4b5563;
    --ink-400: #6b7280;
    --ink-300: #9ca3af;
    --ink-200: #e5e7eb;
    --ink-150: #eef0f3;
    --ink-100: #f4f5f7;
    --ink-50:  #fafafb;
    --bg:      #ffffff;
    --accent:  #1c2435;       /* 차콜 베이스 강조 */
    --navy:    #1e3a5f;       /* 절제된 네이비 */
    --navy-50: #f1f4f9;
    --alert:   #b91c1c;
    --warn:    #b45309;
    --ok:      #15803d;
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --shadow-xs: 0 1px 2px rgba(10, 12, 20, .04);
    --shadow-sm: 0 1px 3px rgba(10, 12, 20, .05), 0 1px 2px rgba(10, 12, 20, .03);
    --shadow-md: 0 6px 22px rgba(10, 12, 20, .06), 0 2px 6px rgba(10, 12, 20, .04);
    --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'Noto Sans KR', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink-700);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.75;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── 헤더·푸터 ───────────────────────────────────────────────── */
.cs-shell { min-height: 100vh; display: flex; flex-direction: column; }
.cs-header {
    border-bottom: 1px solid var(--ink-200);
    background: var(--bg);
    position: sticky; top: 0; z-index: 30;
    backdrop-filter: saturate(180%) blur(12px);
    background: rgba(255, 255, 255, 0.94);
}
.cs-header-inner {
    max-width: 1200px; margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; gap: 18px;
}
.cs-brand {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--ink-900); text-decoration: none;
    font-weight: 700; letter-spacing: -0.02em;
}
.cs-brand-mark {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ink-900); color: #fff; border-radius: 6px;
}
.cs-brand-name { font-size: 15px; }
.cs-brand-sub  { font-size: 12px; color: var(--ink-400); font-weight: 500; margin-left: 2px; }

.cs-nav { display: flex; gap: 4px; margin-left: 6px; flex-wrap: wrap; }
.cs-nav a {
    color: var(--ink-500); text-decoration: none;
    padding: 6px 10px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 4px;
}
.cs-nav a:hover { color: var(--ink-900); background: var(--ink-100); }
.cs-nav a.is-active { color: var(--ink-900); background: var(--ink-100); }

.cs-spacer { flex: 1; }
.cs-lang {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--ink-500); font-size: 13px;
}
.cs-lang select {
    appearance: none; border: 1px solid var(--ink-200);
    background: var(--bg); padding: 5px 28px 5px 10px;
    border-radius: var(--radius-sm); font-size: 13px;
    color: var(--ink-700); cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat; background-position: right 8px center;
}

.cs-main { flex: 1; padding: 32px 24px 64px; max-width: 1200px; margin: 0 auto; width: 100%; }

.cs-footer {
    border-top: 1px solid var(--ink-200);
    padding: 24px;
    background: var(--ink-50);
    color: var(--ink-400);
    font-size: 12.5px;
}
.cs-footer-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 16px; flex-wrap: wrap; }
.cs-footer-inner > span { line-height: 1.7; }

/* ── 타이포 ──────────────────────────────────────────────────── */
.cs-kicker {
    font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--ink-400);
}
.cs-h1 { font-size: 32px; font-weight: 700; line-height: 1.25; letter-spacing: -0.025em; color: var(--ink-900); margin: 0 0 12px; }
.cs-h2 { font-size: 22px; font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; color: var(--ink-900); margin: 28px 0 12px; }
.cs-h3 { font-size: 17px; font-weight: 700; line-height: 1.45; letter-spacing: -0.015em; color: var(--ink-900); margin: 22px 0 8px; }
.cs-h4 { font-size: 14px; font-weight: 700; color: var(--ink-700); margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.cs-lede { font-size: 16.5px; color: var(--ink-500); line-height: 1.75; margin: 0 0 18px; }
.cs-mute { color: var(--ink-400); }
.cs-mono { font-family: var(--font-mono); }

/* ── 카드 ────────────────────────────────────────────────────── */
.cs-card {
    background: var(--bg); border: 1px solid var(--ink-200);
    border-radius: var(--radius); padding: 22px 24px;
    box-shadow: var(--shadow-xs);
}
.cs-card--quiet { background: var(--ink-50); border-color: var(--ink-150); }
.cs-card--accent { border-color: var(--ink-900); }
.cs-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px;
}
.cs-card-title { font-size: 16px; font-weight: 700; color: var(--ink-900); margin: 0; }
.cs-card-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-150); }

/* ── 그리드 ──────────────────────────────────────────────────── */
.cs-grid { display: grid; gap: 16px; }
.cs-grid--2 { grid-template-columns: repeat(2, 1fr); }
.cs-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cs-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .cs-grid--2, .cs-grid--3, .cs-grid--4 { grid-template-columns: 1fr; }
}

/* ── 버튼 ────────────────────────────────────────────────────── */
.cs-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; font-size: 14px; font-weight: 600;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    cursor: pointer; text-decoration: none;
    font-family: inherit; transition: all .12s ease;
    background: var(--accent); color: #fff;
    line-height: 1; letter-spacing: -0.005em;
}
.cs-btn:hover { background: #000; }
.cs-btn--ghost { background: var(--bg); color: var(--ink-700); border-color: var(--ink-200); }
.cs-btn--ghost:hover { background: var(--ink-50); border-color: var(--ink-400); }
.cs-btn--text  { background: transparent; color: var(--ink-600); padding: 6px 8px; }
.cs-btn--text:hover { color: var(--ink-900); }
.cs-btn--navy  { background: var(--navy); }
.cs-btn--navy:hover { background: #16304f; }
.cs-btn--sm   { padding: 7px 12px; font-size: 13px; }
.cs-btn--lg   { padding: 14px 24px; font-size: 15px; }
.cs-btn--block { width: 100%; }
.cs-btn[disabled] { opacity: .55; cursor: not-allowed; }

.cs-btn-icon { width: 16px; height: 16px; }
.cs-btn-icon-lg { width: 18px; height: 18px; }

/* ── 입력 ────────────────────────────────────────────────────── */
.cs-field { margin-bottom: 14px; }
.cs-label {
    display: block; font-size: 12.5px; color: var(--ink-700);
    font-weight: 600; margin-bottom: 5px; letter-spacing: -0.005em;
}
.cs-input, .cs-select, .cs-textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
    background: var(--bg); font-size: 14px; font-family: inherit;
    color: var(--ink-900); line-height: 1.5;
    transition: border-color .12s, box-shadow .12s;
}
.cs-input:focus, .cs-select:focus, .cs-textarea:focus {
    outline: none; border-color: var(--ink-900);
    box-shadow: 0 0 0 3px rgba(28, 36, 53, 0.08);
}
.cs-textarea { min-height: 96px; resize: vertical; }
.cs-help { font-size: 12px; color: var(--ink-400); margin: 4px 0 0; }

/* ── 표 ──────────────────────────────────────────────────────── */
.cs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cs-table th {
    text-align: left; padding: 10px 12px;
    border-bottom: 1px solid var(--ink-200);
    color: var(--ink-500); font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.cs-table td {
    padding: 12px; border-bottom: 1px solid var(--ink-150);
    vertical-align: top; color: var(--ink-700);
}
.cs-table tr:hover td { background: var(--ink-50); }

/* ── 태그·배지 ───────────────────────────────────────────────── */
.cs-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 600;
    padding: 2px 8px; border-radius: 99px;
    background: var(--ink-100); color: var(--ink-700);
    letter-spacing: -0.005em;
}
.cs-tag--ok    { background: #ecfdf5; color: #047857; }
.cs-tag--info  { background: #eff6ff; color: #1d4ed8; }
.cs-tag--warn  { background: #fffbeb; color: #b45309; }
.cs-tag--alert { background: #fef2f2; color: #b91c1c; }
.cs-tag--mute  { background: var(--ink-100); color: var(--ink-500); }
.cs-tag--accent{ background: var(--accent); color: #fff; }
.cs-tag-dot {
    width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

/* ── 통계 그리드 ─────────────────────────────────────────────── */
.cs-stat {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px;
}
.cs-stat-label { font-size: 11.5px; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.cs-stat-num   { font-size: 28px; font-weight: 700; color: var(--ink-900); line-height: 1.1; letter-spacing: -0.02em; }
.cs-stat-sub   { font-size: 12px; color: var(--ink-500); }

/* ── 단계 인디케이터 ─────────────────────────────────────────── */
.cs-steps { display: flex; gap: 0; align-items: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 4px 0 12px; }
.cs-step {
    flex: 1; min-width: 80px; position: relative;
    text-align: center; padding: 8px 4px 0;
    font-size: 11.5px; color: var(--ink-400);
}
.cs-step::before {
    content: ""; position: absolute; top: 12px; right: 50%; left: -50%;
    height: 1px; background: var(--ink-200);
}
.cs-step:first-child::before { display: none; }
.cs-step-num {
    width: 24px; height: 24px; margin: 0 auto 6px;
    border-radius: 50%; background: var(--ink-100);
    border: 1px solid var(--ink-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 700; color: var(--ink-500);
    position: relative; z-index: 1;
}
.cs-step--active { color: var(--ink-900); font-weight: 600; }
.cs-step--active .cs-step-num {
    background: var(--ink-900); color: #fff; border-color: var(--ink-900);
}
.cs-step--done { color: var(--ink-700); }
.cs-step--done .cs-step-num {
    background: var(--ink-700); color: #fff; border-color: var(--ink-700);
}
.cs-step--done::before, .cs-step--active::before { background: var(--ink-700); }

/* ── 히어로 ──────────────────────────────────────────────────── */
.cs-hero {
    padding: 56px 0 32px;
    border-bottom: 1px solid var(--ink-200);
    margin-bottom: 32px;
}
.cs-hero-inner { max-width: 760px; }
.cs-hero h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.03em; margin: 8px 0 16px; font-weight: 700; color: var(--ink-900); }
.cs-hero p { font-size: 17.5px; color: var(--ink-500); line-height: 1.7; margin: 0 0 22px; }
.cs-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ── 서비스 카드 ─────────────────────────────────────────────── */
.cs-service-card {
    display: flex; flex-direction: column;
    background: var(--bg); border: 1px solid var(--ink-200);
    border-radius: var(--radius); padding: 24px;
    text-decoration: none; color: inherit;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    min-height: 200px;
}
.cs-service-card:hover {
    transform: translateY(-2px);
    border-color: var(--ink-900);
    box-shadow: var(--shadow-md);
}
.cs-service-card .cs-svc-icon {
    width: 32px; height: 32px; color: var(--ink-900); margin-bottom: 16px;
}
.cs-service-card h3 { font-size: 16.5px; font-weight: 700; color: var(--ink-900); margin: 0 0 8px; }
.cs-service-card p  { font-size: 13.5px; color: var(--ink-500); margin: 0 0 auto; line-height: 1.65; }
.cs-service-card .cs-svc-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-150);
    font-size: 12.5px;
}
.cs-service-card .cs-svc-cta {
    color: var(--ink-900); font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px;
}

/* ── 채팅·대화 ──────────────────────────────────────────────── */
.cs-chat-frame {
    background: var(--ink-50); border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg); padding: 24px; min-height: 480px;
    max-height: 70vh; overflow-y: auto;
}
.cs-msg { display: flex; margin-bottom: 12px; }
.cs-msg--bot { justify-content: flex-start; }
.cs-msg--user { justify-content: flex-end; }
.cs-bubble {
    max-width: 78%; padding: 12px 16px; border-radius: 14px;
    font-size: 15px; line-height: 1.65; white-space: pre-wrap;
    word-break: break-word;
}
.cs-msg--bot .cs-bubble {
    background: var(--bg); border: 1px solid var(--ink-200);
    border-bottom-left-radius: 4px;
}
.cs-msg--user .cs-bubble {
    background: var(--ink-900); color: #fff;
    border-bottom-right-radius: 4px;
}
.cs-msg-meta { font-size: 11px; color: var(--ink-400); margin-bottom: 4px; padding: 0 4px; }

/* ── 위험도 카드 ─────────────────────────────────────────────── */
.cs-risk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cs-risk-card {
    background: var(--bg); border: 1px solid var(--ink-200);
    border-radius: var(--radius); padding: 14px 18px;
}
.cs-risk-card[data-level="normal"]   { border-top: 3px solid #15803d; }
.cs-risk-card[data-level="info"]     { border-top: 3px solid #1e40af; }
.cs-risk-card[data-level="warning"]  { border-top: 3px solid #b45309; }
.cs-risk-card[data-level="critical"] { border-top: 3px solid #b91c1c; }
.cs-risk-num { font-size: 26px; font-weight: 700; color: var(--ink-900); line-height: 1.1; }
.cs-risk-lab { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
@media (max-width: 700px) { .cs-risk-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── 알림·디스클레이머 ───────────────────────────────────────── */
.cs-disclaimer {
    background: var(--ink-50); border: 1px solid var(--ink-150);
    padding: 14px 18px; border-radius: var(--radius-sm);
    color: var(--ink-500); font-size: 13px; line-height: 1.7;
    margin: 24px 0;
}
.cs-disclaimer-title { font-weight: 600; color: var(--ink-700); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }

.cs-error {
    background: #fef2f2; border: 1px solid #fecaca;
    color: #991b1b; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px;
}

/* ── 콘텐츠 타입 (Markdown 렌더) ────────────────────────────── */
.cs-prose { color: var(--ink-700); font-size: 16px; line-height: 1.8; max-width: 760px; }
.cs-prose h1, .cs-prose h2, .cs-prose h3, .cs-prose h4 { color: var(--ink-900); font-weight: 700; }
.cs-prose h2 { font-size: 24px; margin: 36px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ink-200); }
.cs-prose h3 { font-size: 18px; margin: 28px 0 10px; }
.cs-prose h4 { font-size: 15px; margin: 20px 0 6px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500); }
.cs-prose p  { margin: 12px 0; }
.cs-prose ul, .cs-prose ol { margin: 14px 0; padding-left: 24px; }
.cs-prose li { margin: 6px 0; }
.cs-prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14.5px; }
.cs-prose th { background: var(--ink-50); padding: 10px 12px; border: 1px solid var(--ink-200); text-align: left; font-weight: 600; color: var(--ink-700); }
.cs-prose td { padding: 10px 12px; border: 1px solid var(--ink-200); }
.cs-prose blockquote {
    border-left: 3px solid var(--ink-300); padding: 4px 16px; margin: 16px 0;
    color: var(--ink-500); background: var(--ink-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14.5px;
}
.cs-prose code { background: var(--ink-100); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; font-family: var(--font-mono); }
.cs-prose hr { border: 0; border-top: 1px solid var(--ink-200); margin: 32px 0; }
.cs-prose strong { color: var(--ink-900); font-weight: 700; }

/* ── 헬퍼 ────────────────────────────────────────────────────── */
.cs-row { display: flex; align-items: center; gap: 12px; }
.cs-row--end { justify-content: flex-end; }
.cs-row--between { justify-content: space-between; }
.cs-stack { display: flex; flex-direction: column; gap: 16px; }
.cs-section { margin: 36px 0; }
.cs-mt-0 { margin-top: 0 !important; }
.cs-mt-8 { margin-top: 8px; }
.cs-mt-16 { margin-top: 16px; }
.cs-mt-24 { margin-top: 24px; }
.cs-text-center { text-align: center; }
.cs-text-right  { text-align: right; }
.cs-divider { height: 1px; background: var(--ink-200); margin: 24px 0; border: 0; }

/* ── 반응형 ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .cs-main { padding: 20px 16px 48px; }
    .cs-hero { padding: 32px 0 20px; margin-bottom: 24px; }
    .cs-hero h1 { font-size: 28px; }
    .cs-hero p  { font-size: 15.5px; }
    .cs-header-inner { padding: 12px 16px; }
    .cs-nav { display: none; }
    .cs-h1 { font-size: 24px; }
}
