/* Halawi Chroma: application styles on top of the shared Halawi design system */

/* ---------- neutral grey theme for color critical work: no tinted chrome, no glows ---------- */
html[data-theme="grey"] {
  --bg: #2e2e2e; --bg-1: #333333; --bg-2: #383838; --bg-3: #3d3d3d; --bg-4: #474747;
  --glass: rgba(255,255,255,.025); --glass-2: rgba(255,255,255,.045); --glass-3: rgba(255,255,255,.075);
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.13); --line-3: rgba(255,255,255,.2);
  --text: #e8e8e8; --text-2: #cfcfcf; --muted: #a6a6a6; --dim: #808080;
  --accent: #d6d6d6; --accent-bg: rgba(255,255,255,.08); --accent-line: rgba(255,255,255,.3);
  --violet: #bdbdbd; --magenta: #a8a8a8; --coral: #9a9a9a; --grad: linear-gradient(100deg, #8a8a8a, #a0a0a0);
  --focus: 0 0 0 2px rgba(255,255,255,.55); --shadow: 0 10px 30px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}
html[data-theme="grey"] body::before { display: none; }
html[data-theme="grey"] .btn--primary { background: #5a5a5a; box-shadow: none; border-color: #6a6a6a; }
html[data-theme="grey"] .btn--primary:hover { background: #666; }
html[data-theme="grey"] .grad-text { background: none; color: var(--text); }
html[data-theme="grey"] .sb-mark { background: #555; box-shadow: none; }
html[data-theme="grey"] .sb-logo img { filter: grayscale(1) brightness(1.4); }

/* ---------- shell tweaks ---------- */
.content { padding: 14px; overflow: hidden; display: flex; flex-direction: column; }
.content > .view-host { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: fadeUp .22s ease both; }
.cur-chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 5px; margin-left: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; color: var(--text-2); max-width: 280px; min-width: 0; }
.cur-chip:hover { border-color: var(--line-2); color: var(--text); }
.cur-chip i { width: 20px; height: 20px; border-radius: 5px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.cur-chip .mono { font-size: 12px; }
.cur-chip .nm { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cur-chip.oog i { outline: 2px solid var(--warn); outline-offset: 1px; }
.sb-backup b .ic { width: 14px; height: 14px; vertical-align: -2px; }
.hint { font-size: 11.5px; color: var(--dim); margin: 6px 0 0; }
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--glass); backdrop-filter: blur(6px); }
.panel-hd { padding: 10px 14px; min-height: 48px; }
.panel-hd h3 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.panel-hd h3 .ic { color: var(--accent); width: 15px; height: 15px; }
.panel::before { content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(155,61,245,.45), transparent); opacity: .55; pointer-events: none; }
html[data-theme="grey"] .panel::before, html[data-theme="light"] .panel::before { display: none; }
.seg button { padding: 4px 9px; font-size: 12px; }
.input--sm { height: 28px; }
select.input { padding-right: 24px; }
.view-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.view-h h1 { font-size: 19px; }
.view-h .eyebrow { margin-bottom: 4px; }
.view-h .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scroll { overflow: auto; min-height: 0; }
.sw { width: 26px; height: 26px; border-radius: 6px; border: 0; padding: 0; cursor: pointer; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 1px 2px rgba(0,0,0,.3); transition: transform .1s; flex: none; }
.sw:hover { transform: translateY(-1px) scale(1.06); }
.sw:focus-visible { box-shadow: var(--focus); }
.sw-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; align-items: center; }
.swatch { box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }

