/* MIDI File Inspector (2026-11-06): only what ft-tool-20261106.css doesn't cover. Tokens only. */

/* File panel ----------------------------------------------------------------------------------- */
.mfi-drop--compact .ft-drop__label { min-height: 0; padding: var(--ft-space-3) var(--ft-space-4); grid-auto-flow: column; justify-content: start; align-items: center; gap: var(--ft-space-3); text-align: left; }
.mfi-drop--compact .ft-drop__icon, .mfi-drop--compact .mfi-drop__more { display: none; }
.mfi-drop--compact .ft-drop__label strong { font-size: var(--ft-text-sm); }
.mfi-drop--compact .ft-drop__button { margin-left: auto; }
.mfi-overview { min-height: 12rem; }
.mfi-overview > .ft-placeholder { min-height: 12rem; margin: 0; }
.mfi-stats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.25rem), 1fr)); gap: var(--ft-space-2); }
.mfi-stats .ft-stat { padding: var(--ft-space-2) var(--ft-space-3); }
.mfi-stats .ft-stat__value { font-size: var(--ft-text-lg); }
.mfi-stats .mfi-stat--wide { grid-column: span 2; }
.mfi-example-link { margin: var(--ft-space-3) 0 0; }
.mfi-also { margin: var(--ft-space-3) 0 0; color: var(--ft-ink-2); font-size: var(--ft-text-sm); }
.mfi-inline-btn { min-height: var(--ft-target); padding: 0 var(--ft-space-1); vertical-align: middle; }
.mfi-error { margin: 0; }

/* Problems and fixes --------------------------------------------------------------------------- */
.mfi-fix__empty, .mfi-details__empty, .mfi-more__empty { margin: 0; }
.mfi-fix__empty { min-height: 16rem; }
.mfi-lead { margin: 0; color: var(--ft-ink); font-weight: 600; }
.mfi-problems { display: grid; gap: var(--ft-space-2); margin: 0; padding: 0; list-style: none; }
.mfi-problem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--ft-space-2) var(--ft-space-3);
  align-items: start;
  padding: var(--ft-space-3) var(--ft-space-3) var(--ft-space-3) var(--ft-space-4);
  border: 1px solid var(--ft-line);
  border-left: 4px solid var(--ft-info);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
}
.mfi-problem--error { border-left-color: var(--ft-bad); }
.mfi-problem--warning { border-left-color: var(--ft-warn); }
.mfi-problem--check { border-left-color: var(--ft-warn); border-left-style: dashed; }
.mfi-problem--done { border-left-color: var(--ft-ok); }
.mfi-problem__title { margin: 0; color: var(--ft-ink); font-size: var(--ft-text-sm); font-weight: 650; line-height: 1.45; }
.mfi-problem__title .ft-badge { margin-right: var(--ft-space-2); vertical-align: 1px; }
.mfi-problem__detail { margin: var(--ft-space-1) 0 0; color: var(--ft-ink-2); font-size: var(--ft-text-sm); line-height: 1.45; }
.mfi-problem__action { display: flex; flex-wrap: wrap; gap: var(--ft-space-2); justify-content: flex-end; }
@media (max-width: 40rem) {
  .mfi-problem { grid-template-columns: minmax(0, 1fr); }
  .mfi-problem__action { justify-content: flex-start; }
}
.mfi-h3 { margin: 0; color: var(--ft-ink); font-size: var(--ft-text-md); font-weight: 650; }
.mfi-save { padding-top: var(--ft-space-4); border-top: 1px solid var(--ft-line); }
.mfi-copyline { margin: 0; color: var(--ft-ink-2); font-size: var(--ft-text-sm); }

