/* Make it yours: the Customize panel of the trenches board (js/customize.js, mounted by views/pulse.js displayPanel).
   docs/UPDATES-1.md section 3. Prefix cz-. No colour is written down in this file: everything is a token of
   styles.css / css/light.css, or a mix of the flame tokens.

   Four parts:
   1. the accents: <html data-accent="ember" | "white-hot"> (set by js/pre.js before the first paint and by
      js/customize.js applyAccent). 'flame' is the house orange and has no block. An accent moves the FILLS only:
      what near-black text sits on, washes, borders, glows. The text orange and the text on a fill are the theme's
      and are never named here, so every label keeps the contrast the theme was measured for.
   2. the third market-cap colour (.mc-top) of the visitor's steps;
   3. the numbers a row hides: keyed on the board's own data attributes, so a number that is switched off is not
      drawn at all, never drawn as 0;
   4. the panel's sections. Under 900 px the panel is the board's bottom sheet (css/terminal.css .ppanel): one column,
      every switch, swatch and the reset button at least 44 px tall, the three step boxes in one row that wraps. */

/* ---------- 1. accents: flame tones only ---------- */
/* ember: halfway between the ember red and the orange. The red alone (--heat-1) is 26 degrees of hue from the sell
   red in black, under the 30 the house keeps between the brand and a sell; the mix is 33 or more in both themes and
   near-black text on it reads 5.4 to 1 or better. The deep and the bright orange stay the theme's. */
:root[data-accent="ember"] {
  --brand: color-mix(in srgb, var(--heat-1), var(--heat-2));
  --brand-soft: color-mix(in srgb, var(--brand) 8%, transparent);
  --brand-a06: color-mix(in srgb, var(--brand) 6%, transparent);
  --brand-a35: color-mix(in srgb, var(--brand) 35%, transparent);
  --brand-a45: color-mix(in srgb, var(--brand) 45%, transparent);
  --brand-a50: color-mix(in srgb, var(--brand) 50%, transparent);
  --brand-a55: color-mix(in srgb, var(--brand) 55%, transparent);
  --brand-a90: color-mix(in srgb, var(--brand) 90%, transparent);
  --glow: 0 0 0 1px var(--brand-a35), 0 10px 30px -8px color-mix(in srgb, var(--brand) 60%, transparent);
}
/* white-hot: one stop up the flame. The fill is the bright flame that near-black text already sits on in both themes
   (--brand-hi-fill; --heat-3 is that colour in black, but a deep amber for TEXT in the light theme, where near-black
   on it is 3.8 to 1). A pressed button falls back to the orange. */
:root[data-accent="white-hot"] {
  --brand: var(--brand-hi-fill);
  --brand-deep: var(--heat-2);
  --brand-soft: color-mix(in srgb, var(--brand) 8%, transparent);
  --brand-a06: color-mix(in srgb, var(--brand) 6%, transparent);
  --brand-a35: color-mix(in srgb, var(--brand) 35%, transparent);
  --brand-a45: color-mix(in srgb, var(--brand) 45%, transparent);
  --brand-a50: color-mix(in srgb, var(--brand) 50%, transparent);
  --brand-a55: color-mix(in srgb, var(--brand) 55%, transparent);
  --brand-a90: color-mix(in srgb, var(--brand) 90%, transparent);
  --glow: 0 0 0 1px var(--brand-a35), 0 10px 30px -8px color-mix(in srgb, var(--brand) 60%, transparent);
}
/* white-hot rests on the colour the house uses for a hovered fill, so its own hover is a touch of light instead */
:root[data-accent="white-hot"] .btn-primary:hover, :root[data-accent="white-hot"] .qpill:not(.is-off):hover, :root[data-accent="white-hot"] .fp-apply:hover { filter: brightness(1.1); }

/* ---------- 2. the third market-cap step ---------- */
/* white-hot is 1.05 to 1 from plain text in black, so the top step GLOWS: without the glow the hottest step reads like the coldest */
.pr-mc b.mc-top, .pw-mc.mc-top { color: var(--heat-hot); text-shadow: 0 0 8px var(--heat-3), 0 0 2px var(--heat-4); }

