/* ── Schedule ── */
.schedule-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 0 0 10px;
}

.schedule-date-row button {
  padding: 2.5px 10px;
  font-size: 16px;
  line-height: 1;
  background: none;
  border: none;
  color: var(--border);
}

#schedule-date-label {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

/* ── Schedule week row ── */
#schedule-week-row {
  display: flex;
  justify-content: space-around;
  padding: 5px 0;
}

.schedule-week-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 8px;
  min-width: 30px;
  user-select: none;
}

.schedule-week-cell:hover .schedule-week-day-num {
  background: var(--hover-overlay);
}

.schedule-week-day-letter {
  font-size: 10px;
  color: var(--border);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.schedule-week-day-num {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.1s;
}

.schedule-week-cell.weekend .schedule-week-day-letter,
.schedule-week-cell.weekend .schedule-week-day-num {
  opacity: 0.6;
}

.schedule-week-cell.today .schedule-week-day-num {
  background: var(--error);
  color: var(--text-on-error);
}

.schedule-week-cell.selected:not(.today) .schedule-week-day-num {
  background: var(--week-selected-bg);
  color: var(--text-on-accent);
}

.schedule-week-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 1px;
  flex-shrink: 0;
}

.schedule-week-dot.dot-empty    { background: transparent; }
.schedule-week-dot.dot-event    { background: var(--dot-event); }
.schedule-week-dot.dot-pending  { background: var(--warning); }
.schedule-week-dot.dot-done     { background: var(--success); }
.schedule-week-dot.dot-overdue  { background: var(--error); }


#schedule-timeline-wrapper {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 10px 10px 0 5px;
}

#scheduleGrid {
  position: relative;
  margin: 10px 0 20px;
}

.schedule-time-label {
  position: absolute;
  left: 0;
  width: 50px;
  font-size: 10px;
  color: var(--time-label);
  text-align: left;
  padding-left: 5px;
  transform: translateY(-50%);
  box-sizing: border-box;
  pointer-events: none;
}

.schedule-gridline {
  position: absolute;
  left: 40px;
  right: 0;
  border-top: 0.5px solid var(--gridline);
  margin: 0 10px 0 5px;
}

.schedule-gridline-hour {
  border-top-color: var(--gridline-hour);
}

.schedule-item {
  position: absolute;
  left: 40px;
  right: 0;
  background-color: var(--sched-item-bg);
  border-left: 3px solid var(--sched-item-border);
  border-radius: 0 5px 5px 0;
  padding: 2px 6px;
  margin: 0 10px 0 5px;
  font-size: 12px;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 0.35em;
  cursor: default;
}

.schedule-item.completed {
  opacity: 0.45;
}

.schedule-item.completed .schedule-item-name {
  text-decoration: line-through;
}

.schedule-item input[type="checkbox"] {
  margin-left: 2px;
  margin-top: 0.1em;
  flex-shrink: 0;
}

.schedule-item-name {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-item-name:hover {
  text-decoration: underline;
}

.schedule-event-icon {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1;
  margin-top: 0.1em;
}

/* ── Schedule all-day section (above timed grid, outside the scrollable wrapper) ── */
/* flex-shrink:0 keeps it at its natural height; the timeline wrapper below takes the rest. */
.schedule-allday-section {
  flex-shrink: 0;
}

.schedule-allday-section .schedule-item {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  margin: 5px 10px 5px 45px;
  padding: 0 6px;
  align-items: center;
  box-sizing: border-box;
}

/* ── Conflict indicator: red text for items within 15 min of each other ── */
.schedule-item.conflict .schedule-item-name {
  color: var(--error);
}

/* ── Schedule now indicator ── */
.schedule-now-indicator {
  position: absolute;
  left: 38px;
  right: 5px;
  height: 2px;
  background-color: var(--error);
  z-index: 10;
  pointer-events: none;
}

.schedule-now-indicator::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--error);
}

/* ── Task status dots ── */
.task-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
  /* Align with the first text line, mirroring the checkbox alignment */
  align-self: flex-start;
  margin-top: calc((1lh - 7px) / 2);
}

/* In markdown preview, dot sits inline at the end of the task text */
.task-status-dot.dot-inline {
  margin-left: 5px;
  vertical-align: middle;
}

.dot-unscheduled { background-color: var(--text); }
.dot-overdue     { background-color: var(--error); }
.dot-today       { background-color: var(--warning); }
.dot-future      { background-color: var(--success); }