/* Inside the file ------------------------------------------------------------------------------ */
.mfi-details__empty { min-height: 14rem; }
.mfi-view .ft-segmented__legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mfi-transport { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ft-space-3) var(--ft-space-4); margin-bottom: var(--ft-space-4); }
.mfi-play { min-width: 7.5rem; }
.mfi-play .mfi-icon-stop { display: none; fill: currentColor; stroke: none; }
.mfi-play .mfi-icon-play { fill: currentColor; stroke: none; }
.mfi-play[data-playing="true"] .mfi-icon-stop { display: block; }
.mfi-play[data-playing="true"] .mfi-icon-play { display: none; }
.mfi-startbar { width: 7.5rem; }
.mfi-output { min-width: min(100%, 15rem); }
.mfi-pos { margin: 0; min-height: var(--ft-target); display: flex; align-items: center; color: var(--ft-ink); font-size: var(--ft-text-sm); font-weight: 600; }
.mfi-transport__hint { flex: 1 1 100%; }
.mfi-gap { margin-top: var(--ft-space-4); }
.mfi-tracks td, .mfi-tracks th { white-space: nowrap; }
.mfi-tracks .mfi-name { white-space: normal; min-width: 8rem; max-width: 16rem; overflow-wrap: anywhere; }
.mfi-ms { display: inline-flex; gap: var(--ft-space-1); }
.mfi-ms .ft-btn { min-height: 2.75rem; padding: 0 0.75rem; }
.mfi-ms .ft-btn[aria-pressed="true"] { border-color: var(--ft-ink); background: var(--ft-ink); color: var(--ft-surface); }
.mfi-flag { color: var(--ft-ink-2); font-size: var(--ft-text-xs); }

/* Piano roll */
.mfi-rollbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ft-space-2) var(--ft-space-4); margin-bottom: var(--ft-space-3); }
.mfi-rollbar .ft-hint { flex: 1 1 16rem; }
.mfi-zoom { min-width: 3rem; color: var(--ft-ink); font-size: var(--ft-text-sm); font-weight: 650; }
.mfi-roll { position: relative; height: 22rem; overflow: hidden; border: 1px solid var(--ft-line); border-radius: var(--ft-radius); background: var(--ft-plot-surface); }
.mfi-roll__scroller { position: absolute; inset: 0; z-index: 2; overflow: auto; overscroll-behavior-x: contain; cursor: crosshair; }
.mfi-roll__scroller:focus-visible { outline: 3px solid var(--ft-focus); outline-offset: -3px; }
.mfi-roll__sizer { height: 1px; }
.mfi-roll__canvas, .mfi-roll__overlay { position: absolute; top: 0; left: 0; z-index: 1; display: block; pointer-events: none; }
.mfi-swatch-stuck { background: repeating-linear-gradient(135deg, var(--ft-bad) 0 3px, transparent 3px 5px); outline: 1px solid var(--ft-bad); outline-offset: -1px; }

