body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #17171c;
  color: #f0f0f0;
}

.app {
  box-sizing: border-box;
  position: relative;
  width: 900px;
  max-width: calc(100vw - 32px);
  margin: 16px 0 40px 660px;
  padding: 24px;
}

.drop-area {
  margin-top: 24px;
  padding: 32px;
  border: 2px dashed #777;
  border-radius: 12px;
  background: #23232b;
}

#output {
  margin-top: 24px;
  white-space: pre-wrap;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.file-button {
  padding: 6px 12px;
  border-radius: 4px;
  background: #666;
  color: white;
  cursor: pointer;
  white-space: nowrap;
}

.file-button:hover {
  background: #777;
}

.file-input {
  display: none;
}

.file-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #f0f0f0;
}

.drop-area.drag-over {
  border-color: #aaa;
  background: #2d2d38;
}

.tabs {
  position: relative;
  margin-top: 24px;
}

.tab-buttons {
  position: fixed;
  top: 178px;
  left: 32px;
  width: 596px;
  display: flex;
  align-items: flex-start;
  column-gap: 8px;
  row-gap: 22px;
  flex-wrap: wrap;
  align-content: flex-start;
  margin-bottom: 0;
}

.tab-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 172px;
  padding: 15px 9px 8px;
  border: 1px solid #555;
  border-radius: 12px;
  background: #1f1f27;
}

.tab-group-title {
  position: absolute;
  top: -11px;
  left: 14px;
  padding: 0 8px;
  background: #17171c;
  color: #cfd3df;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
}

.tab-group.hidden-tab-group {
  display: none;
}

.tab-button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #444;
  border-radius: 7px;
  background: #23232b;
  color: #ddd;
  cursor: pointer;
  text-align: center;
}

.tab-button:hover {
  background: #2d2d38;
}

.tab-button.active {
  background: #3a3a48;
  color: #fff;
  border-color: #777;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

#tab-metadata > .bn-subtabs,
#tab-spread > .bn-subtabs {
  display: none;
}

@media (max-width: 1600px) {
  .app {
    margin: 16px auto 40px;
  }

  .tab-buttons {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    width: auto;
    max-height: none;
    overflow-y: visible;
    gap: 22px 10px;
    padding-right: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #444;
    margin: 20px 0 22px;
  }

  .tab-group {
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .app {
    max-width: calc(100vw - 20px);
    padding: 16px;
  }

  .drop-area {
    padding: 20px;
  }

  .tab-buttons {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }
}

.options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.volume-compare-chart-section {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #3d3d48;
  border-radius: 8px;
  background: #202029;
}

.kiai-compare-chart-section {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #3d3d48;
  border-radius: 8px;
  background: #202029;
}

.kiai-compare-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 210px;
  overflow: hidden;
  border-top: 1px solid #393944;
}

.kiai-compare-chart-wrap canvas {
  display: block;
  width: 100%;
  min-height: 210px;
  cursor: crosshair;
  touch-action: none;
}

canvas.is-panning {
  cursor: grabbing !important;
}

.spread-scroll-chart-section {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #3d3d48;
  border-radius: 8px;
  background: #202029;
}

.spread-density-chart-section {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #3d3d48;
  border-radius: 8px;
  background: #202029;
}

.spread-rest-chart-section {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #3d3d48;
  border-radius: 8px;
  background: #202029;
}

.offset-waveform-chart-section {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #3d3d48;
  border-radius: 8px;
  background: #202029;
}

.offset-waveform-chart-section .volume-compare-chart-header p {
  white-space: pre-line;
}

.offset-waveform-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0 10px;
  font-size: 13px;
}

.offset-waveform-info {
  color: #b8bfd4;
}

.offset-waveform-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 12px;
  font-size: 13px;
}

.offset-waveform-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.offset-waveform-legend .offset-waveform-estimate-feature[hidden] {
  display: none;
}

.offset-waveform-legend-swatch {
  display: inline-block;
  width: 22px;
  height: 2px;
}

.offset-waveform-audio-swatch {
  background: #78d7ff;
}

.offset-waveform-barline-swatch {
  background: #ff5c70;
}

.offset-waveform-estimated-swatch {
  background: #ffcf5c;
}

.offset-waveform-peak-swatch {
  background: #c27eff;
}

.offset-waveform-clicked-peak-swatch {
  background: #b284ff;
}

