@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface-2: #E8EBF0;
  --tint: #E0E8F4;

  --ink: #1A2333;
  --ink-2: #4A5568;
  --ink-3: #7B8BA0;

  --border: #D8DCE8;
  --border-2: #B0B8CC;

  --accent: #4d7cfe;
  --accent-dark: #3a68f0;
  --accent-text: #3d5a96;
  --tint-border: #C0CFEA;

  --success: #2D6A4F;
  --success-bg: #EAF4EE;
  --danger: #C0392B;
  --danger-bg: #FDECEA;
  --warning: #92600A;
  --warning-bg: #FEF3E2;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(26, 35, 51, 0.06), 0 1px 2px rgba(26, 35, 51, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 35, 51, 0.08), 0 2px 4px rgba(26, 35, 51, 0.04);

  --t-fast: 150ms ease;
  --t-base: 250ms ease;

  --color-background-primary: var(--surface);
  --color-background-secondary: var(--surface-2);
  --color-border-tertiary: var(--border);
  --color-text-primary: var(--ink);
  --color-text-secondary: var(--ink-2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #1C1F26;
    --surface-2: #252830;
    --tint: #1A2440;

    --ink: #E8ECF4;
    --ink-2: #8A96AA;
    --ink-3: #5A6478;

    --border: #2A2F3C;
    --border-2: #3A4050;

    --accent: #4d7cfe;
    --accent-dark: #3a68f0;
    --accent-text: #8AAEDD;
    --tint-border: #2A3D5C;

    --success: #4ADE80;
    --success-bg: #0F2018;
    --danger: #F87171;
    --danger-bg: #200F0F;
    --warning: #FCD34D;
    --warning-bg: #1C1400;
  }
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", sans-serif;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s6);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--t-fast);
  text-decoration: none;
  font-family: "Vazirmatn", sans-serif;
}

.btn-primary {
  background: var(--ink);
  color: var(--surface);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 24px;
  border: none;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--border-2);
  font-size: 14px;
  padding: 10px 20px;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-accent {
  background: var(--accent);
  color: var(--surface);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 24px;
  border: none;
}

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"] {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 16px;
  font-size: 15px;
  font-family: "Vazirmatn", sans-serif;
  color: var(--ink);
  transition: var(--t-fast);
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 124, 254, 0.12);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s6);
}

/* ── TOPBAR ── */
.ab-topbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0 20px;
  min-height: 52px;
  height: 52px;
  background: var(--color-background-primary);
  border-bottom: 0.5px solid var(--color-border-tertiary);
  position: sticky;
  top: 0;
  z-index: 950;
  direction: ltr;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
  overflow: visible;
}

.ab-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
  flex-shrink: 0;
  direction: rtl;
}

.ab-topbar-r {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-inline-start: auto;
  direction: rtl;
}

.ab-div {
  width: 1px;
  height: 16px;
  background: var(--color-border-tertiary);
  flex-shrink: 0;
}

.ab-plan-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #1e7e34;
  background: rgba(30, 126, 52, 0.08);
  border: 0.5px solid rgba(30, 126, 52, 0.2);
  border-radius: 20px;
  padding: 4px 10px;
}

.ab-plan-badge i {
  font-size: 11px;
}

.ab-wallet {
  display: inline-flex;
  align-items: center;
  background: var(--color-background-secondary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 120ms ease;
  flex-shrink: 0;
}

.ab-wallet:hover {
  border-color: #4d7cfe;
}

.ab-wallet-info {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.ab-wallet-info i {
  font-size: 13px;
  color: #4d7cfe;
}

.ab-wallet-add {
  width: 28px;
  min-height: 28px;
  background: #4d7cfe;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
  font-family: inherit;
}

.ab-wallet-add:hover {
  background: #3a68f0;
}

.ab-wallet-add:active {
  transform: scale(0.93);
}

.ab-notif-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: transparent;
  border: 0.5px solid var(--color-border-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-text-secondary);
  cursor: pointer;
  position: relative;
  transition: all 120ms ease;
  font-family: inherit;
  flex-shrink: 0;
  padding: 0;
}

.ab-notif-btn:hover {
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  border-color: #4d7cfe;
}

.ab-notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e74c3c;
  border: 2px solid var(--color-background-primary);
  animation: abDotPulse 2s ease infinite;
}

@keyframes abDotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.ab-notif-dot[hidden] {
  display: none !important;
}

.ab-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4d7cfe, #3a68f0);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 120ms ease;
  border: 1.5px solid rgba(77, 124, 254, 0.3);
  flex-shrink: 0;
  padding: 0;
  font-family: inherit;
}

.ab-avatar:hover {
  opacity: 0.85;
}

.ab-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.ab-profile-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 20px;
  right: auto;
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 14px;
  padding: 6px;
  width: 200px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transform: translateY(-6px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1), opacity 120ms ease;
  direction: rtl;
}

.ab-profile-drop[hidden] {
  display: none !important;
}

.ab-profile-drop.open {
  display: block;
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.ab-profile-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.ab-profile-hd i {
  font-size: 15px;
  color: #4d7cfe;
}

.ab-profile-div {
  height: 0.5px;
  background: var(--color-border-tertiary);
  margin: 4px 6px;
}

.ab-profile-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background 100ms ease;
}

.ab-profile-item i {
  font-size: 15px;
  color: var(--color-text-secondary);
  width: 18px;
  text-align: center;
}

.ab-profile-item:hover {
  background: var(--color-background-secondary);
}

.ab-profile-logout {
  color: #c0392b;
}

.ab-profile-logout i {
  color: #c0392b;
}

.ab-profile-logout:hover {
  background: rgba(192, 57, 43, 0.06);
}

.ab-profile-admin {
  color: #4d7cfe;
}

.ab-profile-admin i {
  color: #4d7cfe;
}

.ab-profile-admin:hover {
  background: rgba(77, 124, 254, 0.08);
}

.ab-notif-wrap {
  position: relative;
  flex-shrink: 0;
}

.ab-notif-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: auto;
  right: 0;
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 14px;
  padding: 8px;
  width: 300px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transform: translateY(-6px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1), opacity 120ms ease;
  direction: rtl;
}

.ab-notif-drop[hidden] {
  display: none !important;
}

.ab-notif-drop.open {
  display: block;
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.ab-notif-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
  border-bottom: 0.5px solid var(--color-border-tertiary);
  margin-bottom: 4px;
}

.ab-notif-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.ab-notif-clear {
  font-size: 11px;
  color: #4d7cfe;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.ab-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 100ms ease;
}

.ab-notif-item:hover {
  background: var(--color-background-secondary);
}

.ab-notif-item.unread {
  background: rgba(77, 124, 254, 0.04);
}

.ab-notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ab-ni-blue { background: rgba(77, 124, 254, 0.1); color: #4d7cfe; }
.ab-ni-green { background: rgba(30, 126, 52, 0.1); color: #1e7e34; }
.ab-ni-red { background: rgba(192, 57, 43, 0.1); color: #c0392b; }
.ab-ni-orange { background: rgba(230, 126, 34, 0.1); color: #e67e22; }

.ab-notif-body {
  flex: 1;
  min-width: 0;
}

.ab-notif-text {
  font-size: 12px;
  color: var(--color-text-primary);
  line-height: 1.5;
  margin-bottom: 3px;
}

.ab-notif-text b {
  font-weight: 500;
}

.ab-notif-time {
  font-size: 10px;
  color: var(--color-text-secondary);
}

.ab-unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4d7cfe;
  flex-shrink: 0;
  margin-top: 6px;
}

.ab-notif-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.ab-notif-empty i {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
  opacity: 0.3;
}

@media (max-width: 640px) {
  .ab-topbar {
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0px);
    gap: 8px;
  }

  .ab-plan-badge {
    display: none;
  }

  .ab-wallet-info {
    font-size: 11px;
    padding: 5px 8px 5px 4px;
  }

  .ab-notif-drop {
    right: 0;
    left: auto;
    width: min(300px, calc(100vw - 24px));
  }
}

/* ── NAVBAR SHELL (legacy) ── */
.abrivo-nav {
  position: sticky;
  top: 0;
  z-index: 950;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: flex;
  align-items: center;
  padding-top: env(safe-area-inset-top, 0px);
  overflow: visible;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s5);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--s3);
  overflow: visible;
}

.nav-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
  opacity: 1;
  transition: opacity 150ms ease;
}

.nav-brand:hover {
  opacity: 0.75;
}

.nav-brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ── NAV LINKS ── */
.nav-link {
  position: relative;
  padding: var(--s1) var(--s3);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: color 150ms ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link--active {
  color: var(--ink);
  font-weight: 650;
}

.nav-link--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: var(--s3);
  left: var(--s3);
  height: 2px;
  background: var(--accent);
  border-radius: 99px;
}

/* ── CTA BUTTON ── */
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 150ms ease;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-3);
}

