/* =============================================================================
 * LabPulse - SOE Phase 2.4 #8: file pickers and the other native controls, per theme.
 * The file picker markup comes from assets/js/modules/lp-file.js (.lp-file > input.lp-file-input + label.lp-file-btn +
 * .lp-file-text). Its colours come from the theme's own button tokens (--lp-btn-*), never one fixed grey; each theme
 * then gives it its own shape and detail below. The native input stays focusable: its focus shows on the button.
 * ========================================================================== */
:root {
    --lp-file-radius: var(--lp-btn-radius, 8px);
    --lp-file-border: 1px dashed var(--border-subtle);
    --lp-file-bg: var(--surface-subtle, transparent);
    --lp-file-btn-bg: var(--surface-card);
    --lp-file-btn-ink: var(--lp-btn-ink, var(--primary-600));
    --lp-file-btn-line: var(--lp-btn-line, var(--border-subtle));
    --lp-file-btn-hover-bg: var(--lp-btn-bg, var(--primary-500));
    --lp-file-btn-hover-ink: var(--lp-btn-fg, #fff);
    --lp-file-chosen: var(--status-available-fg, var(--primary-500));
    accent-color: var(--primary-500);
}
.lp-file { position: relative; display: flex; align-items: center; gap: var(--space-3); min-width: 0; width: 100%; padding: 6px; border: var(--lp-file-border); border-radius: calc(var(--lp-file-radius) + 4px); background: var(--lp-file-bg); transition: border-color 160ms ease, background-color 160ms ease; }
.lp-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; opacity: 0; }
.lp-file-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 var(--space-4); font-size: 0.875rem; font-weight: 600; line-height: 1; color: var(--lp-file-btn-ink); background: var(--lp-file-btn-bg); border: 1px solid var(--lp-file-btn-line); border-radius: var(--lp-file-radius); cursor: pointer; user-select: none; white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms ease, box-shadow 160ms ease; }
.lp-file-btn .icon { width: 18px; height: 18px; flex: none; }
.lp-file-btn:hover { background: var(--lp-file-btn-hover-bg); color: var(--lp-file-btn-hover-ink); border-color: transparent; }
.lp-file-btn:active { transform: translateY(1px) scale(0.98); }
.lp-file-input:focus-visible + .lp-file-btn { outline: none; box-shadow: var(--lp-focus, var(--focus-ring, 0 0 0 3px rgba(30, 58, 112, 0.35))); }
.lp-file-text { display: grid; min-width: 0; flex: 1 1 auto; line-height: 1.3; }
.lp-file-name { font-size: 0.875rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-file-meta { font-size: 0.75rem; color: var(--text-muted, var(--text-secondary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-file[data-state="chosen"] { border-style: solid; border-color: var(--lp-file-chosen); }
.lp-file[data-state="chosen"] .lp-file-name { color: var(--text-primary); font-weight: 600; }
.lp-file[data-drag] { border-color: var(--primary-500); background: var(--primary-50, rgba(0, 0, 0, 0.04)); }
.lp-file[data-disabled] { opacity: 0.6; }
.lp-file[data-disabled] .lp-file-btn { cursor: not-allowed; pointer-events: none; }
:root[data-lp-motion="reduced"] .lp-file-btn:active { transform: none; }
@media (max-width: 480px) {
    .lp-file { flex-wrap: wrap; }
    .lp-file-btn { width: 100%; justify-content: center; }
    .lp-file-text { flex-basis: 100%; padding: 0 4px 2px; }
}

/* each theme's own picker */
/* SOE Adjustment Batch 2: DYCI Classic follows its light / dark variant (the OS setting or the topbar switch) - no fixed white */
:root:not([data-lp-theme]), :root[data-lp-theme="dyci-classic"] { --lp-file-btn-bg: var(--surface-card); --lp-file-btn-ink: var(--accent-text); --lp-file-btn-line: var(--border-default, var(--border-subtle)); --lp-file-btn-hover-bg: #1e3a70; --lp-file-btn-hover-ink: #ffffff; --lp-file-chosen: #c9a227; }
:root:not([data-lp-theme]) .lp-file-btn, :root[data-lp-theme="dyci-classic"] .lp-file-btn { box-shadow: inset 0 -2px 0 #e2ae45; }
:root[data-lp-theme="midnight"] { --lp-file-radius: 6px; }
:root[data-lp-theme="midnight"]:where(:not([data-theme="light"])) { --lp-file-btn-bg: rgba(56, 189, 248, 0.08); --lp-file-btn-ink: #7dd3fc; --lp-file-btn-line: rgba(56, 189, 248, 0.45); --lp-file-btn-hover-bg: #38bdf8; --lp-file-btn-hover-ink: #04121f; --lp-file-chosen: #38bdf8; }
:root[data-lp-theme="midnight"] .lp-file { backdrop-filter: blur(6px); }
:root[data-lp-theme="aurora"] { --lp-file-radius: 999px; }
:root[data-lp-theme="aurora"]:where(:not([data-theme="light"])) { --lp-file-btn-bg: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(125, 211, 252, 0.16)); --lp-file-btn-ink: #e9e2ff; --lp-file-btn-line: rgba(196, 181, 253, 0.5); --lp-file-btn-hover-ink: #160c2e; --lp-file-chosen: #a78bfa; }
:root[data-lp-theme="aurora"] .lp-file { border-radius: 22px; }
:root[data-lp-theme="copper"]:where(:not([data-theme="light"])) { --lp-file-btn-bg: linear-gradient(180deg, #2a241a, #1d1912); --lp-file-btn-ink: #ecd59a; --lp-file-btn-line: #7a5e2c; --lp-file-btn-hover-ink: #1b1407; --lp-file-chosen: #c9a03f; --lp-file-border: 1px dashed rgba(201, 160, 63, 0.4); }
:root[data-lp-theme="copper"] .lp-file-btn { font-variant: small-caps; letter-spacing: 0.06em; }
:root[data-lp-theme="copper"]:where(:not([data-theme="light"])) .lp-file-btn { box-shadow: inset 0 1px 0 rgba(236, 213, 154, 0.18); }
:root[data-lp-theme="emerald"] { --lp-file-radius: 2px; }
:root[data-lp-theme="emerald"]:where(:not([data-theme="light"])) { --lp-file-btn-bg: transparent; --lp-file-btn-ink: #34d399; --lp-file-btn-line: #34d399; --lp-file-btn-hover-bg: #34d399; --lp-file-btn-hover-ink: #032015; --lp-file-chosen: #34d399; --lp-file-border: 1px dashed rgba(52, 211, 153, 0.45); }
:root[data-lp-theme="emerald"] .lp-file-btn, :root[data-lp-theme="emerald"] .lp-file-name { font-family: var(--font-mono); }
:root[data-lp-theme="emerald"] .lp-file-btn span::before { content: "$ "; opacity: 0.7; }
:root[data-lp-theme="obsidian"] { --lp-file-radius: 0; }
:root[data-lp-theme="obsidian"]:where(:not([data-theme="light"])) { --lp-file-btn-bg: transparent; --lp-file-btn-ink: #e8dcc2; --lp-file-btn-line: #5a5040; --lp-file-btn-hover-bg: #e8dcc2; --lp-file-btn-hover-ink: #121010; --lp-file-chosen: #d9c7a4; --lp-file-border: 1px solid #2c2822; }
:root[data-lp-theme="obsidian"] .lp-file-btn { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; }
:root[data-lp-theme="black-red"] { --lp-file-radius: 3px; }
:root[data-lp-theme="black-red"]:where(:not([data-theme="light"])) { --lp-file-btn-bg: #f0424f; --lp-file-btn-ink: #ffffff; --lp-file-btn-line: #f0424f; --lp-file-btn-hover-bg: #ff5c67; --lp-file-btn-hover-ink: #ffffff; --lp-file-chosen: #f0424f; --lp-file-border: 1px solid #3a1d20; }
:root[data-lp-theme="black-red"] .lp-file-btn { font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.8rem; }

/* the other native controls: checkboxes, radios, ranges and progress take the theme's accent; date and time pickers
   open in the theme's own light or dark scheme */
:root[data-lp-theme="midnight"]:where(:not([data-theme="light"])) { accent-color: #38bdf8; }
:root[data-lp-theme="aurora"]:where(:not([data-theme="light"])) { accent-color: #a78bfa; }
:root[data-lp-theme="copper"]:where(:not([data-theme="light"])) { accent-color: #c9a03f; }
:root[data-lp-theme="emerald"]:where(:not([data-theme="light"])) { accent-color: #34d399; }
:root[data-lp-theme="obsidian"]:where(:not([data-theme="light"])) { accent-color: #d9c7a4; }
:root[data-lp-theme="black-red"]:where(:not([data-theme="light"])) { accent-color: #f0424f; }
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] { min-height: 40px; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator, input[type="datetime-local"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.75; border-radius: 4px; padding: 2px; }
input[type="date"]::-webkit-calendar-picker-indicator:hover, input[type="time"]::-webkit-calendar-picker-indicator:hover, input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--primary-50, rgba(0, 0, 0, 0.06)); }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