.offset-waveform-manual-offset-swatch {
  background: repeating-linear-gradient(
    90deg,
    #ffcf5c 0 6px,
    transparent 6px 10px
  );
}

.offset-waveform-estimate {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #3b4050;
  border-radius: 6px;
  background: #181821;
  font-size: 13px;
}

.offset-waveform-estimate-muted {
  color: #b8bfd4;
}

.offset-waveform-estimate-title {
  margin-bottom: 8px;
  font-weight: 700;
  color: #f4f6ff;
}

.offset-waveform-estimate-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.offset-waveform-estimate-grid div {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.offset-waveform-estimate-grid div span {
  color: #aeb7ce;
}

.offset-waveform-estimate-grid div strong {
  color: #f4f6ff;
}

.offset-waveform-estimate-grid div strong.positive {
  color: #ffcf5c;
}

.offset-waveform-estimate-grid div strong.negative {
  color: #78d7ff;
}

.offset-waveform-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 330px;
  overflow: hidden;
  border-top: 1px solid #393944;
}

.offset-waveform-chart-wrap canvas {
  display: block;
  width: 100%;
  min-height: 330px;
  cursor: crosshair;
  touch-action: none;
}

.offset-waveform-tooltip {
  pointer-events: none;
}

.spread-rest-scale-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 10px;
  font-size: 13px;
}

.spread-rest-scale-controls label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  cursor: pointer;
}

.spread-rest-scale-controls input[type="checkbox"] {
  margin: 0;
}

.spread-rest-scale-controls input[type="number"] {
  width: 72px;
  min-width: 72px;
  box-sizing: border-box;
  padding: 4px 6px;
  border: 1px solid #555867;
  border-radius: 4px;
  background: #15151d;
  color: #f0f0f0;
}

.spread-rest-graph-help {
  white-space: pre-line;
}

.spread-rest-option-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: -6px 0 16px;
  padding: 8px 10px;
  border: 1px solid #3d3d48;
  border-radius: 6px;
  background: #202029;
}

.spread-rest-option-group legend {
  padding: 0 4px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
}

.spread-rest-option-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  cursor: pointer;
}

.spread-rest-option-group input[type="checkbox"] {
  margin: 0;
}

.spread-rest-option-group .spread-rest-scale-controls {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}

.spread-rest-option-group .spread-rest-scale-controls label {
  flex-wrap: wrap;
}

.spread-rest-option-reference {
  color: #aeb8c8;
  font-size: 12px;
}

.spread-rest-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #cbd5e1;
}

.spread-rest-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spread-rest-legend-swatch {
  width: 22px;
  height: 3px;
  flex: 0 0 22px;
  border-radius: 999px;
}

.spread-rest-original-swatch {
  background: #6ecbff;
}

.spread-rest-scaled-swatch {
  background: #f2b84b;
}

.spread-rest-threshold-section {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid #3d3d48;
  border-radius: 8px;
  background: #202029;
}

.spread-rest-threshold-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.spread-rest-threshold-header h4 {
  margin: 0;
  font-size: 14px;
}

.spread-rest-threshold-header span {
  color: #aeb8c8;
  font-size: 13px;
}

.spread-rest-threshold-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.spread-rest-threshold-difficulty-col {
  width: 16%;
}

.spread-rest-threshold-gap-col {
  width: 24%;
}

.spread-rest-threshold-value-col {
  width: 15%;
}

.spread-rest-threshold-table th,
.spread-rest-threshold-table td {
  padding: 7px 8px;
  border-top: 1px solid #373746;
  text-align: left;
}

.spread-rest-threshold-table thead th {
  color: #cbd5e1;
  font-weight: 600;
}

.spread-rest-threshold-table tbody th {
  color: #f0f0f0;
  font-weight: 600;
}

.spread-rest-threshold-table .spread-rest-threshold-warn {
  color: #ffd86b;
  font-weight: 700;
}

.spread-rest-threshold-table .spread-rest-threshold-error {
  color: #ff6b6b;
  font-weight: 700;
}

.spread-density-chart-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 10px;
  font-size: 13px;
}

.spread-density-chart-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.spread-density-chart-options input {
  margin: 0;
}

.spread-density-inversion-swatch {
  width: 18px;
  height: 12px;
  flex: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  background: #d65a67;
}

.spread-density-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 330px;
  overflow: hidden;
  border-top: 1px solid #393944;
}

