/* ============================================================================
   Pulse Finder — app layer on the ListeningMind design tokens.

   Motion policy (emil-design-eng / animate):
   - The brand file ships --lm-ease, a weak built-in-like curve. Stronger UI
     curves are ADDED here rather than replacing it.
   - transform and opacity only. No `transition: all`. No entrance from scale(0).
   - Frequency gate: cards appear once per run (~60s) -> 300ms + 40ms stagger.
     Tabs are pressed often -> 180ms indicator, 140ms opacity, nothing else.
     Sheet is occasional -> 300ms iOS drawer curve, exits the way it entered.
   - Sparklines never animate: they are data being read.
   - Reduced motion and hover gating ship with the animation, not after it.
   ========================================================================== */

/* The app was written against the older listeningmind-tokens.css names. The
   family tokens (lm-app-tokens.css) are now the only source; these aliases
   carry the old names onto the new values so no value is invented twice. */
:root {
  --lm-fs-display: 48px;  --lm-lh-display: 62.4px;
  --lm-fs-xxl:     32px;  --lm-lh-xxl:     44.8px;
  --lm-fs-h2:      28px;  --lm-lh-h2:      39.2px;
  --lm-fs-h3:      24px;  --lm-lh-h3:      33.6px;
  --lm-fs-h4:      20px;  --lm-lh-h4:      28px;
  --lm-fs-lg:      18px;  --lm-lh-lg:      25.2px;
  --lm-fs-md:      16px;  --lm-lh-md:      26px;
  --lm-fs-base:    16px;  --lm-lh-base:    24px;
  --lm-fs-sm:      14px;  --lm-lh-sm:      21px;
  --lm-fs-xs:      12px;  --lm-lh-xs:      16.8px;
  --lm-fs-xxs:     10px;  --lm-lh-xxs:     13px;
  --lm-fw-regular: 400; --lm-fw-medium: 500; --lm-fw-bold: 700; --lm-fw-black: 900;
  --lm-space-1: 4px;  --lm-space-2: 8px;  --lm-space-3: 12px; --lm-space-4: 16px;
  --lm-space-5: 20px; --lm-space-6: 24px; --lm-space-8: 32px; --lm-space-10: 40px;
  --lm-r-md: 10px;
  --lm-header-h: 56px;
  --lm-tracking-tight: -0.0075em;
}

:root {
  --hf-ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --hf-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --hf-ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --hf-d-press: 160ms;
  --hf-d-fast:  180ms;
  --hf-d-ui:    220ms;
  --hf-d-sheet: 300ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--lm-white);
  color: var(--lm-ink);
  font-family: var(--lm-font);
  font-size: var(--lm-fs-base);
  line-height: var(--lm-lh-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
button { font-family: inherit; }

.hf-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------------------------------------- controls kept in the GNB */
.hf-glslot { display: inline-flex; align-items: center; }

.hf-select {
  height: 32px; padding: 0 28px 0 10px; max-width: 100%;
  border: 1px solid var(--lm-line); border-radius: var(--lm-r-sm);
  background: var(--lm-white) no-repeat right 8px center;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237F7A8D' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  font-size: var(--lm-fs-sm); color: var(--lm-ink-2);
  appearance: none; cursor: pointer; text-overflow: ellipsis;
  transition: border-color var(--hf-d-fast) var(--hf-ease-out);
}
.hf-select:focus-visible { outline: 2px solid var(--lm-violet); outline-offset: 1px; }

/* section headings inside the view (the page's one h1 is the shell hero's) */
.hf-hero { margin: var(--lm-space-6) 0 var(--lm-space-6); }
.hf-hero__h2, .hf-hero__h {
  margin: 0; font-size: var(--lm-fs-h3); line-height: var(--lm-lh-h3);
  font-weight: var(--lm-fw-bold); color: var(--lm-ink);
}
.hf-hero p { margin: 8px 0 0; color: var(--lm-ink-2); }

/* ------------------------------------------------------------------ layout */
.hf-main { flex: 1; width: 100%; max-width: var(--lm-container); margin: 0 auto;
  padding: 0 var(--lm-gutter) 96px; }
/* the shell hero carries its own 80px tail, so the form starts right under it */
.lm-hero { padding-bottom: var(--lm-space-8); }
.lm-hero[hidden] { display: none; }
#hero[hidden] ~ .hf-main { padding-top: var(--lm-space-8); }
.hf-sheet__name { font-size: var(--lm-fs-h4); line-height: var(--lm-lh-h4);
  font-weight: var(--lm-fw-bold); }
/* the shell footer sets its own link weight; keep app rules off it */
.lm-footer a, .lm-rail a, .lm-gnb a { font-weight: inherit; }

/* ---------------------------------------------------------------- composer */
.hf-composer {
  border: 1px solid var(--lm-line); border-radius: var(--lm-r-md);
  background: var(--lm-white); box-shadow: var(--lm-shadow);
}
.hf-composer > .hf-fieldset:first-child {
  border-radius: var(--lm-r-md) var(--lm-r-md) 0 0; }
.hf-fieldset { padding: var(--lm-space-6) var(--lm-space-8);
  border-bottom: 1px solid var(--lm-line-soft); }
.hf-fieldset:last-of-type { border-bottom: 0; }
.hf-legend {
  display: block; font-size: var(--lm-fs-xs); line-height: var(--lm-lh-xs);
  font-weight: var(--lm-fw-bold); color: var(--lm-red-deep);
  margin-bottom: var(--lm-space-3);
}
.hf-legend-hint { font-size: var(--lm-fs-xs); color: var(--lm-muted); margin: -6px 0 10px; }
.hf-row { display: flex; flex-wrap: wrap; gap: var(--lm-space-2); align-items: center; }
.hf-row + .hf-row { margin-top: var(--lm-space-3); }
.hf-row__label { font-size: var(--lm-fs-sm); color: var(--lm-ink-3); min-width: 44px; }
.hf-row[data-disabled="true"] { opacity: .45; }

.hf-chip {
  height: 34px; padding: 0 14px; border-radius: var(--lm-r-pill);
  border: 1px solid var(--lm-line); background: var(--lm-white);
  font-size: var(--lm-fs-sm); color: var(--lm-ink-2); cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--hf-d-fast) var(--hf-ease-out),
              border-color var(--hf-d-fast) var(--hf-ease-out),
              color var(--hf-d-fast) var(--hf-ease-out),
              transform var(--hf-d-press) var(--hf-ease-out);
}
.hf-chip:active { transform: scale(0.97); }
.hf-chip[aria-pressed="true"] {
  background: var(--lm-violet); border-color: var(--lm-violet); color: var(--lm-white);
  font-weight: var(--lm-fw-medium);
}
.hf-chip[disabled] { cursor: not-allowed; }
.hf-chip:focus-visible { outline: 2px solid var(--lm-violet); outline-offset: 2px; }

