.projects-page {
  max-width: 680px;
  margin-inline: auto;
  padding-bottom: 32px;
}
.project-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 12px;
}
.project-tabs button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.project-tabs .selected {
  background: var(--surface);
  color: var(--ink);
}
.project-list-filter {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.project-list-filter label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.project-list-filter select {
  width: auto;
  min-height: 44px;
}
.project-list-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.project-list-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0 0 14px;
  min-height: 44px;
  color: var(--ink);
}
.project-list-link strong {
  font-size: 22px;
  font-weight: 600;
}
.project-list-link span,
.project-list-link small {
  font-size: 15px;
  color: var(--muted);
}
.project-empty {
  padding: 56px 0;
}
.project-empty p {
  margin-bottom: 20px;
}
.project-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.project-back {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  min-height: 44px;
}
.project-back svg {
  width: 20px;
  height: 20px;
}
.project-navigation-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.project-options {
  position: relative;
}
.project-options > summary {
  list-style: none;
  cursor: pointer;
}
.project-options > div {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 8;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
  min-width: 180px;
  padding: 6px;
  box-shadow: 0 8px 24px var(--shadow);
}
.project-options > div button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 12px;
  min-height: 44px;
}
/* Who can see the project: a chip by the options that opens the choice. */
.project-sharing > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  list-style: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.project-sharing > summary::-webkit-details-marker {
  display: none;
}
.project-sharing > summary .icon {
  width: 16px;
  height: 16px;
}
.project-sharing > div {
  width: min(300px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
}
.project-sharing > div > p {
  margin: 0;
  padding: 4px 12px 10px;
  font-size: 15px;
}
.project-sharing > div > .project-menu-heading {
  padding: 8px 12px 4px;
  font-size: 13px;
  color: var(--muted);
}
.project-sharing > div > .project-menu-heading:not(:first-child) {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.project-options > div .project-sharing-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-sharing-choice > span {
  display: grid;
  gap: 2px;
}
.project-sharing-choice strong {
  font-weight: 500;
}
.project-sharing-choice small {
  font-size: 13px;
  color: var(--muted);
}
.project-sharing-choice > .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.project-intro h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
.project-intro > p {
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
  color: var(--muted);
}
.projects-page progress {
  display: block;
  width: 100%;
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--line);
}
.projects-page progress::-webkit-progress-bar {
  background: var(--line);
}
.projects-page progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 0;
}
.projects-page progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 0;
}
.project-next {
  margin: 36px 0;
}
.project-section-label {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 12px;
}
.project-next h2 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
.project-step-note {
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-wrap;
  margin: 0;
}
.project-text {
  border: 0;
  background: transparent;
  color: var(--accent);
  min-height: 44px;
  padding: 10px 0;
}
.project-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.project-section-heading h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}
.project-goal {
  margin-top: 28px;
}
.project-goal p {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.project-form-details {
  display: grid;
  gap: 16px;
}
.project-form-details > summary {
  padding: 12px 0;
  cursor: pointer;
}
.project-form-steps {
  border: 0;
  padding: 0;
  margin: 20px 0;
}
.project-form-steps legend {
  font-size: 15px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 12px;
}
#project-edit-steps {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.project-edit-step {
  display: flex;
  gap: 4px;
  align-items: center;
}
.project-edit-step input {
  min-width: 0;
  flex: 1;
}
.project-edit-step .icon-button {
  padding: 4px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
}
.project-edit-step svg {
  width: 16px;
  height: 16px;
}
.projects-page button:focus-visible,
.projects-page summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.projects-page button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.projects-page[aria-busy='true'] button:disabled {
  opacity: 1;
}
.project-text:hover,
.project-back:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.project-list-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.project-options button:hover {
  background: var(--surface);
}
@media (max-width: 420px) {
  .project-edit-step .icon-button {
    width: 44px;
    min-width: 44px;
  }
  [data-moves='true'] .project-edit-step {
    flex-wrap: wrap;
  }
  [data-moves='true'] .project-edit-step input {
    flex-basis: 100%;
  }
}
@media (min-width: 1000px) {
  .projects-page {
    padding-top: 8px;
  }
}