.spread-density-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 330px;
  cursor: crosshair;
  touch-action: none;
}

.spread-density-chart-tooltip {
  max-width: min(420px, calc(100% - 16px));
  white-space: pre;
}

.spread-scroll-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.spread-scroll-header-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.spread-scroll-header-actions input {
  margin: 0;
}

.spread-scroll-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 340px;
  overflow: hidden;
  border-top: 1px solid #393944;
}

.spread-scroll-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 340px;
  cursor: crosshair;
  touch-action: none;
}

.spread-scroll-delta-header {
  margin-top: 22px;
}

.spread-scroll-delta-header h4 {
  margin: 0 0 5px;
  font-size: 17px;
}

.spread-scroll-delta-header p {
  margin: 0 0 10px;
  color: #aeb8c8;
  font-size: 12px;
}

.spread-scroll-progression-swatch {
  background: #d65a67;
}

.spread-scroll-consistency-swatch {
  background: #c4934b;
}

.spread-scroll-delta-chart-wrap,
.spread-scroll-delta-chart-wrap canvas {
  height: 300px;
}

.spread-scroll-warning-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.spread-scroll-warning-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.spread-scroll-warning-toggles input {
  margin: 0;
}

.spread-scroll-warning-swatch {
  width: 18px;
  height: 12px;
  flex: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 2px;
}

.spread-scroll-warning-limit {
  height: 0;
  border: 0;
  border-top: 2px dashed #ffd86b;
  border-radius: 0;
}

.spread-scroll-warning-rapid {
  background: #e07a5f;
}

.volume-compare-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.volume-compare-chart-header h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.volume-compare-chart-header p {
  max-width: 640px;
  margin: 0;
  color: #aaa;
  font-size: 12px;
  line-height: 1.5;
}

.volume-compare-diff-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 24px;
  margin-bottom: 10px;
}

.volume-compare-diff-toggles-bottom {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid #393944;
}

.graph-diff-toggle-actions {
  display: inline-flex;
  gap: 6px;
  margin-right: 4px;
}

.graph-diff-toggle-actions button {
  padding: 3px 8px;
  border: 1px solid #4b4b58;
  border-radius: 4px;
  background: #292933;
  color: #e4e7ee;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.graph-diff-toggle-actions button:hover {
  border-color: #707080;
  background: #343440;
}

.volume-compare-background-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.volume-compare-background-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.volume-compare-background-toggles input {
  margin: 0;
}

.volume-compare-background-swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 2px;
}

.volume-compare-background-difference {
  background: rgba(255, 107, 107, 0.7);
}

.volume-compare-background-kiai {
  background: rgba(255, 216, 107, 0.75);
}

.volume-compare-background-break {
  background: rgba(86, 170, 255, 0.75);
}

.volume-compare-diff-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  cursor: pointer;
}

.volume-compare-diff-toggle input {
  margin: 0;
}

.volume-compare-diff-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

.volume-compare-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 340px;
  overflow: hidden;
  border-top: 1px solid #393944;
}

.volume-compare-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 340px;
  cursor: crosshair;
  touch-action: none;
}

.volume-compare-chart-tooltip {
  position: absolute;
  z-index: 2;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid #555;
  border-radius: 4px;
  background: rgba(15, 15, 20, 0.96);
  color: #f2f2f2;
  font: 12px/1.5 "JetBrains Mono", Consolas, monospace;
  white-space: pre-wrap;
  pointer-events: none;
}

.spread-scroll-delta-tooltip {
  box-sizing: border-box;
  width: max-content;
  max-width: min(680px, calc(100% - 16px));
  padding: 8px;
  white-space: normal;
}

.spread-scroll-delta-tooltip-time {
  margin-bottom: 6px;
  font-weight: 700;
}

.spread-scroll-delta-tooltip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px 8px;
}

