/* HAMDAE Fleet Policy & Legal Design System */
:root {
    color-scheme: light dark;
    --theme-primary: #2563EB;
    --theme-primary-soft: #EFF6FF;
    --theme-background: #F8FAFC;
    --theme-surface: #FFFFFF;
    --theme-text: #0F172A;
    --theme-muted: #475569;
    --theme-outline: #E2E8F0;
    --theme-shadow: rgba(15, 23, 42, 0.06);

    /* Backward compatibility fallback */
    --spring-primary: var(--theme-primary);
    --spring-primary-soft: var(--theme-primary-soft);
    --spring-background: var(--theme-background);
    --spring-surface: var(--theme-surface);
    --spring-text: var(--theme-text);
    --spring-muted: var(--theme-muted);
    --spring-outline: var(--theme-outline);
}

/* 1. SnackPlay Theme (Rose / Coral / Gamer) */
[data-theme="snackplay"], body.theme-snackplay {
    --theme-primary: #E11D48;
    --theme-primary-soft: #FFE4E6;
    --theme-background: #FFF5F6;
    --theme-surface: #FFFFFF;
    --theme-text: #1F2937;
    --theme-muted: #4B5563;
    --theme-outline: #FECDD3;
    --theme-shadow: rgba(225, 29, 72, 0.08);
}

/* 2. PaletteWeather Theme (Sky Blue / Weather) */
[data-theme="paletteweather"], body.theme-paletteweather {
    --theme-primary: #0284C7;
    --theme-primary-soft: #E0F2FE;
    --theme-background: #F0F9FF;
    --theme-surface: #FFFFFF;
    --theme-text: #0F172A;
    --theme-muted: #475569;
    --theme-outline: #BAE6FD;
    --theme-shadow: rgba(2, 132, 199, 0.08);
}

/* 3. PhotoFit Theme (Ice / Crisp Blue / Photography) */
[data-theme="photofit"], body.theme-photofit {
    --theme-primary: #2563EB;
    --theme-primary-soft: #EFF6FF;
    --theme-background: #F8FAFC;
    --theme-surface: #FFFFFF;
    --theme-text: #0F172A;
    --theme-muted: #475569;
    --theme-outline: #BFDBFE;
    --theme-shadow: rgba(37, 99, 235, 0.08);
}

/* 4. HealingVisualizer Theme (Midnight Indigo / Relaxation) */
[data-theme="healing"], body.theme-healing {
    --theme-primary: #6366F1;
    --theme-primary-soft: #EEF2FF;
    --theme-background: #F9F8FE;
    --theme-surface: #FFFFFF;
    --theme-text: #1E1B4B;
    --theme-muted: #4B5563;
    --theme-outline: #C7D2FE;
    --theme-shadow: rgba(99, 102, 241, 0.08);
}

/* 5. NativeLayoutStudio Theme (Spring Green / UI Designer) */
[data-theme="nativelayoutstudio"], body.theme-nativelayoutstudio {
    --theme-primary: #16A34A;
    --theme-primary-soft: #DCFCE7;
    --theme-background: #F6F8F3;
    --theme-surface: #FFFFFF;
    --theme-text: #14532D;
    --theme-muted: #4B5563;
    --theme-outline: #BBF7D0;
    --theme-shadow: rgba(22, 163, 74, 0.08);
}

