/* Cheat menu demo: one wide window with a sidebar of tabs; the ESP tab has a live preview.
   Builds on styles.css tokens. --cm-accent is the menu accent picked in its settings and
   --cm-on the text colour that reads on top of it (menu.js sets both). */

.cm {
  --cm-accent: var(--accent);
  --cm-on: #060706;
  --cm-s1: color-mix(in srgb, var(--ink) 4%, transparent);
  --cm-s2: color-mix(in srgb, var(--ink) 8%, transparent);
  --cm-s3: color-mix(in srgb, var(--ink) 14%, transparent);
  --cm-spring: cubic-bezier(.2, 1.6, .4, 1);
  --cm-ease: cubic-bezier(.2, .8, .2, 1);
  --checker: conic-gradient(#8d8f8a 25%, #c9cbc4 0 50%, #8d8f8a 0 75%, #c9cbc4 0) 0 0 / 8px 8px;
  position: relative; isolation: isolate; margin-inline: calc(16px - var(--gut));
}
.cm button { font-family: inherit; cursor: pointer; }
/* soft colour behind the glass */
.cm::before { content: ""; position: absolute; inset: 6% 4%; z-index: -1; border-radius: 40%; background: radial-gradient(closest-side at 22% 30%, color-mix(in srgb, var(--cm-accent) 30%, transparent), transparent), radial-gradient(closest-side at 80% 72%, color-mix(in srgb, var(--cm-accent) 18%, transparent), transparent); filter: blur(60px); opacity: 0; transition: opacity .6s; pointer-events: none; }
.cm.is-live::before { opacity: 1; }
.cm.is-hidden::before { opacity: .35; }

/* ---------- window ---------- */
.cm-win { position: relative; display: grid; grid-template-columns: 216px minmax(0, 1fr); height: 640px; border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(760px 340px at 0% 0%, color-mix(in srgb, var(--cm-accent) 9%, transparent), transparent 70%), linear-gradient(135deg, color-mix(in srgb, var(--ink) 5%, transparent), transparent 42%), color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(18px); overflow: hidden; overflow: clip; box-shadow: 0 50px 90px -50px rgba(0, 0, 0, .75), inset 0 1px 0 color-mix(in srgb, var(--ink) 11%, transparent); transition: opacity .35s ease, scale .45s var(--cm-ease), filter .35s; }
.cm.is-hidden .cm-win { opacity: 0; scale: .96; filter: blur(8px); pointer-events: none; }
.cm-win.is-opening { animation: cm-open .55s cubic-bezier(.2, .9, .2, 1) backwards; }
@keyframes cm-open { from { opacity: 0; scale: .95; filter: blur(10px); translate: 0 14px; } }

/* ---------- sidebar ---------- */
.cm-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 12px 14px; border-right: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 5%, transparent), color-mix(in srgb, var(--ink) 2%, transparent)); }
.cm-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 10px; }
.cm-brand b { font: 800 16px/1 "Unbounded", sans-serif; letter-spacing: -.04em; }
.cm-brand placebo-logo { height: 24px; --logo-mark: var(--cm-accent); transition: rotate .6s cubic-bezier(.2, 1.5, .4, 1); }
.cm-brand:hover placebo-logo { rotate: 180deg; }
.cm-tabs { position: relative; display: grid; gap: 4px; }
.cm-tabs__label { padding: 12px 10px 5px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.cm-tabs__pill { position: absolute; left: 0; top: 0; border-radius: 13px; background: linear-gradient(90deg, color-mix(in srgb, var(--cm-accent) 17%, transparent), color-mix(in srgb, var(--cm-accent) 5%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cm-accent) 30%, transparent), 0 8px 24px -10px var(--cm-accent); pointer-events: none; transition: translate .45s cubic-bezier(.2, 1.25, .3, 1), width .3s, height .3s, background-color .3s; }
.cm-tab { position: relative; display: flex; align-items: center; gap: 11px; height: 44px; padding: 0 10px 0 8px; border: 0; border-radius: 13px; background: none; color: var(--muted); font-size: 14px; text-align: left; transition: color .2s; }
.cm-tab__ico { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--cm-s1); transition: background-color .3s, color .3s, scale .35s cubic-bezier(.2, 1.7, .4, 1); }
.cm-tab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cm-tab:hover { color: var(--ink); }
.cm-tab:hover .cm-tab__ico { scale: 1.08; background: var(--cm-s2); }
.cm-tab[aria-selected="true"] { color: var(--ink); }
.cm-tab[aria-selected="true"] .cm-tab__ico { background: var(--cm-accent); color: var(--cm-on); box-shadow: 0 6px 16px -6px var(--cm-accent); }
.cm-tab em { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 99px; background: var(--cm-s2); color: var(--muted); font-size: 9px; font-style: normal; text-align: center; }
.cm-tab em:empty { display: none; }
.cm.is-searching .cm-tab em { background: var(--cm-accent); color: var(--cm-on); }
.cm-status { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--cm-s1); color: var(--muted); font-size: 9px; }
.cm-status i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.cm.is-live .cm-status i { background: var(--cm-accent); box-shadow: 0 0 0 0 var(--cm-accent); animation: cm-ping 2s infinite; }
.cm.is-live .cm-status { color: var(--ink); }
@keyframes cm-ping { to { box-shadow: 0 0 0 7px transparent; } }

