/* === CSS Variables === */
:root {
    --navy-dark: #1a2a4a;
    --navy: #2c3e6e;
    --navy-light: #4a5d8a;
    --mint: #20c997;
    --mint-light: #63e6be;
    --mint-dark: #12b886;
    --green-safe: #40c057;
    --yellow-warning: #fab005;
    --red-danger: #fa5252;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* === Header === */
.header {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    padding: 0 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text h1 {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-text p {
    color: var(--mint-light);
    font-size: 0.75rem;
    opacity: 0.8;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-tab.active {
    background: var(--mint);
    color: var(--navy-dark);
}

.nav-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: var(--white);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(238, 90, 90, 0.3);
}

.nav-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 90, 90, 0.4);
}

/* === Main Content === */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Checker Tab === */
.checker-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
}

.input-panel,
.results-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.panel-header h2 {
    font-size: 1.2rem;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.view-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--navy);
}

.view-btn.active {
    background: var(--white);
    color: var(--navy);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Source Group Titles */
.source-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.source-group-icon {
    font-size: 1.2rem;
}

.source-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--gray-500);
    margin-left: 0.5rem;
}

/* Source Group Styling */
.result-category.source-group {
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.result-category.source-group.source-common {
    background: linear-gradient(135deg, rgba(76, 110, 245, 0.08) 0%, rgba(76, 110, 245, 0.02) 100%);
    border: 1px solid rgba(76, 110, 245, 0.2);
}

.result-category.source-group.source-product {
    background: linear-gradient(135deg, rgba(32, 201, 151, 0.08) 0%, rgba(32, 201, 151, 0.02) 100%);
    border: 1px solid rgba(32, 201, 151, 0.2);
}

.result-category.source-group.source-proviso {
    background: linear-gradient(135deg, rgba(250, 176, 5, 0.08) 0%, rgba(250, 176, 5, 0.02) 100%);
    border: 1px solid rgba(250, 176, 5, 0.3);
}

.result-category.source-group.source-frozen {
    background: linear-gradient(135deg, rgba(34, 184, 207, 0.08) 0%, rgba(34, 184, 207, 0.02) 100%);
    border: 1px solid rgba(34, 184, 207, 0.2);
}

.result-category.source-group.source-elderly {
    background: linear-gradient(135deg, rgba(151, 117, 250, 0.08) 0%, rgba(151, 117, 250, 0.02) 100%);
    border: 1px solid rgba(151, 117, 250, 0.2);
}

.result-category.source-group.source-infant {
    background: linear-gradient(135deg, rgba(240, 101, 149, 0.08) 0%, rgba(240, 101, 149, 0.02) 100%);
    border: 1px solid rgba(240, 101, 149, 0.2);
}

.input-section {
    margin-top: 1.5rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.step-number {
    background: var(--navy);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Search */
.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.15);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow-lg);
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--mint-light);
    color: var(--navy-dark);
}

.search-result-item small {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.selected-food {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--mint) 0%, var(--mint-dark) 100%);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: 500;
    display: none;
}

.selected-food.show {
    display: block;
}

/* Checkbox & Radio */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.checkbox-item:hover,
.radio-item:hover {
    background: var(--gray-100);
}

.checkbox-item:has(input:checked),
.radio-item:has(input:checked) {
    background: rgba(32, 201, 151, 0.1);
    border-color: var(--mint);
}

.checkbox-item input,
.radio-item input {
    accent-color: var(--mint);
    width: 18px;
    height: 18px;
}

/* Proviso (단서조항) Items */
.proviso-item {
    background: linear-gradient(135deg, rgba(250, 176, 5, 0.08) 0%, rgba(250, 176, 5, 0.03) 100%);
    border: 2px solid rgba(250, 176, 5, 0.3);
}

.proviso-item:hover {
    background: linear-gradient(135deg, rgba(250, 176, 5, 0.15) 0%, rgba(250, 176, 5, 0.08) 100%);
    border-color: var(--yellow-warning);
}

