/* HH quick chip (header) + popover. Tokens only (css/tokens.css); chart colours live in js/palette.js. */
.hh-chip { position: relative; display: inline-flex; align-items: center; gap: var(--s1); height: var(--h-sm); padding: 0 var(--s2);
  border: 1px solid var(--border); border-radius: var(--r-pill); background: transparent; color: var(--muted);
  font: 600 var(--fs-xs)/1 var(--sans); letter-spacing: .02em; cursor: pointer; flex: none; }
.hh-chip .icon { width: 14px; height: 14px; }
.hh-chip:hover { background: var(--hover); color: var(--text); }
.hh-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hh-chip-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hh-chip[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.hh-chip[aria-pressed="true"] .hh-chip-dot { display: inline-block; }
@media (max-width: 700px) {
  .hh-chip { padding: 0 var(--s2); }
  .hh-chip .hh-chip-label { display: none; }
}

.hhq-pop { position: fixed; z-index: var(--z-popover); box-sizing: border-box; overflow: auto; padding: var(--s3);
  background: var(--surface3); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: var(--s2); font: 400 var(--fs-xs)/1.4 var(--sans); }
.hhq-pop[hidden] { display: none; }
.hhq-head { display: flex; align-items: baseline; gap: var(--s2); }
.hhq-head b { font-size: var(--fs-sm); }
.hhq-head span { color: var(--soft); }
.hhq-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); align-items: end; }
.hhq-f { display: flex; flex-direction: column; gap: var(--s1); color: var(--muted); min-width: 0; }
.hhq-f select, .hhq-f input { box-sizing: border-box; width: 100%; height: var(--h-sm); padding: 0 var(--s2); min-width: 0;
  background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-sm); font: 400 var(--fs-xs)/1 var(--mono); }
.hhq-f select { font-family: var(--sans); }
.hhq-f select:focus-visible, .hhq-f input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.hhq-side { display: grid; grid-template-columns: 1fr 1fr; height: var(--h-sm); border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.hhq-side button { border: 0; background: transparent; color: var(--muted); font: 600 var(--fs-xs)/1 var(--sans); cursor: pointer; }
.hhq-side button[aria-pressed="true"][data-side="long"] { background: var(--long); color: var(--bg); }
.hhq-side button[aria-pressed="true"][data-side="short"] { background: var(--short); color: var(--bg); }
.hhq-lev, .hhq-sum, .hhq-note { margin: 0; }
.hhq-lev { color: var(--muted); font-family: var(--mono); }
.hhq-sum { color: var(--text); }
.hhq-note { color: var(--soft); font-size: var(--fs-2xs); }
.hhq-bad { color: var(--warning); }
.hhq-check { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.hhq-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.hhq-actions { align-items: center; }
.hhq-btn { height: var(--h-sm); padding: 0 var(--s2); border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: transparent; color: var(--text); font: 600 var(--fs-xs)/1 var(--sans); cursor: pointer; }
.hhq-btn:hover { background: var(--hover); }
.hhq-btn[hidden] { display: none; }
.hhq-link { justify-self: end; border: 0; background: transparent; color: var(--accent); font: 600 var(--fs-xs)/1 var(--sans); cursor: pointer; padding: var(--s1) 0; }
.hhq-link:hover { color: var(--accent-hover); }
.hhq-bad:empty { display: none; }

/* leverage: one press, 1× … max (5× on HashHedge) */
.hhq-f > span small { color: var(--soft); font-weight: 400; }
.hhq-levs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--h-sm); border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.hhq-levs button { border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--muted); font: 600 var(--fs-xs)/1 var(--mono); cursor: pointer; }
.hhq-levs button:first-child { border-left: 0; }
.hhq-levs button:hover { background: var(--hover); color: var(--text); }
.hhq-levs button[aria-pressed="true"] { background: var(--accent-fill); color: var(--btn-fg); }
.hhq-row-end .hhq-lev { align-self: center; }
/* what the entry means: price, move from the entry, dollars */
.hhq-out { display: grid; gap: 2px; padding: var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm); background: color-mix(in srgb, var(--bg) 40%, transparent); }
.hhq-out[hidden] { display: none; }
.hhq-out-row { display: grid; grid-template-columns: 1fr auto 64px 72px; gap: var(--s2); align-items: baseline; font-size: var(--fs-xs); color: var(--muted); }
.hhq-out-row b { color: var(--text); font: 600 var(--fs-xs)/1.4 var(--mono); }
.hhq-out-row span:nth-child(n+3) { text-align: right; font-family: var(--mono); }
.hhq-out-row.up span:last-child { color: var(--long); }
.hhq-out-row.down span:last-child { color: var(--short); }
.hhq-note[hidden] { display: none; }
/* one-time hint when the mode is switched on */
dialog.hhq-hint { width: min(420px, calc(100vw - 24px)); }
dialog.hhq-hint p { margin: 0 var(--s4) var(--s3); color: var(--muted); line-height: 1.5; }
dialog.hhq-hint p b { color: var(--text); }
dialog.hhq-hint .hhq-check { margin: 0 var(--s4) var(--s3); font-weight: 400; color: var(--muted); }
/* «Повний планувальник →» sits on the left edge with the rest of the content */
.hhq-actions { display: flex; justify-content: flex-start; }
.hhq-link { justify-self: start; padding-left: 0; }