/* ---------- top bar and footer ---------- */
.cm-main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.cm-top { display: flex; align-items: center; gap: 10px; height: 70px; padding: 0 14px 0 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cm-title { display: grid; gap: 4px; min-width: 0; margin-right: 6px; }
.cm-title b { font: 700 17px/1 "Unbounded", sans-serif; letter-spacing: -.03em; }
.cm-title span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; opacity: .8; }
.cm-search { display: flex; align-items: center; gap: 8px; flex: 0 1 220px; min-width: 110px; height: 34px; margin-left: auto; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--cm-s1); transition: border-color .2s, box-shadow .2s; }
.cm-search:focus-within { border-color: var(--cm-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-accent) 18%, transparent); }
.cm-search svg { flex: none; width: 13px; height: 13px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.cm-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 12px; }
.cm-search input::placeholder { color: var(--muted); }
.cm-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.cm-lang { display: inline-flex; flex: none; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--cm-s1); color: var(--muted); font-size: 10px; transition: border-color .2s, color .2s; }
.cm-lang svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.cm-lang b { font-weight: 600; }
.cm-lang:hover, .cm-lang[aria-expanded="true"] { border-color: var(--cm-accent); color: var(--ink); }

/* the account in the corner: id, login, subscription time */
.cm-acc { --acc: var(--cm-accent); position: relative; display: flex; flex: none; align-items: center; gap: 10px; padding: 8px 16px 10px 9px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(135deg, color-mix(in srgb, var(--acc) 10%, transparent), var(--cm-s1)); overflow: hidden; }
.cm-acc[data-state="warn"] { --acc: #ffc23d; }
.cm-acc[data-state="ended"] { --acc: #ff5247; }
.cm-acc__av { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--acc), color-mix(in srgb, var(--acc) 35%, #000)); color: var(--cm-on); font: 800 13px/1 "Unbounded", sans-serif; box-shadow: 0 6px 16px -6px var(--acc); }
.cm-acc__txt { display: grid; gap: 4px; line-height: 1; }
.cm-acc__top { display: flex; align-items: center; gap: 7px; }
.cm-acc__top b { color: var(--ink); font-size: 13px; font-weight: 600; }
.cm-acc__top em { padding: 2px 6px; border-radius: 6px; background: var(--cm-s2); color: var(--muted); font-size: 9px; font-style: normal; }
.cm-acc__sub { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 10px; }
.cm-acc__sub b { color: var(--acc); font-weight: 600; }
.cm-acc__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--cm-s2); }
.cm-acc__bar i { display: block; height: 100%; background: var(--acc); transform-origin: left; transition: scale 1s linear; box-shadow: 0 0 10px var(--acc); }

.cm-foot { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; }
.cm-foot__key { display: inline-flex; align-items: center; }
.cm-foot__help { display: flex; flex: 1 1 auto; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; font-size: 10px; white-space: nowrap; opacity: .6; transition: opacity .2s; }
.cm-foot__help.has-row { opacity: 1; }
.cm-foot__help b { flex: none; color: var(--ink); font-weight: 600; }
.cm-foot__help span { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.cm-count { flex: none; }
.cm-foot__acts { display: inline-flex; gap: 6px; }
.cm-ghost { padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--muted); font-size: 9px; transition: border-color .2s, color .2s; }
.cm-ghost:hover { border-color: var(--ink); color: var(--ink); }
.cm kbd { display: inline-block; margin-right: 6px; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; font: inherit; color: var(--ink); }

/* ---------- panes ---------- */
.cm-panes { display: grid; min-height: 0; }
.cm-pane { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; opacity: 0; visibility: hidden; transition: opacity .18s, visibility 0s .18s; }
.cm-pane.is-active { opacity: 1; visibility: visible; transition: opacity .3s; }
.cm-pane--view { grid-template-columns: minmax(0, 1fr) clamp(250px, 29%, 320px); }
.cm-scroll { min-height: 0; padding: 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.cm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 14px; align-items: start; }
.cm-col { display: grid; gap: 14px; min-width: 0; }
.cm-group { display: grid; gap: 3px; min-width: 0; padding: 10px 7px 8px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 5%, transparent), color-mix(in srgb, var(--ink) 2%, transparent)); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 6%, transparent); transition: border-color .3s; }
.cm-group:hover { border-color: color-mix(in srgb, var(--cm-accent) 38%, var(--line)); }
.cm-group h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px 8px; color: var(--muted); font-size: 9px; font-weight: 400; letter-spacing: .09em; text-transform: uppercase; }
.cm-group h4::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--cm-accent); box-shadow: 0 0 8px var(--cm-accent); }
.cm-cnt { margin: 0 6px 0 auto; padding: 1px 7px; border-radius: 99px; background: var(--cm-s2); color: var(--muted); font-size: 9px; font-style: normal; letter-spacing: 0; text-transform: none; transition: background-color .25s, color .25s; }
.cm-cnt:empty { display: none; }
.cm-cnt.is-on { background: color-mix(in srgb, var(--cm-accent) 20%, transparent); color: var(--ink); }
.cm-cols { transition: opacity .3s, filter .3s; }
.cm-pane.is-off .cm-cols { opacity: .4; filter: saturate(.4); }
.cm-pane.is-enter .cm-group, .cm-pane.is-enter .cm-view { animation: cm-rise .45s var(--cm-ease) backwards; animation-delay: calc(60ms + var(--i, 4) * 45ms); }
@keyframes cm-rise { from { opacity: 0; translate: 0 12px; } }

