/* ===========================
   Calendar Pro: Sync + Push UI
   =========================== 
*/
.calendar {
  background: var(--surface);
  border-radius: 15px;
  padding: 4px;
  min-height: 200px;
  height: 91vh;
  display: grid;
  grid-template-rows: 30px 1fr;
  gap: 5px;
  overflow: auto;
}

.cal-inner {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.cal-view-host {
  height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
}

.cal-grid {
  display: grid;
  gap: 6px;
  height: -webkit-fill-available;
}

.cal-month {
  grid-template-columns: repeat(7, 1fr);
}

.cal-week {
  grid-template-columns: repeat(7, 1fr);
}

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

.cal-cell {
  height: 11.2vh;
  border: var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--primary-dark);
  overflow: auto;
  scrollbar-width: none;
}

.event {
  background: var(--surface);
  border: 1px solid rgba(79, 70, 229, .5);
  border-width: 2px;
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 11px;
  margin-top: 2px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-day-list .event {
  height: 20vh;
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  padding: 10px;
}

.cal-week .event {
  height: 10vh;
  white-space: normal;
  text-overflow: unset;
  text-wrap-mode: wrap;
  display: flex;
  flex-direction: column;
}

.cal-tl3-event.google-event,
.google-event {
  display: flex;
  flex-flow: wrap;
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--strans);
  padding: 4px;
  background-image: linear-gradient(var(--surface)),
    linear-gradient(45deg, green, red, blue);
  background-clip: padding-box, border-box;
}

.cal-swipe-left {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .2);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cal-swipe-right {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(50%);
  background: rgba(0, 0, 0, .2);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ge {
  display: flex
}

.cal-anim-fade-out {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.15s ease-in;
}

.cal-anim-fade-in {
  opacity: 0;
  transform: translateX(10px);
  animation: calSlideIn 0.2s forwards;
}

/* Directional slide animations for prev/next navigation */
.cal-anim-slide-out-left {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.15s ease-in;
}

.cal-anim-slide-out-right {
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.15s ease-in;
}

.cal-anim-slide-in-right {
  opacity: 0;
  transform: translateX(10px);
  animation: calSlideIn 0.2s forwards;
}

.cal-anim-slide-in-left {
  opacity: 0;
  transform: translateX(-10px);
  animation: calSlideIn 0.2s forwards;
}

@keyframes calSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


@keyframes cal-swipe-left {
  from {
    transform: translateX(0)
  }

  to {
    transform: translateX(-24px);
    opacity: .9
  }
}

@keyframes cal-swipe-right {
  from {
    transform: translateX(0)
  }

  to {
    transform: translateX(24px);
    opacity: .9
  }
}

.cal-grid.swipe-left {
  animation: cal-swipe-left 180ms ease-in-out;
}

.cal-grid.swipe-right {
  animation: cal-swipe-right 180ms ease-in-out;
}


/* Empty State */
.cal-empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  background: var(--surface-2, #f5f5f5);
  border-radius: 8px;
  margin: 1rem;
  border: 1px dashed var(--line, #ccc);
  text-align: center;
}

/* Event Delegation Helpers */
.cal-cell {
  cursor: default;
}

.cal-cell:hover .cal-expand-btn {
  opacity: 1;
}

.cal-expand-btn {
  opacity: 0;
  transition: opacity 0.2s;
}

/* --- Calendar Pro enhancements (grid + timeline) --- */

/* Calendar meta bar */
.cal-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  border: var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  font-size: 12px;
  color: var(--text-muted);
}

.cal-toolbar .cal-view-select {
  min-width: 70px;
  background: var(--primary-dark);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 10px;
  height: auto;
}

.cal-toolbar .btn.toggled {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
}

.cal-year-carousel {
  position: relative;
  overflow: hidden;
}

.cal-year-track {
  display: flex;
  width: 100%;
  transition: transform 220ms ease;
}

.cal-month-panel {
  flex: 0 0 100%;
}

.cal-month-title {
  padding: 10px 6px;
  font-weight: 700;
  opacity: 0.92;
  text-align: center;
}

.cal-weekday {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

/* Weekday header cells should not inherit the fixed day-cell height */
.cal-weekday.cal-cell {
  height: auto;
  min-height: 0;
  padding: 6px;
}

.cal-cell .cal-daynum {
  font-weight: 800;
  font-size: 12px;
  opacity: .92;
}

.cal-cell.today {
  border: 3px solid var(--primary-light);
}

.cal-cell .cal-more {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 0.75rem;
}

.cal-cell .cal-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  overflow: hidden;
}

/* Reuse .event chip styling, but support new child class names */
.event .cal-check {
  margin-right: 6px;
}

.event:not(.selecting) .cal-check {
  display: none !important;
}

.event .cal-ico {
  width: 18px;
  text-align: center;
}

.cal-day-list .cal-ico {
  font-size: 20px
}

.cal-day-list .cal-title {
  font-size: 15px;
  font-weight: 800;
}

.event .cal-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event .cal-time {
  font-size: 0.75rem;
  opacity: 0.75;
  white-space: nowrap;
}

/* Timeline view */
.cal-timeline {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  /* background: rgba(0, 0, 0, 0.10); */
}

.cal-tl-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  background: var(--primary);
  border-bottom: 1px solid var(--line);
}