.hf-inline-note {
  font-size: var(--lm-fs-sm); line-height: 21px; color: var(--lm-ink-3);
  background: var(--lm-surface); border: 1px solid var(--lm-line-soft);
  border-radius: var(--lm-r-sm); padding: 10px 12px; margin-bottom: var(--lm-space-3);
}

.hf-inputrow { display: flex; gap: var(--lm-space-2); align-items: stretch; }
.hf-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--lm-line); border-radius: var(--lm-r-sm);
  font-size: var(--lm-fs-base); color: var(--lm-ink); background: var(--lm-white);
  transition: border-color var(--hf-d-fast) var(--hf-ease-out);
}
.hf-input::placeholder { color: var(--lm-muted); }
.hf-input:focus { outline: none; border-color: var(--lm-violet); }
.hf-btn--seed { height: 44px; padding: 0 16px; white-space: nowrap; }
.hf-btn--seed[disabled] { opacity: .45; cursor: not-allowed; }

/* suggested seeds + category topics */
.hf-sugbox:not(:empty) { margin-top: var(--lm-space-4); }
.hf-sughead { font-size: var(--lm-fs-sm); color: var(--lm-ink-3); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hf-sughead strong { color: var(--lm-ink); }
.hf-sugchips { display: flex; flex-wrap: wrap; gap: var(--lm-space-2); }
.hf-sugchip {
  display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%;
  padding: 8px 14px; border-radius: var(--lm-r-pill);
  border: 1px dashed var(--lm-line-strong); background: var(--lm-white);
  cursor: pointer; text-align: left;
  opacity: 0; transform: translateY(6px);
  animation: hf-in 260ms var(--hf-ease-out) forwards;
  transition: border-color var(--hf-d-fast) var(--hf-ease-out),
              background-color var(--hf-d-fast) var(--hf-ease-out),
              transform var(--hf-d-press) var(--hf-ease-out);
}
.hf-sugchip:active { transform: scale(0.97); }
.hf-sugchip[aria-pressed="true"] {
  border-style: solid; border-color: var(--lm-violet); background: var(--lm-violet);
}
.hf-sugchip[aria-pressed="true"] .hf-sugchip__kw { color: var(--lm-white); }
.hf-sugchip[aria-pressed="true"] .hf-sugchip__angle,
.hf-sugchip[aria-pressed="true"] .hf-sugchip__vol { color: rgba(255,255,255,.62); }
.hf-sugchip__kw { font-size: var(--lm-fs-sm); font-weight: var(--lm-fw-medium);
  color: var(--lm-ink); }
.hf-sugchip__angle { font-size: var(--lm-fs-xxs); color: var(--lm-coral); white-space: nowrap; }
.hf-sugchip__vol { font-size: var(--lm-fs-xxs); color: var(--lm-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.hf-sugfoot { margin-top: 10px; font-size: var(--lm-fs-xs); color: var(--lm-muted); }

.hf-topicchip {
  padding: 6px 12px; border-radius: var(--lm-r-pill);
  border: 1px dashed var(--lm-line); background: var(--lm-white);
  font-size: var(--lm-fs-xs); color: var(--lm-ink-3); cursor: pointer;
  transition: border-color var(--hf-d-fast) var(--hf-ease-out),
              background-color var(--hf-d-fast) var(--hf-ease-out),
              color var(--hf-d-fast) var(--hf-ease-out),
              transform var(--hf-d-press) var(--hf-ease-out);
}
.hf-topicchip:active { transform: scale(0.97); }
.hf-topicchip[aria-pressed="true"] {
  border-style: solid; border-color: var(--lm-violet);
  background: var(--lm-violet); color: var(--lm-white);
}

.hf-question {
  padding: var(--lm-space-5) var(--lm-space-8);
  background: rgba(234,232,238,.8);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--lm-space-6); flex-wrap: wrap;
}
.hf-question__text { font-size: var(--lm-fs-lg); line-height: var(--lm-lh-lg);
  color: var(--lm-ink); word-break: keep-all; }
.hf-question__text b { color: var(--lm-coral); font-weight: var(--lm-fw-bold); }
.hf-question__meta { font-size: var(--lm-fs-xs); color: var(--lm-ink-3); margin-top: 4px; }

.hf-cta {
  height: 44px; padding: 0 24px; border: 0; border-radius: var(--lm-r-pill);
  background: var(--lm-violet); color: var(--lm-white);
  font-size: var(--lm-fs-base); font-weight: var(--lm-fw-bold); cursor: pointer;
  white-space: nowrap;
  transition: transform var(--hf-d-press) var(--hf-ease-out),
              opacity var(--hf-d-fast) var(--hf-ease-out);
}
.hf-cta:active { transform: scale(0.97); }
.hf-cta[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- progress */
.hf-progress { margin-top: var(--lm-space-8); }
.hf-progress__track { height: 4px; border-radius: 2px; background: var(--lm-line-soft);
  overflow: hidden; }
.hf-progress__bar {
  height: 100%; background: var(--lm-grad-cta);
  transform-origin: left center; transform: scaleX(0);
  transition: transform 400ms var(--hf-ease-out);
}
.hf-steps { list-style: none; margin: var(--lm-space-5) 0 0; padding: 0; }
.hf-steps li {
  display: flex; gap: var(--lm-space-3); align-items: baseline;
  padding: 7px 0; font-size: var(--lm-fs-sm); color: var(--lm-ink-2);
  border-bottom: 1px solid var(--lm-line-soft);
  opacity: 0; transform: translateY(6px);
  animation: hf-in 260ms var(--hf-ease-out) forwards;
}
.hf-steps li .t { color: var(--lm-muted); font-size: var(--lm-fs-xs); min-width: 48px; }
.hf-steps li .c { margin-left: auto; color: var(--lm-muted); font-size: var(--lm-fs-xs); }
@keyframes hf-in { to { opacity: 1; transform: translateY(0); } }

.hf-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--lm-line); border-top-color: var(--lm-coral);
  animation: hf-spin 620ms linear infinite; display: inline-block; vertical-align: -2px;
}
@keyframes hf-spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------- result bar */
.hf-resultbar {
  display: flex; align-items: center; gap: var(--lm-space-3); flex-wrap: wrap;
  padding-bottom: var(--lm-space-5); border-bottom: 1px solid var(--lm-line);
  margin-bottom: var(--lm-space-6);
}
.hf-resultbar h2 { margin: 0; font-size: var(--lm-fs-h3); line-height: var(--lm-lh-h3);
  font-weight: var(--lm-fw-bold); word-break: keep-all; }
.hf-meta { display: flex; gap: var(--lm-space-4); flex-wrap: wrap;
  font-size: var(--lm-fs-sm); color: var(--lm-ink-3); }
.hf-actions { margin-left: auto; display: flex; gap: var(--lm-space-2); flex-wrap: wrap; }
.hf-btn {
  height: 34px; padding: 0 14px; border-radius: var(--lm-r-sm);
  border: 1px solid var(--lm-line-strong); background: var(--lm-white);
  font-size: var(--lm-fs-sm); color: var(--lm-ink-2); cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--hf-d-fast) var(--hf-ease-out),
              color var(--hf-d-fast) var(--hf-ease-out),
              transform var(--hf-d-press) var(--hf-ease-out);
}
.hf-btn:active { transform: scale(0.97); }
.hf-btn--danger { color: var(--lm-red-deep); border-color: rgba(200,20,20,.3); }

