/* Task tools: popovers opened from the task card toolbar and its «Ещё» menu.
   Source: design mockups «Инструмент · Напоминание / Цвет / Таймер / Поделиться /
   Ещё / Перенос даты / Теги / Удаление» and «Повтор задачи».
   A popover is a light tint of the task colour with dark ink and a tip pointing
   at the button that opened it. Buttons inside use the shared data-ui-button
   component; everything else is local to .tp. */

.tp {
  --tp-bg: color-mix(in srgb, var(--task-dialog-color, #f5f6ff) 22%, #fff);
  --tp-ink: #17131f;
  --tp-mut: rgba(23, 19, 31, .56);
  --tp-fill: rgba(255, 255, 255, .62);
  --tp-line: rgba(23, 19, 31, .08);
  --tp-track: rgba(23, 19, 31, .07);
  --tp-sel-bg: #17131f;
  --tp-sel-fg: #fff;
  --tp-field: #fff;
  --tp-danger: #b8233a;
  --tp-weekend: #be2a4a;
  --tp-tip: 60px;
  --task-dialog-ink: #17131f;
  --fw-button-focus: #17131f;
  position: fixed;
  inset: auto;
  left: var(--quick-panel-left, 12px);
  top: var(--quick-panel-top, 12px);
  z-index: 2147483000;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: var(--tp-width, 330px);
  max-width: calc(100vw - 24px);
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  overflow: visible;
  background: var(--tp-bg);
  color: var(--tp-ink);
  box-shadow: 0 1px 2px rgba(23, 19, 31, .08), 0 14px 40px rgba(23, 19, 31, .18);
  font: 400 14px/1.3 var(--fw-font, "Onest", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}
.tp[hidden] { display: none !important; }
.tp *, .tp *::before, .tp *::after { box-sizing: border-box; }
.tp::before {
  content: "";
  position: absolute;
  top: -6px;
  left: calc(var(--tp-tip) - 6px);
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--tp-bg);
  transform: rotate(45deg);
  pointer-events: none;
}
.tp.opens-above::before { top: auto; bottom: -6px; }
.tp.no-tip::before { display: none; }
.tp svg.i {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tp :is(button, input, select) { font: inherit; }
.tp :where(button, input, select) { color: inherit; }
.tp button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tp button:disabled { cursor: default; }
.tp :is(button, input, select):focus-visible { outline: 2px solid var(--tp-ink); outline-offset: 2px; }
.tp input:focus-visible { outline-offset: 0; }

/* Dark card (system dark, dark theme, dark task colour): same tint idea, light ink. */
.tp.tp-dark {
  --tp-bg: color-mix(in srgb, var(--task-dialog-color, #22242a) 84%, #fff);
  --tp-ink: #f2f3f5;
  --tp-mut: rgba(242, 243, 245, .64);
  --tp-fill: rgba(255, 255, 255, .1);
  --tp-line: rgba(255, 255, 255, .12);
  --tp-track: rgba(255, 255, 255, .1);
  --tp-sel-bg: #f2f3f5;
  --tp-sel-fg: #17131f;
  --tp-field: rgba(255, 255, 255, .14);
  --tp-danger: #ff8a9c;
  --tp-weekend: #ff8a9c;
  --task-dialog-ink: #f2f3f5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 40px rgba(0, 0, 0, .45);
}

/* ── shared pieces ─────────────────────────────────────────────── */
.tp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tp-head b { font-size: 16px; line-height: 20px; font-weight: 700; }
.tp-head small { font-size: 13px; line-height: 18px; color: var(--tp-mut); white-space: nowrap; }
.tp-label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--tp-mut); margin-bottom: -6px; }
.tp-note { margin: 0; font-size: 12px; line-height: 17px; color: var(--tp-mut); }

.tp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tp-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border: 0; border-radius: 16px;
  background: var(--tp-fill); color: var(--tp-ink);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.tp-chip svg.i { width: 15px; height: 15px; stroke-width: 1.7; }
.tp-chip:is(.on, .is-active, [aria-pressed="true"], [aria-checked="true"]) { background: var(--tp-sel-bg); color: var(--tp-sel-fg); }

.tp-seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: stretch;
  height: 30px; padding: 2px; border-radius: 15px; background: var(--tp-track);
}
.tp-seg > button {
  min-width: 0; padding: 0 6px; border: 0; border-radius: 13px; background: transparent;
  color: var(--tp-mut); font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.tp-seg > button:is(.on, [aria-checked="true"], [aria-pressed="true"]) {
  background: #fff; color: #17131f; font-weight: 600; box-shadow: 0 1px 2px rgba(23, 19, 31, .08);
}
.tp.tp-dark .tp-seg > button:is(.on, [aria-checked="true"], [aria-pressed="true"]) { background: rgba(255, 255, 255, .92); }
.tp-seg > button:disabled { opacity: .5; }

.tp-row { display: flex; align-items: center; gap: 8px; }
.tp-row > span { font-size: 14px; font-weight: 500; }
.tp-row-between { justify-content: space-between; }
.tp-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--tp-fill); }
.tp-box[hidden], .tp-end[hidden], .tp-sum[hidden], .tp-weekdays[hidden], .tp-count-row[hidden], .tp-date[hidden] { display: none; }

.tp-stepper { display: flex; align-items: center; height: 30px; border-radius: 15px; background: #fff; color: #17131f; }
.tp-stepper button {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 14px; background: transparent; color: rgba(23, 19, 31, .56);
}
.tp-stepper button:hover:not(:disabled) { color: #17131f; }
.tp-stepper button:disabled { opacity: .35; }
.tp-stepper svg.i { width: 12px; height: 12px; stroke-width: 2; }
.tp-stepper b { min-width: 22px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.tp-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.tp-weekdays button {
  height: 30px; padding: 0; border: 0; border-radius: 15px; background: transparent;
  color: var(--tp-ink); font-size: 12.5px; font-weight: 500;
}
.tp-weekdays button.is-weekend { color: var(--tp-weekend); }
.tp-weekdays button.active { background: var(--tp-sel-bg); color: var(--tp-sel-fg); }

.tp-end { display: flex; flex-direction: column; gap: 8px; }
.tp-end > .tp-label { margin-bottom: 0; }
.tp-date {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 10px;
  border: 0; border-radius: 10px; background: var(--tp-fill); color: var(--tp-ink);
  font-size: 13px; font-weight: 500; text-align: left;
}
.tp-date svg.i { width: 15px; height: 15px; stroke-width: 1.6; color: var(--tp-mut); }
.tp-date em { display: flex; margin-left: auto; color: var(--tp-mut); }
.tp-date em svg.i { width: 13px; height: 13px; }

.tp-sum { display: flex; flex-direction: column; gap: 3px; padding: 0 2px; }
.tp-sum b { font-size: 13px; line-height: 18px; font-weight: 600; }
.tp-next { font-size: 12px; line-height: 16px; color: var(--tp-mut); }

.tp-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--tp-line); }
.tp-foot > [data-ui-button] { margin-left: auto; min-height: 36px; padding: 6px 18px; }
.tp-foot-split { justify-content: space-between; }
.tp-link {
  height: 34px; padding: 0 4px; border: 0; background: transparent; color: var(--tp-mut);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.tp-link:hover:not(:disabled) { color: var(--tp-ink); }
.tp-link-danger, .tp-link-danger:hover:not(:disabled) { color: var(--tp-danger); }
.tp-link-inline { display: inline; padding: 0; border: 0; background: none; color: var(--tp-ink); font-size: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.tp-field {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: 12px; background: var(--tp-fill); font-size: 13px; min-width: 0;
}
.tp-field svg.i { width: 15px; height: 15px; stroke-width: 1.6; color: var(--tp-mut); }
.tp-field input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; outline: 0;
  background: transparent; font-size: 13px; text-overflow: ellipsis;
}
.tp-field input::placeholder { color: var(--tp-mut); opacity: 1; }
.tp-field:focus-within { background: var(--tp-field); box-shadow: 0 0 0 1.5px var(--tp-ink); }
.tp-field-action {
  display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; padding: 0;
  border: 0; background: none; color: var(--tp-ink); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.tp-field-action svg.i { width: 14px; height: 14px; color: var(--tp-ink); }
.tp-field-action:disabled { opacity: .45; }

/* ── «Ещё» menu ────────────────────────────────────────────────── */
.tp-menu { --tp-width: 240px; gap: 0; padding: 6px; }
.tp-menu .task-move-list, .tp-menu .task-advanced-menu { display: contents; }
.tp-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--tp-ink);
  font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap;
}
.tp-item svg.i { width: 17px; height: 17px; stroke-width: 1.6; color: var(--tp-mut); }
.tp-item .tp-item-chevron { width: 14px; height: 14px; margin-left: auto; }
.tp-item:hover:not(:disabled), .tp-item:focus-visible, .tp-item[aria-expanded="true"] { background: var(--tp-fill); }
.tp-item:disabled { opacity: .45; }
.tp-item:focus-visible { outline-offset: -2px; }
.tp-item-danger, .tp-item-danger svg.i { color: var(--tp-danger); }
.tp-sep { height: 1px; margin: 4px 6px; background: var(--tp-line); }

/* ── delete confirmation ───────────────────────────────────────── */
.tp-confirm { --tp-width: 280px; }
.tp-confirm-body { display: flex; flex-direction: column; gap: 14px; }
.tp-confirm-body[hidden] { display: none; }
.tp-confirm-body > b { font-size: 15px; line-height: 20px; font-weight: 700; }
.tp-confirm-body > .tp-note { margin-top: -8px; }
.tp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-btns > [data-ui-button] { min-height: 36px; padding: 6px 12px; }
.tp-btns > #deleteFutureTaskButton { grid-column: 1 / -1; }

/* ── date picker ───────────────────────────────────────────────── */
.tp-datepick { --tp-width: 320px; }
.tp-month { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tp-month-label { padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; font-weight: 600; }
.tp-month-nav, .tp-back-button {
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 14px; background: var(--tp-fill); color: var(--tp-ink);
}
.tp-month-nav { background: transparent; }
.tp-month-nav:hover:not(:disabled) { background: var(--tp-fill); }
.tp-month-nav:disabled { opacity: .3; }
.tp-month-nav svg.i, .tp-back-button svg.i { width: 15px; height: 15px; }
.tp-month-jump { display: none; flex: 1; justify-content: center; gap: 6px; }
.tp.is-jumping .tp-month-label { display: none; }
.tp.is-jumping .tp-month-jump { display: flex; }
.tp-select select {
  height: 28px; padding: 0 8px; border: 0; border-radius: 10px; background: var(--tp-fill); color: var(--tp-ink);
  font-size: 13px; font-weight: 500;
}
.tp-cal { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; text-align: center; }
.tp-cal > i { display: flex; align-items: center; justify-content: center; height: 22px; font-size: 11px; font-style: normal; font-weight: 600; color: var(--tp-mut); }
.tp-datepick .tp-cal:not(.tp-cal-grid) { margin-bottom: -6px; }
.tp-day {
  width: 32px; height: 32px; margin: 1px auto; padding: 0; border: 0; border-radius: 16px; background: transparent;
  color: var(--tp-ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tp-day.is-weekend { color: var(--tp-weekend); }
.tp-day.is-outside { color: rgba(23, 19, 31, .28); font-weight: 500; }
.tp.tp-dark .tp-day.is-outside { color: rgba(242, 243, 245, .32); }
.tp-day:hover:not(:disabled):not(.is-active) { background: var(--tp-fill); }
.tp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--tp-ink); }
.tp-day.is-active { background: var(--tp-sel-bg); color: var(--tp-sel-fg); box-shadow: none; }
.tp-day:disabled { opacity: .3; }

/* ── share ─────────────────────────────────────────────────────── */
.tp-share { --tp-width: 340px; }
.tp-toggle { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--tp-fill); cursor: pointer; }
.tp-toggle-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.tp-toggle-text b { font-size: 14px; font-weight: 600; }
.tp-toggle-text small { font-size: 12px; line-height: 16px; color: var(--tp-mut); }
.tp-switch { position: relative; flex: none; width: 36px; height: 22px; }
.tp-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tp-switch > span { position: absolute; inset: 0; border-radius: 11px; background: color-mix(in srgb, var(--tp-ink) 24%, transparent); transition: background-color 120ms ease; pointer-events: none; }
.tp-switch > span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 8px;
  background: #fff; transition: transform 120ms ease;
}
.tp-switch input:checked + span { background: var(--tp-sel-bg); }
.tp-switch input:checked + span::after { transform: translateX(14px); background: var(--tp-sel-fg); }
.tp-switch input:focus-visible + span { outline: 2px solid var(--tp-ink); outline-offset: 2px; }
.tp-share.is-off .tp-seg, .tp-share.is-off .tp-field, .tp-share.is-off .tp-note { opacity: .55; }

/* ── colour ────────────────────────────────────────────────────── */
.tp-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tp .tp-sw.task-color-option {
  position: relative; flex: none; width: 32px; height: 32px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(23, 19, 31, .1); outline: 0;
}
.tp .tp-sw.task-color-option.active { box-shadow: 0 0 0 2px var(--tp-bg), 0 0 0 4px var(--tp-ink); }
.tp .tp-sw.task-color-option:focus-visible { outline: 2px solid var(--tp-ink); outline-offset: 3px; }
.tp .tp-sw.task-color-option::after { display: none; }
.tp-sw-divider { flex: none; width: 1px; height: 26px; background: rgba(23, 19, 31, .18); }
.tp.tp-dark .tp-sw-divider { background: rgba(255, 255, 255, .24); }
.tp-custom-colors { display: contents; }
.tp-custom-colors button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(23, 19, 31, .1); }
.tp-custom-colors button.active { box-shadow: 0 0 0 2px var(--tp-bg), 0 0 0 4px var(--tp-ink); }

