/* realty_assistant/static/css/style.css */
/* Notion Design System 적용 — warm neutrals, whisper borders, multi-layer shadows */

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

/* ══ KIT Design System — canonical tokens (2026-07 디자인 업그레이드) ══ */
:root {
    /* ── KIT canonical ── */
    --kit-bg: #F7F9FC;  --kit-surface: #FFFFFF;  --kit-ink: #111827;
    --kit-body: #374151;  --kit-dim: #6B7280;
    --kit-blue: #1B4FD8;  --kit-blue-soft: #EEF3FF;  --kit-blue-dark: #1640B0;
    --kit-line: #E5EAF2;
    --kit-danger: #DC2626;   /* 기존 #EF4444 → 대비 보정 */
    --kit-success: #15803D;  /* 신설 — 의미색 성공 */
    --kit-warn: #D97706;     /* 신설 — 의미색 주의 */
    --kit-radius: 14px;  --kit-radius-lg: 18px;
    --kit-shadow: 0 1px 5px rgba(15,23,42,.06);
    /* 하단 고정 내비(.kit-nav)의 실제 높이. 콘텐츠 하단 여백·sticky 요소가
       이 값을 기준으로 비켜서야 한다. 60px = 내비 콘텐츠+상단 패딩,
       뒤는 .kit-nav 의 하단 패딩 max(safe-area, 12px) 과 같은 식.
       아이폰 홈 인디케이터에서 safe-area 가 34px 까지 커지므로 상수는 금물. */
    --kit-nav-h: calc(60px + max(env(safe-area-inset-bottom), 12px));
    /* ── legacy alias (@deprecated) ── */
    --primary: var(--kit-blue);        /* @deprecated → kit-blue */
    --primary-light: var(--kit-blue-soft); /* @deprecated */
    --primary-dark: var(--kit-blue-dark);   /* 구 #1440B8 → kit-blue-dark 단일화 (검토 §4.1) */
    --danger: #d93025;
    --warning: #dd5b00;
    --success: #1aae39;
    --tip: #391c57;
    --text: rgba(0,0,0,0.95);
    --text-secondary: #615d59;
    --text-muted: #a39e98;
    --border: rgba(0,0,0,0.1);
    --bg: var(--kit-bg);               /* @deprecated → kit-bg */
    --white: #ffffff;
    --warm-dark: #31302e;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04),
              0 2px 4px rgba(0,0,0,0.03),
              0 4px 8px rgba(0,0,0,0.03),
              0 8px 16px rgba(0,0,0,0.02);
    --shadow-deep: 0 1px 3px rgba(0,0,0,0.05),
                   0 4px 8px rgba(0,0,0,0.04),
                   0 8px 16px rgba(0,0,0,0.03),
                   0 16px 32px rgba(0,0,0,0.03),
                   0 32px 52px rgba(0,0,0,0.02);
}

body {
    font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
}

/* Header */
.app-header {
    background: var(--white);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 1001;
    border-bottom: 1px solid var(--border);
}
.header-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.02em;
}

/* Main */
.app-main { padding: 24px 16px 110px; max-width: 640px; margin: 0 auto; }

/* Page Header */
.page-header { margin-bottom: 24px; }
.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}
.back-link {
    display: inline-block;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 10px;
}

/* Home */
.home-screen h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}
.home-screen .subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feature-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 14px 14px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.15s;
}
.feature-card:hover {
    box-shadow: var(--shadow-deep);
    transform: translateY(-1px);
}
.card-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.feature-card h2 {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.feature-card p { font-size: 0.78rem; color: var(--text-secondary); }
.card-pro-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 3px;
    padding: 1px 5px;
    vertical-align: middle;
    letter-spacing: 0.05em;
    margin-left: 4px;
    position: relative;
    top: -1px;
}