/* ---------- 3. numbers a row hides ---------- */
.pulse[data-n-vol="off"] .pr-v,
.pulse[data-n-mc="off"] .pr-mc,
.pulse[data-n-fees="off"] .pr-f,
.pulse[data-n-tx="off"] .pr-tx,
.pulse[data-n-holders="off"] .pr-n,
.pulse[data-n-heat="off"] .pc-heat { display: none; }
/* a line of the row with nothing left on it takes no room */
.pulse[data-n-vol="off"][data-n-mc="off"] .pr-r1 { display: none; }
.pulse[data-n-fees="off"][data-n-tx="off"] .pr-r2:has(> [data-tip="liquidity"][hidden]) { display: none; }
.pulse[data-n-tx="off"] .pr-r2:has(> [data-tip="liquidity"][hidden]):has(> .pr-f[hidden]) { display: none; }
.pulse[data-n-fees="off"] .pr-r2:has(> [data-tip="liquidity"][hidden]):has(> .pr-tx[hidden]) { display: none; }
@media (max-width: 559px) {
  /* a phone row has no V of its own (css/terminal.css): without MC its first line is empty */
  .pulse[data-n-mc="off"] .pr-r1 { display: none; }
}

/* ---------- 4. the panel ---------- */
.cz-sec { display: grid; gap: 6px; min-width: 0; }
.cz-note, .cz-msg { margin: 0; font-size: 11.5px; line-height: 1.35; }
/* a typing mistake is a caution, never the sell red (spec: green / red stay for buy / sell and profit / loss) */
.cz-msg { color: var(--warn); }
.cz-tog { min-height: 28px; }
.cz-tog-t { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
/* "wide screens": said only where it is true, on a phone, whose rows leave V and F out by themselves */
.cz-wide { display: none; color: var(--dim); font: 500 10.5px/1 var(--font-ui); }
@media (max-width: 559px) {
  .cz-wide { display: inline; }
}

.cz-steps { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cz-step { display: grid; gap: 4px; flex: 1 1 70px; min-width: 0; }
.cz-step-k { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--muted); font: 600 10.5px/1.2 var(--font-ui); }
.cz-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line-2); }
.cz-dot.mc-mid { background: var(--heat-3); }
.cz-dot.mc-hi { background: var(--heat-4); }
.cz-dot.mc-top { background: var(--heat-hot); }
.cz-in { width: 100%; min-width: 0; height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 500 12.5px/1 var(--font-mono); outline: none; }
.cz-in:focus { border-color: var(--brand); }
.cz-in.bad { border-color: var(--warn); color: var(--text); }
/* the live swatch: the step as the board will write it, in the colour the board will give it */
.cz-eg { min-height: 12px; font: 700 12px/1 var(--font-mono); color: var(--text); }
.cz-eg.mc-mid { color: var(--heat-3); }
.cz-eg.mc-hi { color: var(--heat-4); }
.cz-eg.mc-top { color: var(--heat-hot); text-shadow: 0 0 8px var(--heat-3), 0 0 2px var(--heat-4); }

.cz-accs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cz-acc { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 32px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); font: 600 12px/1 var(--font-ui); cursor: pointer; }
.cz-acc:hover { color: var(--text); }
.cz-acc[aria-pressed="true"] { border-color: var(--brand); color: var(--text); box-shadow: var(--ring); }
/* each swatch shows its own tone whatever accent is on: drawn from the flame tokens, not from --brand */
.cz-acc-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.cz-acc-ember { background: linear-gradient(135deg, var(--heat-1), var(--heat-2)); }
.cz-acc-flame { background: var(--heat-2); }
.cz-acc-white-hot { background: var(--brand-hi-fill); }

.cz-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.cz-reset { flex: none; }

@media (max-width: 899px) {
  /* the bottom sheet: fingers, not a pointer */
  .cz-tog, .cz-acc, .cz-reset { min-height: 44px; }
  .cz-in { height: 44px; font-size: 16px; }
  .cz-step { flex-basis: 92px; }
}