.nav-cta:hover {
  border-color: var(--border-2);
  color: var(--ink);
  background: var(--surface);
}

.nav-cta.is-urgent {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

.nav-cta--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
}

.nav-cta--ghost:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

/* ── USER AVATAR ── */
.nav-account {
  position: relative;
  z-index: 2;
}

.nav-avatar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  cursor: pointer;
  padding: 3px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-family: inherit;
  transition: background 150ms ease;
  user-select: none;
}

.nav-avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-avatar:hover {
  background: var(--surface);
}

.nav-avatar-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Vazirmatn', sans-serif;
}

.nav-avatar-chevron {
  color: var(--ink-3);
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.nav-account.is-open .nav-avatar-chevron {
  transform: rotate(180deg);
}

/* ── ACCOUNT DROPDOWN ── */
.nav-account-panel {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  width: min(220px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  z-index: 10001;
  animation: dropdownIn 150ms ease forwards;
}

.nav-account-panel[hidden] {
  display: none !important;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
}

.nav-account-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--ink);
}

.nav-account-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  color: #10b981;
}

.nav-account-divider {
  height: 1px;
  background: var(--border);
  margin: var(--s1) 0;
}

.nav-account-link {
  display: block;
  padding: var(--s2) var(--s4);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 100ms ease, color 100ms ease;
}

.nav-account-link:hover {
  background: var(--bg);
  color: var(--ink);
}

.nav-account-link--active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--ink);
  font-weight: 600;
}

.nav-account-link--admin {
  color: var(--accent);
}

.nav-account-link--admin:hover {
  color: var(--accent);
}

.nav-account-link--danger {
  color: #ef4444;
}

.nav-account-link--danger:hover {
  background: rgba(239,68,68,0.08);
  color: #ef4444;
}

/* ── MOBILE DRAWER ── */
.nav-drawer {
  display: none;
}

.nav-drawer-btn {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  cursor: pointer;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--ink-2);
  font-size: 0.825rem;
  font-weight: 600;
  transition: all 150ms ease;
  user-select: none;
}

.nav-drawer-btn::-webkit-details-marker {
  display: none;
}

.nav-drawer-btn:hover {
  background: var(--border-2);
  color: var(--ink);
}

.nav-drawer-icon {
  width: 16px;
  height: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-drawer-icon::before,
.nav-drawer-icon::after {
  content: '';
  display: block;
  height: 1.5px;
  background: currentColor;
  border-radius: 99px;
}

.nav-drawer-icon::after {
  width: 75%;
}

.nav-drawer-panel {
  position: fixed;
  top: 52px;
  right: 0;
  left: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--s4) var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  z-index: 899;
  animation: drawerIn 200ms ease forwards;
}

.nav-drawer:not([open]) .nav-drawer-panel {
  display: none;
}

@keyframes drawerIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-drawer-head {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: var(--s1) var(--s2);
  margin-bottom: var(--s1);
  text-transform: none;
  letter-spacing: 0;
}

.nav-drawer-link {
  display: block;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 100ms, color 100ms;
}

.nav-drawer-link:hover {
  background: var(--surface);
  color: var(--ink);
}

.nav-drawer-link-accent {
  color: var(--accent);
  font-weight: 600;
}

.nav-drawer-link-muted {
  color: var(--ink-3);
  margin-top: var(--s2);
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  margin-top: var(--s7);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s4) var(--s6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  gap: var(--s4);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--ink-2);
}

.footer-sep {
  color: var(--ink-3);
  font-size: 0.75rem;
}

.footer-link {
  font-size: 0.8rem;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-link:hover {
  color: var(--ink);
}

.footer-right {
  flex-shrink: 0;
}

.footer-credit {
  font-size: 0.75rem;
  color: var(--ink-3);
  direction: ltr;
  display: block;
}

.footer-credit-link {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
}

.footer-credit-link:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-end;
    gap: var(--s3);
    padding: var(--s4);
  }

  .footer-right {
    align-self: flex-start;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .container {
    padding: 0 var(--s5);
  }
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none !important;
  }

  .nav-drawer {
    display: flex !important;
  }

  .nav-link--active::after {
    display: none;
  }

  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"] {
    font-size: 16px;
    min-height: 48px;
  }

  .card {
    padding: var(--s5);
  }
}

@media (min-width: 769px) {
  .nav-drawer {
    display: none !important;
  }
}

/* Note: avoid body scroll-lock hacks on mobile because they can make footer overlay content. */
@media (max-width: 640px) {
  /* Transfer: keep hints visible; large tap targets (see transfer_home.html for layout) */
  .dropzone {
    padding: 28px 16px !important;
    border-radius: var(--r-lg) !important;
  }

  .dropzone #idleState .btn.btn-primary {
    width: 100% !important;
    min-height: 52px !important;
    font-size: 17px !important;
  }

  .transfer-wrap .hero {
    padding-top: var(--s6) !important;
  }

  .transfer-wrap .hero h1 {
    font-size: 26px !important;
    line-height: 1.2 !important;
  }

  .transfer-wrap .hero p {
    font-size: 15px !important;
    padding-inline: var(--s2);
  }

  .transfer-wrap .eyebrow {
    font-size: 11px;
    padding: 6px 12px;
  }

  .transfer-wrap .trust-bar {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
    text-align: center;
    padding-inline: var(--s3);
  }

  .transfer-wrap .share-row {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  .transfer-wrap .share-row .share-btn {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 15px !important;
  }

  .transfer-wrap .link-box {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .transfer-wrap .link-box .link-text {
    text-align: center;
    white-space: normal;
    word-break: break-all;
    font-size: 12px !important;
  }

  .transfer-wrap .link-box .btn {
    width: 100%;
    min-height: 48px;
  }

  .transfer-wrap #qrBoxWrap {
    width: 100% !important;
  }

  .transfer-wrap #qrBox {
    max-width: 100%;
  }

  /* Login/signup: hide brand panel */
  .login-page,
  .signup-page {
    grid-template-columns: 1fr !important;
  }

  .login-page .left-pane,
  .signup-page .left-pane {
    display: none !important;
  }

  .login-page .right-pane,
  .signup-page .right-pane {
    padding: max(var(--s5), env(safe-area-inset-top)) var(--s4) max(var(--s6), env(safe-area-inset-bottom)) !important;
  }

  .login-page .btn-primary,
  .signup-page .btn-primary {
    width: 100%;
    min-height: 52px;
    font-size: 17px;
  }

  /* Dashboard: hide upload date column in table (if any) */
  .dash-wrap table th:nth-child(3),
  .dash-wrap table td:nth-child(3) {
    display: none !important;
  }
}

