* { margin: 0; padding: 0; box-sizing: border-box; }

:root { --bg: #0a0e17; --bg-alt: #0d111c; --surface: rgba(255,255,255,0.06); --surface-hover: rgba(255,255,255,0.1); --surface-active: rgba(255,255,255,0.14); --border: rgba(255,255,255,0.1); --border-hover: rgba(255,255,255,0.18); --primary: #00e5ff; --primary-dim: rgba(0,229,255,0.15); --accent: #ff6b35; --accent-dim: rgba(255,107,53,0.15); --text: #e8eaed; --text-secondary: #9aa0a6; --text-muted: #6b7280; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 20px; --shadow: 0 8px 32px rgba(0,0,0,0.4); --font: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans SC",sans-serif; --font-mono: "SF Mono","Fira Code","Cascadia Code","Consolas",monospace; --chk-a: #fff; --chk-b: #e8e8e8; }

html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: var(--primary-dim); color: var(--primary); }
::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }
kbd { display: inline-block; padding: 0 5px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-secondary); background: var(--surface-hover); border: 1px solid var(--border); border-radius: 3px; line-height: 1.6; }

.app { max-width: 1200px; margin: 0 auto; padding: 12px 20px; min-height: 100vh; display: flex; flex-direction: column; gap: 8px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: #141a26; border: 1px solid var(--border); border-radius: var(--radius-lg); backdrop-filter: blur(20px); }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-mark { font-size: 20px; line-height: 1; }
.logo-text { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; }
.logo-badge { font-size: 10px; font-weight: 500; color: var(--text-muted); font-family: var(--font-mono); padding: 2px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.status-text { font-size: 12px; color: var(--text-secondary); }
.btn-icon-only { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-icon-only:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.btn-icon-only:disabled { opacity: 0.35; cursor: default; pointer-events: auto; }
.btn-icon-only:disabled:hover { border-color: var(--border); color: var(--text-muted); background: var(--surface); }

.image-tabs { display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: #141a26; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.image-tabs[hidden] { display: none; }
.tabs-scroll { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.img-tab { display: flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font-size: 11px; cursor: pointer; white-space: nowrap; font-family: inherit; transition: all 0.15s; }
.img-tab.active { border-color: var(--primary); color: var(--text); background: var(--primary-dim); }
.img-tab .tab-close { width: 14px; height: 14px; border-radius: 50%; border: none; background: transparent; color: var(--text-muted); font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.img-tab .tab-close:hover { background: var(--accent-dim); color: var(--accent); }
.tab-add { width: 22px; height: 22px; border-radius: 4px; border: 1px dashed var(--border); background: transparent; color: var(--text-muted); font-size: 14px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.tab-add:hover { border-color: var(--primary); color: var(--primary); }

.main { display: grid; grid-template-columns: 1fr 280px; gap: 8px; flex: 1; min-height: 0; }
.canvas-area { position: relative; display: flex; min-height: 0; }

.canvas-wrapper { position: relative; flex: 1; background: var(--bg-alt); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; min-height: 400px; transition: border-color 0.25s; cursor: grab; }
.canvas-wrapper.dragover { border-color: var(--primary); box-shadow: 0 0 30px rgba(0,229,255,0.08); }
.canvas-wrapper.panning { cursor: grabbing; }
#mainCanvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.canvas-wrapper.eyedropper #mainCanvas { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%2300e5ff' stroke-width='1.5' opacity='.8'/%3E%3Ccircle cx='12' cy='12' r='2' fill='%2300e5ff' opacity='.8'/%3E%3Cline x1='12' y1='3' x2='12' y2='8' stroke='%2300e5ff' stroke-width='1.5' opacity='.8'/%3E%3Cline x1='12' y1='16' x2='12' y2='21' stroke='%2300e5ff' stroke-width='1.5' opacity='.8'/%3E%3Cline x1='3' y1='12' x2='8' y2='12' stroke='%2300e5ff' stroke-width='1.5' opacity='.8'/%3E%3Cline x1='16' y1='12' x2='21' y2='12' stroke='%2300e5ff' stroke-width='1.5' opacity='.8'/%3E%3C/svg%3E") 12 12, crosshair; }

.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; padding: 40px; gap: 8px; z-index: 1; }
.placeholder-icon { color: var(--text-muted); opacity: 0.5; }
.placeholder-text { font-size: 16px; font-weight: 500; color: var(--text-secondary); }
.placeholder-hint { font-size: 12px; color: var(--text-muted); }
.placeholder-shortcuts { display: flex; gap: 10px; margin-top: 2px; flex-wrap: wrap; justify-content: center; }
.shortcut { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }

.color-tooltip { position: absolute; display: none; align-items: center; gap: 6px; padding: 5px 8px; background: rgba(10,14,23,0.92); border: 1px solid var(--border-hover); border-radius: 6px; pointer-events: none; white-space: nowrap; z-index: 10; backdrop-filter: blur(8px); }
.tooltip-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.15); }
.tooltip-hex { font-size: 11px; font-weight: 600; font-family: var(--font-mono); }
.zoom-label, .pan-label { position: absolute; bottom: 8px; padding: 3px 8px; background: rgba(10,14,23,0.8); font-size: 11px; font-family: var(--font-mono); border-radius: 4px; border: 1px solid var(--border); pointer-events: none; z-index: 5; backdrop-filter: blur(8px); }
.zoom-label { right: 8px; color: var(--text-secondary); }
.pan-label { left: 8px; color: var(--text-muted); }

.magnifier { position: absolute; pointer-events: none; z-index: 20; background: #141a26; border: 1px solid var(--border); border-radius: 10px; padding: 5px; box-shadow: 0 4px 20px rgba(0,0,0,0.6); backdrop-filter: blur(12px); flex-direction: column; align-items: center; gap: 3px; transform: translate(16px,-50%); display: none; }
#magnifierCanvas { display: block; width: 70px; height: 70px; border-radius: 50%; border: 2px solid var(--primary); box-shadow: 0 0 10px rgba(0,229,255,0.15); image-rendering: pixelated; }
.magnifier-hex { font-size: 10px; font-weight: 600; font-family: var(--font-mono); }
.magnifier-coord { font-size: 9px; font-family: var(--font-mono); color: var(--text-muted); }

.context-menu { position: absolute; z-index: 30; background: #141a26; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.context-menu[hidden] { display: none; }
.ctx-item { padding: 5px 10px; border: none; border-radius: 4px; background: transparent; color: var(--text-secondary); font-size: 11px; cursor: pointer; text-align: left; font-family: inherit; }
.ctx-item:hover { background: var(--surface-hover); color: var(--text); }

.panel { display: flex; flex-direction: column; gap: 8px; }
.panel-section { background: #141a26; border: 1px solid var(--border); border-radius: var(--radius-lg); backdrop-filter: blur(20px); padding: 12px; }
.panel-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }

.color-showcase { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.color-ring { position: relative; width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #1a1f2e; transition: background 0.4s; flex-shrink: 0; border: 2px solid var(--border); }
.color-ring::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--border-hover); pointer-events: none; }
.ring-deco { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); pointer-events: none; }
.swatch-hex { font-size: 9px; font-weight: 700; font-family: var(--font-mono); color: var(--text-muted); z-index: 1; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }

.color-details { width: 100%; display: flex; flex-direction: column; gap: 3px; }
.color-row { display: flex; align-items: center; gap: 5px; padding: 3px 6px; background: #0d111c; border-radius: var(--radius-sm); }
.color-row-label { font-size: 9px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; width: 26px; flex-shrink: 0; }
.color-row-value { font-size: 11px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.color-row-value.mono { font-family: var(--font-mono); }
.hex-input { font-size: 11px; font-weight: 600; font-family: var(--font-mono); flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: inherit; padding: 0; text-transform: uppercase; }
.copy-mini { width: 18px; height: 18px; border: none; border-radius: 3px; background: transparent; color: var(--text-muted); font-size: 10px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 0; }
.copy-mini:hover { background: var(--surface-hover); color: var(--primary); }
.color-name { display: flex; align-items: center; gap: 5px; padding: 2px 6px; font-size: 11px; }

.hsl-sliders { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.slider-row { display: flex; align-items: center; gap: 4px; }
.slider-label { font-size: 9px; font-weight: 700; color: var(--text-muted); width: 12px; text-align: right; flex-shrink: 0; }
.slider { flex: 1; height: 3px; -webkit-appearance: none; appearance: none; border-radius: 2px; background: var(--bg-alt); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #141a26; cursor: pointer; }
.slider-val { font-size: 9px; font-weight: 600; font-family: var(--font-mono); width: 20px; text-align: right; flex-shrink: 0; }

.btn-copy { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; padding: 7px 14px; border: none; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; cursor: pointer; color: #fff; background: linear-gradient(135deg,var(--primary),#00b8d4); font-family: inherit; margin-top: 3px; }
.btn-copy:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,229,255,0.3); }

.contrast-section { padding: 12px; }
.contrast-section.hidden { display: none; }
.contrast-input { display: flex; gap: 4px; margin-bottom: 6px; }
.contrast-field { flex: 1; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0d111c; color: var(--text); font-size: 12px; font-family: var(--font-mono); outline: none; }
.contrast-field:focus { border-color: var(--primary); }
.contrast-result { padding: 4px 0; font-size: 12px; color: var(--text-secondary); }
.contrast-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.contrast-badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.contrast-badge.pass { background: rgba(34,197,94,0.2); color: #22c55e; }
.contrast-badge.fail { background: var(--accent-dim); color: var(--accent); }

.dominant-section { padding: 12px; min-height: 0; }
.dominant-section.hidden { display: none; }
.btn-refresh { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 11px; cursor: pointer; flex-shrink: 0; }
.btn-refresh:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.dominant-list { display: flex; gap: 3px; flex-wrap: wrap; }
.dominant-item { width: 26px; height: 26px; border-radius: 5px; cursor: pointer; border: 1px solid var(--border); position: relative; }
.dominant-item:hover { transform: scale(1.2); z-index: 1; border-color: var(--primary); }
.dominant-item::after { content: attr(data-hex); position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); background: rgba(10,14,23,0.95); color: var(--text); font-size: 9px; font-family: var(--font-mono); padding: 2px 5px; border-radius: 3px; white-space: nowrap; opacity: 0; pointer-events: none; border: 1px solid var(--border); }
.dominant-item:hover::after { opacity: 1; }

.palette-section { padding: 12px; }
.palette-section.hidden { display: none; }
.palette-grid { display: flex; flex-direction: column; gap: 6px; }
.palette-card { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: #0d111c; border-radius: var(--radius-sm); }
.palette-label { font-size: 10px; font-weight: 600; color: var(--text-muted); width: 26px; flex-shrink: 0; }
.palette-colors { display: flex; gap: 3px; flex: 1; flex-wrap: wrap; }
.palette-swatch { width: 22px; height: 22px; border-radius: 3px; cursor: pointer; border: 1px solid var(--border); position: relative; }
.palette-copy { width: 18px; height: 18px; border: none; border-radius: 3px; background: transparent; color: var(--text-muted); font-size: 10px; cursor: pointer; padding: 0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.palette-copy:hover { color: var(--primary); background: var(--primary-dim); }
.palette-swatch:hover { transform: scale(1.25); z-index: 1; border-color: var(--primary); }
.palette-swatch::after { content: attr(data-hex); position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); background: rgba(10,14,23,0.95); font-size: 9px; font-family: var(--font-mono); padding: 2px 5px; border-radius: 3px; white-space: nowrap; opacity: 0; pointer-events: none; border: 1px solid var(--border); }
.palette-swatch:hover::after { opacity: 1; }

.history-section { flex: 1; display: flex; flex-direction: column; }
.history-tools { display: flex; align-items: center; gap: 4px; }
.search-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.search-clear { position: absolute; right: 2px; width: 14px; height: 14px; border: none; border-radius: 50%; background: var(--text-muted); color: var(--bg); font-size: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.search-clear:hover { background: var(--text-secondary); }
.search-clear[hidden] { display: none; }
.btn-fav-toggle { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.btn-fav-toggle.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.section-badge { font-size: 10px; font-weight: 600; color: var(--text-muted); background: var(--bg-alt); padding: 2px 6px; border-radius: 8px; font-family: var(--font-mono); }
.history-list { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-height: 36px; justify-content: center; }
.history-item { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; position: relative; flex-shrink: 0; }
.history-item:hover { transform: scale(1.2); border-color: var(--primary); z-index: 3; }
.history-item .delete-btn, .history-item .fav-btn { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border); font-size: 8px; cursor: pointer; opacity: 0; display: flex; align-items: center; justify-content: center; z-index: 4; padding: 0; }
.history-item:hover .delete-btn, .history-item:hover .fav-btn { opacity: 1; }
.history-item .delete-btn { top: -4px; right: -4px; background: var(--accent); color: #fff; }
.history-item .fav-btn { top: -4px; left: -4px; background: #141a26; color: var(--text-muted); }
.history-item .fav-btn.favorited { opacity: 1; color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.history-item::after { content: attr(data-tip); position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); background: rgba(10,14,23,0.95); color: var(--text); font-size: 9px; font-family: var(--font-mono); padding: 2px 5px; border-radius: 3px; white-space: nowrap; opacity: 0; pointer-events: none; border: 1px solid var(--border); z-index: 5; }
.history-item:hover::after { opacity: 1; }
.btn-clear { display: block; width: 100%; padding: 5px 0; margin-top: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font-size: 11px; font-family: inherit; cursor: pointer; }
.btn-clear:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--accent); background: var(--accent-dim); }
.btn-clear:disabled { opacity: 0.35; cursor: default; }
.history-actions { display: flex; gap: 4px; margin-top: 6px; min-height: 24px; }
.history-actions .btn-clear { flex: 1; width: auto; margin-top: 0; }
.btn-copyall { flex: 1; padding: 5px 0; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary-dim); color: var(--primary); font-size: 11px; font-family: inherit; cursor: pointer; }
.btn-copyall:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-copyall:disabled { opacity: 0.35; cursor: default; }
.empty-hint { color: var(--text-muted); font-size: 12px; width: 100%; text-align: center; padding: 6px 0; }

.bottombar { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: #141a26; border: 1px solid var(--border); border-radius: var(--radius-lg); backdrop-filter: blur(20px); gap: 6px; flex-wrap: wrap; }
.mode-switch { display: flex; gap: 2px; background: #0d111c; border-radius: var(--radius-sm); padding: 2px; }
.mode-btn { display: flex; align-items: center; gap: 3px; padding: 4px 8px; border: none; border-radius: 5px; font-size: 11px; font-weight: 500; cursor: pointer; background: transparent; color: var(--text-muted); font-family: inherit; }
.mode-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.mode-indicator { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.4; }
.mode-btn.active .mode-indicator { background: var(--primary); opacity: 1; box-shadow: 0 0 6px rgba(0,229,255,0.5); }
.sample-picker { display: flex; align-items: center; gap: 2px; margin-left: 4px; padding-left: 6px; border-left: 1px solid var(--border); }
.sample-label { font-size: 8px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.sample-btn { width: 20px; height: 18px; border: none; border-radius: 3px; font-size: 9px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text-muted); font-family: var(--font-mono); padding: 0; }
.sample-btn.active { background: var(--primary-dim); color: var(--primary); }
.btn-action { display: inline-flex; align-items: center; gap: 3px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; cursor: pointer; background: transparent; color: var(--text-secondary); font-family: inherit; }
.btn-action:hover { background: var(--surface-hover); border-color: var(--border-hover); color: var(--text); }
.btn-action svg { width: 12px; height: 12px; }

.drop-overlay { position: fixed; inset: 0; background: rgba(10,14,23,0.88); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: center; z-index: 200; opacity: 0; pointer-events: none; }
.drop-overlay.active { opacity: 1; pointer-events: auto; }
.drop-overlay-content { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--primary); padding: 36px; border: 2px dashed var(--primary); border-radius: var(--radius-xl); }
.drop-overlay-content p { font-size: 16px; font-weight: 500; }

.export-modal, .help-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.export-modal[hidden], .help-modal[hidden] { display: none; }
.help-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.export-modal-content, .help-modal-content { position: relative; background: #141a26; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; width: 340px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
.help-modal-content { width: 300px; }
.export-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.export-tab { padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font-size: 11px; cursor: pointer; font-family: inherit; }
.export-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.export-code { background: #0d111c; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; font-family: var(--font-mono); font-size: 10px; line-height: 1.5; color: var(--text); white-space: pre; overflow-x: auto; min-height: 80px; max-height: 180px; margin-bottom: 8px; }
.help-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.help-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 12px; color: var(--text-secondary); }
.help-row kbd { min-width: 50px; text-align: center; }

.onboarding { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; }
.onboarding[hidden] { display: none; }
.onboarding-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); }
.onboarding-content { position: relative; background: #141a26; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; width: 380px; box-shadow: 0 8px 48px rgba(0,0,0,0.6); text-align: center; }
.onboarding-content h2 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.onboarding-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; text-align: left; }
.onb-step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.onb-num { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-dim); color: var(--primary); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.onb-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; cursor: pointer; }

.toast { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%) translateY(16px); background: rgba(10,14,23,0.92); color: var(--text); padding: 8px 16px; border-radius: var(--radius-md); font-size: 13px; pointer-events: none; opacity: 0; transition: opacity 0.3s, transform 0.3s; z-index: 100; backdrop-filter: blur(12px); white-space: nowrap; border: 1px solid var(--border); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.color-ring[draggable="true"] { cursor: grab; }
.color-ring[draggable="true"]:active { cursor: grabbing; }

.info-bar { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); padding: 3px 10px; background: rgba(10,14,23,0.8); color: var(--text-muted); font-size: 10px; font-family: var(--font-mono); border-radius: 4px; border: 1px solid var(--border); pointer-events: none; z-index: 5; backdrop-filter: blur(8px); white-space: nowrap; }

.blind-section { padding: 12px; }
.blind-section.hidden { display: none; }
.blind-grid { display: flex; flex-direction: column; gap: 4px; }
.blind-row { display: flex; align-items: center; gap: 6px; }
.blind-label { font-size: 10px; font-weight: 600; color: var(--text-muted); width: 40px; flex-shrink: 0; }
.blind-swatch { width: 22px; height: 22px; border-radius: 3px; border: 1px solid var(--border); cursor: pointer; transition: transform 0.15s; }
.blind-swatch:hover { transform: scale(1.2); border-color: var(--primary); }

.filter-section { padding: 12px; }
.filter-section.hidden { display: none; }
.filter-slider { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.filter-label { font-size: 9px; font-weight: 600; color: var(--text-muted); width: 36px; flex-shrink: 0; }
.filter-slider-input { flex: 1; }

.search-field { flex: 1; min-width: 60px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; background: #0d111c; color: var(--text-secondary); font-size: 10px; font-family: inherit; outline: none; }
.search-field:focus { border-color: var(--primary); }
.search-field::placeholder { color: var(--text-muted); }

body.light-theme {
  --bg: #f8f6f0; --bg-alt: #ece8e0; --surface: rgba(0,0,0,0.03); --surface-hover: rgba(0,0,0,0.06); --surface-active: rgba(0,0,0,0.1); --border: rgba(0,0,0,0.1); --border-hover: rgba(0,0,0,0.2); --text: #2d2d2d; --text-secondary: #666; --text-muted: #999; --shadow: 0 2px 12px rgba(0,0,0,0.06); --chk-a: #fcfbf7; --chk-b: #ece8e0;
}
body.light-theme .topbar { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-theme .panel-section { background: #fff; }
body.light-theme .bottombar { background: #fff; }
body.light-theme .color-row { background: #f3f0ea; }
body.light-theme .color-ring { background: #e0dbd0; }
body.light-theme .search-field { background: #f3f0ea; color: #2d2d2d; }
body.light-theme .palette-card { background: #f3f0ea; }
body.light-theme .contrast-field { background: #f3f0ea; color: #2d2d2d; }
body.light-theme .magnifier { background: #fff; }
body.light-theme .mode-switch { background: #ece8e0; }
body.light-theme .mode-btn { color: #888; }
body.light-theme .mode-btn.active { background: #fff; color: #2d2d2d; }
body.light-theme .help-modal-content, body.light-theme .export-modal-content { background: #fff; }
body.light-theme .export-code { background: #f3f0ea; }
body.light-theme .slider { background: #d5d0c8; }
body.light-theme .slider::-webkit-slider-thumb { border-color: #fff; }

body.light-theme .image-tabs { background: #fff; }
body.light-theme .context-menu { background: #fff; }
body.light-theme .onboarding-content { background: #fff; }
body.light-theme .color-tooltip { background: rgba(255,255,255,0.95); color: #2d2d2d; border-color: rgba(0,0,0,0.1); }
body.light-theme .zoom-label,
body.light-theme .pan-label { background: rgba(255,255,255,0.85); color: #555; }
body.light-theme .info-bar { background: rgba(255,255,255,0.85); color: #888; }
body.light-theme .toast { background: rgba(255,255,255,0.95); color: #2d2d2d; border-color: rgba(0,0,0,0.1); }
body.light-theme .drop-overlay { background: rgba(255,255,255,0.92); color: #2d2d2d; }
body.light-theme .drop-overlay-content { border-color: var(--primary); }
body.light-theme .dominant-item::after,
body.light-theme .palette-swatch::after,
body.light-theme .history-item::after { background: rgba(255,255,255,0.95); color: #2d2d2d; border-color: rgba(0,0,0,0.1); }
body.light-theme .contrast-badge.pass { background: rgba(34,197,94,0.12); }
body.light-theme .history-item .fav-btn { background: #fff; }
body.light-theme .ctx-item { color: #555; }
body.light-theme .ctx-item:hover { background: rgba(0,0,0,0.05); color: #2d2d2d; }

.fullscreen .panel { display: none; }
.fullscreen .main { grid-template-columns: 1fr; }
.fullscreen .image-tabs { display: none; }

@media (max-width: 820px) {
  .main { grid-template-columns: 1fr; }
  .canvas-wrapper { min-height: 280px; max-height: 400px; }
  .panel { flex-direction: row; flex-wrap: wrap; }
  .panel-section { flex: 1; min-width: 200px; }
  .color-ring { width: 60px; height: 60px; }
  .sample-picker, .placeholder-shortcuts { display: none; }
}
@media (max-width: 640px) {
  .sample-picker, .placeholder-shortcuts { display: none; }
}
@media (max-width: 520px) {
  .app { padding: 8px; }
  .bottombar { flex-direction: column; gap: 6px; }
  .bottombar-left, .bottombar-right { width: 100%; justify-content: center; }
  .panel { flex-direction: column; }
  .canvas-wrapper { min-height: 200px; max-height: 300px; }
}
.fav-btn.favorited { animation: favBounce 0.12s ease; }
@keyframes favBounce { 0%{transform:scale(1)} 50%{transform:scale(1.3)} 100%{transform:scale(1)} }
.color-ring.bounce { animation: ringBounce 0.12s ease; }
@keyframes ringBounce { 0%{transform:scale(1)} 50%{transform:scale(1.08)} 100%{transform:scale(1)} }