/* 사용량 바 */
.usage-bar-wrap { margin-top: 8px; }
.usage-label { font-size: 0.78rem; color: #666; }
.usage-bar {
    height: 5px; background: #eee; border-radius: 4px;
    margin: 4px 0 2px; overflow: hidden;
}
.usage-fill {
    height: 100%; background: #7c4dff;
    border-radius: 4px; transition: width 0.3s;
}
.usage-over { font-size: 0.75rem; color: #e53e3e; margin-top: 3px; }

/* Checklist Index */
.type-grid { display: flex; flex-direction: column; gap: 12px; }
.type-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.type-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}
.stage-buttons { display: flex; gap: 8px; }
.stage-btn {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: opacity 0.15s;
}
.stage-btn:hover { opacity: 0.85; }
.stage-btn.pre { background: #e3f2fd; color: #1565c0; }
.stage-btn.day { background: #fce4ec; color: #b71c1c; }
.stage-btn.bal { background: #e8f5e9; color: #1b5e20; }

/* Stage Tabs */
.stage-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.tab {
    padding: 7px 14px;
    border-radius: 9999px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Checklist Items */
.checklist-item {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.item-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
}
.item-check {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--primary);
}
.item-task {
    font-size: 0.93rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.item-detail { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.item-detail.open { max-height: 320px; padding-bottom: 14px; }
.detail-why, .detail-risk, .detail-tip {
    font-size: 0.84rem;
    padding: 9px 11px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}
.detail-why { background: var(--primary-light); border-color: rgba(0,117,222,0.12); }
.detail-risk { background: #fff8f2; border-color: rgba(221,91,0,0.12); }
.detail-tip { background: #fdf8ff; border-color: rgba(57,28,87,0.1); }
.toggle-detail {
    width: 100%;
    padding: 9px;
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.toggle-detail:hover { background: var(--bg); }

/* Progress Bar */
.progress-bar-wrap {
    position: sticky;
    bottom: 64px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-deep);
    border: 1px solid var(--border);
    margin-top: 16px;
}
.progress-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
}
.progress-bar {
    background: var(--border);
    border-radius: 9999px;
    height: 6px;
}
.progress-fill {
    background: var(--primary);
    height: 6px;
    border-radius: 9999px;
    width: 0%;
    transition: width 0.3s;
}

/* Doc Guide Index */
.section-list { display: flex; flex-direction: column; gap: 8px; }
.section-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.15s;
}
.section-card:hover {
    box-shadow: var(--shadow-deep);
    transform: translateY(-1px);
}
.section-number {
    background: var(--primary);
    color: var(--white);
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}
.section-title { flex: 1; font-weight: 600; letter-spacing: -0.01em; }
.section-count { font-size: 0.78rem; color: var(--text-muted); }
.chevron { color: var(--text-muted); }

/* Doc Guide Section Nav */
.section-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
}
.section-tab {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: all 0.15s;
}
.section-tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Guide Items */
.guide-item {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.guide-item-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}
.item-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.guide-item-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.guide-block { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); }
.guide-label { font-size: 0.78rem; font-weight: 700; display: block; margin-bottom: 4px; letter-spacing: 0.01em; }
.guide-block p { font-size: 0.875rem; color: var(--text-secondary); }
.guide-block.explanation { background: var(--primary-light); border-color: rgba(0,117,222,0.12); }
.guide-block.explanation .guide-label { color: var(--primary); }
.guide-block.mistake { background: #fff8f2; border-color: rgba(221,91,0,0.12); }
.guide-block.mistake .guide-label { color: var(--warning); }
.guide-block.tip { background: #fdf8ff; border-color: rgba(57,28,87,0.1); }
.guide-block.tip .guide-label { color: var(--tip); }

/* Checked state */
.checklist-item.done .item-task {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Section heading */
.section-heading {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Tax form */
.tax-form { display: flex; flex-direction: column; gap: 16px; }
.form-section { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.01em; }
.radio-group { display: flex; gap: 8px; }
.radio-option { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 0.9rem; flex: 1; }
.radio-option input[type="radio"] { accent-color: var(--primary); }
.form-select, .form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; background: var(--white); color: var(--text); outline: none; }
.form-select:focus, .form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,117,222,0.12); }
.submit-btn { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 8px; }
.submit-btn:hover { background: var(--primary-dark); }
.tax-breakdown { display: flex; flex-direction: column; gap: 4px; }
.tax-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.tax-row.total { font-weight: 700; font-size: 1rem; border-bottom: none; color: var(--primary); }
.tax-disclaimer { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin-top: 20px; padding: 0 8px; line-height: 1.5; }

/* ===== 법령 모달 ===== */
.law-modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: flex-end; justify-content: center;
}
.law-modal-sheet {
    background: #fff; width: 100%; max-width: 600px;
    max-height: 75vh; border-radius: 16px 16px 0 0;
    display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}
.law-modal-header {
    display: flex; align-items: center; gap: 8px;
    padding: 16px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.law-modal-title { font-weight: 700; font-size: 16px; flex: 1; }
.law-modal-date { font-size: 12px; color: #888; }
.law-modal-close {
    background: none; border: none; font-size: 18px;
    cursor: pointer; color: #666; padding: 4px;
}
.law-modal-body {
    padding: 16px; overflow-y: auto; flex: 1;
    font-size: 14px; line-height: 1.7; white-space: pre-wrap;
    color: #333;
}

/* ===== 법령 검색 페이지 ===== */
.law-search-wrap { padding: 16px; }
.law-search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.law-input {
    flex: 1; padding: 10px 14px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 15px;
}
.law-btn {
    padding: 10px 18px; background: #1e2332; color: #fff;
    border: none; border-radius: 8px; font-size: 15px; cursor: pointer;
}
.law-result-item {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 0; border-bottom: 1px solid #f0f0f0;
}
.law-name { flex: 1; font-size: 15px; font-weight: 500; }
.law-date { font-size: 12px; color: #888; }
.law-article-btn {
    padding: 6px 12px; background: #f0f4ff; color: #1e2332;
    border: 1px solid #c5d0e8; border-radius: 6px;
    font-size: 13px; cursor: pointer;
}
.law-loading, .law-error, .law-empty { color: #888; font-size: 14px; padding: 12px 0; }
.law-error { color: #c0392b; }

/* ===== 관련 법령 버튼 (체크리스트·확인설명서) ===== */
.law-ref-btn {
    margin-top: 8px; padding: 6px 12px;
    background: #f0f4ff; color: #1e2332;
    border: 1px solid #c5d0e8; border-radius: 6px;
    font-size: 13px; cursor: pointer;
}

/* ===== 헤더 우측 (로그아웃/관리자) ===== */
.app-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; overflow: visible; }
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header-admin-btn {
    font-size: 12px; text-decoration: none;
    padding: 4px 7px; border-radius: 4px;
    white-space: nowrap;
    color: var(--kit-blue);
}
.header-admin-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.header-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ===== 경고 배너 ===== */
.warning-banner {
    background: #FFF7E8; border-bottom: 1px solid #F3E3C2;
    color: #8A5A00; font-size: 12px; padding: 8px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.warning-close {
    background: none; border: none; color: #8A5A00;
    font-size: 14px; cursor: pointer; padding: 0 4px; flex-shrink: 0;
}

/* ===== 관리자 페이지 ===== */
.admin-section { margin-bottom: 28px; }
.admin-section-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: #1e2332; }
.admin-user-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user-item {
    background: #fff; border: 1px solid #eee; border-radius: 10px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.admin-user-item.inactive { opacity: 0.5; }
.admin-user-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-user-name { font-weight: 600; font-size: 14px; }
.admin-user-id { font-size: 12px; color: #888; }
.admin-badge { font-size: 11px; background: #1e2332; color: #fff; padding: 2px 6px; border-radius: 4px; }
.admin-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.admin-status.on { background: #e6f9ed; color: #1aae39; }
.admin-status.off { background: #fdecea; color: #d93025; }
.admin-user-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-btn {
    font-size: 12px; padding: 5px 10px; border: none;
    border-radius: 6px; cursor: pointer; font-weight: 500;
}
.btn-deactivate { background: #fdecea; color: #d93025; }
.btn-activate { background: #e6f9ed; color: #1aae39; }
.btn-reset { background: #f0f4ff; color: #1e2332; }
.btn-add { background: #1e2332; color: #fff; }
.btn-upgrade { background: #7c4dff; color: #fff; }
.btn-downgrade { background: #eee; color: #666; }
.plan-badge { font-size: 11px; padding: 2px 7px; border-radius: 4px; font-weight: 700; }
.plan-pro { background: #f3eeff; color: #7c4dff; border: 1px solid #d4b8ff; }
.plan-free { background: #f5f5f5; color: #999; border: 1px solid #e0e0e0; }
.admin-pw-input {
    font-size: 13px; padding: 5px 10px; border: 1px solid #ddd;
    border-radius: 6px; width: 140px;
}
.admin-add-form .admin-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-input {
    flex: 1; min-width: 120px; padding: 8px 12px;
    border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
}

/* ── 법령 뉴스 배너 (AI상담 페이지) ─────────────────────── */
.law-news-banner {
    display: block;
    background: var(--kit-blue-soft);
    color: var(--kit-ink);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
    transition: opacity 0.15s;
}
.law-news-banner:hover { opacity: 0.88; }

/* ══════════════════════════════════════════════════════
   ■ 소프트 네이비 테마 (dk-*) — Option C
   dk-* 구조 클래스 — 명칭만 legacy, 값은 전부 kit 토큰
   (Task 9: dk 변수 폐지 후에도 .dk-* 클래스명 자체는 유지 —
    .kit-card/.kit-input 등 기존 kit 컴포넌트와 정의가 달라 충돌 방지)
   ══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

/* 페이지 래퍼 */
.dk-wrap {
    margin: -24px -16px -110px;
    background: var(--kit-bg);
    min-height: calc(100vh - 60px);
    font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
    color: var(--kit-ink);
}

/* 히어로 헤더 */
.dk-hero {
    padding: 16px 20px 14px;
    background: var(--kit-surface);
    border-bottom: 2px solid var(--kit-line);
    position: relative;
    overflow: hidden;
}
.dk-hero::before { display: none; }
.dk-hero::after  { display: none; }
.dk-hero-back {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.78rem; font-weight: 600; color: var(--kit-dim);
    text-decoration: none; margin-bottom: 8px;
}
.dk-hero-back:hover { color: var(--kit-ink); }
.dk-hero h1 {
    font-size: 1.2rem; font-weight: 800; color: var(--kit-ink);
    letter-spacing: -0.03em; margin-bottom: 4px;
}
.dk-hero p {
    font-size: 0.8rem; color: var(--kit-dim); line-height: 1.5;
    margin-top: 6px;
}
.dk-hero-badge {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 0; padding: 6px 16px;
    background: var(--kit-blue-soft); border: 1px solid var(--kit-line);
    border-radius: 20px; font-size: 0.85rem; font-weight: 700; color: var(--kit-blue);
}

/* 카드 */
.dk-card {
    background: #ffffff;
    border: 1px solid #D8DFF0;
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 2px 8px rgba(29,46,82,0.07);
    transition: box-shadow 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
}
.dk-card:active { transform: scale(0.98); background: #F4F7FD; }
.dk-card-link {
    display: block; text-decoration: none; color: inherit;
    background: #ffffff; border: 1px solid #D8DFF0;
    border-radius: 16px; padding: 18px 16px;
    box-shadow: 0 2px 8px rgba(29,46,82,0.07);
    transition: box-shadow 0.2s, transform 0.15s;
}
.dk-card-link:active { transform: scale(0.98); background: #F4F7FD; }

/* 콘텐츠 영역 */
/* 하단 여백은 고정 내비 높이를 따라간다. .dk-wrap 의 margin-bottom:-110px 이
   .app-main 의 padding-bottom:110px 을 상쇄해 버리므로, 여기서 확보하지 않으면
   마지막 콘텐츠가 내비 뒤로 들어간다(dk-wrap 을 쓰는 17개 화면 공통). */
.dk-body { padding: 16px 16px calc(var(--kit-nav-h) + 16px); }

/* 섹션 타이틀 */
.dk-section-title {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--kit-blue); margin-bottom: 12px;
}

/* 리스트 아이템 (chevron) */
.dk-list-item {
    display: flex; align-items: center; gap: 12px;
    background: #ffffff; border: 1px solid #D8DFF0;
    border-radius: 14px; padding: 16px; text-decoration: none; color: inherit;
    box-shadow: 0 2px 8px rgba(29,46,82,0.07); transition: background 0.2s;
}
.dk-list-item:active { background: #F4F7FD; }
.dk-list-icon {
    width: 44px; height: 44px; background: #EEF1FB;
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.dk-list-title { font-size: 0.95rem; font-weight: 700; color: var(--kit-ink); }
.dk-list-sub { font-size: 0.78rem; color: #7A8BAB; margin-top: 2px; }
.dk-chevron { color: #A0AEC0; font-size: 1.1rem; margin-left: auto; flex-shrink: 0; }

/* 폼 요소 */
.dk-form-label {
    display: block; font-size: 0.78rem; font-weight: 700;
    color: #7A8BAB; margin-bottom: 6px; letter-spacing: 0.05em;
    text-transform: uppercase;
}
.dk-radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.dk-radio-opt {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 14px; background: #ffffff;
    border: 1px solid #D8DFF0; border-radius: 10px;
    cursor: pointer; font-size: 0.88rem; color: var(--kit-ink); flex: 1;
    transition: border-color 0.15s, background 0.15s;
}
.dk-radio-opt:has(input:checked) {
    border-color: var(--kit-blue); background: rgba(74,127,212,0.08); color: var(--kit-blue);
    font-weight: 700;
}
.dk-radio-opt input { accent-color: var(--kit-blue); }
.dk-select {
    width: 100%; padding: 10px 14px;
    background: #ffffff; color: var(--kit-ink);
    border: 1px solid #D8DFF0; border-radius: 10px;
    font-size: 0.9rem; font-family: inherit; outline: none;
    transition: border-color 0.15s;
}
.dk-select:focus { border-color: var(--kit-blue); box-shadow: 0 0 0 2px rgba(74,127,212,0.15); }
.dk-input {
    width: 100%; padding: 10px 14px;
    background: #ffffff; color: var(--kit-ink);
    border: 1px solid #D8DFF0; border-radius: 10px;
    font-size: 0.9rem; font-family: inherit; outline: none;
    transition: border-color 0.15s;
}
.dk-input:focus { border-color: var(--kit-blue); box-shadow: 0 0 0 2px rgba(74,127,212,0.15); }
.dk-input::placeholder { color: #A0AEC0; }
.dk-textarea {
    width: 100%; padding: 12px 14px;
    background: #ffffff; color: var(--kit-ink);
    border: 1px solid #D8DFF0; border-radius: 10px;
    font-size: 0.9rem; font-family: inherit; outline: none;
    resize: vertical; transition: border-color 0.15s;
}
.dk-textarea:focus { border-color: var(--kit-blue); box-shadow: 0 0 0 2px rgba(74,127,212,0.15); }
.dk-textarea::placeholder { color: #A0AEC0; }

/* 버튼 */
.dk-btn-primary {
    width: 100%; padding: 14px;
    background: var(--kit-blue); color: #ffffff;
    border: none; border-radius: 12px;
    font-size: 0.97rem; font-weight: 800;
    cursor: pointer; font-family: inherit;
    transition: background 0.15s;
}
.dk-btn-primary:hover { background: var(--kit-blue-dark); }
.dk-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.dk-btn-secondary {
    padding: 9px 18px;
    background: #ffffff; color: var(--kit-ink);
    border: 1px solid #D8DFF0; border-radius: 10px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.dk-btn-secondary:active { background: #EEF1F8; }

/* 탭 */
.dk-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.dk-tabs::-webkit-scrollbar { display: none; }
.dk-tab {
    padding: 7px 16px; border-radius: 20px; white-space: nowrap;
    font-size: 0.82rem; font-weight: 600; cursor: pointer; text-decoration: none;
    background: #ffffff; color: #7A8BAB;
    border: 1px solid #D8DFF0; transition: all 0.15s;
}
.dk-tab.active {
    background: var(--kit-blue); color: #ffffff; border-color: var(--kit-blue);
}

/* 체크리스트 아이템 */
.dk-check-item {
    background: #ffffff; border: 1px solid #D8DFF0;
    border-radius: 14px; margin-bottom: 8px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(29,46,82,0.06); transition: border-color 0.2s;
}
.dk-check-item.done { border-color: #BBD9C8; }
.dk-check-label {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; cursor: pointer;
}
.dk-check-input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--kit-blue); }
.dk-check-task {
    font-size: 0.92rem; font-weight: 600; color: var(--kit-ink); line-height: 1.4;
}
.dk-check-item.done .dk-check-task { text-decoration: line-through; color: #A0AEC0; }
.dk-check-detail {
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
    padding: 0 16px;
}
.dk-check-detail.open { max-height: 360px; padding-bottom: 14px; }
.dk-detail-block {
    font-size: 0.82rem; padding: 8px 12px; border-radius: 8px;
    margin-bottom: 7px; line-height: 1.55;
}
.dk-detail-why        { background: #EEF4FF; color: #2D5BAF; border: 1px solid #C5D8F8; }
.dk-detail-risk       { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.dk-detail-tip        { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.dk-detail-law-basis  { background: #F3F0FF; color: #5B21B6; border: 1px solid #DDD6FE; }
.dk-toggle-btn {
    width: 100%; padding: 8px; background: none;
    border: none; border-top: 1px solid #D8DFF0;
    color: var(--kit-blue); font-size: 0.76rem; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.dk-toggle-btn:hover { background: #EEF1F8; }

/* 진행 바 */
.dk-progress-wrap {
    /* 상수 64px 이면 내비(72px, 아이폰 94px)에 가려지고, sticky 가 흐름 위치보다
       위로 들려 마지막 항목의 '상세 보기' 버튼을 덮어 탭을 가로챈다. */
    position: sticky; bottom: calc(var(--kit-nav-h) + 8px);
    background: #ffffff; border: 1px solid #D8DFF0;
    border-radius: 14px; padding: 12px 16px;
    box-shadow: 0 -2px 16px rgba(29,46,82,0.1);
    margin: 12px 16px 0;
}
.dk-progress-label { font-size: 0.8rem; color: #7A8BAB; margin-bottom: 6px; }
.dk-progress-label strong { color: var(--kit-blue); }
.dk-progress-bar { background: #D8DFF0; border-radius: 9999px; height: 5px; }
.dk-progress-fill {
    height: 5px; border-radius: 9999px; width: 0%;
    background: linear-gradient(90deg, var(--kit-blue), #7EB3F5);
    transition: width 0.3s;
}

/* 법령 참조 버튼 */
.dk-law-btn {
    margin-top: 8px; padding: 6px 12px;
    background: rgba(74,127,212,0.08); color: var(--kit-blue);
    border: 1px solid rgba(74,127,212,0.25); border-radius: 8px;
    font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: background 0.15s;
}
.dk-law-btn:hover { background: rgba(74,127,212,0.15); }

/* 칩 */
.dk-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 14px; background: #ffffff;
    border: 1px solid #D8DFF0; border-radius: 20px;
    font-size: 0.8rem; color: #7A8BAB; cursor: pointer;
    font-family: inherit; transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.dk-chip:hover { border-color: var(--kit-blue); color: var(--kit-blue); }

/* 정보 블록 */
.dk-info-block {
    background: rgba(74,127,212,0.08); border: 1px solid rgba(74,127,212,0.25);
    border-radius: 10px; padding: 12px 14px;
    font-size: 0.82rem; color: #2D5BAF; line-height: 1.6;
}
.dk-warning-block {
    background: #FEF2F2; border: 1px solid #FECACA;
    border-radius: 10px; padding: 12px 14px;
    font-size: 0.82rem; color: #B91C1C; line-height: 1.6;
}

/* 답변 영역 (AI상담) */
.dk-answer-wrap {
    background: #ffffff; border: 1px solid #D8DFF0;
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(29,46,82,0.07);
}
.dk-answer-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; background: #EEF1F8;
    border-bottom: 1px solid #D8DFF0;
    font-size: 0.82rem; font-weight: 700; color: var(--kit-ink);
}
.dk-answer-text {
    padding: 16px; font-size: 0.9rem; line-height: 1.8;
    white-space: pre-wrap; color: var(--kit-ink); min-height: 60px;
}
.dk-copy-btn {
    font-size: 0.74rem; padding: 3px 10px;
    background: #ffffff; border: 1px solid #D8DFF0;
    border-radius: 6px; cursor: pointer; color: #7A8BAB; font-family: inherit;
}
.dk-copy-btn:hover { color: var(--kit-ink); }

/* 업로드 영역 (계약서분석) */
.dk-upload-area {
    border: 2px dashed #C8D4EC; border-radius: 14px;
    padding: 28px 20px; text-align: center;
    background: #ffffff; min-height: 130px;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.2s;
}
.dk-upload-area:hover { border-color: var(--kit-blue); }
.dk-upload-btn {
    flex: 1; padding: 11px 0;
    background: #ffffff; border: 1px solid #D8DFF0;
    border-radius: 12px; font-size: 0.85rem; color: var(--kit-ink);
    font-weight: 600; cursor: pointer; font-family: inherit;
    box-shadow: 0 1px 3px rgba(29,46,82,0.08);
    transition: border-color 0.15s, background 0.15s;
}
.dk-upload-btn:active { background: #EEF1F8; border-color: var(--kit-blue); }

/* 가이드 섹션 (사용가이드) */
.dk-guide-section {
    background: #ffffff; border: 1px solid #D8DFF0; border-radius: 14px;
    margin-bottom: 10px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(29,46,82,0.06);
}
.dk-guide-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; cursor: pointer;
    font-size: 0.92rem; font-weight: 700; color: var(--kit-ink);
    background: #ffffff; user-select: none; transition: background 0.15s;
}
.dk-guide-header:hover { background: #F4F7FD; }
.dk-guide-header.open { border-bottom: 1px solid #D8DFF0; }
.dk-guide-body {
    padding: 0 16px; display: none;
    font-size: 0.87rem; line-height: 1.7; color: #3D5275;
    background: #F8FAFD;
}
.dk-guide-body.open { display: block; padding: 14px 16px 16px; }
.dk-guide-body p { margin-bottom: 10px; }
.dk-callout {
    background: #FFFBEB; border-left: 3px solid #D97706;
    border-radius: 0 8px 8px 0; padding: 10px 14px;
    font-size: 0.83rem; line-height: 1.6; margin: 12px 0; color: #92400E;
}
.dk-callout-blue {
    background: #EEF4FF; border-left-color: var(--kit-blue); color: #2D5BAF;
}
.dk-step-list { margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.dk-step {
    display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem;
    color: #3D5275;
}
.dk-step-num {
    background: var(--kit-blue); color: #ffffff;
    border-radius: 50%; width: 22px; height: 22px; min-width: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800;
}

/* PRO 뱃지 */
.dk-pro-badge {
    display: inline-block; font-size: 0.58rem; font-weight: 800;
    color: #fff; background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 4px; padding: 2px 6px; letter-spacing: 0.06em;
    vertical-align: middle; position: relative; top: -1px; margin-left: 5px;
}

/* 폼 섹션 구분 */
.dk-form-section { margin-bottom: 16px; }

/* 결과 카드 (계약서분석 다크) */
.dk-result-card {
    background: var(--kit-surface); border: 1px solid var(--kit-line);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.dk-issue-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 14px; border-radius: 10px; margin-bottom: 8px;
    font-size: 0.85rem;
}
.dk-issue-danger  { background: rgba(248,113,113,0.1); border-left: 3px solid #f87171; }
.dk-issue-warning { background: rgba(252,211,77,0.1);  border-left: 3px solid #fcd34d; }
.dk-issue-check   { background: rgba(74,222,128,0.1);  border-left: 3px solid #4ade80; }
.dk-issue-level {
    font-size: 0.68rem; font-weight: 700; padding: 2px 7px;
    border-radius: 20px; white-space: nowrap; margin-top: 2px;
}
.dk-level-danger  { background: rgba(248,113,113,0.2); color: #fca5a5; }
.dk-level-warning { background: rgba(252,211,77,0.2);  color: #fde68a; }
.dk-level-check   { background: rgba(74,222,128,0.2);  color: #86efac; }

/* 애니메이션 */
@keyframes dk-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dk-animate { opacity: 0; animation: dk-fade-up 0.4s ease forwards; }
.dk-animate:nth-child(1) { animation-delay: 0.08s; }
.dk-animate:nth-child(2) { animation-delay: 0.14s; }
.dk-animate:nth-child(3) { animation-delay: 0.20s; }
.dk-animate:nth-child(4) { animation-delay: 0.26s; }
.dk-animate:nth-child(5) { animation-delay: 0.32s; }
.dk-animate:nth-child(6) { animation-delay: 0.38s; }
.dk-animate:nth-child(7) { animation-delay: 0.44s; }
.dk-animate:nth-child(8) { animation-delay: 0.50s; }

/* 목차 (가이드) */
.dk-toc {
    background: var(--kit-surface); border: 1px solid var(--kit-line);
    border-radius: 14px; padding: 14px 16px; margin-bottom: 16px;
}
.dk-toc-title { font-size: 0.72rem; color: var(--kit-dim); font-weight: 700; margin-bottom: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.dk-toc-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.dk-toc-link {
    font-size: 0.78rem; color: var(--kit-blue); text-decoration: none;
    padding: 6px 10px; background: var(--kit-blue-soft);
    border: 1px solid var(--kit-line); border-radius: 20px;
    text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 동의 체크박스 */
.dk-consent {
    display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
    background: var(--kit-blue-soft); border: 1px solid var(--kit-line);
    border-radius: 12px; padding: 12px 14px; font-size: 0.82rem;
    color: var(--kit-ink); line-height: 1.6;
}
.dk-consent strong { color: var(--kit-blue); }
.dk-consent input { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--kit-blue); }

/* 사용량 바 (다크) */
.dk-usage-bar-wrap { margin-top: 10px; }
.dk-usage-label { font-size: 0.78rem; color: var(--kit-dim); }
.dk-usage-label strong { color: var(--kit-ink); }
.dk-usage-bar {
    height: 4px; background: var(--kit-line);
    border-radius: 4px; margin: 5px 0 3px; overflow: hidden;
}
.dk-usage-fill {
    height: 100%; border-radius: 4px;
    background: var(--kit-blue);
    transition: width 0.3s;
}
.dk-usage-over { font-size: 0.75rem; color: var(--kit-danger); margin-top: 3px; }

/* ══ KIT components ══ */
.kit-card {
    background: var(--kit-surface);
    border-radius: var(--kit-radius);
    box-shadow: var(--kit-shadow);
    padding: 16px;
}
/* 전역 리셋(padding:0)으로 불릿이 텍스트와 겹치는 문제 보정 —
   불릿을 여백에 두고 줄바꿈 글씨가 첫 글자에 정렬(행잉 인덴트) */
.kit-card ul, .kit-card ol { padding-left: 1.3em; margin: 8px 0; }
.kit-card li { margin: 5px 0; line-height: 1.6; }
.kit-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 12px 18px;
    background: var(--kit-blue); color: #fff;
    border: none; border-radius: 12px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    text-decoration: none; font-family: inherit;
}
.kit-btn:active { transform: scale(.98); }
.kit-btn-ghost { background: var(--kit-blue-soft); color: var(--kit-blue); }
.kit-input {
    width: 100%; min-height: 44px; padding: 12px 14px;
    border: 1.5px solid var(--kit-line); border-radius: 12px;
    font-size: 16px; color: var(--kit-ink); background: var(--kit-surface);
    font-family: inherit; outline: none;
}
.kit-input:focus { border-color: var(--kit-blue); }
.kit-badge {
    display: inline-block;
    background: var(--kit-blue-soft); color: var(--kit-blue);
    font-size: 13px; font-weight: 600;
    border-radius: 16px; padding: 5px 12px;
}

/* ══ KIT layout utilities (messaging·contacts 등 기능 페이지 공통) ══ */
.kit-home {
    max-width: 640px; margin: 0 auto; padding: 14px 16px 104px;
    display: flex; flex-direction: column; gap: 14px;
}
.kit-group-label {
    font-size: 15px; font-weight: 800; color: var(--kit-ink);
    letter-spacing: -.01em; margin: 2px 0 -2px;
}
.kit-lead { font-size: 14px; line-height: 1.6; color: var(--kit-body); margin: 0; }
.kit-note { font-size: 13px; line-height: 1.55; color: var(--kit-dim); }
.kit-note strong { color: var(--kit-body); }
.kit-tool-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.kit-ask-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kit-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.kit-actions > .kit-btn, .kit-actions > form { flex: 1 1 auto; }
.kit-actions > form > .kit-btn { width: 100%; }
.kit-ask-btn { box-shadow: 0 2px 10px rgba(27,79,216,.26); }
.kit-btn.primary { background: var(--kit-blue-dark); }
.kit-btn-sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.kit-badge-on { background: var(--kit-blue); color: #fff; }
.kit-field-label { display: block; font-size: 13px; font-weight: 700;
    color: var(--kit-body); margin-bottom: 6px; }
.kit-check { display: flex; align-items: center; gap: 8px; font-size: 14px;
    color: var(--kit-body); cursor: pointer; }
.kit-details { border: 1.5px solid var(--kit-line); border-radius: var(--kit-radius);
    background: var(--kit-surface); padding: 2px 16px; }
.kit-details > summary { cursor: pointer; font-weight: 700; font-size: 14px;
    color: var(--kit-ink); padding: 12px 0; list-style: none; }
.kit-details > summary::-webkit-details-marker { display: none; }
.kit-details > summary::after { content: ' ▾'; color: var(--kit-dim); }
.kit-details[open] > summary::after { content: ' ▴'; }
.kit-flash { padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.kit-flash-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.kit-flash-ok { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }

/* ── KIT 계산기류 폼 (경매입찰 등, fieldset 다건 입력) ────────────── */
.kit-form fieldset { border: none; padding: 0; margin: 0 0 16px; }
.kit-form legend { font-size: 13px; font-weight: 800; color: var(--kit-blue); padding: 0 0 8px; width: 100%; }
.kit-form label { display: block; font-size: 13px; font-weight: 600; color: var(--kit-body); margin-bottom: 10px; }
.kit-form label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; }
.kit-form label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--kit-blue); }
/* 항목 힌트(label 바로 아래 .kit-note)는 자기 항목에 붙고 다음 항목과는 떨어져야 한다.
   기본값(label mb:10 + note 여백 0)이면 힌트가 다음 라벨에 딱 붙어 그 항목 설명으로 오독된다. */
.kit-form label:has(+ .kit-note) { margin-bottom: 4px; }
.kit-form .kit-note { margin: 0 0 14px; }
.kit-form input, .kit-form select {
    display: block; width: 100%; min-height: 44px; margin-top: 4px; padding: 10px 12px;
    border: 1.5px solid var(--kit-line); border-radius: 12px;
    font-size: 15px; color: var(--kit-ink); background: var(--kit-surface);
    font-family: inherit; outline: none;
}
.kit-form label:has(input[type="checkbox"]) input { width: 18px; margin-top: 0; }
.kit-form input:focus, .kit-form select:focus { border-color: var(--kit-blue); }
.kit-form > button[type="submit"] { width: 100%; margin-top: 4px; }

/* ── KIT 결과 표 (경매입찰·가져오기 미리보기 등 키·값 요약) ───────── */
.kit-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kit-table th, .kit-table td { padding: 9px 6px; border-bottom: 1px solid var(--kit-line); text-align: left; vertical-align: top; }
.kit-table th { font-weight: 700; color: var(--kit-dim); font-size: 13px; }
.kit-table td:first-child { color: var(--kit-dim); white-space: nowrap; padding-right: 12px; }
.kit-table tr:last-child td { border-bottom: none; }

/* ── KIT 원본 JSON/코드 블록 (AI 원자료 노출용, textContent로만 채울 것) ── */
.kit-pre {
    background: var(--kit-bg); border: 1px solid var(--kit-line); border-radius: 10px;
    padding: 12px 14px; font-size: 12px; line-height: 1.6; color: var(--kit-body);
    white-space: pre-wrap; word-break: break-all; overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ── KIT 인라인 오류 텍스트 ─────────────────────────────────────── */
.kit-err { color: var(--kit-danger); font-weight: 700; }

/* ══ KIT bottom nav (5탭 + 중앙 FAB) ══ */
.kit-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--kit-surface);
    border-top: 1px solid var(--kit-line);
    display: flex; justify-content: space-around; align-items: flex-end;
    padding: 8px 8px max(env(safe-area-inset-bottom), 12px);
    z-index: 100;
}
.kit-nav-item {
    flex: 1; min-width: 44px; min-height: 44px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; cursor: pointer;
    text-decoration: none; color: var(--kit-dim);
    font-size: 1.25rem; font-family: inherit; padding: 2px 0;
}
.kit-nav-item span { font-size: 0.68rem; font-weight: 600; line-height: 1.2; }
.kit-nav-item.active, .kit-nav-item.active span { color: var(--kit-blue); font-weight: 800; }
.kit-nav-fab { flex: 1; display: flex; flex-direction: column; align-items: center; text-decoration: none; margin-top: -30px; }
.kit-nav-fab-btn {
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(135deg, #1B4FD8, #3B6EF0);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.55rem; border: 4px solid var(--kit-bg);
    box-shadow: 0 6px 16px rgba(27,79,216,.4);
}
.kit-nav-fab-label { font-size: 0.68rem; font-weight: 800; color: var(--kit-blue); margin-top: 3px; }

/* ══ KIT '전체' 바텀시트 ══ */
.kit-sheet-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(15,23,42,.45);
    display: flex; align-items: flex-end;
}
.kit-sheet {
    background: var(--kit-surface);
    width: 100%; max-height: 82vh; overflow-y: auto;
    border-radius: 20px 20px 0 0;
    padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
}
.kit-sheet-handle { width: 44px; height: 4px; border-radius: 2px; background: var(--kit-line); margin: 4px auto 14px; }
.kit-sheet-group { font-size: 0.85rem; font-weight: 800; color: var(--kit-blue); margin: 14px 0 8px; }
.kit-sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kit-sheet-grid a {
    display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 10px 12px;
    background: var(--kit-bg); border-radius: 12px;
    text-decoration: none; color: var(--kit-ink);
    font-size: 0.95rem; font-weight: 600;
}
/* 이모지 고정폭 슬롯 — ✍️·⚖️·🗂️ 처럼 변이선택자(U+FE0F)가 붙은 이모지는
   글리프 폭이 달라 라벨 시작 위치가 밀린다. 폭을 고정해 항상 정렬시킨다. */
.kit-sheet-grid a .kit-emoji { flex: 0 0 1.25em; text-align: center; }
.kit-sheet-footer {
    margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--kit-line);
    display: flex; flex-direction: column; gap: 10px;
}
.kit-sheet-footer a { color: var(--kit-body); text-decoration: none; font-size: 0.95rem; min-height: 44px; display: flex; align-items: center; }
.kit-sheet-legal { font-size: 0.8rem; color: var(--kit-dim); }
.kit-sheet-legal a { display: inline; min-height: 0; color: var(--kit-dim); font-size: 0.8rem; }

/* ══ KIT header brand ══ */
.kit-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.kit-logo-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--kit-blue);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
/* 2026-07-06 정식 로고 C-2 확정 — 단일 소스 _kit_mark.svg 표시 크기.
   타일(38px)과 동일한 풀블리드 → 앱 아이콘과 같은 비율 */
.kit-logo-mark svg { width: 38px; height: 38px; display: block; }
.kit-wordmark { display: inline-block; }
.kit-wordmark-name {
    display: block; font-size: 19px; font-weight: 800;
    color: var(--kit-ink); line-height: 1.15; letter-spacing: .01em;
}
.kit-wordmark-tagline {
    display: block; font-size: 12px; color: var(--kit-dim); margin-top: 1px;
    letter-spacing: 2px;  /* 자간으로 '중개키트' 폭에 맞춰 양끝 정렬(justify 몰빵 대신 균일 확장) */
}

/* ══ KIT stage pills (체크리스트 단계 이동) ══ */
.kit-stage-pill { display:flex; align-items:center; justify-content:space-between;
    min-height:44px; padding:12px 14px; border-radius:12px; text-decoration:none;
    font-size:0.95rem; font-weight:700; border:1.5px solid transparent; }
.kit-stage-pill.pre    { background:#EBF2FF; color:#1E5FCC; border-color:#AECBF5; }
.kit-stage-pill.day    { background:#FEF0F0; color:#C0392B; border-color:#F5AAAA; }
.kit-stage-pill.settle { background:#EDFAF4; color:#1A7A49; border-color:#7EDAAA; }

/* ── 공용 AI 마크다운 렌더 (kit_md.js 출력) ───────────────────────── */
/* 법령상담·어시스턴트·특약·매물비교 공유. 컨테이너에 .kit-md 부여 시 적용 */
.kit-md .kit-md-h1 { font-size: 1.0rem; font-weight: 800; color: var(--kit-ink); margin: 13px 0 6px; }
.kit-md .kit-md-h2 { font-size: 0.94rem; font-weight: 800; color: var(--kit-ink); margin: 12px 0 5px; padding-left: 9px; border-left: 3px solid var(--kit-blue); }
.kit-md .kit-md-h3 { font-size: 0.89rem; font-weight: 700; color: var(--kit-dim); margin: 11px 0 4px; }
.kit-md .kit-md-p  { margin: 5px 0; line-height: 1.66; }
.kit-md .kit-md-ul { margin: 5px 0; padding-left: 20px; }
.kit-md .kit-md-ul li { margin: 3px 0; line-height: 1.58; }
.kit-md .kit-md-gap { height: 6px; }
.kit-md .kit-md-p:first-child, .kit-md .kit-md-h1:first-child, .kit-md .kit-md-h2:first-child { margin-top: 0; }
.kit-md strong { font-weight: 700; color: var(--kit-ink); }
.kit-md code { background: var(--kit-bg); border: 1px solid var(--kit-line); border-radius: 4px; padding: 1px 5px; font-size: 0.86em; }

/* ══════════════════════════════════════════════════════════════
   데스크탑 반응형 (2026-07-12) — 모바일 우선 유지
   기존 모바일 규칙은 건드리지 않고 ≥760px에서 min-width 오버라이드만 추가.
   목표: 한방·이실장 등 데스크탑 프로그램 옆에 반창(half-dock, ≈680~960px)으로
   띄웠을 때 옹색하지 않게. 폼 입력폭 과확장은 820px 상한으로 방지.
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 760px) {
    /* 본문 컨테이너: 640 → 820, 상단 여백 확대 */
    .app-main { max-width: 820px; padding: 32px 24px 130px; }

    /* 하단 내비를 콘텐츠 폭에 맞춰 중앙 도크화 (풀블리드 방지) */
    .kit-nav {
        max-width: 820px; margin: 0 auto;
        border-left: 1px solid var(--kit-line);
        border-right: 1px solid var(--kit-line);
        border-top-left-radius: 16px; border-top-right-radius: 16px;
    }

    /* '전체' 바텀시트도 중앙 정렬·폭 제한, 항목 3열로 */
    .kit-sheet { max-width: 720px; margin: 0 auto; }
    .kit-sheet-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   공통 로딩 피드백 스피너 (2026-07-23) — .kit-spinner 단일 정본
   currentColor 상속이라 버튼/텍스트 색에 자동 맞춰짐. JS: kit_loading.js
   ══════════════════════════════════════════════════════════════ */
@keyframes kit-spin { to { transform: rotate(360deg); } }
.kit-spinner {
  display: inline-block;
  width: 1em; height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: kit-spin .7s linear infinite;
  vertical-align: -0.15em;
  margin-right: .5em;
}

/* ══════════════════════════════════════════════════════════════
   인쇄 (출력물 정리 + 가시 워터마크 푸터)
   설계: docs/2026-07-06_보안도용방어설계.md §2-ⓑ-2

   중개사가 고객에게 주는 자료(브리핑·확인설명서·단지리포트)를 종이나 PDF로
   뽑을 때, 앱 크롬이 같이 찍히면 자료의 격이 떨어진다. 2026-08-05 이전에는
   @media print 규칙이 저장소에 하나도 없어 헤더·내비·FAB가 그대로 찍혔다.

   푸터는 화면에서는 숨기고 인쇄에만 띄운다 — 화면 레이아웃을 건드리지 않으면서
   출력물에는 출처가 남는다(채증 겸 브랜딩).
   ══════════════════════════════════════════════════════════════ */

/* 화면에서는 숨김. @media print 블록보다 반드시 앞에 와야 한다. */
.kit-print-footer { display: none; }

@media print {
    /* 앱 크롬 — 종이에 나올 이유가 없다 */
    .app-header,
    .kit-nav,
    #kit-sheet,
    .kit-noprint { display: none !important; }

    /* 페이지가 개별 지정한 비인쇄 요소는 area_report/report.html 의 선례를
       따른다. 그쪽 페이지-로컬 규칙도 계속 유효하다(중복돼도 무해). */

    /* 하단 내비가 사라진 만큼 본문 여백을 회수 */
    .app-main { padding-bottom: 0 !important; max-width: none !important; }

    /* 출처 푸터 — 매 페이지 하단에 반복 */
    .kit-print-footer {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9pt;
        color: #6B7280;
        padding: 6pt 0;
    }
}