/* ── repeat ────────────────────────────────────────────────────── */
.tp-repeat { --tp-width: 340px; }
.tp-hscroll {
  margin: 0 -16px; padding: 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.tp-hscroll::-webkit-scrollbar { display: none; }
.tp-hscroll.has-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 85%, transparent); }
.tp-hscroll.at-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%); mask-image: linear-gradient(90deg, transparent, #000 15%); }
.tp-hscroll.at-start.at-end { -webkit-mask-image: none; mask-image: none; }
.tp-pills { display: flex; gap: 6px; width: max-content; }

/* ── tags ──────────────────────────────────────────────────────── */
.tp-tags { --tp-width: 280px; gap: 12px; }
.tp-back { display: flex; align-items: center; gap: 8px; }
.tp-back b { font-size: 16px; font-weight: 600; }
.tp-tag-list { display: flex; flex-direction: column; gap: 2px; max-height: min(260px, 40vh); margin: 0 -8px; padding: 0 8px; overflow-y: auto; scrollbar-width: thin; }
.tp-tag-row { position: relative; display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.tp-tag-row:hover, .tp-tag-row:focus-within { background: var(--tp-fill); }
.tp-tag-toggle {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; height: 36px; padding: 0 8px;
  border: 0; border-radius: 10px; background: transparent; color: var(--tp-ink); font-size: 14px; text-align: left;
}
.tp-tag-toggle > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-tag-check {
  display: flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px;
  border: 1.5px solid rgba(23, 19, 31, .3); border-radius: 6px; background: #fff; color: #fff;
}
.tp.tp-dark .tp-tag-check { border-color: rgba(255, 255, 255, .4); background: transparent; }
.tp-tag-check svg.i { width: 11px; height: 11px; stroke-width: 3; }
.tp-tag-toggle[aria-pressed="true"] .tp-tag-check { background: var(--tp-sel-bg); border-color: var(--tp-sel-bg); color: var(--tp-sel-fg); }
.tp-tag-dot { flex: none; width: 8px; height: 8px; border-radius: 4px; }
.tp-tag-edit {
  display: flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: rgba(23, 19, 31, .3);
}
.tp.tp-dark .tp-tag-edit { color: rgba(242, 243, 245, .4); }
.tp-tag-row:hover .tp-tag-edit, .tp-tag-edit:focus-visible { color: var(--tp-mut); }
.tp-tag-edit:hover { color: var(--tp-ink) !important; }
.tp-tag-edit svg.i { width: 14px; height: 14px; }
.tp-tag-new { color: var(--tp-ink); font-weight: 500; }
.tp-tag-new svg.i { width: 15px; height: 15px; }
.tp-tag-empty { margin: 0; padding: 8px; font-size: 13px; color: var(--tp-mut); }
.tp-tag-editor { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 8px; }
.tp-tag-editor p { margin: 0; font-size: 12px; line-height: 17px; color: var(--tp-mut); }
.tp-tag-editor .tp-tag-error { color: var(--tp-danger); }
.tp-tag-editor input { height: 34px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--tp-field); font-size: 13px; }
.tp-tag-editor .tp-btns > [data-ui-button] { min-height: 32px; padding: 4px 10px; font-size: 13px !important; }
.tp-tag-row.is-editing { flex-wrap: wrap; background: var(--tp-fill); }

/* ── reminder ──────────────────────────────────────────────────── */
.tp-reminder { --tp-width: 330px; }
.tp-time { display: flex; align-items: center; gap: 6px; }
.tp-time input {
  width: 52px; height: 40px; padding: 0; border: 0; border-radius: 12px; outline: 0;
  background: var(--tp-fill); text-align: center; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tp-time input:focus { background: var(--tp-field); box-shadow: 0 0 0 1.5px var(--tp-ink); }
.tp-time i { font-size: 18px; font-style: normal; color: var(--tp-mut); }
.tp-reminder .tp-foot > .tp-link[hidden] ~ [data-ui-button] { margin-left: auto; }

/* ── timer strip above the card ────────────────────────────────── */
.task-dialog > .task-pomodoro-panel.tt-strip {
  --tp-tint: color-mix(in srgb, var(--task-dialog-color) 22%, #fff);
  gap: 12px;
  color: #17131f;
  --tt-ink: #17131f;
  --tt-mut: rgba(23, 19, 31, .56);
  --tt-fill: rgba(255, 255, 255, .62);
}
.tt-strip .tt-time {
  min-width: 92px; margin: 0; font-size: 30px; line-height: 34px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tt-strip .tt-modes { flex: none; width: 300px; height: 34px; border-radius: 17px; }
.tt-strip .tt-modes > button { border-radius: 15px; }
.tt-strip .tt-custom {
  display: flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px; border-radius: 17px;
  background: var(--tt-fill); font-size: 13px; font-weight: 600;
}
.tt-strip .tt-custom input { width: 36px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: #fff; color: #17131f; text-align: center; font: 600 14px/1 inherit; font-variant-numeric: tabular-nums; }
.tt-strip .tt-custom[hidden] { display: none; }
.tt-strip .tt-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--tt-mut); white-space: nowrap; }
.tt-strip .tt-label[hidden] { display: none; }
.tt-strip .tt-label i { width: 8px; height: 8px; border-radius: 4px; background: #be2a4a; }
.tt-strip .tt-label.is-break i { background: #2f8f5b; }
.tt-strip .tt-go {
  margin-left: auto; min-height: 40px !important; padding: 0 18px !important; gap: 8px;
  --fw-button-bg: #17131f; --fw-button-ink: #fff;
}
.tt-strip .tt-go svg.i { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.tt-strip .tt-go[hidden], .tt-strip .tt-ib[hidden] { display: none !important; }
.tt-strip .tt-ib {
  display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 20px; background: var(--tt-fill); color: #17131f;
}
.tt-strip .tt-pause { margin-left: auto; }
.tt-strip .tt-ib svg.i { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tt-strip .tt-stop svg.i { fill: currentColor; stroke: none; }
.tt-strip.is-running .tt-modes, .tt-strip.is-running .tt-custom { display: none; }
.tt-strip .tt-modes[hidden] { display: none; }
.tt-strip svg.i { flex: none; }

/* Running timer: the toolbar icon turns into a black pill with the time. */
.task-dialog-toolbar .task-quick-tool.is-timing {
  width: auto;
  min-width: 36px;
  column-gap: 6px;
  border-radius: 18px;
  background: #17131f;
  color: #fff;
}
.task-dialog-toolbar .task-quick-tool.is-timing::before,
.task-dialog-toolbar .task-quick-tool.is-timing::after { display: none; }
.task-dialog-toolbar .task-quick-tool .tt-tool-time {
  grid-area: 1 / 2;
  margin: 0 12px 0 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* left inner padding: the shared icon-button rules pin padding/margins to 0, a transparent border still counts */
.task-dialog-toolbar .task-quick-tool.is-timing { border-left: 12px solid transparent; }

@media (max-width: 700px) {
  .tp { max-width: calc(100vw - 16px); }
  .tp-tag-list { max-height: 32vh; }
}

/* A footer with a single action: the button takes the whole row instead of hanging on the right. */
.tp-foot > .tp-link[hidden] + [data-ui-button] { flex: 1; margin-left: 0; }

/* On phones the popover sits as a sheet above the toolbar; no tip there. */
@media (max-width: 900px) {
  .tp::before { display: none; }
}

/* The timer stays a single compact strip on every screen size (overrides the old big
   «running timer» block of the phone layout). */
.task-dialog > .task-pomodoro-panel.tt-strip,
.task-dialog > .task-pomodoro-panel.tt-strip.is-running {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 12px;
  min-height: 0;
  padding: 12px 18px;
}
.task-dialog > .task-pomodoro-panel.tt-strip .tt-time,
.task-dialog > .task-pomodoro-panel.tt-strip.is-running .tt-time { font-size: 30px; line-height: 34px; }
@media (max-width: 900px) {
  .task-dialog > .task-pomodoro-panel.tt-strip .tt-time { font-size: 26px; min-width: 0; }
  .tt-strip .tt-modes { order: 5; flex: 1 1 100%; width: auto; }
  .tt-strip .tt-go, .tt-strip .tt-pause { margin-left: auto; }
  .task-dialog-toolbar .task-quick-tool.is-timing { flex: 0 0 auto; width: auto; min-width: 64px; height: 36px; }
}

.task-dialog-toolbar .task-quick-tool.is-timing {
  width: auto !important;
  min-width: 36px !important;
  background: #17131f !important;
  color: #fff !important;
}
.task-dialog-toolbar .task-quick-tool.is-timing > * { color: #fff !important; }
@media (max-width: 900px) {
  .task-dialog > .task-pomodoro-panel.tt-strip, .task-dialog > .task-pomodoro-panel.tt-strip.is-running { padding-right: 64px; }
  .task-dialog-toolbar .task-quick-tool.is-timing { min-width: 76px !important; justify-self: center; }
}
@media (max-width: 900px) {
  .task-dialog > .task-pomodoro-panel.tt-strip, .task-dialog > .task-pomodoro-panel.tt-strip.is-running { padding-right: 56px; gap: 8px; flex-wrap: nowrap; }
  .tt-strip .tt-modes { flex-basis: auto; }
  .task-dialog > .task-pomodoro-panel.tt-strip:not(.is-running) { flex-wrap: wrap; }
  .tt-strip .tt-label { font-size: 12px; min-width: 0; }
  .tt-strip .tt-ib { width: 36px; height: 36px; }
}

/* Phones: the time is already shown in the strip above the card, so the toolbar icon stays a plain icon. */
@media (max-width: 900px) {
  .task-dialog-toolbar .task-quick-tool .tt-tool-time { display: none; }
  .task-dialog-toolbar .task-quick-tool.is-timing {
    width: 40px !important; min-width: 40px !important; background: transparent !important; color: inherit !important;
  }
  .task-dialog-toolbar .task-quick-tool.is-timing > * { color: inherit !important; }
}

/* Running timer in the task list: black pill with the remaining time. */
.entry-meta-icons .entry-timer-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px;
  background: #17131f; color: #fff; font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.entry-meta-icons .entry-timer-pill i { width: 6px; height: 6px; border-radius: 3px; background: #be2a4a; }
.entry-meta-icons .entry-timer-pill span { color: #fff; }

/* Uncoloured card: the popover is nearly white, so fills are a soft grey instead of translucent white. */
.tp.tp-plain:not(.tp-dark) { --tp-fill: rgba(23, 19, 31, .06); --tp-track: rgba(23, 19, 31, .08); --tp-line: rgba(23, 19, 31, .1); }
.tp.tp-plain:not(.tp-dark) .tp-tag-check { background: #fff; }

/* Chips and segments show their state by fill; no extra focus ring around them. */
.tp :is(.tp-chip, .tp-seg > button, .tp-weekdays button, .tp-day):focus-visible { outline: none; }

/* The timer strip is not a .tp popover, so it carries its own segment colours. */
.tt-strip { --tp-track: rgba(23, 19, 31, .09); --tp-mut: rgba(23, 19, 31, .6); --tp-ink: #17131f; }
.tt-strip .tt-modes > button:is(.on, [aria-checked="true"]) { background: #fff; box-shadow: 0 1px 3px rgba(23, 19, 31, .18); }
.tt-strip .tt-ib { background: rgba(23, 19, 31, .08); }
@media (max-width: 900px) {
  .tt-strip .tt-modes { flex: 1 1 100%; }
}

/* The shared focus outline is !important in a layer; neutralise it through its variable instead. */
.tp :is(.tp-chip, .tp-seg > button, .tp-weekdays button, .tp-day), .tt-strip .tt-modes > button { --fw-button-focus: transparent; }

/* Phones: the mode switch spans the strip evenly (cancels the room kept for the close button). */
@media (max-width: 900px) {
  .tt-strip .tt-modes { margin-right: -38px; justify-content: center; }
}

/* Phones: the idle strip fits on one line — time, mode switch, start. */
@media (max-width: 900px) {
  .task-dialog > .task-pomodoro-panel.tt-strip:not(.is-running) { flex-wrap: nowrap; gap: 8px; }
  .task-dialog > .task-pomodoro-panel.tt-strip .tt-time { font-size: 22px; line-height: 26px; }
  .tt-strip .tt-modes { order: 0; flex: 1 1 0; min-width: 0; margin-right: 0; height: 32px; }
  .tt-strip .tt-modes > button { padding: 0 2px; font-size: 11px; }
  .tt-strip .tt-go { margin-left: 0; min-height: 36px !important; padding: 0 12px !important; gap: 6px; }
  .tt-strip .tt-custom { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 900px) { .tt-strip .tt-m { display: none; } .tt-strip .tt-modes > button { font-size: 12px; } }
@media (max-width: 900px) {
  /* start becomes a round play button so the mode switch gets the room it needs */
  .tt-strip:not(.is-running) .tt-go { width: 36px; min-width: 36px; padding: 0 !important; }
  .tt-strip:not(.is-running) .tt-go > span { display: none; }
  .tt-strip .tt-modes { flex: 1 1 auto; }
  .tt-strip .tt-modes > button { overflow: hidden; text-overflow: clip; }
}

/* Same strip height whether idle or running, so the close button stays on the buttons' centre line. */
@media (max-width: 900px) {
  .task-dialog > .task-pomodoro-panel.tt-strip, .task-dialog > .task-pomodoro-panel.tt-strip.is-running { min-height: 64px; box-sizing: border-box; align-content: center; }
}

/* Inputs inside a field: only the rounded field ring shows, never a second rectangle around the input. */
.tp .tp-field input, .tp .tp-time input, .tp .tt-custom input { --fw-button-focus: transparent; outline: none !important; box-shadow: none; }
.tp .tp-field input:focus, .tp .tp-field input:focus-visible { outline: none !important; box-shadow: none; }

/* No room under the button: the popover scrolls inside instead of covering the button. */
.tp.is-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tp.is-scroll::before { display: none; }
.tp [hidden] { display: none !important; }

/* Calendar day: a true circle with the number centred in it. */
.tp .tp-day {
  display: grid; place-items: center; box-sizing: border-box; width: 34px; height: 34px; min-width: 0; min-height: 0;
  margin: 0 auto; padding: 0; border-radius: 50%; line-height: 1; text-align: center;
}

/* The date chip is 34px tall; its (opaque) wrapper was 3px shorter and cut a strip off the chip's bottom. */
.task-dialog-date { display: flex; align-items: center; min-height: 34px; }

/* «Оформление» и «Интеграции» живут в меню профиля; кнопки в настройках остались только как цели для openWorkspace(). */
.workspace-tab-moved { display: none !important; }