/* -------------------------------------------------------------------- tabs */
.hf-tabs { position: relative; display: flex; gap: var(--lm-space-1);
  border-bottom: 1px solid var(--lm-line); margin-bottom: var(--lm-space-6); }
.hf-tab {
  position: relative; height: 40px; padding: 0 14px; border: 0; background: none;
  font-size: var(--lm-fs-sm); color: var(--lm-ink-3); cursor: pointer;
  white-space: nowrap;
  transition: color var(--hf-d-fast) var(--hf-ease-out);
}
.hf-tab[aria-selected="true"] { color: var(--lm-violet); font-weight: var(--lm-fw-bold); }
.hf-tab__count { margin-left: 6px; color: var(--lm-muted); font-size: var(--lm-fs-xs); }
.hf-tabs__ink {
  position: absolute; bottom: -1px; left: 0; height: 2px; width: 1px;
  background: var(--lm-violet); transform-origin: left center;
  transition: transform var(--hf-d-ui) var(--hf-ease-in-out);
}
.hf-panel { opacity: 1; transition: opacity 140ms var(--hf-ease-out); }
.hf-panel[data-fading="true"] { opacity: 0; }

/* ------------------------------------------------------------- trend cards */
.hf-grid { display: grid; gap: var(--lm-space-4);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.hf-card {
  border: 1px solid var(--lm-line); border-radius: var(--lm-r-md);
  background: var(--lm-white); padding: var(--lm-space-5) var(--lm-space-6);
  display: flex; flex-direction: column; gap: var(--lm-space-3); min-width: 0;
  opacity: 0; transform: translateY(8px);
  animation: hf-in 300ms var(--hf-ease-out) forwards;
  transition: box-shadow var(--hf-d-ui) var(--hf-ease-out),
              border-color var(--hf-d-ui) var(--hf-ease-out);
}
.hf-card__top { display: flex; align-items: flex-start; gap: var(--lm-space-3); }
.hf-card__kw { font-size: var(--lm-fs-h4); line-height: var(--lm-lh-h4);
  font-weight: var(--lm-fw-bold); color: var(--lm-ink); word-break: keep-all; }
.hf-card__kind {
  display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: var(--lm-r-sm);
  background: var(--lm-line-soft); color: var(--lm-ink-3);
  font-size: var(--lm-fs-xxs); line-height: 16px;
}
.hf-score { margin-left: auto; text-align: right; flex-shrink: 0; }
.hf-score__n { font-size: 28px; line-height: 32px; font-weight: var(--lm-fw-black);
  color: var(--lm-ink); font-variant-numeric: tabular-nums; }
.hf-score__l { font-size: var(--lm-fs-xxs); color: var(--lm-muted); }

.hf-spark { height: 34px; width: 100%; display: block; }
.hf-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px var(--lm-space-4); }
.hf-metric { min-width: 0; }
.hf-metric__l { font-size: var(--lm-fs-xxs); color: var(--lm-muted);
  white-space: nowrap; }
.hf-metric__v { font-size: var(--lm-fs-base); font-weight: var(--lm-fw-bold);
  color: var(--lm-ink); font-variant-numeric: tabular-nums; }
.hf-metric__v.up { color: var(--lm-red-deep); }
.hf-metric__v.down { color: var(--lm-ink-3); }

