.fm-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25em;
  padding: 1.25em;
  border-bottom: 1px solid var(--border-color);
}

.fm-col {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}

.fm-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-color);
}

.fm-area {
  min-height: 260px;
  resize: vertical;
  padding: 0.6em 0.7em;
  border: 1px solid var(--border-strong);
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.fm-area:focus {
  outline: none;
  border-color: var(--link-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.fm-results {
  margin-top: 1.25em;
}

.fm-table-wrap {
  max-height: 440px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.fm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.fm-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  background: var(--section-bg);
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-strong);
  border-right: 1px solid var(--border-color);
  padding: 0.55em 0.7em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fm-table th:last-child {
  border-right: none;
}

.fm-table td {
  padding: 0.45em 0.7em;
  border-bottom: 1px solid var(--border-color);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fm-score-col {
  width: 160px;
}

.fm-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fm-score-bar {
  flex: 1;
  height: 8px;
  background: #f0ece6;
  overflow: hidden;
}

.fm-score-fill {
  height: 100%;
  background: var(--success);
}

.fm-score-fill.low {
  background: #d97706;
}

.fm-score-val {
  width: 44px;
  text-align: right;
  font-weight: 600;
}

.fm-rail {
  display: flex;
  flex-direction: column;
  gap: 0.9em;
  align-items: center;
  padding: 0.8em 1.25em;
}

.fm-controls {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5em;
  flex-wrap: wrap;
}

.fgroup {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.fgroup-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-text);
}

#mode-select {
  min-width: 340px;
  max-width: none;
}

#skip-header {
  min-width: 240px;
}

.fcheck {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 2.4em;
  font-size: 0.95rem;
  color: var(--text-color);
  cursor: pointer;
  white-space: nowrap;
}

.fcheck input {
  accent-color: var(--primary-color);
}

.fslider {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  min-height: 2.4em;
}

.fslider input[type="range"] {
  width: 200px;
  accent-color: var(--primary-color);
}

.fslider-val {
  min-width: 3em;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
}

.fm-submit {
  display: flex;
  justify-content: center;
}

@media (max-width: 760px) {
  .fm-inputs {
    grid-template-columns: 1fr;
  }

  .fm-area {
    min-height: 180px;
  }

  .fm-controls {
    gap: 1em;
  }

  #mode-select,
  #skip-header {
    min-width: 0;
    width: 100%;
  }

  .fgroup {
    flex: 1 1 200px;
  }

  .fslider {
    width: 100%;
  }

  .fslider input[type="range"] {
    flex: 1;
    width: auto;
  }
}

.fm-row {
  cursor: pointer;
}

.fm-row:hover td {
  background: var(--surface-hover);
}

.fm-detail-row td {
  background: var(--panel-bg);
  padding: 0.8em 0.7em;
}

.stat-block .tchips {
  margin-left: auto;
}
