/* My tasks, task detail and the bottom tab bar (#6185765729).
   Own file so the shared app.css stays untouched; uses app.css tokens. */

:root { --tabbar-h: 64px; }

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 6px calc(10px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(10px + var(--safe-left));
  background: var(--bg-elev);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--border);
}
.tabbar .tab {
  min-height: 52px; border: 0; border-radius: 14px; background: transparent; cursor: pointer;
  display: grid; justify-items: center; align-content: center; gap: 2px;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  transition: color 0.15s, background-color 0.15s;
}
.tabbar .tab .icon { width: 24px; height: 24px; }
.tabbar .tab.active { color: var(--primary); }
.tabbar .tab.active .tab-icon {
  background: var(--primary-soft); border-radius: 999px; padding: 2px 16px;
}
.tabbar .tab-icon { display: grid; place-items: center; padding: 2px 16px; transition: background-color 0.15s; }
.tabbar .tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }

/* Lift New task's bottom button and the toast above the tab bar. */
body.has-tabbar .actionbar { bottom: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: 10px; }
body.has-tabbar .compose-body { padding-bottom: calc(150px + var(--tabbar-h) + var(--safe-bottom)); }
body.has-tabbar .toast { bottom: calc(var(--tabbar-h) + 96px + var(--safe-bottom)); }
body.has-tabbar .done { padding-bottom: calc(24px + var(--tabbar-h) + var(--safe-bottom)); }
body.editing .tabbar { display: none; }

/* ── List ────────────────────────────────────────────────────────────────── */
.tasks-screen { padding-bottom: calc(var(--tabbar-h) + 24px + var(--safe-bottom)); }
.tasks-screen .appbar { gap: 8px; }
.tl-refresh { color: var(--text-2); background: var(--bg-elev); border: 1px solid var(--border); }
.tl-refresh.spinning .icon { animation: spin 0.8s linear infinite; }
.tl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 12px; min-width: 0; }
.tl-scope {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 700; color: var(--primary); background: var(--primary-soft);
  padding: 5px 11px; border-radius: 999px;
}
.tl-count { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tl-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tl-row {
  width: 100%; min-width: 0; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.2s;
}
.tl-row:active { transform: scale(0.99); }
.tl-row:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }
.tl-row-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.tl-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tl-num { font-size: 12px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.tl-date { font-size: 12px; color: var(--muted); flex: none; }
.tl-title {
  font-size: 16px; font-weight: 650; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.tl-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-project { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.tl-chevron { color: var(--muted); display: grid; flex: none; }
.tl-chevron .icon { width: 18px; height: 18px; }
.stage-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 60%;
  font-size: 12px; font-weight: 650; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stage-chip .stage-dot { width: 8px; height: 8px; }
.tl-state { display: grid; justify-items: center; gap: 10px; text-align: center; }
.tl-state:empty { display: none; }
.tl-state.loading { justify-items: stretch; }
.tl-skeleton {
  height: 92px; border-radius: 18px; border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--bg-elev) 0%, var(--surface-2) 50%, var(--bg-elev) 100%);
  background-size: 200% 100%; animation: tl-shimmer 1.2s linear infinite;
}
@keyframes tl-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.tl-empty-icon {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-top: 28px;
  color: var(--primary); background: var(--primary-soft);
}
.tl-empty-icon.error { color: var(--danger); background: var(--danger-soft); }
.tl-empty-icon .icon { width: 30px; height: 30px; }
.tl-empty-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.tl-empty-sub { color: var(--muted); max-width: 300px; font-size: 14px; }
.tl-inline-error { color: var(--danger); font-size: 14px; font-weight: 600; }
.tl-sentinel { height: 1px; }

/* ── Detail ──────────────────────────────────────────────────────────────── */
.task-detail { padding-bottom: calc(var(--tabbar-h) + 28px + var(--safe-bottom)); }
.td-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-top)) 0 10px;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
}
.td-top .icon-btn { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); }
.td-top-title { font-weight: 700; font-size: 17px; }
.td-top-space { flex: 1; }
.td-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.td-loading { display: grid; justify-items: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.td-head-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.td-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; margin-top: 8px; overflow-wrap: anywhere; }
.td-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 16px 0 0; }
.td-fact { min-width: 0; }
.td-fact dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.td-fact dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-section h2 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.td-section .card-head h2 { margin-bottom: 0; }
.td-description { font-size: 15px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.td-description p, .td-description ul, .td-description ol, .td-description pre, .td-description blockquote { margin: 0 0 10px; }
.td-description > :last-child { margin-bottom: 0; }
.td-description ul, .td-description ol { padding-left: 22px; }
.td-description a { color: var(--primary); }
.td-description pre { white-space: pre-wrap; background: var(--surface-2); padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.td-description code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; font-size: 0.9em; }
.td-description blockquote { border-left: 3px solid var(--border-strong); padding-left: 12px; color: var(--muted); }
.td-description h1, .td-description h2, .td-description h3, .td-description h4 { font-size: 16px; margin: 0 0 8px; color: var(--text); }
.td-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.td-tile {
  position: relative; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2);
}
.td-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.td-tile-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.td-tile:not(.loading):not(.failed) .td-tile-ph { display: none; }
.td-tile.loading .td-tile-ph { animation: tl-pulse 1s ease-in-out infinite alternate; }
.td-tile.failed { border-style: dashed; cursor: default; }
.td-tile.failed img { display: none; }
@keyframes tl-pulse { from { opacity: 0.4; } to { opacity: 1; } }
.td-files { display: grid; gap: 8px; margin-top: 10px; }
.td-file {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2);
}
.td-file-icon { color: var(--primary); display: grid; }
.td-file-text { min-width: 0; display: grid; }
.td-file-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-file-size { font-size: 12px; color: var(--muted); }
.td-actions { display: grid; gap: 10px; }
.td-actions .btn .icon { width: 18px; height: 18px; }

/* ── Image viewer ────────────────────────────────────────────────────────── */
.tv {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center;
  padding: calc(56px + var(--safe-top)) 12px calc(24px + var(--safe-bottom));
  background: rgba(5, 6, 10, 0.94); overflow: hidden;
}
.tv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.tv-close { position: absolute; top: calc(10px + var(--safe-top)); right: calc(12px + var(--safe-right)); color: #fff; background: rgba(255, 255, 255, 0.12); }

/* ── Search, project filter, All tasks (#6185765730) ─────────────────────── */
.tl-toolbar { display: block; padding: 2px 0 12px; }
.tl-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tl-search { position: relative; }
.tl-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.tl-search-icon .icon { width: 18px; height: 18px; }
.tl-search-input { padding-left: 40px; padding-right: 44px; min-height: 48px; background: var(--bg-elev); }
.tl-search-input::-webkit-search-cancel-button { display: none; }
.tl-search-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.tl-search-clear .icon { width: 18px; height: 18px; }
.tl-seg {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
}
.tl-seg-btn {
  min-height: 38px; min-width: 0; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--text-2); font-weight: 650; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.tl-seg-btn.active { background: var(--bg-elev); color: var(--primary); box-shadow: var(--shadow-sm); }
.tl-seg-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.tl-seg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-seg-chevron { display: grid; flex: none; }
.tl-seg-chevron .icon { width: 16px; height: 16px; }
.tl-filters-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.tl-hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; min-width: 0; }
.tl-hint:empty { display: none; }
.tl-filters-meta .tl-count { margin-left: auto; }
.tl-row.exact { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tl-exact {
  margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); padding: 2px 7px; border-radius: 999px;
}
