/* T-012 "What parents ask for" (dm-*), a preview on Providers. Tokens only, so light and dark both work. */

/* ───────── Preview label (tab, drawer button) ───────── */
.dm-preview {
  display: inline-flex; align-items: center; height: 17px; padding: 0 6px; margin-left: 6px; vertical-align: 1px;
  border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn-text);
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
}
.dm-months { flex: none; }
.dm-preview-phone { display: none; }
.dm-tab-short { display: none; }

/* ───────── Card ───────── */
.dm .card-scroll { display: flex; flex-direction: column; gap: 16px; }
.dm-lead {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line);
}
.dm-lead p { margin: 0; flex: 1; min-width: 0; font-size: var(--t-base); color: var(--ink); text-wrap: pretty; }
.dm-lead-ico { flex: none; display: inline-flex; color: var(--c1); }
.dm-lead .btn { flex: none; }
.dm-head .card-title p { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ───────── Heat table: services × districts, one measure (asks), sequential colour + the number ───────── */
.dm-heat-wrap { overflow-x: auto; margin: 0 -2px; padding: 2px; }
.dm-heat { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 760px; table-layout: fixed; font-size: var(--t-sm); }
.dm-heat th { font-weight: 500; color: var(--ink-3); font-size: var(--t-xs); line-height: 1.25; padding: 4px 2px; vertical-align: bottom; text-align: center; overflow-wrap: anywhere; }
.dm-heat th[scope="row"] { text-align: left; color: var(--ink-2); vertical-align: middle; padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-heat .dm-corner { text-align: left; width: 124px; }
.dm-heat td { padding: 0; }
.dm-cell {
  width: 100%; min-height: 36px; border-radius: var(--r-xs); font: inherit; font-variant-numeric: tabular-nums; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 1px; cursor: pointer;
  transition: box-shadow var(--t-fast) var(--ease-std), transform var(--t-fast) var(--ease-std);
}
.dm-cell.l0 { background: var(--seq-0); color: var(--ink-3); font-weight: 400; }
.dm-cell.l1 { background: var(--seq-1); color: var(--ink); }
.dm-cell.l2 { background: var(--seq-2); color: var(--ink); }
.dm-cell.l3 { background: var(--seq-3); color: var(--ink); }
.dm-cell.l4 { background: var(--seq-4); color: #fff; }
.dm-cell.l5 { background: var(--seq-5); color: #fff; }
@media (hover: hover) { .dm-cell:hover { box-shadow: 0 0 0 2px var(--ink); } }
.dm-cell:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus, var(--brand)); }
.dm-few { font-weight: 700; margin-left: 1px; }
.dm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 10px; font-size: var(--t-xs); }
.dm-legend .seq-legend { margin: 0; }
.dm-few-key { font-weight: 700; color: var(--ink); }
.dm-table-wrap { overflow-x: auto; }
.dm-num { min-height: 28px; padding: 0 6px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.dm-basis { margin: 0; font-size: var(--t-xs); color: var(--ink-3); }
.dm-nc { display: inline-flex; align-items: center; gap: 4px; color: var(--warn-text); }

/* Phone: the ranked list instead of the table, so the page never scrolls sideways */
.dm-phone { display: none; }
.dm-phone-title { margin: 0 0 6px; font-size: var(--t-sm); font-weight: 600; }
.dm-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dm-top-row {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px;
  border-bottom: 1px solid var(--line); text-align: left; font: inherit; color: inherit;
}
.dm-top li:last-child .dm-top-row { border-bottom: 0; }
.dm-rank { flex: none; width: 22px; color: var(--ink-3); font-size: var(--t-xs); }
.dm-top-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-top-main b { font-weight: 600; font-size: var(--t-sm); }
.dm-top-main small, .dm-top-n small { color: var(--ink-3); font-size: var(--t-xs); }
.dm-top-n { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.dm-top-row > .ico { flex: none; color: var(--ink-3); }

/* ───────── Gap list and "Loved but little known" ───────── */
.dm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; align-items: start; }
.dm-block { min-width: 0; }
.dm-block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.dm-block-head h4 { margin: 0; font-size: var(--t-sm); font-weight: 600; }
.dm-block-head h4:focus { outline: none; }
.dm-empty { font-size: var(--t-sm); margin: 6px 0 0; }
.dm-gaps, .dm-loved { list-style: none; margin: 0; padding: 0; }
.dm-gaps li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.dm-gaps li:last-child { border-bottom: 0; }
.dm-gap-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; text-align: left; font: inherit; color: inherit; border-radius: var(--r-xs); }
@media (hover: hover) { .dm-gap-row:hover .dm-gap-name b { text-decoration: underline; text-underline-offset: 3px; } }
.dm-gap-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-gap-name b { font-weight: 600; font-size: var(--t-sm); }
.dm-gap-name small { color: var(--ink-3); font-size: var(--t-xs); }
.dm-gap-n { flex: none; font-size: var(--t-xs); color: var(--ink-3); }
.dm-gap-n b { font-size: var(--t-sm); color: var(--ink); }
.dm-gap-on { flex: none; font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; }
.dm-gap-row svg { flex: none; }
.dm-find { flex: none; font-size: var(--t-xs); }
.dm-filter { margin-bottom: 6px; }
.dm-filter .chip { gap: 4px; padding-right: 2px; }
.dm-filter-x { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: var(--ink-3); }
.dm-filter-x:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.dm-cand { padding: 10px 0; border-bottom: 1px solid var(--line); }
.dm-cand:last-child { border-bottom: 0; }
.dm-cand-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dm-cand-name { min-width: 0; display: flex; flex-direction: column; }
.dm-cand-name b { font-weight: 600; font-size: var(--t-sm); }
.dm-cand-name small { color: var(--ink-3); font-size: var(--t-xs); }
.dm-cand-top .chip, .dm-sign { flex: none; }
.dm-cand-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: var(--t-xs); color: var(--ink-2); }
.dm-cand-meta .dm-num { min-height: 24px; padding: 0; font-weight: 500; color: var(--ink-2); }
.dm-unsure { color: var(--ink-3); }
.dm-seeded { height: 22px; font-size: 11px; }
.dm-quote { margin: 6px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--line-2); font-size: var(--t-sm); color: var(--ink-2); }
.dm-quote .vi { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--ink-3); font-style: italic; }