/* —— Global toasts (RTL-friendly, bottom center) —— */
.abrivo-toast-stack {
  position: fixed;
  z-index: 10050;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.abrivo-toast {
  pointer-events: auto;
  margin: 0;
  padding: 12px 14px 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: abrivoToastIn 0.28s ease;
}

.abrivo-toast--success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.abrivo-toast--error {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.abrivo-toast--info {
  background: var(--tint);
  border-color: var(--tint-border);
  color: var(--accent-text);
}

@keyframes abrivoToastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .abrivo-toast {
    animation: none;
  }

  .nav-account-panel {
    animation: none;
  }

  .nav-drawer-panel {
    animation: none;
  }

  .nav-brand,
  .nav-link,
  .nav-cta,
  .nav-avatar,
  .nav-avatar-chevron,
  .nav-drawer-btn,
  .nav-account-link,
  .nav-drawer-link {
    transition: none;
  }
}

/* —— AI assistant (fab + full page) —— */
.abrivo-asst-shell {
  position: relative;
}
.abrivo-asst-fab {
  position: fixed;
  z-index: 10100;
  /* گوشهٔ پایین «چپِ صفحهٔ نمایش» — با left فیزیکی تا در RTL گم نشود */
  left: max(18px, env(safe-area-inset-left, 0px));
  right: auto;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid var(--tint-border);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  font-size: 1.35rem;
  line-height: 1;
  box-sizing: border-box;
}
.abrivo-asst-fab:link,
.abrivo-asst-fab:visited {
  color: #fff;
  text-decoration: none;
}
.abrivo-asst-fab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.abrivo-asst-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* [hidden] must win over display:flex — otherwise بستن never hides the panel */
.abrivo-asst-backdrop[hidden],
.abrivo-asst-panel--float[hidden] {
  display: none !important;
}
.abrivo-asst-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 10098;
  background: rgba(7, 12, 25, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.18s ease;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
}
.abrivo-asst-panel--float {
  position: fixed;
  z-index: 10099;
  bottom: max(86px, calc(18px + env(safe-area-inset-bottom, 0px) + 56px));
  left: max(18px, env(safe-area-inset-left, 0px));
  right: auto;
  width: min(460px, calc(100vw - 36px));
  max-width: min(460px, calc(100vw - 36px));
  height: min(640px, calc(100vh - 120px));
  max-height: min(640px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: color-mix(in srgb, var(--surface) 96%, #0f172a 4%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(8, 12, 24, 0.45), 0 2px 14px rgba(8, 12, 24, 0.3);
  overflow: hidden;
  pointer-events: auto;
  min-width: 0;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transform-origin: left bottom;
  transition: opacity 0.18s ease, transform 0.2s ease;
}
/* دکمهٔ بستن در سمت چپِ فیزیکی صفحه (الگوی رایج موبایل/چت) */
.abrivo-asst-panel--float .abrivo-asst-head {
  flex-direction: row-reverse;
}
body.abrivo-asst-open {
  overflow: hidden;
}
body.abrivo-asst-open .abrivo-asst-backdrop {
  opacity: 1;
}
body.abrivo-asst-open .abrivo-asst-panel--float {
  opacity: 1;
  transform: translateY(0) scale(1);
}
@media (max-width: 520px) {
  .abrivo-asst-panel--float {
    left: max(0px, env(safe-area-inset-left, 0px));
    right: max(0px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    bottom: max(0px, env(safe-area-inset-bottom, 0px));
    height: min(90dvh, 760px);
    max-height: min(90dvh, 760px);
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
  .abrivo-asst-fab {
    width: 54px;
    height: 54px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
}
.abrivo-asst-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  min-height: 320px;
  min-width: 0;
  box-sizing: border-box;
}
.abrivo-asst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 90%, var(--tint) 10%), var(--surface-2));
}
.abrivo-asst-titlewrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.abrivo-asst-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
}
.abrivo-asst-subtitle {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.abrivo-asst-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 200px;
  min-width: 0;
  width: 100%;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.abrivo-asst-panel:not(.abrivo-asst-panel--float) .abrivo-asst-messages {
  max-height: min(50vh, 420px);
}
.abrivo-asst-panel--float .abrivo-asst-messages {
  max-height: none;
}
.abrivo-asst-msg {
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.58;
  width: fit-content;
  max-width: 88%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}
.abrivo-asst-msg--user {
  align-self: flex-start;
  margin-left: auto;
  background: var(--tint);
  border: 1px solid var(--tint-border);
}
.abrivo-asst-msg--assistant {
  align-self: flex-start;
  margin-right: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.abrivo-asst-msg-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.abrivo-asst-msg-body {
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.abrivo-asst-infochips {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.abrivo-asst-infochip {
  border: 1px solid var(--tint-border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  line-height: 1.35;
  direction: ltr;
  unicode-bidi: isolate;
}
.abrivo-asst-cards {
  margin-top: 8px;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.abrivo-asst-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 8px 9px;
}
.abrivo-asst-card-title {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.abrivo-asst-card-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.abrivo-asst-card-hint {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-2);
}
.abrivo-asst-ctas {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.abrivo-asst-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--tint) 42%, transparent);
  color: var(--accent-text);
  text-decoration: none;
}
.abrivo-asst-cta--support {
  border-color: var(--warning);
  color: var(--warning);
  background: color-mix(in srgb, var(--warning-bg) 70%, transparent);
}
.abrivo-asst-msg-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.abrivo-asst-msg-time {
  font-size: 10px;
  color: var(--ink-3);
  opacity: 0.9;
}
.abrivo-asst-msg-copy,
.abrivo-asst-msg-retry {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1.3;
  font-family: inherit;
  cursor: pointer;
}
.abrivo-asst-msg-retry {
  border-color: var(--accent);
  color: var(--accent-text);
}
.abrivo-asst-msg-copy:hover,
.abrivo-asst-msg-retry:hover {
  filter: brightness(0.98);
}
.abrivo-asst-msg--typing .abrivo-asst-msg-body {
  display: flex;
  align-items: center;
}
.abrivo-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 14px;
}
.abrivo-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-2) 74%, transparent);
  animation: abrivoTypingBounce 1s infinite ease-in-out;
}
.abrivo-typing-dots i:nth-child(2) {
  animation-delay: 0.14s;
}
.abrivo-typing-dots i:nth-child(3) {
  animation-delay: 0.28s;
}
@keyframes abrivoTypingBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}
.abrivo-asst-suggestions {
  align-self: stretch;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
  border-radius: var(--r-md);
  padding: 8px;
}
.abrivo-asst-suggestions-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  margin: 0 0 6px;
}
.abrivo-asst-suggestions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.abrivo-asst-chip {
  border: 1px solid var(--tint-border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
  font-family: inherit;
}
.abrivo-asst-chip:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: color-mix(in srgb, var(--tint) 45%, transparent);
}
.abrivo-asst-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.abrivo-asst-input-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 11px;
  border-top: 1px solid var(--border);
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  box-sizing: border-box;
  background: var(--surface);
}
.abrivo-asst-input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  resize: none;
  min-height: 46px;
  max-height: 118px;
  padding: 10px 11px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
}
.abrivo-asst-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.abrivo-asst-actions {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-width: 0;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.abrivo-asst-charcount {
  font-size: 11px;
  color: var(--ink-3);
  user-select: none;
}
.abrivo-asst-charcount.is-warn {
  color: var(--warning);
}
.abrivo-asst-send {
  flex-shrink: 0;
  min-width: 80px;
  padding: 7px 12px;
}
.abrivo-asst-close.btn {
  padding: 5px 11px;
  min-height: 32px;
}
@media (max-width: 520px) {
  .abrivo-asst-input-row {
    padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
  }
  .abrivo-asst-msg {
    max-width: 92%;
  }
  .abrivo-asst-subtitle {
    display: none;
  }
}
.abrivo-asst-hint {
  margin: 0;
  padding: 0 12px 10px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-3);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  .abrivo-asst-panel--float {
    background: #151b28;
    border-color: #313d54;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.55), 0 1px 8px rgba(0, 0, 0, 0.4);
  }
  .abrivo-asst-panel--float .abrivo-asst-msg--assistant {
    background: #202734;
    border-color: #364257;
  }
  .abrivo-asst-panel--float .abrivo-asst-msg--user {
    background: #22324e;
    border-color: #4a6aa1;
  }
  .abrivo-asst-infochip {
    border-color: #445066;
    background: #1e2430;
    color: #b7c3d8;
  }
  .abrivo-asst-card {
    border-color: #39465a;
    background: #1f2633;
  }
  .abrivo-asst-cta {
    background: #202d44;
    border-color: #3e5f95;
    color: #9fbeec;
  }
  .abrivo-asst-cta--support {
    background: #2a2617;
    border-color: #8d6b17;
    color: #f3d27a;
  }
  .abrivo-asst-head {
    background: linear-gradient(180deg, #1d2433, #1a2130);
    border-bottom-color: #344158;
  }
}
@media (prefers-reduced-motion: reduce) {
  .abrivo-asst-panel--float,
  .abrivo-asst-backdrop,
  .abrivo-asst-fab {
    transition: none;
  }
  .abrivo-typing-dots i {
    animation: none;
  }
}

.abrivo-asst-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  font-size: 11px;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.abrivo-asst-powered a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.abrivo-asst-powered a:hover {
  text-decoration: underline;
}

.abrivo-asst-powered-tag {
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}

.abrivo-asst-promo {
  margin: 8px 0;
  animation: fadeIn 0.3s ease;
}

.abrivo-asst-promo-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  direction: rtl;
}

.abrivo-asst-promo-inner span:first-child {
  font-size: 20px;
  flex-shrink: 0;
}

.abrivo-asst-promo-inner strong {
  display: block;
  color: #1e40af;
  margin-bottom: 4px;
  font-size: 13px;
}

.abrivo-asst-promo-inner p {
  color: #475569;
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.5;
}

.abrivo-asst-promo-inner a {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.abrivo-asst-promo-inner a:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.abrivo-asst-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
  justify-content: flex-end;
  direction: rtl;
}

.abrivo-asst-suggestion-btn {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}

.abrivo-asst-suggestion-btn:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* ── Proactive FAB states ── */
.abrivo-asst-fab--proactive {
  animation: avronPulse 2s infinite;
}

.abrivo-asst-fab--warning {
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: avronPulseWarning 2s infinite;
}

.abrivo-asst-fab--danger {
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: avronPulseDanger 2s infinite;
}

@keyframes avronPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes avronPulseWarning {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes avronPulseDanger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ── Notification dot ── */
.abrivo-asst-notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
  animation: notifPop 0.3s ease;
}

@keyframes notifPop {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ── Typing indicator ── */
.abrivo-asst-typing {
  display: flex !important;
  align-items: center;
  gap: 4px;
  padding: 12px 16px !important;
  width: fit-content;
}

.abrivo-asst-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  display: inline-block;
  animation: dotBounce 1.2s infinite;
}

