/* ==========================================================================
   Timer di studio (#/timer, scheda in home, pillola fissa)
   Il colore dell'etichetta (o della pausa) arriva in --c.
   ========================================================================== */
.tm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; animation: rise 0.4s var(--ease) both; }
.tm-head h1 { margin: 0; }
.tm-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 899px) { .tm-layout { grid-template-columns: 1fr; } }
.tm .card { margin: 0; animation: rise 0.45s var(--ease) both; }
.tm-side { display: grid; gap: 14px; }
.tm-side > :nth-child(2) { animation-delay: 60ms; }
.tm-side > :nth-child(3) { animation-delay: 100ms; }
.tm-side > :nth-child(4) { animation-delay: 140ms; }
.tm .card h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.tm .card h3 small { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-4); }
.tm-empty { margin: 0; font-size: 14px; color: var(--ink-3); }

/* --- timer --- */
.tm-main { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 22px 22px 26px; position: sticky; top: calc(80px + var(--sat, 0px)); }
@media (max-width: 899px) { .tm-main { position: static; } }
.tm-tags { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.tm-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--stroke-2); background: transparent; color: var(--ink-2);
  font: inherit; font-size: 14.5px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s var(--ease);
}
.tm-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tm-chip:hover:not(:disabled) { color: var(--ink); background: var(--fill); }
.tm-chip:active:not(:disabled) { transform: scale(0.95); }
.tm-chip.active { color: var(--ink); border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.tm-chip:disabled { opacity: 0.35; cursor: default; }
.tm-mode button { min-height: 34px; padding: 5px 16px; font-size: 14px; }
.tm-mode button:disabled { opacity: 0.4; cursor: default; }

.tm-ring-wrap { position: relative; width: min(340px, 78vw); aspect-ratio: 1; }
.tm-ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.tm-track { fill: none; stroke: var(--fill-2); stroke-width: 10; }
.tm-prog {
  fill: none; stroke: var(--c); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 0.3s linear, stroke 0.4s, opacity 0.3s;
}
.tm-main.is-running .tm-prog { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 45%, transparent)); }
.tm-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.tm-phase { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.tm-main.is-break .tm-phase { color: var(--ok); }
.tm-time {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(48px, 13vw, 72px);
  line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.tm-dots { display: flex; gap: 7px; min-height: 8px; }
.tm-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--fill-3); transition: background 0.3s; }
.tm-dots i.on { background: var(--c); animation: pop 0.3s var(--ease); }