.proviso-item:has(input:checked) {
    background: linear-gradient(135deg, rgba(250, 176, 5, 0.2) 0%, rgba(250, 176, 5, 0.1) 100%);
    border-color: var(--yellow-warning);
}

.proviso-item input {
    accent-color: var(--yellow-warning);
}

#proviso-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px dashed var(--gray-200);
}

#proviso-section .input-label {
    color: #946c00;
}

#proviso-section .step-number {
    background: var(--yellow-warning);
    color: var(--gray-900);
}

/* Analyze Button */
.analyze-button {
    width: 100%;
    margin-top: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.analyze-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.analyze-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Results */
.applied-standards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.standard-tag {
    padding: 0.5rem 1rem;
    background: var(--navy);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

/* 태그 출처별 색상 */
.standard-tag.tag-common {
    background: linear-gradient(135deg, #4c6ef5 0%, #364fc7 100%);
}

.standard-tag.tag-product {
    background: linear-gradient(135deg, var(--mint) 0%, var(--mint-dark) 100%);
}

.standard-tag.tag-proviso {
    background: linear-gradient(135deg, #fab005 0%, #f59f00 100%);
    color: #1a1a1a;
}

.standard-tag.tag-frozen {
    background: linear-gradient(135deg, #22b8cf 0%, #15aabf 100%);
}

.standard-tag.tag-elderly {
    background: linear-gradient(135deg, #9775fa 0%, #7950f2 100%);
}

.standard-tag.tag-infant {
    background: linear-gradient(135deg, #f06595 0%, #e64980 100%);
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Result Cards */
.result-category {
    margin-bottom: 1.5rem;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.result-card {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--mint);
    transition: var(--transition);
}

.result-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-card-title {
    font-weight: 600;
    color: var(--gray-800);
}

.result-card-standard {
    font-size: 0.9rem;
    color: var(--mint-dark);
    font-weight: 500;
}

.result-card-source {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.method-btn {
    padding: 0.25rem 0.75rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.method-btn:hover {
    background: var(--navy-light);
}

/* Source Type Badges & Cards */
.source-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* 공통기준 - 파란색 */
.source-common {
    border-left-color: #4c6ef5 !important;
}

.source-type-badge.source-common {
    background: rgba(76, 110, 245, 0.15);
    color: #364fc7;
}

/* 제품규격 - 민트색 (기본) */
.source-product {
    border-left-color: var(--mint) !important;
}

.source-type-badge.source-product {
    background: rgba(32, 201, 151, 0.15);
    color: var(--mint-dark);
}

/* 단서조항 - 주황색 */
.source-proviso {
    border-left-color: var(--yellow-warning) !important;
}

.source-type-badge.source-proviso {
    background: rgba(250, 176, 5, 0.2);
    color: #946c00;
}

/* 냉동규격 - 하늘색 */
.source-frozen {
    border-left-color: #22b8cf !important;
}

.source-type-badge.source-frozen {
    background: rgba(34, 184, 207, 0.15);
    color: #0b7285;
}

/* 고령자용 - 보라색 */
.source-elderly {
    border-left-color: #9775fa !important;
}

.source-type-badge.source-elderly {
    background: rgba(151, 117, 250, 0.15);
    color: #6741d9;
}

/* 영유아용 - 분홍색 */
.source-infant {
    border-left-color: #f06595 !important;
}

.source-type-badge.source-infant {
    background: rgba(240, 101, 149, 0.15);
    color: #c2255c;
}

/* 기타 */
.source-other {
    border-left-color: var(--gray-400) !important;
}

.source-type-badge.source-other {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Result Card Footer */
.result-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
}

.result-card-footer .method-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
}

/* === Wizard Tab === */
.wizard-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wizard-header h2 {
    color: var(--navy);
}

.wizard-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.wizard-category-tag {
    background: linear-gradient(135deg, var(--mint) 0%, var(--mint-dark) 100%);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.wizard-step-info {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.wizard-question {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1.5rem;
    text-align: center;
}

.wizard-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wizard-options.wizard-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.wizard-option {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-weight: 500;
}

.wizard-option:hover {
    border-color: var(--mint);
    background: rgba(32, 201, 151, 0.05);
}

.wizard-option.selected {
    border-color: var(--mint);
    background: rgba(32, 201, 151, 0.15);
    color: var(--mint-dark);
}

.wizard-category-option {
    font-size: 1.1rem;
    padding: 1.25rem;
}

.wizard-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.wizard-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.wizard-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#wizard-back {
    background: var(--gray-200);
    color: var(--gray-700);
}

#wizard-next {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: white;
}

#wizard-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Wizard Result */
.wizard-result-header {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.wizard-result-category {
    font-size: 0.9rem;
    color: var(--mint-dark);
    margin-bottom: 0.75rem;
}

.wizard-result-type {
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.wizard-result-def {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.wizard-result-path {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.wizard-result-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.wizard-action-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 150px;
}

.wizard-action-btn.primary {
    background: linear-gradient(135deg, var(--mint) 0%, var(--mint-dark) 100%);
    color: white;
}

.wizard-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wizard-action-btn.secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.wizard-action-btn.secondary:hover {
    background: var(--gray-300);
}

/* === Calculator Tab === */
.calculator-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.calculator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.calculator-header h2 {
    color: var(--navy);
    font-size: 1.5rem;
}

.calc-section {
    margin-bottom: 2rem;
}

.calc-section h3 {
    color: var(--gray-700);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.standard-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.standard-input-group {
    text-align: center;
}

.standard-input-group label {
    display: block;
    font-weight: 700;
    color: var(--navy);
    font-size: 1.25rem;
}

.standard-input-group input {
    width: 100%;
    padding: 0.75rem;
    text-align: center;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    font-weight: 600;
}

.standard-input-group input:focus {
    outline: none;
    border-color: var(--mint);
}

.standard-input-group small {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.sample-inputs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.sample-input {
    text-align: center;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.sample-input:focus {
    outline: none;
    border-color: var(--mint);
}

.judge-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.judge-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.judgment-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.judgment-result.pass {
    background: rgba(64, 192, 87, 0.1);
    border: 2px solid var(--green-safe);
}

.judgment-result.fail {
    background: rgba(250, 82, 82, 0.1);
    border: 2px solid var(--red-danger);
}

.judgment-result .icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.judgment-result .text {
    font-size: 1.5rem;
    font-weight: 700;
}

.judgment-result.pass .text {
    color: var(--green-safe);
}

.judgment-result.fail .text {
    color: var(--red-danger);
}

.judgment-result .details {
    margin-top: 1rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* === Wizard Tab === */
.wizard-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wizard-header h2 {
    color: var(--navy);
}

.wizard-content {
    min-height: 200px;
}

.wizard-question {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    text-align: center;
}

.wizard-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wizard-option {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.wizard-option:hover {
    border-color: var(--mint);
    background: rgba(32, 201, 151, 0.05);
}

.wizard-option.selected {
    border-color: var(--mint);
    background: rgba(32, 201, 151, 0.15);
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.wizard-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.wizard-btn.primary {
    background: var(--navy);
    color: var(--white);
}

.wizard-btn.secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.wizard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wizard-result {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(32, 201, 151, 0.1) 0%, rgba(32, 201, 151, 0.05) 100%);
    border: 2px solid var(--mint);
    border-radius: var(--radius-lg);
    text-align: center;
}

.wizard-result h3 {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.wizard-result .result-type {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.wizard-result .result-def {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* === Additives Tab === */
.additives-container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.additives-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.additives-header h2 {
    color: var(--navy);
}

.additives-search {
    margin-bottom: 1.5rem;
}

.additives-search input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.additives-search input:focus {
    outline: none;
    border-color: var(--mint);
}

.additive-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.category-tab {
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.category-tab:hover {
    background: var(--gray-200);
}

.category-tab.active {
    background: var(--navy);
    color: var(--white);
}

.additives-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.additive-card {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1rem;
    border-left: 4px solid var(--mint);
}

.additive-card.not-allowed {
    border-left-color: var(--red-danger);
}

.additive-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.additive-food {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.additive-limit {
    font-size: 0.9rem;
    font-weight: 500;
}

.additive-limit.allowed {
    color: var(--green-safe);
}

.additive-limit.not-allowed {
    color: var(--red-danger);
}

.combined-limit-section {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.combined-limit-section h3 {
    color: var(--navy);
    margin-bottom: 1rem;
}

.combined-inputs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.combined-inputs select,
.combined-inputs input {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
}

.combined-inputs button {
    padding: 0.5rem 1rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.combined-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.combined-result.pass {
    background: rgba(64, 192, 87, 0.1);
    color: var(--green-safe);
}

.combined-result.fail {
    background: rgba(250, 82, 82, 0.1);
    color: var(--red-danger);
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--navy);
    color: var(--white);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* === Compatibility Warnings === */
.compatibility-warnings {
    margin-top: 0.75rem;
    padding: 0;
    display: none;
}

.warning-item {
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(250, 176, 5, 0.15) 0%, rgba(250, 176, 5, 0.08) 100%);
    border: 1px solid var(--yellow-warning);
    border-radius: var(--radius-sm);
    color: #946c00;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.checkbox-item.disabled,
.radio-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--gray-100);
}

.checkbox-item.disabled .checkbox-text,
.radio-item.disabled span {
    color: var(--gray-400);
    text-decoration: line-through;
}

/* === Responsive === */
@media (max-width: 900px) {
    .checker-container {
        grid-template-columns: 1fr;
    }

    .header-container {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }

    .nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .standard-inputs {
        grid-template-columns: repeat(2, 1fr);
    }

    .sample-inputs {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 모바일 최적화 (768px 이하) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .header-container {
        padding: 0.75rem;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .nav-tabs {
        gap: 0.25rem;
    }

    .nav-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* 패널 헤더 */
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-header h2 {
        font-size: 1rem;
    }

    .view-toggle {
        width: 100%;
        justify-content: center;
    }

    .view-btn {
        flex: 1;
        text-align: center;
    }

    /* 적용된 기준 태그 */
    .applied-standards {
        gap: 0.35rem;
    }

    .standard-tag {
        padding: 0.35rem 0.6rem;
        font-size: 0.7rem;
    }

    /* 결과 카드 */
    .result-card {
        padding: 0.75rem;
    }

    .result-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-card-title {
        font-size: 0.9rem;
    }

    .source-type-badge {
        padding: 0.15rem 0.4rem;
        font-size: 0.65rem;
    }

    .result-card-standard {
        font-size: 0.85rem;
    }

    .result-card-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .result-card-footer .method-btn {
        width: 100%;
    }

    /* 입력 옵션 */
    .checkbox-group,
    .radio-group {
        gap: 0.5rem;
    }

    .checkbox-item,
    .radio-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* 단서조항 */
    .proviso-item .checkbox-text strong {
        font-size: 0.85rem;
    }

    .proviso-item .checkbox-text small {
        font-size: 0.7rem;
    }

    /* 분석 버튼 */
    .analyze-button {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    /* 검색 */
    .search-input {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* 카테고리 제목 */
    .category-title {
        font-size: 0.95rem;
        padding: 0.5rem 0.75rem;
    }

    .source-group-title {
        font-size: 0.9rem;
    }

    .source-count {
        font-size: 0.7rem;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }

    .checker-panel,
    .results-panel {
        padding: 1rem;
        border-radius: 12px;
    }

    .standard-tag {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        border-radius: 12px;
    }

    .checkbox-group,
    .radio-group {
        flex-direction: column;
    }

    .checkbox-item,
    .radio-item {
        width: 100%;
    }

    .result-card-standard {
        font-size: 0.8rem;
        word-break: break-all;
    }

    .source-group-icon {
        font-size: 1rem;
    }

    /* 입력 라벨 */
    .input-label {
        font-size: 0.85rem;
    }

    .step-number {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }
}