/* OrbitFocus v4: task Start buttons, active task, History tab. Theme-aware through the --slate/--indigo/... variables. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* tabs */
.task-tabs { display: flex; align-items: flex-end; gap: 1.25rem; flex-wrap: wrap; }
.task-tabs .nav-tab { background: none; border: 0; padding: 0 0 .35rem; text-align: left; color: rgb(var(--slate-400)); cursor: pointer; border-radius: .4rem; }
.task-tabs .nav-tab:hover { color: rgb(var(--slate-200)); }
.task-tabs .nav-tab.active { color: rgb(var(--slate-100)); }
.task-tabs .nav-tab .tab-k { display: block; text-transform: uppercase; letter-spacing: 1.5px; font-size: .75rem; font-weight: 600; }
.task-tabs .nav-tab.active .tab-k { color: rgb(var(--violet-400)); }
.task-tabs .nav-tab .tab-t { display: flex; align-items: center; gap: .45rem; font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -.025em; }
.task-tabs .nav-tab:focus-visible { outline: 2px solid rgb(var(--indigo-400)); outline-offset: 4px; }
.tab-count { font-size: .7rem; font-weight: 600; letter-spacing: 0; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: rgb(var(--emerald-400) / .16); color: rgb(var(--emerald-400)); }
.tab-count[hidden] { display: none; }
.nav-tab.bump .tab-count { animation: tab-bump .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tab-bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
@media (max-width: 639px) { .task-tabs { gap: .9rem; } .task-tabs .nav-tab .tab-t { font-size: 1.12rem; line-height: 1.6rem; } .task-tabs .nav-tab .tab-k { font-size: .66rem; letter-spacing: 1.2px; } }

/* task rows */
.task-item { position: relative; overflow: hidden; }
.task-item.is-active { border-color: rgb(var(--indigo-400) / .7) !important; background: linear-gradient(90deg, rgb(var(--indigo-500) / .16), rgb(var(--slate-950)) 70%) !important;
  box-shadow: 0 0 0 1px rgb(var(--indigo-400) / .25), 0 8px 26px -12px rgb(var(--indigo-500) / .55); }
.task-item.is-active::before { content: ''; position: absolute; left: 0; top: 10%; bottom: 10%; width: 3px; border-radius: 3px; background: linear-gradient(rgb(var(--indigo-300)), rgb(var(--emerald-400))); }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .15rem; font-size: .7rem; color: rgb(var(--slate-400)); }
.task-spent { color: rgb(var(--slate-300)); }
.task-badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: rgb(var(--indigo-300)); text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; }
.task-badge .dot { width: .45rem; height: .45rem; border-radius: 50%; background: rgb(var(--indigo-400)); }
.task-badge.is-live { color: rgb(var(--emerald-400)); }
.task-badge.is-live .dot { background: rgb(var(--emerald-400)); animation: task-pulse 1.6s ease-out infinite; }
@keyframes task-pulse { 0% { box-shadow: 0 0 0 0 rgb(var(--emerald-400) / .55); } 100% { box-shadow: 0 0 0 .5rem rgb(var(--emerald-400) / 0); } }