.cal-tl-corner {
  padding: 10px;
  opacity: 0.65;
  position: sticky;
  left: 0;
  z-index: 6;
  background: var(--primary);
}

.cal-tl-dayhead {
  padding: 10px 8px;
  border-left: 1px solid var(--line);
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
}

.cal-tl-allday {
  display: grid;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.cal-tl-allday-label {
  padding: 8px 10px;
  font-size: 0.8rem;
  opacity: 0.72;
  position: sticky;
  left: 0;
  z-index: 4;
  background: rgba(255, 255, 255, 0.03);
}

.cal-tl-allday-cell {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.cal-tl-evt-ico {
  margin-right: 6px;
}

.cal-tl-evt-title {
  font-weight: 700;
}

.cal-tl-body {
  display: grid;
  position: relative;
}

.cal-tl-allday-event {
  margin: 4px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.cal-tl-timegrid {
  display: grid;
}

.cal-tl-times {
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.08);
  position: sticky;
  left: 0;
  z-index: 3;
}

.cal-tl-time {
  height: 48px;
  padding: 6px 8px;
  font-size: 0.75rem;
  opacity: 0.65;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.cal-tl-col {
  position: relative;
  height: 1152px;
  border-left: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 48px);
}

.cal-tl-event {
  position: absolute;
  border-radius: 12px;
  padding: 4px 6px;
  font-size: 0.8rem;
  background: rgba(0, 153, 255, 0.14);
  border: 1px solid rgba(0, 153, 255, 0.25);
  cursor: pointer;
  overflow: hidden;
}

.cal-tl-event .cal-tl-event-title {
  font-weight: 700;
}

.cal-tl-event .cal-tl-event-time {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 2px;
}

.cal-tl-event.cont-left {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.cal-tl-event.cont-right {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* --- Timeline v2 (no all-day row) --- */
.cal-timeline2 {
  overflow: hidden;
  /* inner scroll handles it */
  display: flex;
  flex-direction: column;
}

.cal-tl2-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
  border-radius: 14px;
}

.cal-tl2-head,
.cal-tl2-foot,
.cal-tl2-body {
  display: grid;
  align-items: stretch;
}

.cal-tl2-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-tl2-foot {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 0;
}

.cal-tl2-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.92);
}

.cal-tl2-corner.tl2-left {
  position: sticky;
  left: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.04);
}

.cal-tl2-corner.tl2-right {
  position: sticky;
  right: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.04);
}

.cal-tl2-dayhead {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.9;
}

.cal-tl2-body {
  position: relative;
}

