/* The task timer (tasks-ui.js), on /timer/ and in the app's Tasks room. The
   pages bring the cards; this is what goes inside them. Same tokens as
   everything else. */

/* ---------- /timer/ : the page anybody can open ---------- */

.timer-page { padding: 40px 0 64px; }

.timer-card {
  background: var(--surface-card, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 20px);
  padding: 28px;
  margin-bottom: 20px;
}
.timer-card[hidden] { display: none; }

.timer-more p { color: var(--text-2); margin: 8px 0 14px; }
.timer-more h2 { font-size: 1.05rem; margin: 0; }
.timer-more-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- the task on now ---------- */

.tk-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-2);
  margin: 0 0 16px;
}

.tk-name-input,
.tk-custom {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.tk-name-input {
  width: 100%;
  font-size: 1.05rem;
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
}
.tk-name-input:focus,
.tk-custom:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.tk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tk-chips[hidden] { display: none; }

.tk-chip {
  font: inherit;
  font-size: 0.92rem;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
}
.tk-chip-sm { min-height: 34px; padding: 0 12px; font-size: 0.85rem; }
.tk-chip[aria-checked="true"],
.tk-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.tk-custom {
  width: 84px;
  min-height: 40px;
  font-size: 0.92rem;
  text-align: center;
  border-radius: var(--radius-pill, 999px);
}

.tk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.tk-actions .btn { min-height: 46px; min-width: 120px; }
.tk-composer .tk-actions { justify-content: flex-start; }

.tk-now-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}
.tk-now-name {
  font-size: 1.35rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.tk-rename-row { display: flex; gap: 8px; align-items: center; }
.tk-rename-row .tk-name-input { flex: 1 1 auto; min-width: 0; }

.tk-link {
  font: inherit;
  font-size: 0.88rem;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 4px 2px;
  cursor: pointer;
}
.tk-link:hover { text-decoration: underline; }

.tk-clock {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.5rem, 15vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text);
  margin: 18px 0 4px;
  line-height: 1;
}
.tk-clock.is-paused { color: var(--text-3); }
.tk-clock.is-done { color: var(--green); }

.tk-state {
  text-align: center;
  color: var(--text-2);
  margin: 0;
  min-height: 1.4em;
}

.tk-timeup {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-md, 12px);
  background: var(--green-soft);
  border: 1px solid var(--green-glow, var(--border));
  text-align: center;
}
.tk-timeup p { margin: 0; font-weight: 600; color: var(--text); }
.tk-timeup .tk-actions { margin-top: 12px; }

.tk-retime { justify-content: center; margin-top: 18px; }

.tk-new-row {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.tk-composer-next {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.tk-next-note { margin: 0 0 10px; }

/* ---------- the lists ---------- */

.tk-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.tk-section-head h2 { font-size: 1.05rem; margin: 0; }
.tk-total { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.tk-list { list-style: none; padding: 0; margin: 12px 0 0; }
.tk-list:empty { display: none; }

.tk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.tk-row .tk-rename-row { flex: 1 1 auto; }
.tk-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tk-row-plain { align-items: baseline; }
.tk-row-name { color: var(--text); overflow-wrap: anywhere; }
.tk-row-time {
  color: var(--text-2);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tk-row-plain .tk-row-time { font-size: inherit; }
.tk-done-name { color: var(--text-2); }
/* A done row: the name takes the room, the time and its × after it, and in a
   narrow card the time drops below the name rather than squeezing it. */
.tk-row-plain:has(.tk-done-name) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "name reopen remove" "time reopen remove";
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
}
.tk-row-plain .tk-done-name { grid-area: name; }
.tk-row-plain:has(.tk-done-name) .tk-row-time { grid-area: time; font-size: 0.88rem; }
.tk-row-plain:has(.tk-done-name) .tk-reopen { grid-area: reopen; margin-left: 0; }
.tk-row-plain:has(.tk-done-name) .tk-icon,
.tk-row-plain:has(.tk-done-name) .btn-danger { grid-area: remove; }

.tk-row-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.tk-icon {
  font: inherit;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid transparent;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.tk-icon:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }

.tk-empty { margin: 10px 0 0; }
.tk-empty[hidden] { display: none; }
.tk-more { margin-top: 8px; }

/* The app's Tasks room: the task on now and the shelf on the left, today and
   what is done on the right. */
.tasks-column { display: grid; gap: 1.25rem; align-content: start; min-width: 0; }
.tasks-column > .panel[hidden] { display: none; }
/* Each other device's shelf (device-shelves.js), under this browser's. */
.tasks-devices { display: grid; gap: 1.25rem; min-width: 0; }
.tasks-devices:empty { display: none; }
.tasks-devices-heading { font-size: 1.05rem; margin: 0.5rem 0 -0.5rem; }
.tasks-devices .shelf-device + .shelf-device { margin-top: 0; }
#tasksFocus { display: inline-flex; align-items: center; gap: 8px; }
.tasks-layout #taskNow { padding: 24px; }
#tasksSyncLine:empty { display: none; }

@media (max-width: 560px) {
  .timer-page { padding-top: 20px; }
  .timer-card { padding: 20px; }
  .tk-actions .btn { flex: 1 1 40%; min-width: 0; }
  .tk-row { flex-wrap: wrap; }
  .tk-row-actions { margin-left: auto; }
}

/* ---------- tools under the clock: full screen, a break, reset ---------- */

.tk-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.tk-tools-label { color: var(--text-2); font-size: 0.9rem; margin-left: 6px; }

/* ---------- a note and the sites for the task ---------- */

.tk-extra {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.tk-extra summary {
  cursor: pointer;
  color: var(--text-2);
  font-size: 0.95rem;
}
.tk-note {
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
}
.tk-links { list-style: none; margin: 10px 0 0; padding: 0; }
.tk-links li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
}
.tk-links a { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-extra .tk-rename-row { margin-top: 10px; }
.tk-link-hint { margin: 6px 0 0; }
.tk-reopen { margin-left: 8px; }

/* ---------- the extension or the app keeps the clock ---------- */

.tk-gate p { color: var(--text-2); margin: 0 0 8px; }
.tk-gate .tk-actions { justify-content: flex-start; }
.tk-app-note {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 14px;
  color: var(--text);
}
.tk-app-note a { color: var(--accent); font-weight: 600; }

/* ---------- full screen ---------- */

/* Above the sticky navbar, like the Focus stage: full screen renders the
   whole document, so anything stacked over this would still show. */
.tk-full {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--bg, var(--surface));
  color: var(--text);
}
.tk-full-name {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0;
  text-align: center;
}
.tk-full-clock { font-size: clamp(5rem, 22vw, 14rem); margin: 0; }
.tk-full-exit { position: absolute; top: clamp(1rem, 2vw, 1.5rem); right: clamp(1rem, 2vw, 1.5rem); }
body.tk-full-live { overflow: hidden; }