.spread-scroll-delta-tooltip-grid.is-multicolumn {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spread-scroll-delta-tooltip-item {
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
}

.spread-scroll-delta-tooltip-diff {
  overflow: hidden;
  margin-bottom: 1px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spread-scroll-delta-tooltip-values {
  overflow: hidden;
  color: #dce2ec;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spread-scroll-delta-tooltip-issue {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  white-space: pre-wrap;
}

.spread-scroll-delta-tooltip.is-dense {
  font-size: 11px;
  line-height: 1.35;
}

.spread-scroll-delta-tooltip.is-dense .spread-scroll-delta-tooltip-item {
  padding: 3px 5px;
}

.spread-scroll-delta-tooltip.is-simple .spread-scroll-delta-tooltip-item {
  padding: 0;
}

.spread-scroll-delta-tooltip.is-simple {
  width: auto;
  max-width: 320px;
  padding: 8px 10px;
  white-space: pre-wrap;
}

@media (max-width: 700px) {
  .spread-scroll-delta-tooltip-grid.is-multicolumn {
    grid-template-columns: minmax(0, 1fr);
  }
}

.volume-compare-chart-empty {
  padding: 24px 12px;
  border-top: 1px solid #393944;
  color: #aaa;
  text-align: center;
}

@media (max-width: 600px) {
  .volume-compare-chart-header {
    align-items: stretch;
    flex-direction: column;
  }

  .spread-scroll-header-actions {
    align-items: flex-end;
  }
}

.placeholder {
  margin-top: 24px;
  padding: 16px;
  background: #111;
  border-radius: 8px;
  color: #aaa;
}

.language-switch {
  display: flex;
  gap: 8px;
}

.lang-button {
  padding: 6px 12px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #23232b;
  color: #ddd;
  cursor: pointer;
}

.lang-button:hover {
  background: #2d2d38;
}

.lang-button.active {
  background: #3a3a48;
  color: #fff;
  border-color: #777;
}

.ok {
  color: #9aa0a6;
}

.warn {
  color: #fbbc04;
}

.error {
  color: #ff6b6b;
}

.separator {
  border-top: 1px solid #444;
  margin: 12px 0;
}

.file-header {
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
}

.kiai-on {
  color: #4ade80;
}

.kiai-off {
  color: #f87171;
}

.highlight {
  background: rgba(255, 107, 107, 0.1);
}

pre {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.tab-visibility-settings {
  margin-top: 20px;
}

.settings-button {
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #23232b;
  color: #ddd;
  cursor: pointer;
}

.settings-button:hover {
  background: #2d2d38;
}

.tab-settings-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #1f1f26;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tab-settings-panel.hidden {
  display: none;
}

.tab-settings-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-button.hidden-tab {
  display: none;
}

/* チェック対象（ファイル / osu! 連動）切替 — Electron 専用 */
.osu-source-settings {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: 1px solid #4a4a58;
  border-radius: 8px;
  background: #23232c;
}

.osu-source-settings[hidden] {
  display: none;
}

.osu-source-title {
  font-size: 12px;
  font-weight: 700;
  color: #cfcfe0;
  letter-spacing: 0.03em;
}

.osu-source-option {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #ddd;
  cursor: pointer;
}

.osu-source-option input {
  cursor: pointer;
}

.osu-source-reload {
  align-self: flex-start;
  margin-top: 2px;
}

.osu-source-reload[hidden] {
  display: none;
}

.osu-source-status {
  font-size: 11.5px;
  color: #8a8a9a;
  min-height: 1em;
}

.osu-source-status.error { color: #d98a8a; }
.osu-source-status.ok    { color: #8ac49a; }

.tab-panel.hidden-tab {
  display: none !important;
}

.top-links a {
  text-decoration: none;
  color: #9fdcff;
  font-size: 14px;
}

.top-links a:hover {
  text-decoration: underline;
}

.top-links {
  position: absolute;
  top: 8px;
  right: 0;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.doc-btn {
  padding: 6px 10px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #23232b;
  color: #ddd;
  font-size: 13px;
}

.doc-btn:hover {
  background: #2d2d38;
}

/* 設定だけ少し強調 */
#toggleTabSettings {
  border-color: #777;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1e1e26;
  padding: 20px 24px;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  color: #eee;
}

.close {
  float: right;
  cursor: pointer;
  font-size: 20px;
}

/* ヘッダーを2列に分割 */
.app {
  position: relative;
}

/* 右上に固定 */
.top-links {
  position: absolute;
  top: 8px;
  right: 0;

  display: flex;
  gap: 8px;
}

/* ボタン風に */
.top-links-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.top-links .language-switch {
  justify-content: flex-end;
}

.app > h1,
.app > p[data-i18n="subtitle"] {
  margin-right: 400px;
}

@media (max-width: 760px) {
  .top-links {
    position: static;
    align-items: flex-end;
    margin-bottom: 16px;
  }

  .app > h1,
  .app > p[data-i18n="subtitle"] {
    margin-right: 0;
  }
}

.top-links a,
.doc-btn {
  padding: 6px 10px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #23232b;
  color: #ddd;
  text-decoration: none;
  font-size: 13px;
}

.top-links a:hover,
.doc-btn:hover {
  background: #2d2d38;
}

.timestamp-link {
  color: #9fdcff;
  text-decoration: none;
}

.timestamp-link:hover {
  text-decoration: underline;
}

/** [Diff名]の色 */
.diff-name {
  color: #6b9aff;
  font-weight: 500;
}

code {
  background: #1f2a38;        /* 濃い青系 */
  color: #7fd1ff;             /* 薄い青（重要） */
  padding: 2px 6px;
  border-radius: 4px;
  font-family: Consolas, monospace;
}

.tab-button.has-warnings {
  border-color: #fbbc04;
  color: #ffd580;
}

.tab-button.has-warnings.active {
  background: #4a3a20;
  border-color: #fbbc04;
  color: #fff;
}

.tab-button.has-errors {
  border-color: #ff6b6b;
  color: #ff8a8a;
}

.tab-button.has-errors.active {
  background: #4a252a;
  border-color: #ff6b6b;
  color: #fff;
}

/** BN評価 */
.tab-button.bn-tab-button {
  border-color: #4ade80;
  color: #9ff2b2;
}

.tab-button.bn-tab-button.active {
  background: #1f3a2a;
  border-color: #4ade80;
  color: #fff;
}

.bn-compare-panel {
  margin-top: 8px;
}

.bn-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.bn-file-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bn-file-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal; 
}

.bn-diff-matching {
  margin: 12px 0;
  padding: 12px;
  background: #111;
  border-radius: 8px;
}

.bn-match-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.bn-match-before {
  color: #6b9aff;
}

.bn-match-arrow {
  color: #aaa;
}

.bn-result-controls {
  margin: 16px 0;
}

.bn-subtabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.bn-subtab-button {
  padding: 8px 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #23232b;
  color: #ddd;
  cursor: pointer;
}

.bn-subtab-button.active {
  background: #3a3a48;
  color: #fff;
  border-color: #777;
}

.bn-subtab-panel {
  display: none;
}

.bn-subtab-panel.active {
  display: block;
}

.bn-note {
  padding: 1px 5px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  background: #222;
}

.bn-note::before {
  opacity: 0.8;
}

.bn-note::after {
  opacity: 0.8;
}

.bn-d {
  color: #ff6b6b;
}

.bn-k {
  color: #7fb7ff;
}

.bn-slider {
  color: #ffd166;
}

.bn-spinner {
  color: #aaa;
}

.bn-offset-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.bn-offset-status {
  color: #ddd;
  font-family: Consolas, monospace;
}

/** BN評価欄の、メタデータの表 */
.bn-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: #111;
}

.bn-meta-table th,
.bn-meta-table td {
  border: 1px solid #333;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.bn-meta-table thead th {
  background: #23232b;
  color: #ddd;
}

.bn-meta-table tbody th {
  width: 180px;
  color: #9fdcff;
  font-weight: 500;
}

.bn-meta-same {
  color: #9aa0a6;
}

.bn-tags-block {
  margin-top: 16px;
  padding: 12px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
}

.bn-tags-block h4 {
  margin: 0 0 10px;
  color: #ddd;
}

.bn-tags-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  margin: 8px 0;
}

.bn-tags-label {
  color: #aaa;
}

.bn-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bn-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #222;
  font-family: Consolas, monospace;
}

