/* ==========================================================================
   FlixAdda Admin — shared theme + responsive layer
   Loaded by header.php on every admin page.
   Themes : light | dark | midnight | ocean   (html[data-skin])
   Accents: indigo | red | sky | emerald | amber | pink | violet | orange
   ========================================================================== */

/* ---------- 1. Design tokens ---------------------------------------------- */
html {
    --fx-font: "Outfit", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fx-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --fx-radius: 16px;
    --fx-radius-sm: 10px;
    --fx-header-h: 72px;

    --fx-accent: #4f46e5;
    --fx-on-accent: #ffffff;
    --fx-accent-dark: color-mix(in srgb, var(--fx-accent) 82%, #000);
    --fx-accent-light: color-mix(in srgb, var(--fx-accent) 60%, #fff);
    --fx-accent-soft: color-mix(in srgb, var(--fx-accent) 11%, transparent);
    --fx-accent-ring: color-mix(in srgb, var(--fx-accent) 28%, transparent);
    --fx-accent-grad: linear-gradient(135deg, var(--fx-accent-light) -40%, var(--fx-accent) 40%, var(--fx-accent-dark) 140%);

    --fx-success: #10b981;
    --fx-warning: #f59e0b;
    --fx-danger: #ef4444;
    --fx-info: #3b82f6;
    --fx-danger-text: #b91c1c;
    --fx-success-text: #047857;
    --fx-warning-text: #b45309;
    --fx-info-text: #1d4ed8;

    /* light (default) */
    --fx-bg: #f3f5fb;
    --fx-surface: #ffffff;
    --fx-surface-2: #f7f8fc;
    --fx-surface-3: #eceff6;
    --fx-text: #0f172a;
    --fx-text-2: #334155;
    --fx-muted: #64748b;
    --fx-muted-2: #94a3b8;
    --fx-border: #e3e8f0;
    --fx-border-strong: #cbd5e1;
    --fx-shadow: 0 6px 24px rgba(15, 23, 42, .07);
    --fx-shadow-lg: 0 18px 50px rgba(15, 23, 42, .16);
    --fx-overlay: rgba(15, 23, 42, .55);
    color-scheme: light;
}

html[data-skin="dark"] {
    --fx-bg: #0b1220;
    --fx-surface: #131c2f;
    --fx-surface-2: #19243a;
    --fx-surface-3: #223049;
    --fx-text: #e8ecf5;
    --fx-text-2: #cbd5e1;
    --fx-muted: #97a3b8;
    --fx-muted-2: #6b7a92;
    --fx-border: #26324b;
    --fx-border-strong: #364562;
    --fx-shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --fx-shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
    --fx-overlay: rgba(2, 6, 14, .7);
    color-scheme: dark;
}
html[data-skin="dark"], html[data-skin="midnight"], html[data-skin="ocean"] {
    --fx-danger-text: #fca5a5;
    --fx-success-text: #6ee7b7;
    --fx-warning-text: #fcd34d;
    --fx-info-text: #93c5fd;
}
html[data-skin="midnight"] {
    --fx-bg: #000000;
    --fx-surface: #0b0b0d;
    --fx-surface-2: #141417;
    --fx-surface-3: #1d1d21;
    --fx-text: #f3f3f5;
    --fx-text-2: #d4d4d8;
    --fx-muted: #9a9aa3;
    --fx-muted-2: #6e6e77;
    --fx-border: #232327;
    --fx-border-strong: #34343a;
    --fx-shadow: 0 6px 24px rgba(0, 0, 0, .6);
    --fx-shadow-lg: 0 18px 50px rgba(0, 0, 0, .8);
    --fx-overlay: rgba(0, 0, 0, .8);
    color-scheme: dark;
}
html[data-skin="ocean"] {
    --fx-bg: #06141f;
    --fx-surface: #0b2133;
    --fx-surface-2: #0f2b42;
    --fx-surface-3: #153854;
    --fx-text: #e4f3fb;
    --fx-text-2: #c4dcea;
    --fx-muted: #8db2c8;
    --fx-muted-2: #5f8aa3;
    --fx-border: #17405e;
    --fx-border-strong: #21567a;
    --fx-shadow: 0 6px 24px rgba(0, 12, 24, .5);
    --fx-shadow-lg: 0 18px 50px rgba(0, 12, 24, .7);
    --fx-overlay: rgba(2, 10, 18, .75);
    color-scheme: dark;
}

/* accents */
html[data-accent="indigo"]  { --fx-accent: #4f46e5; --fx-on-accent: #fff; }
html[data-accent="red"]     { --fx-accent: #dc143c; --fx-on-accent: #fff; }
html[data-accent="sky"]     { --fx-accent: #0284c7; --fx-on-accent: #fff; }
html[data-accent="emerald"] { --fx-accent: #059669; --fx-on-accent: #fff; }
html[data-accent="amber"]   { --fx-accent: #d97706; --fx-on-accent: #fff; }
html[data-accent="pink"]    { --fx-accent: #db2777; --fx-on-accent: #fff; }
html[data-accent="violet"]  { --fx-accent: #7c3aed; --fx-on-accent: #fff; }
html[data-accent="orange"]  { --fx-accent: #ea580c; --fx-on-accent: #fff; }
/* slightly brighter accents on dark skins so they stay readable */
html[data-skin="dark"][data-accent="indigo"],  html[data-skin="midnight"][data-accent="indigo"],  html[data-skin="ocean"][data-accent="indigo"]  { --fx-accent: #6366f1; }
html[data-skin="dark"][data-accent="red"],     html[data-skin="midnight"][data-accent="red"],     html[data-skin="ocean"][data-accent="red"]     { --fx-accent: #f43f5e; }
html[data-skin="dark"][data-accent="sky"],     html[data-skin="midnight"][data-accent="sky"],     html[data-skin="ocean"][data-accent="sky"]     { --fx-accent: #0ea5e9; }
html[data-skin="dark"][data-accent="emerald"], html[data-skin="midnight"][data-accent="emerald"], html[data-skin="ocean"][data-accent="emerald"] { --fx-accent: #10b981; }
html[data-skin="dark"][data-accent="amber"],  html[data-skin="midnight"][data-accent="amber"],  html[data-skin="ocean"][data-accent="amber"]  { --fx-accent: #f59e0b; --fx-on-accent: #1c1917; }
html[data-skin="dark"][data-accent="pink"],    html[data-skin="midnight"][data-accent="pink"],    html[data-skin="ocean"][data-accent="pink"]    { --fx-accent: #ec4899; }
html[data-skin="dark"][data-accent="violet"],  html[data-skin="midnight"][data-accent="violet"],  html[data-skin="ocean"][data-accent="violet"]  { --fx-accent: #8b5cf6; }
html[data-skin="dark"][data-accent="orange"],  html[data-skin="midnight"][data-accent="orange"],  html[data-skin="ocean"][data-accent="orange"]  { --fx-accent: #f97316; }

/* ---------- 2. Base ------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
html body {
    background: var(--fx-bg) !important;
    color: var(--fx-text);
    font-family: var(--fx-font) !important;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
html body.fx-no-scroll { overflow: hidden; }
img, video, canvas, svg { max-width: 100%; }
img { height: auto; }
::selection { background: var(--fx-accent); color: var(--fx-on-accent); }
:focus-visible { outline: 3px solid var(--fx-accent-ring); outline-offset: 2px; }
a { -webkit-tap-highlight-color: transparent; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--fx-border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--fx-border-strong); border-radius: 10px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. Form controls --------------------------------------------- */
html body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]):not(.fx-bare),
html body select,
html body textarea {
    font-family: var(--fx-font) !important;
    color: var(--fx-text);
    background-color: var(--fx-surface-2);
    border-color: var(--fx-border);
    max-width: 100%;
    box-sizing: border-box;
}
html body input::placeholder, html body textarea::placeholder { color: var(--fx-muted-2); opacity: 1; }
html body input:not([type=checkbox]):not([type=radio]):not(.fx-bare):focus,
html body select:focus,
html body textarea:focus {
    border-color: var(--fx-accent) !important;
    box-shadow: 0 0 0 4px var(--fx-accent-ring) !important;
    outline: none;
}
html body select option { background: var(--fx-surface); color: var(--fx-text); }
html body input[type=checkbox], html body input[type=radio], html body input[type=range] { accent-color: var(--fx-accent); }
html body button, html body input[type=submit], html body input[type=button] { font-family: var(--fx-font) !important; }
input[type=file]::file-selector-button {
    background: var(--fx-accent-soft); color: var(--fx-accent); border: 0; padding: 8px 14px;
    border-radius: 8px; font-weight: 700; margin-right: 10px; cursor: pointer;
}
html body input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--fx-surface-2) inset; -webkit-text-fill-color: var(--fx-text); }

/* ---------- 4. Tables ----------------------------------------------------- */
.fx-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }
.fx-table-wrap > table { min-width: 100%; }
html body table { color: var(--fx-text); border-color: var(--fx-border); }
html body table thead th { color: var(--fx-muted); }

/* stacked "card" tables on phones (JS adds .fx-stack + data-label) */
@media (max-width: 767px) {
    table.fx-stack, table.fx-stack tbody, table.fx-stack tr, table.fx-stack td { display: block; width: 100%; }
    table.fx-stack thead { display: none; }
    table.fx-stack tr {
        background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: 14px;
        margin: 0 0 12px; padding: 6px 4px; box-shadow: var(--fx-shadow);
    }
    table.fx-stack td {
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        padding: 9px 12px !important; border: 0 !important; text-align: right !important; min-height: 0;
    }
    table.fx-stack td::before {
        content: attr(data-label); flex: 0 0 34%; max-width: 40%; text-align: left;
        font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fx-muted);
    }
    table.fx-stack td[data-label=""]::before, table.fx-stack td:not([data-label])::before { display: none; }
    table.fx-stack td > * { max-width: 100%; }
    table.fx-stack td:first-child { border-bottom: 1px dashed var(--fx-border) !important; }
}

/* ---------- 5. Modals / dialogs / SweetAlert ------------------------------ */
.swal2-popup {
    background: var(--fx-surface) !important; color: var(--fx-text) !important;
    border: 1px solid var(--fx-border); border-radius: 20px !important;
    width: min(94vw, 34em) !important; font-family: var(--fx-font) !important;
}
.swal2-title, .swal2-html-container { color: var(--fx-text) !important; }
.swal2-html-container { max-height: 60vh; overflow: auto; }
.swal2-styled.swal2-confirm { background-color: var(--fx-accent) !important; color: var(--fx-on-accent) !important; }
.swal2-input, .swal2-textarea, .swal2-select { background: var(--fx-surface-2) !important; color: var(--fx-text) !important; border-color: var(--fx-border) !important; }
.swal2-container.swal2-backdrop-show { background: var(--fx-overlay) !important; }
.swal2-toast { background: var(--fx-surface) !important; color: var(--fx-text) !important; }
.swal2-validation-message { background: var(--fx-surface-2) !important; color: var(--fx-text) !important; }
@media (max-width: 480px) {
    .swal2-actions { flex-wrap: wrap; gap: 8px; }
    .swal2-actions .swal2-styled { flex: 1 1 auto; margin: 0 !important; }
}
/* custom modals used by pages */
[class*="modal-content"], [class*="modal-box"], [class*="modal-card"], [class*="modal-dialog"] {
    max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto;
    background-color: var(--fx-surface); color: var(--fx-text);
}
.modal-content, .modal-dialog > .modal-content { background-color: var(--fx-surface); color: var(--fx-text); border-color: var(--fx-border); }
.glightbox-container .gslide-description { background: var(--fx-surface); }

/* ---------- 6. Responsive helpers (apply to every page) ------------------- */
@media (max-width: 1023px) {
    html body { font-size: 15px; }
}
@media (max-width: 767px) {
    html body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),
    html body select, html body textarea { font-size: 16px !important; }       /* stops iOS zoom-on-focus */
    html body button, html body .btn, html body a.btn { min-height: 38px; }
    html body pre, html body code { white-space: pre-wrap; word-break: break-word; }
    html body h1 { font-size: clamp(1.35rem, 6vw, 1.75rem); line-height: 1.25; }
    html body h2 { font-size: clamp(1.15rem, 5vw, 1.4rem); }
    .container, .wrapper, .main-content, .page-wrap, main { max-width: 100% !important; }
}
/* sticky bottom bars should respect the iOS home indicator */
@supports (padding: max(0px)) {
    .save-bar, .fx-safe-bottom { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
/* long words / urls never blow the layout */
html body td, html body th, html body p, html body li, html body label, html body h1, html body h2, html body h3 { overflow-wrap: anywhere; }
html body td a, html body p a { word-break: break-word; }

/* Tailwind pages: containers that use fixed columns collapse gracefully */
@media (max-width: 640px) {
    .grid.grid-cols-4:not([class*="sm:"]):not([class*="md:"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 7. Tailwind utility remap -> theme tokens ---------------------- */
/* neutrals (apply in every skin so the whole UI follows the theme) */
html[data-skin] .bg-white { background-color: var(--fx-surface) !important; }
html[data-skin] :is(.bg-slate-50, .bg-gray-50, .bg-zinc-50, .bg-neutral-50, .bg-slate-50\/50) { background-color: var(--fx-surface-2) !important; }
html[data-skin] :is(.bg-slate-100, .bg-gray-100) { background-color: var(--fx-surface-3) !important; }
html[data-skin] :is(.bg-slate-200, .bg-gray-200) { background-color: var(--fx-border) !important; }
html[data-skin] :is(.hover\:bg-slate-50:hover, .hover\:bg-gray-50:hover, .hover\:bg-slate-50\/80:hover) { background-color: var(--fx-surface-2) !important; }
html[data-skin] :is(.hover\:bg-slate-200:hover, .hover\:bg-gray-200:hover, .hover\:bg-slate-300:hover, .hover\:bg-gray-300:hover) { background-color: var(--fx-border-strong) !important; }
html[data-skin] :is(.focus\:bg-white:focus) { background-color: var(--fx-surface) !important; }
html[data-skin] :is(.text-slate-900, .text-gray-900, .text-slate-800, .text-gray-800, .text-black) { color: var(--fx-text) !important; }
html[data-skin] :is(.text-slate-700, .text-gray-700, .text-slate-600, .text-gray-600) { color: var(--fx-text-2) !important; }
html[data-skin] :is(.text-slate-500, .text-gray-500) { color: var(--fx-muted) !important; }
html[data-skin] :is(.text-slate-400, .text-gray-400, .text-slate-300) { color: var(--fx-muted-2) !important; }
html[data-skin] :is(.border-slate-50, .border-gray-50, .border-slate-100, .border-gray-100, .border-slate-200, .border-gray-200, .border-slate-300) { border-color: var(--fx-border) !important; }
html[data-skin] :is(.divide-slate-100, .divide-gray-100) > :not([hidden]) ~ :not([hidden]) { border-color: var(--fx-border) !important; }
html[data-skin] .bg-white\/70, html[data-skin] .bg-white\/60 { background-color: color-mix(in srgb, var(--fx-surface) 75%, transparent) !important; }
/* primary-action colours follow the chosen accent */
html[data-skin] :is(.bg-red-600, .bg-rose-600, .bg-rose-500, .bg-indigo-600) { background-color: var(--fx-accent) !important; color: var(--fx-on-accent); }
html[data-skin] :is(.hover\:bg-red-700:hover, .hover\:bg-rose-700:hover, .hover\:bg-red-600:hover) { background-color: var(--fx-accent-dark) !important; }
html[data-skin] :is(.text-rose-500, .text-rose-600, .text-indigo-600, .text-indigo-400) { color: var(--fx-accent) !important; }
html[data-skin] :is(.focus\:ring-red-500:focus, .focus\:ring-indigo-500:focus, .focus\:ring-rose-500\/20:focus) { --tw-ring-color: var(--fx-accent-ring) !important; box-shadow: 0 0 0 3px var(--fx-accent-ring) !important; }
html[data-skin] :is(.focus\:border-red-500:focus, .focus\:border-rose-500:focus, .focus\:border-indigo-500:focus, .hover\:border-rose-500:hover, .hover\:border-red-500:hover) { border-color: var(--fx-accent) !important; }
html[data-skin] :is(.bg-red-50, .bg-rose-50, .bg-indigo-50) { background-color: var(--fx-accent-soft) !important; }
html[data-skin] :is(.hover\:bg-rose-50:hover, .hover\:bg-indigo-100:hover) { background-color: var(--fx-accent-soft) !important; }
html[data-skin] :is(.shadow-rose-600\/30) { --tw-shadow-color: var(--fx-accent-ring) !important; }
/* status chips: translucent on dark skins so they don't glare */
html:not([data-skin="light"]) :is(.bg-red-50, .bg-red-100, .bg-rose-100) { background-color: color-mix(in srgb, #ef4444 16%, transparent) !important; }
html:not([data-skin="light"]) :is(.bg-green-50, .bg-green-100, .bg-emerald-50) { background-color: color-mix(in srgb, #10b981 16%, transparent) !important; }
html:not([data-skin="light"]) :is(.bg-blue-50, .bg-sky-50) { background-color: color-mix(in srgb, #3b82f6 16%, transparent) !important; }
html:not([data-skin="light"]) :is(.bg-amber-50, .bg-yellow-50, .bg-yellow-100, .bg-orange-50) { background-color: color-mix(in srgb, #f59e0b 16%, transparent) !important; }
html:not([data-skin="light"]) :is(.text-red-600, .text-red-700, .text-red-800) { color: #fca5a5 !important; }
html:not([data-skin="light"]) :is(.text-green-600, .text-green-800, .text-emerald-600) { color: #6ee7b7 !important; }
html:not([data-skin="light"]) :is(.text-blue-600, .text-indigo-700) { color: #93c5fd !important; }
html:not([data-skin="light"]) :is(.text-amber-600, .text-yellow-600, .text-yellow-800, .text-orange-600) { color: #fcd34d !important; }
html:not([data-skin="light"]) :is(.border-red-100, .border-green-100, .border-emerald-100, .border-blue-100, .border-amber-100, .border-yellow-100, .border-orange-100, .border-indigo-100) { border-color: var(--fx-border) !important; }


/* Tailwind arbitrary-value colours used by older pages -> theme tokens */
html[data-skin] .text-\[\#0F172A\] { color: var(--fx-text) !important; }
html[data-skin] .text-\[\#9CA3AF\] { color: var(--fx-muted-2) !important; }
html[data-skin] .bg-\[\#FFFFFF\] { background-color: var(--fx-surface) !important; }
html[data-skin] :is(.border-\[\#0F172A\]\/5, .border-\[\#0F172A\]\/10, .border-\[\#0F172A\]\/20) { border-color: var(--fx-border) !important; }
html[data-skin] :is(.bg-\[\#0F172A\]\/5, .hover\:bg-\[\#0F172A\]\/5:hover) { background-color: var(--fx-surface-2) !important; }
html[data-skin] :is(.bg-\[\#DC143C\], .hover\:bg-\[\#DC143C\]:hover) { background-color: var(--fx-accent) !important; }
html[data-skin] :is(.hover\:bg-\[\#DC143C\]\/90:hover, .hover\:bg-\[\#b01030\]:hover) { background-color: var(--fx-accent-dark) !important; }
html[data-skin] :is(.bg-\[\#DC143C\]\/10, .bg-\[\#DC143C\]\/20) { background-color: var(--fx-accent-soft) !important; }
html[data-skin] :is(.text-\[\#DC143C\], .hover\:text-\[\#DC143C\]:hover) { color: var(--fx-accent) !important; }
html[data-skin] :is(.border-\[\#DC143C\]\/20) { border-color: var(--fx-accent-ring) !important; }
html[data-skin] :is(.focus\:border-\[\#DC143C\]:focus) { border-color: var(--fx-accent) !important; }
html[data-skin] :is(.focus\:ring-\[\#DC143C\]:focus, .focus\:ring-\[\#DC143C\]\/20:focus) { --tw-ring-color: var(--fx-accent-ring) !important; }
html[data-skin] .bg-\[\#DC143C\]:hover { color: var(--fx-on-accent); }

/* ---------- 8. Bootstrap pages (tmdb-matcher) ----------------------------- */
html[data-skin] .card, html[data-skin] .list-group-item, html[data-skin] .modal-content { background-color: var(--fx-surface); color: var(--fx-text); border-color: var(--fx-border); }
html[data-skin] .form-control, html[data-skin] .form-select { background-color: var(--fx-surface-2); color: var(--fx-text); border-color: var(--fx-border); }
html[data-skin] .table { --bs-table-bg: transparent; --bs-table-color: var(--fx-text); --bs-table-border-color: var(--fx-border); color: var(--fx-text); }
html[data-skin] .text-muted { color: var(--fx-muted) !important; }
html[data-skin] .btn-primary { background-color: var(--fx-accent); border-color: var(--fx-accent); color: var(--fx-on-accent); }

/* ---------- 9. Theme picker (opened from the header palette button) -------- */
.fx-tp-overlay { position: fixed; inset: 0; background: var(--fx-overlay); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 10000; }
.fx-tp-overlay.open { opacity: 1; pointer-events: auto; }
.fx-tp {
    position: fixed; z-index: 10001; background: var(--fx-surface); color: var(--fx-text);
    border: 1px solid var(--fx-border); box-shadow: var(--fx-shadow-lg);
    font-family: var(--fx-font); padding: 18px 18px 20px; opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .3s cubic-bezier(.25, 1, .5, 1);
    top: calc(var(--fx-header-h) + 8px); right: 16px; width: 340px; border-radius: 18px; transform: translateY(-8px) scale(.98);
    max-height: calc(100dvh - var(--fx-header-h) - 24px); overflow-y: auto;
}
.fx-tp.open { opacity: 1; pointer-events: auto; transform: none; }
.fx-tp-head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; margin-bottom: 4px; }
.fx-tp-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--fx-surface-3); color: var(--fx-muted); cursor: pointer; }
.fx-tp-label { margin: 14px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--fx-muted); }
.fx-tp-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-tp-mode {
    display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; padding: 9px 10px;
    border-radius: 12px; border: 1.5px solid var(--fx-border); background: var(--fx-surface-2); color: var(--fx-text); font-family: inherit;
    transition: border-color .15s, background .15s;
}
.fx-tp-mode:hover { border-color: var(--fx-border-strong); }
.fx-tp-mode.active { border-color: var(--fx-accent); background: var(--fx-accent-soft); }
.fx-tp-mode b { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; }
.fx-tp-mode small { display: block; font-size: 11px; color: var(--fx-muted); line-height: 1.2; margin-top: 2px; }
.fx-tp-swatch { flex: 0 0 34px; height: 34px; border-radius: 9px; position: relative; border: 1px solid var(--fx-border-strong); overflow: hidden; display: block; }
.fx-tp-swatch i { position: absolute; left: 6px; right: -2px; bottom: -2px; top: 11px; border-radius: 6px 0 0 0; display: block; }
.fx-tp-swatch.auto { background: linear-gradient(135deg, #f3f5fb 50%, #0b1220 50%); }
.fx-tp-swatch.auto i { background: linear-gradient(135deg, #fff 50%, #131c2f 50%); }
.fx-tp-accents { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.fx-tp-accent {
    aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; background: var(--c); color: #fff; cursor: pointer;
    display: grid; place-items: center; font-size: 12px; box-shadow: 0 0 0 1px var(--fx-border-strong);
}
.fx-tp-accent i { opacity: 0; transform: scale(.5); transition: .15s; }
.fx-tp-accent.active { border-color: var(--fx-surface); box-shadow: 0 0 0 2.5px var(--c); }
.fx-tp-accent.active i { opacity: 1; transform: none; }
.fx-tp-reset { margin-top: 16px; width: 100%; padding: 10px; border-radius: 12px; border: 1px dashed var(--fx-border-strong); background: transparent; color: var(--fx-muted); cursor: pointer; font-family: inherit; font-weight: 600; }
.fx-tp-reset:hover { color: var(--fx-text); border-color: var(--fx-accent); }
@media (max-width: 640px) {
    .fx-tp { top: auto; bottom: 0; left: 0; right: 0; width: auto; border-radius: 26px 26px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); transform: translateY(100%); max-height: 85dvh; }
    .fx-tp.open { transform: none; }
}
