@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: #5B7FD4;
  --accent-dark: #4d6fbe;
  --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;
}

@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: #5B7FD4;
    --accent-dark: #4d6fbe;
    --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(91, 127, 212, 0.12);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s6);
}

/* ── NAVBAR SHELL ── */
.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;
}

.upload-file-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.upload-file-item:last-child {
  border-bottom: none;
}

.upload-file-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-2);
  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(91, 127, 212, 0.35);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.upload-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(91, 127, 212, 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(91, 127, 212, 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 hero header ──────────────────────────────────────────── */

.dash-hero {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--s5) var(--s6);
  margin-bottom: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.dash-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
}

.dash-hero-greeting {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.dash-hero-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  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-shrink: 0;
}

.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;
  animation: urgentPulse 2s ease-in-out infinite;
}

@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 0 4px rgba(239,68,68,0.15); }
}

.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.8rem;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.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-stats {
  display: flex;
  align-items: center;
  gap: 0;
  padding: var(--s3) 0;
  border-top: 1px solid var(--border);
}

.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.dash-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.dash-stat-label {
  font-size: 0.7rem;
  color: var(--ink-3);
  font-weight: 500;
  white-space: nowrap;
}

.dash-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .dash-hero {
    padding: var(--s4);
    gap: var(--s4);
  }
  .dash-hero-name {
    font-size: 1.2rem;
  }
  .dash-hero-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: var(--s2);
  }
  .dash-stat-label {
    font-size: 0.65rem;
  }
}

@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: rgba(99,102,241,0.12); 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-radius: var(--r-xl);
  padding: var(--s6);
  margin-bottom: var(--s5);
}

.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, rgba(99,102,241,0.08) 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(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 1px var(--accent);
  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: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.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.75rem;
}

.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 var(--accent), 0 0 24px rgba(99,102,241,0.15); }
}

/* ── 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; }
}

/* AI TRIGGER BUTTON */
.ai-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px var(--s3);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 99px;
  color: var(--ink-3);
  font-size: 0.775rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms ease;
  margin-top: var(--s3);
}
.ai-trigger:hover {
  border-color: var(--accent);
  color: var(--ink-2);
}
.ai-trigger-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
.ai-trigger-shortcut {
  background: var(--border-2);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.7rem;
  font-family: monospace;
}
/* AI MODAL */
.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; }
}