.tm-ctrl { display: flex; align-items: flex-start; justify-content: center; gap: 22px; min-height: 92px; }
.tm-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; font: inherit; animation: pop 0.25s var(--ease) both; }
.tm-btn span {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--stroke-2); background: var(--fill);
  transition: background 0.15s, transform 0.18s var(--ease), box-shadow 0.18s;
}
.tm-btn span svg { width: 22px; height: 22px; }
.tm-btn small { font-size: 13px; color: var(--ink-2); }
.tm-btn:hover span { background: var(--fill-2); }
.tm-btn:active span { transform: scale(0.92); }
.tm-btn.tm-go span { width: 76px; height: 76px; background: var(--solid); color: var(--on-solid); border-color: transparent; }
.tm-btn.tm-go span svg { width: 28px; height: 28px; }
.tm-btn.tm-go:hover span { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.tm-btn:not(.tm-go) { margin-top: 8px; }

/* --- numeri --- */
.tm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; animation: rise 0.45s var(--ease) both; }
.tm-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--stroke); border-radius: var(--r); min-width: 0; }
.tm-tile small { font-size: 12.5px; color: var(--ink-3); }
.tm-tile b { display: flex; align-items: center; gap: 5px; font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-tile b svg { width: 19px; height: 19px; color: var(--ink-4); flex: none; }
.tm-tile.hot b svg { color: #ff9f0a; }
.tm-tile span { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.tm-tile b .tm-flame { display: inline-flex; width: 20px; height: 24px; flex: none; font-size: inherit; }
.tm-tile b .tm-flame svg { width: 100%; height: 100%; }
@media (max-width: 520px) {
  .tm-tiles { grid-template-columns: 1fr 1fr; }
  .tm-tile:last-child { grid-column: 1 / -1; }
}

/* --- colonne: ultimi 7 giorni --- */
.tm-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 168px; }
.tm-col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; min-width: 0; }
.tm-col-v { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 16px; }
.tm-col-bar { position: relative; width: 100%; max-width: 34px; height: 100%; border-radius: 7px; background: var(--fill); overflow: hidden; }
.tm-col-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 7px 7px 3px 3px; background: var(--ink-3); transform-origin: bottom; animation: tmGrow 0.6s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.tm-col.today .tm-col-bar i { background: var(--ink); }
.tm-col.today .tm-col-v, .tm-col.today .tm-col-l { color: var(--ink); }
.tm-col-l { font-size: 12px; color: var(--ink-3); }
.tm-col.today .tm-col-l { font-weight: 600; }
@keyframes tmGrow { from { transform: scaleY(0); } }

/* --- barre: per etichetta o per gruppo --- */
.tm-bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: none; }
.tm-bar-list li { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tm-bar-n { font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-bar { height: 12px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.tm-bar i { display: block; height: 100%; width: var(--w); min-width: 4px; border-radius: 6px; background: var(--c); transform-origin: left; animation: tmGrowX 0.6s var(--ease) both; animation-delay: calc(var(--i) * 50ms); }
.tm-bar-v { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 52px; text-align: right; }
@keyframes tmGrowX { from { transform: scaleX(0); } }

/* --- cosa ripassare --- */
.tm-sugg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: none; }
.tm-sugg-item { margin: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 12px; background: var(--fill); animation: rise 0.3s var(--ease) both; }
.tm-sugg-bar { align-self: stretch; width: 4px; flex: none; border-radius: 4px; background: var(--c); }
.tm-sugg-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tm-sugg-t b { font-size: 15px; font-weight: 600; line-height: 1.3; }
.tm-sugg-t small { font-size: 13px; color: var(--ink-3); line-height: 1.35; }
.tm-sugg-item.soon .tm-sugg-t b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; vertical-align: 2px; border-radius: 50%; background: var(--ko); }
.tm-sugg-item .btn { flex: none; height: 38px; }
.tm-sugg-item .btn svg { width: 13px; height: 13px; }

/* --- impostazioni --- */
.tm-set form { display: grid; gap: 14px; }
.tm-set h3 { margin: 0; }
.tm-set-grid { display: grid; gap: 8px; }
.tm-set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.tm-set-row small { color: var(--ink-3); font-size: 13px; }
.tm-step { display: inline-flex; align-items: center; gap: 4px; }
.tm-step button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--stroke-2); background: transparent; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; transition: background 0.15s, transform 0.15s var(--ease); }
.tm-step button:hover { background: var(--fill); }
.tm-step button:active { transform: scale(0.9); }
.tm-step input { width: 58px; min-height: 40px; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.tm-step input::-webkit-inner-spin-button, .tm-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tm-set-tg { font-size: 15px; color: var(--ink); min-height: 32px; }

/* --- scheda in home --- */
.tm-home { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; animation: rise 0.42s var(--ease) both; }
.tm-home-l { display: flex; flex-direction: column; min-width: 0; }
.tm-home-l small { font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.tm-home-l b { font-family: var(--font-display); font-size: 30px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tm-home-l span { font-size: 13.5px; color: var(--ink-3); }
.tm-home-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-home-r .btn svg { width: 15px; height: 15px; }
.tm-home-run { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); text-decoration: none; color: var(--ink); }
.tm-home-run i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); animation: tmPulse 2s ease-in-out infinite; }
.tm-home-run span { display: flex; flex-direction: column; line-height: 1.2; }
.tm-home-run small { font-size: 12px; color: var(--ink-2); }
.tm-home-run b { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tm-home-toggle { width: 44px; height: 44px; }
@keyframes tmPulse { 50% { opacity: 0.35; } }

/* --- pillola fissa --- */
.tm-pill {
  position: fixed; z-index: 90; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 999px; background: var(--raised); color: var(--ink);
  border: 1px solid var(--stroke-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  animation: rise 0.35s var(--ease) both;
}
.tm-pill[hidden] { display: none; }
@media (min-width: 981px) { .tm-pill { left: calc(var(--sidebar-w, 272px) + 20px); } }
body.nb-focus .tm-pill { left: 16px; }
/* a tutto schermo (html.focus-mode, css/glass.css): il menu non c'è più, quindi niente spazio per lui;
   dove in basso a sinistra c'è il bottone tondo per uscire (.focus-fab, 46 px) la pillola gli sta accanto */
@media (min-width: 981px) {
  html.focus-mode .tm-pill { left: calc(16px + var(--sal, 0px)); }
  html.focus-mode.nb-open .tm-pill { left: calc(70px + var(--sal, 0px)); }
}
/* telefono con la barra in basso (js/tabbar.js): la pillola sta sopra la barra, come .privacy-pill in
   css/glass.css; a tutto schermo la barra va via e la pillola torna giù, accanto al bottone tondo */
html.has-tabbar:not(.tb-hide) .tm-pill { bottom: calc(80px + var(--sab, 0px)); }
@media (max-height: 500px) and (orientation: landscape) { html.has-tabbar:not(.tb-hide) .tm-pill { bottom: calc(62px + var(--sab, 0px)); } }
@media (max-width: 980px) {
  html.focus-mode.has-tabbar .tm-pill { bottom: calc(16px + var(--sab, 0px)); }
  html.focus-mode.has-tabbar:not(.tb-hide) .tm-pill { left: calc(70px + var(--sal, 0px)); }
}
.tm-pill-main { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 8px 0 12px; border-radius: 999px; text-decoration: none; color: inherit; }
.tm-pill-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); animation: tmPulse 2s ease-in-out infinite; }
.tm-pill.paused .tm-pill-dot { animation: none; opacity: 0.5; }
.tm-pill-t { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tm-pill.paused .tm-pill-t { color: var(--ink-3); }
.tm-pill-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fill-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background 0.15s, transform 0.15s var(--ease); }
.tm-pill-btn:hover { background: var(--fill-3); }
.tm-pill-btn:active { transform: scale(0.88); }
.tm-pill-btn svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  .tm-prog, .tm-dots i, .tm-btn span { transition: none; }
  .tm-col-bar i, .tm-bar i, .tm-bar-stack b, .tm-pill, .tm-home-run i, .tm-pill-dot, .tm-btn, .tm .card, .tm-tiles, .tm-head, .tm-sugg-item { animation: none; }
}