.task-check { flex: none; width: 1.6rem; height: 1.6rem; border-radius: .7rem; border: 1.5px solid rgb(var(--slate-600)); display: flex; align-items: center; justify-content: center; color: transparent; font-size: .7rem; transition: border-color .15s, background-color .15s, color .15s; }
.task-check:hover, .task-check:focus-visible { border-color: rgb(var(--emerald-400)); color: rgb(var(--emerald-400)); }
.task-start { flex: none; display: inline-flex; align-items: center; gap: .45rem; height: 2.25rem; padding: 0 .95rem; border-radius: .9rem; font-size: .8rem; font-weight: 600;
  color: rgb(var(--indigo-300)); background: rgb(var(--indigo-500) / .12); border: 1px solid rgb(var(--indigo-400) / .4); transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.task-start i { font-size: .72rem; }
.task-start:hover { background: rgb(var(--indigo-500) / .24); border-color: rgb(var(--indigo-400) / .75); }
.task-start:active { transform: scale(.96); }
.task-start.is-active { color: #fff; background: rgb(var(--indigo-600)); border-color: rgb(var(--indigo-600)); }
.task-start.is-active:hover { background: rgb(var(--indigo-500)); }
.task-start:focus-visible, .task-check:focus-visible, .task-tools button:focus-visible, .th-btn:focus-visible { outline: 2px solid rgb(var(--indigo-400)); outline-offset: 2px; }

/* edit/delete: revealed on hover or keyboard focus; always shown on touch screens (no hover there) */
.task-tools { opacity: 0; transition: opacity .15s; }
.task-item:hover .task-tools, .task-item:focus-within .task-tools { opacity: 1; }
@media (hover: none) { .task-tools { opacity: 1; } }
@media (max-width: 479px) { .task-start { padding: 0 .75rem; } .task-tools button { padding: .3rem; } }

/* done -> History animation */
.task-item.task-leaving { pointer-events: none; animation: task-leave .52s cubic-bezier(.4, 0, .2, 1) forwards; }
.task-item.task-leaving .task-check { background: rgb(var(--emerald-500)); border-color: rgb(var(--emerald-500)); color: #fff; animation: task-check-pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.task-item.task-leaving .task-text { text-decoration: line-through; color: rgb(var(--slate-500)); }
@keyframes task-check-pop { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
@keyframes task-leave {
  0%, 30% { opacity: 1; transform: translateX(0); height: var(--h, auto); }
  75% { opacity: 0; transform: translateX(2.5rem); height: var(--h, auto); margin-top: .25rem; margin-bottom: .25rem; padding-top: .75rem; padding-bottom: .75rem; border-width: 1px; }
  100% { opacity: 0; transform: translateX(2.5rem); height: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
}
.task-item.is-gone { display: none !important; }

/* active task on the timer card */
.active-task { margin-top: 1rem; display: flex; align-items: center; gap: .65rem; padding: .6rem .8rem; border-radius: 1rem; border: 1px dashed rgb(var(--slate-700)); background: rgb(var(--slate-950) / .6); min-height: 3.1rem; }
.active-task.has-task { border-style: solid; border-color: rgb(var(--indigo-400) / .55); background: rgb(var(--indigo-500) / .1); }
.active-task .at-ico { flex: none; width: 1.9rem; height: 1.9rem; border-radius: .7rem; display: flex; align-items: center; justify-content: center; background: rgb(var(--slate-800)); color: rgb(var(--slate-400)); font-size: .8rem; }
.active-task.has-task .at-ico { background: rgb(var(--indigo-600)); color: #fff; }
.active-task .at-label { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: rgb(var(--slate-400)); }
.active-task.has-task .at-label { color: rgb(var(--indigo-300)); }
.active-task .at-name { display: block; font-size: .85rem; font-weight: 500; color: rgb(var(--slate-300)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-task.has-task .at-name { color: rgb(var(--slate-100)); }
.active-task .at-clear { flex: none; margin-left: auto; width: 1.8rem; height: 1.8rem; border-radius: .6rem; color: rgb(var(--slate-400)); }
.active-task .at-clear:hover { color: rgb(var(--slate-100)); background: rgb(var(--slate-800)); }
.active-task .at-clear[hidden] { display: none; }

/* History */
.th-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .75rem .35rem; min-height: 2.6rem; }
.th-clear { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.th-group { padding: .15rem .25rem .4rem; }
.th-day { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: rgb(var(--slate-400)); padding: .6rem .6rem .35rem; }
.th-list { list-style: none; margin: 0; padding: 0; }
.th-item { display: flex; align-items: center; gap: .75rem; margin: .25rem; padding: .65rem .8rem; border-radius: 1rem; border: 1px solid rgb(var(--slate-800)); background: rgb(var(--slate-950)); animation: th-in .35s ease-out; }
@keyframes th-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.th-ok { color: rgb(var(--emerald-400)); flex: none; }
.th-text { font-size: .875rem; font-weight: 500; color: rgb(var(--slate-300)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-meta { display: flex; flex-wrap: wrap; gap: .1rem .9rem; font-size: .72rem; color: rgb(var(--slate-400)); margin-top: .1rem; }
.th-actions { flex: none; display: flex; align-items: center; gap: .3rem; }
.th-btn { display: inline-flex; align-items: center; gap: .35rem; height: 1.95rem; padding: 0 .7rem; border-radius: .7rem; font-size: .75rem; font-weight: 600; color: rgb(var(--slate-300)); border: 1px solid rgb(var(--slate-700)); background: rgb(var(--slate-900)); transition: background-color .15s, border-color .15s, color .15s; }
.th-btn:hover { border-color: rgb(var(--slate-500)); color: rgb(var(--slate-100)); }
.th-btn.th-icon { width: 1.95rem; padding: 0; justify-content: center; }
.th-btn.th-icon:hover { color: rgb(var(--red-400)); border-color: rgb(var(--red-400) / .6); }
.th-btn.th-danger { color: #fff; background: rgb(220 38 38); border-color: rgb(220 38 38); }
.th-btn.th-danger:hover { background: rgb(185 28 28); color: #fff; }
@media (max-width: 479px) { .th-btn span { display: none; } .th-actions .th-btn:not(.th-icon) { width: 1.95rem; padding: 0; justify-content: center; } }

/* home: small links row that replaced the old About block */
.home-links { margin-top: 2.25rem; text-align: center; font-size: .85rem; color: rgb(var(--slate-400)); }
.home-links a { color: rgb(var(--slate-300)); text-decoration: underline; text-underline-offset: 3px; }
.home-links a:hover { color: rgb(var(--slate-50)); }

@media (prefers-reduced-motion: reduce) {
  .task-item.task-leaving, .th-item, .nav-tab.bump .tab-count, .task-badge.is-live .dot { animation: none !important; }
}

/* small screens: let task names wrap to two lines instead of cutting them short */
@media (max-width: 639px) {
  .task-item .task-text { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
  .task-item { gap: .55rem !important; padding-left: .7rem !important; padding-right: .6rem !important; }
  .task-tools { gap: 0 !important; }
}
