/* FedM8 Discover (design 003): #/discover, Contracts > Discover. Search workspace, Brief panel and quiet chat rail.
 * Approved look: the Discover mockup canvas (Option6 Sub / Prime / 1099) on design 003 (/design/003/spec.json, tokens.json).
 * Reads only --fm-* tokens: no colour literal, no px/rem font size, no px length (media-query breakpoints excepted).
 * Shared components (fm-btn, fm-segmented, fm-urgency, fm-badge, fm-empty, fm-note, fm-skeleton) come from
 * assets/d3/components.css; this file places them and adds the few Discover-only pieces (rows, band bars, pass meters).
 * Scope: everything sits under body.fd-design .dv so no other page changes. */

body.fd-design .dv.fm-page { padding-inline: 0; padding-block: 0 var(--fm-space-7); }
body.fd-design :is(.dv, .bv) :is(h1, h2, h3, p, ul, ol, li, dl, dd) { margin: 0; }
body.fd-design .dv :is(ul, ol).dv-plain { list-style: none; padding: 0; }
body.fd-design .dv-sr { position: absolute; width: var(--fm-border-width); height: var(--fm-border-width); margin: calc(var(--fm-border-width) * -1); padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body.fd-design svg.dv-ic { width: var(--fm-text-md); height: var(--fm-text-md); flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.fd-design :is(.dv, .bv) :is(button, a, input, select, summary, [tabindex]):focus-visible { outline: calc(var(--fm-border-width) * 2) solid var(--fm-focus-ring); outline-offset: calc(var(--fm-border-width) * 2); }

/* ---------- demo banner (Cloudflare preview only) ---------- */
body.fd-design .dv-demo { margin-bottom: var(--fm-space-3); }

/* ---------- the grid: rail | center | brief | chat ---------- */
body.fd-design .dv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fm-space-4); align-items: start; }
@media (min-width: 1024px) {
  body.fd-design .dv-grid { grid-template-columns: calc(var(--fm-rail-left) - var(--fm-space-8)) minmax(0, 1fr) auto; }
}
@media (min-width: 1280px) {
  body.fd-design .dv-grid[data-brief="open"] { grid-template-columns: calc(var(--fm-rail-left) - var(--fm-space-8)) minmax(0, 1fr) calc(var(--fm-rail-right) + var(--fm-space-8) * 2 + var(--fm-space-1)) auto; }
}

