/* fetch-1641. Read-only report, shared Crystal tokens; pre-primitive data states. */
.crmsc { min-width: 0; color: var(--ink); }
.crmsc-header .pgh-nav { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-2); }
.crmsc-header .pgh-navfield { flex: 1 1 9rem; min-width: 0; }
.crmsc-header .pgh-navfield[for="crmScoreSubject"] { flex: 2 1 16rem; }
.crmsc-header .pgh-navfield[for="crmScoreView"], .crmsc-booking-header .pgh-navfield[for="crmScoreView"] { display: none; }
.crmsc-booking-header .pgh-nav { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-2); }
.crmsc-header .pgh-navfield :is(input,select) { width: 100%; min-width: 0; min-height: var(--control-height-touch); }
.crmsc-header .pgh-tabs { flex-wrap: wrap; }
.crmsc-header .pgh-tab { min-height: var(--control-height-touch); }
.crmsc :is(button,input,select,summary) { min-height: var(--control-height-touch); }
.crmsc :is(button,input,select,summary):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.crmsc-subject-tools { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: end; margin-block: var(--s-2); font-size: var(--t-sub); color: var(--muted); }
.crmsc-subject-tools label { display: grid; gap: var(--s-1); min-width: 0; flex: 1 1 18rem; }
.crmsc-subject-tools input { box-sizing: border-box; width: 100%; min-width: 0; font: inherit; font-size: var(--t-body); border: 1px solid var(--line); border-radius: var(--r-s); padding: var(--s-2) var(--s-3); color: var(--ink); background: var(--surface-card); }
.crmsc-context, .crmsc-meta, .crmsc-muted { color: var(--muted); font-size: var(--t-sub); line-height: 1.5; }
.crmsc-context { margin-block: var(--s-3); }
.crmsc-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--s-3); margin-block: var(--s-4); }
.crmsc-metric { display: grid; align-content: start; gap: var(--s-2); min-width: 0; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s-3); text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.crmsc-metric:hover, .crmsc-metric.is-selected { background: var(--wash); }
.crmsc-metric.is-selected { box-shadow: inset 0 3px var(--gold); }
.crmsc-metric strong { font-size: var(--t-title); line-height: 1.1; }
.crmsc-label { font-size: var(--t-body); font-weight: 600; }
.crmsc-base { font-size: var(--t-sub); font-variant-numeric: tabular-nums; }
.crmsc-explain { font-size: var(--t-sub); color: var(--muted); line-height: 1.5; }
.crmsc-methods { padding-block: var(--s-2); border-top: 1px solid var(--line); font-size: var(--t-sub); }
.crmsc-methods summary { display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.crmsc-methods article { border-top: 1px solid var(--line); padding-block: var(--s-2); }
.crmsc-methods h3 { margin: 0; font-size: var(--t-body); }
.crmsc-methods p { margin-block: var(--s-2); line-height: 1.5; }
.crmsc-evidence { margin-block: var(--s-4); min-width: 0; }
.crmsc-evidence-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.crmsc-evidence h2 { margin: 0; font-size: var(--t-section); scroll-margin-top: calc(var(--phone-nav-height,55px) + var(--s-3)); }
.crmsc-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(12rem,.55fr); gap: var(--s-3); padding: var(--s-3); background: var(--surface-card); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.crmsc-row-main, .crmsc-row-facts { display: grid; gap: var(--s-1); align-content: start; min-width: 0; }
.crmsc-row-main > span, .crmsc-row-facts, .crmsc-row-main p { font-size: var(--t-sub); color: var(--muted); line-height: 1.5; }
.crmsc-row-main p { margin: 0; white-space: pre-line; }
.crmsc-row-facts { font-variant-numeric: tabular-nums; }
.crmsc-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.crmsc-row-actions:empty { display: none; }
.crmsc-more { margin-block: var(--s-3); }
.crmsc-state { padding: var(--s-3); border-radius: var(--r-s); background: var(--wash); font-size: var(--t-sub); line-height: 1.5; }
.crmsc-state--error { color: var(--warn-fg); background: var(--warn-bg); }
.crmsc-state .btn { margin-left: var(--s-2); }
.crmsc-skeleton { display: grid; gap: var(--s-2); margin-block: var(--s-3); color: var(--muted); font-size: var(--t-sub); }
.crmsc-skeleton i { min-height: 3rem; border-radius: var(--r-s); background: var(--wash); }
.crmsc-filter-dialog { box-sizing: border-box; inset: 0; margin: auto; width: min(42rem,calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-card); color: var(--ink); }
.crmsc-filter-dialog:not([open]) { display: none; }
.crmsc-filter-dialog[open] { display: flex; flex-direction: column; }
.crmsc-filter-dialog::backdrop { background: var(--ink); opacity: .42; }
.crmsc-filter-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.crmsc-filter-head h2 { margin: 0; font-size: var(--t-section); }
.crmsc-filter-body { display: grid; flex: 1 1 auto; align-content: start; gap: var(--s-3); padding: var(--s-4); overflow-y: auto; min-height: 0; }
.crmsc-filter-body label { display: grid; gap: var(--s-1); font-size: var(--t-sub); color: var(--muted); min-width: 0; }
.crmsc-filter-body :is(input,select) { box-sizing: border-box; width: 100%; min-width: 0; min-height: var(--control-height-touch); border: 1px solid var(--line); border-radius: var(--r-s); padding: var(--s-2) var(--s-3); background: var(--surface-card); color: var(--ink); font: inherit; font-size: var(--t-body); }
.crmsc-filter-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s-3); }
.crmsc-filter-actions, .crmsc-filter-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.crmsc-filter-foot { flex: 0 0 auto; padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); }
.crmsc-filter-foot .btn-primary { margin-left: auto; }
.crmsc-filter-error { color: var(--bad-fg); font-size: var(--t-sub); margin: 0; }
@media(max-width: 1000px) { .crmsc-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width: 640px) {
  .crmsc-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s-2); margin-block: var(--s-3); }
  .crmsc-metric { padding: var(--s-3); }
  .crmsc-metric strong { font-size: var(--t-section); }
  .crmsc-row { grid-template-columns: minmax(0,1fr); gap: var(--s-2); }
  .crmsc-header .pgh-navfield, .crmsc-header .pgh-navfield[for="crmScoreSubject"] { flex: 1 1 5rem; }
  .crmsc-header .pgh-navfield[for="crmScoreView"], .crmsc-booking-header .pgh-navfield[for="crmScoreView"] { display: grid; }
  .crmsc-booking-header .pgh-navfield { flex: 1 1 7rem; min-width: 0; }
  .crmsc-booking-header .pgh-navfield select { width: 100%; min-width: 0; min-height: var(--control-height-touch); }
  .crmsc-header .pgh-tabs, .crmsc-booking-header .pgh-tabs { display: none; }
  .crmsc-subject-tools label { flex-basis: 100%; }
  .crmsc :is(input,select) { font-size: 1rem; }
  .crmsc-evidence-head { align-items: start; }
  .crmsc-evidence h2 { font-size: var(--t-body); }
  .crmsc-filter-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
}
/* A narrow phone cannot fit the view, period and Mine controls on one flex row.
 * Keep the period and its scope action together; the view chooser owns the row above. */
@media(max-width: 480px) {
  .crmsc-booking-header .pgh-nav:has([data-sdmine]) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crmsc-booking-header .pgh-nav:has([data-sdmine]) .pgh-navfield[for="crmScoreView"] { grid-column: 1 / -1; }
}