/* Project detail: every step in order on one line, the next one in a card. */
.project-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}
.project-progress progress {
  flex: 1;
}
.project-progress span {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.project-notes {
  margin-top: 28px;
}
.project-notes p {
  white-space: pre-wrap;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.project-timeline {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
}
.project-timeline > li {
  position: relative;
  display: flex;
  gap: 14px;
}
/* The line runs through the check column: down to each box, and on from it to the next row. */
.project-step::before,
.project-step::after,
.project-insert-row::before {
  content: '';
  position: absolute;
  left: 13px;
  width: 2px;
  background: var(--line-strong);
}
.project-step::before {
  top: 0;
  height: 0;
}
.project-step::after {
  top: 28px;
  bottom: 0;
}
.project-step[data-above='done']::before,
.project-step[data-below='done']::after {
  background: var(--accent);
}
.project-step[data-above='none']::before,
.project-step[data-below='none']::after {
  background: transparent;
}
.project-step.is-next {
  align-items: center;
  padding-bottom: 10px;
}
.project-step.is-next::before {
  height: calc(50% - 19px);
}
.project-step.is-next::after {
  top: calc(50% + 9px);
}
.project-insert-row::before {
  top: 0;
  bottom: 0;
}
.project-box,
.project-insert-mark,
.project-add-mark {
  position: relative;
  z-index: 1;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
}
/* 44px targets around the 28px marks. */
.project-box::before,
.project-insert-mark::before {
  content: '';
  position: absolute;
  inset: -8px;
}
.project-box {
  border: 2px solid var(--control-border);
  background: var(--paper);
  color: var(--accent-ink);
}
.is-next > .project-box {
  border-color: var(--accent);
}
.project-box[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
}
.project-box .icon {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}
.project-box.is-popping {
  animation: project-pop 320ms ease-out both;
}
.project-step-open {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: start;
  min-height: 44px;
  padding: 3px 0 22px;
  text-align: left;
  color: var(--ink);
}
.project-step-title {
  grid-column: 1;
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.project-step-open > .project-step-note {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14px;
  color: var(--muted);
}
.project-step-open > .project-step-note .icon {
  width: 14px;
  height: 14px;
}
.project-step-open > .project-step-time {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.project-step-open > .project-step-time .icon {
  width: 15px;
  height: 15px;
}
.project-step-open > .icon:last-child {
  grid-column: 2;
  grid-row: 1;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: var(--muted);
}
.project-step.is-done .project-step-title {
  text-decoration: line-through;
  color: var(--muted);
}
.project-step-open:hover .project-step-title,
.project-up-next-open:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.project-up-next {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  padding: 12px 12px 12px 16px;
  background: var(--accent-soft);
}
.project-up-next > * {
  grid-column: 1;
}
.project-up-next > p:first-child {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-up-next h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.project-up-next-open {
  padding: 0;
  text-align: left;
  font-weight: inherit;
}
/* The whole card opens the step; Schedule sits above that. */
.project-up-next-open::after {
  content: '';
  position: absolute;
  inset: 0;
}
.project-up-next .project-step-note {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.project-up-next .project-step-time {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.project-up-next .project-schedule {
  grid-column: 2;
  grid-row: 1 / span 4;
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}
/* Filled once the step has a time. */
.project-up-next .project-schedule.is-scheduled {
  background: var(--accent);
  color: var(--accent-ink);
}
.project-insert-row {
  align-items: center;
  padding-bottom: 10px;
}
.project-insert-mark {
  border: 1.5px dashed var(--control-border);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
}
.project-insert-mark .icon,
.project-add-mark .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}
.project-insert-label {
  flex: 1;
  min-height: 44px;
  padding: 0;
  text-align: left;
  font-size: 15px;
  color: var(--muted);
}
.project-add-row {
  align-items: center;
}
.project-add-mark {
  background: var(--accent-soft);
  color: var(--accent);
}
.project-timeline input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 17px;
  color: var(--ink);
}
.project-all-done {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin-top: 16px;
  padding: 16px;
  background: var(--accent-soft);
}
.project-all-done strong {
  font-size: 17px;
  font-weight: 600;
}
.project-all-done span {
  font-size: 15px;
  color: var(--muted);
}
.project-all-done .primary {
  margin-top: 10px;
}
.project-hint {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
}
/* The burst from a ticked box lives on the page body, so repainting the list doesn't cut it short. */
.project-burst {
  position: absolute;
  z-index: 50;
  width: 0;
  height: 0;
  pointer-events: none;
}
.project-burst i {
  position: absolute;
  display: block;
}
.project-burst-ring {
  left: -18px;
  top: -18px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: project-ring 520ms ease-out forwards;
}
.project-burst .project-ray {
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}
.project-burst .project-piece {
  opacity: 0;
  background: var(--piece);
  animation: project-fly 720ms cubic-bezier(0.15, 0.75, 0.3, 1) forwards;
}
.project-burst .project-piece.is-far {
  animation-name: project-fly-far;
  animation-duration: 950ms;
}
.project-piece.is-spark {
  left: -1px;
  top: -5px;
  width: 2px;
  height: 10px;
  border-radius: 1px;
}
.project-piece.is-dot {
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.project-burst .project-piece.is-confetti {
  left: -3px;
  top: -2px;
  width: 7px;
  height: 4px;
  border-radius: 1px;
  animation-name: project-confetti;
}
.project-burst .project-piece.is-confetti.is-far {
  animation-name: project-confetti-far;
}
.project-piece.is-star {
  left: -5px;
  top: -5px;
  width: 11px;
  height: 11px;
  clip-path: polygon(50% 0, 62% 36%, 100% 37%, 69% 59%, 80% 96%, 50% 74%, 20% 96%, 31% 59%, 0 37%, 38% 36%);
}
@keyframes project-pop {
  40% {
    transform: scale(1.28);
  }
}
@keyframes project-ring {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}
@keyframes project-fly {
  0% {
    transform: translateY(0) scale(0.3);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translateY(-34px) scale(1);
    opacity: 0;
  }
}
@keyframes project-fly-far {
  0% {
    transform: translateY(0) scale(0.3);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translateY(-70px) scale(1.1);
    opacity: 0;
  }
}
@keyframes project-confetti {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  55% {
    transform: translateY(-36px) rotate(200deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-26px) rotate(360deg);
    opacity: 0;
  }
}
@keyframes project-confetti-far {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  55% {
    transform: translateY(-72px) rotate(240deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-58px) rotate(420deg);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-burst {
    display: none;
  }
  .project-box.is-popping {
    animation: none;
  }
}
