/**
 * Critical CSS — styles needed for first paint (kanban board view).
 * Full webapp.css is loaded asynchronously after this.
 * Keep in sync: any changes here should also exist in webapp.css.
 */
:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #000000);
  --hint: var(--tg-theme-hint-color, #999999);
  --link: var(--tg-theme-link-color, #7c3aed);
  --btn: var(--tg-theme-button-color, #7c3aed);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --accent: var(--tg-theme-button-color, #7c3aed);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #f0f0f0);
  --section-bg: var(--tg-theme-section-bg-color, var(--secondary-bg));
  --card-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 0;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Tab bar ────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--secondary-bg);
  position: sticky;
  top: 0;
  padding-top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(128,128,128,0.15);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs-wrap { position: relative; }
.tabs-wrap::after {
  content: "";
  position: absolute;
  inset-inline-end: 0; top: 0; bottom: 1px;
  width: 28px;
  background: linear-gradient(to right, transparent, var(--secondary-bg));
  pointer-events: none;
  z-index: 101;
  opacity: 1;
  transition: opacity 0.2s;
}
.tabs-wrap.scrolled-end::after { opacity: 0; }
.tab {
  flex: 1 0 auto;
  padding: 12px 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--tg-theme-subtitle-text-color, #777777);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tab.active {
  color: var(--btn);
  border-bottom-color: var(--btn);
}

/* ── Kanban board ───────────────────────────────── */
.kanban {
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  min-height: calc(100vh - 100px);
  align-items: flex-start;
}
.column {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--secondary-bg);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 120px;
  max-height: none;
}
.column-header {
  padding: 12px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
}
.column-header .count {
  background: rgba(128,128,128,0.2);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
}
.column-body {
  flex: 1;
  overflow-y: visible;
  padding: 0 8px 72px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* On desktop with wide viewport, cap column height and scroll inside */
@media (min-width: 768px) {
  .column { max-height: calc(100vh - 110px); }
  .column-body { overflow-y: auto; }
}

/* ── Task card ──────────────────────────────────── */
.card {
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  cursor: grab;
  position: relative;
  overflow: hidden;
  min-height: 44px;
  flex-shrink: 0;
}
.card-inner {
  background: var(--bg);
  padding: 10px 12px 10px 16px;
  padding-inline: 16px 12px;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  z-index: 1;
  border-radius: 10px;
}
.card-inner::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 5px;
  border-radius: 10px 0 0 10px;
  background: var(--card-accent, rgba(128,128,128,0.25));
}
.card:active .card-inner { transform: scale(0.98); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card.swiped .card-inner { transform: translateX(-152px); }
.card.dragging { opacity: 0.5; transform: scale(0.95); }
.card-inner.swipe-hint-anim {
  animation: swipeHint 1.2s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes swipeHint {
  0%   { transform: translateX(0); }
  30%  { transform: translateX(-80px); }
  55%  { transform: translateX(-80px); }
  100% { transform: translateX(0); }
}
.card-actions {
  position: absolute;
  inset-inline-end: 0; top: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  z-index: 0;
}
.card-actions button {
  border: none;
  color: #fff;
  font-size: 17px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.swipe-done { background: #27ae60; }
.swipe-next { background: #3498db; }
.swipe-del  { background: #e74c3c; }
.card-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.85;
  transform: scale(1.04) rotate(2deg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  border-radius: 10px;
}
.card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.card-top .card-content { flex: 1; min-width: 0; }
.card-done-btn {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--hint);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.15s;
  margin-top: 0;
  padding: 0;
  position: relative;
}
/* Expand touch target to 44px without changing visual size */
.card-done-btn::after {
  content: "";
  position: absolute;
  inset: -9px;
}
.card-done-btn:hover, .card-done-btn:active {
  border-color: #27ae60;
  color: #27ae60;
  background: rgba(39,174,96,0.08);
}


/* ── Task age badge ─────────────────────────────── */
.card-age-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 2px;
  line-height: 1.3;
}
.card-age-badge.age-yellow { background: rgba(243,156,18,0.15); color: #d4a017; }
.card-age-badge.age-red { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* ── FAB ────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 28px;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fab:active { transform: scale(0.85); }

/* ── Empty state ────────────────────────────────── */
.empty { text-align: center; color: var(--hint); padding: 40px 20px; font-size: 14px; }
.empty-cta {
  text-align: center;
  padding: 48px 24px;
  color: var(--hint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.empty-cta .empty-icon { font-size: clamp(48px, 12vw, 64px); margin-bottom: 12px; }
.empty-cta .empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-cta .empty-desc { font-size: 13px; margin-bottom: 16px; }
.empty-cta .btn { display: inline-flex; }
.empty-cta .empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.empty-cta .empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}
.empty-cta .empty-btn:active { transform: scale(0.95); opacity: 0.8; }
.empty-cta .empty-btn.primary { background: var(--btn); color: var(--btn-text); }
.empty-cta .empty-btn.secondary { background: var(--secondary-bg); color: var(--text); }

/* ── Loading / skeleton ────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  font-size: 14px;
  color: var(--hint);
}
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.skeleton-card {
  background: linear-gradient(90deg, var(--secondary-bg) 25%, rgba(128,128,128,0.12) 50%, var(--secondary-bg) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.2s infinite ease-in-out;
  border-radius: 10px;
  height: 64px;
  margin-bottom: 6px;
}
.skeleton-wrap { padding: 8px; }
.skeleton-header {
  height: 18px;
  width: 120px;
  background: linear-gradient(90deg, var(--secondary-bg) 25%, rgba(128,128,128,0.12) 50%, var(--secondary-bg) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.2s infinite ease-in-out;
  border-radius: 6px;
  margin-bottom: 10px;
}
.skeleton-text {
  display: inline-block;
  height: 14px;
  background: linear-gradient(90deg, rgba(128,128,128,0.10) 25%, rgba(128,128,128,0.18) 50%, rgba(128,128,128,0.10) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.2s infinite ease-in-out;
  border-radius: 4px;
}
.skeleton-col .column-body { padding-bottom: 16px; }
.skeleton-col .skeleton-card { box-shadow: none; }


/* ── Search bar ─────────────────────────────────── */
.search-bar {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-bar input {
  flex: 1;
  padding: 8px 12px 8px 32px;
  padding-inline: 32px 12px;
  border-radius: 10px;
  border: 1px solid rgba(128,128,128,0.2);
  background: var(--secondary-bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.search-bar input:focus { border-color: var(--btn); }
.search-bar .search-icon {
  position: absolute;
  inset-inline-start: 18px;
  font-size: 14px;
  color: var(--hint);
  pointer-events: none;
}
.search-bar { position: relative; }
.search-clear {
  position: absolute;
  inset-inline-end: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(128,128,128,0.2);
  color: var(--hint);
  font-size: 11px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.search-clear.visible { display: flex; }
.search-clear:active { transform: translateY(-50%) scale(0.85); opacity: 0.6; }

/* ── Search filter chips ─────────────────────── */
.search-filters {
  display: flex;
  gap: 6px;
  padding: 2px 8px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.search-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  background: var(--secondary-bg);
  color: var(--hint);
  border: 1.5px solid transparent;
  transition: all 0.15s;
}
.filter-chip.active {
  border-color: var(--btn);
  color: var(--btn);
  background: color-mix(in srgb, var(--btn) 10%, transparent);
}


/* ── Tab badge ─────────────────────────────────── */
.tab .tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  font-size: 9px;
  font-weight: 700;
  background: var(--btn);
  color: var(--btn-text);
  border-radius: 8px;
  padding: 0 4px;
  margin-inline-start: 2px;
  vertical-align: middle;
}
.tab .tab-badge.muted {
  background: rgba(128,128,128,0.2);
  color: var(--hint);
}


@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes viewFadeIn { from { opacity: 0; } to { opacity: 1; } }
#kanban-view, #list-view, #calendar-view, #projects-view, #stats-view {
  animation: viewFadeIn 0.15s ease;
}

/* ── Progress widget ───────────────────────────── */
.progress-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 8px 8px;
  background: var(--secondary-bg);
  border-radius: 10px;
}
.prog-pct {
  font-size: 22px; font-weight: 600;
  min-width: 48px; flex-shrink: 0;
}
.prog-pct span { font-size: 13px; font-weight: 400; color: var(--hint); }
.prog-right { flex: 1; min-width: 0; }
.prog-bar-track {
  height: 5px; background: rgba(128,128,128,0.15);
  border-radius: 3px; overflow: hidden; margin-bottom: 5px;
}
.prog-bar-fill {
  height: 100%; border-radius: 3px;
  background: var(--btn); transition: width 0.4s ease;
}
.prog-sub { font-size: 12px; color: var(--hint); }
.progress-widget.all-done { background: rgba(39,174,96,0.1); }
.progress-widget.all-done .prog-pct { color: #27ae60; }
.progress-widget.all-done .prog-bar-fill { background: #27ae60; }
.progress-widget.all-done .prog-sub { color: #27ae60; }

/* ── Due today banner ──────────────────────────── */
.sub-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 8px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}
.sub-banner.grace {
  background: rgba(243, 156, 18, 0.1);
  border: 1px solid rgba(243, 156, 18, 0.25);
  color: #e67e22;
}
.sub-banner.readonly {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #c0392b;
}
.sub-banner-icon { font-size: 16px; }

.due-today-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin: 0 8px 8px;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #c0392b;
  cursor: pointer;
  transition: opacity 0.2s;
}
.due-today-banner:active { opacity: 0.7; }
.due-today-banner .dtb-icon { font-size: 16px; }
.due-today-banner .dtb-count {
  font-weight: 700;
  margin-inline-start: auto;
  background: #e74c3c;
  color: #fff;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
}


/* ── Toast notification ─────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(12px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toastIn 0.25s ease, toastOut 0.3s ease 2.2s forwards;
  pointer-events: auto;
  white-space: nowrap;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }
.toast:has(.toast-undo) {
  animation: toastIn 0.25s ease, toastOut 0.3s ease 3.2s forwards;
}
.toast-undo {
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
}
.toast-undo-btn {
  background: none; border: none; color: var(--btn, #5eafc0); font-weight: 700;
  font-size: 14px; cursor: pointer; padding: 0; text-decoration: underline;
}
.hint-banner {
  position: fixed;
  top: calc(12px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  left: 12px; right: 12px;
  z-index: 500;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}
.hint-banner-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}
.hint-banner-ok {
  background: rgba(255,255,255,0.25);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}
.hint-banner.fade-out {
  animation: toastOut 0.25s ease forwards;
}
.confirm-overlay {
  display: none; position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
  align-items: center; justify-content: center; padding: 24px;
}
.confirm-overlay.show { display: flex; }
.confirm-box {
  background: var(--bg); border-radius: 14px; padding: 20px;
  max-width: 300px; width: 100%; text-align: center;
  animation: slideUp 0.2s ease;
}
.confirm-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; line-height: 1.4; }
.confirm-actions { display: flex; gap: 8px; }
.confirm-actions button {
  flex: 1; padding: 11px 0; border-radius: 10px; font-size: 15px;
  font-weight: 600; border: none; cursor: pointer;
}
.confirm-cancel { background: var(--secondary-bg); color: var(--text); }
.confirm-danger { background: #e74c3c; color: #fff; }
.offline-bar {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 9998;
  background: #e74c3c; color: #fff; font-size: 13px; font-weight: 600;
  text-align: center; padding: 6px 12px;
  animation: toastIn 0.3s ease;
}
.offline-bar.show { display: block; }

/* Card fade-out animation */
.card.fade-out {
  transition: opacity 0.35s ease, transform 0.35s ease;
  opacity: 0;
  transform: scale(0.92);
}
/* Task completion animation — green glow, scale up then shrink away */
.card.completing {
  transition: opacity 0.45s ease, transform 0.45s ease, box-shadow 0.2s ease;
  opacity: 0;
  transform: scale(0.88);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.5), 0 0 16px rgba(76, 175, 80, 0.3);
}
.card.completing .card-inner {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(76, 175, 80, 0.03));
}


/* ── Assignee badge ────────────────────────────── */
.assignee-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.assignee-badges {
  display: flex;
  align-items: center;
}
.assignee-badge {
  display: inline-flex;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--btn);
  color: var(--btn-text);
  align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 0 1.5px var(--card-bg, #fff);
  margin-inline-start: -5px;
  position: relative;
}
.assignee-badges .assignee-badge:first-child { margin-inline-start: 0; }
.assignee-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.assignee-name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  line-height: 1;
}

/* ── Filter bar ────────────────────────────────── */
.filter-bar { display: none; gap: 6px; padding: 6px 12px; }
.filter-bar.visible { display: flex; }
.filter-bar.visible + .tabs-wrap .tabs { padding-top: 0; }
/* Safe area padding only in actual fullscreen (no Telegram header) */
.tg-fullscreen .tabs { padding-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }
.tg-fullscreen .filter-bar { padding-top: calc(6px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)); }
.tg-fullscreen .filter-bar.visible + .tabs-wrap .tabs { padding-top: 0; }
.filter-btn { flex: 1; padding: 6px; border: 1px solid var(--hint); border-radius: 6px; background: var(--bg); color: var(--text); cursor: pointer; font-size: 12px; }
.filter-btn.active { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }

/* ── Cross-context scope chips (personal chat) ──────────────────────────── */
#crossContextFilter {
  display: none;
  padding: 6px 12px;
  overflow-x: auto;
  white-space: nowrap;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
  background: var(--secondary-bg);
  border-bottom: 1px solid rgba(128,128,128,0.15);
}
#crossContextFilter.visible { display: flex; }

.scope-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--hint);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.scope-chip:hover { border-color: var(--btn); }
.scope-chip.active {
  background: var(--btn);
  color: var(--btn-text);
  border-color: var(--btn);
}

/* Group badge on task cards */
.group-badge {
  display: inline-block;
  background: var(--secondary-bg);
  color: var(--hint);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-inline-start: 6px;
  vertical-align: middle;
  white-space: nowrap;
}


/* ── Haptic ─────────────────────────────────────── */
@media (max-width: 600px) {
  .column { flex: 0 0 85vw; }
}

/* ── Create limit counter (near FAB) ─────────────── */
.create-limit-counter {
  position: fixed; bottom: 80px; inset-inline-end: 16px; z-index: 99;
  background: var(--secondary-bg); border-radius: 12px; padding: 4px 10px;
  font-size: 12px; font-weight: 600; color: var(--hint);
  display: none; align-items: center; gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.create-limit-counter.limit-warn { color: #e67e22; }
.create-limit-counter.limit-reached { color: #e74c3c; background: rgba(231,76,60,0.1); }

/* ── Limit banner (top of content when limit reached) */
.limit-banner {
  display: none; align-items: center; gap: 12px;
  background: rgba(231,76,60,0.08); border: 1px solid rgba(231,76,60,0.2);
  border-radius: 14px; padding: 12px 16px; margin: 8px 16px;
}
.limit-banner-text { flex: 1; }
.limit-banner-text strong { display: block; font-size: 14px; color: var(--text); }
.limit-banner-text span { font-size: 12px; color: var(--hint); }
.limit-banner-btn {
  background: var(--btn); color: var(--btn-text); border: none; border-radius: 10px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.limit-banner-btn:active { opacity: 0.7; }

/* ── RTL (Arabic) ────────────────────────────── */
[dir="rtl"] .card-inner::before {
  border-radius: 0 10px 10px 0;
}
[dir="rtl"] .card.swiped .card-inner { transform: translateX(152px); }
[dir="rtl"] .card-inner.swipe-hint-anim {
  animation: swipeHintRtl 1.2s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes swipeHintRtl {
  0%   { transform: translateX(0); }
  30%  { transform: translateX(80px); }
  55%  { transform: translateX(80px); }
  100% { transform: translateX(0); }
}
[dir="rtl"] .tabs-wrap::after {
  inset-inline-end: auto;
  inset-inline-start: 0;
  background: linear-gradient(to left, transparent, var(--secondary-bg));
}

/* ── Reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

