/* Modo foco: barra flutuante com relógio, escolha de tempo e botão na tarefa */
.foco-bar {
  --foco-ring: #34d399;
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 1200; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  width: max-content; max-width: min(720px, calc(100vw - 24px));
  animation: foco-in 0.28s cubic-bezier(.2, .8, .2, 1);
}
.foco-bar.is-leaving { opacity: 0; transform: translateX(-50%) translateY(10px); transition: all 0.18s ease; }
.foco-bar[data-state="warn"] { --foco-ring: #fbbf24; }
.foco-bar[data-state="over"] { --foco-ring: #f87171; }
.foco-bar[data-state="paused"] { --foco-ring: #94a3b8; }
@keyframes foco-in { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.97); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

.foco-pill {
  display: flex; align-items: center; gap: 14px; padding: 9px 10px 9px 11px;
  border-radius: 999px; background: #161a26; color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 38px rgba(8, 12, 24, 0.42), 0 2px 6px rgba(8, 12, 24, 0.25);
}
.foco-bar.is-pulse .foco-pill { animation: foco-pulse 0.6s ease; }
@keyframes foco-pulse { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.045); box-shadow: 0 0 0 5px rgba(52, 211, 153, .28), 0 14px 38px rgba(8, 12, 24, .42); } }

/* anel de progresso */
.foco-ring { position: relative; width: 48px; height: 48px; flex: none; }
.foco-ring svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.foco-ring circle { fill: none; stroke-width: 4; }
.foco-ring-bg { stroke: rgba(255, 255, 255, 0.11); }
.foco-ring-fg { stroke: var(--foco-ring); stroke-linecap: round; transition: stroke-dashoffset 0.5s linear, stroke 0.3s; }
.foco-ring-ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--foco-ring); transition: color 0.3s; }
.foco-bar[data-state="over"] .foco-ring-fg { animation: foco-blink 1.2s ease-in-out infinite; }
@keyframes foco-blink { 50% { opacity: .45; } }

