.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-timer {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--control);
  color: var(--text);
}

.topbar-timer-open {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 6px 9px;
  font: 400 .62rem var(--font-ui);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.topbar-timer-label {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.topbar-timer strong {
  white-space: nowrap;
  font: 700 .78rem var(--font-ui);
}

.timer-dot {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.topbar-timer-stop {
  width: 38px;
  border-left: 1px solid var(--line);
  background: var(--cta);
  color: #000;
  font-size: 13px;
}

#tracker-live-nav {
  display: inline-flex;
  width: auto;
  margin-left: auto;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font: 700 .62rem var(--font-ui);
}

#tracker-live-nav span {
  width: auto;
  flex: none;
}

#tracker-live-nav .timer-dot {
  width: 8px;
  height: 8px;
  box-shadow: none;
}

.task-card.is-running {
  box-shadow: inset 4px 0 var(--accent);
}

.task-actions .timer-stop,
.inline-tracker.is-running,
.tracker-row-stop {
  background: var(--accent);
  border-color: var(--line);
  color: #000;
}

.running-pill {
  background: var(--accent);
  color: #000;
}

.task-card.is-running .task-actions {
  opacity: 1;
}

.time-pill,
.inline-subtasks small {
  color: var(--text);
}

.inline-subtasks li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-subtasks li > span {
  flex: 1;
}

.inline-subtasks small {
  font: 400 .58rem var(--font-ui);
  text-transform: uppercase;
}

.inline-tracker {
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--line);
  font-size: 11px;
}

.project-totals {
  display: flex;
  gap: 36px;
  margin-top: 20px;
}

.project-totals div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-totals span {
  color: var(--muted);
  font: 400 .61rem var(--font-ui);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.project-totals strong {
  font: 700 1.45rem var(--font-ui);
}

.tracker-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font: 700 .65rem var(--font-ui);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.tracker-day-heading b {
  white-space: nowrap;
}

.time-entry {
  grid-template-columns: 1.2fr 2fr minmax(130px, 1fr) 86px 132px;
}

.entry-duration {
  width: 86px;
  text-align: right;
  font: 700 .9rem var(--font-ui);
  text-transform: uppercase;
}

.entry-actions {
  display: flex;
  width: 132px;
  justify-content: flex-end;
  gap: 4px;
}

.tracker-row-control,
.entry-actions .icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
}

.tracker-row-control {
  border-color: var(--line);
}

.tracker-row-control:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.running-entry-note {
  margin: 12px 0 0;
  color: var(--muted);
  font: 400 .62rem var(--font-ui);
  letter-spacing: .03em;
}

.task-created {
  display: block;
  margin-top: 5px;
}

.time-range-fields {
  margin-top: 18px;
}

.time-range-label {
  margin: 16px 0 8px;
  color: var(--accent);
  font: 700 .62rem var(--font-ui);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.time-range-grid {
  gap: 15px;
}

.time-range-summary {
  margin: 14px 0 0;
  color: var(--muted);
  font: 400 .68rem var(--font-ui);
  letter-spacing: .04em;
}

.entry-next-day {
  margin-left: 4px;
  color: var(--accent);
  font: 700 .58rem var(--font-ui);
  letter-spacing: .04em;
}

@media (max-width: 720px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
  }

  /* Above the pinned top bar; the menu itself above its scrim so taps reach it. */
  .sidebar-scrim {
    z-index: 25;
  }

  .sidebar {
    z-index: 26;
  }

  .modal-backdrop,
  .toast {
    z-index: 30;
  }

  .topbar-right {
    gap: 6px;
  }

  .topbar-timer-open {
    padding: 6px 8px;
  }

  .topbar-timer-label {
    display: none;
  }

  .topbar-timer-stop {
    width: 38px;
  }

  .inline-tracker {
    width: 44px;
    height: 44px;
  }

  /* Phone row: project | duration, then the activity full width, then times | buttons. */
  .time-entry {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }

  .time-entry .entry-project {
    grid-column: 1;
    grid-row: 1;
  }

  .time-entry .entry-duration {
    grid-column: 2;
    grid-row: 1;
    width: auto;
  }

  .time-entry p {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .time-entry > span {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
  }

  .time-entry .entry-actions {
    grid-column: 2;
    grid-row: 3;
    width: auto;
  }

  .tracker-row-control,
  .entry-actions .icon-button {
    width: 44px;
    height: 44px;
  }

  .project-totals {
    gap: 23px;
    margin-top: 18px;
  }

  .project-totals div:nth-child(2) span {
    font-size: 0;
  }

  .project-totals div:nth-child(2) span::after {
    content: 'Semana';
    font-size: .61rem;
  }

  .project-totals strong {
    font-size: 1.25rem;
  }

  .time-range-grid {
    grid-template-columns: 1fr;
  }
}

/* G5: "¿Sigues trabajando?" */
.forgotten-text {
  margin: 0 0 6px;
}

.forgotten-last {
  margin: 0;
}
