:root {
  --bg: #0f1220;
  --fg: #e8ecff;
  --muted: #9aa3c7;
  --panel: #151935;
  --accent: #6ea8fe;
  --line: #252b5a;
  --btn: #202752;
  --btnb: #2b3470;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, Segoe UI, Roboto, Arial;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: linear-gradient(180deg, #1a2045, #131836);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  margin: 0 8px 0 0;
  font-size: 16px;
  letter-spacing: .3px;
  color: #cbd5ff;
}

.bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn {
  background: var(--btn);
  color: var(--fg);
  border: 1px solid var(--btnb);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.2s;
}

.btn:hover {
  border-color: #3a4799;
}

.sep {
  flex: 1;
}

.stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #cbd5ff;
  align-items: center;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .4px;
  font-size: 12px;
  border: 1px solid #0002;
}

.pill-running {
  background: #082e15;
  border-color: #0004;
  color: #bff6cf;
  box-shadow: 0 0 0 1px #16a34a inset;
}

.pill-paused {
  background: #3b0b0b;
  border-color: #0004;
  color: #ffd1d1;
  box-shadow: 0 0 0 1px #ef4444 inset;
}

.wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 52px);
}

aside {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 12px;
  overflow: auto;
}

.group {
  margin-bottom: 16px;
}

.title {
  font-size: 12px;
  color: #cbd5ff;
  opacity: .9;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tool {
  width: 100%;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

main {
  position: relative;
  background: #0b0e1a;
}

#stage {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(#10142f 1px, transparent 1px) 0 0/24px 24px,
    linear-gradient(90deg, #10142f 1px, transparent 1px) 0 0/24px 24px,
    #0b0e1a;
}

.copyright {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 12px;
  color: #9aa3c7;
  opacity: .85;
}

/* Modal (TT) */
.modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-box {
  width: min(920px, calc(100% - 40px));
  max-height: min(80vh, 680px);
  background: #0f1533;
  border: 1px solid #283066;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px #0006;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #283066;
  cursor: move;
  user-select: none;
}

.modal-head * {
  user-select: none;
}

.modal-head h3 {
  margin: 0;
  font-size: 14px;
  color: #cbd5ff;
}

.tt-info {
  padding: 8px 12px;
  font-size: 12px;
  color: #9aa3c7;
  border-bottom: 1px solid #283066;
}

.tt-table-wrap {
  overflow: auto;
  padding: 8px;
}

.tt-table {
  border-collapse: collapse;
  font-size: 12px;
}

.tt-table th,
.tt-table td {
  border: 1px solid #283066;
  padding: 6px 8px;
  white-space: nowrap;
}

.tt-table th {
  background: #171d42;
  color: #cbd5ff;
  position: sticky;
  top: 0;
}

.tt-table td {
  background: #0e1433;
  color: #e8ecff;
  text-align: center;
}
