:root {
  --bg: #000000;
  --panel: #060606;
  --line: #2a2a2a;
  --line-strong: #4a4a4a;
  --text: #ffffff;
  --muted: #bdbdbd;
  --ok: #ffffff;
  --warn: #9f9f9f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  background:
    linear-gradient(transparent 23px, #0f0f0f 24px),
    linear-gradient(90deg, transparent 23px, #0f0f0f 24px),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  padding: 18px 24px 12px;
  background: #000;
  border-bottom: 1px solid var(--line-strong);
}

.kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.3vw, 2rem);
  letter-spacing: 0.04em;
  font-weight: 600;
}

.stream {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 6px 10px;
  font-size: 0.76rem;
  color: var(--text);
  background: #000;
}

.stream-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: blink 1s steps(1, end) infinite;
}

.stream.offline .stream-dot {
  background: #7a7a7a;
  animation: none;
}

@keyframes blink {
  50% { opacity: 0.25; }
}

.layout {
  display: grid;
  gap: 12px;
  padding: 12px 24px 24px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  box-shadow: none;
}

.hero { grid-column: span 12; }
.mini { grid-column: span 4; }
.table-panel { grid-column: span 12; }

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

h2, h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.time {
  color: var(--muted);
  font-size: 0.78rem;
}

.hero-stats {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.hero-stats article {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #000;
}

.hero-stats small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.hero-stats strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1rem, 2vw, 1.6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.hero-stats strong.flash {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.meter {
  margin-top: 10px;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #000;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.28s linear;
}

.kv {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.kv li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.kv b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.kv b.good { color: var(--ok); }
.kv b.warn { color: var(--warn); }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.panel-head a {
  font-size: 0.78rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #444;
}

.task-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.task-head-actions button {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #000;
  color: #fff;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}

.task-head-actions button:hover {
  border-color: #fff;
}

.task-head-actions button.active {
  background: #fff;
  color: #000;
}

.focus-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.focus-actions button {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #000;
  color: #fff;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.focus-actions button:hover {
  border-color: #fff;
}

.focus-actions button.active {
  background: #fff;
  color: #000;
}

.table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.completed-wrap.hidden {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th, td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

th {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.task-row {
  transition: background-color 0.2s linear;
}

.task-row.execing { background: rgba(255, 255, 255, 0.03); }
.task-row.suspended { background: rgba(255, 255, 255, 0.01); }
.task-row.completed { background: rgba(255, 255, 255, 0.06); }

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 1px 6px;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.badge.exec {
  color: #fff;
  background: #0d0d0d;
  border-color: #fff;
}

.badge.susp {
  color: #b8b8b8;
  background: #090909;
  border-color: #3a3a3a;
}

.badge.done {
  color: #000;
  background: #fff;
  border-color: #fff;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .hero, .mini, .table-panel {
    grid-column: span 1;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .top {
    padding: 12px 10px 10px;
  }

}