.hf-tag {
  display: inline-block; padding: 2px 7px; border-radius: var(--lm-r-sm);
  border: 1px solid var(--lm-line); font-size: var(--lm-fs-xxs); line-height: 16px;
  color: var(--lm-ink-3); margin: 2px 4px 0 0;
}
/* Source labels sit on every metric, so they stay neutral: red is reserved for
   the eyebrow, the CTA and the one link per card. */
.hf-tag--label { border-color: var(--lm-line-soft); color: var(--lm-muted);
  background: var(--lm-surface); margin-left: 6px; vertical-align: 1px; }

.hf-qlist { border-top: 1px solid var(--lm-line-soft); padding-top: 10px; }
.hf-q { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; }
.hf-q__k { font-size: var(--lm-fs-xs); color: var(--lm-ink-2); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-q__v { margin-left: auto; font-size: var(--lm-fs-xxs); color: var(--lm-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.hf-q__more { font-size: var(--lm-fs-xxs); color: var(--lm-muted); padding-top: 3px; }

.hf-card__foot { margin-top: auto; padding-top: var(--lm-space-3);
  border-top: 1px solid var(--lm-line-soft); display: flex; align-items: center; gap: 10px; }
.hf-link {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: var(--lm-fs-sm); font-weight: var(--lm-fw-bold); color: var(--lm-coral);
  transition: opacity var(--hf-d-fast) var(--hf-ease-out);
}
.hf-link:active { opacity: .7; }
.hf-cost { margin-left: auto; font-size: var(--lm-fs-xxs); color: var(--lm-muted); }

/* ------------------------------------------------------------------- sheet */
.hf-scrim {
  position: fixed; inset: 0; z-index: 650; max-width: 100vw;
  background: rgba(35,33,40,.42);
  opacity: 0; pointer-events: none;
  transition: opacity var(--hf-d-sheet) var(--hf-ease-out);
}
.hf-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }
.hf-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 651;
  width: min(560px, 100vw); max-width: 100vw; background: var(--lm-white);
  border-left: 1px solid var(--lm-line);
  transform: translateX(100%);
  transition: transform var(--hf-d-sheet) var(--hf-ease-drawer);
  display: flex; flex-direction: column;
}
.hf-sheet[data-open="true"] { transform: translateX(0); visibility: visible; }
.hf-sheet[data-open="false"] { visibility: hidden;
  transition: transform var(--hf-d-sheet) var(--hf-ease-drawer), visibility 0s linear var(--hf-d-sheet); }
.hf-sheet__head {
  padding: var(--lm-space-5) var(--lm-space-6); border-bottom: 1px solid var(--lm-line);
  display: flex; align-items: flex-start; gap: var(--lm-space-3);
}
.hf-sheet__body { flex: 1; overflow-y: auto; padding: var(--lm-space-6);
  -webkit-overflow-scrolling: touch; }
.hf-sheet__tools { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto;
  align-items: center; }
.hf-btn--sm { height: 28px; padding: 0 10px; font-size: var(--lm-fs-xs);
  display: inline-flex; align-items: center; text-decoration: none; }
.hf-btn--sm[disabled] { opacity: .5; cursor: progress; }

.hf-close {
  width: 32px; height: 32px; border-radius: var(--lm-r-sm);
  border: 1px solid var(--lm-line); background: var(--lm-white); cursor: pointer;
  color: var(--lm-ink-3); font-size: 16px; line-height: 1; flex-shrink: 0;
  transition: transform var(--hf-d-press) var(--hf-ease-out);
}
.hf-close:active { transform: scale(0.94); }

.hf-sec { margin-bottom: var(--lm-space-6); }
.hf-sec__h { font-size: var(--lm-fs-xs); font-weight: var(--lm-fw-bold);
  color: var(--lm-red-deep); margin-bottom: var(--lm-space-2); }
.hf-sec ul { margin: 0; padding-left: 18px; }
.hf-sec li { font-size: var(--lm-fs-sm); line-height: 22px; color: var(--lm-ink-2);
  margin-bottom: 6px; word-break: break-word; }
.hf-sec li .ev { display: block; color: var(--lm-muted); font-size: var(--lm-fs-xs); }

.hf-stage { display: flex; gap: var(--lm-space-2); overflow-x: auto; padding-bottom: 6px; }
.hf-stage__col { min-width: 150px; flex: 1; }
.hf-stage__h { font-size: var(--lm-fs-xxs); color: var(--lm-muted);
  margin-bottom: 6px; }
.hf-stage__item { font-size: var(--lm-fs-xs); line-height: 18px; color: var(--lm-ink-2);
  background: var(--lm-surface); border: 1px solid var(--lm-line-soft);
  border-radius: var(--lm-r-sm); padding: 5px 8px; margin-bottom: 4px; word-break: keep-all; }

.hf-path { font-size: var(--lm-fs-xs); line-height: 20px; color: var(--lm-ink-2);
  padding: 6px 0; border-bottom: 1px solid var(--lm-line-soft); }
.hf-path span::after { content: " → "; color: var(--lm-muted); }
.hf-path span:last-child::after { content: ""; }

/* -------------------------------------------------------------------- misc */
.hf-note { background: rgba(234,232,238,.8); border-radius: var(--lm-r-md);
  padding: var(--lm-space-4) var(--lm-space-5); font-size: var(--lm-fs-sm);
  line-height: 22px; color: var(--lm-ink-2); margin-bottom: var(--lm-space-6); }
.hf-empty { text-align: center; padding: 64px 0; color: var(--lm-ink-3); }

.hf-details { border: 1px solid var(--lm-line); border-radius: var(--lm-r-md);
  padding: 10px 16px; }
.hf-details > summary { cursor: pointer; font-size: var(--lm-fs-sm);
  color: var(--lm-ink-2); list-style: none; }
.hf-details > summary::-webkit-details-marker { display: none; }
.hf-details > summary::before { content: "▸ "; color: var(--lm-muted); }
.hf-details[open] > summary::before { content: "▾ "; }
.hf-details > ul { margin-top: 10px; columns: 2; column-gap: 32px; }

.hf-table-wrap { overflow-x: auto; }
.hf-table { width: 100%; border-collapse: collapse; font-size: var(--lm-fs-sm); }
.hf-table th { text-align: left; color: var(--lm-ink-3); font-weight: var(--lm-fw-medium);
  padding: 8px 12px; border-bottom: 1px solid var(--lm-line); font-size: var(--lm-fs-xs); }
.hf-table td { padding: 10px 12px; border-bottom: 1px solid var(--lm-line-soft);
  color: var(--lm-ink-2); }
.hf-table td b { color: var(--lm-ink); }

.hf-runrow { display: flex; align-items: center; gap: var(--lm-space-3);
  padding: 14px 0; border-bottom: 1px solid var(--lm-line-soft); }
.hf-runrow__t { font-size: var(--lm-fs-base); color: var(--lm-ink); word-break: break-word; }
.hf-runrow__m { font-size: var(--lm-fs-xs); color: var(--lm-muted); word-break: break-all; }

.hf-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 700;
  padding: 12px 18px; border-radius: var(--lm-r-md);
  background: var(--lm-charcoal); color: var(--lm-white); font-size: var(--lm-fs-sm);
  box-shadow: var(--lm-shadow);
  transform: translate(-50%, calc(100% + 24px)); opacity: 0;
  transition: transform var(--hf-d-ui) var(--hf-ease-out),
              opacity var(--hf-d-ui) var(--hf-ease-out);
}
.hf-toast[data-open="true"] { transform: translate(-50%, 0); opacity: 1; }

