:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: rgba(15, 20, 29, .78);
  --panel-solid: #0f141d;
  --border: rgba(255, 255, 255, .085);
  --text: #f4f7fb;
  --muted: #8a95a6;
  --accent: #8b7cf6;
  --accent-soft: rgba(139, 124, 246, .15);
  --success: #42d89c;
  --warning: #f7c76b;
  --danger: #ff6b7d;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); overflow-x: hidden; }
button { font: inherit; }
.ambient { position: fixed; width: 560px; height: 560px; border-radius: 50%; filter: blur(120px); opacity: .13; pointer-events: none; }
.ambient-one { top: -260px; left: -180px; background: #6959ff; }
.ambient-two { right: -250px; top: 180px; background: #1ec9a5; opacity: .08; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 48px; position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 52px; }
.brand { display: flex; gap: 14px; align-items: center; }
.mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: linear-gradient(145deg,#26213f,#11151d); color: #b9b0ff; font-weight: 750; box-shadow: inset 0 1px rgba(255,255,255,.08); }
.eyebrow, .panel-kicker { margin: 0 0 4px; color: #777f91; font-size: 10px; letter-spacing: .16em; font-weight: 700; }
h1 { font-size: 18px; margin: 0; letter-spacing: -.02em; }
.refresh-button, .all-button { border: 1px solid var(--border); background: rgba(255,255,255,.035); color: #dce2ed; border-radius: 11px; cursor: pointer; transition: .2s ease; }
.refresh-button { height: 40px; padding: 0 14px; display: flex; align-items: center; gap: 8px; }
.refresh-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.refresh-button:hover, .all-button:hover { background: rgba(255,255,255,.075); border-color: rgba(255,255,255,.14); transform: translateY(-1px); }
.refresh-button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 34px; }
.hero h2 { font-size: clamp(34px, 5vw, 58px); letter-spacing: -.055em; line-height: 1.04; margin: 14px 0 16px; }
.hero p { color: var(--muted); max-width: 620px; line-height: 1.7; margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(66,216,156,.08); margin: 0 9px 1px 4px; }
.updated { text-align: right; flex: 0 0 auto; padding-bottom: 5px; }
.updated span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.updated strong { font-size: 13px; font-weight: 520; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); backdrop-filter: blur(18px); overflow: hidden; margin-bottom: 18px; }
.stat-card { min-height: 154px; padding: 24px; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.stat-card:last-child { border-right: 0; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 34px; letter-spacing: -.04em; margin: auto 0 9px; }
.stat-value span { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 5px; }
.stat-value.compact { font-size: 20px; letter-spacing: -.025em; }
.stat-caption { color: #697486; font-size: 11px; }
.status-card .badge { margin: auto 0 12px; align-self: flex-start; }
.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 6px 10px; font-size: 10px; font-weight: 750; letter-spacing: .08em; border: 1px solid; }
.badge-success { color: var(--success); border-color: rgba(66,216,156,.23); background: rgba(66,216,156,.08); }
.badge-failed { color: var(--danger); border-color: rgba(255,107,125,.24); background: rgba(255,107,125,.08); }
.badge-idle { color: var(--muted); border-color: var(--border); background: rgba(255,255,255,.03); }

.content-grid { display: grid; grid-template-columns: .88fr 1.12fr; gap: 18px; }
.panel { background: var(--panel); backdrop-filter: blur(18px); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; min-width: 0; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.panel-heading h3, .dialog-head h3 { font-size: 16px; margin: 0; letter-spacing: -.02em; }
.record-count { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 5px 9px; }
.chart { height: 285px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; padding-top: 18px; }
.bar-column { height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 9px; min-width: 0; }
.bar-track { height: 220px; width: 100%; border-radius: 8px; background: rgba(255,255,255,.025); display: flex; align-items: end; overflow: hidden; position: relative; }
.bar { width: 100%; min-height: 3px; border-radius: 8px; background: linear-gradient(180deg, #9c8eff, #6f61dc); box-shadow: 0 -7px 30px rgba(139,124,246,.18); transition: height .5s cubic-bezier(.2,.8,.2,1); }
.bar-value { color: #cbd2df; font-size: 11px; }
.bar-label { color: #687284; font-size: 10px; white-space: nowrap; }

.run-list { display: grid; gap: 2px; }
.run-item { width: 100%; display: grid; grid-template-columns: minmax(130px, 1fr) auto 26px; gap: 16px; align-items: center; padding: 15px 12px; border: 0; border-bottom: 1px solid rgba(255,255,255,.055); background: transparent; color: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.run-item:hover { background: rgba(255,255,255,.035); }
.run-time strong { display: block; font-size: 13px; font-weight: 580; margin-bottom: 5px; }
.run-time span { color: var(--muted); font-size: 11px; }
.run-counts { display: flex; gap: 13px; color: var(--muted); font-size: 11px; }
.run-counts b { color: #e5e9f0; font-weight: 600; }
.chevron { color: #60697a; font-size: 18px; }
.empty-state { min-height: 210px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.all-button { width: 100%; height: 40px; margin-top: 18px; }
footer { display: flex; justify-content: space-between; color: #4f5868; font-size: 11px; padding: 24px 4px 0; }

.detail-dialog { width: min(680px, calc(100% - 32px)); max-height: min(760px, calc(100vh - 48px)); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; color: var(--text); background: #0c1119; padding: 0; box-shadow: 0 30px 100px rgba(0,0,0,.65); }
.detail-dialog::backdrop { background: rgba(2,4,8,.76); backdrop-filter: blur(6px); }
.dialog-head { padding: 22px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #0c1119; z-index: 1; }
.close-button { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.03); cursor: pointer; font-size: 20px; }
.detail-content { padding: 24px; overflow: auto; }
.detail-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 22px; }
.detail-stat { padding: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--border); border-radius: 12px; }
.detail-stat span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.detail-stat strong { font-size: 18px; }
.detail-section { margin-top: 24px; }
.detail-section h4 { font-size: 12px; margin: 0 0 10px; color: #c7cedb; }
.song-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.045); font-size: 12px; line-height: 1.5; }
.result-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; margin-top: 5px; }
.result-success { background: var(--success); }
.result-skipped { background: var(--warning); }
.result-failed { background: var(--danger); }
.song-row small { display: block; color: var(--muted); margin-top: 2px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 18px); opacity: 0; background: #171d28; border: 1px solid var(--border); color: #dfe5ef; border-radius: 10px; padding: 11px 15px; font-size: 12px; transition: .22s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .stat-card:nth-child(2) { border-right: 0; }
  .stat-card:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 20px; }
  .topbar { margin-bottom: 38px; }
  .refresh-button { width: 40px; padding: 0; justify-content: center; font-size: 0; }
  .hero { display: block; }
  .hero h2 { font-size: 38px; }
  .updated { text-align: left; margin-top: 22px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 132px; padding: 18px; }
  .stat-value { font-size: 28px; }
  .stat-value.compact { font-size: 15px; }
  .panel { padding: 18px; }
  .chart { height: 240px; gap: 5px; }
  .bar-track { height: 178px; }
  .bar-label { font-size: 9px; }
  .run-item { grid-template-columns: 1fr 20px; }
  .run-counts { grid-column: 1 / -1; grid-row: 2; }
  .chevron { grid-column: 2; grid-row: 1; }
  .detail-grid { grid-template-columns: repeat(2,1fr); }
}