.bn-tag-removed {
  color: #ff8a8a;
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.bn-tag-added {
  color: #9ff2b2;
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.bn-section-title {
  margin-top: 10px;
  margin-bottom: 6px;
  color: #9fdcff;
  font-weight: 600;
}

/** プルダウン */
select {
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px 6px;
}

/** ファイル選択ボタン */
input[type="file"] {
  color: #fff;
}
input[type="file"]::file-selector-button {
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  background-color: #3a3a3a;
}

.result-warn {
  color: #fbbc04;
}

.author {
  font-size: 0.45em;
  color: #666;
  opacity: 0.8;
}

.result-error {
  color: #ff6b6b;
}

/** スプレッドタブ用 */
.spread-subtab-button {
  padding: 8px 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #23232b;
  color: #ddd;
  cursor: pointer;
}

.spread-subtab-button.active {
  background: #3a3a48;
  color: #fff;
  border-color: #777;
}

.spread-subtab-panel {
  display: none;
}

.spread-subtab-panel.active {
  display: block;
}

.spread-order-actions {
  margin-bottom: 12px;
}

.spread-order-button {
  margin-right: 4px;
  padding: 2px 6px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #23232b;
  color: #ddd;
  cursor: pointer;
  font-family: Consolas, monospace;
}

.spread-order-button:hover:not(:disabled) {
  background: #2d2d38;
}

.spread-order-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.spread-category-select {
  box-sizing: border-box;
  width: 16ch;
  padding: 2px 6px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #23232b;
  color: #ddd;
  font: inherit;
  vertical-align: middle;
}

.spread-category-unknown {
  background: #3a3320;
  border-color: #fbbc04;
  color: #fbbc04;
}

.spread-subtab-button.has-warnings {
  border-color: #fbbc04;
  color: #ffd580;
}

.spread-subtab-button.has-warnings.active {
  background: #4a3a20;
  border-color: #fbbc04;
  color: #fff;
}

.spread-subtab-button.has-errors {
  border-color: #ff6b6b;
  color: #ff9a9a;
}

.spread-subtab-button.has-errors.active {
  background: #4a2020;
  border-color: #ff6b6b;
  color: #fff;
}

/** 区切り線 */
.result-separator {
  border-top: 1px solid #444;
  margin: 18px 0;
}

.result-separator-line {
  display: block;
  border-top: 1px solid #444;
  margin: 16px 0;
}

/** 見出しの色 */
.result-section-title {
  margin: 14px 0 10px;
  color: #f3f3f3;
  font-size: 1.17em;
  font-weight: 700;
}


.result-option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #3d3d48;
  border-radius: 6px;
  background: #202029;
}

.result-option-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: normal;
}