/* Event list */
.mfi-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ft-space-3); }
@media (max-width: 56rem) { .mfi-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mfi-filters2 { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ft-space-2) var(--ft-space-5); margin: var(--ft-space-3) 0; }
.mfi-events-count { margin: 0 0 0 auto; min-height: var(--ft-target); display: flex; align-items: center; }
.mfi-events { height: 28rem; overflow: auto; }
.mfi-events__table { table-layout: fixed; min-width: 58rem; }
.mfi-events__table th, .mfi-events__table td { height: 2rem; box-sizing: border-box; padding-top: 0; padding-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.mfi-events__table th:nth-child(1) { width: 4.5rem; }
.mfi-events__table th:nth-child(2) { width: 4.25rem; }
.mfi-events__table th:nth-child(3) { width: 5.5rem; }
.mfi-events__table th:nth-child(4) { width: 4.5rem; }
.mfi-events__table th:nth-child(5) { width: 7.5rem; }
.mfi-events__table th:nth-child(6) { width: 6rem; }
.mfi-events__table th:nth-child(7) { width: 2.75rem; }
.mfi-events__table th:nth-child(8) { width: 9rem; }
.mfi-events__table .mfi-col-bytes { width: 12rem; font-family: var(--ft-font-mono); font-size: var(--ft-text-xs); }
.mfi-events--bytes .mfi-events__table { min-width: 70rem; }
.mfi-events__table tr.mfi-spacer td { height: auto; padding: 0; border: 0; }
.mfi-events__table td.mfi-empty { white-space: normal; height: auto; padding: var(--ft-space-4); color: var(--ft-ink-2); text-align: center; }
.mfi-pager { justify-content: space-between; margin-top: var(--ft-space-3); }
.mfi-pager__text { margin: 0; color: var(--ft-ink-2); font-size: var(--ft-text-sm); }

/* Text and lyrics */
.mfi-lyrics { margin-bottom: var(--ft-space-4); }
.mfi-lyrics__text { max-height: 16rem; margin-top: var(--ft-space-2); padding: var(--ft-space-3) var(--ft-space-4); overflow: auto; border: 1px solid var(--ft-line); border-radius: var(--ft-radius); background: var(--ft-surface-2); color: var(--ft-ink); }
.mfi-lyrics__text p { margin: 0 0 var(--ft-space-1); }
.mfi-lyrics__text p.mfi-verse-gap { height: var(--ft-space-3); margin: 0; }
.mfi-text-cell { white-space: normal; overflow-wrap: anywhere; }

/* More changes --------------------------------------------------------------------------------- */
.mfi-tools { display: grid; gap: var(--ft-space-4); }
@media (min-width: 56rem) { .mfi-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mfi-tool--wide { grid-column: 1 / -1; } }
.mfi-tool { display: grid; gap: var(--ft-space-3); align-content: start; min-width: 0; margin: 0; padding: var(--ft-space-4); border: 1px solid var(--ft-line); border-radius: var(--ft-radius); background: var(--ft-surface); }
.mfi-tool__title { padding: 0 var(--ft-space-1); color: var(--ft-ink); font-size: var(--ft-text-md); font-weight: 650; }
.mfi-tool .ft-btn { justify-self: start; }
.mfi-tool__note { min-height: 2.6em; }
.mfi-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0 var(--ft-space-4); }
.mfi-nochanges { margin: var(--ft-space-2) 0 0; color: var(--ft-ink-2); font-size: var(--ft-text-sm); }
.mfi-changes { display: grid; gap: var(--ft-space-2); margin: var(--ft-space-2) 0 0; padding: 0; list-style: none; }
.mfi-change { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ft-space-2) var(--ft-space-3); padding: var(--ft-space-2) var(--ft-space-3) var(--ft-space-2) var(--ft-space-4); border: 1px solid var(--ft-line); border-left: 4px solid var(--ft-ok); border-radius: var(--ft-radius); background: var(--ft-surface); }
.mfi-change--auto { border-left-color: var(--ft-line-strong); background: var(--ft-surface-2); }
.mfi-change p { flex: 1 1 18rem; margin: 0; color: var(--ft-ink); font-size: var(--ft-text-sm); }
.mfi-compare td:nth-child(n+2) { font-variant-numeric: tabular-nums; }
.mfi-compare tr.is-changed td:last-child { font-weight: 650; }

@media print {
  .mfi-transport, .mfi-more, .mfi-problem__action, .mfi-save .ft-segmented, #mfi-panel-roll, #mfi-panel-events { display: none !important; }
}

/* Mobile form controls (16px to prevent iOS Safari zoom) and 44px primary buttons */
@media screen and (max-width: 640px), screen and (hover: none) and (pointer: coarse) {
  .ft-tool input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  .ft-tool select,
  .ft-tool textarea,
  .ft-tool .ft-input,
  .ft-tool .ft-select,
  .ft-tool .ft-textarea,
  .ft-tool .ft-inputgroup > .ft-select.ft-inputgroup__unit {
    font-size: max(16px, 1rem);
  }
  .ft-tool .ft-btn--primary {
    min-height: 44px;
  }
}

/* A file dragged anywhere over the page: the whole tool shows it will open there. */
.ft-tool.mfi-file-over { outline: 3px dashed var(--ft-accent); outline-offset: 4px; border-radius: var(--ft-radius); }
@media (forced-colors: active) { .ft-tool.mfi-file-over { outline-color: Highlight; } }
