:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #20242c;
  --muted: #6c7380;
  --line: #dfe3e8;
  --accent: #126b5b;
  --accent-soft: #dff3ee;
  --mark: #b94724;
  --shadow: 0 18px 50px rgba(32, 36, 44, 0.09);
}

* {
  box-sizing: border-box;
}

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

button {
  font: inherit;
}

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

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
}

h2 {
  font-size: 22px;
}

.month-controls {
  display: grid;
  grid-template-columns: 44px minmax(150px, auto) 44px auto;
  align-items: center;
  gap: 8px;
}

.icon-button,
.today-button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 44px;
  font-size: 28px;
  line-height: 1;
}

.today-button {
  padding: 0 16px;
  font-weight: 800;
}

.month-label {
  min-width: 150px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.calendar-panel,
.agenda-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calendar-panel {
  overflow: hidden;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  border-bottom: 1px solid var(--line);
  background: #eef1f4;
}

.weekday-row span {
  padding: 12px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.day-cell {
  position: relative;
  min-height: 128px;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.day-cell.outside {
  background: #fafbfc;
  color: #9aa1ab;
}

.day-cell.today {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.day-number {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
}

.today .day-number {
  background: var(--accent);
  color: white;
}

.event-pill {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(18, 107, 91, 0.2);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  text-align: left;
}

.event-time {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.agenda-panel {
  padding: 20px;
}

.agenda-head {
  margin-bottom: 14px;
}

.agenda-list {
  display: grid;
  gap: 10px;
}

.agenda-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.agenda-date {
  color: var(--mark);
  font-size: 13px;
  font-weight: 900;
}

.agenda-title {
  margin-top: 5px;
  font-size: 16px;
  font-weight: 900;
}

.agenda-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 860px) {
  .toolbar {
    display: grid;
    align-items: start;
  }

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

  .month-controls {
    grid-template-columns: 44px 1fr 44px auto;
    width: 100%;
  }

  .day-cell {
    min-height: 92px;
    padding: 8px;
  }

  .event-pill {
    padding: 6px;
    font-size: 12px;
  }
}

@media (max-width: 540px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .weekday-row span {
    padding: 10px 3px;
    font-size: 12px;
  }

  .day-cell {
    min-height: 78px;
    padding: 5px;
  }

  .day-number {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .event-pill {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