/* 6. SnapCaption Theme (Vivid Violet & Coral / Social Storyteller) */
[data-theme="snapcaption"], body.theme-snapcaption {
    --theme-primary: #7C3AED;
    --theme-primary-soft: #F5F3FF;
    --theme-background: #FAF8FF;
    --theme-surface: #FFFFFF;
    --theme-text: #2E1065;
    --theme-muted: #4B5563;
    --theme-outline: #DDD6FE;
    --theme-shadow: rgba(124, 58, 237, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 24px 16px 48px;
    background: var(--theme-background);
    color: var(--theme-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.policy-shell {
    width: min(840px, 100%);
    margin: 0 auto;
    padding: clamp(24px, 5vw, 48px);
    border: 1px solid var(--theme-outline);
    border-radius: 24px;
    background: var(--theme-surface);
    box-shadow: 0 12px 36px var(--theme-shadow);
}
.policy-brand { display: flex; align-items: center; gap: 12px; color: var(--theme-primary); font-weight: 750; font-size: 1.15rem; }
.policy-avatar { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 4px 12px var(--theme-shadow); object-fit: cover; flex-shrink: 0; border: 1px solid var(--theme-outline); transition: transform 0.2s ease; }
.policy-avatar:hover { transform: scale(1.05); }
.policy-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--theme-primary-soft); color: var(--theme-primary); font-weight: 800; font-size: 0.95rem; }
.language { margin-left: auto; font-size: 0.875rem; font-weight: 600; }
.language a, a { color: var(--theme-primary); text-underline-offset: 3px; }
.policy-header { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
h1 { margin: 0 0 10px; font-size: clamp(1.85rem, 5vw, 2.45rem); line-height: 1.2; letter-spacing: -0.035em; color: var(--theme-text); }
.lead { margin: 0 0 30px; color: var(--theme-muted); font-size: 1.02rem; }
h2 { margin: 32px 0 10px; font-size: 1.12rem; color: var(--theme-primary); font-weight: 700; }
p, li { color: var(--theme-muted); }
ul { padding-left: 22px; }
.notice { padding: 16px 18px; border-left: 4px solid var(--theme-primary); border-radius: 4px 14px 14px 4px; background: var(--theme-primary-soft); color: var(--theme-text); }
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.92rem; }
th, td { padding: 12px; border: 1px solid var(--theme-outline); text-align: left; vertical-align: top; }
th { background: var(--theme-primary-soft); color: var(--theme-text); font-weight: 700; }
.policy-footer { margin-top: 42px; padding-top: 20px; border-top: 1px solid var(--theme-outline); color: var(--theme-muted); font-size: 0.85rem; }
.support-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.support-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--theme-primary); border-radius: 12px; background: var(--theme-primary); color: #ffffff; font-weight: 700; text-decoration: none; }
.support-button.secondary { background: transparent; color: var(--theme-primary); }
.faq-list { display: grid; gap: 10px; margin-top: 16px; }
.faq-list details { border: 1px solid var(--theme-outline); border-radius: 14px; background: var(--theme-surface); }
.faq-list summary { padding: 15px 46px 15px 16px; color: var(--theme-text); font-weight: 700; cursor: pointer; position: relative; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 16px; top: 50%; color: var(--theme-primary); font-size: 1.25rem; transform: translateY(-50%); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details[open] summary { border-bottom: 1px solid var(--theme-outline); }
.faq-answer { padding: 0 16px 16px; }
.faq-answer p:last-child, .faq-answer ul:last-child { margin-bottom: 0; }
.support-note { margin-top: 30px; padding: 18px; border: 1px solid var(--theme-outline); border-radius: 16px; background: var(--theme-primary-soft); }

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --theme-primary: #60A5FA;
        --theme-primary-soft: #1E293B;
        --theme-background: #0F172A;
        --theme-surface: #1E293B;
        --theme-text: #F8FAFC;
        --theme-muted: #94A3B8;
        --theme-outline: #334155;
        --theme-shadow: none;
    }
    [data-theme="snackplay"], body.theme-snackplay {
        --theme-primary: #FB7185;
        --theme-primary-soft: #4C0519;
        --theme-background: #12080B;
        --theme-surface: #1C0F14;
        --theme-text: #FFF1F2;
        --theme-muted: #FDA4AF;
        --theme-outline: #5C1D2E;
    }
    [data-theme="paletteweather"], body.theme-paletteweather {
        --theme-primary: #38BDF8;
        --theme-primary-soft: #082F49;
        --theme-background: #081018;
        --theme-surface: #0E1A26;
        --theme-text: #F0F9FF;
        --theme-muted: #7DD3FC;
        --theme-outline: #164E63;
    }
    [data-theme="photofit"], body.theme-photofit {
        --theme-primary: #60A5FA;
        --theme-primary-soft: #172554;
        --theme-background: #080D1A;
        --theme-surface: #0F172A;
        --theme-text: #F8FAFC;
        --theme-muted: #93C5FD;
        --theme-outline: #1E3A8A;
    }
    [data-theme="healing"], body.theme-healing {
        --theme-primary: #818CF8;
        --theme-primary-soft: #1E1B4B;
        --theme-background: #0B0B16;
        --theme-surface: #14142B;
        --theme-text: #EEF2FF;
        --theme-muted: #A5B4FC;
        --theme-outline: #312E81;
    }
    [data-theme="nativelayoutstudio"], body.theme-nativelayoutstudio {
        --theme-primary: #4ADE80;
        --theme-primary-soft: #052E16;
        --theme-background: #08120B;
        --theme-surface: #101E13;
        --theme-text: #F0FDF4;
        --theme-muted: #86EFAC;
        --theme-outline: #14532D;
    }
    [data-theme="snapcaption"], body.theme-snapcaption {
        --theme-primary: #A78BFA;
        --theme-primary-soft: #2E1065;
        --theme-background: #0E071A;
        --theme-surface: #1A0F2E;
        --theme-text: #F5F3FF;
        --theme-muted: #C4B5FD;
        --theme-outline: #4C1D95;
    }
    .policy-shell { box-shadow: none; }
    .support-button { color: #0F172A; }
    .support-button.secondary { color: var(--theme-primary); }
}

@media (max-width: 560px) {
    body { padding: 0; }
    .policy-shell { border: 0; border-radius: 0; min-height: 100vh; }
    .policy-header { align-items: flex-start; }
}
