/* ============================================================
   topdevphone — Calendar app styles
   Red identity (#ff5f52 → #c62828). Month grid + day agenda +
   bottom sheet. All colours come from base.css vars (or the six
   fixed event colours) so dark AND light both read correctly.
   ============================================================ */

/* ---------- header ---------- */
.cal-today {
  font-size: 15px !important; font-weight: 600;
  color: var(--accent-red);
}

/* ---------- month navigation ---------- */
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 2px 10px;
}
.cal-nav .cal-month {
  font-size: 17px; font-weight: 800; letter-spacing: -0.2px;
}
.cal-nav .cal-month span { color: var(--text-secondary); font-weight: 600; }
.cal-arrow {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-red); font-size: 17px;
  background: var(--bg-secondary);
  transition: filter 0.15s, transform 0.1s;
}
.cal-arrow:active { transform: scale(0.92); filter: brightness(1.35); }

/* ---------- grid ---------- */
.cal-dows {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-dows span {
  text-align: center; font-size: 11px; font-weight: 800;
  letter-spacing: 0.6px; color: var(--text-tertiary);
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--separator);
}
.cal-cell {
  height: 46px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer;
}
.cal-cell.dim { opacity: 0.32; }
.cal-num {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14.5px; font-weight: 500; color: var(--text-primary);
  transition: background 0.15s, color 0.15s;
}
.cal-cell.today .cal-num { color: var(--accent-red); font-weight: 800; }
.cal-cell.sel .cal-num { background: var(--bg-tertiary); font-weight: 700; }
.cal-cell.today.sel .cal-num { background: var(--accent-red); color: #fff; }
.cal-cell:active .cal-num { filter: brightness(1.3); }

.cal-dots { display: flex; gap: 3px; height: 5px; align-items: center; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }

/* ---------- agenda ---------- */
.cal-agenda { padding-top: 12px; }
.cal-sl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cal-sl-row > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-count {
  font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--text-tertiary); flex: 0 0 auto;
}

.cal-ev {
  display: flex; align-items: stretch; gap: 11px;
  background: var(--bg-secondary); border-radius: var(--radius-card);
  padding: 11px 13px; margin-bottom: 8px; cursor: pointer;
  transition: filter 0.15s;
}
.cal-ev:active { filter: brightness(1.25); }
.cal-ev-bar { width: 4px; border-radius: 2px; flex: 0 0 auto; }
.cal-ev-main { flex: 1; min-width: 0; }
.cal-ev-title { font-size: 14.5px; font-weight: 600; }
.cal-ev-notes {
  font-size: 12px; color: var(--text-secondary); margin-top: 2px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cal-ev-time {
  flex: 0 0 auto; text-align: right;
  font-size: 12.5px; font-weight: 700; color: var(--text-primary);
}
.cal-ev-end { font-size: 11.5px; font-weight: 500; color: var(--text-tertiary); margin-top: 2px; }

/* ---------- bottom sheet ---------- */
.cal-sheet-host { position: absolute; inset: 0; z-index: 20; display: none; align-items: flex-end; }
.cal-sheet-host.show { display: flex; }
.cal-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.cal-sheet {
  position: relative; width: 100%;
  background: var(--bg-elevated); color: var(--text-primary);
  border-radius: 22px 22px 0 0; padding: 18px 18px 26px;
  max-height: 94%; overflow-y: auto;
  animation: calSheetUp 0.28s cubic-bezier(0.32, 0.72, 0.35, 1);
}
.cal-sheet::-webkit-scrollbar { width: 0; }
@keyframes calSheetUp { from { transform: translateY(60%); } }
.cal-sheet-title { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 14px; }
.cal-sheet .section-label { margin: 14px 2px 7px; }
.cal-mt { margin-top: 10px; }
.cal-title { font-size: 15px; font-weight: 600; }
.cal-notes { min-height: 74px; line-height: 1.45; }

.cal-swatches { display: flex; gap: 10px; }
.cal-swatch {
  flex: 1; height: 34px; border-radius: 10px;
  border: 2px solid transparent;
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.16);
  transition: transform 0.12s;
}
.cal-swatch.on { border-color: var(--text-primary); transform: scale(1.06); }
.cal-swatch:active { transform: scale(0.94); }

.cal-datepick { display: flex; gap: 8px; }
.cal-timepick { display: flex; align-items: center; gap: 7px; }
.cal-colon { font-size: 20px; font-weight: 800; color: var(--text-tertiary); }
.cal-select {
  -webkit-appearance: none; appearance: none;
  flex: 1 1 auto; min-width: 0;
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 0; border-radius: 11px; padding: 10px 8px;
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
  text-align: center; outline: none; cursor: pointer;
}
.cal-select.wide { flex: 1.4 1 auto; }
.cal-select.ampm { flex: 0 0 68px; }
.cal-select option { background: var(--bg-secondary); color: var(--text-primary); font-size: 15px; }

.cal-sheet-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-secondary); border-radius: var(--radius-card);
  padding: 10px 14px; margin-top: 16px;
  font-size: 14.5px; font-weight: 500;
}
.cal-endwrap { margin-top: 10px; }

/* ---------- home-screen widget ---------- */
.cal-w-row { display: flex; align-items: center; gap: 10px; }
.cal-w-row + .cal-w-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
[data-theme='light'] .cal-w-row + .cal-w-row { border-top-color: rgba(0, 0, 0, 0.08); }
.cal-w-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.cal-w-main { min-width: 0; }
.cal-w-title {
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-w-sub { font-size: 11.5px; opacity: 0.65; margin-top: 1px; }
.cal-w-empty { font-size: 12.5px; opacity: 0.6; }