.result-option-group select {
  min-width: 96px;
}

.result-option-group input[type="checkbox"] {
  margin: 0;
}

/** スプレッドタブのFinisher */
.spread-finisher-d {
  color: #ff6b6b;
  font-weight: bold;
}

.spread-finisher-k {
  color: #6b9aff;
  font-weight: bold;
}

.bn-subtab-button.has-warnings {
  border-color: #fbbc04;
  color: #fbbc04;
}

.bn-subtab-button.has-errors {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.bn-subtab-button.active.has-warnings {
  background: #4a3a20;
  border-color: #fbbc04;
  color: #fff;
}

.bn-subtab-button.active.has-errors {
  background: #4a2020;
  border-color: #ff6b6b;
  color: #fff;
}

/** Tagの一覧表示 */
.tag-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

.tag-token {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #222;
  border: 1px solid #444;
  color: #f0f0f0;
  font-family: Consolas, monospace;
  font-size: 0.95em;
}

/** BNタブのOD/HP */
.bn-difficulty-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: #111;
}

.bn-difficulty-table th,
.bn-difficulty-table td {
  border: 1px solid #333;
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.bn-difficulty-table thead th {
  background: #23232b;
  color: #ddd;
}

.bn-difficulty-table tbody td:first-child {
  color: #9fdcff;
  font-family: Consolas, monospace;
}

.result-info {
  color: #8ecdfc;
  font-weight: 600;
}

.bn-difficulty-table th:nth-child(2),
.bn-difficulty-table th:nth-child(3),
.bn-difficulty-table td:nth-child(2),
.bn-difficulty-table td:nth-child(3) {
  min-width: 90px;
  white-space: nowrap;
}

/** BNタイムライン表示 */
.bn-timeline-block {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
}

.bn-timeline-header {
  margin-bottom: 8px;
  color: #ddd;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
}

.bn-timeline-grid {
  margin-left: 8px;
  color: #aaa;
}

.bn-timeline-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.bn-timeline-label {
  color: #aaa;
  font-size: 12px;
}

.bn-timeline-cells {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  font-family: "JetBrains Mono", Consolas, monospace;
  line-height: 1.6;
}

.bn-timeline-cell {
  display: inline-block;
  width: 14px;
  text-align: center;
}

.bn-empty {
  color: #555;
}

.bn-overflow {
  color: #fbbc04;
  font-weight: bold;
}

.bn-timeline-warning {
  color: #fbbc04;
  font-size: 13px;
}

.bn-timeline-chunk-label {
  font-size: 11px;
  color: #a8b3c7;
  margin: 4px 0 2px;
  font-family: Consolas, monospace;
}

.misc-section + .misc-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #333;
}

