/* Beauty AI Analyze - Premium Web Theme */
:root {
    --primary: #E8A0BF;
    --primary-dark: #D4789E;
    --text: #2D2D2D;
    --text-sub: #6B6B6B;
    --bg: #FAFAFA;
    --white: #FFFFFF;
    --border: #E8E8E8;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 16px;
    --green: #4CAF50;
    --red: #EF5350;
    --orange: #FF9800;
    --spring: #FF8FAB;
    --summer: #C8A2C8;
    --autumn: #CD853F;
    --winter: #DC143C;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }
.hidden { display: none !important; }

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, #FFF5F8 0%, #F8F0FF 50%, #F0F5FF 100%);
    padding: 3.5rem 0 2.5rem;
    text-align: center;
}
.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin-bottom: 0.6rem;
}
.hero-sub { color: var(--text-sub); font-size: 1.05rem; line-height: 1.7; }
.badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(232,160,191,0.15);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

/* ── Card ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ── Upload ── */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    overflow: hidden;
    position: relative;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(232,160,191,0.04);
}
.upload-placeholder { text-align: center; color: var(--text-sub); }
.upload-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--primary);
    margin: 0 auto 1rem;
}
.upload-hint { font-size: 0.8rem; color: #aaa; }
.preview-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

/* Guide */
.upload-guide h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.guide-label { font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
.guide-label.good { color: var(--green); }
.guide-label.bad { color: var(--red); }
.upload-guide ul {
    font-size: 0.85rem; color: var(--text-sub);
    line-height: 1.9; padding-left: 1.2rem;
}

/* ── Profile ── */
.profile-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 0.4rem; color: var(--text-sub);
}
.form-group select {
    width: 100%; padding: 0.6rem 0.8rem;
    border: 1px solid var(--border); border-radius: 10px;
    font-size: 0.9rem; background: var(--white);
    font-family: inherit; color: var(--text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236B6B6B'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
}
.form-group select:focus { outline: none; border-color: var(--primary); }
.optional { font-size: 0.8rem; color: #aaa; font-weight: 400; }
.section-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; }
.section-sub { font-size: 0.9rem; color: var(--text-sub); margin-bottom: 1.2rem; }

/* ── Buttons ── */
.btn-primary {
    width: 100%; padding: 0.85rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; border: none; border-radius: 12px;
    font-size: 1rem; font-weight: 700; cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(232,160,191,0.4);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    padding: 0.7rem 2rem;
    background: var(--white); color: var(--text);
    border: 1px solid var(--border); border-radius: 12px;
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-dark); }

.center-action { text-align: center; margin: 2rem 0; }

/* ── Loading ── */
.loading-content { text-align: center; padding: 2rem 0; }
.loading-content h3 { margin: 1rem 0 0.8rem; }
.loading-steps { text-align: left; max-width: 280px; margin: 0 auto; }
.loading-step {
    font-size: 0.85rem; padding: 0.4rem 0; color: #ccc;
    transition: color 0.3s;
}
.loading-step.active { color: var(--primary-dark); font-weight: 600; }
.loading-step.done { color: var(--green); }
.loading-step.done::before { content: "✓ "; }
.spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ── */
.error-msg {
    background: #FFF0F0; border: 1px solid #FFCDD2;
    color: #C62828; padding: 1rem 1.5rem;
    border-radius: 12px; margin: 1rem 0;
    font-size: 0.9rem;
}

/* ── Result Header ── */
.result-header-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.season-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1.2rem; border-radius: 25px;
    font-weight: 700; font-size: 1.1rem;
}
.season-spring { background: rgba(255,143,171,0.15); color: #D4567A; }
.season-summer { background: rgba(200,162,200,0.15); color: #8B5E8B; }
.season-autumn { background: rgba(205,133,63,0.15); color: #8B6914; }
.season-winter { background: rgba(220,20,60,0.15); color: #B01030; }
.conf-bar { width: 100%; height: 8px; background: #F0F0F0; border-radius: 4px; margin-top: 0.5rem; }
.conf-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.conf-high { background: linear-gradient(90deg, #4CAF50, #66BB6A); }
.conf-mid { background: linear-gradient(90deg, #FFA726, #FFB74D); }
.conf-low { background: linear-gradient(90deg, #EF5350, #E57373); }
.conclusion-box {
    margin-top: 1rem; padding: 0.8rem 1rem;
    background: #FFF8F0; border-radius: 12px;
    border-left: 4px solid var(--primary);
    font-size: 0.95rem; line-height: 1.6;
}

/* ── Tabs ── */
.tabs {
    display: flex; gap: 4px; overflow-x: auto;
    padding: 0.5rem 0; margin: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}
.tab {
    padding: 0.55rem 1.1rem; border: none; background: var(--white);
    border-radius: 10px; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; white-space: nowrap; font-family: inherit;
    color: var(--text-sub); border: 1px solid var(--border);
    transition: all 0.2s;
}
.tab:hover { border-color: var(--primary); color: var(--primary-dark); }
.tab.active {
    background: var(--primary); color: white;
    border-color: var(--primary);
}

#tab-content { min-height: 200px; }

/* ── Analysis blocks ── */
.analysis-block {
    padding: 1rem; background: var(--bg); border-radius: 12px;
    border-left: 4px solid var(--primary); margin-bottom: 0.8rem;
    font-size: 0.92rem; line-height: 1.7;
}
.analysis-block strong { display: block; margin-bottom: 0.3rem; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.metric-card {
    background: var(--white); border-radius: 14px;
    padding: 1.2rem 1rem; text-align: center;
    border: 1px solid var(--border);
    min-height: 110px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.metric-icon { font-size: 1.6rem; margin-bottom: 0.3rem; line-height: 1; }
.metric-label { font-size: 0.78rem; color: var(--text-sub); letter-spacing: 0.02em; }
.metric-value { font-size: 1.15rem; font-weight: 800; margin-top: 0.25rem; }

/* ── Detail sections ── */
.detail-section {
    background: var(--white); border-radius: 14px;
    border: 1px solid var(--border); margin-bottom: 0.8rem;
    overflow: hidden; transition: box-shadow 0.2s;
}
.detail-section:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.detail-section-header {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.8rem 1rem; background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.detail-section-header strong { font-size: 0.88rem; }
.detail-section-icon {
    width: 28px; height: 28px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.9rem; flex-shrink: 0;
}
.detail-section-body {
    padding: 1rem; font-size: 0.9rem; line-height: 1.75;
    color: var(--text);
}

/* ── Draping ── */
.draping-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.draping-item {
    display: flex; align-items: flex-start; gap: 0.8rem;
    margin-bottom: 0.8rem;
}
.color-chip {
    min-width: 44px; width: 44px; height: 44px;
    border-radius: 10px; border: 1px solid var(--border);
    flex-shrink: 0;
}
.draping-item .info { flex: 1; }
.draping-item .color-name { font-weight: 700; font-size: 0.88rem; }
.draping-item .effect { font-size: 0.82rem; color: var(--text-sub); line-height: 1.5; margin-top: 0.2rem; }

/* ── Color Palette ── */
.palette-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1rem; }
.swatch {
    text-align: center; cursor: default;
}
.swatch-color {
    width: 52px; height: 52px;
    border-radius: 12px; border: 2px solid var(--border);
    transition: transform 0.2s;
}
.swatch-color:hover { transform: scale(1.15); }
.swatch { position: relative; }
.swatch-tooltip {
    display: none; position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%); background: rgba(45,45,45,0.95);
    color: white; padding: 0.4rem 0.7rem; border-radius: 8px;
    font-size: 0.72rem; white-space: nowrap; z-index: 10;
    pointer-events: none;
}
.swatch:hover .swatch-tooltip { display: block; }
.swatch-name {
    font-size: 0.7rem; color: var(--text-sub);
    margin-top: 4px; max-width: 56px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Face Analysis ── */
.face-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.strength-box {
    background: #F0FFF0; border-radius: 12px; padding: 1rem;
}
.strength-box h4 { color: var(--green); margin-bottom: 0.5rem; font-size: 0.9rem; }
.improve-box {
    background: #FFF8F0; border-radius: 12px; padding: 1rem;
}
.improve-box h4 { color: var(--orange); margin-bottom: 0.5rem; font-size: 0.9rem; }
.strength-box ul, .improve-box ul {
    padding-left: 1.2rem; font-size: 0.88rem; line-height: 1.8;
}

/* ── Styling ── */
.styling-makeup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-bottom: 1.5rem; }
.hair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1.5rem; }
.hair-good { background: #F0FFF0; border-radius: 12px; padding: 1rem; }
.hair-good p:first-child { font-weight: 600; color: var(--green); margin-bottom: 0.3rem; font-size: 0.85rem; }
.hair-bad { background: #FFF0F0; border-radius: 12px; padding: 1rem; }
.hair-bad p:first-child { font-weight: 600; color: var(--red); margin-bottom: 0.3rem; font-size: 0.85rem; }

/* ── Product Cards ── */
.product-category { margin-bottom: 1.5rem; }
.product-category h4 {
    font-size: 0.85rem; color: var(--text-sub); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 0.8rem; font-weight: 700;
}
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.product-card {
    background: var(--white); border-radius: 12px;
    border: 1px solid var(--border); overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.product-img {
    width: 100%; height: 140px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; color: white;
    position: relative; overflow: hidden;
}
.product-img-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,0.08);
    padding: 0.5rem;
}
.product-img-overlay .brand-text {
    font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.1em; opacity: 0.9;
}
.product-img-overlay .product-text {
    font-size: 0.78rem; text-align: center; margin-top: 0.3rem;
    line-height: 1.3;
}
.product-body { padding: 1rem; }
.product-brand { font-size: 0.72rem; color: var(--text-sub); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.product-name { font-size: 0.9rem; font-weight: 700; margin: 0.2rem 0; line-height: 1.3; }
.product-price { font-size: 0.88rem; font-weight: 600; color: var(--primary-dark); }
.product-reason {
    font-size: 0.78rem; color: var(--text-sub);
    margin-top: 0.5rem; padding: 0.5rem;
    background: var(--bg); border-radius: 8px; line-height: 1.5;
}

/* Fashion product with color dot */
.fashion-color {
    display: inline-block; width: 14px; height: 14px;
    border-radius: 50%; border: 1px solid var(--border);
    vertical-align: middle; margin-right: 4px;
}

/* ── Best/Worst Colors ── */
.colors-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.color-item {
    display: flex; align-items: center; gap: 0.7rem;
    margin-bottom: 0.5rem;
}
.color-item .chip {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--border); flex-shrink: 0;
}
.color-item .name { font-weight: 700; font-size: 0.85rem; }
.color-item .reason { font-size: 0.8rem; color: var(--text-sub); margin-left: 0.4rem; }

/* ── Result Face Image ── */
.result-header-with-face {
    display: flex; align-items: center; gap: 1.5rem;
}
.result-face-img {
    width: 120px; height: 120px;
    border-radius: 50%; object-fit: cover;
    border: 4px solid var(--border);
    flex-shrink: 0;
}
.result-header-info { flex: 1; }

/* ── Buy Link ── */
.buy-link {
    display: inline-block; margin-top: 0.6rem;
    padding: 0.35rem 0.8rem;
    background: var(--primary); color: white;
    border-radius: 8px; font-size: 0.78rem;
    font-weight: 600; text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}
.buy-link:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ── Report (for html2canvas capture) ── */
.report-page {
    width: 800px; background: #fff;
    font-family: 'Pretendard Variable', sans-serif;
    padding: 0; overflow: hidden;
}
.rpt-header {
    padding: 2rem 2.5rem; color: white;
}
.rpt-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.rpt-badge { font-size: 0.75rem; opacity: 0.9; letter-spacing: 0.05em; }
.rpt-conf { font-size: 0.85rem; font-weight: 700; }
.rpt-header-main { display: flex; align-items: center; gap: 1.5rem; }
.rpt-face {
    width: 100px; height: 100px; border-radius: 50%;
    object-fit: cover; border: 3px solid rgba(255,255,255,0.6);
}
.rpt-season { font-size: 1.8rem; font-weight: 800; }
.rpt-season-en { font-size: 0.9rem; opacity: 0.85; margin-top: 0.2rem; }
.rpt-conclusion {
    margin-top: 0.6rem; padding: 0.5rem 0.8rem;
    background: rgba(255,255,255,0.2); border-radius: 8px;
    font-size: 0.82rem; line-height: 1.5;
}
.rpt-section { padding: 1rem 2.5rem; }
.rpt-title {
    font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem;
    padding-bottom: 0.3rem; border-bottom: 2px solid #E8E8E8;
}
.rpt-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.6rem; }
.rpt-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem; margin-bottom: 0.6rem; }
.rpt-block {
    background: #F8F8F8; padding: 0.6rem; border-radius: 8px;
    font-size: 0.75rem; line-height: 1.6;
}
.rpt-block strong { display: block; font-size: 0.72rem; color: #6B6B6B; margin-bottom: 0.2rem; }
.rpt-good {
    background: #F0FFF0; padding: 0.6rem; border-radius: 8px;
    font-size: 0.75rem; line-height: 1.6;
}
.rpt-good strong, .rpt-bad strong { display: block; margin-bottom: 0.3rem; font-size: 0.72rem; }
.rpt-good span, .rpt-bad span { display: block; }
.rpt-bad {
    background: #FFF8F0; padding: 0.6rem; border-radius: 8px;
    font-size: 0.75rem; line-height: 1.6;
}
.rpt-label { font-weight: 700; font-size: 0.82rem; margin-bottom: 0.5rem; }
.rpt-color-row { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.4rem; font-size: 0.72rem; line-height: 1.5; }
.rpt-chip { min-width: 24px; width: 24px; height: 24px; border-radius: 6px; border: 1px solid #ddd; flex-shrink: 0; }
.rpt-chip-lg { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #ddd; }
.rpt-colors-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.rpt-swatch { text-align: center; }
.rpt-swatch-name { font-size: 0.65rem; color: #6B6B6B; display: block; margin-top: 2px; }
.rpt-footer {
    display: flex; justify-content: space-between;
    padding: 0.8rem 2.5rem; font-size: 0.7rem; color: #ccc;
    border-top: 1px solid #eee;
}

/* ── Footer ── */
footer {
    text-align: center; padding: 2rem 1rem; color: #aaa;
    font-size: 0.8rem; max-width: 960px; margin: 0 auto;
}
.footer-privacy {
    background: #F8F8F8; border-radius: 12px;
    padding: 1rem 1.5rem; margin-bottom: 1rem;
    font-size: 0.78rem; line-height: 1.7; color: #888;
    border: 1px solid var(--border);
}
.footer-links {
    display: flex; justify-content: center; gap: 0.8rem;
    margin-bottom: 0.8rem; font-size: 0.78rem;
}
.footer-links a {
    color: #999; text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary-dark); }
.footer-links span { color: #ddd; }
.footer-note { font-size: 0.72rem; margin-top: 0.3rem; }

/* ── Share Modal ── */
.share-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.share-modal {
    background: white; border-radius: 16px; padding: 1.8rem;
    max-width: 420px; width: 90%; max-height: 85vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2); position: relative;
}
.share-modal-close {
    position: absolute; top: 12px; right: 16px;
    border: none; background: none; font-size: 1.5rem;
    cursor: pointer; color: #999; line-height: 1;
}
.share-modal-close:hover { color: #333; }
.share-modal h3 {
    font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; text-align: center;
}
.share-preview-wrap {
    width: 100%; max-height: 260px; overflow: hidden;
    border-radius: 10px; border: 1px solid var(--border);
    margin-bottom: 1.2rem; position: relative;
}
.share-preview-wrap::after {
    content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 50px;
    background: linear-gradient(transparent, white); pointer-events: none;
}
.share-preview {
    width: 140%; margin-left: -20%; display: block;
}
.share-buttons {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem;
}
.share-btn-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    padding: 0.7rem 0.3rem; border: 1px solid var(--border); border-radius: 12px;
    background: white; cursor: pointer; font-family: inherit;
    font-size: 0.68rem; color: #555; transition: all 0.2s;
}
.share-btn-item:hover { background: var(--bg); border-color: var(--accent-color); transform: translateY(-2px); }
.share-btn-item .share-icon { font-size: 1.5rem; line-height: 1; }
.share-btn-item img.share-icon { width: 28px; height: 28px; }

/* ── Cookie Banner ── */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(45,45,45,0.95); backdrop-filter: blur(8px);
    padding: 1rem 1.5rem; z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.cookie-banner.hidden { display: none; }
.cookie-content {
    max-width: 960px; margin: 0 auto;
    display: flex; align-items: center; gap: 1.5rem;
}
.cookie-content p {
    flex: 1; color: #e0e0e0; font-size: 0.8rem; line-height: 1.6; margin: 0;
}
.cookie-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ── Modal ── */
.modal {
    position: fixed; inset: 0; z-index: 10000;
    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); backdrop-filter: blur(4px);
}
.modal-content {
    position: relative; background: white;
    border-radius: 16px; max-width: 680px; width: 90%;
    max-height: 80vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 2rem 1rem; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: white;
    border-radius: 16px 16px 0 0; z-index: 1;
}
.modal-header h2 { font-size: 1.2rem; font-weight: 700; }
.modal-close {
    width: 36px; height: 36px; border: none; background: var(--bg);
    border-radius: 50%; font-size: 1.3rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-sub); transition: background 0.2s;
}
.modal-close:hover { background: #eee; }
.modal-body {
    padding: 1.5rem 2rem 2rem;
    font-size: 0.85rem; line-height: 1.8; color: var(--text);
}
.modal-body h3 {
    font-size: 0.95rem; font-weight: 700;
    margin: 1.5rem 0 0.5rem; color: var(--text);
}
.modal-body ul {
    padding-left: 1.2rem; margin-bottom: 0.8rem;
}
.modal-body a { color: var(--primary-dark); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.5rem; }
    .result-header-with-face { flex-direction: column; text-align: center; }
    .result-face-img { width: 90px; height: 90px; }
    .upload-grid { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr 1fr; }
    .metric-grid { grid-template-columns: 1fr; }
    .draping-grid { grid-template-columns: 1fr; }
    .face-grid { grid-template-columns: 1fr; }
    .styling-makeup-grid { grid-template-columns: 1fr; }
    .hair-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr 1fr; }
    .colors-grid { grid-template-columns: 1fr; }
    .tabs { gap: 2px; }
    .tab { font-size: 0.78rem; padding: 0.45rem 0.8rem; }
    .cookie-content { flex-direction: column; text-align: center; }
    .cookie-actions { justify-content: center; }
    .modal-content { width: 95%; max-height: 85vh; }
    .modal-body { padding: 1rem 1.2rem 1.5rem; }
    .footer-links { flex-wrap: wrap; }
}
