:root {
    color-scheme: dark;
    --bg: #0F1626;
    --surface: #182238;
    --surface2: #22314A;
    --text: #E6ECF7;
    --muted: #A1AEC4;
    --primary: #4C8DFF;
    --primary-hover: #699fff;
    --primary-subtle: #273e66;
    --on-primary: #07101f;
    --accent: #2EC4B6;
    --accent-subtle: #234c54;
    --on-accent: #07101f;
    --border: #34435D;
    --secondary: #0A101C;
    --ring: #4C8DFF;
    --ok: #4ccf93;
    --wait: #e6a93a;
    --ko: #f27c80;
    --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

@keyframes panelIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulseRing {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.45); opacity: 0.45; }
}

@keyframes drawCurve {
    from { stroke-dashoffset: 600; }
    to { stroke-dashoffset: 0; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 104px;
}

/* ——— Barre supérieure minimaliste ——— */
.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 12px 36px;
    min-height: 62px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.nav-portal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.06em;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    margin-right: 6px;
}
.nav-portal:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--primary-subtle);
    transform: translateY(-1px);
}

.brand-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--on-primary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-head:hover .brand-mark { transform: rotate(25deg) scale(1.06); }
.brand-name { font-size: 15.5px; font-weight: 750; letter-spacing: -0.025em; color: var(--text); }
.badge-pro { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 99px; background: var(--primary-subtle); color: var(--text); border: 1px solid var(--border); }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seg-group, .picker-modes, .mode-pills, .radius-grid { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.seg-label { font-size: 11px; color: var(--muted); padding: 0 8px 0 6px; font-weight: 600; white-space: nowrap; }

.studio-dock {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 40;
    display: flex; align-items: center; gap: 10px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: 16px; padding: 8px 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28); max-width: calc(100vw - 24px); overflow-x: auto;
}
.dock-group { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dock-sep { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }

.floating-panel {
    position: fixed; z-index: 45;
    background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(18px);
    color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36); max-height: calc(100vh - 155px); overflow-y: auto;
    animation: panelIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.pop-tune { top: 74px; right: 28px; width: min(420px, calc(100vw - 28px)); display: flex; flex-direction: column; gap: 12px; }
.pop-audit { top: 74px; right: 28px; width: min(520px, calc(100vw - 28px)); }
.pop-export { top: 84px; right: 28px; width: min(640px, calc(100vw - 28px)); z-index: 50; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--border); cursor: grab; user-select: none; touch-action: none; }
.pop-head:active { cursor: grabbing; }
.drag-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.drag-title small { font-weight: 500; font-size: 11px; color: var(--muted); }
.grip { font-style: normal; color: var(--muted); letter-spacing: -1px; }

.btn-close {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.wheel-box,
.sliders-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wheel-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.wheel-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.wheel-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sec-title {
    font-size: 10.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 5px;
}

.wheel {
    position: relative;
    width: 114px;
    height: 114px;
    border-radius: 50%;
    cursor: crosshair;
    user-select: none;
    touch-action: none;
    background: conic-gradient(from 0deg, hsl(0 80% 56%), hsl(60 80% 56%), hsl(120 80% 56%), hsl(180 80% 56%), hsl(240 80% 56%), hsl(300 80% 56%), hsl(360 80% 56%));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.wheel::after {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    pointer-events: none;
}

.wheel svg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.dot {
    position: absolute;
    z-index: 2;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: width 0.15s ease, height 0.15s ease;
}

.dot.primary-dot {
    border-width: 2.5px;
    cursor: grab;
}

.wheel-hint {
    font-size: 10px;
    color: var(--muted);
}

.row label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 3px;
}

.row label output {
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: var(--bg);
    margin: 3px 0;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid var(--primary);
}

#hue {
    height: 8px;
    background: linear-gradient(90deg, hsl(0 80% 56%), hsl(60 80% 56%), hsl(120 80% 56%), hsl(180 80% 56%), hsl(240 80% 56%), hsl(300 80% 56%), hsl(360 80% 56%));
}

#vivid, #sAcc, #sBg {
    background: linear-gradient(90deg, var(--bg), var(--primary));
}

#bgL {
    background: linear-gradient(90deg, #070a12, #f8fafc);
}

.sliders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}