/* ---------- left rail: Top 10, Your recent, Saved ---------- */
body.fd-design .dv-rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fm-space-2); padding: var(--fm-space-3); background: var(--fm-surface); color: var(--fm-ink); border: var(--fm-border-width) solid var(--fm-line); border-radius: var(--fm-radius-lg); }
@media (min-width: 1024px) {
  body.fd-design .dv-rail { position: sticky; top: calc(var(--fm-header-h) + var(--fm-space-3)); max-height: calc(100dvh - var(--fm-header-h) - var(--fm-space-6)); overflow-y: auto; }
}
body.fd-design .dv-rail__sec + .dv-rail__sec { padding-top: var(--fm-space-2); border-top: var(--fm-border-width) solid var(--fm-line); }
body.fd-design .dv-rail__toggle { display: flex; align-items: center; gap: var(--fm-space-2); width: 100%; min-height: var(--fm-tap-min); padding: 0 var(--fm-space-2); border: 0; border-radius: var(--fm-radius-md); background: transparent; color: var(--fm-ink); font-family: var(--fm-font-sans); font-size: var(--fm-text-md); font-weight: var(--fm-weight-semibold); text-align: start; cursor: pointer; }
body.fd-design .dv-rail__toggle:hover { background: var(--fm-surface-alt); }
body.fd-design .dv-rail__chev { margin-inline-start: auto; display: inline-flex; color: var(--fm-ink-3); transition: transform var(--fm-motion-base) var(--fm-ease); }
body.fd-design .dv-rail__toggle[aria-expanded="true"] .dv-rail__chev { transform: rotate(180deg); }
body.fd-design .dv-rail__list { display: grid; gap: var(--fm-space-1); list-style: none; margin: 0; padding: 0; }
body.fd-design .dv-rail__list[hidden] { display: none; }
body.fd-design .dv-rail__item { display: flex; align-items: center; gap: var(--fm-space-2); width: 100%; min-height: var(--fm-tap-min); padding: 0 var(--fm-space-2); border: 0; border-radius: var(--fm-radius-md); background: transparent; color: var(--fm-ink); font-family: var(--fm-font-sans); font-size: var(--fm-text-md); font-weight: var(--fm-weight-medium); text-align: start; cursor: pointer; }
body.fd-design .dv-rail__item:hover { background: var(--fm-surface-alt); }
body.fd-design .dv-rail__item[aria-current="true"] { background: var(--fm-row-selected-bg); color: var(--fm-row-selected-ink); font-weight: var(--fm-weight-bold); }
body.fd-design .dv-rail__n { display: inline-grid; place-items: center; flex: none; width: var(--fm-space-6); height: var(--fm-space-6); border-radius: var(--fm-radius-pill); background: var(--fm-info-soft); color: var(--fm-ink-2); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-bold); }
body.fd-design .dv-rail__q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.fd-design .dv-rail__count { flex: none; color: var(--fm-ink-3); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-regular); }
body.fd-design .dv-rail__note { padding: var(--fm-space-1) var(--fm-space-2); color: var(--fm-ink-3); font-size: var(--fm-text-sm); line-height: 1.4; }
body.fd-design .dv-rail__note a { color: var(--fm-ink); font-weight: var(--fm-weight-semibold); }

/* ---------- center: heading, search form, Looking as, pass panel ---------- */
body.fd-design .dv-center { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fm-space-4); min-width: 0; }
body.fd-design .dv-h1 { font-size: var(--fm-text-2xl); line-height: 1.2; font-weight: var(--fm-weight-bold); color: var(--fm-ink); }
body.fd-design .dv-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-space-2); padding: var(--fm-space-2); background: var(--fm-surface); border: var(--fm-border-width) solid var(--fm-line); border-radius: var(--fm-radius-lg); }
body.fd-design .dv-form__words { display: flex; align-items: center; gap: var(--fm-space-2); flex: 1 1 calc(var(--fm-space-8) * 7); min-width: 0; padding-inline-start: var(--fm-space-2); color: var(--fm-ink-3); }
body.fd-design .dv-form__words svg.dv-ic { width: var(--fm-text-lg); height: var(--fm-text-lg); }
body.fd-design .dv-form__input { flex: 1; min-width: 0; min-height: var(--fm-tap-min); padding: 0; border: 0; background: transparent; color: var(--fm-ink); font-family: var(--fm-font-sans); font-size: var(--fm-text-lg); }
body.fd-design .dv-form__input::placeholder { color: var(--fm-ink-3); opacity: 1; }
body.fd-design .dv-form__input:focus-visible { outline: 0; }
body.fd-design .dv-form__words:focus-within { outline: calc(var(--fm-border-width) * 2) solid var(--fm-focus-ring); outline-offset: calc(var(--fm-border-width) * 2); border-radius: var(--fm-radius-md); }
body.fd-design .dv-form .fm-select { border-radius: var(--fm-radius-md); }
body.fd-design .dv-form .fm-btn--primary { border-radius: var(--fm-radius-md); padding-inline: var(--fm-space-6); }
body.fd-design .dv-form__hint { flex: 1 1 100%; padding-inline: var(--fm-space-2); color: var(--fm-ink-3); font-size: var(--fm-text-sm); }
/* When the center column is narrow (the Brief open beside it, or a smaller screen) the words take their own line and
   Source, Status, Show and Search share the next one. */
body.fd-design .dv-grid[data-brief="open"] .dv-form__words { flex-basis: 100%; }
@media (max-width: 1279px) { body.fd-design .dv-form__words { flex-basis: 100%; } }
body.fd-design .dv-form__hint:empty { display: none; }

