/* 
  =========================================
  MEDICost Pro v2.5 - 병원비 계산기 style.css 
  =========================================
  심평원 전체 수가 분류 체계에 맞춰 확장된 UI를 지원합니다.
  4단 병원등급 타일, 산정특례 토글, 3대 탭(검사/시술/수술), 
  기타 처치/주사/마취 아코디언, 실시간 병원 규모별 비교 테이블 등을 지원합니다.
*/

/* 1. 디자인 시스템 변수 */
:root {
    --bg-base: #0b0f19;
    --bg-surface: rgba(22, 28, 45, 0.65);
    --bg-surface-hover: rgba(30, 41, 59, 0.8);
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --primary-hover: #60a5fa;
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --danger: #f43f5e;
    --danger-glow: rgba(244, 63, 94, 0.15);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.15);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(59, 130, 246, 0.5);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. 전역 스타일 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

/* 3. 레이아웃 */
.app-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

/* 4. 헤더 */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-area {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    margin-bottom: 1rem;
}

.logo-text {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--primary);
    text-transform: uppercase;
}

.pulse-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
    animation: heartbeat 1.8s infinite ease-in-out;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.app-header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 300;
}

.development-notice {
    max-width: 880px;
    margin: 1.2rem auto 0;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    text-align: left;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.24);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.05rem;
    color: var(--text-secondary);
}

.development-notice i {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.development-notice strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
}

.development-notice span,
.development-notice small {
    display: block;
    font-size: 0.8rem;
    line-height: 1.5;
}

.development-notice small {
    margin-top: 0.35rem;
    color: var(--text-muted);
}

/* 5. 메인 그리드 */
.app-main {
    display: grid;
    grid-template-columns: 1.2fr 1.1fr;
    gap: 2rem;
    align-items: start;
}

/* 6. 카드 (글래스모피즘) */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.card-title i {
    color: var(--primary);
    width: 22px;
    height: 22px;
}

/* 7. 폼 요소 */
.form-group { margin-bottom: 2rem; }
.form-group.last-group { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

/* 8. 라디오 타일 */
.radio-group-tile {
    display: grid;
    gap: 0.8rem;
}

.hospital-select-grid {
    grid-template-columns: repeat(4, 1fr);
}

.treatment-select-grid {
    grid-template-columns: repeat(3, 1fr);
}

.tile-option {
    cursor: pointer;
    position: relative;
}

.tile-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    height: 100%;
}

.tile-content i {
    width: 26px;
    height: 26px;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    transition: var(--transition-smooth);
}

