/* Calendar page — homepage styles.css remains the global design system. */

.page.calendar-page {
  --cal-purple: #6d4ec2;
  --cal-purple-soft: #f1ebfc;
  --cal-green: #2f9a58;
  --cal-green-soft: #e7f6ec;
  --cal-blue: #3b86e0;
  --cal-blue-soft: #eef4fc;
  --cal-gray: #6d7178;
  --cal-gray-soft: #f1f1f3;
  max-width: 1760px;
  padding: 0 32px 28px;
}

@media (min-width: 1680px) {
  .page.calendar-page {
    max-width: 1880px;
    padding: 0 40px 28px;
  }
}

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 10px;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cal-month-btn {
  width: 34px;
  height: 34px;
}

.cal-month-btn:focus-visible,
.cal-view-btn:focus-visible,
.cal-filter:focus-visible,
.cal-shortcut:focus-visible,
.cal-event:focus-visible,
.cal-more:focus-visible,
.cal-best-row:focus-visible,
.cal-view-area-btn:focus-visible {
  outline: 2px solid var(--cal-purple);
  outline-offset: 2px;
}

.cal-month-title {
  margin-left: 6px;
  font-size: 32px;
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.1;
  color: #111;
}

.cal-view-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cal-view-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e6e6e8;
  background: #fff;
  color: #161616;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 16, 16, 0.03);
}

.cal-view-btn.is-active {
  background: var(--cal-purple);
  border-color: var(--cal-purple);
  color: #fff;
  box-shadow: none;
}

.cal-week-note,
.cal-empty-note,
.cal-search-note {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #6b6f76;
}

.cal-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 6px;
}

.cal-shortcut {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #e6e6e8;
  background: #fff;
  color: #3a3a3c;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.cal-shortcut.is-active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.cal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 18px;
}

.cal-filter {
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid #e6e6e8;
  background: #fff;
  color: #5a5e64;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.cal-filter.is-active {
  border-color: var(--cal-purple);
  color: var(--cal-purple);
  background: #faf8ff;
  font-weight: 650;
}

.cal-filter-count {
  margin-left: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #9aa0a8;
}

.cal-filter.is-active .cal-filter-count {
  color: var(--cal-purple);
  opacity: 0.72;
}

.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.85fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}

.cal-main,
.cal-side {
  min-width: 0;
}

.cal-board-scroll {
  overflow-x: auto;
  border: 1px solid #efeff1;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(16, 16, 16, 0.04),
    0 10px 28px rgba(16, 16, 16, 0.045);
}

.cal-board {
  min-width: 1020px;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-weekdays {
  border-bottom: 1px solid #f0f0f2;
}

.cal-weekday {
  padding: 12px 12px 10px;
  font-size: 11.5px;
  font-weight: 720;
  letter-spacing: 0.08em;
  color: #8a8e95;
}

.cal-cell {
  min-height: 158px;
  padding: 10px 9px 9px;
  border-right: 1px solid #f3f3f5;
  border-bottom: 1px solid #f3f3f5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

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

.cal-grid .cal-cell:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.cal-daynum {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.03em;
  padding: 0 2px 2px;
  line-height: 1.15;
}

.cal-cell.is-outside .cal-daynum {
  color: #c5c8cd;
  font-weight: 500;
}

.cal-cell.is-today {
  background: #fcfaff;
}

.cal-cell.is-range {
  background: #f7f4fd;
}

.cal-cell.is-today.is-range {
  background: #f4effc;
}

.cal-cell.is-today .cal-daynum {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cal-purple);
  color: #fff;
  font-size: 14px;
}

.cal-event {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  background: var(--cal-purple-soft);
  color: #111;
  min-width: 0;
}

.cal-event.green {
  background: var(--cal-green-soft);
}

.cal-event.blue {
  background: var(--cal-blue-soft);
}

.cal-event.gray {
  background: var(--cal-gray-soft);
}

.cal-event.is-selected {
  box-shadow: inset 0 0 0 1.5px rgba(17, 17, 17, 0.28);
}

.cal-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--cal-purple);
}

.cal-event.green .cal-event-dot {
  background: var(--cal-green);
}

.cal-event.blue .cal-event-dot {
  background: var(--cal-blue);
}

.cal-event.gray .cal-event-dot {
  background: #b0b3b8;
}