body.fd-design .dv-controls { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--fm-space-4); }
body.fd-design .dv-lens { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-space-3); min-height: var(--fm-tap-min); }
body.fd-design .dv-lens__label { color: var(--fm-ink-3); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-semibold); }

body.fd-design .dv-pass { flex: 1 1 calc(var(--fm-space-8) * 8.75); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fm-space-3); min-width: 0; padding: var(--fm-space-3) var(--fm-space-4); background: var(--fm-surface); border: var(--fm-border-width) solid var(--fm-line); border-radius: var(--fm-radius-lg); }
body.fd-design .dv-pass__h { font-size: var(--fm-text-sm); font-weight: var(--fm-weight-semibold); color: var(--fm-ink); }
body.fd-design .dv-pass__meters { display: flex; flex-wrap: wrap; gap: var(--fm-space-5); }
body.fd-design .dv-pass__meter { flex: 1 1 calc(var(--fm-space-8) * 3); display: grid; gap: var(--fm-space-1); min-width: 0; }
body.fd-design .dv-pass__name { font-size: var(--fm-text-sm); font-weight: var(--fm-weight-semibold); color: var(--fm-ink); }
body.fd-design .dv-pass__line { font-size: var(--fm-text-sm); color: var(--fm-ink-3); }
body.fd-design progress.dv-meter { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: calc(var(--fm-space-1) + var(--fm-space-1) / 2); border: 0; border-radius: var(--fm-radius-pill); background: var(--fm-line); overflow: hidden; }
body.fd-design progress.dv-meter::-webkit-progress-bar { background: var(--fm-line); border-radius: var(--fm-radius-pill); }
body.fd-design progress.dv-meter::-webkit-progress-value { background: var(--fm-ink-2); border-radius: var(--fm-radius-pill); transition: width var(--fm-motion-base) var(--fm-ease); }
body.fd-design progress.dv-meter::-moz-progress-bar { background: var(--fm-ink-2); border-radius: var(--fm-radius-pill); }
body.fd-design .dv-status { display: flex; align-items: center; gap: var(--fm-space-2); color: var(--fm-ink-3); font-size: var(--fm-text-sm); line-height: 1.4; }
body.fd-design .dv-status__dot { flex: none; width: var(--fm-space-2); height: var(--fm-space-2); border-radius: var(--fm-radius-pill); background: var(--fm-ink-2); }
body.fd-design .dv-status__dot[hidden], body.fd-design .dv-status__done[hidden] { display: none; }
body.fd-design .dv-status__done { display: inline-flex; color: var(--fm-success); }
body.fd-design .dv-status[data-state="error"] { color: var(--fm-urgent); }
body.fd-design .dv-pass__note { font-size: var(--fm-text-sm); line-height: 1.4; color: var(--fm-ink-2); }
body.fd-design .dv-pass__note[hidden] { display: none; }