.tile-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.tile-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.tile-option input[type="radio"]:checked + .tile-content {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.tile-option input[type="radio"]:checked + .tile-content i {
    color: var(--primary);
    transform: scale(1.1);
}

/* 9. 토글 스위치 */
.insurance-toggle {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.sanjeong-toggle-box {
    margin-top: 1rem;
}

.switch-container {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch-container input { opacity: 0; width: 0; height: 0; }

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .switch-slider { background-color: var(--primary); }
input:checked + .switch-slider:before { transform: translateX(22px); }

.switch-label {
    font-size: 0.92rem;
    font-weight: 500;
}

/* 10. 서브 폼 섹션 */
.sub-form-section {
    margin-top: 1rem;
    padding: 1.2rem;
    background: rgba(15, 23, 42, 0.8);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: grid;
    gap: 1rem;
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: top;
}

.sanjeong-help-text {
    margin: -0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.er-help-text {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.nonbenefit-public-section {
    margin-top: 0;
}

.public-data-help-text {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

@keyframes slideDown {
    from { opacity: 0; transform: scaleY(0.9); }
    to { opacity: 1; transform: scaleY(1); }
}

.hidden { display: none !important; }

.sub-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sub-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* 11. 셀렉트 박스 */
.form-select {
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* 12. 수량 스태퍼 */
.number-input-wrapper {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 160px;
}

.btn-step {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.btn-step:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.number-input-wrapper input[type="number"] {
    width: 50px;
    text-align: center;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    outline: none;
    -moz-appearance: textfield;
}

.number-input-wrapper input::-webkit-outer-spin-button,
.number-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input-wrapper .unit {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 0.8rem;
}

/* 13. 추가된 아이템 칩 리스트 */
.added-items-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.added-list-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.added-list-title i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.added-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.empty-list-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
}

.added-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem;
    animation: fadeInItem 0.25s ease;
}

@keyframes fadeInItem {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.item-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: var(--transition-smooth);
}

.btn-remove:hover {
    color: var(--danger);
    background: var(--danger-glow);
}

.btn-remove i { width: 16px; height: 16px; }

/* 14. 결과 카드 */
.result-card {
    border-color: rgba(59, 130, 246, 0.2);
    position: sticky;
    top: 2rem;
}

.result-display {
    display: grid;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.result-item {
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.result-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.text-green {
    color: var(--success) !important;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.text-green i { width: 16px; height: 16px; }

.cost-value-wrapper { display: flex; align-items: baseline; }

.cost-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.03em;
}

.cost-unit {
    font-size: 1.1rem;
    font-weight: 700;
    margin-left: 0.2rem;
}

.insurance-refund-box {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.02);
}

.refund-text { color: var(--success); }

/* 최종 예상 부담금 최상단 강조형 레이아웃 */
.final-cost-box-primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 2px solid var(--primary);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.3);
    transform: scale(1.02);
}

.highlight-label { color: #e2e8f0; font-weight: 700; font-size: 0.95rem; }

.highlight-value {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.highlight-value .main-value { font-size: 2.3rem; }
.highlight-value .main-unit { font-size: 1.3rem; }

.cost-range-primary {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.range-lbl {
    color: var(--text-muted);
    font-weight: 500;
}

.range-value-large {
    font-weight: 800;
    color: #ffffff;
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.total-cost-box-secondary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.secondary-value .cost-value {
    font-size: 1.4rem;
}

/* DRG 안내 박스 */
.drg-notice-box {
    display: flex;
    gap: 0.8rem;
    background: rgba(245, 158, 11, 0.06);
    border: 1px dashed rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.drg-notice-box i {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.drg-notice-box p {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.drg-notice-box p strong {
    color: var(--warning);
    font-weight: 700;
}

/* 병원 규모별 실시간 예상비용 비교 테이블 */
.comparison-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.comparison-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-primary);
}

.comparison-title i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.comparison-table th, .comparison-table td {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
}

.comparison-table td {
    color: var(--text-primary);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr.active-class {
    background: rgba(59, 130, 246, 0.1);
    font-weight: 700;
}

.comparison-table tr.active-class td {
    color: var(--primary-hover);
}

/* 아코디언 명세서 */
.details-accordion {
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.accordion-trigger:hover { background: rgba(255, 255, 255, 0.03); }
.accordion-trigger i { width: 18px; height: 18px; transition: transform 0.3s ease; }
.accordion-trigger.active i { transform: rotate(180deg); }

.accordion-content {
    padding: 0 1.2rem 1.2rem 1.2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 0.5rem;
}

.cost-table th, .cost-table td {
    padding: 0.7rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cost-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
}

.cost-table td { color: var(--text-primary); }
.text-right { text-align: right !important; }

/* 뱃지 태그 */
.badge {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.badge-benefit {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-non-benefit {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.badge-drg {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    margin-left: 0.3rem;
    vertical-align: middle;
}

/* 면책 조항 */
.disclaimer-box {
    display: flex;
    gap: 0.8rem;
    background: rgba(244, 63, 94, 0.05);
    border: 1px dashed rgba(244, 63, 94, 0.25);
    border-radius: var(--radius-md);
    padding: 1rem;
    flex-direction: column;
}

.disclaimer-box i {
    width: 18px;
    height: 18px;
    color: var(--danger);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.disclaimer-box p {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.disclaimer-box p strong { color: var(--danger); font-weight: 700; }

/* 자료 기준일 Footer */
.data-date-footer {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.data-date-footer i {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.data-date-footer strong {
    color: var(--primary);
}

/* =========================================================
   15. [신규] 3대 카테고리 탭 UI 디자인
   ========================================================= */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: white;
    background: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

/* 탭 내용 콘텐트 래퍼 */
.tab-content-wrapper {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.input-inline-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    align-items: flex-start;
}

.input-sub-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.input-sub-label i {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.direct-select-box, .search-input-box {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* =========================================================
   16. [신규] 기타 처치, 주사, 마취 등 아코디언 스타일
   ========================================================= */
.etc-accordion-wrapper {
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.2);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.etc-accordion-trigger {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
}

.etc-accordion-trigger:hover {
    background: rgba(255, 255, 255, 0.03);
}

.etc-trigger-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.etc-accordion-trigger i {
    width: 18px;
    height: 18px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.etc-accordion-trigger.active i {
    transform: rotate(45deg);
    color: var(--danger);
}

.etc-accordion-content {
    padding: 0 1.2rem 1.2rem 1.2rem;
    border-top: 1px solid var(--border-color);
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: top;
}

.etc-desc-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.badge-etc-count {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.72rem;
}

/* =========================================================
   17. 실시간 검색 및 자동완성 결과 리스트 관련 스타일
   ========================================================= */
.search-box-wrapper {
    position: relative;
    width: 100%;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.85rem 6.2rem 0.85rem 2.8rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    background: rgba(15, 23, 42, 0.8);
}

.search-icon {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.btn-clear-search {
    position: absolute;
    right: 4.85rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 0.2rem;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.btn-clear-search:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.btn-clear-search i {
    width: 16px;
    height: 16px;
}

.btn-run-search {
    position: absolute;
    right: 0.45rem;
    height: calc(100% - 0.6rem);
    min-width: 4rem;
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 0.55rem;
    background: rgba(59, 130, 246, 0.18);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.btn-run-search i {
    width: 14px;
    height: 14px;
}

.btn-run-search:not(:disabled):hover,
.btn-run-search.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.btn-run-search:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.search-results-list {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
}

.search-result-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.search-result-item:focus {
    background: rgba(59, 130, 246, 0.2);
    outline: none;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    margin-right: 1rem;
}

.search-result-name {
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.search-result-keywords {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.search-result-price {
    font-size: 0.88rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.btn-result-add {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.search-result-item:hover .btn-result-add {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.empty-search-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.empty-search-results i {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

/* =========================================================
   18. 인기/최근 검색어 칩 디자인 추가
   ========================================================= */
.search-chips-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.4rem;
    margin-bottom: 1rem;
}

.chip-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.chip-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 80px;
}

.chips-list {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.3rem 0.8rem;
    color: var(--text-primary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.search-chip:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
    color: var(--text-primary);
}

.search-chip .btn-chip-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0 0 0 0.25rem;
    display: inline-flex;
    align-items: center;
}

.search-chip .btn-chip-delete:hover {
    color: var(--danger);
}

.no-recent-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* =========================================================
   19. 반응형 (모바일)
   ========================================================= */
@media (max-width: 1100px) {
    .hospital-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    body { padding: 1.5rem 0.8rem; }

    .app-header h1 { font-size: 1.6rem; }
    .app-header .subtitle { font-size: 0.9rem; }

    .development-notice {
        padding: 0.85rem;
    }

    .app-main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card { padding: 1.5rem; }

    .hospital-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .treatment-select-grid {
        grid-template-columns: 1fr;
    }

    .tile-content {
        flex-direction: row;
        text-align: left;
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .tile-content i { margin-bottom: 0; }

    .input-inline-group {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .result-card { position: static; }

    .data-date-footer {
        flex-direction: column;
        text-align: center;
        gap: 0.4rem;
    }
}

@media (max-width: 480px) {
    .hospital-select-grid {
        grid-template-columns: 1fr;
    }

    .cost-value { font-size: 1.5rem; }
    .highlight-value .main-value { font-size: 1.8rem; }
    
    .category-tabs {
        flex-direction: column;
        gap: 0.2rem;
    }
}