/* ---------- rows ---------- */
.cm-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 34px; padding: 3px 9px; border: 0; border-radius: 11px; background: var(--cm-s1); color: var(--muted); font-size: 13px; text-align: left; transition: background-color .2s, opacity .25s; }
.cm-row > span { min-width: 0; }
.cm-row--sub { min-height: 30px; background: none; }
.cm-row--sub::after { content: ""; position: absolute; left: -10px; top: 50%; width: 8px; height: 1px; background: var(--line); pointer-events: none; }
.cm-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.cm-bar > * { flex: 1 1 220px; min-height: 44px; }
.cm-bar .cm-row--color { border: 1px solid var(--line); padding-inline: 14px; }
.cm-row--master { padding-inline: 14px; border: 1px solid var(--line); background: linear-gradient(90deg, color-mix(in srgb, var(--cm-accent) 9%, transparent), var(--cm-s1)); font-size: 14px; transition: background-color .2s, border-color .3s, opacity .25s; }
.cm-row--master > span { color: var(--ink); font-weight: 600; }
.cm-row--master.is-on { border-color: color-mix(in srgb, var(--cm-accent) 48%, var(--line)); }
.cm-row--toggle:hover, .cm-row--color:hover { background: var(--cm-s2); }
.cm-row--toggle::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--cm-accent); scale: 1 0; transition: scale .25s var(--cm-spring); }
.cm-row--toggle:hover::before, .cm-row--toggle.is-on::before { scale: 1 1; }
.cm-row--toggle > span { margin-right: auto; pointer-events: none; transition: color .2s; }
.cm-row--toggle.is-on > span, .cm-row--color:hover > span { color: var(--ink); }
.cm-row--color { width: 100%; font-family: inherit; cursor: pointer; }
.cm-hit { position: absolute; inset: 0; padding: 0; border: 0; border-radius: inherit; background: none; }
.cm-hit:focus-visible, .cm button:focus-visible, .cm [tabindex]:focus-visible { outline: 2px solid var(--cm-accent); outline-offset: -2px; }
.cm.is-searching .cm-row[data-row]:not(.is-hit) { opacity: .28; }
.cm-row.is-hit { background: color-mix(in srgb, var(--cm-accent) 14%, transparent); }

