/* DXCISION shared light / dark theme tokens (Apple Health–inspired) */

:root,
[data-theme="light"] {
    color-scheme: light;

    --ink: #1c1c1e;
    --muted: #8e8e93;
    --muted-deep: #636366;
    --line: rgba(60, 60, 67, 0.12);
    --line-strong: rgba(60, 60, 67, 0.2);
    --surface: #ffffff;
    --panel: #f2f2f7;
    --field: rgba(120, 120, 128, 0.12);
    --field-hover: rgba(120, 120, 128, 0.18);
    --teal: #00a89b;
    --teal-dark: #008f84;
    --teal-soft: rgba(0, 168, 155, 0.14);
    --teal-glow: rgba(0, 168, 155, 0.22);
    --blue: #007aff;
    --blue-soft: rgba(0, 122, 255, 0.12);
    --red: #ff3b30;
    --red-soft: rgba(255, 59, 48, 0.12);
    --amber: #ff9500;
    --amber-soft: rgba(255, 149, 0, 0.14);
    --green: #34c759;
    --green-soft: rgba(52, 199, 89, 0.14);
    --overlay: rgba(0, 0, 0, 0.45);
    --scrollbar: rgba(120, 120, 128, 0.35);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 24px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 10px 40px rgba(0, 0, 0, 0.12);
    --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;

    --gradient-brand: linear-gradient(145deg, #00c4b4 0%, #008f84 100%);
    --gradient-primary: linear-gradient(180deg, #00b8aa 0%, #00a89b 100%);
    --gradient-sticky: linear-gradient(180deg, rgba(242, 242, 247, 0), var(--panel) 28%);
    --status-accent: linear-gradient(180deg, #00c4b4, #00a89b);

    --theme-switch-track: #e5e5ea;
    --theme-switch-track-active: linear-gradient(180deg, #00c4b4 0%, #00a89b 100%);
    --theme-switch-thumb: #ffffff;
    --theme-switch-thumb-shadow: 0 1px 4px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
    --theme-switch-icon: #8e8e93;
    --theme-switch-icon-active: #ffffff;
}

[data-theme="dark"] {
    color-scheme: dark;

    --ink: #f5f5f7;
    --muted: #98989d;
    --muted-deep: #aeaeb2;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.16);
    --surface: #1c1c1e;
    --panel: #000000;
    --field: rgba(255, 255, 255, 0.08);
    --field-hover: rgba(255, 255, 255, 0.12);
    --teal: #00d4c5;
    --teal-dark: #00a89b;
    --teal-soft: rgba(0, 212, 197, 0.18);
    --teal-glow: rgba(0, 212, 197, 0.28);
    --blue: #0a84ff;
    --blue-soft: rgba(10, 132, 255, 0.18);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.18);
    --amber: #ff9f0a;
    --amber-soft: rgba(255, 159, 10, 0.18);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.18);
    --overlay: rgba(0, 0, 0, 0.62);
    --scrollbar: rgba(255, 255, 255, 0.22);

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-float: 0 16px 48px rgba(0, 0, 0, 0.55);

    --gradient-brand: linear-gradient(145deg, #00d4c5 0%, #008f84 100%);
    --gradient-primary: linear-gradient(180deg, #00c4b4 0%, #00a89b 100%);
    --gradient-sticky: linear-gradient(180deg, rgba(0, 0, 0, 0), var(--panel) 28%);
    --status-accent: linear-gradient(180deg, #00d4c5, #00a89b);

    --theme-switch-track: rgba(255, 255, 255, 0.16);
    --theme-switch-track-active: linear-gradient(180deg, #00d4c5 0%, #00a89b 100%);
    --theme-switch-thumb: #f5f5f7;
    --theme-switch-thumb-shadow: 0 1px 6px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
    --theme-switch-icon: rgba(255, 255, 255, 0.45);
    --theme-switch-icon-active: #003d38;
}

.theme-switch {
    flex: 0 0 auto;
    position: relative;
    width: 30px;
    height: 30px;
    min-height: 30px !important;
    padding: 0 !important;
    border: none;
    border-radius: 50% !important;
    background: var(--surface) !important;
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--muted-deep) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.theme-switch:hover {
    background: var(--field) !important;
    color: var(--ink) !important;
}

.theme-switch:active {
    transform: scale(0.94);
}

.theme-switch:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px var(--line), 0 0 0 3px var(--teal-soft);
}

[data-theme="dark"] .theme-switch {
    background: var(--gradient-brand) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px var(--teal-glow), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .theme-switch:hover {
    filter: brightness(1.05);
}

.theme-switch-icon {
    position: absolute !important;
    inset: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.theme-switch-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    flex: 0 0 auto;
}

.theme-switch-icon-moon {
    color: #6366f1;
    opacity: 1;
}

.theme-switch-icon-sun {
    color: #f59e0b;
    opacity: 0;
}

[data-theme="dark"] .theme-switch-icon-moon {
    opacity: 0;
}

[data-theme="dark"] .theme-switch-icon-sun {
    opacity: 1;
    color: #ffffff;
}

.theme-switch-icon path {
    fill: currentColor;
}

* {
    scrollbar-color: var(--scrollbar) transparent;
}