.abrivo-asst-dot:nth-child(2) { animation-delay: 0.2s; }
.abrivo-asst-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* ── Proactive message bubble ── */
.abrivo-asst-msg--proactive {
  border-right: 3px solid #2563eb;
  background: #f0f9ff !important;
}

.abrivo-asst-msg--proactive.abrivo-asst-msg--warning {
  border-right-color: #f59e0b;
  background: #fffbeb !important;
}

.abrivo-asst-msg--proactive.abrivo-asst-msg--danger {
  border-right-color: #ef4444;
  background: #fef2f2 !important;
}

/* ── File cards ── */
.abrivo-asst-file-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin: 4px 0;
  direction: rtl;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.abrivo-asst-file-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.abrivo-asst-file-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.abrivo-asst-file-info {
  flex: 1;
  min-width: 0;
}

.abrivo-asst-file-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.abrivo-asst-file-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.abrivo-asst-file-expiry {
  color: #64748b;
}

.abrivo-asst-file-expiry.danger {
  color: #ef4444;
  font-weight: 600;
}

.abrivo-asst-file-actions {
  display: flex;
  gap: 8px;
}

.abrivo-asst-file-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  transition: all 0.15s;
  display: block;
}

.abrivo-asst-file-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.abrivo-asst-file-btn.primary {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.abrivo-asst-file-btn.primary:hover {
  background: #1d4ed8;
}

/* ═══════════════════════════════════════════════════════════════════════
   Upload Experience — overlay, zone, sheet, FAB, done, failed
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Full-page drag overlay ─────────────────────────────────────────── */

.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(17, 19, 24, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.upload-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.upload-overlay-icon {
  width: 96px;
  height: 96px;
  color: #fff;
  animation: uploadOverlayFloat 1.5s ease-in-out infinite;
}

.upload-overlay-text {
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

@keyframes uploadOverlayFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ── Upload zone (landing page idle state) ──────────────────────────── */

.upload-zone {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  padding: var(--s7) var(--s5);
  background: var(--surface);
  border: 2px dashed var(--border-2);
  border-radius: var(--r-xl);
  cursor: pointer;
  text-align: center;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
  animation: zonePulse 2.5s ease-in-out infinite;
}

@keyframes zonePulse {
  0%, 100% { border-color: var(--border-2); }
  50%      { border-color: var(--accent); }
}

.upload-zone:hover {
  background: var(--tint);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.upload-zone.dragover {
  background: var(--tint);
  border-style: solid;
  border-color: var(--accent);
  border-width: 2.5px;
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-md);
  animation: none;
}

.upload-zone-icon {
  width: 48px;
  height: 48px;
  color: var(--ink-3);
  transition: color 200ms ease, transform 200ms ease;
}

.upload-zone:hover .upload-zone-icon,
.upload-zone.dragover .upload-zone-icon {
  color: var(--accent);
  transform: translateY(-2px);
}

.upload-zone-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.upload-zone-sub {
  font-size: 13px;
  color: var(--ink-3);
}

.upload-zone-limit {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: var(--s2);
}

/* ── Upload sheet (dashboard bottom sheet / modal) ──────────────────── */

.upload-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(17, 19, 24, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.upload-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.upload-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8001;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s5);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -8px 32px rgba(17, 19, 24, 0.18);
}

.upload-sheet.is-open {
  transform: translateY(0);
}

.upload-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-2);
  border-radius: 2px;
  margin: 0 auto var(--s4);
}

.upload-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.upload-sheet-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.upload-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}

.upload-sheet-close:hover {
  background: var(--border);
  color: var(--ink);
}

.upload-sheet-name-field {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-family: "Vazirmatn", sans-serif;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: var(--s4);
  transition: border-color 150ms ease;
}

.upload-sheet-name-field:focus {
  outline: none;
  border-color: var(--accent);
}

.upload-sheet-name-field::placeholder {
  color: var(--ink-3);
}

.upload-sheet-actions {
  display: flex;
  gap: var(--s3);
  margin-top: var(--s4);
}

.upload-sheet-actions .btn {
  flex: 1;
  justify-content: center;
  min-height: 44px;
}

@media (min-width: 640px) {
  .upload-sheet {
    left: 50%;
    right: auto;
    width: 100%;
    max-width: 560px;
    transform: translate(-50%, 100%);
    border-radius: 16px 16px 0 0;
  }

  .upload-sheet.is-open {
    transform: translate(-50%, 0);
  }
}

/* ── File list inside sheet ─────────────────────────────────────────── */

.upload-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-file-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  position: relative;
}

.upload-file-item-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: rgba(77, 124, 254, 0.1);
  border: 1px solid rgba(77, 124, 254, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.upload-file-item-info {
  flex: 1;
  min-width: 0;
}

.upload-file-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-file-item-size {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.upload-file-item-remove {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}

.upload-file-item-remove:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.upload-file-item.uploading .upload-file-item-name {
  color: var(--accent);
}

.upload-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  width: 0%;
  transition: width 200ms ease;
}

.upload-file-item-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  flex-shrink: 0;
  white-space: nowrap;
}

.upload-file-item-status.is-done {
  color: var(--success);
}

.upload-file-item-status.is-error {
  color: var(--danger);
}

/* ── FAB (floating action button for dashboard) ─────────────────────── */

.upload-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 7000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(77, 124, 254, 0.35);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.upload-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(77, 124, 254, 0.45);
}

.upload-fab:active {
  transform: scale(0.97);
}

.upload-fab svg {
  width: 24px;
  height: 24px;
}

.upload-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--surface);
}

@media (max-width: 639px) {
  .upload-fab {
    width: 48px;
    height: 48px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    right: 16px;
  }

  .upload-fab svg {
    width: 20px;
    height: 20px;
  }
}

/* ── Done state ─────────────────────────────────────────────────────── */

.upload-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s4);
  text-align: center;
  padding: var(--s5) 0;
}

.upload-done-check {
  width: 64px;
  height: 64px;
  color: var(--success);
}

.upload-done-check circle {
  fill: var(--success-bg);
  stroke: var(--success);
  stroke-width: 1.5;
}

.upload-done-check polyline {
  fill: none;
  stroke: var(--success);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: checkDraw 400ms ease forwards 100ms;
}

@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

.upload-done-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.upload-done-link {
  width: 100%;
  max-width: 440px;
  padding: 12px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--tint);
  font-family: "Vazirmatn", monospace;
  font-size: 13px;
  color: var(--accent-text);
  direction: ltr;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  outline: none;
}

.upload-done-link:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 2px rgba(77, 124, 254, 0.15);
}

.upload-copy-btn {
  width: 100%;
  max-width: 440px;
}

.upload-done-nudge {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: var(--s2);
}

.upload-done-nudge a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.upload-done-nudge a:hover {
  text-decoration: underline;
}

.upload-done-secondary {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Vazirmatn", sans-serif;
  padding: 0;
}

.upload-done-secondary:hover {
  text-decoration: underline;
}

/* ── Per-file done row (sheet multi-file results) ───────────────────── */

.upload-result-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.upload-result-row:last-child {
  border-bottom: none;
}

.upload-result-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-result-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Failed files list ──────────────────────────────────────────────── */

.upload-failed-list {
  width: 100%;
  max-width: 440px;
  margin-top: var(--s3);
  padding: var(--s3);
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--r-md);
}

.upload-failed-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: var(--s2);
}

.upload-failed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 6px 0;
}

.upload-failed-item:not(:last-child) {
  border-bottom: 1px solid rgba(146, 96, 10, 0.15);
}

.upload-failed-name {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.upload-failed-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Dashboard layout ───────────────────────────────────────────────── */

/* Dashboard semantic aliases (file list, keep, assistant) */
.dash-wrap,
.ai-overlay,
.keep-overlay {
  --color-background-primary: var(--surface);
  --color-background-secondary: var(--surface-2, var(--bg));
  --color-background-tertiary: var(--surface-2, var(--bg));
  --color-border-tertiary: var(--border);
  --color-border-secondary: var(--border);
  --color-text-primary: var(--ink);
  --color-text-secondary: var(--ink-2);
  --fl-accent: var(--accent);
  --fl-accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --fl-danger: var(--danger);
  --fl-danger-soft: var(--danger-bg);
  --fl-warn: var(--warning);
  --color-text-danger: var(--fl-danger);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

.dash-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s6) var(--s5);
}

.dash-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}

.dash-top-main {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  min-width: 0;
}

.dash-top-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.dash-top-sub {
  font-size: 0.875rem;
  color: var(--ink-3);
  margin: 0;
}

.dash-top-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dash-section-heading {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 var(--s4);
  line-height: 1.3;
}

.dash-upload-primary {
  margin-bottom: var(--s5);
}

.dash-storage-compact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s5);
}

.dash-storage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.dash-storage-meta span {
  white-space: nowrap;
}

.dash-assistant-row {
  margin-top: var(--s6);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
}