.cm-switch { position: relative; flex: none; width: 34px; height: 20px; border-radius: 99px; background: var(--cm-s3); pointer-events: none; transition: background-color .25s, box-shadow .25s; }
.cm-switch i { position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: translate .4s cubic-bezier(.2, 1.7, .4, 1), background-color .25s, scale .2s; }
.cm-row--toggle:active .cm-switch i { scale: 1.3 .8; }
.is-on > .cm-switch { background: var(--cm-accent); box-shadow: 0 0 14px color-mix(in srgb, var(--cm-accent) 60%, transparent); }
.is-on > .cm-switch i { translate: 14px 0; background: var(--cm-on); }

/* rows that belong to a switch fold away while it is off; a thin line ties them to it */
.cm-dep { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .4s var(--cm-ease), opacity .3s; }
.cm-dep > div { position: relative; display: grid; gap: 2px; min-height: 0; margin-left: 10px; padding-left: 14px; overflow: hidden; }
.cm-dep > div::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 14px; width: 1px; background: var(--line); }
.cm-dep.is-open { grid-template-rows: 1fr; opacity: 1; }

/* the colour square of an element: a checkerboard under the colour, left half opaque */
.cm-sw { position: relative; z-index: 1; display: inline-block; flex: none; width: 22px; height: 22px; padding: 0; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 7px; background: var(--checker); overflow: hidden; transition: scale .3s cubic-bezier(.2, 1.7, .4, 1), box-shadow .2s, border-color .2s, opacity .2s; }
.cm-sw::after, .cm-sw::before { content: ""; position: absolute; top: 0; bottom: 0; background: var(--sw, #fff); }
.cm-sw::after { left: 0; right: 0; }
.cm-sw::before { left: 0; z-index: 1; width: 50%; background: var(--sw-solid, #fff); }
button.cm-sw:hover, .cm-row--color:hover .cm-sw { scale: 1.14; border-color: var(--ink); }
.cm-sw[aria-expanded="true"], .cm-row--color[aria-expanded="true"] .cm-sw { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--cm-accent); }
.cm-sw.is-auto { opacity: .42; }
.cm-sw.is-link { scale: 1.18; box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--cm-accent); }

.cm-bind { position: relative; z-index: 1; flex: none; min-width: 30px; height: 22px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--cm-s1); color: var(--muted); font-size: 9px; transition: border-color .2s, color .2s; }
.cm-bind:hover { border-color: var(--ink); color: var(--ink); }
.cm-bind.is-listening { border-color: var(--cm-accent); color: var(--cm-accent); animation: cm-listen 1s ease-in-out infinite; }
@keyframes cm-listen { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cm-accent) 25%, transparent); } }

.cm-seg { display: inline-flex; flex: none; gap: 2px; padding: 2px; border-radius: 99px; background: var(--cm-s2); }
.cm-seg button { height: 24px; padding: 0 10px; border: 0; border-radius: 99px; background: none; color: var(--muted); font-size: 11px; transition: background-color .25s, color .25s; }
.cm-seg button:hover { color: var(--ink); }
.cm-seg button[aria-pressed="true"] { background: var(--cm-accent); color: var(--cm-on); }

