<style>
  body { background: #f5f6f8; }
  .calendar, .selected-day-panel {
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 4px 18px rgba(0,0,0,.08);
  }
  .calendar { overflow: hidden; }
  .calendar-header { background-color: #e3f2fd; padding: 8px 8px; }
  .calendar-toolbar {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 8px;
  }
  .calendar-toolbar-left, .calendar-toolbar-center, .calendar-toolbar-right {
      display: flex;
      align-items: center;
      gap: 8px;
  }
  .calendar-toolbar-left { justify-content: flex-start; }
  .calendar-toolbar-center { justify-content: center; gap: 12px; }
  .calendar-toolbar-right { justify-content: flex-end; }
  .calendar-title { min-width: 260px; text-align: center; font-size: 1.6rem; font-weight: 600; }
  .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .calendar-weekday {
      background: gainsboro;
      color: #495057;
      font-weight: 600;
      text-align: center;
      padding: 12px;
      border-bottom: 1px solid #dee2e6;
  }
  .calendar-day {
      position: relative;
      min-width: 0;
      min-height: 80px;
      padding: 8px;
      background: #fff;
      border-right: 1px solid #dee2e6;
      border-bottom: 1px solid #dee2e6;
      cursor: pointer;
  }
  .calendar-day:nth-child(7n) { border-right: 0; }
  .calendar-day:hover { background: #f8fbff; }
  .calendar-day.other-month { background: #f8f9fa; color: #adb5bd; }
  .calendar-day.today { background: #e7f1ff; }
  .calendar-day.selected-day { outline: 3px solid #0d6efd; outline-offset: -3px; background: #eef6ff; }
  .day-number { font-size: .95rem; font-weight: 600; margin-bottom: 6px; }
  .today .day-number {
      display: inline-block;
      min-width: 28px;
      height: 28px;
      line-height: 28px;
      text-align: center;
      color: #fff;
      background: #0d6efd;
      border-radius: 50%;
  }
  .event {
      display: block;
      width: 100%;
      min-width: 0;
      margin-bottom: 4px;
      padding: 3px 6px;
      overflow: hidden;
      color: #084298;
      background: #cfe2ff;
      border-radius: 5px;
      font-size: .8rem;
      text-overflow: ellipsis;
      white-space: nowrap;
      cursor: pointer;
  }
  .event:hover { opacity: .85; }
  .event-time { font-weight: 600; margin-right: 4px; }
  .mobile-time-bars { display: none; }
  .mobile-time-bar {
      position: absolute;
      top: 50%;
      height: 8px;
      background: #0d6efd;
      border-radius: 999px;
      opacity: .75;
      transform: translateY(-50%);
  }
  .selected-day-panel { margin-top: 18px; padding: 8px; }
  .empty-day { color: #6c757d; }

  @media (max-width: 768px) {
      .calendar-wrapper { margin: 12px auto; }
      
      .calendar-title { min-width: auto; font-size: 1.2rem; }
      .calendar-weekday { padding: 2px 2px; font-size: .72rem; }
      .calendar-day { min-height: 40px; padding: 2px; }
      
      .event { display: none; }
      .mobile-time-bars {
          display: block;
          position: relative;
          height: 8px;
          margin-top: 0px;
          overflow: hidden;
          pointer-events: none;
      }
      .selected-day-panel { margin: 8px 0 0; padding: 8px; }
  }
</style>
