/* カレンダービュー */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.calendar-toolbar h2 {
  margin: 0;
  font-size: 1.15rem;
  min-width: 7.5rem;
  text-align: center;
}

.cal-nav-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.cal-nav-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.cal-filter-chip {
  font-size: 0.75rem;
}

.cal-grid-wrap {
  margin-bottom: 1rem;
}

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

.cal-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.25rem 0;
}

.cal-weekday:first-child {
  color: var(--high);
}

.cal-weekday:last-child {
  color: var(--accent-alt);
}

.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-cell {
  position: relative;
  min-height: 3.25rem;
  padding: 0.35rem 0.2rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.cal-cell:hover:not(:disabled) {
  border-color: var(--accent-mid);
  background: var(--accent-soft);
}

.cal-cell-today .cal-day-num {
  color: var(--accent-alt);
  font-weight: 700;
}

.cal-cell-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.cal-cell-outside {
  opacity: 0.35;
  cursor: default;
}

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: auto;
  padding-top: 0.15rem;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-src-task { background: #6ea8fe; }
.cal-src-habit { background: var(--semantic-success); }
.cal-src-journal { background: #c9a0dc; }
.cal-src-finance { background: #f0c674; }
.cal-src-revenue { background: #7ee787; }
.cal-src-dev { background: #79c0ff; }
.cal-src-body { background: #ff9bce; }
.cal-src-focus { background: var(--accent); }
.cal-src-goal { background: #d2a8ff; }
.cal-src-event { background: #ffa657; }

.cal-more {
  font-size: 0.6rem;
  color: var(--muted);
  align-self: flex-end;
}

.cal-day-panel {
  margin-top: 0.5rem;
}

.cal-day-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.cal-day-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.cal-day-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid var(--border);
}

.cal-day-item-done strong {
  text-decoration: line-through;
  opacity: 0.55;
}

.cal-day-item-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.cal-day-item-body {
  flex: 1;
  min-width: 0;
}

.cal-day-item-type {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-day-item-body strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  word-break: break-word;
}

.cal-quick-forms {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .calendar-layout {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 360px);
    gap: 1rem;
    align-items: start;
  }

  .cal-day-panel {
    position: sticky;
    top: 1rem;
  }
}
