:root {
  color-scheme: light dark;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 2rem clamp(2rem, 5vw, 6rem) 2rem clamp(1rem, 3vw, 2.5rem);
  background: radial-gradient(circle at top left, #1d4ed8, transparent 55%),
    radial-gradient(circle at bottom right, #f97316, transparent 55%), #0f172a;
}

.app {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  width: min(1280px, 100%);
  grid-template-columns: minmax(360px, 430px) minmax(540px, 1fr);
  align-items: flex-start;
}

.panel {
  background: rgba(15, 23, 42, 0.82);
  border-radius: 1.65rem;
  padding: clamp(1.85rem, 2.7vw, 2.7rem);
  box-shadow: 0 28px 60px -18px rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.player {
  position: sticky;
  top: 50vh;
  transform: translateY(-50%);
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.75rem;
  padding: clamp(1rem, 2vw, 2.5rem) 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  letter-spacing: 0.01em;
}

.lead {
  margin: 0;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.85);
}

.file-input {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: #2563eb;
  color: white;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 18px 35px -18px rgba(37, 99, 235, 0.9);
}

.file-input input {
  display: none;
}

.file-input:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px -18px rgba(37, 99, 235, 0.9);
}

.status {
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  background: rgba(148, 163, 184, 0.12);
  font-size: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.threshold-settings {
  display: grid;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.threshold-settings input[type="range"] {
  width: 100%;
  accent-color: #f97316;
}

.plot-container {
  padding: 1.3rem 1.4rem;
  border-radius: 1.1rem;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plot-container h2 {
  margin: 0;
  font-size: 1.15rem;
}

.plot-canvas {
  display: block;
  width: 100%;
  height: 220px;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.plot-hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.65);
}

.silence-summary {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.silence-summary h2 {
  margin: 0;
  font-size: 1.15rem;
}

#silenceList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.silence-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0.9rem;
}

.silence-item.empty {
  justify-content: center;
  color: rgba(226, 232, 240, 0.62);
  font-style: italic;
}

.silence-item.active {
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.35);
}

.jump-button {
  background: rgba(249, 115, 22, 0.92);
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.35rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.jump-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px -18px rgba(249, 115, 22, 0.82);
}

.video-shell {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
}

.video-frame {
  width: min(100%, 940px);
  border-radius: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.65);
  aspect-ratio: 16 / 9;
  object-fit: contain;
  box-shadow: 0 40px 60px -24px rgba(15, 23, 42, 0.8);
  overflow: hidden;
}

.video-frame::-webkit-media-controls-panel {
  opacity: 0;
  transition: opacity 160ms ease;
}

.video-frame:hover::-webkit-media-controls-panel,
.video-frame:focus-visible::-webkit-media-controls-panel,
.video-frame:focus-within::-webkit-media-controls-panel {
  opacity: 1;
}

.video-frame::-webkit-media-controls-start-playback-button {
  display: none;
}

@media (hover: none) {
  .video-frame::-webkit-media-controls-panel {
    opacity: 1;
  }
}

.timeline-wrapper {
  position: relative;
  pointer-events: none;
  width: min(100%, 940px);
  margin-top: 1rem;
}

.timeline-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.16),
    0 16px 36px -18px rgba(15, 23, 42, 0.82);
  overflow: hidden;
}

.timeline-progress {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 60ms linear;
  pointer-events: none;
}

.skip-summary {
  width: min(100%, 940px);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.7);
  margin-top: -0.25rem;
}

@media (max-width: 900px) {
  body {
    padding: 1.75rem;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .player {
    position: static;
    top: auto;
    transform: none;
    padding: 1.5rem 0 0;
    gap: 1.75rem;
  }

  .timeline-wrapper {
    position: static;
    transform: none;
    width: 100%;
  }
}

@media (max-width: 720px) {
  body {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.7rem;
  }

  .plot-canvas {
    height: 180px;
  }
}