/* ---------- slider ---------- */
.csl { display: grid; grid-template-columns: 22px minmax(0, 1fr) 74px auto; align-items: center; gap: 10px; margin: 7px 0; }
.csl-l { font: 500 12px var(--f-ui); color: var(--text-2); cursor: default; user-select: none; }
.csl-t { position: relative; height: 22px; display: flex; align-items: center; }
.csl input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 7px; margin: 0; background: var(--track, linear-gradient(90deg, var(--bg-4), var(--line-3))); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); cursor: pointer; }
.csl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 20px; border-radius: 4px; background: #fff; border: 2px solid #111; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.csl input[type=range]::-moz-range-thumb { width: 10px; height: 18px; border-radius: 4px; background: #fff; border: 2px solid #111; }
.csl input[type=range]:focus-visible { outline: none; box-shadow: var(--focus); }
.csl-n { width: 100%; height: 28px; padding: 0 6px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 12px; text-align: right; }
.csl-n:focus { outline: none; border-color: var(--accent-line); }
.csl-u { font-size: 11px; color: var(--dim); min-width: 18px; }
.csl--plain input[type=range] { height: 4px; }
.csl--plain input[type=range]::-webkit-slider-thumb { width: 14px; height: 14px; border-radius: 50%; }

/* ---------- picker ---------- */
.pk { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(330px, 1.05fr) minmax(320px, 1fr) minmax(300px, .95fr); gap: 14px; }
.pk-field .pk-fieldwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.pk-canvas { position: relative; flex: 1; min-height: 160px; border-radius: 10px; overflow: hidden; cursor: crosshair; touch-action: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.pk-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pk-canvas [data-cv] { image-rendering: auto; }
.pk-thumb { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 2px 8px rgba(0,0,0,.6); pointer-events: none; }
.pk-hue { position: relative; height: 18px; border-radius: 9px; overflow: hidden; cursor: ew-resize; touch-action: none; box-shadow: inset 0 0 0 1px var(--line-2); flex: none; }
.pk-hue canvas { width: 100%; height: 100%; display: block; }
.pk-hthumb { position: absolute; top: -1px; bottom: -1px; width: 10px; margin-left: -5px; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.7); pointer-events: none; }
.pk-legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--text-2); padding: 0 14px 12px; }
.pk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pk-legend i { width: 18px; height: 0; border-top: 2px solid rgba(255,255,255,.85); }
.pk-legend i.lg-p { border-top: 2px dashed rgba(255,255,255,.55); } .pk-legend i.lg-r { border-top: 2px dotted rgba(255,255,255,.35); }
html[data-theme="light"] .pk-legend i { border-color: #333; }
.pk-legend .seg { margin-left: auto; }
.pk-mid { overflow: hidden; }
.pk-preview { padding: 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 96px 1fr; gap: 6px 14px; align-items: center; }
.pk-prev-c { width: 96px; height: 96px; border-radius: 12px; grid-row: span 2; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 10px 30px -12px rgba(0,0,0,.7); }
@supports (color: oklch(0.5 0.1 100)) { .pk-prev-c { background: var(--wide) !important; } }
.pk-prev-i { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-prev-i b { font-size: 22px; font-family: var(--f-ui); font-weight: 600; letter-spacing: .02em; }
.pk-prev-i span { color: var(--text-2); font-size: 13px; }
.pk-oog { color: var(--warn) !important; font-size: 12px !important; display: flex; gap: 6px; align-items: flex-start; }
.pk-oog .ic { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.pk-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pk-scroll { flex: 1; overflow: auto; padding: 4px 14px 14px; min-height: 0; }
.pk-grp { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pk-grp:last-child { border-bottom: 0; }
.pk-grp-h { font: 500 10.5px var(--f-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin-bottom: 4px; }
.pk-grp-h .muted { text-transform: none; letter-spacing: 0; margin-left: 6px; }
.pk-parse { padding: 10px 0 8px; position: sticky; top: 0; background: linear-gradient(var(--bg-1) 80%, transparent); z-index: 2; }
html[data-theme="grey"] .pk-parse { background: linear-gradient(#353535 80%, transparent); }
.fmts { display: flex; flex-direction: column; }
.fmt { display: grid; grid-template-columns: 128px minmax(0, 1fr) 16px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.fmt:hover, .fmt:focus-visible { background: var(--glass-3); }
.fmt-l { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmt-v { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.fmt .ic { width: 13px; height: 13px; color: var(--dim); opacity: 0; }
.fmt:hover .ic { opacity: 1; }
.gam { display: flex; flex-direction: column; gap: 2px; }
.gam-r { display: grid; grid-template-columns: 104px 110px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 8px; border-radius: 7px; font-size: 12px; cursor: pointer; }
.gam-r:hover { background: var(--glass-3); }
.gam-r b { font-weight: 500; font-family: var(--f-ui); }
.gam-r .mono { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near { display: flex; flex-direction: column; gap: 2px; }
.near-i { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.near-i:hover { background: var(--glass-3); }
.near-i i { width: 28px; height: 28px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.near-i b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.near-i small { color: var(--dim); font-size: 11px; }
.near-i em { font-style: normal; font-size: 11px; color: var(--muted); }

/* ---------- names ---------- */
.nm-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 270px minmax(0, 1fr) 300px; gap: 14px; }
.nm-filters { padding: 14px; overflow: auto; }
.nm-filters h4 { font: 500 10.5px var(--f-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin: 16px 0 8px; }
.src-i { display: flex; gap: 9px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.src-i:hover { background: var(--glass-2); }
.src-i small { display: block; color: var(--dim); font-size: 11px; }
.src-i input { margin-top: 3px; }
.fam { display: flex; flex-wrap: wrap; gap: 5px; }
.fam button { height: 26px; padding: 0 9px 0 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--glass); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.fam button i { width: 12px; height: 12px; border-radius: 3px; }
.fam button.on { border-color: var(--accent-line); background: var(--accent-bg); color: var(--text); }
.nm-grid-wrap { position: relative; overflow: auto; flex: 1; min-height: 0; }
.nm-grid { position: relative; }
.nm-card { position: absolute; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; display: flex; flex-direction: column; text-align: left; padding: 0; color: inherit; }
.nm-card:hover { border-color: var(--line-3); }
.nm-card:focus-visible { box-shadow: var(--focus); }
.nm-card .c { flex: 1; min-height: 0; }
.nm-card .t { padding: 7px 9px 8px; }
.nm-card b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-card small { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; font-family: var(--f-mono); }
.nm-count { font-size: 12px; color: var(--muted); }

/* ---------- harmony ---------- */
.hm { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; }
.hm-top { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; min-height: 0; }
.hm-cols { flex: 1; display: flex; min-height: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; }
.hm-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px 14px; position: relative; min-width: 0; transition: flex .2s; }
.hm-col:hover { flex: 1.15; }
.hm-col .hx { font: 600 20px var(--f-ui); letter-spacing: .03em; }
.hm-col .nm { font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-col .sub { font: 11px var(--f-mono); opacity: .7; margin-top: 2px; }
.hm-col .tools { display: flex; gap: 4px; margin-bottom: 10px; opacity: 0; transition: opacity .15s; }
.hm-col:hover .tools, .hm-col:focus-within .tools, .hm-col.locked .tools { opacity: 1; }
.hm-col .tools button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(0,0,0,.18); color: inherit; cursor: pointer; display: grid; place-items: center; }
.hm-col .tools button:hover { background: rgba(0,0,0,.32); }
.hm-col.locked .lk { background: rgba(0,0,0,.42); }
.hm-col .idx { position: absolute; top: 12px; left: 14px; font: 500 11px var(--f-mono); opacity: .6; }
.hm-side { padding: 14px; overflow: auto; }
.ramp { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; }
.ramp-i { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; padding: 0; color: inherit; text-align: left; }
.ramp-i .c { height: 46px; }
.ramp-i .t { padding: 5px 7px; font-size: 11px; }
.ramp-i .t b { display: block; font-weight: 600; font-family: var(--f-ui); }
.ramp-i .t span { font-family: var(--f-mono); color: var(--muted); font-size: 10.5px; }
.ramp-i.anchor { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.strip { display: flex; height: 34px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.strip button { flex: 1; border: 0; padding: 0; cursor: pointer; }
.strip-l { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin: 10px 0 5px; }

/* ---------- palettes ---------- */
.pl { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 14px; }
.pl-list { overflow: auto; padding: 6px; flex: 1; }
.pl-item { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; }
.pl-item:hover { background: var(--glass-2); }
.pl-item.on { background: var(--accent-bg); border-color: var(--accent-line); }
.pl-item b { font: 500 13px var(--f-ui); display: flex; justify-content: space-between; gap: 8px; }
.pl-item b span { color: var(--dim); font-weight: 400; font-size: 11.5px; }
.pl-mini { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: var(--glass-2); }
.pl-mini i { flex: 1; }
.pl-item.drag-over { border-color: var(--accent); }
.pl-main .panel-hd input.title-in { font: 600 16px var(--f-ui); background: none; border: 1px solid transparent; color: var(--text); border-radius: 7px; padding: 4px 6px; min-width: 120px; width: 260px; }
.pl-main .panel-hd input.title-in:hover { border-color: var(--line-2); }
.pl-main .panel-hd input.title-in:focus { outline: none; border-color: var(--accent-line); background: var(--bg-2); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; padding: 14px; align-content: start; overflow: auto; flex: 1; min-height: 0; }
.pl-sw { border-radius: 11px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); cursor: grab; display: flex; flex-direction: column; text-align: left; padding: 0; color: inherit; position: relative; }
.pl-sw:hover { border-color: var(--line-3); }
.pl-sw.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pl-sw.dragging { opacity: .35; }
.pl-sw.drop-before::before { content: ''; position: absolute; left: -7px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--accent); }
.pl-sw .c { height: 92px; }
.pl-sw .t { padding: 8px 10px 9px; }
.pl-sw b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sw small { color: var(--muted); font-family: var(--f-mono); font-size: 11px; }
.pl-sw .note-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 0 2px rgba(0,0,0,.3); }
.pl-add { border: 1.5px dashed var(--line-3); border-radius: 11px; background: none; color: var(--muted); cursor: pointer; min-height: 140px; display: grid; place-items: center; font-size: 12.5px; }
.pl-add:hover { border-color: var(--accent); color: var(--text); background: var(--accent-bg); }
.pl-insp { padding: 14px; overflow: auto; flex: 1; }
.pl-insp .big { height: 120px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); margin-bottom: 12px; }
.pl-insp .field { margin-bottom: 12px; }
.tags-in { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 4px 6px; min-height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); }
.tags-in input { flex: 1; min-width: 80px; border: 0; background: none; color: var(--text); font: 13px var(--f-data); outline: none; height: 24px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 10px; }
.tag-filter button { height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); cursor: pointer; font-size: 11.5px; }
.tag-filter button.on { color: var(--text); border-color: var(--accent-line); background: var(--accent-bg); }
textarea.input { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.empty { display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; gap: 10px; font-size: 13px; }
.empty .ic { width: 28px; height: 28px; color: var(--dim); }

/* ---------- contrast ---------- */
.ct { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(380px, 0.9fr) minmax(0, 1.1fr); gap: 14px; }
.ct-left { overflow: auto; }
.ct-pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; padding: 14px; }
.ct-c { display: flex; gap: 8px; align-items: center; }
.ct-c input[type=color] { width: 40px; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: var(--bg-2); cursor: pointer; }
.ct-prev { margin: 0 14px; border-radius: 12px; padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--line-2); }
.ct-prev h2 { font: 600 30px/1.15 var(--f-ui); margin: 0 0 6px; }
.ct-prev p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.ct-prev small { font-size: 12px; }
.ct-prev .ui-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.ct-prev .ui-row span { padding: 6px 12px; border-radius: 7px; border: 2px solid currentColor; font: 500 13px var(--f-ui); }
.ct-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.ct-m { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--glass); }
.ct-m .l { font: 500 10.5px var(--f-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.ct-m .v { font: 600 32px/1.1 var(--f-ui); margin: 6px 0 8px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ct-m .badges { display: flex; flex-wrap: wrap; gap: 5px; }
.ct-fix { padding: 0 14px 14px; }
.fix-i { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); margin-top: 6px; }
.fix-i i { width: 26px; height: 26px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.fix-i .mono { font-size: 12px; }
.fix-i .grow { color: var(--muted); font-size: 12px; }
.mx-wrap { overflow: auto; flex: 1; min-height: 0; padding: 14px; }
.mx { border-collapse: separate; border-spacing: 3px; font-size: 11.5px; }
.mx th { font-weight: 400; padding: 0; }
.mx th .sw { width: 34px; height: 34px; cursor: default; }
.mx td { width: 56px; height: 40px; text-align: center; border-radius: 6px; cursor: pointer; font: 600 12.5px var(--f-ui); position: relative; }
.mx td small { display: block; font: 500 9.5px var(--f-data); opacity: .8; }
.mx td.fail { outline: 1px dashed rgba(239,91,98,.6); outline-offset: -1px; }
.mx td.self { opacity: .25; cursor: default; }
.cvd-grid { padding: 14px; overflow: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.cvd-row h4 { font: 500 12.5px var(--f-ui); margin: 0 0 6px; display: flex; justify-content: space-between; }
.cvd-row h4 span { color: var(--dim); font-weight: 400; font-size: 11.5px; }
.cvd-sw { display: flex; height: 44px; border-radius: 9px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.cvd-sw i { flex: 1; }
.conf { font-size: 12px; color: var(--warn); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.conf span { display: inline-flex; gap: 2px; align-items: center; padding: 2px 6px 2px 2px; border-radius: 6px; background: rgba(232,163,61,.1); }
.conf span i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

/* ---------- gradients ---------- */
.gd { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr) 320px; gap: 14px; }
.gd-main { overflow: hidden; }
.gd-prev { flex: 1; min-height: 140px; margin: 14px 14px 0; border-radius: 12px; overflow: hidden; position: relative; box-shadow: inset 0 0 0 1px var(--line-2); }
.gd-prev canvas { width: 100%; height: 100%; display: block; }
.gd-bar { position: relative; height: 36px; margin: 16px 24px 6px; border-radius: 8px; cursor: copy; box-shadow: inset 0 0 0 1px var(--line-2); }
.gd-bar canvas { width: 100%; height: 100%; display: block; border-radius: 8px; }
.gd-stop { position: absolute; top: -6px; width: 18px; height: 48px; margin-left: -9px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 3px 8px rgba(0,0,0,.5); cursor: ew-resize; touch-action: none; padding: 0; }
.gd-stop.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 3px 10px rgba(0,0,0,.6); }
.gd-cmp { padding: 10px 14px 14px; display: grid; gap: 6px; }
.gd-cmp-r { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 11.5px; color: var(--muted); }
.gd-cmp-r canvas { width: 100%; height: 22px; border-radius: 5px; display: block; }
.gd-cmp-r.on { color: var(--text); }
.gd-side { padding: 14px; overflow: auto; }
.code { font: 11.5px/1.5 var(--f-mono); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px; white-space: pre-wrap; word-break: break-all; max-height: 180px; overflow: auto; color: var(--text-2); }

/* ---------- image tools ---------- */
.im { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.im-stage { flex: 1; min-height: 0; position: relative; margin: 14px; border-radius: 12px; overflow: hidden; background: repeating-conic-gradient(var(--bg-3) 0 25%, var(--bg-2) 0 50%) 0 0 / 18px 18px; display: grid; place-items: center; }
.im-stage canvas { max-width: 100%; max-height: 100%; display: block; cursor: crosshair; }
.loupe { position: absolute; width: 120px; height: 120px; border-radius: 50%; pointer-events: none; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.6); overflow: hidden; display: none; }
.loupe canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.loupe b { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font: 600 10.5px var(--f-mono); padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.7); color: #fff; }
.drop-zone { display: grid; place-items: center; gap: 10px; }
.im-drop { position: absolute; inset: 0; margin: 0; border-radius: 12px; z-index: 2; background: color-mix(in srgb, var(--bg) 88%, transparent); }
.im-side { padding: 14px; overflow: auto; }
.ext-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.ext-i { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 5px 6px; border-radius: 8px; }
.ext-i:hover { background: var(--glass-2); }
.ext-i i { width: 34px; height: 34px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); cursor: pointer; }
.ext-i b { font-size: 12.5px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-i small { font: 11px var(--f-mono); color: var(--muted); }
.ext-i .pct { font: 11px var(--f-mono); color: var(--dim); }
.ext-bar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; margin-top: 10px; }

/* ---------- grading ---------- */
.gr { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
.gr-view { grid-column: 1; grid-row: 1; min-height: 0; }
.gr-scopes { grid-column: 2; grid-row: 1 / span 2; min-height: 0; overflow: hidden; }
.gr-ctl { grid-column: 1; grid-row: 2; min-height: 0; }
.gr-tb { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.gr-tb .sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.gr-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; background: #0b0b0d; margin: 10px; border-radius: 8px; overflow: hidden; }
html[data-theme="grey"] .gr-stage { background: #262626; }
.gr-stage canvas { max-width: 100%; max-height: 100%; display: block; }
.gr-split { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.85); cursor: ew-resize; box-shadow: 0 0 0 1px rgba(0,0,0,.5); touch-action: none; }
.gr-split::after { content: ''; position: absolute; top: 50%; left: -9px; width: 20px; height: 32px; margin-top: -16px; border-radius: 6px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
.gr-split span { position: absolute; top: 10px; font: 500 10.5px var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.6); padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.gr-split .a { right: 10px; } .gr-split .b { left: 10px; }
.gr-info { position: absolute; left: 10px; bottom: 10px; font: 11px var(--f-mono); color: rgba(255,255,255,.75); background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 5px; pointer-events: none; }
.gr-info.gr-rk { left: auto; right: 10px; }
.gr-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.gr-tabs .tab { padding: 8px 11px; font-size: 12.5px; }
.gr-pane { padding: 10px 14px 12px; height: 246px; overflow: auto; }
.wheels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wh { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.wh-h { font: 500 11px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.wh-h button { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0; display: grid; }
.wh-h button:hover { color: var(--text); }
.wh-h button .ic { width: 12px; height: 12px; }
.wh-disc { position: relative; width: 128px; height: 128px; border-radius: 50%; cursor: crosshair; touch-action: none; }
.wh-disc::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ring); -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); opacity: .9; }
.wh-disc::after { content: ''; position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle, #2a2a30, #141418); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
html[data-theme="light"] .wh-disc::after { background: radial-gradient(circle, #e9e7ee, #d7d4de); }
.wh-disc .cross { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.wh-disc .cross::before, .wh-disc .cross::after { content: ''; position: absolute; background: rgba(255,255,255,.12); }
.wh-disc .cross::before { left: 50%; top: 22%; bottom: 22%; width: 1px; } .wh-disc .cross::after { top: 50%; left: 22%; right: 22%; height: 1px; }
.wh-dot { position: absolute; z-index: 2; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.4); box-shadow: 0 0 0 1px rgba(0,0,0,.6); pointer-events: none; }
.wh-vals { font: 10.5px var(--f-mono); color: var(--muted); display: flex; gap: 6px; }
.wh-vals b { font-weight: 500; }
.wh .csl-n { font-size: 11px; padding: 0 4px; }
.wh .csl { width: 100%; grid-template-columns: minmax(0, 1fr) 64px; gap: 6px; margin: 0; }
.wh .csl-l { display: none; }
.prim { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.prim .csl { grid-template-columns: 92px minmax(0, 1fr) 70px; }
.prim .csl-l { white-space: nowrap; }
.curves .seg { flex-wrap: wrap; height: auto; }
.curves .seg button { flex: 1 0 auto; }
.curves { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.curve-box { position: relative; width: 100%; max-width: 420px; aspect-ratio: 2 / 1; border-radius: 8px; background: #111115; box-shadow: inset 0 0 0 1px var(--line-2); touch-action: none; cursor: crosshair; }
.curve-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
html[data-theme="light"] .curve-box { background: #f4f3f7; }
.cdl { display: grid; grid-template-columns: 80px repeat(3, minmax(0, 1fr)); gap: 6px 10px; align-items: center; max-width: 640px; }
.cdl .h { font: 500 11px var(--f-ui); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.cdl input { height: 30px; font-family: var(--f-mono); font-size: 12px; }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.look { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--glass); cursor: pointer; text-align: left; color: inherit; overflow: hidden; }
.look:hover { border-color: var(--line-3); }
.look canvas { width: 100%; height: 64px; display: block; object-fit: cover; }
.look div { padding: 7px 10px 9px; }
.look b { font-size: 12.5px; font-weight: 500; display: block; }
.look small { color: var(--muted); font-size: 11px; }
.sc-grid { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.sc { position: relative; border-radius: 8px; overflow: hidden; background: #08080a; box-shadow: inset 0 0 0 1px var(--line); min-height: 0; }
.sc canvas { width: 100%; height: 100%; display: block; }
.sc span { position: absolute; left: 8px; top: 6px; font: 500 10px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.sc.vs { aspect-ratio: auto; }

/* ---------- projects ---------- */
.pj { flex: 1; min-height: 0; overflow: auto; padding: 4px; }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pj-card { padding: 0; overflow: hidden; }
.pj-card .pv { display: flex; height: 70px; }
.pj-card .pv i { flex: 1; }
.pj-card .bd { padding: 12px 14px; }
.pj-card h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.pj-card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pj-card .ft { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pj-card.on { border-color: var(--accent-line); }
.pj-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.imp-list { margin: 12px 0 0; padding-left: 18px; font-size: 13px; }

@media (max-width: 1360px) {
  .gr-tb .btn .t { display: none; }
  .pk { grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) minmax(280px, .9fr); gap: 12px; }
  .fmt { grid-template-columns: 110px minmax(0, 1fr) 14px; }
  .gam-r { grid-template-columns: 96px 96px minmax(0, 1fr); }
  .nm-layout { grid-template-columns: 230px minmax(0, 1fr) 270px; }
  .pl { grid-template-columns: 220px minmax(0, 1fr) 270px; }
  .gd { grid-template-columns: 200px minmax(0, 1fr) 290px; }
  .gr { grid-template-columns: minmax(0, 1fr) 300px; }
  .wh-disc { width: 112px; height: 112px; }
  .cur-chip .nm { display: none; }
  .cmdk-btn { min-width: 0; } .cmdk-btn span { display: none; }
}
@media (max-width: 1100px) {
  .pk, .nm-layout, .pl, .gd, .ct, .im, .hm-top { grid-template-columns: 1fr; overflow: auto; }
  .content { overflow: auto; }
  .gr { grid-template-columns: 1fr; grid-template-rows: auto; }
  .gr-view, .gr-scopes, .gr-ctl { grid-column: 1; grid-row: auto; }
  .gr-view { height: 60vh; } .gr-scopes { height: 520px; }
  .pk-canvas { min-height: 300px; }
}
