:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #171d22;
  --panel-strong: #202830;
  --text: #edf4f2;
  --muted: #9fb0ae;
  --line: #314049;
  --accent: #e2b84b;
  --accent-soft: rgba(226, 184, 75, 0.14);
  --danger: #ee6b6e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.topbar p,
.updated span,
.day-date,
.attendee-status {
  color: var(--muted);
}

.updated {
  min-width: 180px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  text-align: right;
}

.updated span,
.updated strong {
  display: block;
}

.updated strong {
  margin-top: 4px;
}

.status {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.day {
  min-height: 148px;
  padding: 10px;
  background: var(--panel);
}

.day.today {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.day-name {
  font-weight: 750;
}

.day-date {
  margin-top: 2px;
  font-size: 0.84rem;
}

.events {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.event {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.event:hover,
.event:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.event-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.event-time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.close {
  float: right;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
}

.details-title {
  margin: 0 42px 6px 0;
  font-size: 1.4rem;
}

.details-meta {
  color: var(--muted);
}

.attendees {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  max-height: 560px;
  overflow: auto;
}

.status-group h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.attendee-list {
  display: grid;
  gap: 6px;
}

.attendee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--panel-strong);
}

.attendee-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.attendee-status {
  flex: 0 0 auto;
}

@media (max-width: 780px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .updated {
    text-align: left;
  }

  .calendar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .day {
    min-height: auto;
  }
}
