:root {
  --bg: #0f1419;
  --surface: #1a222d;
  --surface-hover: #232d3a;
  --border: #2d3a4a;
  --text: #e8eef4;
  --muted: #8b9cb0;
  --accent: #3b82f6;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 20% -10%, #1e3a5f 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #312e81 0%, transparent 50%), var(--bg);
  color: var(--text);
}

body {
  padding: 1.25rem;
}

.app {
  max-width: 960px;
  margin: 0 auto;
}

.header {
  margin-bottom: 1.5rem;
}

.title {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 52ch;
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.legend {
  margin-bottom: 1.75rem;
}

.people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.person-chip:hover {
  background: var(--surface-hover);
}

.person-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.person-chip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.person-chip .swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.calendar-section {
  background: rgba(26, 34, 45, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.25rem;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.month-label {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--surface-hover);
}

.btn-ghost {
  width: auto;
  padding: 0 0.75rem;
  font-size: 0.85rem;
  margin-left: 0.25rem;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.weekday-cell {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.35rem 0;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-cell {
  position: relative;
  min-height: 4.5rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.day-cell:hover:not(.outside) {
  background: var(--surface-hover);
}

.day-cell.outside {
  opacity: 0.38;
  cursor: default;
}

.day-cell.weekend:not(.outside) {
  background: rgba(26, 34, 45, 0.55);
}

.day-cell .day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.day-cell:not(.outside) .day-num {
  color: var(--text);
}

.day-cell .assignee {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 600;
  word-break: break-word;
}

.day-cell.has-assignee {
  border-color: transparent;
}

.footer {
  margin-top: 1.25rem;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

kbd {
  font-family: inherit;
  font-size: 0.75em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
}

@media (max-width: 520px) {
  .day-cell {
    min-height: 3.75rem;
    padding: 0.25rem;
  }

  .day-cell .assignee {
    font-size: 0.65rem;
  }
}