.hf-menu { position: relative; }
.hf-menu__list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 200px; padding: 6px; background: var(--lm-white);
  border: 1px solid var(--lm-line); border-radius: var(--lm-r-md);
  box-shadow: var(--lm-shadow);
  transform-origin: top right; transform: scale(0.96); opacity: 0;
  pointer-events: none;
  transition: transform var(--hf-d-fast) var(--hf-ease-out),
              opacity var(--hf-d-fast) var(--hf-ease-out);
}
.hf-menu__list[data-open="true"] { transform: scale(1); opacity: 1; pointer-events: auto; }
.hf-menu__list a {
  display: block; padding: 8px 10px; border-radius: var(--lm-r-sm);
  font-size: var(--lm-fs-sm); color: var(--lm-ink-2); text-decoration: none;
  transition: background-color 120ms var(--hf-ease-out);
}

/* --------------------------------------------------- hover, gated to mouse */
@media (hover: hover) and (pointer: fine) {
  .hf-card:hover { box-shadow: var(--lm-shadow); border-color: var(--lm-line-strong); }
  .hf-menu__list a:hover { background: var(--lm-line-soft); }
}

/* ------------------------------------------------------------- breakpoints */
@media (max-width: 1024px) {
  .hf-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 600px) {
  /* the market picker shares the GNB right side with the language menu;
     below 600px only the market code fits */
  .hf-select { max-width: 84px; font-size: var(--lm-fs-xs); padding: 0 20px 0 8px; }
  .lm-gnb__in { gap: 8px; }

  .hf-main { padding: var(--lm-space-5) 16px 72px; }
  .hf-hero { margin-bottom: var(--lm-space-5); }
  .hf-hero__h2, .hf-hero__h { font-size: var(--lm-fs-h4); line-height: var(--lm-lh-h4); }

  .hf-fieldset { padding: var(--lm-space-4); }
  .hf-row { gap: 6px; }
  .hf-row__label { flex-basis: 100%; min-width: 0; margin-bottom: 2px; }
  .hf-chip { height: 32px; padding: 0 12px; font-size: var(--lm-fs-xs); }
  .hf-inputrow { flex-wrap: wrap; }
  .hf-inputrow .hf-input { flex: 1 1 100%; }
  .hf-btn--seed { flex: 1 1 100%; }

  .hf-question { padding: var(--lm-space-4); flex-direction: column;
    align-items: stretch; gap: var(--lm-space-3); }
  .hf-question__text { font-size: var(--lm-fs-base); line-height: var(--lm-lh-base); }
  .hf-cta { width: 100%; }

  .hf-resultbar { flex-direction: column; align-items: flex-start;
    gap: var(--lm-space-3); }
  .hf-actions { margin-left: 0; width: 100%; }
  .hf-meta { gap: 4px 12px; font-size: var(--lm-fs-xs); }

  .hf-tabs { overflow-x: auto; scrollbar-width: none; }
  .hf-tabs::-webkit-scrollbar { display: none; }
  .hf-tab { flex: 0 0 auto; padding: 0 10px; font-size: var(--lm-fs-xs); }

  .hf-grid { grid-template-columns: 1fr; }
  .hf-card { padding: var(--lm-space-4) var(--lm-space-5); }
  .hf-card__kw { font-size: var(--lm-fs-lg); line-height: var(--lm-lh-lg); }
  .hf-score__n { font-size: 24px; line-height: 28px; }

  .hf-details > ul { columns: 1; }

  /* On a phone the drill-down is a bottom sheet, and it leaves the way it came. */
  .hf-sheet { left: 0; right: 0; top: auto; width: 100vw; height: 92vh;
    border-left: 0; border-top: 1px solid var(--lm-line);
    border-top-left-radius: var(--lm-r-lg); border-top-right-radius: var(--lm-r-lg);
    transform: translateY(100%); }
  .hf-sheet[data-open="true"] { transform: translateY(0); }
  .hf-sheet__head { padding: var(--lm-space-4); flex-wrap: wrap; }
  .hf-sheet__tools { order: 3; width: 100%; margin-left: 0; }
  .hf-sheet__tools .hf-btn--sm { flex: 1 1 auto; justify-content: center; }
  .hf-sheet__body { padding: var(--lm-space-4); }
  .hf-stage__col { min-width: 132px; }

  .hf-runrow { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hf-runrow .hf-actions { width: 100%; }
  .hf-table { font-size: var(--lm-fs-xs); }
  .hf-table th, .hf-table td { padding: 8px; }

  .hf-toast { left: 16px; right: 16px; bottom: 16px;
    transform: translateY(calc(100% + 16px)); }
  .hf-toast[data-open="true"] { transform: translateY(0); }
}

@media (max-width: 380px) {
  .hf-chip { padding: 0 10px; }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hf-card, .hf-steps li, .hf-sugchip {
    animation: hf-fade 200ms ease forwards; transform: none;
  }
  .hf-sheet { transition: opacity var(--hf-d-ui) ease; }
  .hf-sheet[data-open="false"] { opacity: 0; }
  .hf-chip:active, .hf-btn:active, .hf-cta:active, .hf-close:active,
  .hf-sugchip:active,
  .hf-topicchip:active { transform: none; }
  .hf-toast { transition: opacity var(--hf-d-ui) ease; }
  .hf-spinner { animation-duration: 1.4s; }
}
@keyframes hf-fade { to { opacity: 1; } }

/* entity tab: generic-demand divider */
.hf-subhead {
  margin: 26px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--lm-line);
  font-size: 13px;
  font-weight: 700;
  color: var(--lm-ink-3);
}