/* ---------- results ---------- */
body.fd-design .dv-results__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-space-2) var(--fm-space-3); margin-top: var(--fm-space-1); }
body.fd-design .dv-results__title { font-size: var(--fm-text-lg); line-height: 1.3; font-weight: var(--fm-weight-bold); color: var(--fm-ink); overflow-wrap: anywhere; }
body.fd-design .dv-results__sub { font-size: var(--fm-text-sm); color: var(--fm-ink-3); }
body.fd-design .dv-results__save { margin-inline-start: auto; }
body.fd-design .dv-results__note { flex: 1 1 100%; }
body.fd-design .dv-results { position: relative; background: var(--fm-surface); border: var(--fm-border-width) solid var(--fm-line); border-radius: var(--fm-radius-lg); overflow: hidden; }
body.fd-design .dv-results[hidden] { display: none; }
body.fd-design .dv-results__cols { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-space-3); padding: var(--fm-space-2) var(--fm-space-4); background: var(--fm-surface-alt); color: var(--fm-ink-3); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-semibold); }
body.fd-design .dv-results__cols > :nth-child(1) { flex: 0 0 var(--fm-space-7); }
body.fd-design .dv-results__cols > :nth-child(2) { flex: 1 1 calc(var(--fm-space-8) * 5); padding-inline-start: var(--fm-tap-min); }
body.fd-design .dv-results__cols > :nth-child(3) { flex: 0 0 calc(var(--fm-space-8) * 4); }
body.fd-design .dv-list { list-style: none; margin: 0; padding: 0; }
body.fd-design .dv-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-space-3); min-height: calc(var(--fm-tap-min) + var(--fm-space-5)); padding: var(--fm-space-2) var(--fm-space-4); border-top: var(--fm-border-width) solid var(--fm-line); background: var(--fm-surface); color: var(--fm-ink); }
body.fd-design .dv-row[data-selected="true"] { background: var(--fm-row-selected-bg); color: var(--fm-row-selected-ink); }
body.fd-design .dv-row[data-selected="true"] .dv-row__title { font-weight: var(--fm-weight-bold); }
body.fd-design .dv-row__rank { flex: 0 0 var(--fm-space-7); color: var(--fm-ink-3); font-size: var(--fm-text-md); font-weight: var(--fm-weight-bold); font-variant-numeric: tabular-nums; }
body.fd-design .dv-row__type { display: inline-grid; place-items: center; flex: none; width: calc(var(--fm-space-7)); height: calc(var(--fm-space-7)); border-radius: var(--fm-radius-sm); background: var(--fm-info-soft); color: var(--fm-ink-2); }
body.fd-design .dv-row__type svg.dv-ic { width: var(--fm-text-lg); height: var(--fm-text-lg); }
/* minmax(0, 1fr): a long title or summary ellipsises inside its column instead of widening the track under the Match|M8 column. */
body.fd-design .dv-row__main { flex: 1 1 calc(var(--fm-space-8) * 5); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fm-space-1); min-width: 0; }
body.fd-design .dv-row__title { display: flex; align-items: center; width: 100%; min-height: var(--fm-tap-min); padding: 0; border: 0; background: none; color: inherit; font-family: var(--fm-font-sans); font-size: var(--fm-text-md); font-weight: var(--fm-weight-semibold); text-align: start; cursor: pointer; }
body.fd-design .dv-row__title > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.fd-design .dv-row__title:hover > span { text-decoration: underline; }
body.fd-design .dv-row__tldr { display: flex; align-items: center; gap: var(--fm-space-2); min-width: 0; font-size: var(--fm-text-sm); color: var(--fm-ink-2); }
body.fd-design .dv-row__tldr > .dv-row__tldr-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.fd-design .dv-row__tldr[data-ready="false"] { color: var(--fm-ink-3); }
body.fd-design .dv-ai { flex: none; padding: 0 var(--fm-space-2); border-radius: var(--fm-radius-sm); background: var(--fm-accent-soft); color: var(--fm-accent-ink); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-semibold); }
body.fd-design .dv-row__meta { font-size: var(--fm-text-sm); color: var(--fm-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.fd-design .dv-row[data-selected="true"] .dv-row__meta { color: var(--fm-ink-2); }
body.fd-design .dv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-space-1) var(--fm-space-2); list-style: none; margin: 0; padding: var(--fm-space-1) 0; }
body.fd-design .dv-chips:empty { display: none; }
body.fd-design .dv-chip { display: inline-flex; align-items: center; gap: var(--fm-space-1); min-height: calc(var(--fm-space-6) + var(--fm-space-1)); padding: 0 var(--fm-space-3); border: var(--fm-border-width) solid var(--fm-line-strong); border-radius: var(--fm-radius-pill); background: transparent; color: var(--fm-ink-2); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-medium); white-space: nowrap; }
body.fd-design .dv-chip svg.dv-ic { width: var(--fm-text-sm); height: var(--fm-text-sm); }
/* A long chip (a package name, the words a notice mentions) ends with an ellipsis instead of widening the row. */
body.fd-design .dv-chip { max-width: 100%; }
body.fd-design .dv-chip__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.fd-design .dv-chip[data-kind="plain"] { padding: 0; border-color: transparent; color: var(--fm-ink-3); font-weight: var(--fm-weight-regular); }
body.fd-design .dv-chip[data-kind="ok"] { border-color: transparent; background: var(--fm-success-soft); color: var(--fm-success); }
body.fd-design .dv-chip[data-kind="warn"] { border-color: transparent; background: var(--fm-warn-soft); color: var(--fm-warn); }
body.fd-design .dv-chip[data-kind="info"] { border-color: transparent; background: var(--fm-info-soft); color: var(--fm-ink-2); }
body.fd-design .dv-chip[data-kind="no"] { color: var(--fm-ink-3); }
body.fd-design .dv-row__counts { display: flex; flex-wrap: wrap; gap: var(--fm-space-1) var(--fm-space-3); font-size: var(--fm-text-sm); color: var(--fm-ink-2); }
body.fd-design .dv-row__counts:empty { display: none; }
body.fd-design .dv-row__counts > span { display: inline-flex; align-items: center; gap: var(--fm-space-1); }
body.fd-design .dv-row__counts > span[hidden] { display: none; }
body.fd-design .dv-row__side { flex: 0 0 calc(var(--fm-space-8) * 4); display: grid; justify-items: start; gap: var(--fm-space-2); }
body.fd-design .dv-band { display: inline-flex; align-items: center; gap: var(--fm-space-2); color: var(--fm-ink-2); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-semibold); }
body.fd-design .dv-bars { display: inline-flex; gap: calc(var(--fm-border-width) * 2); }
body.fd-design .dv-bars > span { width: calc(var(--fm-space-1) + var(--fm-border-width)); height: calc(var(--fm-space-3) + var(--fm-space-1) / 2); border-radius: calc(var(--fm-border-width) * 2); background: var(--fm-line); }
body.fd-design .dv-bars > span[data-on] { background: var(--fm-ink-2); }
body.fd-design .dv-due { display: inline-flex; align-items: center; gap: var(--fm-space-1); min-height: calc(var(--fm-space-6) + var(--fm-space-1)); padding-inline: var(--fm-space-3); }
body.fd-design .dv-due svg.dv-ic { width: var(--fm-text-sm); height: var(--fm-text-sm); }
body.fd-design .dv-price { display: inline-flex; align-items: center; padding: 0 var(--fm-space-3); border: var(--fm-border-width) solid var(--fm-line); border-radius: var(--fm-radius-pill); color: var(--fm-ink); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-semibold); white-space: nowrap; }
body.fd-design .dv-price[hidden] { display: none; }
body.fd-design .dv-row__brief { border-radius: var(--fm-radius-md); }
body.fd-design .dv-row__brief[aria-expanded="true"] { background: var(--fm-surface-alt); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-reduce-motion="true"]) body.fd-design .dv-row[data-new] { animation: dv-in calc(var(--fm-motion-base) + var(--fm-motion-fast)) var(--fm-ease) both; }
  :root:not([data-reduce-motion="true"]) body.fd-design .dv-pulse { animation: dv-pulse calc(var(--fm-motion-base) * 6) var(--fm-ease) infinite; }
}
@keyframes dv-in { from { opacity: 0; transform: translateY(var(--fm-space-2)); } to { opacity: 1; transform: none; } }
@keyframes dv-pulse { 50% { opacity: .4; } }
body.fd-design .dv-skel { display: flex; align-items: center; gap: var(--fm-space-3); min-height: calc(var(--fm-tap-min) + var(--fm-space-5)); padding: var(--fm-space-2) var(--fm-space-4); border-top: var(--fm-border-width) solid var(--fm-line); }
body.fd-design .dv-skel[hidden] { display: none; }
body.fd-design .dv-skel__gap { flex: 0 0 var(--fm-space-7); }
body.fd-design .dv-skel__box { flex: none; width: var(--fm-space-7); height: var(--fm-space-7); border-radius: var(--fm-radius-sm); }
body.fd-design .dv-skel__lines { flex: 1; display: grid; gap: var(--fm-space-2); }
body.fd-design .dv-empty { margin: 0; }
body.fd-design .dv-empty[hidden] { display: none; }