/* relógio */
.foco-clock { display: flex; flex-direction: column; align-items: flex-start; min-width: 92px; line-height: 1.05; }
.foco-time { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; color: #fff; }
.foco-bar[data-state="over"] .foco-time { color: #fca5a5; }
.foco-bar[data-state="paused"] .foco-time { color: #cbd5e1; }
.foco-sub { margin-top: 3px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: #94a3b8; }

/* nome da tarefa */
.foco-info { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; max-width: 250px; padding: 4px 8px; margin: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
.foco-info:hover { background: rgba(255, 255, 255, 0.07); }
.foco-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--foco-ring); }
.foco-task { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; font-weight: 600; color: #e2e8f0; }

/* botões */
.foco-actions { display: flex; align-items: center; gap: 6px; padding-left: 4px; border-left: 1px solid rgba(255, 255, 255, 0.1); margin-left: 2px; }
.foco-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.09); color: #e2e8f0; font-family: inherit; font-size: 0.82rem; font-weight: 800; cursor: pointer; transition: background 0.15s, transform 0.1s; }
.foco-btn:hover { background: rgba(255, 255, 255, 0.18); }
.foco-btn:active { transform: scale(.93); }
.foco-btn:focus-visible, .foco-info:focus-visible, .foco-end-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.foco-plus { width: auto; min-width: 44px; padding: 0 12px; border-radius: 999px; }
.foco-done { background: #10b981; color: #fff; }
.foco-done:hover { background: #059669; }
.foco-stop { color: #fca5a5; }
.foco-stop:hover { background: rgba(248, 113, 113, 0.22); }

/* aviso de fim do tempo */
.foco-end { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px 11px 16px; border-radius: 18px; background: #2a1d1d; color: #fee2e2; border: 1px solid rgba(248, 113, 113, 0.35); box-shadow: 0 12px 30px rgba(8, 12, 24, 0.4); animation: foco-in 0.25s ease-out; font-size: 0.9rem; }
.foco-end[hidden] { display: none; }
.foco-end-text b { color: #fff; }
.foco-end-btns { display: flex; gap: 6px; flex: none; }
.foco-end-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.foco-end-btn:hover { background: rgba(255, 255, 255, 0.22); }
.foco-end-btn.is-primary { background: #10b981; }
.foco-end-btn.is-primary:hover { background: #059669; }
.foco-end-btn.is-ghost { background: transparent; color: #fca5a5; }

/* escolha de quanto tempo */
.foco-picker { position: fixed; z-index: 2000; width: 300px; padding: 14px; border-radius: 16px; background: var(--bg-surface, #fff); color: var(--text-primary, #0f172a); border: 1px solid var(--border-color, #e2e8f0); box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28); animation: foco-pop 0.16s ease-out; }
@keyframes foco-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.foco-picker-title { display: flex; align-items: center; gap: 7px; font-size: 0.95rem; font-weight: 800; color: var(--accent-emerald, #10b981); }
.foco-picker-title svg { flex: none; }
.foco-picker-sub { margin: 3px 0 11px; font-size: 0.8rem; color: var(--text-muted, #64748b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foco-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.foco-chip { display: inline-flex; align-items: center; justify-content: center; padding: 9px 6px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 11px; background: var(--bg-surface-elevated, #f8fafc); color: inherit; font-family: inherit; font-size: 0.86rem; font-weight: 700; cursor: pointer; transition: all 0.12s; }
.foco-chip:hover { border-color: var(--accent-emerald, #10b981); background: rgba(16, 185, 129, 0.1); color: var(--accent-emerald, #10b981); }
.foco-chip.is-est { border-color: var(--accent-emerald, #10b981); background: rgba(16, 185, 129, 0.12); box-shadow: inset 0 0 0 1px var(--accent-emerald, #10b981); }
.foco-chip.is-go { background: var(--accent-emerald, #10b981); border-color: transparent; color: #fff; }
.foco-chip.is-go:hover { background: #059669; color: #fff; }
.foco-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.foco-picker-row label { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-secondary, #475569); }
.foco-picker-row input { width: 62px; padding: 7px 8px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 9px; background: var(--bg-surface, #fff); color: inherit; font-family: inherit; font-size: 0.9rem; text-align: center; }
.foco-picker-row input.is-bad { border-color: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, .2); }
.foco-picker-row .foco-chip { padding: 8px 16px; }
.foco-stopwatch { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 9px; border: 1px dashed var(--border-color, #cbd5e1); border-radius: 11px; background: transparent; color: var(--text-secondary, #475569); font-family: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.foco-stopwatch:hover { border-color: var(--accent-emerald, #10b981); color: var(--accent-emerald, #10b981); }

/* botão na gaveta da tarefa e tempo real */
.task-focus-btn { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 0 12px; font-size: 0.82rem; font-weight: 700; color: var(--accent-emerald, #10b981); }
.task-focus-btn:hover { background: rgba(16, 185, 129, 0.12); }
.task-focus-btn.is-on { background: rgba(16, 185, 129, 0.14); }
.foco-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: foco-live 1.6s ease-out infinite; }
@keyframes foco-live { 70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.task-prop-spent { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--bg-surface-elevated, #f1f5f9); color: var(--text-secondary, #475569); font-size: 0.74rem; font-weight: 700; cursor: default; }
.task-prop-spent[hidden] { display: none; }
.task-prop-spent.is-ok { background: rgba(16, 185, 129, 0.13); color: #047857; }
.task-prop-spent.is-over { background: rgba(245, 158, 11, 0.16); color: #b45309; }

@media (max-width: 800px) {
  .foco-bar { bottom: calc(var(--m-bar-h, 62px) + 88px + var(--m-safe, 0px)); left: 12px; right: 12px; transform: none; width: auto; max-width: none; }
  @keyframes foco-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .foco-bar.is-leaving { transform: translateY(10px); }
  .foco-pill { gap: 9px; padding: 8px 8px 8px 9px; border-radius: 22px; }
  .foco-ring, .foco-ring svg { width: 42px; height: 42px; }
  .foco-clock { min-width: 0; }
  .foco-time { font-size: 1.3rem; }
  .foco-info { flex: 1; max-width: none; padding: 2px 4px; }
  .foco-actions { gap: 5px; padding-left: 6px; margin-left: 0; }
  .foco-btn { width: 36px; height: 36px; }
  .foco-plus { display: none; }
  .foco-end { flex-direction: column; align-items: stretch; gap: 9px; }
  .foco-end-btns { justify-content: flex-end; }
  .foco-picker.is-sheet { left: 12px; right: 12px; bottom: calc(var(--m-bar-h, 62px) + 20px + var(--m-safe, 0px)); top: auto; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .foco-bar, .foco-end, .foco-picker, .foco-live-dot, .foco-bar[data-state="over"] .foco-ring-fg, .foco-bar.is-pulse .foco-pill { animation: none; }
  .foco-ring-fg { transition: none; }
}
