:root {
    --brand: #01b574;
    --brand-dark: #019660;
    --bg: #f1f5f4;
    --text: #0f1f1c;
    --muted: #5d6f69;
    --card-bg: #ffffff;
    --border: #d6e2dd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 40px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.app-header h1 {
    margin: 4px 0 0;
    font-size: 32px;
}

.brand-eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    color: var(--muted);
}

.primary {
    border: none;
    cursor: pointer;
    background: var(--brand);
    color: white;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.primary:disabled {
    background: #9acfb8;
    cursor: not-allowed;
}

.primary:not(:disabled):hover {
    background: var(--brand-dark);
}

.primary.ghost {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--brand);
}

.app-main {
    background: var(--card-bg);
    border-radius: 32px;
    padding: 32px;
    min-height: 600px;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

h2 {
    margin: 0;
    font-size: 28px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

#symptomGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.card {
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border 0.2s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    /* gap: 12px; */
    align-items: flex-start;
}

.card:hover,
.card.active {
    transform: translateY(-4px);
    border-color: var(--brand);
}

.card-icon {
    width: 88px;
    height: 88px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.card-icon img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

#symptomGrid .card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#symptomGrid .card-icon {
    width: 176px;
    height: 176px;
}

#symptomGrid .card-icon img {
    width: 150px;
    height: 150px;
}

#symptomGrid .card h3 {
    margin-bottom: 0;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.card p {
    margin: 0;
    color: var(--muted);
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.check-item {
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    cursor: pointer;
    transition:
        border 0.2s ease,
        background 0.2s ease;
}

.check-item.active {
    border-color: var(--brand);
    background: rgba(1, 181, 116, 0.08);
}

.check-item input {
    margin-top: 6px;
}

.check-item ul {
    padding-left: 18px;
    margin: 6px 0 0;
    color: var(--muted);
}

.product-card img {
    width: clamp(120px, 35vw, 300px);
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin-bottom: 12px;
}

.card.product-card {
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: auto;
    gap: 12px;
}

#productGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.product-detail {
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    background: #fdfefc;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.product-detail h2 {
    margin-bottom: 16px;
}

.product-detail p {
    color: var(--muted);
    line-height: 1.6;
}

.product-detail .detail-image {
    width: min(500px, 60vw);
    height: auto;
    object-fit: contain;
    margin-bottom: 16px;
}

.detail-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.detail-actions .primary:not(.ghost) {
    margin-right: auto;
}

.is-hidden {
    display: none !important;
}

.slide-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

#checkSlide .slide-actions,
#productSlide .slide-actions {
    justify-content: flex-end;
}

#detailSlide .slide-actions {
    justify-content: flex-end;
    align-items: center;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 31, 28, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal-overlay.is-hidden {
    display: none;
}

.modal {
    position: relative;
    background: #fff;
    border-radius: 24px;
    width: min(1100px, 98vw);
    height: min(90vh, 760px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 60px rgba(15, 31, 28, 0.25);
}

.modal iframe {
    flex: 1;
    border: none;
    border-radius: 24px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
}

.modal-note {
    margin: 0;
    padding: 12px 20px 20px;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 768px) {
    .app-shell {
        padding: 16px;
    }

    .app-main {
        padding: 20px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    #symptomGrid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    #productGrid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}
