/* Native viewer proportions; scoped so body.flat cannot invert these controls. */
.mv-match-shell,
.mv-match-selector,
.mv-match-dialog {
  --mv-match-surface: #12141c;
  --mv-match-raised: rgba(13, 15, 22, .91);
  --mv-match-hover: #2a2825;
  --mv-match-text: #d2cabb;
  --mv-match-muted: #b7b0a4;
  --mv-match-border: #ffffff1f;
  --mv-match-focus: #ffd98a;
  --mv-match-error: #ffb5b1;
  --mv-match-popup-width: 760px;
  --mv-match-popup-max-height: 560px;
  color-scheme: dark;
  color: var(--mv-match-text);
  font: 400 12px/normal ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: left;
  letter-spacing: normal;
  box-sizing: border-box;
}
.mv-match-shell *,
.mv-match-selector *,
.mv-match-dialog * { box-sizing: border-box; }
.mv-match-selector { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mv-match-chooser { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.mv-match-caption { display: block; color: var(--mv-match-muted); margin: 0 0 4px; font-size: 11px; font-weight: 400; }
.mv-match-selector .mv-match-trigger,
.mv-match-dialog .mv-match-button,
.mv-match-dialog .mv-match-close,
.mv-match-dialog .mv-match-chip,
.mv-match-dialog .mv-match-input,
.mv-match-shell .mv-match-source button,
.mv-match-bootstrap-error button {
  appearance: auto;
  position: static;
  width: auto;
  height: auto;
  min-height: 29px;
  min-width: 24px;
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--mv-match-border, #ffffff1f);
  border-radius: 5px;
  padding: 4px 9px;
  color: var(--mv-match-text, #d2cabb);
  background: var(--mv-match-raised, rgba(13, 15, 22, .91));
  box-shadow: none;
  font: 400 12px/normal ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: none;
  letter-spacing: normal;
  opacity: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.mv-match-selector .mv-match-trigger { display: flex; width: 100%; height: auto; justify-content: space-between; align-items: center; gap: 6px; text-align: left; }
.mv-match-trigger-value { min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.mv-match-chevron { flex: 0 0 auto; color: var(--mv-match-muted); }
.mv-match-selector .mv-match-trigger:disabled,
.mv-match-dialog button:disabled,
.mv-match-dialog input:disabled { color: #a8a296; border-color: #ffffff14; background: #171820; cursor: not-allowed; }
.mv-match-dialog {
  position: fixed;
  z-index: 10010;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: var(--mv-match-popup-width);
  height: var(--mv-match-popup-max-height);
  min-width: 0;
  max-width: calc(100vw - 16px);
  max-height: min(var(--mv-match-popup-max-height), calc(100dvh - 16px));
  padding: 7px;
  border: 1px solid var(--mv-match-border);
  border-radius: 5px;
  background: var(--mv-match-surface);
  box-shadow: 0 6px 24px #0008;
  overflow: visible;
  overscroll-behavior: contain;
  isolation: isolate;
  scrollbar-color: #777166 var(--mv-match-surface);
}
.mv-match-dialog[hidden],
.mv-match-dialog [hidden] { display: none !important; }
.mv-match-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex: 0 0 auto; }
.mv-match-dialog .mv-match-title { margin: 0; padding: 0; color: var(--mv-match-text); font: inherit; letter-spacing: normal; }
.mv-match-dialog .mv-match-close { flex: 0 0 auto; border-color: transparent; background: transparent; }
.mv-match-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-width: 0; min-height: 0; flex: 1; }
.mv-match-query-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 4px 10px 4px 2px; overflow: visible; gap: 8px; }
.mv-match-query-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 0 0 auto; }
.mv-match-query-actions { margin-top: auto; padding-top: 5px; }
.mv-match-results-pane { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; padding: 4px 2px 4px 10px; border-left: 1px solid var(--mv-match-border); }
.mv-match-results-heading { display: grid; gap: 5px; flex: 0 0 auto; }
.mv-match-results-body { min-width: 0; min-height: 29px; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; scroll-padding: 4px; scrollbar-color: #777166 var(--mv-match-surface); }
.mv-match-dialog[data-mv-layout="stacked"] .mv-match-body { grid-template-columns: minmax(0, 1fr); }
.mv-match-dialog[data-mv-layout="stacked"] .mv-match-query-pane { padding-right: 2px; }
.mv-match-dialog[data-mv-layout="stacked"] .mv-match-results-pane { border-left: 0; border-top: 1px solid var(--mv-match-border); padding: 9px 2px 4px; }
.mv-match-dialog[data-mv-scroll="outer"] { overflow: auto; }
.mv-match-dialog[data-mv-scroll="outer"] .mv-match-body { flex: 0 0 auto; min-height: auto; align-items: start; }
.mv-match-dialog[data-mv-scroll="outer"] .mv-match-results-body { overflow: visible; flex: 0 0 auto; }
.mv-match-dialog[data-mv-scroll="outer"] .mv-match-query-actions { margin-top: 0; }
.mv-match-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; flex: 0 0 auto; }
.mv-match-field { display: flex; flex-direction: column; min-width: 0; gap: 4px; color: var(--mv-match-muted); font-size: 11px; font-weight: 400; }
.mv-match-dialog .mv-match-input { display: block; width: 100%; min-width: 0; cursor: text; }
.mv-match-dialog select.mv-match-input { cursor: pointer; }
.mv-match-dialog input::placeholder { color: var(--mv-match-muted); opacity: 1; }
.mv-match-dialog input[aria-invalid="true"] { border-color: var(--mv-match-error); }
.mv-match-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 0 0 auto; }
/* Expanded summaries reflow rather than hiding applied dates or long IANA zones. */
.mv-match-dialog .mv-match-chip { height: auto; min-width: 24px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.mv-match-dialog .mv-match-chip[aria-expanded="true"] { border-color: var(--mv-match-focus); background: var(--mv-match-hover); }
.mv-match-filters { flex: 0 0 auto; min-width: 0; padding: 6px; margin: 0; background: var(--mv-match-raised); border-radius: 5px; }
.mv-match-filter-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; padding: 0; margin: 0; border: 0; }
.mv-match-filter-group[data-mv-group="month"],
.mv-match-filter-group[data-mv-group="zone"] { grid-template-columns: minmax(0, 1fr); }
.mv-match-filter-legend { padding: 0; margin: 0 0 4px; color: var(--mv-match-text); font-size: 12px; }
.mv-match-dialog .mv-match-hint,
.mv-match-dialog .mv-match-pinned,
.mv-match-dialog .mv-match-error,
.mv-match-dialog .mv-match-status,
.mv-match-dialog .mv-match-sync,
.mv-match-dialog .mv-match-empty { margin: 0; padding: 0; color: var(--mv-match-muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; flex: 0 0 auto; }
.mv-match-dialog .mv-match-pinned { padding: 4px; border-radius: 5px; background: var(--mv-match-raised); }
.mv-match-dialog .mv-match-error { color: var(--mv-match-error); }
.mv-match-error:empty { display: none; }
.mv-match-filters .mv-match-hint,
.mv-match-filters .mv-match-actions,
.mv-match-filters .mv-match-error:not(:empty) { margin-top: 5px; }
.mv-match-list { min-height: 29px; padding: 3px; margin: 0; border-radius: 5px; }
.mv-match-option { position: relative; display: flex; gap: 9px; min-height: 29px; align-items: flex-start; padding: 8px; border: 1px solid transparent; border-radius: 5px; color: var(--mv-match-text); cursor: pointer; touch-action: manipulation; transition: background-color 120ms ease; }
.mv-match-option + .mv-match-option { margin-top: 7px; }
.mv-match-option + .mv-match-option::before { content: ''; position: absolute; inset: -5px 4px auto; border-top: 1px solid var(--mv-match-border); pointer-events: none; }
.mv-match-option[aria-selected="true"] { background: var(--mv-match-hover); border-color: #ffd98a80; }
.mv-match-option[aria-disabled="true"] { background: var(--mv-match-raised); cursor: not-allowed; }
.mv-match-option[data-mv-pending="true"] { background: var(--mv-match-hover); border-color: var(--mv-match-focus); }
.mv-match-tile { display: grid; place-items: center; flex: 0 0 16px; height: 16px; border-radius: 3px; background: #ffffff0a; color: var(--mv-match-muted); font-size: 11px; font-weight: 400; }
.mv-match-option-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.mv-match-identity-line { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; min-width: 0; }
.mv-match-identifier { color: var(--mv-match-text); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.mv-match-metadata { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; }
.mv-match-badge { display: inline-block; max-width: 100%; padding: 0 3px; border-radius: 3px; color: var(--mv-match-text); background: #ffffff0a; font-size: 11px; overflow-wrap: anywhere; }
.mv-match-ready-badge { color: #bfe3c9; background: #1d332a; }
.mv-match-detail,
.mv-match-date,
.mv-match-description { color: var(--mv-match-muted); font-size: 11px; overflow-wrap: anywhere; }
.mv-match-option-cue { flex: 0 1 auto; min-width: 0; max-width: 32%; align-self: center; padding: 2px 4px; border: 1px solid currentColor; border-radius: 3px; color: var(--mv-match-focus); font-size: 11px; text-align: center; overflow-wrap: anywhere; }
.mv-match-option[aria-selected="true"] .mv-match-option-cue { border-color: transparent; }
.mv-match-option[aria-disabled="true"] .mv-match-option-cue { border-color: transparent; color: var(--mv-match-muted); }
.mv-match-option[data-mv-pending="true"] .mv-match-option-cue { color: var(--mv-match-focus); }
.mv-match-transfer { border: 1px solid #ffd98a80; border-left: 3px solid var(--mv-match-focus); border-radius: 5px; background: var(--mv-match-hover); padding: 8px 10px; color: var(--mv-match-focus); overflow-wrap: anywhere; }
.mv-match-transfer[hidden] { display: none; }
.mv-match-results-footer { flex: 0 0 auto; display: grid; gap: 7px; padding-top: 8px; border-top: 1px solid var(--mv-match-border); }
.mv-match-dialog .mv-match-status { color: var(--mv-match-text); }
.mv-match-dialog .mv-match-status[data-mv-transfer-summary="true"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#picker .mv-loaded-match, #tdmPicker .mv-loaded-match { margin: 0; }
.mv-match-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.mv-match-dialog .mv-match-button { height: auto; white-space: normal; overflow-wrap: anywhere; }
.mv-match-picker-anchor { position: relative; min-width: 0; width: 100%; }
.mv-match-picker-field { display: flex; gap: 4px; min-width: 0; width: 100%; }
.mv-match-picker-field .mv-match-input { flex: 1 1 0; }
.mv-match-picker-field .mv-match-button { flex: 0 0 29px; padding: 4px; }
.mv-match-dialog button.mv-match-input { display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; height: auto; min-height: 29px; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.mv-match-picker-icon { display: inline-block; vertical-align: middle; flex: 0 0 12px; color: var(--mv-match-muted); }
.mv-match-picker { position: absolute; z-index: 2; left: 0; top: calc(100% + 4px); width: 100%; min-width: 0; padding: 6px; display: grid; gap: 6px; border: 1px solid var(--mv-match-border); border-radius: 5px; background: var(--mv-match-surface); color: var(--mv-match-text); font: inherit; box-shadow: 0 4px 12px #0008; }
.mv-match-picker[data-mv-placement="above"] { top: auto; bottom: calc(100% + 4px); }
.mv-match-picker[data-mv-placement="inline"] { position: static; margin-top: 4px; box-shadow: none; }
.mv-match-picker-option { min-height: 29px; display: flex; align-items: center; padding: 4px 6px; border: 1px solid transparent; border-radius: 5px; color: var(--mv-match-text); font-size: 12px; overflow-wrap: anywhere; cursor: pointer; }
.mv-match-picker-list { min-width: 0; }
.mv-match-picker-option[aria-selected="true"], .mv-match-dialog .mv-match-picker [aria-selected="true"] { background: var(--mv-match-hover); border-color: #ffd98a80; color: var(--mv-match-focus); }
.mv-match-picker-count { margin: 0; color: var(--mv-match-muted); font-size: 11px; overflow-wrap: anywhere; }
.mv-match-spins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mv-match-spin { display: grid; gap: 4px; min-width: 0; }
.mv-match-spin .mv-match-actions { flex-wrap: nowrap; }
.mv-match-spin .mv-match-button { flex: 1; }
.mv-match-calendar-nav { display: grid; grid-template-columns: 29px minmax(0, 1fr) 29px; gap: 6px; align-items: end; }
.mv-match-dialog .mv-match-calendar-nav > .mv-match-button { padding: 4px; }
.mv-match-calendar, .mv-match-month-grid { display: grid; gap: 2px; min-width: 0; }
.mv-match-calendar-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mv-match-month-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.mv-match-dialog .mv-match-calendar-row .mv-match-button, .mv-match-dialog .mv-match-month-row .mv-match-button { min-width: 0; padding: 3px 0; height: auto; min-height: 29px; }
.mv-match-dialog .mv-match-calendar-row [data-mv-outside-month="true"]:not([aria-selected="true"]) { color: var(--mv-match-muted); border-color: transparent; background: transparent; }
.mv-match-weekday { color: var(--mv-match-muted); text-align: center; font-size: 11px; padding: 3px 0; }
.mv-match-selector .mv-match-trigger:focus-visible,
.mv-match-dialog :is(button, input, select, [tabindex]):focus-visible,
.mv-match-shell .mv-match-source button:focus-visible,
.mv-match-bootstrap-error button:focus-visible { outline: 2px solid var(--mv-match-focus, #ffd98a); outline-offset: 1px; }
@media (hover: hover) {
  .mv-match-selector .mv-match-trigger:not(:disabled):hover,
  .mv-match-dialog :is(.mv-match-button, .mv-match-close, .mv-match-chip):not(:disabled):hover,
  .mv-match-shell .mv-match-source button:not(:disabled):hover,
  .mv-match-option:not([aria-disabled="true"]):hover,
  .mv-match-picker-option:hover { background: var(--mv-match-hover); }
}
.mv-match-selector .mv-match-trigger:not(:disabled):active,
.mv-match-dialog button:not(:disabled):active,
.mv-match-shell .mv-match-source button:not(:disabled):active { background: #373229; }
@media (pointer: coarse) {
  .mv-match-chips, .mv-match-actions, .mv-match-selector { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .mv-match-shell *, .mv-match-selector *, .mv-match-dialog * { transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .mv-match-dialog, .mv-match-picker, .mv-match-option[aria-selected="true"], .mv-match-picker [aria-selected="true"] { border: 1px solid CanvasText; }
  .mv-match-option + .mv-match-option::before { border-color: CanvasText; }
  .mv-match-option[aria-disabled="true"] .mv-match-option-cue { color: GrayText; }
  .mv-match-option:focus, .mv-match-picker :focus { outline: 2px solid Highlight; }
}

/* Shared adapter chrome, with native curated pickers retained as fallback. */
.mv-match-shell { min-width: 0; flex: 0 1 auto; width: max-content; max-width: 100%; }
.mv-match-controls { min-width: 0; }
.mv-match-shell [hidden],
#picker #matchsel[hidden],
#tdmPicker #tdmDataset[hidden] { display: none !important; }
#picker select:focus-visible,
#tdmPicker select:focus-visible { outline: 2px solid #ffd98a; outline-offset: 1px; }
.mv-match-source-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 5px; }
.mv-match-source { display: flex; gap: 4px; padding: 0; }
.mv-match-shell .mv-match-source button[aria-pressed="true"] { background: var(--mv-match-hover); color: var(--mv-match-focus); border-color: #ffd98a80; }
.mv-match-service-note { color: var(--mv-match-muted); max-width: 30ch; font-size: 11px; line-height: 1.35; padding: 3px 4px; border-radius: 3px; background: var(--mv-match-raised); overflow-wrap: anywhere; }
.mv-match-service-note:empty { display: none; }
.mv-match-bootstrap-error { position: fixed; inset: 30% 1rem auto; max-width: 35rem; margin: auto; z-index: 10020; padding: 12px; background: #12141c; color: #d2cabb; border: 1px solid #ffb5b1; border-radius: 5px; font: 400 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Loaded identity sits beside the native picker and wraps when space is tight. */
.mv-loaded-match {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 6px;
  width: max-content; max-width: 100%; min-width: 0; min-height: 29px; box-sizing: border-box;
  padding: 4px 8px; border: 1px solid #ffffff1f; border-radius: 5px;
  background: #0d0f16f2; color: #d2cabb; text-align: center; overflow-wrap: anywhere;
  font: 400 12px/16px ui-monospace, SFMono-Regular, Menlo, monospace;
  pointer-events: none;
}
.mv-loaded-match strong { color: #ffd98a; font-weight: 600; }
/* Fit both the native Curated controls and the loaded identity. */
#picker[data-mv-loaded-match], #tdmPicker[data-mv-loaded-match] { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; bottom: 120px; }
#picker[data-mv-loaded-match] #matchsel:not([hidden]) { flex: 1 1 180px !important; }
@media (max-width: 600px) {
  #picker[data-mv-loaded-match] .mv-loaded-match, #tdmPicker[data-mv-loaded-match] .mv-loaded-match { flex-basis: 100%; }
}
/* Discovery alone uses the input-log-free band below POV. Native pickers stay bottom. */
.mv-match-discovery-host { position: fixed; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); top: 140px; bottom: auto; z-index: 9; }
body.immersive .mv-loaded-match,
body.immersive .mv-match-discovery-host,
body.immersive .mv-match-dialog { visibility: hidden; pointer-events: none; }
.mv-match-replay-progress {
  display: block;
  width: 100%;
  height: 0.5em;
  margin: 0.3em 0 0.5em;
  accent-color: #ffd080;
}
.mv-match-replay-progress[hidden] { display: none; }