.cm-select { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--cm-s1); color: var(--ink); font-size: 12px; transition: border-color .2s; }
.cm-select:hover, .cm-select[aria-expanded="true"] { border-color: var(--cm-accent); }
.cm-select svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: rotate .3s cubic-bezier(.2, 1.5, .4, 1); }
.cm-select[aria-expanded="true"] svg { rotate: 180deg; }
.cm-pop { position: absolute; z-index: 9; display: grid; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .65); opacity: 0; visibility: hidden; scale: .92; transform-origin: top right; transition: opacity .18s, scale .28s cubic-bezier(.2, 1.4, .4, 1), visibility 0s .18s; }
.cm-pop.is-up { transform-origin: bottom right; }
.cm-pop.is-open { opacity: 1; visibility: visible; scale: 1; transition: opacity .18s, scale .28s cubic-bezier(.2, 1.4, .4, 1); }
.cm-pop button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12px; text-align: left; white-space: nowrap; }
.cm-pop button:hover { background: var(--cm-s2); color: var(--ink); }
.cm-pop button[aria-selected="true"] { color: var(--cm-accent); }

.cm-row--slider { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; align-items: stretch; padding-block: 6px 3px; }
.cm-slider__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-slider__head b { padding: 1px 7px; border-radius: 6px; background: var(--cm-s2); color: var(--ink); font-size: 9px; font-weight: 400; }
.cm input[type="range"] { --fill: 50%; width: 100%; height: 18px; margin: 0; background: none; appearance: none; -webkit-appearance: none; cursor: pointer; }
.cm input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--cm-accent) var(--fill), var(--cm-s3) var(--fill)); }
.cm input[type="range"]::-moz-range-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--cm-accent) var(--fill), var(--cm-s3) var(--fill)); }
.cm input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-accent) 32%, transparent); transition: scale .2s; }
.cm input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink); }
.cm input[type="range"]:active::-webkit-slider-thumb { scale: 1.3; }

.cm-row--chips { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: start; padding-block: 7px; }
.cm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cm-chips button { height: 25px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--muted); font-size: 11px; transition: border-color .2s, color .2s, background-color .2s, scale .3s cubic-bezier(.2, 1.7, .4, 1); }
.cm-chips button:active { scale: .92; }
.cm-chips button[aria-pressed="true"] { border-color: var(--cm-accent); background: color-mix(in srgb, var(--cm-accent) 16%, transparent); color: var(--ink); }