/* ── Dashboard — hero, keep, assistant (extracted from dashboard.html) ─ */

.dash-hero{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:var(--s5);margin-bottom:var(--s5)}
.dash-hero-top{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--s4);flex-wrap:wrap}
.dash-hero-greeting{min-width:0}
.dash-hero-name{font-size:1.25rem;font-weight:700;color:var(--ink);margin:0 0 var(--s1);line-height:1.2}
.dash-hero-sub{font-size:0.875rem;color:var(--ink-3);margin:0}
.dash-hero-actions{display:flex;align-items:center;gap:var(--s3);flex-wrap:wrap}
.dash-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:0;margin-top:var(--s4);padding-top:var(--s4);border-top:1px solid var(--border)}
.dash-stat{text-align:center;padding:var(--s2)}
.dash-stat-value{display:block;font-size:1rem;font-weight:700;color:var(--ink)}
.dash-stat-label{display:block;font-size:0.7rem;color:var(--ink-3);margin-top:2px}
.dash-stat-divider{display:none}
@media (max-width:640px){.dash-stats{grid-template-columns:repeat(2,1fr)}}
.pending-payment-note{margin-top:var(--s4);padding:10px 12px;border-radius:var(--r-md);border:1px solid var(--border);background:var(--surface)}
.pending-payment-note .pending-payment-link{color:var(--accent);font-weight:700;text-decoration:none}
.pending-payment-note .pending-payment-link:hover{text-decoration:underline}
.dash-wallet-badge{display:inline-flex;align-items:center;gap:6px;background:var(--color-background-secondary);border:.5px solid var(--color-border-tertiary);border-radius:20px;padding:5px 12px;font-size:12px;color:var(--color-text-primary);text-decoration:none;transition:border-color .15s}
.dash-wallet-badge:hover{border-color:var(--accent)}
.dash-wallet-badge i{font-size:14px;color:var(--accent)}
.keep-overlay{position:fixed;inset:0;background:rgba(17,19,24,.45);z-index:9998;display:none;align-items:center;justify-content:center;padding:20px}
.keep-overlay.open{display:flex}
.keep-modal{background:var(--color-background-primary);border:.5px solid var(--color-border-tertiary);border-radius:20px;padding:24px;width:100%;max-width:420px;direction:rtl;box-shadow:0 24px 80px rgba(0,0,0,.3);animation:keepModalIn .2s ease}
@keyframes keepModalIn{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.keep-modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.keep-modal-title{font-size:15px;font-weight:500;color:var(--color-text-primary)}
.keep-modal-close{width:44px;height:44px;border-radius:50%;background:var(--color-background-secondary);border:none;cursor:pointer;font-size:14px;color:var(--color-text-secondary);display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0}
.keep-file-info{background:var(--color-background-secondary);border-radius:10px;padding:10px 14px;margin-bottom:16px}
.keep-file-name{font-size:13px;font-weight:500;color:var(--color-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:2px}
.keep-file-size{font-size:11px;color:var(--color-text-secondary)}
.keep-options{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.keep-option{display:flex;align-items:center;gap:12px;padding:12px 14px;border:.5px solid var(--color-border-tertiary);border-radius:12px;cursor:pointer;transition:all .15s}
.keep-option:hover{border-color:var(--accent);background:color-mix(in srgb, var(--accent) .04)}
.keep-option.selected{border:1.5px solid var(--accent);background:color-mix(in srgb, var(--accent) .08)}
.keep-option--premium{border-color:color-mix(in srgb, var(--accent) .3)}
.keep-option--premium.selected{border-color:var(--accent);background:color-mix(in srgb, var(--accent) .08)}
.keep-option-icon{font-size:20px;flex-shrink:0}
.keep-option-info{flex:1}
.keep-option-title{font-size:13px;font-weight:500;color:var(--color-text-primary)}
.keep-option-desc{font-size:11px;color:var(--color-text-secondary);margin-top:2px}
.keep-option-price{font-size:13px;font-weight:500;color:var(--accent);flex-shrink:0}
.keep-wallet-row{display:flex;align-items:center;justify-content:space-between;padding:10px 0;margin-bottom:8px;border-top:.5px solid var(--color-border-tertiary)}
.keep-wallet-label{font-size:12px;color:var(--color-text-secondary)}
.keep-wallet-balance{font-size:13px;font-weight:500;color:var(--color-text-primary)}
.keep-insufficient{display:flex;background:rgba(230,126,34,.08);border:.5px solid rgba(230,126,34,.3);border-radius:8px;padding:8px 12px;font-size:12px;color:#e67e22;margin-bottom:12px;align-items:center;gap:6px}
.keep-insufficient .ti{font-size:16px;flex-shrink:0}
.keep-topup-link{color:var(--accent);text-decoration:none;font-weight:500}
.keep-confirm-btn{width:100%;background:var(--accent);color:#fff;border:none;border-radius:12px;padding:13px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:background .12s;margin-bottom:8px}
.keep-confirm-btn:hover:not(:disabled){background:var(--accent-dark)}
.keep-confirm-btn:disabled{opacity:.4;cursor:not-allowed}
.keep-hint{text-align:center;font-size:11px;color:var(--color-text-secondary)}
.keep-badge-forever,.keep-badge-kept{display:inline-flex;align-items:center;gap:3px;font-size:10px;padding:2px 7px;border-radius:20px}
.keep-badge-forever{background:color-mix(in srgb, var(--accent) .1);color:var(--accent);border:.5px solid color-mix(in srgb, var(--accent) .3)}
.keep-badge-kept{background:var(--color-background-success,rgba(16,185,129,.1));color:var(--color-text-success,#10b981)}
.keep-badge-forever .ti,.keep-badge-kept .ti{font-size:11px;line-height:1}
@media (max-width:640px){
  .keep-modal{border-radius:20px 20px 0 0}
  .keep-overlay{align-items:flex-end;padding:0}
}
.ai-trigger:focus-visible,.ai-ctrl-btn:focus-visible,.ai-attach-btn:focus-visible,.ai-send-btn:focus-visible,.ai-sug-btn:focus-visible,.keep-modal-close:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--fl-accent) 35%,transparent);border-radius:8px}
.dash-wrap .file-box-sort:focus-visible,.dash-wrap .file-box-tab:focus-visible,.dash-wrap .fbt-btn:focus-visible,.dash-wrap .fc-menu-btn:focus-visible,.dash-wrap .fc-keep:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--fl-accent) 35%,transparent);border-radius:8px}
.dash-wrap .fc-cb input:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--fl-accent) 35%,transparent)}
/* ── Dashboard responsive adapt (mobile / tablet / touch) ─────────── */

