/* ==========================================================================
   Fair Drape Comparator — [tm_fair_drape]
   Light theme; matches free-tool cards (drape wheel / dress selector).
   ========================================================================== */

.tm-fdrape-card {
    --tmfd-bg: #ffffff;
    --tmfd-bg-soft: #f4f1ec;
    --tmfd-line: #e4dfd7;
    --tmfd-text: #1c1917;
    --tmfd-muted: #6b6560;
    --tmfd-accent: #8d3f5c;
    --tmfd-accent-soft: rgba(141, 63, 92, 0.1);
    --tmfd-focus: rgba(141, 63, 92, 0.22);
    --tmfd-warn: #c9973a;
    --tmfd-warn-bg: #fff8e8;
    --tmfd-ok: #3d7a5a;
    --tmfd-ok-bg: #eef6f1;
    max-width: 860px !important;
    margin: 3rem auto;
    padding: 28px;
    border-radius: 18px;
    background: var(--tmfd-bg);
    border: 1px solid var(--tmfd-line);
    color: var(--tmfd-text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
    box-sizing: border-box;
}

.tm-fdrape-card *,
.tm-fdrape-card *::before,
.tm-fdrape-card *::after {
    box-sizing: border-box;
}

.tm-fdrape-header {
    margin-bottom: 22px;
}

.tm-fdrape-title {
    margin: 0 0 8px;
    font-family: Fraunces, Georgia, serif;
    font-size: 1.55rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--tmfd-text);
}

.tm-fdrape-intro {
    margin: 0;
    color: var(--tmfd-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.tm-fdrape-card [hidden] {
    display: none !important;
}

/* ---- Two upload slots ----------------------------------------------------- */

.tm-fdrape-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.tm-fdrape-slot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.tm-fdrape-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 220px;
    padding: 20px 14px;
    border: 1.5px dashed #cfc8bd;
    border-radius: 14px;
    background: var(--tmfd-bg-soft);
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tm-fdrape-drop:hover,
.tm-fdrape-drop.is-drag {
    border-color: var(--tmfd-accent);
    background: var(--tmfd-accent-soft);
}

.tm-fdrape-slot-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--tmfd-text);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    z-index: 2;
}

.tm-fdrape-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    justify-content: center;
    cursor: pointer;
    padding: 12px;
}

.tm-fdrape-empty-icon {
    color: var(--tmfd-accent);
    margin-bottom: 2px;
}

.tm-fdrape-drop-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--tmfd-text);
}

.tm-fdrape-drop-hint {
    color: var(--tmfd-muted);
    font-size: 0.78rem;
    line-height: 1.4;
    max-width: 16em;
}

.tm-fdrape-canvas {
    display: none;
    width: 100%;
    height: auto;
    border-radius: 10px;
    cursor: crosshair;
}

.tm-fdrape-pick-hint {
    display: none;
    color: var(--tmfd-accent);
    font-size: 0.78rem;
    font-weight: 600;
}

.tm-fdrape-replace {
    display: none;
    margin-top: 2px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--tmfd-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tm-fdrape-replace:hover {
    color: var(--tmfd-accent);
}

.tm-fdrape-drop.has-photo {
    min-height: 0;
    padding: 12px;
    border-style: solid;
    border-color: var(--tmfd-line);
    background: var(--tmfd-bg);
    align-items: stretch;
}

.tm-fdrape-drop.has-photo:hover {
    background: var(--tmfd-bg);
    border-color: var(--tmfd-line);
}

.tm-fdrape-drop.has-photo .tm-fdrape-empty {
    display: none;
}

.tm-fdrape-drop.has-photo .tm-fdrape-canvas,
.tm-fdrape-drop.has-photo .tm-fdrape-pick-hint,
.tm-fdrape-drop.has-photo .tm-fdrape-replace {
    display: block;
}

.tm-fdrape-sample {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--tmfd-bg-soft);
    border: 1px solid var(--tmfd-line);
    font-size: 0.82rem;
}

.tm-fdrape-sample-swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(28, 25, 23, 0.12);
    flex-shrink: 0;
}

.tm-fdrape-sample-hex {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tmfd-text);
}

/* ---- Insights ------------------------------------------------------------- */

.tm-fdrape-insights {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tm-fdrape-report {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--tmfd-bg-soft);
    border: 1px solid var(--tmfd-line);
    font-size: 0.87rem;
    line-height: 1.5;
}

.tm-fdrape-report.is-warn {
    border-color: #f0d9a0;
    background: var(--tmfd-warn-bg);
}

.tm-fdrape-report.is-ok {
    border-color: #c5dfd0;
    background: var(--tmfd-ok-bg);
}

.tm-fdrape-report-tag {
    flex-shrink: 0;
    margin-top: 1px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(28, 25, 23, 0.06);
    color: var(--tmfd-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tm-fdrape-report.is-warn .tm-fdrape-report-tag {
    background: rgba(201, 151, 58, 0.18);
    color: #8a6518;
}

.tm-fdrape-report.is-ok .tm-fdrape-report-tag {
    background: rgba(61, 122, 90, 0.14);
    color: var(--tmfd-ok);
}

.tm-fdrape-lighting-text,
.tm-fdrape-fairness-text {
    flex: 1;
    min-width: 0;
    color: var(--tmfd-text);
}

.tm-fdrape-normalize {
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
    padding: 9px 14px;
    border-radius: 10px;
    border: none;
    background: var(--tmfd-accent);
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tm-fdrape-normalize:hover {
    background: #7a3450;
}

/* ---- Fair-pair suggestion ------------------------------------------------- */

.tm-fdrape-suggest {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--tmfd-accent-soft);
    border: 1px solid rgba(141, 63, 92, 0.18);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--tmfd-text);
}

.tm-fdrape-suggest-swatch {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(28, 25, 23, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* ---- Actions -------------------------------------------------------------- */

.tm-fdrape-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--tmfd-line);
    flex-wrap: wrap;
}

.tm-fdrape-caption-row {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tm-fdrape-caption-label {
    font-size: 0.78rem;
    color: var(--tmfd-muted);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tm-fdrape-caption {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--tmfd-line);
    background: #fff;
    color: var(--tmfd-text);
    font: inherit;
    font-size: 0.9rem;
}

.tm-fdrape-caption:focus {
    outline: none;
    border-color: var(--tmfd-accent);
    box-shadow: 0 0 0 3px var(--tmfd-focus);
}

.tm-fdrape-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tmfd-accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px 20px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.tm-fdrape-export:hover {
    background: #7a3450;
    transform: translateY(-1px);
}

.tm-fdrape-export:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* ---- Status --------------------------------------------------------------- */

.tm-fdrape-status {
    margin: 12px 0 0;
    min-height: 1.2em;
    font-size: 0.82rem;
    color: var(--tmfd-muted);
}

.tm-fdrape-status.is-error {
    color: #b42318;
}

@media (max-width: 560px) {
    .tm-fdrape-card {
        padding: 20px 16px;
    }

    .tm-fdrape-slots {
        grid-template-columns: 1fr;
    }

    .tm-fdrape-drop {
        min-height: 180px;
    }

    .tm-fdrape-report {
        flex-wrap: wrap;
    }

    .tm-fdrape-normalize {
        margin-left: 0;
        width: 100%;
    }

    .tm-fdrape-export {
        width: 100%;
    }
}