.cal-tl2-times {
  position: sticky;
  left: 0;
  z-index: 15;
  background: rgba(0, 0, 0, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.cal-tl2-time {
  height: 48px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.75rem;
  opacity: 0.7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

.cal-tl2-hours {
  position: sticky;
  right: 0;
  z-index: 15;
  background: rgba(0, 0, 0, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
  cursor: grab;
}

.cal-tl2-hour {
  height: 48px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.75rem;
  opacity: 0.55;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.cal-tl2-hour.in-view {
  opacity: 1;
  font-weight: 900;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  transform: translateX(-10px) scale(1.06);
}

.cal-tl2-hour.focus-near {
  transform: translateX(-14px) scale(1.10);
}

.cal-tl2-hour.focus-mid {
  transform: translateX(-18px) scale(1.14);
}

.cal-tl2-col {
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 100% 48px;
}

.cal-tl2-allday {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 6px;
  right: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0.22;
  z-index: 1;
}

.cal-tl2-allday-label {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.92;
}

.cal-tl2-event {
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 0.8rem;
  background: rgba(79, 70, 229, 0.16);
  border: 1px solid rgba(79, 70, 229, 0.32);
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
}

.cal-tl2-event .cal-tl2-event-title {
  font-weight: 800;
}

.cal-tl2-event .cal-tl2-event-time {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 2px;
}

.cal-tl2-event.cont-left {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.cal-tl2-event.cont-right {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.cal-tl2-day {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.cal-tl2-day-circle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  opacity: 0.7;
}

.cal-tl2-day.in-view .cal-tl2-day-circle {
  opacity: 0.95;
}

.cal-tl2-day-range {
  grid-row: 1;
  height: 30px;
  align-self: center;
  margin: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  opacity: 0.75;
  z-index: 2;
  cursor: grab;
}

/* Event type helpers (you can restyle freely) */
.event.type-task,
.cal-tl2-event.type-task,
.cal-tl2-allday.type-task {
  border-color: rgba(0, 153, 255, 0.55);
}

.event.type-project,
.cal-tl2-event.type-project,
.cal-tl2-allday.type-project {
  border-color: rgba(255, 180, 0, 0.55);
}

.event.type-chat,
.cal-tl2-event.type-chat,
.cal-tl2-allday.type-chat {
  border-color: rgba(0, 220, 150, 0.55);
}

.event.type-payment,
.cal-tl2-event.type-payment,
.cal-tl2-allday.type-payment {
  border-color: rgba(255, 80, 120, 0.55);
}

.event.type-reminder,
.cal-tl2-event.type-reminder,
.cal-tl2-allday.type-reminder {
  border-color: rgba(180, 120, 255, 0.55);
}

.event.type-cloud,
.cal-tl2-event.type-cloud,
.cal-tl2-allday.type-cloud {
  border-color: rgba(255, 255, 255, 0.35);
}

/* Week/day grid refinements */
.cal-head {
  display: flex;
  align-items: center;
  margin: 10px 0;
  justify-content: center;
}

.cal-h-title {
  font-weight: 800;
  opacity: .92;
}

.cal-week .cal-col {
  border: var(--line);
  border-radius: 12px;
  background: var(--primary-dark);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.cal-col-head {
  padding: 8px 10px;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.cal-col-body {
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
  scrollbar-width: none;
}

.cal-col-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.cal-day-list {
  border: var(--line);
  border-radius: 12px;
  background: var(--primary-dark);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: -webkit-fill-available;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-faded) transparent;
}


/* Generic loading bars for buttons (used by Calendar Sync/Pull/Push) */
.btn .bars {
  display: none;
  align-items: center;
  gap: 4px;
  height: 14px;
  margin-left: 8px;
}

.btn .bars i {
  display: block;
  width: 4px;
  height: 100%;
  background: var(--primary-faded);
  border-radius: 2px;
  animation: bars 0.8s ease-in-out infinite;
}

.btn .bars i:nth-child(2) {
  animation-delay: 0.1s;
}

.btn .bars i:nth-child(3) {
  animation-delay: 0.2s;
}

.btn.is-loading .bars {
  display: inline-flex;
}

.btn.is-loading {
  cursor: progress;
}

.btn.is-loading .label {
  opacity: 0.72;
}


/* =========================
   Calendar Timeline View v3
   ========================= */
.cal-timeline3 {
  display: grid;
  grid-template-columns: 1fr var(--tl3-axis-w, 88px);
  grid-template-rows: 1fr var(--tl3-bottom-h, 46px);
  border: var(--line);
  border-radius: 10px;
  overflow: hidden;
  height: -webkit-fill-available;
}

.cal-tl3-scroll {
  overflow: auto;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cal-tl3-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.cal-tl3-grid {
  position: relative;
  display: flex;
}

.cal-tl3-col {
  position: relative;
  flex: 0 0 var(--tl3-day-w, 180px);
  border-right: var(--line);
  background-image: repeating-linear-gradient(to bottom,
      var(--muted) 0,
      var(--muted) 1px,
      transparent 1px,
      transparent var(--tl3-hour-h, 56px));
  background-size: 100% var(--tl3-hour-h, 56px);
}

.cal-tl3-col:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.cal-tl3-allday-bg {
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  background: var(--primary-faded);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1;
  overflow: hidden;
}

.cal-tl3-allday-list {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-tl3-allday-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.30);
  font-size: 12px;
  line-height: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-tl3-event {
  position: absolute;
  border-radius: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(4px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
  z-index: 3;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
}

.cal-tl3-event.google-event {
  border-style: dashed;
}

.cal-tl3-event .cal-tl3-title {
  font-weight: 800;
  font-size: 12px;
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-tl3-event .cal-tl3-time {
  opacity: 0.7;
  font-size: 11px;
  margin-top: 4px;
}

.cal-tl3-event.cont-left {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.cal-tl3-event.cont-right {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.cal-tl3-axis {
  position: relative;
  border-left: var(--line);
  /* background: var(--dots); */
  overflow: hidden;
  user-select: none;
}

.cal-tl3-hours {
  position: absolute;
  inset: 8px 2px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
}

.cal-tl3-hour {
  flex: 1 1 auto;
  display: flex;
  padding-right: 2px;
  font-size: 9px;
  border: var(--line);
  background: var(--surface);
  border-radius: 10px;
  opacity: 0.65;
  transition: transform 120ms ease, opacity 120ms ease;
  justify-content: center;
  align-items: center;
}

.cal-tl3-hour.in-view {
  opacity: 1;
  font-weight: 500;
  transform: translateX(-2px) scale(1.05);
  background: var(--primary-faded);
  border-radius: 15px;
}

.cal-tl3-hour.focus-near {
  transform: translateX(-6px) scale(1.06);
}

.cal-tl3-hour.focus-mid {
  transform: translateX(-10px) scale(1.1);
}

.cal-tl3-focus {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 10px;
  background: var(--primary-faded);
  border: var(--line);
  z-index: 4;
  cursor: grab;
}

.cal-tl3-focus:active {
  cursor: grabbing;
}

.cal-tl3-days {
  border-top: var(--line);
  /* background: rgba(255, 255, 255, 0.03); */
  overflow: hidden;
}

.cal-tl3-days-inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: space-between;
  padding: 2px 10px;
  user-select: none;
}

.cal-tl3-day {
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.cal-tl3-day.in-view {
  position: relative;
  z-index: 2;
  cursor: pointer;
  scale: 1.03;
}

.cal-tl3-day-circle {
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: var(--surface);
  border: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.8;
  transition: transform 120ms ease, opacity 120ms ease;
}

.cal-tl3-day.in-view .cal-tl3-day-circle {
  opacity: 1;
  transform: scale(1.08);
}

.cal-tl3-day-range {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
  background: var(--primary-faded);
  border: var(--line);
  z-index: 2;
  cursor: grab;
}

.cal-tl3-day-range:active {
  cursor: grabbing;
}

.cal-tl3-corner {
  border-left: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

/* Timeline v3 event type borders */
.cal-tl3-event.type-task,
.cal-tl3-allday-item.type-task {
  border-color: rgba(0, 153, 255, 0.55);
}

.cal-tl3-event.type-project,
.cal-tl3-allday-item.type-project {
  border-color: rgba(255, 180, 0, 0.55);
}

.cal-tl3-event.type-chat,
.cal-tl3-allday-item.type-chat {
  border-color: rgba(0, 220, 150, 0.55);
}

.cal-tl3-event.type-payment,
.cal-tl3-allday-item.type-payment {
  border-color: rgba(255, 80, 120, 0.55);
}

.cal-tl3-event.type-reminder,
.cal-tl3-allday-item.type-reminder {
  border-color: rgba(180, 120, 255, 0.55);
}

.cal-tl3-event.type-cloud,
.cal-tl3-allday-item.type-cloud {
  box-shadow: var(--shadow);
}

.cal-push-pill {
  position: absolute;
  left: 55%;
  bottom: 50px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 5px 6px;
  border-radius: 999px;
  backdrop-filter: var(--backdrop-2);
  border: var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.cal-push-pill.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

.cal-push-pill .pill-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.cal-push-pill .pill-btn:hover {
  background: rgba(255, 255, 255, 0.10);
}

.cal-push-pill .pill-btn.primary {
  background: var(--primary-faded);
  border-color: rgba(255, 255, 255, 0.14);
}

/* Timeline today highlight */
.cal-tl3-col.today {
  box-shadow: inset 0px 0px 8px 0px var(--primary);
}

.cal-tl3-header.today {
  background: rgba(12, 44, 64, 0.18);
  border-bottom-color: rgba(12, 44, 64, 0.55);
}

.cal-tl3-day.today {
  background: var(--primary);
  border-radius: 100%;
  padding: 2px;
}

.cal-tl3-day.today .cal-tl3-day-name {
  color: rgba(255, 255, 255, 0.90);
}

.cal-tl3-day.today .cal-tl3-day-num {
  font-weight: 800;
}

/* Timeline selection checkboxes */
.cal-tl3-event,
.cal-tl3-allday-item {
  position: relative;
}

.cal-tl3-event:not(.selecting) .cal-check,
.cal-tl3-allday-item:not(.selecting) .cal-check {
  display: none !important;
}

.cal-tl3-event.selecting {
  padding-left: 26px;
}

.cal-tl3-allday-item.selecting {
  padding-left: 26px;
}

.cal-tl3-event .cal-check,
.cal-tl3-allday-item .cal-check {
  position: absolute;
  left: 1px;
  top: 4px;
  width: 14px;
  height: 14px;
  accent-color: var(--primary-dark);
}

/* Calendar sync modal (mirrors email modal behavior) */
.cal-sync-modal {
  width: min(560px, calc(100vw - 32px));
  background: rgba(10, 16, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  overflow: hidden;
}

.cal-sync-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-sync-modal .modal-header .title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.cal-sync-modal .modal-body {
  padding: 14px;
}

.cal-sync-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-sync-modal .provider-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  .cal-sync-modal .provider-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.cal-sync-modal .provider-pill {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  padding: 12px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.cal-sync-modal .provider-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cal-sync-modal .provider-pill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cal-sync-modal .provider-label {
  font-weight: 800;
  margin-bottom: 2px;
}

.cal-sync-modal .provider-sub {
  font-size: 12px;
  opacity: 0.82;
}

.cal-sync-modal .account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}

.cal-sync-modal .acct-provider {
  font-weight: 800;
}

.cal-sync-modal .acct-email {
  font-size: 12px;
  opacity: 0.85;
}

.cal-sync-hint {
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.78;
}

/* Calendar Pro: dialog overlay + magnify animation */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  backdrop-filter: var(--backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: calFadeIn 0.12s ease-out both;
}

.dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  overflow: auto;
  background: var(--surface);
  border: var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  animation: calPopIn 0.14s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: center center;
}

.dialog-header, .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: var(--line);
}

.dialog-title {
  font-weight: 800;
}

.dialog-close {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dialog-body {
  padding: 14px;
}

.dialog-footer, .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: var(--line);
}

/* Calendar day-events modal: allow a left and right button group */
.dialog-actions.split {
  justify-content: space-between;
}

.dialog-actions.split .dialog-actions-left,
.dialog-actions.split .dialog-actions-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

@keyframes calFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes calPopIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}