.cal-event-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cal-event-place {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cal-event-type {
  font-size: 11.5px;
  color: #5a5e64;
  font-weight: 500;
  line-height: 1.3;
}

.cal-event-qual {
  font-size: 10.5px;
  color: #6b6f76;
  font-weight: 550;
}

.cal-more {
  border: 0;
  background: transparent;
  color: #6d7178;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
}

.cal-more:hover {
  background: #f5f5f7;
  color: #111;
}

@media (hover: hover) {
  .cal-event[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
  }

  .cal-event[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 6;
    width: max-content;
    max-width: 240px;
    white-space: pre-line;
    background: #1b1b1d;
    color: #fff;
    font-size: 11.5px;
    line-height: 1.4;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(16, 16, 16, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.cal-inline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding: 12px 4px 0;
  font-size: 11.5px;
  color: #6b6f76;
}

.cal-inline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.leg-dot.purple { background: var(--cal-purple); }
.leg-dot.green { background: var(--cal-green); }
.leg-dot.blue { background: var(--cal-blue); }
.leg-dot.gray { background: #b0b3b8; }

.cal-card {
  background: #fff;
  border: 1px solid #efeff1;
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 1px 2px rgba(16, 16, 16, 0.03);
}

.cal-card h2 {
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.cal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cal-text-link {
  border: 0;
  background: transparent;
  color: var(--cal-purple);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 0;
}

.cal-next {
  margin-bottom: 14px;
}

.cal-next-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8e95;
  margin-bottom: 8px;
}

.cal-next-place {
  font-size: 13px;
  font-weight: 720;
  color: #111;
}

.cal-next-meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: #6b6f76;
}

.cal-next-empty {
  font-size: 13px;
  color: #8a8e95;
}

.cal-next-view {
  margin-top: 10px;
}

.cal-active {
  margin-bottom: 14px;
}

.cal-active-item {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f2;
}

.cal-active-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.cal-active-place {
  font-size: 13px;
  font-weight: 700;
}

.cal-active-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #6b6f76;
}

.cal-best-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-best-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid #f0f0f2;
  border-radius: 12px;
  background: #fff;
  padding: 10px 10px 10px 8px;
  cursor: pointer;
}

.cal-best-row:hover {
  border-color: #e4e4e8;
}

.cal-best-row.is-selected {
  border-color: #d9d1ef;
  background: #faf8ff;
}

.cal-best-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.cal-best-wd {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #8a8e95;
}

.cal-best-day {
  font-size: 18px;
  font-weight: 740;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #111;
}

.cal-best-mon {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8a8e95;
}

.cal-best-body {
  min-width: 0;
}

.cal-best-place {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
}

.cal-best-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 650;
  color: #3a3a3c;
}

.cal-best-summary {
  margin-top: 2px;
  font-size: 11.5px;
  color: #6b6f76;
}

.cal-best-go {
  color: #c5c8cd;
  font-size: 16px;
}

.cal-best-empty {
  padding: 16px 4px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #8a8e95;
}

.cal-view-all-btn {
  width: 100%;
  margin-top: 12px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #ececee;
  background: #fafafa;
  color: #2a2a2c;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.cal-detail-place {
  font-size: 18px;
  font-weight: 730;
  letter-spacing: -0.03em;
}

.cal-detail-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  height: 26px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f1f1f3;
  color: #6d7178;
}

.cal-detail-status.putout {
  background: #f1ebfc;
  color: #6d4ec2;
}

.cal-detail-status.collection {
  background: #e7f6ec;
  color: #2f9a58;
}

.cal-detail-message {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #1a1a1c;
}

.cal-detail-timing {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-detail-row {
  border: 1px solid #f0f0f2;
  border-radius: 10px;
  padding: 9px 10px;
}

.cal-detail-label {
  font-size: 10.5px;
  color: #8a8e95;
}

.cal-detail-value {
  margin-top: 2px;
  font-size: 13.5px;
  font-weight: 700;
}

.cal-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.cal-view-area-btn {
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--cal-purple);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cal-colors {
  margin-top: 14px;
}

.cal-colors h2 {
  margin-bottom: 10px;
}

.cal-color-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 6px;
}

.cal-color-row.purple { background: var(--cal-purple-soft); }
.cal-color-row.green { background: var(--cal-green-soft); }
.cal-color-row.blue { background: var(--cal-blue-soft); }
.cal-color-row.gray { background: var(--cal-gray-soft); }

.cal-color-row .leg-dot {
  margin-top: 5px;
}

.cal-color-row strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #111;
}

.cal-color-row span {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: #6b6f76;
}

.cal-cta {
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--cal-purple);
  color: #fff;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(111, 78, 196, 0.18);
}

.cal-cta-kicker {
  display: block;
  font-size: 12px;
  opacity: 0.82;
  font-weight: 500;
}

.cal-cta-title {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 730;
}

.cal-cta-copy {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.84;
}

.cal-cta-go {
  font-size: 18px;
  opacity: 0.9;
}

.cal-cta-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #6b6f76;
}

.cal-tips {
  margin-top: 22px;
}

.cal-tips h2 {
  margin-bottom: 14px;
}

.cal-tips-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
}

.cal-tip-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f4f4f6;
  color: #111;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.cal-tip-icon svg {
  width: 16px;
  height: 16px;
}

.cal-tips h3 {
  font-size: 13px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.cal-tips p {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #6b6f76;
}

.cal-source {
  margin-top: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.cal-source-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--cal-purple-soft);
  color: var(--cal-purple);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.cal-source-name {
  font-size: 13px;
  font-weight: 700;
}

.cal-source-meta {
  margin-top: 2px;
  font-size: 12.5px;
  color: #6b6f76;
}

.cal-source-verify {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #6b6f76;
}

.cal-source-verify svg {
  width: 14px;
  height: 14px;
  color: var(--cal-green);
  flex-shrink: 0;
  margin-top: 1px;
}

.cal-about-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.cal-about {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #6b6f76;
  max-width: 46em;
}

.cal-popover {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.28);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 20px;
}

.cal-popover[hidden] {
  display: none;
}

.cal-popover-card {
  width: min(420px, 100%);
  max-height: min(72vh, 560px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: 0 16px 40px rgba(16, 16, 16, 0.18);
}

.cal-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-popover-head h3 {
  font-size: 15px;
  font-weight: 720;
}

.cal-popover-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 1280px) {
  .cal-month-title {
    font-size: 28px;
  }
}

@media (max-width: 1080px) {
  .cal-layout {
    grid-template-columns: 1fr;
  }

  .cal-tips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .calendar-page .primary-nav {
    display: none;
  }

  .page.calendar-page {
    padding: 0 16px 24px;
  }

  .cal-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .cal-month-title {
    font-size: 24px;
  }

  .cal-tips-grid {
    grid-template-columns: 1fr;
  }

  .cal-board {
    min-width: 920px;
  }

  .cal-cell {
    min-height: 148px;
  }
}
