:root {
  --bg: #f6f5ef;
  --ink: #1f2933;
  --muted: #5f6c7b;
  --accent: #0b7a75;
  --accent-soft: #d6f2ef;
  --panel: #ffffffde;
  --line: #dde5ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #fff7d6 0%, transparent 30%),
              radial-gradient(circle at 90% 20%, #d6f2ef 0%, transparent 35%),
              var(--bg);
  min-height: 100vh;
  padding: 24px;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.3;
}

.bg-shape.one { width: 300px; height: 300px; top: -80px; right: -50px; background: #ffb38a; }
.bg-shape.two { width: 260px; height: 260px; bottom: -100px; left: -50px; background: #8ad7d2; }

.topbar h1 { margin: 0 0 8px; font-size: 2rem; }
.topbar p { margin: 0; color: var(--muted); }

.controls {
  display: grid;
  grid-template-columns: 220px minmax(360px, 620px);
  gap: 12px;
  margin: 20px 0;
}

label { display: grid; gap: 6px; font-weight: 600; }
select, input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
}

.time-slider-control {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.time-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 8px;
}

.time-slider-head strong {
  color: var(--accent);
  font-size: 0.9rem;
}

.time-slider-wrap {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}

.time-slider-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 999px;
  background: #dbe3ea;
  z-index: 1;
}

.time-slider-range {
  position: absolute;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b7a75, #169d94);
  box-shadow: 0 0 0 1px #0b7a7530 inset;
  z-index: 2;
  cursor: grab;
}

.time-slider-wrap input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  appearance: none;
  z-index: 3;
}

.time-slider-wrap input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #0b7a75;
  background: #fff;
  box-shadow: 0 2px 8px #0f2e2a33;
  -webkit-appearance: none;
  cursor: pointer;
  margin-top: -6px;
}

.time-slider-wrap input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #0b7a75;
  background: #fff;
  box-shadow: 0 2px 8px #0f2e2a33;
  cursor: pointer;
}

.time-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border: none;
}

.time-slider-wrap input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent;
  border: none;
}

.time-slider-wrap input[type="range"]::-moz-focus-outer {
  border: 0;
}

.time-slider-scale {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}

.consistent-option {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2a4a57;
  font-size: 0.84rem;
  font-weight: 600;
}

.consistent-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #0b7a75;
}

.grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 30px #0f2e2a14;
  backdrop-filter: blur(4px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-head span { color: var(--muted); }

.list-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.list-actions button {
  border: 1px solid #cfdbe6;
  background: #fff;
  color: #27414f;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}

.list-actions button:hover {
  background: #eef6fb;
}

.list-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shift-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfdbe6;
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  color: #314e5f;
}

.shift-target input {
  width: 56px;
  border: 1px solid #d8e2eb;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.8rem;
}

.streamer-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: none;
  overflow: auto;
}

.streamer-item {
  border: 1px solid #e9eef3;
  border-radius: 10px;
  padding: 10px;
  cursor: default;
  transition: transform 150ms ease, background 150ms ease;
}

.streamer-row {
  display: grid;
  grid-template-columns: 24px minmax(320px, auto) minmax(260px, 1fr);
  justify-content: start;
  gap: 8px 10px;
  align-items: start;
}

.streamer-check {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: #0b7a75;
}

.streamer-list .streamer-item:nth-child(odd) {
  background: #f9fcff;
}

.streamer-list .streamer-item:nth-child(even) {
  background: #f3f8f6;
}

.streamer-item:hover {
  background: #eaf7f5;
  transform: translateY(-1px);
}

.streamer-item.active {
  border-color: var(--accent);
  background: #ecfaf8;
}

.streamer-name { font-weight: 700; }
.streamer-meta { color: var(--muted); font-size: 0.84rem; margin-top: 4px; }
.streamer-time {
  font-size: 0.82rem;
  color: #284452;
  line-height: 1.35;
  border-left: 2px solid #d7e3ee;
  padding-left: 8px;
  min-height: 100%;
  word-break: break-word;
  max-width: 720px;
}

.streamer-time strong {
  display: inline-block;
  margin-right: 4px;
}

#detailContent { padding: 14px; }
.detail-empty { color: var(--muted); }

.detail-title { margin: 0 0 8px; }
.detail-sub { color: var(--muted); margin: 0 0 14px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th { background: #f4f8fb; }

.grouped-panel { margin-top: 14px; }
.coverage-container {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.coverage-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.coverage-card h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.95rem;
}

.coverage-role {
  font-size: 0.82rem;
  color: #4d5e6e;
  margin-bottom: 6px;
}

.coverage-list {
  margin: 0;
  padding-left: 16px;
}

.coverage-list li {
  margin-bottom: 6px;
  font-size: 0.84rem;
}

.coverage-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.clusters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.cluster {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.cluster h3 { margin: 0 0 8px; font-size: 0.95rem; color: var(--accent); }
.cluster ul { margin: 0; padding-left: 16px; max-height: 220px; overflow: auto; }
.cluster li { margin-bottom: 5px; font-size: 0.86rem; }
.multi-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #7a3e00;
  background: #ffe9d1;
  border: 1px solid #ffd2a5;
}

.full-list-panel {
  height: calc(100vh - 250px);
  min-height: 420px;
}

.full-list-panel .streamer-list {
  height: calc(100% - 56px);
}

@media (max-width: 980px) {
  .controls { grid-template-columns: 1fr; }
  .full-list-panel { height: calc(100vh - 320px); min-height: 320px; }
  .streamer-row { grid-template-columns: 1fr; }
  .streamer-time { border-left: 0; border-top: 1px solid #d7e3ee; padding-left: 0; padding-top: 6px; }
}