/* sottofondo per lo studio */
.tm-amb { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--stroke); width: 100%; }
.tm-amb-l { font-size: 12px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.tm-amb-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tm-amb-b { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--stroke-2); background: transparent; color: var(--ink-2); font: inherit; font-size: 13.5px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.tm-amb-b:hover { background: var(--fill); color: var(--ink); }
.tm-amb-b.on { background: var(--solid); color: var(--on-solid); border-color: transparent; }
.tm-amb-vol input { width: 180px; accent-color: var(--ink); }
.tm-amb-vol input:disabled { opacity: 0.35; }
/* colonna dei numeri stretta (iPad in verticale con il timer accanto, finestre strette):
   due riquadri per riga invece di tre, così «12 giorni» non esce dal riquadro */
.tm-side { container: tmside / inline-size; }
@container tmside (max-width: 430px) {
  .tm-tiles { grid-template-columns: 1fr 1fr; }
  .tm-tile:last-child { grid-column: 1 / -1; }
}

/* --- etichette divise per gruppo (scelta nel timer) --- */
.tm-tg { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.tm-tg-h {
  display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 0 6px 0 4px;
  border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 12px; font-weight: 650;
  letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; border-radius: 8px;
}
.tm-tg-h:hover { color: var(--ink); }
.tm-tg-h svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.tm-tg.closed .tm-tg-h svg { transform: rotate(-90deg); }
.tm-tg-h small { font-size: 11px; font-weight: 600; letter-spacing: 0; color: var(--ink-4); padding: 1px 6px; border-radius: 999px; background: var(--fill-2); }
.tm-chip-edit { border-style: dashed; color: var(--ink-3); font-size: 13.5px; min-height: 34px; padding: 0 12px; }
.tm-chip-edit svg { width: 14px; height: 14px; }

/* --- intestazione con il cambio etichette / gruppi --- */
.tm-chart-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tm .card .tm-chart-h h3 { margin: 0; }
.tm-statby button { min-height: 30px; padding: 3px 12px; font-size: 13px; }
/* gruppo: la barra divisa nei colori delle sue etichette */
.tm-bar-stack i { display: flex; gap: 2px; background: none; }
.tm-bar-stack b { display: block; height: 100%; flex: 1 1 0; min-width: 3px; border-radius: 3px; background: var(--c); }

/* --- Da fare --- */
.tm-td-add { margin: -4px 0 6px; }
.tm-td-in { display: flex; align-items: center; gap: 6px; padding: 3px 3px 3px 12px; border: 1px solid var(--stroke-2); border-radius: 14px; background: var(--fill); transition: border-color 0.15s, background 0.15s; }
.tm-td-in:focus-within { border-color: var(--ink-3); background: transparent; }
.tm-td-in input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.tm-td-plus { flex: none; width: 40px; height: 40px; border-radius: 11px; border: 0; background: var(--solid); color: var(--on-solid); display: grid; place-items: center; cursor: pointer; transition: transform 0.15s var(--ease), opacity 0.15s; }
.tm-td-plus svg { width: 18px; height: 18px; }
.tm-td-plus:active { transform: scale(0.9); }
.tm-td-add:not(.has-text) .tm-td-plus { opacity: 0.35; }
/* giorno ed etichetta: solo mentre si scrive */
.tm-td-opts { display: none; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0 2px; }
.tm-td-add.has-text .tm-td-opts { display: flex; animation: rise 0.2s var(--ease) both; }
.tm-td-when button { min-height: 34px; padding: 4px 13px; font-size: 13.5px; }
.tm-td-opts input[type="date"], .tm-td-tag {
  height: 36px; max-width: 100%; border-radius: 10px; border: 1px solid var(--stroke-2);
  background: var(--sheet, var(--raised)); color: var(--ink); font: inherit; font-size: 14px; padding: 0 8px;
}
.tm-td-tag { flex: 1 1 140px; min-width: 0; }
.tm-td-opts input[hidden] { display: none; }

.tm-td-h { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.tm-td-h.late { color: var(--ko); }
.tm-td-h a { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.tm-td-list > .tm-td-h:first-child { margin-top: 8px; }
.tm-td-none { margin: 10px 0 2px; }
.tm-td-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: none; }
.tm-td {
  margin: 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 6px 6px 10px;
  border-radius: 13px; background: var(--fill); box-shadow: inset 3px 0 0 var(--c);
  transition: opacity 0.2s, background 0.2s;
}
.tm-td.late { background: var(--ko-fill); }
.tm-td.done { opacity: 0.55; }
.tm-td.done .tm-td-t { text-decoration: line-through; }
.tm-td-check {
  position: relative; flex: none; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--c);
  background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer;
  transition: background 0.15s, transform 0.15s var(--ease);
}
/* area di tocco più grande del cerchio */
.tm-td-check::after { content: ""; position: absolute; inset: -8px; }
.tm-td-check svg { width: 16px; height: 16px; }
.tm-td-check:hover { background: color-mix(in srgb, var(--c) 15%, transparent); }
.tm-td-check[aria-pressed="true"] { background: var(--c); color: #fff; }
.tm-td-check:active { transform: scale(0.88); }
.tm-td-check:disabled { opacity: 0.6; cursor: default; }
.tm-td-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tm-td-t { font-size: 15px; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.tm-td-meta { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12.5px; color: var(--ink-3); }
.tm-td-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tm-td-tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tm-td.late .tm-td-date { color: var(--ko); }
/* il giorno si cambia toccandolo: sopra c'è il selettore di data, invisibile */
.tm-td-date { position: relative; white-space: nowrap; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--ink-4); }
.tm-td-date input { position: absolute; inset: -8px -4px; width: calc(100% + 8px); height: calc(100% + 16px); opacity: 0; cursor: pointer; border: 0; padding: 0; font-size: 16px; }
.tm-td-ic {
  flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 0; background: transparent;
  color: var(--ink-3); display: grid; place-items: center; cursor: pointer; font-size: 20px; line-height: 1;
  transition: background 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.tm-td-ic svg { width: 15px; height: 15px; }
.tm-td-ic:active { transform: scale(0.9); }
.tm-td-play { color: var(--c); }
.tm-td-play:hover { background: color-mix(in srgb, var(--c) 14%, transparent); }
.tm-td-del:hover { background: var(--ko-fill); color: var(--ko); }
.tm-td .ui-more { flex: none; }
.tm-td-more { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; margin-top: 6px; padding: 0 4px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tm-td-more:hover { color: var(--ink); }
.tm-td-more svg { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform 0.2s var(--ease); }
.tm-td-more[aria-expanded="true"] svg { transform: none; }
.tm-td-more + .tm-td-ul { margin-top: 4px; }

/* --- gestione delle etichette (finestra) --- */
.tm-ts { width: min(480px, 100%); }
.tm-ts h3 { margin: 0 0 4px; }
.tm-ts-sub { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-3); line-height: 1.4; }
.tm-ts-body { display: grid; gap: 12px; max-height: min(58vh, 520px); overflow-y: auto; margin: 0 -4px; padding: 0 4px; -webkit-overflow-scrolling: touch; }
.tm-ts-g { border: 1px solid var(--stroke); border-radius: var(--r); padding: 6px 8px 8px 12px; }
.tm-ts-gh { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.tm-ts-gh b { font-size: 15px; font-weight: 650; }
.tm-ts-gh small { font-size: 12px; color: var(--ink-3); margin-right: auto; }
.tm-ts-list { list-style: none; margin: 0; padding: 0; max-width: none; }
.tm-ts-t { margin: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--stroke); }
.tm-ts-color { position: relative; flex: none; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 3px solid var(--raised); background: var(--c); box-shadow: 0 0 0 1px var(--stroke-2); cursor: pointer; }
.tm-ts-color::after { content: ""; position: absolute; inset: -8px; }
.tm-ts-n { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.tm-ts-add { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-top: 2px; padding: 0 4px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tm-ts-add:hover { color: var(--ink); }
.tm-ts-add svg, .tm-ts .nb-modal-actions .btn svg { width: 15px; height: 15px; }
.tm-ts .tm-empty { font-size: 13.5px; padding: 6px 0; }
.tm-sw { display: block; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }

@media (prefers-reduced-motion: reduce) {
  .tm-td-add.has-text .tm-td-opts { animation: none; }
  .tm-tg-h svg, .tm-td-more svg { transition: none; }
}

/* --- Concentrazione (js/timer.js: setZen) ---
   html.tm-zen: via la barra in alto e il bottone tondo (il menu laterale lo toglie Fisica.layout);
   .tm.is-zen: nella pagina restano il timer con la sua etichetta e le cose da fare */
.tm-hb { height: 40px; padding: 0 14px; gap: 7px; font-size: 14px; }
.tm-hb svg { width: 17px; height: 17px; flex: none; }
.tm-hb[aria-pressed="true"] { background: var(--solid); color: var(--on-solid); border-color: transparent; }
.tm-hb[hidden] { display: none; }
@media (max-width: 620px) {
  .tm-head .tm-hb { width: 40px; padding: 0; }
  .tm-head .tm-hb span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.tm-zbar, .tm-ztag { display: none; }
html.tm-zen .topbar, html.tm-zen .focus-fab { display: none !important; }
.tm.is-zen { display: flex; flex-direction: column; min-height: calc(100vh - 16px - var(--sat, 0px)); min-height: calc(100dvh - 16px - var(--sat, 0px)); padding-top: calc(22px + var(--sat, 0px)); padding-bottom: calc(32px + var(--sab, 0px)); max-width: 1060px; }
.tm.is-zen .tm-head, .tm.is-zen .tm-tags, .tm.is-zen .tm-mode, .tm.is-zen .tm-amb,
.tm.is-zen .tm-tiles, .tm.is-zen .tm-sugg, .tm.is-zen .tm-chart { display: none; }
.tm.is-zen .tm-zbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; animation: rise 0.35s var(--ease) both; }
.tm-zbar-l { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.tm-zbar-l svg { width: 16px; height: 16px; }
.tm-zbar-r { display: flex; align-items: center; gap: 8px; }
.tm.is-zen .tm-layout { flex: 1; align-content: center; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 36px; padding: 18px 0; }
/* il timer senza scheda: solo anello e comandi, calmo */
.tm.is-zen .tm-main { position: static; background: none; border-color: transparent; box-shadow: none; padding: 8px 0; gap: 16px; }
.tm.is-zen .tm-ring-wrap { width: min(380px, 40vw, 58vh); }
.tm.is-zen .tm-time { font-size: clamp(52px, 7vw, 80px); }
.tm.is-zen .tm-side { align-self: center; }
.tm.is-zen .tm-todo { max-height: min(74vh, 680px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tm.is-zen .tm-ztag {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 14px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 550; cursor: pointer; max-width: 100%;
  transition: background 0.15s, transform 0.15s var(--ease);
}
.tm-ztag i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tm-ztag span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-ztag svg { flex: none; width: 14px; height: 14px; color: var(--ink-3); }
.tm-ztag:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.tm-ztag:active { transform: scale(0.96); }
.tm-ztag.locked { cursor: default; }
.tm-ztag.locked svg { display: none; }
.tm-ztag.locked:active { transform: none; }
/* telefono, iPad in verticale, finestre strette: uno sopra l'altro */
@media (max-width: 899px), (orientation: portrait) and (max-width: 1100px) {
  .tm.is-zen .tm-layout { grid-template-columns: 1fr; gap: 18px; align-content: start; }
  .tm.is-zen .tm-ring-wrap { width: min(320px, 72vw, 42vh); }
  .tm.is-zen .tm-todo { max-height: none; overflow: visible; }
  .tm.is-zen .tm-side { width: 100%; max-width: 560px; justify-self: center; }
}
@media (max-width: 520px) {
  .tm.is-zen { padding-top: calc(14px + var(--sat, 0px)); }
  .tm.is-zen .tm-zbar-l { display: none; }
  .tm.is-zen .tm-zbar { justify-content: flex-end; }
}

/* video nascosto della mini finestra di Safari: nel documento (lo chiede), ma invisibile */
.tm-pipvid { position: fixed; left: 0; bottom: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; z-index: -1; }

@media (prefers-reduced-motion: reduce) {
  .tm.is-zen .tm-zbar { animation: none; }
  .tm-ztag { transition: none; }
  .tm-ztag:active { transform: none; }
}

/* --- testi lunghi: tre righe, poi «Mostra altro» --- */
.tm-td-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.tm-td-t.open { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.tm-td-xp { align-self: flex-start; margin: 0 0 1px; padding: 2px 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tm-td-xp:hover { color: var(--ink); }
.tm-td-xp[hidden] { display: none; }
/* «Fatte oggi»: una piega che si apre (righe della griglia 0fr → 1fr), senza ridisegnare la lista */
.tm-td-fold { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.28s cubic-bezier(.2,.8,.2,1), opacity 0.2s; }
.tm-td-fold > div { min-height: 0; overflow: hidden; }
.tm-td-fold.open { grid-template-rows: 1fr; opacity: 1; }
.tm-td-fold .tm-td-ul { padding-top: 4px; }
@media (prefers-reduced-motion: reduce) { .tm-td-fold { transition: none; } }