/* ---------- Brief panel (right column; drawer under 1280; full-screen bottom sheet at 480 and below) ---------- */
body.fd-design .dv-brief { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0; min-width: 0; padding: var(--fm-space-4) var(--fm-space-5) var(--fm-space-6); background: var(--fm-surface); color: var(--fm-ink); border: var(--fm-border-width) solid var(--fm-line); border-radius: var(--fm-radius-lg); }
body.fd-design .dv-brief[hidden] { display: none; }
@media (min-width: 1280px) {
  body.fd-design .dv-brief { position: sticky; top: calc(var(--fm-header-h) + var(--fm-space-3)); max-height: calc(100dvh - var(--fm-header-h) - var(--fm-space-6)); overflow-y: auto; }
}
@media (max-width: 1279px) {
  body.fd-design .dv-brief { position: fixed; z-index: 85; inset-block: var(--fm-header-h) 0; inset-inline-end: 0; width: min(100%, calc(var(--fm-rail-right) + var(--fm-space-8) * 2 + var(--fm-space-1))); overflow-y: auto; border-radius: var(--fm-radius-lg) 0 0 var(--fm-radius-lg); box-shadow: var(--fm-shadow-2); }
}
/* A bottom sheet: anchored to the bottom edge with the page dimmed above it (the dim is design 003's dialog backdrop). */
@media (max-width: 480px) {
  body.fd-design .dv-brief { z-index: 95; inset: auto 0 0 0; width: 100%; max-height: calc(100dvh - var(--fm-space-8)); border-radius: var(--fm-radius-xl) var(--fm-radius-xl) 0 0; padding-bottom: calc(var(--fm-space-7) + env(safe-area-inset-bottom)); box-shadow: var(--fm-shadow-2), 0 0 0 100vmax color-mix(in srgb, var(--fm-ink) 45%, transparent); }
  :root:not([data-reduce-motion="true"]) body.fd-design .dv-brief[data-sheet] { animation: dv-sheet calc(var(--fm-motion-base) + var(--fm-motion-fast)) var(--fm-ease) both; }
}
@media (prefers-reduced-motion: reduce) { body.fd-design .dv-brief[data-sheet] { animation: none; } }
@keyframes dv-sheet { from { transform: translateY(var(--fm-space-8)); opacity: 0; } to { transform: none; opacity: 1; } }
:root.dv-sheet-open, :root.dv-sheet-open body { overflow: hidden; }
body.fd-design .dv-brief__top { display: flex; align-items: center; gap: var(--fm-space-2); margin-bottom: var(--fm-space-2); }
body.fd-design .dv-brief__label { color: var(--fm-ink-3); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-bold); }
body.fd-design .dv-brief__full { margin-inline-start: auto; border-radius: var(--fm-radius-md); }
body.fd-design .dv-brief__close { display: inline-grid; place-items: center; flex: none; width: var(--fm-tap-min); height: var(--fm-tap-min); padding: 0; border: 0; border-radius: var(--fm-radius-md); background: transparent; color: var(--fm-ink-3); cursor: pointer; }
body.fd-design .dv-brief__close:hover { background: var(--fm-surface-alt); color: var(--fm-ink); }
body.fd-design .dv-brief__sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fm-space-2); padding: var(--fm-space-3) 0; border-top: var(--fm-border-width) solid var(--fm-line); }
body.fd-design .dv-brief__sec:first-of-type { border-top: 0; padding-top: 0; }
body.fd-design .dv-brief__sec[hidden] { display: none; }
body.fd-design .dv-brief__title { font-size: var(--fm-text-lg); line-height: 1.35; font-weight: var(--fm-weight-bold); color: var(--fm-ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
body.fd-design .dv-brief__title:focus { outline: 0; }
body.fd-design .dv-brief__title:focus-visible { outline: calc(var(--fm-border-width) * 2) solid var(--fm-focus-ring); outline-offset: calc(var(--fm-border-width) * 2); }
body.fd-design .dv-brief__h { font-size: var(--fm-text-md); font-weight: var(--fm-weight-bold); color: var(--fm-ink); }
body.fd-design .dv-brief__meta { font-size: var(--fm-text-sm); color: var(--fm-ink-3); overflow-wrap: anywhere; }
body.fd-design .dv-brief__facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fm-space-2); }
body.fd-design .dv-brief__text { font-size: var(--fm-text-md); line-height: 1.5; color: var(--fm-ink-2); overflow-wrap: anywhere; }
body.fd-design .dv-brief__note { font-size: var(--fm-text-sm); color: var(--fm-ink-3); }
body.fd-design .dv-brief__note:empty { display: none; }
body.fd-design .dv-kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fm-space-1); }
body.fd-design .dv-kv__k { font-size: var(--fm-text-sm); color: var(--fm-ink-3); }
body.fd-design .dv-kv__v { font-size: var(--fm-text-md); color: var(--fm-ink); overflow-wrap: anywhere; }
body.fd-design .dv-kv__v[data-empty] { color: var(--fm-ink-3); }
body.fd-design .dv-req { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--fm-space-3); font-size: var(--fm-text-md); }
body.fd-design .dv-req > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
body.fd-design .dv-pkg { display: flex; align-items: center; gap: var(--fm-space-3); min-height: calc(var(--fm-space-6) + var(--fm-space-1)); font-size: var(--fm-text-md); }
body.fd-design .dv-pkg__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
body.fd-design .dv-pkg__share { flex: none; color: var(--fm-ink-3); font-size: var(--fm-text-sm); }
body.fd-design .dv-pkg__tag { flex: 0 0 calc(var(--fm-space-8) + var(--fm-space-5)); display: flex; justify-content: flex-end; }
body.fd-design .dv-tag { display: inline-flex; align-items: center; padding: 0 var(--fm-space-3); border: var(--fm-border-width) solid var(--fm-line-strong); border-radius: var(--fm-radius-pill); color: var(--fm-ink-2); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-semibold); white-space: nowrap; }
body.fd-design .dv-tag[data-cover="you"] { border-color: transparent; background: var(--fm-success-soft); color: var(--fm-success); }
body.fd-design .dv-tag[data-cover="teammate"] { border-color: transparent; background: var(--fm-info-soft); color: var(--fm-ink-2); }
body.fd-design .dv-people { display: flex; align-items: center; gap: var(--fm-space-2); color: var(--fm-ink-2); font-size: var(--fm-text-sm); }
body.fd-design .dv-signal[hidden] { display: none; }
body.fd-design .dv-brief__acts { display: flex; flex-wrap: wrap; gap: var(--fm-space-2); }
body.fd-design .dv-brief__acts .fm-btn { border-radius: var(--fm-radius-md); }
body.fd-design .dv-brief__links { display: grid; justify-items: start; }
body.fd-design .dv-link { display: inline-flex; align-items: center; gap: var(--fm-space-1); min-height: var(--fm-tap-min); color: var(--fm-ink); font-size: var(--fm-text-md); font-weight: var(--fm-weight-semibold); text-underline-offset: var(--fm-space-1); }
body.fd-design .dv-link--quiet { color: var(--fm-ink-3); font-size: var(--fm-text-sm); font-weight: var(--fm-weight-regular); }
body.fd-design .dv-link:hover { color: var(--fm-accent-ink); }
body.fd-design .dv-say { font-size: var(--fm-text-sm); color: var(--fm-ink-2); }
body.fd-design .dv-say:empty { display: none; }
body.fd-design .dv-say a { color: var(--fm-ink); font-weight: var(--fm-weight-semibold); }