/* entity attribution chip on query cards */
.hf-entchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin: -2px 0 10px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--lm-line);
  border-radius: 999px;
  background: var(--lm-line-soft);
  font: inherit;
  font-size: 12px;
  line-height: 16px;
  cursor: pointer;
  transition: background 160ms var(--hf-ease-out), border-color 160ms var(--hf-ease-out);
}
.hf-entchip:hover { background: var(--lm-white); border-color: var(--lm-coral); }
.hf-entchip:active { transform: scale(0.97); }
.hf-entchip__t { color: var(--lm-ink-3); }
.hf-entchip__n { font-weight: 700; color: var(--lm-ink); }
.hf-entchip__c { color: var(--lm-coral); font-weight: 700; }

.hf-card.is-focus {
  box-shadow: 0 0 0 2px var(--lm-coral);
  transition: box-shadow 200ms var(--hf-ease-out);
}
@media (prefers-reduced-motion: reduce) {
  .hf-entchip, .hf-card.is-focus { transition: none; }
}

/* co-query formation (Query Finder) */
.hf-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--lm-line-soft);
  font-size: 12px; line-height: 16px; color: var(--lm-ink-3);
}
.hf-form__l { white-space: nowrap; }
.hf-form__bar {
  flex: 1 1 auto; min-width: 40px; height: 5px; border-radius: 3px;
  background: var(--lm-line-soft); overflow: hidden;
}
.hf-form__fill {
  display: block; height: 100%; border-radius: 3px;
  background: var(--lm-d1);
}
.hf-form__v { white-space: nowrap; color: var(--lm-ink-2); font-weight: 500; }
.hf-form__age { white-space: nowrap; color: var(--lm-ink-3); }
.hf-form__side {
  margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--lm-ink-3);
}

/* ------------------------------------------------- brief / purpose input */
.hf-textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  min-height: 84px; padding: 12px 14px;
  border: 1px solid var(--lm-line-strong); border-radius: var(--lm-r-sm);
  background: var(--lm-white); color: var(--lm-ink);
  font: inherit; font-size: var(--lm-fs-md); line-height: 26px;
  transition: border-color var(--hf-d-fast) var(--hf-ease-out);
}
.hf-textarea:focus { outline: none; border-color: var(--lm-violet); }
.hf-textarea::placeholder { color: var(--lm-muted); }
.hf-briefrow { display: flex; justify-content: flex-end; margin-top: 10px; }

.hf-readback:empty { display: none; }
.hf-readback {
  margin-top: 14px; padding: 16px 18px;
  border: 1px solid var(--lm-line); border-radius: var(--lm-r-sm);
  background: var(--lm-line-soft);
}
.hf-readback__h {
  font-size: 13px; font-weight: 700; color: var(--lm-ink); margin-bottom: 10px;
}
.hf-readback__list { display: grid; gap: 7px; }
.hf-readback__r {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 10px;
  align-items: baseline; font-size: 13px; line-height: 20px;
}
.hf-readback__k { color: var(--lm-ink-3); }
.hf-readback__v { color: var(--lm-ink); font-weight: 500; word-break: keep-all; }
.hf-readback__q { color: var(--lm-muted); font-size: 12px; text-align: right; }
.hf-readback__f {
  margin-top: 12px; font-size: 12px; line-height: 18px; color: var(--lm-ink-3);
}
.hf-readback__u {
  margin-top: 8px; padding-left: 16px; position: relative;
  font-size: 13px; line-height: 20px; color: var(--lm-coral);
}
.hf-readback__u::before { content: "?"; position: absolute; left: 0; font-weight: 700; }

.hf-purposegroups { display: grid; gap: 12px; }
.hf-purposegroup__l { font-size: 11px; font-weight: 700;
  color: var(--lm-muted); margin-bottom: 6px; }
.hf-purposes { display: flex; flex-wrap: wrap; gap: 8px; }
.hf-purpose {
  padding: 8px 15px; border-radius: var(--lm-r-pill);
  border: 1px solid var(--lm-line-strong); background: var(--lm-white);
  font: inherit; font-size: 13px; line-height: 20px; color: var(--lm-ink-2);
  cursor: pointer; text-align: left;
  transition: border-color var(--hf-d-fast) var(--hf-ease-out),
              background-color var(--hf-d-fast) var(--hf-ease-out),
              transform var(--hf-d-press) var(--hf-ease-out);
}
.hf-purpose:hover { border-color: var(--lm-violet); }
.hf-purpose:active { transform: scale(0.98); }
.hf-purpose[aria-pressed="true"] {
  border-color: var(--lm-violet); color: var(--lm-white); background: var(--lm-violet);
  font-weight: 600;
}

