/* ── Modal ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  border: 3px solid var(--border);
  box-shadow: 0 8px 0 var(--neutral-400), 0 16px 40px rgba(0, 0, 0, 0.12);
  animation: modal-pop 0.18s ease;
}

@keyframes modal-pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal__header .modal__title {
  margin-bottom: 0;
}

/* Standalone bare icon button — no chrome, sized to content.
   Used for modal close X, inline remove icons, etc. NOT part of
   the .btn system: doesn't share base styles, used on its own. */
.icon-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--text-lg);
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  line-height: var(--leading-tight);
  border-radius: var(--radius-xs);
  transition: color 0.15s;
}

.icon-btn:hover {
  color: var(--text);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: var(--font-black);
  margin-bottom: 20px;
  color: var(--text);
}

.modal label:not(.field) {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-extrabold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  margin-top: 18px;
}

.task-list {
  max-height: 180px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--neutral-50);
  margin-top: 4px;
  margin-bottom: 24px;
}

.task-list__items {
  overflow: visible;
}

.task-group {
  background: #fcfcfc;
  border-bottom: 1.5px solid var(--border);
}

.task-group--alt {
  background: var(--surface);
}

.task:not(.task--session-header) {
  background: #fcfcfc;
}

.task.task--alt {
  background: var(--surface);
}

.task-group .task:not(.task--session-header) {
  background: transparent;
}

.task-group:last-child {
  border-bottom: none;
}


.task--session-header {
  background: transparent;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.task--session-header .task__text {
  cursor: default;
  flex: 1;
  min-width: 0;
}

.task--session-header .task__text:hover,
.task--session-header:hover .task__text {
  background: transparent;
}

.task__leading-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

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

.task__row-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.task__row-icon svg {
  width: 14px;
  height: 14px;
}



.task-group .task:not(.task--session-header) {
  background: transparent;
  padding: 8px 12px 8px 28px;
  border-bottom: 1px solid var(--border);
}

.task-group .task:not(.task--session-header) .task__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-group .task:last-child {
  border-bottom: none;
  padding-bottom: 10px;
}

.task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1.5px solid var(--border);
  gap: 8px;
}

.task:last-child {
  border-bottom: none;
}

.task span {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  flex: 0 1 auto;
}

.task .task__text {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  border-radius: var(--radius-xs);
  padding: 2px 4px;
  margin: -2px -4px;
}

.task__text:hover {
  background: var(--border);
}


/* task text inline edit uses .input.input--inline */

.task .task__done {
  margin-left: auto;
}

.task__duration {
  flex: 0 0 auto;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--purple-dark);
  background: var(--purple-light);
  padding: 2px 8px;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.task.is-done .task__text {
  color: var(--text-muted);
}

.task__done {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
  position: relative;
  overflow: visible;
}

.task__done svg {
  width: 12px;
  height: 12px;
  stroke: transparent;
  transition: stroke 0.15s ease;
}

.task__done:hover {
  border-color: var(--green);
}

.task__done:hover svg {
  stroke: var(--green);
}

.task.is-done .task__done {
  background: var(--green);
  border-color: var(--green);
}

.task.is-done .task__done svg {
  stroke: var(--neutral-0);
}

.task__done.is-just-checked {
  animation: task-check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes task-check-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.task__done.is-just-checked svg polyline {
  stroke-dasharray: 14;
  animation: task-check-draw 0.35s ease-out 0.05s both;
}

@keyframes task-check-draw {
  0%   { stroke-dashoffset: 14; }
  100% { stroke-dashoffset: 0; }
}

.task-check-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--green);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: task-check-ripple 0.6s ease-out forwards;
}

@keyframes task-check-ripple {
  0%   { opacity: 0.8; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(2.6); }
}

.task-sparkle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: var(--color);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 4px var(--color);
  animation: task-sparkle-fly 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes task-sparkle-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2);
  }
}

.task__remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  cursor: pointer;
  padding: 0 4px;
  line-height: var(--leading-tight);
  border-radius: var(--radius-tight);
  transition: all 0.1s ease;
}

.task__remove:hover {
  color: var(--red);
  background: var(--red-light);
}

/* Compact confirm-dialog variant — narrower frame for short prompts. */
.modal--compact {
  max-width: 360px;
}

/* Body paragraph used by confirm dialogs. */
.modal__body-text {
  margin: 0 0 20px;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}
.modal__body-text--mb-lg {
  margin-bottom: 24px;
}

/* Inline checkbox row inside a confirm dialog. Overrides
   `.modal label:not(.field)` (same specificity, declared later) so the
   confirm-dialog "Don't show again" row reads as plain body text. */
.modal label.modal__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-size: var(--text-lg);
  cursor: pointer;
  user-select: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--font-normal);
  color: var(--text);
}

/* Sign-out row tucked at the bottom of the project-settings modal. */
.modal__signout-row {
  text-align: center;
  padding: 8px 0 4px;
}

.modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.modal__actions .btn { flex: 1; }
.modal__actions .btn[hidden] { display: none; }

/* Generic section block inside a modal (replaces fieldset). */
.modal__section {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.modal__section[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

/* Horizontal section divider — use between sections in a modal/form. */
.section-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* Drag-reorder variant (used by focus checklist; .task base + drag elements) */
.task__drag-handle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0.35;
  cursor: grab;
  padding: 2px 2px 2px 0;
  border-radius: 3px;
  transition: opacity 0.15s;
}
.task__drag-handle svg {
  width: 10px;
  height: 16px;
  display: block;
}
.task--draggable:hover .task__drag-handle {
  opacity: 0.7;
}
.task__drag-handle:active {
  cursor: grabbing;
}
.task--draggable.is-dragging {
  opacity: 0.4;
}
.task--draggable.is-drag-over {
  background: var(--purple-light);
  border-bottom-color: var(--purple-dark);
}