@media (max-width: 640px) {
  .dash-hero {
    padding: var(--s4);
    margin-bottom: var(--s4);
  }
  .dash-hero-top {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s3);
  }
  .dash-hero-name {
    font-size: 1.125rem;
  }
  .dash-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .dash-buy-btn {
    flex: 1;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .dash-upload-new {
    padding: var(--s4) var(--s3);
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .du-idle {
    grid-template-columns: 1fr;
  }
  .du-divider {
    flex-direction: row;
    padding: var(--s2) 0;
  }
  .du-divider::before {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: 1px;
    transform: translateY(-50%);
  }
  .dash-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (pointer: coarse) {
  .du-zone:hover {
    transform: none;
  }
}
.dash-wrap .ai-trigger{margin-top:14px;padding-top:14px;border-top:.5px solid var(--color-border-tertiary)}
.ai-trigger{background:var(--color-background-secondary);border:.5px solid var(--color-border-tertiary);border-radius:10px;padding:11px 16px;display:flex;align-items:center;gap:10px;cursor:pointer;direction:rtl;transition:border-color .15s}
.ai-trigger:hover{border-color:var(--accent)}
.ai-trigger-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);flex-shrink:0;opacity:.85}
.ai-trigger-placeholder{flex:1;font-size:13px;color:var(--color-text-secondary);text-align:right}
.ai-trigger-shortcut{font-size:11px;color:var(--color-text-secondary);background:var(--color-background-primary);border:.5px solid var(--color-border-tertiary);border-radius:5px;padding:2px 7px}
.ai-overlay{position:fixed;inset:0;background:rgba(17,19,24,.45);z-index:9999;display:none;align-items:center;justify-content:center;padding:20px}
.ai-overlay.open{display:flex}
.ai-modal{background:var(--color-background-primary);border:.5px solid var(--color-border-tertiary);border-radius:20px;width:100%;max-width:580px;height:560px;display:flex;flex-direction:column;overflow:hidden;position:relative;direction:rtl;box-shadow:0 24px 80px rgba(0,0,0,.35);animation:aiModalIn .2s cubic-bezier(.22,1,.36,1)}
@keyframes aiModalIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
.ai-modal.expanded{max-width:820px;height:calc(100vh - 40px);transition:max-width .25s ease,height .25s ease}
.ai-overlay.open .ai-modal{animation:aiModalIn .2s cubic-bezier(.22,1,.36,1)}
.ai-modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:.5px solid var(--color-border-tertiary);flex-shrink:0}
.ai-modal-title-group{display:flex;align-items:center;gap:10px}
.ai-modal-avatar{width:34px;height:34px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;font-size:16px;color:#fff}
.ai-modal-avatar .ti{font-size:18px}
.ai-modal-name{font-size:14px;font-weight:500;color:var(--color-text-primary)}
.ai-modal-online{display:flex;align-items:center;gap:4px;font-size:11px;color:var(--accent)}
.ai-online-dot{width:6px;height:6px;border-radius:50%;background:var(--accent);animation:aiPulse 2s infinite}
.ai-modal-controls{display:flex;gap:6px}
.ai-ctrl-btn{width:44px;height:44px;border-radius:10px;background:var(--color-background-secondary);border:none;cursor:pointer;font-size:16px;color:var(--color-text-secondary);display:flex;align-items:center;justify-content:center;transition:background .12s ease;flex-shrink:0;padding:0}
.ai-ctrl-btn:hover{background:var(--color-border-tertiary)}
.ai-messages{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:16px;scroll-behavior:smooth}
.ai-messages::-webkit-scrollbar{width:3px}
.ai-messages::-webkit-scrollbar-thumb{background:var(--color-border-tertiary);border-radius:2px}
.ai-msg{display:flex;gap:8px;align-items:flex-end}
.ai-msg--user{flex-direction:row-reverse}
.ai-msg-avatar{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;flex-shrink:0;margin-bottom:2px}
.ai-msg--ai .ai-msg-avatar{background:var(--accent);color:#fff}
.ai-msg--ai .ai-msg-avatar .ti{font-size:14px;line-height:1}
.ai-msg--user .ai-msg-avatar{background:var(--color-background-secondary);font-size:11px;color:var(--color-text-secondary)}
.ai-msg--user .ai-msg-bubble .ti{margin-inline-end:4px;font-size:13px;vertical-align:-2px}
.ai-msg-content{max-width:78%;display:flex;flex-direction:column}
.ai-msg-bubble{padding:10px 14px;border-radius:16px;font-size:13px;line-height:1.65}
.ai-msg--ai .ai-msg-bubble{background:var(--color-background-secondary);color:var(--color-text-primary);border-bottom-right-radius:4px}
.ai-msg--user .ai-msg-bubble{background:var(--accent);color:#fff;border-bottom-left-radius:4px}
.ai-typing-bubble{display:flex;align-items:center;gap:4px;padding:12px 16px!important}
.ai-typing-dot{width:6px;height:6px;border-radius:50%;background:var(--color-text-secondary);display:inline-block;animation:aiTyping 1.2s infinite}
.ai-typing-dot:nth-child(2){animation-delay:.2s}
.ai-typing-dot:nth-child(3){animation-delay:.4s}
@keyframes aiTyping{0%,60%,100%{opacity:.3;transform:scale(1)}30%{opacity:1;transform:scale(1.3)}}
.ai-suggestions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.ai-sug-btn{padding:4px 12px;border:1px solid var(--accent);color:var(--accent);border-radius:20px;background:transparent;cursor:pointer;font-size:12px;font-family:inherit;transition:all .12s}
.ai-sug-btn:hover{background:color-mix(in srgb, var(--accent) .1)}
.ai-msg-cta{display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:7px 14px;background:var(--accent);color:#fff;border-radius:10px;text-decoration:none;font-size:12px;font-weight:500;transition:background .12s}
.ai-msg-cta:hover{background:var(--accent-dark)}
.ai-file-result{background:var(--color-background-secondary);border:.5px solid var(--color-border-tertiary);border-radius:12px;padding:12px 14px;margin-top:4px}
.ai-file-result-name{font-size:13px;font-weight:500;color:var(--color-text-primary);margin-bottom:6px}
.ai-file-result-link{display:flex;align-items:center;gap:8px;background:var(--color-background-primary);border:.5px solid var(--color-border-tertiary);border-radius:8px;padding:7px 10px}
.ai-file-result-url{flex:1;font-size:11px;color:var(--accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:ltr;text-align:left}
.ai-file-result-copy{font-size:11px;padding:3px 8px;border-radius:6px;border:.5px solid var(--color-border-tertiary);background:transparent;cursor:pointer;color:var(--color-text-secondary);white-space:nowrap;font-family:inherit}
.ai-file-result-copy:hover{color:var(--accent);border-color:var(--accent)}
.ai-drag-overlay{position:absolute;inset:60px 0 0 0;background:color-mix(in srgb, var(--accent) .12);border:2px dashed var(--accent);border-radius:0 0 20px 20px;display:none;flex-direction:column;align-items:center;justify-content:center;gap:8px;z-index:10}
.ai-drag-overlay.active{display:flex}
.ai-drag-icon{font-size:40px;color:var(--accent);line-height:1}
.ai-upload-icon{color:var(--color-text-secondary);font-size:16px;line-height:1}
.ai-drag-text{font-size:15px;font-weight:500;color:var(--accent)}
.ai-drag-sub{font-size:12px;color:var(--color-text-secondary)}
.ai-upload-progress{display:none;padding:8px 0 10px;border-bottom:.5px solid var(--color-border-tertiary);margin-bottom:10px}
.ai-upload-progress.active{display:block}
.ai-upload-info{display:flex;align-items:center;gap:8px;margin-bottom:6px;direction:rtl}
.ai-upload-icon{font-size:14px}
.ai-upload-filename{flex:1;font-size:12px;color:var(--color-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ai-upload-pct{font-size:12px;color:var(--accent);font-weight:500;flex-shrink:0}
.ai-progress-track{height:3px;background:var(--color-border-tertiary);border-radius:2px;overflow:hidden}
.ai-progress-fill{height:100%;background:var(--accent);border-radius:2px;width:0%;transition:width .2s ease}
.ai-input-area{padding:14px 18px;border-top:.5px solid var(--color-border-tertiary);flex-shrink:0}
.ai-input-row{display:flex;align-items:center;gap:8px;background:var(--color-background-secondary);border:.5px solid var(--color-border-tertiary);border-radius:12px;padding:7px 10px;transition:border-color .15s}
.ai-input-row:focus-within{border-color:var(--accent)}
.ai-attach-btn{width:44px;height:44px;border-radius:10px;background:transparent;border:none;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;color:var(--color-text-secondary);flex-shrink:0;transition:background .12s ease;padding:0}
.ai-attach-btn:hover{background:var(--color-background-primary)}
.ai-text-input{flex:1;background:transparent;border:none;outline:none;font-size:13px;color:var(--color-text-primary);direction:rtl;font-family:inherit}
.ai-text-input::placeholder{color:var(--color-text-secondary)}
.ai-send-btn{width:44px;height:44px;border-radius:10px;background:var(--accent);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px;color:#fff;flex-shrink:0;transition:background .12s ease;padding:0}
.ai-send-btn:hover{background:var(--accent-dark)}
.ai-send-btn:disabled{opacity:.4;cursor:not-allowed}
.ai-input-hint{font-size:11px;color:var(--color-text-secondary);text-align:center;margin-top:8px}
@media (max-width: 640px) {
  #aiOverlay.open > #aiModal,
  .ai-overlay.open > .ai-modal {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
    max-height: 92dvh !important;
  }
}
@media (max-width:640px){
  .ai-modal{border-radius:16px}
  .ai-modal.expanded{max-width:100%}
}
@media (max-width: 640px) {
  .ai-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .ai-modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    width: 100%;
  }
}
@media (max-width: 640px) {
  .ai-modal-header {
    padding: 12px 14px;
  }
  .ai-modal-name { font-size: 13px; }
}
@media (max-width: 640px) {
  .ai-messages {
    padding: 14px;
    gap: 12px;
  }
  .ai-msg-bubble {
    font-size: 12px;
    padding: 8px 12px;
  }
  .ai-msg-content { max-width: 85%; }
}
@media (max-width: 640px) {
  .ai-input-area {
    padding: 10px 14px;
    padding-bottom: env(safe-area-inset-bottom, 14px);
  }
}
@media (max-width: 640px) {
  .ai-sug-btn {
    font-size: 11px;
    padding: 3px 10px;
  }
}
@media (max-width: 640px) {
  .ai-trigger {
    padding: 9px 12px;
  }
  .ai-trigger-shortcut { display: none; }
}
@media (max-width: 768px) {
  .ai-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .ai-overlay.open .ai-modal {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
    animation: none !important;
  }
  .ai-modal {
    width: 100% !important;
    max-width: 100% !important;
    height: 85dvh !important;
    max-height: 92dvh !important;
    min-height: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 1 !important;
  }
  .ai-modal.expanded {
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .ai-modal-header {
    flex-shrink: 0 !important;
  }
  .ai-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  .ai-input-area {
    flex-shrink: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 16px) !important;
  }
}
#abrivo-assistant-mount,.abrivo-asst-fab,.abrivo-asst-shell{display:none!important;visibility:hidden!important;pointer-events:none!important}
.ai-action-confirm{background:var(--color-background-secondary);border:.5px solid var(--color-border-tertiary);border-radius:12px;padding:14px;margin:4px 0;direction:rtl}
.ai-action-confirm-title{font-size:13px;font-weight:500;color:var(--color-text-primary);margin-bottom:6px}
.ai-action-confirm-body{font-size:12px;color:var(--color-text-secondary);margin-bottom:12px}
.ai-action-confirm-btns{display:flex;gap:8px}
.ai-action-cancel{flex:1;padding:7px;border-radius:8px;border:.5px solid var(--color-border-tertiary);background:transparent;cursor:pointer;font-size:12px;font-family:inherit;color:var(--color-text-primary)}
.ai-action-ok{flex:1;padding:7px;border-radius:8px;border:none;background:var(--accent);color:#fff;cursor:pointer;font-size:12px;font-family:inherit}
.ai-action-result{font-size:12px;color:var(--color-text-secondary);padding:6px 10px;background:var(--color-background-secondary);border-radius:8px;margin:4px 0;direction:rtl;text-align:right}
.ai-storage-report{background:var(--color-background-secondary);border:.5px solid var(--color-border-tertiary);border-radius:12px;padding:14px;direction:rtl;margin:4px 0}
.ai-report-title{font-size:13px;font-weight:500;color:var(--color-text-primary);margin-bottom:10px}
.ai-report-bar-wrap{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.ai-report-bar{flex:1;height:6px;background:var(--color-border-tertiary);border-radius:3px;overflow:hidden}
.ai-report-fill{height:100%;background:var(--accent);border-radius:3px;transition:width .5s ease}
.ai-report-stats{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--color-text-secondary)}
.ai-report-title i{color:var(--accent);margin-inline-end:2px}
.ai-report-stats>div{display:flex;align-items:center;gap:6px}
.ai-report-stats i{color:var(--accent);font-size:13px}
.ai-expiring-banner{background:rgba(230,126,34,.1);border:.5px solid rgba(230,126,34,.3);border-radius:10px;padding:10px 14px;font-size:12px;color:#e67e22;display:flex;align-items:center;justify-content:space-between;gap:8px;direction:rtl;margin-bottom:8px}
.ai-expiring-banner .ti{font-size:16px;flex-shrink:0}
.ai-expiring-banner span{flex:1}
.ai-expiring-banner button{font-size:11px;padding:3px 10px;border:1px solid #e67e22;color:#e67e22;border-radius:20px;background:transparent;cursor:pointer;font-family:inherit}
@media (prefers-reduced-motion: reduce) {
  .ai-online-dot {
    animation: none !important;
  }
  .ai-modal,
  .keep-modal {
    animation: none;
  }
}


.dash-plan-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 700;
}

.dash-buy-btn {
  padding: var(--s2) var(--s4);
  border-radius: var(--r-md);
  background: var(--surface-2, var(--border-2));
  border: 1px solid var(--border-2);
  color: var(--ink-2);
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 150ms ease;
  white-space: nowrap;
}

.dash-buy-btn:hover {
  background: var(--border-2);
  color: var(--ink);
}

.dash-buy-btn.is-urgent {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.dash-storage-hero {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.dash-storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-storage-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
}

.dash-storage-numbers {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  font-size: 0.875rem;
}

.dash-storage-used {
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}

.dash-storage-sep {
  color: var(--ink-3);
  font-size: 0.8rem;
}

.dash-storage-total {
  color: var(--ink-3);
}

.dash-storage-track {
  width: 100%;
  height: 10px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  cursor: default;
}

.dash-storage-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 800ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background 400ms ease;
  position: relative;
  overflow: hidden;
}

.dash-storage-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: storageShimmer 2s ease-in-out infinite;
}

@keyframes storageShimmer {
  0% { left: -60%; }
  100% { left: 110%; }
}

.dash-storage-fill.is-done::after {
  animation: none;
}

.dash-storage-fill.is-warning {
  background: #f59e0b;
}

.dash-storage-fill.is-danger {
  background: #ef4444;
}

.dash-storage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-storage-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
}

.dash-storage-free {
  font-size: 0.8rem;
  color: var(--ink-3);
  display: flex;
  gap: 4px;
}

.dash-storage-hero {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

@media (max-width: 640px) {
  .dash-wrap {
    padding: var(--s4) var(--s3);
    padding-bottom: max(var(--s7), env(safe-area-inset-bottom, 0px));
  }
  .dash-top {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s3);
  }
  .dash-top-name {
    font-size: 1.125rem;
  }
  .dash-top-actions {
    justify-content: flex-start;
  }
  .dash-storage-meta {
    gap: var(--s2) var(--s3);
  }
  /* dash-hero + filelist mobile rules: see «Dashboard responsive adapt» */
}

@media (prefers-reduced-motion: reduce) {
  .dash-storage-fill {
    transition: width 0ms;
  }
  .dash-storage-fill::after {
    animation: none;
  }
  .dash-buy-btn.is-urgent {
    animation: none;
  }
}

/* ── File list rows ─────────────────────────────────────────────────── */

.files-section {
  background: var(--surface);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--border);
}

.files-header-right {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.files-header-left {
  flex-shrink: 0;
}

.files-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.files-count {
  background: var(--border-2);
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--border);
  transition: background 150ms ease;
  position: relative;
  isolation: isolate;
}

.file-row:last-child {
  border-bottom: none;
}

.file-row:hover {
  background: var(--surface-2, rgba(255,255,255,0.03));
}

.file-row:hover .file-row-more-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.file-row:hover .file-action-copy {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.file-row--expired {
  display: none;
}

.file-row--expired.is-shown {
  display: flex;
  opacity: 0.45;
}

.file-row--expired.is-shown:hover {
  opacity: 0.7;
}

.file-row--fresh {
  animation: rowFadeIn 400ms ease forwards;
}

@keyframes rowFadeIn {
  from { background: color-mix(in srgb, var(--accent) 12%, transparent); transform: translateX(8px); }
  to   { background: transparent; transform: translateX(0); }
}

.file-row-icon {
  flex-shrink: 0;
}

.file-type-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--border-2);
  font-family: inherit;
}

.file-type-badge--bundle {
  background: var(--bg);
  border: 1px solid var(--border-2);
  color: var(--ink-3);
}

.file-row-main {
  flex: 1;
  min-width: 0;
}

.file-row-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.file-row-meta {
  font-size: 0.75rem;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: var(--s1);
  flex-wrap: wrap;
}

.expiry-warn {
  color: #f59e0b;
  font-weight: 600;
}

.file-row-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-shrink: 0;
}

.file-action-copy {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

.file-row-more-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: all 150ms ease;
}

.file-action-btn {
  padding: 5px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
  white-space: nowrap;
}

.file-action-btn:hover {
  background: var(--border-2);
  color: var(--ink);
}

.file-action-btn--danger:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

.expired-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: 100%;
  padding: var(--s3) var(--s5);
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 150ms, background 150ms;
}

.expired-toggle:hover {
  background: var(--surface-2, rgba(255,255,255,0.02));
  color: var(--ink-2);
}

.expired-toggle-chevron {
  transition: transform 250ms ease;
}

.expired-toggle.is-open .expired-toggle-chevron {
  transform: rotate(180deg);
}

.share-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.share-toggle-input {
  display: none;
}

.share-toggle-track {
  width: 32px;
  height: 18px;
  background: var(--border-2);
  border-radius: 99px;
  position: relative;
  transition: background 200ms ease;
}

.share-toggle-track::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  right: 3px;
  transition: transform 200ms ease;
}

.share-toggle-input:checked + .share-toggle-track {
  background: var(--accent);
}

.share-toggle-input:checked + .share-toggle-track::after {
  transform: translateX(-14px);
}

.dl-count {
  color: var(--ink-2);
  font-weight: 600;
}

.files-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s8) var(--s5);
  text-align: center;
}