/* what the chosen purpose moves - stated, not implied */
.hf-effects { margin-top: 12px; padding: 12px 14px;
  border: 1px dashed var(--lm-line-strong); border-radius: var(--lm-r-sm);
  background: var(--lm-line-soft); }
.hf-effects__none { font-size: 12px; line-height: 19px; color: var(--lm-ink-3); }
.hf-effects__h { font-size: 11px; font-weight: 700;
  color: var(--lm-ink-3); margin-bottom: 8px; }
.hf-effects__list { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hf-effects__i { display: inline-flex; gap: 6px; align-items: baseline;
  font-size: 13px; line-height: 20px; }
.hf-effects__k { color: var(--lm-ink-3); }
.hf-effects__v { color: var(--lm-ink); font-weight: 600; }
.hf-effects__d { margin-top: 9px; font-size: 12px; line-height: 19px;
  color: var(--lm-ink-3); word-break: keep-all; }

.hf-toggle {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 14px;
  cursor: pointer;
}
.hf-toggle input { margin-top: 3px; accent-color: var(--lm-violet); }
.hf-toggle__t { display: block; font-size: 13px; font-weight: 600; color: var(--lm-ink); }
.hf-toggle__d {
  display: block; font-size: 12px; line-height: 19px; color: var(--lm-ink-3);
  margin-top: 2px; word-break: keep-all;
}

/* --------------------------------------------------- numbered steps */
.hf-step__h { display: flex; align-items: center; gap: 10px;
  margin-bottom: var(--lm-space-3); }
.hf-step__h .hf-legend { margin-bottom: 0; }
.hf-step__n {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--lm-red-deep); color: var(--lm-white);
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
/* a folded step: the number and the title stay, plus one line saying what
   opening it does. Folded, not hidden. */
.hf-step__fold {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; padding: 0; font: inherit; cursor: pointer;
  text-align: left;
}
.hf-step__fold .hf-legend { margin-bottom: 0; flex: none; }
.hf-step__fold .hf-step__n { flex: none; }
.hf-step__teaser {
  flex: 1; min-width: 0; font-size: var(--lm-fs-xs); color: var(--lm-ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hf-step__fold[aria-expanded="true"] { margin-bottom: var(--lm-space-3); }

.hf-briefrow { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 10px; }
.hf-briefrow__skip { font-size: 12px; color: var(--lm-muted); }

/* the summary bar: what will run, without unfolding anything */
.hf-summary { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; }
.hf-summary__pills { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 320px; }
.hf-pill { display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 11px; border-radius: var(--lm-r-pill);
  background: var(--lm-line-soft); border: 1px solid var(--lm-line);
  font-size: 13px; line-height: 20px; }
.hf-pill__k { color: var(--lm-ink-3); font-size: 11px; }
.hf-pill__v { color: var(--lm-ink); font-weight: 600; word-break: keep-all; }
.hf-pill--free { border-color: var(--lm-coral); background: var(--lm-white); }
.hf-linkbtn { border: 0; background: none; padding: 0; font: inherit;
  font-size: 13px; color: var(--lm-violet); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.hf-linkbtn:hover { color: var(--lm-coral); }

.hf-details { margin-top: 18px; }
.hf-group + .hf-group { margin-top: 20px; padding-top: 18px;
  border-top: 1px dashed var(--lm-line); }
.hf-group__l { font-size: 12px; font-weight: 700; color: var(--lm-ink-2);
  margin-bottom: 10px; }
.hf-group > .hf-input { width: 100%; box-sizing: border-box; }

/* the category selection is silently ignored while free text is present */
.hf-row[data-overridden="true"] { opacity: .45; }
.hf-override { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding: 8px 11px; border-radius: var(--lm-r-sm);
  background: rgba(255,91,96,.07); border: 1px solid rgba(255,91,96,.28); }
.hf-override__t { font-size: 12px; line-height: 19px; color: var(--lm-ink-2);
  word-break: keep-all; }

/* options fold */
.hf-opts { padding-top: var(--lm-space-4); padding-bottom: var(--lm-space-4); }
.hf-opts__h { display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: none; padding: 0; font: inherit; cursor: pointer;
  text-align: left; }
.hf-opts__h .hf-legend { margin-bottom: 0; flex: none; }
.hf-opts__sum { flex: 1; font-size: 12px; color: var(--lm-ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-opts__c { flex: none; width: 22px; height: 22px; line-height: 20px;
  text-align: center; border: 1px solid var(--lm-line-strong);
  border-radius: 50%; color: var(--lm-ink-3); font-size: 13px; }

/* the cost and the button stay reachable however long the form gets */
.hf-question { border-radius: 0 0 var(--lm-r-md) var(--lm-r-md); }
.hf-question[data-pin="true"] {
  position: fixed; bottom: 0; z-index: 6;
  backdrop-filter: blur(8px); border-top: 1px solid var(--lm-line);
  box-shadow: var(--lm-shadow);
}
.hf-qspacer { height: 0; }

@media (max-width: 640px) {
  .hf-summary__pills { flex-basis: 100%; }
  .hf-readback__r { grid-template-columns: 1fr; gap: 2px; }
  .hf-readback__q { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .hf-textarea, .hf-purpose { transition: none; }
}
.hf-note--warn {
  border-left: 3px solid var(--lm-coral);
  background: var(--lm-white);
}

/* colourways and fits of one model, shown as attributes not as separate cards */
.hf-variants {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 11px; font-size: 12px; line-height: 16px;
}
.hf-variants__l { color: var(--lm-ink-3); margin-right: 3px; }
.hf-vchip {
  padding: 2px 7px; border-radius: 999px;
  background: var(--lm-line-soft); color: var(--lm-ink-2);
}

/* situation lean — the axis that works where demography does not exist */
.hf-ctx {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 11px; font-size: 12px; line-height: 16px;
}
.hf-ctx__l { color: var(--lm-ink-3); margin-right: 2px; }
.hf-ctx__c {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--lm-line); background: var(--lm-white);
}
.hf-ctx__n { color: var(--lm-ink-2); }
.hf-ctx__v { color: var(--lm-coral); font-weight: 700; }

/* which of the three a thing is, and why — stated on the card, not inferred */
.hf-bucket {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
  margin: -2px 0 10px;
}
.hf-bucket__n {
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 17px; font-weight: 700; white-space: nowrap;
}
.hf-bucket__w { font-size: 12px; line-height: 17px; color: var(--lm-ink-3);
  word-break: keep-all; }
/* three mutually exclusive buckets = three data categories, so the data
   layer picks the colors: the emphasis series for surge, d3 and d2 for the
   other two. No new values - all three are tints of palette tokens. */
.hf-bucket[data-b="surge"]    .hf-bucket__n { background: var(--lm-coral-soft); color: var(--lm-red-deep); }
.hf-bucket[data-b="distinct"] .hf-bucket__n { background: rgba(147,151,253,.20); color: var(--lm-ink); }
.hf-bucket[data-b="nascent"]  .hf-bucket__n { background: rgba(140,189,87,.22); color: var(--lm-ink); }
.hf-bucket[data-b="none"]     .hf-bucket__n { background: var(--lm-line-soft);
  color: var(--lm-ink-3); font-weight: 500; }

/* when the thing started being searched, from its own history */
.hf-onset { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: -2px 0 12px; font-size: 12px; line-height: 17px; }
.hf-onset__l { color: var(--lm-muted); }
.hf-onset__v { color: var(--lm-ink-2); font-weight: 700; }
.hf-onset[data-new="true"] .hf-onset__v { color: var(--lm-red-deep); }

/* newcomers with no gender/age split: shown apart, no score */
.hf-newcomers { margin-top: 28px; }
.hf-nclist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px; }
.hf-nc { border: 1px dashed var(--lm-line-strong); border-radius: var(--lm-r-md);
  padding: 14px 16px 6px; background: var(--lm-white); }
.hf-nc__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; }
.hf-nc__k { font-size: 15px; font-weight: 700; color: var(--lm-ink); word-break: keep-all; }
.hf-nc__m { font-size: 12px; color: var(--lm-ink-3); margin: 4px 0 8px; }
.hf-aio { display: inline-block; margin-left: 6px; margin-top: 6px; padding: 2px 8px;
  border-radius: var(--lm-r-sm); font-size: var(--lm-fs-xxs); line-height: 16px;
  border: 1px solid var(--lm-line); color: var(--lm-ink-3); background: var(--lm-white); }
/* "not in AI answers" is news only for a new thing; for the rest it is the
   normal state, so it stays grey */
.hf-aio[data-aio="silent"][data-fresh="true"] { border-color: var(--lm-coral); color: var(--lm-red-deep); }

/* AI Overview evidence: the sentence a topic was read from, and its sources */
.hf-aioevs { display: grid; gap: 14px; }
.hf-aioev__item { border-bottom: 1px solid var(--lm-line-soft); padding-bottom: 12px; }
.hf-aioev__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.hf-aioev__q { font-size: 12px; color: var(--lm-ink-3); }
.hf-quote { margin: 8px 0 6px; padding: 8px 12px; border-left: 2px solid var(--lm-line-strong);
  background: var(--lm-surface); font-size: 13px; line-height: 20px; color: var(--lm-ink-2);
  word-break: keep-all; }
.hf-aioev__src { font-size: 12px; color: var(--lm-muted); }
.hf-aioev__ug { font-size: 12px; color: var(--lm-muted); }
.hf-refs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 12px; }
.hf-refs a { color: var(--lm-ink-3); text-decoration: underline; text-underline-offset: 2px; }
.hf-cardev { margin: 0 0 10px; font-size: 12px; }
.hf-cardev summary { cursor: pointer; color: var(--lm-ink-2); font-weight: 700; }
.hf-via { font-size: 12px; color: var(--lm-ink-3); margin: 0 0 10px; }

/* results list: market filter (Japan and the US open on their own market) */
.hf-runfilter { display: flex; gap: 8px; margin: 0 0 16px; }
/* an endpoint id beside its name in the data tab */
.hf-code { font: 400 12px/16.8px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--lm-muted); }

/* Japanese has no spaces, so keep-all (right for Korean) leaves a whole
   sentence unbreakable and it overflows its box. Japanese breaks normally,
   with the usual kinsoku rules. */
html:lang(ja) *, html:lang(ja) *::before, html:lang(ja) *::after { word-break: normal !important; line-break: strict; }
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) .lm-h1, html:lang(ja) .hf-card__kw {
  word-break: auto-phrase !important; text-wrap: balance; }

/* six-month outlook (forecast.py) */
.hf-fc { display: grid; gap: 2px; font-size: 13px; line-height: 19px; padding: 8px 10px;
  border: 1px solid var(--lm-line-soft, #EAE8EE); border-radius: 8px; background: var(--lm-bg-soft, #FBFAFB); }
.hf-fc__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.hf-fc__l { color: var(--lm-muted); }
.hf-fc__st { font-weight: 700; color: var(--lm-ink-2); }
.hf-fc[data-stage="climbing"] .hf-fc__st { color: #4f7f2a; }
.hf-fc[data-stage="cooling"] .hf-fc__st { color: var(--lm-red-deep); }
.hf-fc__se { font-size: 12px; line-height: 16px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  border: 1px solid #BFA055; color: #7a6326; }
.hf-fc__rates { color: var(--lm-ink-2); }
.hf-fc__r { white-space: nowrap; }
.hf-fc__rng { color: var(--lm-muted); font-size: 12px; line-height: 17px; }
.hf-spark__band { fill: rgba(147,151,253,.22); stroke: #9397FD; stroke-width: .6; }
.hf-spark__mid { stroke: #6a6fd6; stroke-width: 1.4; }
.hf-spark__dash { stroke: #9397FD; stroke-width: 1; stroke-dasharray: 4 4; }