.result-note {
  color: #b8b8b8;
}

/** タイムライン表示 */
.tab-button.timeline-tab-button {
  border-color: #4ade80;
  color: #9ff2b2;
}

.tab-button.timeline-tab-button.active {
  background: #1f3a2a;
  border-color: #4ade80;
  color: #fff;
}

.timeline-measure {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #7a6f5a;
  border-radius: 8px;
  background: #111;
  overflow-x: auto;
}

.timeline-measure-title {
  margin-bottom: 8px;
  color: #7fdcff;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
}

.timeline-measure pre {
  margin: 0;
  white-space: pre;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.9;
}

.timeline-cell {
  display: inline-block;
  width: 14px;
  text-align: center;
}

.timeline-cell {
  font-size: 13px;
  line-height: 16px;
  height: 16px;
  padding: 0 2px;
  font-weight: 600;
}

.timeline-empty {
  color: #555;
}

.timeline-unsupported {
  color: #ff6b6b;
}

.timeline-cell.timeline-kiai {
  background: rgba(255, 216, 107, 0.18);
  border-radius: 3px;
}

.timeline-cell.timeline-kiai .bn-note {
  background: rgba(255, 216, 107, 0.04);
}

.modal-content {
  max-height: 85vh;
  overflow-y: auto;
}

.update-date {
  margin-top: 24px;
  margin-bottom: 8px;

  padding-bottom: 4px;

  border-bottom: 1px solid #444;

  color: #9fdcff;
  font-size: 18px;
}

[data-electron-only] {
  display: none !important;
}

.tab-button.sr-calculator-tab-button,
.tab-button.spectrogram-tab-button {
  border-color: #4ade80;
  color: #9ff2b2;
}

.tab-button.sr-calculator-tab-button.active,
.tab-button.spectrogram-tab-button.active {
  background: #1f3a2a;
  border-color: #4ade80;
  color: #fff;
}

.sr-calculator-panel {
  max-width: 520px;
}

.sr-calculator-panel h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.sr-calculator-help,
.sr-calculator-meta,
.sr-calculator-status {
  margin: 0 0 14px;
}

.sr-calculator-help,
.sr-calculator-meta {
  color: #b8b8b8;
}

.sr-calculator-ruleset {
  display: grid;
  grid-template-columns: max-content minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: #cfd3df;
  font-size: 13px;
  font-weight: 700;
}

.sr-calculator-ruleset select {
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #555563;
  border-radius: 4px;
  background: #24242c;
  color: #f3f3f3;
  font: inherit;
  font-weight: 400;
}

.sr-calculator-mods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 14px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid #3d3d48;
}

.sr-calculator-mods legend {
  padding: 0 8px 0 0;
  color: #cfd3df;
  font-size: 13px;
  font-weight: 700;
}

.sr-calculator-mods label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
}

.sr-calculator-mods input {
  margin: 0;
}

.sr-calculator-output {
  min-width: 0;
  overflow-x: auto;
}

.sr-calculator-table {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #444;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.sr-calculator-table th,
.sr-calculator-table td {
  padding: 9px 8px;
  border: 0;
  border-right: 1px solid #444;
  border-bottom: 1px solid #444;
  text-align: left;
  overflow-wrap: anywhere;
}

.sr-calculator-table th:last-child,
.sr-calculator-table td:last-child {
  border-right: 0;
}

.sr-calculator-table tbody tr:last-child td {
  border-bottom: 0;
}

.sr-calculator-table th {
  background: #29292f;
  color: #ddd;
}

.sr-calculator-table th:last-child,
.sr-calculator-table td:last-child {
  width: 120px;
  text-align: right;
}

.sr-calculator-rating-cell {
  white-space: nowrap;
}

.sr-calculator-badge {
  box-sizing: border-box;
  display: inline-flex;
  min-width: 76px;
  padding: 3px 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0;
  -webkit-text-stroke: 0.25px currentColor;
  text-shadow: 0 0 0 currentColor;
}

.sr-calculator-badge-loading {
  background: #34343d;
  color: #aeb2bd;
  -webkit-text-stroke: 0;
  text-shadow: none;
}
