/* ---- Quick-create (inline input spanning the duration area) ------------ */
.quick-create {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 10;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 2px dashed var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: visible;
}

/* Ghost: semi-transparent preview shown while drag-creating. */
.quick-create__ghost {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 9;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  pointer-events: none;
}

.quick-create__input {
  width: 100%;
  height: 24px;
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}

.quick-create__input::placeholder {
  color: var(--text-muted);
}

/* ---- Habit suggestions dropdown ----------------------------------------- */
.quick-create__suggestions {
  width: 100%;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 148px;
  overflow-y: auto;
  flex-shrink: 0;
}

.quick-create__suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: background var(--transition);
}

.quick-create__suggestion:hover,
.quick-create__suggestion--highlighted {
  background: var(--accent-soft);
}

.quick-create__suggestion__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.quick-create__suggestion__plus {
  flex: 0 0 auto;
  width: 8px;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
}

.quick-create__suggestion__title {
  flex: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-create__suggestion__duration {
  flex: 0 0 auto;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.quick-create__suggestion--standalone {
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 6px;
}

.quick-create__suggestion--standalone .quick-create__suggestion__title {
  color: var(--text-muted);
}
/* ---- Week entry (compact block) ----------------------------------------- */
.week-entry {
  position: absolute;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--entry-color, var(--accent)) 12%, var(--surface));
  border-left: 3px solid var(--entry-color, var(--accent));
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition);
  touch-action: none; /* let pointer events drive touch drag-to-move, not scroll */
}

.week-entry:hover {
  box-shadow: var(--shadow-sm);
}

.week-entry__header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.week-entry__done {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: transparent;
  background: transparent;
  border: 2px solid var(--entry-color, var(--accent));
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), color var(--transition);
}

.week-entry__done:hover {
  background: color-mix(in srgb, var(--entry-color, var(--accent)) 15%, transparent);
}

.week-entry--done .week-entry__done {
  color: #fff;
  background: var(--entry-color, var(--accent));
}

.week-entry__done:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.week-entry__title {
  flex: 1;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Streak badge */
.week-entry__streak {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--entry-color, var(--accent)) 10%, transparent);
  padding: 0 3px;
  border-radius: 2px;
  line-height: 1.4;
  pointer-events: none;
}

.week-entry--done {
  opacity: 0.45;
}

.week-entry--done .week-entry__title {
  text-decoration: line-through;
}

/* Missed: warn emoji replaces done button, same as day view */
.week-entry--missed {
}

.week-entry__warn {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
}

/* Missed: hide done button, show warn. On hover: reverse. */
.week-entry--missed .week-entry__done { display: none; }
.week-entry--missed .week-entry__warn { display: inline-flex; }
.week-entry--missed:hover .week-entry__done { display: flex; }
.week-entry--missed:hover .week-entry__warn { display: none; }

.week-entry__remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.week-entry:hover .week-entry__remove {
  opacity: 1;
}

/* Reserve room for the remove button so the title doesn't run under it */
.week-entry:hover .week-entry__title {
  padding-right: 20px;
}

.week-entry__remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.week-entry__resize {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
  touch-action: none; /* let pointer events drive touch resize, not scroll */
}

.week-entry__resize::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--entry-color, var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

.week-entry:hover .week-entry__resize::after {
  opacity: 0.6;
}

.week-entry--resizing {
  z-index: 10;
  box-shadow: var(--shadow-lg);
}

/* ---- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .entry,
  .entry__remove,
  .entry__upgrade,
  .entry__resize::after,
  .week-entry,
  .week-entry__remove,
  .week-entry__resize::after {
    transition: none;
  }
}