/* ───────── Drawer: posts behind a number, evidence sheet ───────── */
.dm-posts { list-style: none; margin: 0; padding: 0; }
.dm-posts .quote { display: block; }
.dm-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-size: var(--t-xs); }
.dm-post-en { display: block; }
.dm-post-seeded { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.dm-typical { margin: 4px 0 0; color: var(--ink-2); font-size: var(--t-sm); }
.dm-paper { padding: 16px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); }
.dm-paper h3 { margin: 4px 0 10px; font-family: var(--f-display); font-size: var(--t-lg); font-weight: 500; }
.dm-sheet-lines { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: var(--t-sm); color: var(--ink); }
.dm-sheet-quotes { margin-top: 12px; }
.dm-sheet-foot { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: var(--t-xs); color: var(--ink-2); }
.dm-small { font-size: var(--t-xs); margin: 8px 0 0; }

@media (max-width: 1099px) {
  .dm-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .dm-desk, .dm-table-toggle { display: none; }
  .dm-phone { display: block; }
  .dm-lead { flex-wrap: wrap; }
  .dm-lead p { flex-basis: calc(100% - 40px); }
  .dm-lead .btn { margin-left: 36px; }
  .dm-gap-row svg, .dm-gap-on { display: none; }
  .dm-preview-phone { display: inline-flex; }
  [data-seg="providerTab"] .dm-preview { display: none; }
  [data-seg="providerTab"] > button { padding-inline: 7px; } /* four tabs fit at 375 px (T-018 adds Not signing) */
  [data-seg="providerTab"] .dm-tab-long { display: none; }
  [data-seg="providerTab"] .dm-tab-short { display: inline; }
}

/* Dark: the ramp runs dark → light, so the two strongest steps carry dark text */
:root[data-theme="dark"] .dm-cell.l4, :root[data-theme="dark"] .dm-cell.l5 { color: #0E1311; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dm-cell.l4, :root:not([data-theme="light"]) .dm-cell.l5 { color: #0E1311; } }
