/*
 * DEEPCHAT Scoped Foundation & Dual-Family Typography System.
 * - Normal text: SamsungOne-400 (font-weight: 400, zero synthetic bold).
 * - Headings & emphasized text: SamsungOne-700 (font-weight: 400, zero extra bold).
 * - Mobile-first responsive scale: Mobile 12px (label 7px) | Tablet / iPad 13px (label 8px) | PC 15px (label 9px).
 * - Contains zero hard-coded colors — all colors come from theme-light.css / theme-dark.css.
 */

@font-face {
    font-family: 'SamsungOne-400';
    src: url('../assets/font/SamsungOne-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SamsungOne-700';
    src: url('../assets/font/SamsungOne-700.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Shared non-color layout & control geometry tokens */
:root {
    --deepchat-glass-backdrop-filter: blur(8px);
    --deepchat-glass-menu-backdrop-filter: blur(34px);
    --deepchat-dropdown-panel-padding: 12px;
    --deepchat-dropdown-option-radius: var(--deepchat-radius);
    --deepchat-dropdown-panel-radius: calc(var(--deepchat-radius) + var(--deepchat-dropdown-panel-padding));
    --deepchat-dropdown-option-gap: 8px;

    /* Compact switch contract (52x30px) */
    --deepchat-toggle-width: 52px;
    --deepchat-toggle-height: 30px;
    --deepchat-toggle-knob-size: 22px;
    --deepchat-toggle-knob-offset: 3px;
    --deepchat-toggle-knob-travel: 22px;
    --deepchat-toggle-transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    --deepchat-toggle-knob-transition: transform 160ms ease, background-color 160ms ease;
}

/* Tablet / iPad Mini (768px+) */
@media (min-width: 768px) {
    :root {
        --deepchat-font-size: var(--deepchat-font-size-tablet);
        --deepchat-floating-label-size: var(--deepchat-floating-label-size-tablet);
    }
}

/* Desktop / PC (>= 1280px mouse display) */
@media (min-width: 1280px) {
    :root {
        --deepchat-font-size: var(--deepchat-font-size-desktop);
        --deepchat-floating-label-size: var(--deepchat-floating-label-size-desktop);
    }
}

/* iPad Pro 12.9" / 13" landscape touch override (1280px..1366px coarse) -> Tablet scale */
@media (min-width: 1280px) and (max-width: 1366px) and (pointer: coarse) and (hover: none) {
    :root {
        --deepchat-font-size: var(--deepchat-font-size-tablet);
        --deepchat-floating-label-size: var(--deepchat-floating-label-size-tablet);
    }
}

/* Mobile landscape touch override -> Mobile scale */
@media (max-width: 950px) and (max-height: 480px) and (hover: none) and (pointer: coarse) {
    :root {
        --deepchat-font-size: var(--deepchat-font-size-mobile);
        --deepchat-floating-label-size: var(--deepchat-floating-label-size-mobile);
    }
}

/* Unified SamsungOne typography + anti-synthetic-bold across all DEEPCHAT surfaces */
:is(.dc-admin, .dc-ai-chat, .dc-admin-toast-region, .dc-floating-icons, .dc-feature-unavailable),
:is(.dc-admin, .dc-ai-chat, .dc-admin-toast-region, .dc-floating-icons, .dc-feature-unavailable) * {
    box-sizing: border-box;
    font-synthesis: none;
}

:is(.dc-admin, .dc-ai-chat, .dc-admin-toast-region, .dc-floating-icons, .dc-feature-unavailable) {
    font-family: var(--deepchat-font-regular);
    font-size: var(--deepchat-font-size);
    font-weight: 400;
    color: var(--deepchat-color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Enforce SamsungOne-400 with zero synthetic bold on regular UI elements */
:is(.dc-admin, .dc-ai-chat, .dc-admin-toast-region, .dc-feature-unavailable) :where(
    div, p, span, small, label, a, li, ul, ol, em, i, td, dd, dt, legend, button, input, select, textarea, option, code, time
) {
    font-family: var(--deepchat-font-regular);
    font-weight: 400;
}

:is(.dc-admin, .dc-ai-chat, .dc-feature-unavailable) :where(
    p, li, td, dd, dt, a, input, textarea, select, option, button, .button
) {
    font-size: var(--deepchat-font-size);
}

/* Headings & emphasized text use native SamsungOne-700 face with font-weight: 400 */
:is(.dc-admin, .dc-ai-chat, .dc-admin-toast-region, .dc-feature-unavailable) :where(
    h1, h2, h3, h4, h5, h6,
    th, strong, b,
    button, .button, .button-primary, .button-secondary,
    .dc-badge, .dc-admin-toast
) {
    font-family: var(--deepchat-font-emphasis);
    font-weight: 400;
    font-synthesis: none;
}

:is(.dc-admin, .dc-ai-chat, .dc-feature-unavailable) :where(h1, h2, h3, h4, h5, h6) {
    font-size: var(--deepchat-font-size);
    line-height: 1.35;
}

/* Text ownership guard: protects DEEPCHAT semantic text against WP theme / Elementor overrides
   (strictly excludes floating labels, badges, unit suffixes, legends & async pending skeletons) */
html body .dc-text-node:not([data-dc-pending="true"]):not(.dc-input-label):not(.dc-input-shell):not(.dc-input-shell__unit):not(.dc-field__label):not(.dc-badge):not(.dc-skel):is(.dc-text-node--p,
    .dc-text-node--span,
    .dc-text-node--li,
    .dc-text-node--ul,
    .dc-text-node--ol,
    .dc-text-node--a,
    .dc-text-node--b,
    .dc-text-node--strong,
    .dc-text-node--em,
    .dc-text-node--i) {
    color: var(--deepchat-color-text) !important;
    -webkit-text-fill-color: var(--deepchat-color-text) !important;
    font-family: inherit !important;
    text-decoration-color: currentColor !important;
}
