:root {
  --bg: #262625;
  --surface: #3b3c3e;
  --accent: #4a4a4a;
  --fg: #eaeaea;
  --muted: #b3b3b3;
  --quiet: #9a9a9a;
  --line: #5a5a5a;
  --dot: #c8c8c8;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
.wrap {
  max-width: none;
  padding: 20px 28px 72px;
  margin: 0;
  text-align: left;
}
.hidden { display: none !important; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
}
.tabs, .chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  justify-content: flex-start;
}
.chips { margin: 14px 0 10px; flex-wrap: wrap; }

.session-meta {
  margin: 8px 0 4px;
  color: var(--muted);
}
.clock {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
.session, .counts {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.chip, button, .upload {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  padding: 8px 13px;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}
.chip.on, .upload {
  background: var(--accent);
  border-color: #7a7a7a;
}
.chip:hover, button:hover, .upload:hover {
  border-color: #8a8a8a;
}
.upload { display: inline-block; }
.upload input { display: none; }

input[type="password"] {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  margin-right: 8px;
}

#upload-status { min-height: 1.2em; margin: 8px 0 0; }

.panel {
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 16px 12px;
  overflow-x: auto;
}

.grid {
  border-collapse: collapse;
  width: max-content;
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}
.grid th,
.grid td {
  border: 1px solid var(--bg);
  padding: 10px 16px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.grid th {
  font-size: 12px;
  font-weight: 500;
  color: var(--quiet);
  letter-spacing: 0.02em;
}
.grid .name {
  white-space: nowrap;
}
.grid .mark-listed { color: var(--muted); }
.grid .mark-registered { color: #d4893a; }
.grid .mark-played { color: #6aa86a; }
.grid .mark-skipped { color: var(--quiet); opacity: 0.42; }
.grid .mark-registered .chip,
.grid .mark-played .chip,
.grid .mark-listed .chip,
.grid .mark-skipped .chip {
  color: inherit;
  border-color: currentColor;
  font-size: 15px;
  font-weight: 600;
}
.room-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-cell img {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
  flex: 0 0 22px;
  background: var(--bg);
}
.room-cell span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  padding: 8px 0 4px;
}
.card {
  background: var(--accent);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 10px;
  min-width: 140px;
}
.card b {
  display: block;
  font-size: 22px;
  font-weight: 500;
}
.card span { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.lead { font-size: 15px; font-weight: 500; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .wrap { padding: 12px 12px 48px; }
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .tabs {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }
  .tabs .chip,
  .upload,
  #logout {
    flex: 1 1 calc(50% - 8px);
    min-width: calc(50% - 8px);
    max-width: 100%;
    text-align: center;
    min-height: 44px;
    font-size: 13px;
    padding: 8px 8px;
  }
  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .chips .chip {
    flex: 1 1 calc(33.33% - 8px);
    min-width: 0;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 12px;
  }
  .panel {
    padding: 8px;
    overflow-x: hidden;
  }
  .grid,
  .grid thead,
  .grid tbody,
  .grid tr,
  .grid th,
  .grid td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .grid {
    width: 100% !important;
    font-size: 15px;
  }
  .grid thead { display: none; }
  .grid tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--accent);
    padding: 12px;
  }
  .grid td {
    border: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    white-space: normal;
    overflow: hidden;
  }
  .grid td[data-label]::before {
    content: attr(data-label);
    color: var(--quiet);
    font-size: 12px;
    font-weight: 500;
  }
  .grid td .chip {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .grid .name,
  .room-cell span {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .cards { flex-direction: column; }
  .card { min-width: 0; width: 100%; }
}
