@charset "utf-8";

    :root {
      --bg: #f3f4f6;
      --panel: #ffffff;
      --text: #111827;
      --muted: #6b7280;
      --line: #e5e7eb;
      --accent: #2563eb;
      --accent-soft: #dbeafe;
      --closed: #6b7280;
      --today-ring: #93c5fd;
      --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: var(--text);
    }

    .wrap {
      max-width: 1200px;
      margin: 24px auto;
      padding: 0 16px;
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 16px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .header {
      padding: 20px;
      border-bottom: 1px solid var(--line);
      display: grid;
      gap: 12px;
    }

    .title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    h1 {
      margin: 0;
      font-size: 28px;
      line-height: 1.2;
    }

    .sub {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
    }

    .toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .btn-group {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    button {
      border: 1px solid var(--line);
      background: #fff;
      color: var(--text);
      border-radius: 10px;
      padding: 10px 14px;
      cursor: pointer;
      font-size: 14px;
      line-height: 1;
    }

    button:hover {
      background: #f9fafb;
    }

    button.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
    }

    .current-label {
      font-weight: 700;
      font-size: 20px;
      min-width: 180px;
      text-align: center;
    }

    .legend {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      color: var(--muted);
      font-size: 13px;
    }

    .legend-item {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .dot {
      width: 12px;
      height: 12px;
      border-radius: 999px;
      display: inline-block;
    }

    .dot.available { background: var(--accent); }
    .dot.closed { background: var(--closed); }

    .calendar {
      padding: 16px;
    }

    .month-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 1px;
      background: var(--line);
      border: 1px solid var(--line);
      border-radius: 14px;
      overflow: hidden;
    }

    .dow,
    .day-cell {
      background: #fff;
    }

    .dow {
      padding: 12px 8px;
      text-align: center;
      font-size: 13px;
      font-weight: 700;
      color: var(--muted);
    }

    .day-cell {
      min-height: 140px;
      padding: 8px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .day-cell.other-month {
      background: #f9fafb;
      color: #9ca3af;
    }

    .day-cell.today {
      box-shadow: inset 0 0 0 2px var(--today-ring);
    }

    .day-num {
      font-size: 13px;
      font-weight: 700;
      align-self: flex-start;
      padding: 2px 8px;
      border-radius: 999px;
    }

    .today .day-num {
      background: var(--accent-soft);
      color: var(--accent);
    }

    .events {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-height: 0;
    }

    .event-chip {
      border-radius: 8px;
      padding: 6px 8px;
      color: #fff;
      font-size: 12px;
      line-height: 1.35;
      overflow: hidden;
      text-decoration: none;
      display: block;
    }

    .event-chip.available { background: var(--accent); }
    .event-chip.closed { background: var(--closed); }

    .more {
      font-size: 12px;
      color: var(--muted);
      padding-top: 2px;
    }

    .week-wrap {
      border: 1px solid var(--line);
      border-radius: 14px;
      overflow: hidden;
    }

    .week-head,
    .week-row {
      display: grid;
      grid-template-columns: 72px repeat(7, minmax(0, 1fr));
    }

    .week-head {
      background: #fff;
      border-bottom: 1px solid var(--line);
    }

    .week-head-cell {
      padding: 12px 8px;
      border-left: 1px solid var(--line);
      text-align: center;
      font-size: 13px;
      font-weight: 700;
      min-height: 56px;
    }

    .week-head-cell.today {
      background: var(--accent-soft);
      color: var(--accent);
    }

    .week-head-spacer {
      padding: 12px 8px;
      color: var(--muted);
      font-size: 12px;
    }

    .week-row {
      background: #fff;
      border-bottom: 1px solid var(--line);
      min-height: 72px;
    }

    .week-row:last-child {
      border-bottom: 0;
    }

    .time-label {
      padding: 8px;
      color: var(--muted);
      font-size: 12px;
      text-align: center;
      border-right: 1px solid var(--line);
    }

    .week-cell {
      padding: 6px;
      border-left: 1px solid var(--line);
      display: flex;
      flex-direction: column;
      gap: 6px;
      background-image: linear-gradient(to bottom, rgba(229, 231, 235, 0.25), rgba(229, 231, 235, 0.25));
      background-size: 100% 1px;
      background-repeat: no-repeat;
      background-position: top;
    }

    .week-event {
      border-radius: 8px;
      color: #fff;
      padding: 6px 8px;
      font-size: 12px;
      line-height: 1.35;
      text-decoration: none;
      display: block;
    }

    .week-event.available { background: var(--accent); }
    .week-event.closed { background: var(--closed); }

    .empty {
      color: var(--muted);
      font-size: 12px;
      min-height: 16px;
    }

    .footer-note {
      padding: 0 20px 20px;
      color: var(--muted);
      font-size: 12px;
    }

    @media (max-width: 900px) {
      .day-cell {
        min-height: 110px;
      }

      .week-head,
      .week-row {
        grid-template-columns: 56px repeat(7, minmax(120px, 1fr));
      }

      .week-scroll {
        overflow-x: auto;
      }
    }

    @media (max-width: 640px) {
      h1 {
        font-size: 22px;
      }

      .current-label {
        width: 100%;
        text-align: left;
      }
    }