.cm-presets { display: grid; gap: 5px; }
.cm-presets button { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid transparent; border-radius: 11px; background: var(--cm-s1); color: var(--ink); text-align: left; transition: border-color .2s, background-color .2s, translate .3s cubic-bezier(.2, 1.5, .4, 1); }
.cm-presets button:hover { border-color: var(--cm-accent); translate: 3px 0; }
.cm-presets b { font-size: 13px; font-weight: 600; }
.cm-presets span { color: var(--muted); font-size: 11px; }
.cm-action { height: 34px; margin-top: 4px; border: 1px solid var(--line); border-radius: 11px; background: none; color: var(--muted); font-size: 9px; transition: border-color .2s, color .2s; }
.cm-action:hover { border-color: var(--danger, #ff5247); color: var(--danger, #ff5247); }

/* ---------- colour picker, ImGui style ---------- */
.cm-pk { position: absolute; z-index: 10; display: grid; gap: 10px; width: 250px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--bg-2) 94%, var(--ink)); box-shadow: 0 28px 60px -14px rgba(0, 0, 0, .75), inset 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent); opacity: 0; visibility: hidden; scale: .96; transform-origin: top right; transition: opacity .15s, scale .22s cubic-bezier(.2, 1.3, .4, 1), visibility 0s .15s; }
.cm-pk.is-open { opacity: 1; visibility: visible; scale: 1; transition: opacity .15s, scale .22s cubic-bezier(.2, 1.3, .4, 1); }
.cm-pk__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-pk__head b { overflow: hidden; color: var(--ink); font: 600 13px/1.1 "Unbounded", sans-serif; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.cm-pk__x { display: grid; flex: none; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--muted); transition: background-color .2s, color .2s; }
.cm-pk__x:hover { background: var(--cm-s2); color: var(--ink); }
.cm-pk__x svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.cm-pk__pick { display: grid; grid-template-columns: minmax(0, 1fr) 16px 16px; gap: 8px; height: 176px; }
.cm-pk.no-alpha .cm-pk__pick { grid-template-columns: minmax(0, 1fr) 16px; }
.cm-pk__sv, .cm-pk__bar { position: relative; border-radius: 5px; cursor: crosshair; touch-action: none; user-select: none; }
.cm-pk__sv { background: linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, var(--hue, #f00)); }
.cm-pk__hue { background: linear-gradient(to bottom, #f00, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00); }
.cm-pk__alpha { background: linear-gradient(to bottom, var(--c, #fff), rgba(0, 0, 0, 0)), var(--checker); }
.cm-pk__bar[hidden] { display: none; }
.cm-pk__sv i, .cm-pk__bar i { position: absolute; pointer-events: none; box-sizing: border-box; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .35); }
.cm-pk__sv i { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; }
.cm-pk__bar i { left: -3px; right: -3px; height: 7px; margin-top: -3.5px; border-radius: 4px; }
.cm-pk__mid { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cm-pk__prev { display: grid; grid-template-rows: 1fr 1fr; flex: none; width: 56px; height: 38px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cm-pk__new, .cm-pk__old { display: block; padding: 0; border: 0; background: linear-gradient(var(--sw, #fff), var(--sw, #fff)), var(--checker); }
.cm-pk__old { cursor: pointer; }
.cm-pk__old:hover { filter: brightness(1.12); }
.cm-pk__modes { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--cm-s2); font-size: 10px; }
.cm-pk__modes button { height: 24px; padding: 0 9px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: inherit; transition: background-color .2s, color .2s; }
.cm-pk__modes button:hover { color: var(--ink); }
.cm-pk__modes button[aria-pressed="true"] { background: var(--cm-accent); color: var(--cm-on); }
.cm-pk__fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cm-pk__fields label { display: grid; gap: 3px; min-width: 0; }
.cm-pk__fields label.is-wide { grid-column: 1 / -1; }
.cm-pk__fields span { color: var(--muted); font-size: 9px; text-align: center; }
.cm-pk__fields input { width: 100%; min-width: 0; height: 28px; padding: 0 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--cm-s1); color: var(--ink); font: 500 12px/1 inherit; text-align: center; outline: 0; appearance: textfield; -moz-appearance: textfield; transition: border-color .2s, box-shadow .2s; }
.cm-pk__fields input::-webkit-outer-spin-button, .cm-pk__fields input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cm-pk__fields input:focus { border-color: var(--cm-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-accent) 18%, transparent); }
.cm-pk__pal { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; padding-top: 10px; border-top: 1px solid var(--line); }
.cm-pk__pal button { height: 22px; padding: 0; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 6px; background: var(--c); transition: scale .25s cubic-bezier(.2, 1.7, .4, 1), box-shadow .2s; }
.cm-pk__pal button:hover { scale: 1.14; }
.cm-pk__pal button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--ink); }

/* ---------- preview (ESP tab only) ---------- */
.cm-view { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 4%, transparent), color-mix(in srgb, var(--ink) 2%, transparent)); }
.cm-view__bar { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.cm.is-live #cmViewState { color: var(--cm-accent); }
.cm-view__stage { position: relative; flex: 1; min-height: 0; }
/* viewfinder corners */
.cm-view__stage::after { content: ""; position: absolute; inset: 12px; pointer-events: none; opacity: .6; background:
  linear-gradient(var(--cm-accent), var(--cm-accent)) 0 0 / 16px 1.5px no-repeat, linear-gradient(var(--cm-accent), var(--cm-accent)) 0 0 / 1.5px 16px no-repeat,
  linear-gradient(var(--cm-accent), var(--cm-accent)) 100% 0 / 16px 1.5px no-repeat, linear-gradient(var(--cm-accent), var(--cm-accent)) 100% 0 / 1.5px 16px no-repeat,
  linear-gradient(var(--cm-accent), var(--cm-accent)) 0 100% / 16px 1.5px no-repeat, linear-gradient(var(--cm-accent), var(--cm-accent)) 0 100% / 1.5px 16px no-repeat,
  linear-gradient(var(--cm-accent), var(--cm-accent)) 100% 100% / 16px 1.5px no-repeat, linear-gradient(var(--cm-accent), var(--cm-accent)) 100% 100% / 1.5px 16px no-repeat; }
#cmCanvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; user-select: none; }
#cmCanvas:active { cursor: grabbing; }
.cm-view__hint { padding: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; text-align: center; }
.cm-view__ctl { display: grid; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.cm-view__ctl-title { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.cm-view__ctl label { display: grid; gap: 1px; font-size: 12px; color: var(--muted); }
.cm-view__ctl label > span { display: flex; justify-content: space-between; gap: 10px; }
.cm-view__ctl b { padding: 1px 7px; border-radius: 6px; background: var(--cm-s2); color: var(--ink); font-size: 9px; font-weight: 400; }

/* ---------- toast, hidden state, lock ---------- */
.cm-toast { position: absolute; left: 50%; bottom: 56px; z-index: 11; padding: 9px 15px; border: 1px solid var(--cm-accent); border-radius: 99px; background: var(--bg-2); color: var(--ink); font-size: 9px; white-space: nowrap; opacity: 0; translate: -50% 12px; pointer-events: none; transition: opacity .25s, translate .4s cubic-bezier(.2, 1.5, .4, 1); }
.cm-toast.is-on { opacity: 1; translate: -50% 0; }

.cm-show { position: absolute; left: 50%; top: 50%; display: inline-flex; align-items: center; padding: 10px 16px 10px 10px; border: 1px dashed var(--line); border-radius: 99px; background: color-mix(in srgb, var(--bg-2) 80%, transparent); color: var(--ink); font-size: 10px; opacity: 0; translate: -50% calc(-50% + 10px); pointer-events: none; transition: opacity .3s, translate .4s cubic-bezier(.2, 1.4, .4, 1), border-color .2s; }
.cm-show:hover { border-color: var(--cm-accent); }
.cm.is-hidden .cm-show { opacity: 1; translate: -50% -50%; pointer-events: auto; }

.cm-lock { position: absolute; inset: 0; z-index: 12; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: color-mix(in srgb, var(--bg-2) 78%, transparent); backdrop-filter: blur(7px); transition: opacity .4s ease, visibility 0s; }
.cm-lock b { font: 600 22px/1.1 "Unbounded", sans-serif; letter-spacing: -.04em; }
.cm-lock span { max-width: 30ch; color: var(--muted); font-size: 14px; }
.cm-lock .btn { margin-top: 8px; }
.cm.is-live .cm-lock { opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s .4s; }

/* ---------- narrower windows ---------- */
@media (max-width: 1080px) {
  .cm-title span, .cm-acc__sub > span { display: none; }
  .cm-search { flex-basis: 150px; }
}

/* ---------- small screens: tabs go on top, the preview stays in view ---------- */
@media (max-width: 760px) {
  .cm-win { grid-template-columns: minmax(0, 1fr); height: auto; }
  .cm-side { flex-direction: row; align-items: center; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .cm-brand, .cm-status, .cm-tabs__label, .cm-tab em, .cm-foot__key { display: none; }
  .cm-tabs { display: flex; gap: 4px; }
  .cm-tab { flex: none; height: 40px; padding: 0 12px 0 6px; }
  .cm-tabs__pill { border-radius: 13px; }
  .cm-top { flex-wrap: wrap; gap: 8px; height: auto; padding: 10px 12px; }
  .cm-title { flex: 1; }
  .cm-search { order: 5; flex: 1 1 100%; margin-left: 0; }
  .cm-acc { padding-right: 12px; }
  .cm-acc__sub > span { display: inline; }
  .cm-pane:not(.is-active) { display: none; }
  .cm-pane--view { grid-template-columns: minmax(0, 1fr); }
  .cm-scroll { overflow: visible; }
  .cm-view { order: -1; border-left: 0; border-bottom: 1px solid var(--line); background: var(--bg-2); }
  .cm-view__stage { flex: none; height: 230px; }
  .cm-view__ctl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
  .cm-pk { width: min(250px, calc(100% - 16px)); }
  .cm-show { position: static; display: none; margin: 0 auto; translate: none; }
  .cm.is-hidden .cm-win { display: none; }
  .cm.is-hidden .cm-show { display: block; translate: none; }
}
@media (max-width: 420px) {
  .cm-acc__sub > span { display: none; }
  .cm-acc__av { display: none; }
}

.cm.no-anim *, .cm.no-anim *::before, .cm.no-anim *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cm *, .cm *::before, .cm *::after { transition: none !important; animation: none !important; }
}