/* ---------- quiet chat rail (collapsed by default, muted) ---------- */
body.fd-design .dv-chat { display: flex; align-items: stretch; min-width: 0; background: var(--fm-surface-alt); border: var(--fm-border-width) solid var(--fm-line); border-radius: var(--fm-radius-lg); color: var(--fm-ink-2); }
@media (min-width: 1024px) {
  body.fd-design .dv-chat { position: sticky; top: calc(var(--fm-header-h) + var(--fm-space-3)); }
  body.fd-design .dv-chat[data-open="true"] { width: calc(var(--fm-rail-right) - var(--fm-space-5)); max-height: calc(100dvh - var(--fm-header-h) - var(--fm-space-6)); }
}
body.fd-design .dv-chat__closed { display: flex; flex-direction: column; align-items: center; gap: var(--fm-space-2); padding: var(--fm-space-3); }
body.fd-design .dv-chat__closed[hidden] { display: none; }
@media (max-width: 1023px) { body.fd-design .dv-chat__closed { flex-direction: row; } }
body.fd-design .dv-chat__open { display: grid; grid-template-rows: auto minmax(0, 1fr); width: 100%; min-width: 0; }
body.fd-design .dv-chat__open[hidden] { display: none; }
body.fd-design .dv-chat__btn { position: relative; display: inline-grid; place-items: center; width: var(--fm-tap-min); height: var(--fm-tap-min); padding: 0; border: var(--fm-border-width) solid var(--fm-line); border-radius: var(--fm-radius-md); background: transparent; color: var(--fm-ink-3); cursor: pointer; }
body.fd-design .dv-chat__btn svg.dv-ic { width: var(--fm-text-lg); height: var(--fm-text-lg); }
body.fd-design .dv-chat__btn:hover { background: var(--fm-surface); color: var(--fm-ink); }
body.fd-design .dv-chat__word { color: var(--fm-ink-3); font-size: var(--fm-text-sm); }
body.fd-design .dv-chat__head { display: flex; align-items: center; gap: var(--fm-space-2); padding: var(--fm-space-2) var(--fm-space-2) var(--fm-space-2) var(--fm-space-4); border-bottom: var(--fm-border-width) solid var(--fm-line); }
body.fd-design .dv-chat__title { font-size: var(--fm-text-md); font-weight: var(--fm-weight-bold); color: var(--fm-ink); }
body.fd-design .dv-chat__where { min-width: 0; color: var(--fm-ink-3); font-size: var(--fm-text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.fd-design .dv-chat__collapse { margin-inline-start: auto; display: inline-grid; place-items: center; flex: none; width: var(--fm-tap-min); height: var(--fm-tap-min); padding: 0; border: 0; border-radius: var(--fm-radius-md); background: transparent; color: var(--fm-ink-3); cursor: pointer; }
body.fd-design .dv-chat__body { min-height: 0; overflow-y: auto; padding: var(--fm-space-3); }
body.fd-design .dv-chat__body .dv-say { padding: var(--fm-space-2) 0; }
/* One amber per screen: Search is the screen's primary action, so the room's Post button reads as secondary here. */
body.fd-design.fd-design .dv-chat .fr-room .fr-btn.primary { background: var(--fm-surface); border-color: var(--fm-ink); color: var(--fm-ink); }
body.fd-design.fd-design .dv-chat .fr-room .fr-btn.primary:hover { background: var(--fm-surface-alt); }

/* ---------- narrow screens: panes stack ---------- */
@media (max-width: 760px) {
  body.fd-design .dv-row__side { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; }
  body.fd-design .dv-results__cols { display: none; }
  body.fd-design .dv-row__rank { flex-basis: auto; }
  body.fd-design .dv-results__save { margin-inline-start: 0; }
  body.fd-design .dv-form .fm-select { flex: 1 1 calc(var(--fm-space-8) * 2); }
  body.fd-design .dv-form .fm-btn--primary { flex: 1 1 100%; }
}