@media (max-width: 640px) {

  .file-row {
    flex-wrap: wrap;
    padding: var(--s3) var(--s3);
    gap: var(--s2);
    cursor: pointer;
  }

  .file-row-icon {
    flex-shrink: 0;
  }

  .file-row-main {
    flex: 1;
    min-width: 0;
  }

  .file-row-actions {
    flex-shrink: 0;
    align-items: center;
  }

  .file-row-more-actions {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    width: 100%;
    padding-top: var(--s2);
    border-top: 1px solid var(--border);
    margin-top: var(--s2);
    display: none;
  }

  .file-row--touch-expanded .file-row-more-actions {
    display: flex;
  }

  .file-action-copy span {
    display: none;
  }

  .file-action-copy {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .file-action-btn {
    min-height: 36px;
    padding: var(--s2) var(--s3);
  }

  .file-row::after {
    content: '\203A';
    position: absolute;
    bottom: var(--s2);
    left: var(--s3);
    color: var(--ink-3);
    font-size: 0.7rem;
    transition: transform 200ms ease;
  }

  .file-row--touch-expanded::after {
    transform: rotate(90deg);
  }
}

/* ── Dashboard upload section (two-zone) ────────────────────────────── */

.dash-upload-new {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s5) var(--s6);
}

.du-idle {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s4);
  align-items: stretch;
  min-height: 200px;
}

