:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #0d0d0d;
  color: #f0f0f0;
}

h1 {
  text-align: center;
  font-size: 1.4rem;
  margin: 8px 0 12px;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 14px;
}

.tab-btn {
  background: #1e1e1e;
  color: #888;
  border: 1px solid #333;
  padding: 6px 28px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-btn:first-child {
  border-radius: 20px 0 0 20px;
}

.tab-btn:last-child {
  border-radius: 0 20px 20px 0;
  border-left: none;
}

.tab-btn.active[data-tab="team"] {
  background: #1a4d24;
  color: #39ff14;
  border-color: #39ff14;
}

.tab-btn.active[data-tab="personal"] {
  background: #0a1f3c;
  color: #00b4ff;
  border-color: #00b4ff;
}

.hidden {
  display: none !important;
}

.legend {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  color: #aaa;
  gap: 4px;
}

.legend-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

/* Team (green) swatches */
.team-swatch[data-level="0"] { background-color: #1a1a1a; }
.team-swatch[data-level="1"] { background-color: #16331c; }
.team-swatch[data-level="2"] { background-color: #135523; }
.team-swatch[data-level="3"] { background-color: #0f7a2b; }
.team-swatch[data-level="4"] { background-color: #0ba032; }
.team-swatch[data-level="5"] { background-color: #2ed94f; }
.team-swatch[data-level="6"] { background-color: #39ff14; }

/* Personal (blue) swatches */
.personal-swatch[data-level="0"] { background-color: #1a1a1a; }
.personal-swatch[data-level="1"] { background-color: #0a1929; }
.personal-swatch[data-level="2"] { background-color: #0d2f52; }
.personal-swatch[data-level="3"] { background-color: #0d4777; }
.personal-swatch[data-level="4"] { background-color: #0d62a8; }
.personal-swatch[data-level="5"] { background-color: #1a80d4; }
.personal-swatch[data-level="6"] { background-color: #00b4ff; }

.status {
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  min-height: 1.2em;
  margin-bottom: 8px;
}

.doc {
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 0.9rem;
  color: #ccc;
}

.doc ul {
  padding-left: 1.2em;
}

.matrix {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: min(420px, calc(100vw - 32px));
  margin: 0 auto;
  height: calc(100vh - 170px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  scroll-behavior: auto;
}

.weekday-label {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0d0d0d;
  text-align: center;
  font-size: 0.7rem;
  color: #888;
  padding: 4px 0;
  min-width: 0;
  overflow: hidden;
}

.day-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #ddd;
  overflow: hidden;
  white-space: nowrap;
}

.day-cell.is-today {
  outline: 2px solid #ffffff;
  outline-offset: -2px;
  font-weight: bold;
}

.day-cell.is-placeholder {
  visibility: hidden;
}