.du-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  padding: var(--s6) var(--s5);
  border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: center;
  transition: all 250ms ease;
  animation: zonePulse 2.5s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.du-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 300ms ease;
  border-radius: inherit;
}

.du-zone:hover::before,
.du-zone.dragover::before {
  opacity: 1;
}

.du-zone:hover,
.du-zone.dragover {
  border-color: var(--accent);
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: none;
}

.du-zone-icon {
  width: 52px;
  height: 52px;
  color: var(--accent);
  opacity: 0.85;
}

.du-zone-icon--stack {
  color: var(--ink-2);
}

.du-zone-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.du-zone-sub {
  font-size: 0.875rem;
  color: var(--ink-3);
}

.du-pick-link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.du-pick-link:hover {
  text-decoration: underline;
}

.du-zone-limit {
  font-size: 0.75rem;
  color: var(--ink-3);
  margin-top: var(--s1);
}

.du-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--s3);
  position: relative;
}

.du-divider::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
}

.du-divider span {
  background: var(--surface);
  color: var(--ink-3);
  font-size: 0.75rem;
  padding: var(--s1) var(--s2);
  position: relative;
  z-index: 1;
}

.du-selected {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.du-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s2);
}

.du-selected-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-3);
}

.du-reset-btn {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 0.85rem;
  padding: var(--s1) var(--s2);
  border-radius: var(--r-sm);
  transition: color 150ms, background 150ms;
}

.du-reset-btn:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.08);
}

.du-controls {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-top: var(--s2);
}

.du-upload-btn {
  width: 100%;
  padding: var(--s3) var(--s4);
  font-size: 1rem;
  font-weight: 700;
}

.du-uploading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) 0;
}

.du-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) 0;
}

.du-done-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.du-another-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  padding: var(--s2);
  margin-top: var(--s1);
}

.du-another-btn:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .du-idle {
    grid-template-columns: 1fr;
  }
  .du-divider {
    flex-direction: row;
    height: auto;
    padding: var(--s2) 0;
  }
  .du-divider::before {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: 1px;
    transform: translateY(-50%);
  }
}

/* ── Uploading ring + shimmer ───────────────────────────────────────── */

.du-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto var(--s4);
  flex-shrink: 0;
}

.du-ring-svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.du-ring-bg {
  fill: none;
  stroke: var(--border-2);
  stroke-width: 6;
}

.du-ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 376.99;
  stroke-dashoffset: 376.99;
  transition: stroke-dashoffset 600ms ease;
}

.du-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.du-ring-pct {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.du-ring-label {
  font-size: 0.7rem;
  color: var(--ink-3);
  font-weight: 500;
}

.du-file-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  max-width: 100%;
  overflow: hidden;
}

.du-file-ext-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.du-file-name-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.du-shimmer-track {
  width: 100%;
  max-width: 480px;
  height: 8px;
  background: var(--border-2);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

.du-shimmer-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
  transition: width 500ms ease;
  min-width: 8px;
}

.du-shimmer-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmerSlide 1.5s ease-in-out infinite;
}

@keyframes shimmerSlide {
  0%   { left: -60%; }
  100% { left: 110%; }
}

.du-meta-chips {
  display: flex;
  gap: var(--s3);
  justify-content: center;
  flex-wrap: wrap;
}

.du-chip {
  display: flex;
  align-items: center;
  gap: var(--s1);
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: var(--s1) var(--s3);
  font-size: 0.8rem;
  color: var(--ink-2);
  font-weight: 500;
}

.du-chip-icon {
  font-size: 0.85rem;
  color: var(--accent);
  line-height: 1;
}

.dash-upload-new.is-uploading {
  animation: uploadingPulse 3s ease-in-out infinite;
}

@keyframes uploadingPulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 20px color-mix(in srgb, var(--accent) 15%, transparent); }
}

/* ── Reduced motion ─────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .upload-overlay { transition: none; }
  .upload-overlay-icon { animation: none; }
  .upload-zone { animation: none; transition: none; }
  .du-zone { animation: none; transition: none; }
  .du-zone:hover { transform: none; }
  .du-shimmer-fill::after { animation: none; }
  .dash-upload-new.is-uploading { animation: none; }
  .du-ring-progress { transition: none; }
  .upload-done-check polyline { animation: none; stroke-dashoffset: 0; }
  .upload-progress-bar { transition: none; }
}

/* Legacy assistant shell (.ai-modal-overlay) — not used on dashboard */
.ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.ai-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.ai-modal-overlay .ai-modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-12px) scale(0.97);
  transition: transform 200ms ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4),
              0 8px 24px rgba(0,0,0,0.3);
}
.ai-modal-overlay.is-open .ai-modal {
  transform: translateY(0) scale(1);
}
/* Header */
.ai-modal-header {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-modal-close {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  transition: color 150ms, background 150ms;
  flex-shrink: 0;
  display: flex;
}
.ai-modal-close:hover {
  color: var(--ink);
  background: var(--border-2);
}
.ai-modal-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.ai-modal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  direction: rtl;
  text-align: right;
}
.ai-modal-input::placeholder {
  color: var(--ink-3);
}
.ai-modal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  animation: aiDotPulse 2s ease-in-out infinite;
}
@keyframes aiDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
/* Body */
.ai-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s4);
  min-height: 160px;
}
/* Suggestions */
.ai-modal-suggestions-label {
  font-size: 0.75rem;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: var(--s3);
  text-align: right;
}
.ai-modal-suggestion {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: var(--s3) var(--s3);
  background: none;
  border: none;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  text-align: right;
  direction: rtl;
  transition: background 100ms;
}
.ai-modal-suggestion:hover {
  background: var(--bg);
  color: var(--ink);
}
.ai-modal-suggestion-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
/* Conversation */
.ai-modal-conversation {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.ai-msg-user {
  text-align: right;
  direction: rtl;
}
.ai-msg-user-bubble {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-lg) var(--r-sm) var(--r-lg) var(--r-lg);
  font-size: 0.875rem;
  max-width: 85%;
  word-break: break-word;
  text-align: right;
}
.ai-msg-assistant {
  text-align: right;
  direction: rtl;
}
.ai-msg-assistant-bubble {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm) var(--r-lg) var(--r-lg) var(--r-lg);
  font-size: 0.875rem;
  max-width: 85%;
  word-break: break-word;
  line-height: 1.6;
  text-align: right;
}
.ai-modal-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s3);
  padding: var(--s2) var(--s4);
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-lg);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 600;
  font-family: inherit;
  transition: opacity 150ms ease;
  direction: rtl;
}
.ai-modal-cta:hover {
  opacity: 0.85;
  color: #fff;
}
.ai-modal-quick-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s2);
  justify-content: flex-end;
}
.ai-modal-quick-chip {
  padding: 4px 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 99px;
  background: transparent;
  cursor: pointer;
  font-size: 0.775rem;
  font-family: inherit;
  transition: all 150ms;
}
.ai-modal-quick-chip:hover {
  background: var(--accent);
  color: #fff;
}
/* Thinking dots */
.ai-modal-thinking {
  display: flex;
  gap: 5px;
  padding: var(--s3) 0;
  justify-content: flex-end;
}
.ai-modal-dot-anim {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: aiDotBounce 1.2s ease-in-out infinite;
  opacity: 0.5;
}
.ai-modal-dot-anim:nth-child(2) { animation-delay: 0.2s; }
.ai-modal-dot-anim:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDotBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}
/* Footer */
.ai-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s2) var(--s4);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-modal-hint {
  font-size: 0.72rem;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.ai-modal-hint kbd {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.65rem;
  font-family: monospace;
  color: var(--ink-2);
}
.ai-modal-hint-sep {
  color: var(--border-2);
}
.ai-modal-powered {
  font-size: 0.7rem;
  color: var(--ink-3);
}
/* Mobile */
@media (max-width: 640px) {
  .ai-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .ai-modal-overlay .ai-modal {
    max-width: 100%;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 75vh;
    transform: translateY(100%);
  }
  .ai-modal-overlay.is-open .ai-modal {
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ai-modal-overlay { transition: none; }
  .ai-modal { transition: none; }
  .ai-modal-dot { animation: none; }
  .ai-modal-dot-anim { animation: none; }
}
