/* ==============================================================================
   Qesh22 Webmail — Design tokens & primitives (Phase 5)
   ==============================================================================
   Source of truth: the Qesh22 back office (Downloads/Qesh22/Qesh22/app,
   read-only): tailwind.config.js + src/styles/index.css (`:root` warm-white
   system) + src/styles/fonts.css + src/components/ui/{Button,Field,Badge}.tsx.

     Font     Vazirmatn variable (the face all Persian is actually drawn in)
     Ground   warm white #FBF9F8, cards #FFFFFF, hairline #E3DED3
     Ink      #1B1C1C, secondary #5C5749, muted #8A8378
     Accent   warm gold #D4AF37 (fill), #735C00 (gold text), #FDF8E7 (gold-50)
     Status   success #12805C, warning #B07207, error #BA1A1A, info #2B5F9E
     Radius   8 / 12 / 16 px controls, 24 px cards — soft, never sharp
     Shadow   ambient, low contrast
     Icons    Remix Icon (inline subset, js/icons.js)

   The Webmail keeps a deliberately small token set; components below use only
   these variables. Dark theme is a Webmail adaptation of the same roles (the
   back office ships light only); the email reading canvas stays white.
   ============================================================================== */

/* Vazirmatn variable, vendored unchanged from the Qesh22 store
   (public/media/fonts/vazirmatn-wght-normal.woff2, OFL-1.1, licence beside it).
   One file covers every weight used (400/500/600/700). */
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn-wght-normal.woff2") format("woff2-variations"),
       url("/fonts/vazirmatn-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Typography */
  --font-sans: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 0.75rem;     /* 12 label-sm */
  --text-sm: 0.8125rem;   /* 13 metadata */
  --text-base: 0.875rem;  /* 14 body-sm / label-md (Qesh22 admin body) */
  --text-md: 1rem;        /* 16 body-md / title-sm */
  --text-lg: 1.125rem;    /* 18 title-md */
  --text-xl: 1.25rem;     /* 20 title-lg */
  --text-2xl: 1.5rem;     /* 24 headline-md */

  /* Surfaces */
  --bg-canvas: #fbf9f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f6f3f2;        /* surface-container-low */
  --bg-muted: #f0eded;         /* surface-container */
  --bg-hover: #f6f3f2;
  --bg-active: #fdf8e7;        /* gold-50 */

  /* Ink */
  --text-primary: #1b1c1c;
  --text-secondary: #5c5749;
  --text-muted: #6f685d;       /* labels/meta only, never body copy; Phase 6 a11y: >=4.5:1 on every light surface (was #8a8378) */

  /* Lines */
  --border-subtle: #ece8e0;
  --border-medium: #e3ded3;    /* outline-variant */
  --border-strong: #cfc7b7;

  /* Brand accent (warm gold) */
  --accent: #d4af37;
  --accent-hover: #c5a030;
  --accent-active: #a88827;
  --accent-text: #735c00;      /* gold ink on light ground */
  --accent-soft: #fdf8e7;
  --accent-border: #fbf0c6;
  /* Phase 6 a11y: white on #d4af37 is 2.1:1 (WCAG AA needs 4.5:1); ink is 8.1:1,
     the same pairing the dark theme and the email CTA buttons already use. */
  --on-accent: #1b1c1c;

  /* Status (container + ink pairs, Qesh22 Badge tones) */
  --success: #12805c;  --success-soft: #d7f3e7;  --success-ink: #0a5540;
  --warning: #b07207;  --warning-soft: #fff0d2;  --warning-ink: #7a4e00;
  --danger:  #ba1a1a;  --danger-soft:  #ffdad6;  --danger-ink:  #93000a;
  --info:    #2b5f9e;  --info-soft:    #dceafb;  --info-ink:    #17406f;

  /* Radius / shadow / motion */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(32, 26, 5, 0.06);
  --shadow-md: 0 4px 40px rgba(32, 26, 5, 0.05);         /* ambient */
  --shadow-lg: 0 24px 80px -24px rgba(32, 26, 5, 0.28);  /* overlay */
  --shadow-gold: 0 10px 30px -12px rgba(212, 175, 55, 0.55);
  --focus-ring: 0 0 0 3px rgba(212, 175, 55, 0.35);
  --transition-fast: 120ms cubic-bezier(0.2, 0, 0, 1);
  --transition-normal: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Email reading canvas: always white (sender HTML assumes it) */
  --email-canvas-bg: #ffffff;
  --email-canvas-text: #1b1c1c;

  /* Aliases still referenced by inline styles in older views */
  --border: var(--border-medium);
  --bg-primary: var(--bg-surface);
  --bg-secondary: var(--bg-subtle);
  --bg-tertiary: var(--bg-muted);

  /* Layout */
  --header-h: 60px;
  --sidebar-width: 248px;
  --list-width: 380px;
}

/* Dark: same roles on a warm near-black ground; gold stays the accent. */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #141311;
  --bg-surface: #1c1b19;
  --bg-subtle: #23221f;
  --bg-muted: #2a2926;
  --bg-hover: #26241f;
  --bg-active: #2f2814;
  --text-primary: #f1eee8;
  --text-secondary: #cfc8b9;
  --text-muted: #a39c8e;
  --border-subtle: #2c2a26;
  --border-medium: #3a3731;
  --border-strong: #514c43;
  --accent-text: #e9c349;
  --accent-soft: #2f2814;
  --accent-border: #4a3d12;
  --on-accent: #1b1c1c;
  --success: #3fbf8d;  --success-soft: #12352a;  --success-ink: #8fe0bf;
  --warning: #e0a43a;  --warning-soft: #3a2a0c;  --warning-ink: #f3cf8c;
  --danger:  #f87171;  --danger-soft:  #3d1616;  --danger-ink:  #fbb4b4;
  --info:    #7aa7e0;  --info-soft:    #162a43;  --info-ink:    #b9d2f2;
  --shadow-md: 0 4px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 80px -24px rgba(0, 0, 0, 0.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg-canvas: #141311;
    --bg-surface: #1c1b19;
    --bg-subtle: #23221f;
    --bg-muted: #2a2926;
    --bg-hover: #26241f;
    --bg-active: #2f2814;
    --text-primary: #f1eee8;
    --text-secondary: #cfc8b9;
    --text-muted: #a39c8e;
    --border-subtle: #2c2a26;
    --border-medium: #3a3731;
    --border-strong: #514c43;
    --accent-text: #e9c349;
    --accent-soft: #2f2814;
    --accent-border: #4a3d12;
    --on-accent: #1b1c1c;
    --success: #3fbf8d;  --success-soft: #12352a;  --success-ink: #8fe0bf;
    --warning: #e0a43a;  --warning-soft: #3a2a0c;  --warning-ink: #f3cf8c;
    --danger:  #f87171;  --danger-soft:  #3d1616;  --danger-ink:  #fbb4b4;
    --info:    #7aa7e0;  --info-soft:    #162a43;  --info-ink:    #b9d2f2;
    --shadow-md: 0 4px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 80px -24px rgba(0, 0, 0, 0.7);
  }
}

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

/* ------------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { font-size: var(--text-base); }

/* Persian cursive must never be letter-spaced */
html[dir="rtl"] body, html[dir="rtl"] body * { letter-spacing: normal; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent-text); }
img, svg { display: block; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
[hidden] { display: none !important; }

/* Accessible focus everywhere (keyboard only) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------------------
   Bidirectional text — direction is applied to the smallest element holding
   LTR data (addresses, URLs, IDs, file names), never to whole cards.
   ------------------------------------------------------------------------------ */
.ltr-text, bdi.ltr, .ltr {
  direction: ltr;
  unicode-bidi: isolate;
}
.ltr-text { text-align: start; }
.rtl-text { direction: rtl; unicode-bidi: isolate; }
.auto-dir { unicode-bidi: plaintext; text-align: start; }
.break-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tabular { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------------------
   Icons (inline SVG, Remix Icon)
   ------------------------------------------------------------------------------ */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: currentColor;
  display: inline-block;
  vertical-align: -0.25em;
}
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
html[dir="rtl"] .icon-rtl-flip { transform: scaleX(-1); }
.icon-spin { animation: q-spin 0.9s linear infinite; }
@keyframes q-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------------------
   Buttons (Qesh22 Button: primary / secondary / ghost / subtle / danger)
   ------------------------------------------------------------------------------ */
.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-subtle, .btn-danger, .btn-danger-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-gold); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-active); }
.btn-primary:disabled { background: var(--accent-border); color: var(--accent-text); box-shadow: none; }

.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1.5px solid var(--border-medium); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.btn-secondary:disabled { opacity: 0.55; }

.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }

.btn-subtle { background: var(--bg-subtle); color: var(--text-primary); }
.btn-subtle:hover:not(:disabled) { background: var(--bg-muted); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }
.btn-danger-soft { color: var(--danger); background: transparent; }
.btn-danger-soft:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger-ink); }

.btn-sm { height: 34px; padding: 0 12px; font-size: var(--text-sm); gap: 6px; border-radius: var(--radius-sm); }
.btn-lg { height: 48px; padding: 0 24px; font-size: var(--text-md); }
.btn-block { width: 100%; }

/* Square icon button (Qesh22 IconButton) — always has an aria-label */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.icon-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn.is-active { background: var(--accent-soft); color: var(--accent-text); }
.icon-btn.danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: 0.45; }
.icon-btn .icon { width: 20px; height: 20px; }

/* ------------------------------------------------------------------------------
   Forms (Qesh22 Field: rounded, gold focus ring)
   ------------------------------------------------------------------------------ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.form-hint { font-size: var(--text-xs); color: var(--text-muted); }
.form-error { font-size: var(--text-xs); color: var(--danger); }

.form-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
textarea.form-input { min-height: 96px; resize: vertical; line-height: 1.7; }
select.form-input { cursor: pointer; }
.form-input::placeholder { color: var(--text-muted); opacity: 1; }
.form-input:hover:not(:disabled) { border-color: var(--border-strong); }
.form-input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); outline: none; }
.form-input:disabled { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; }
.form-input[aria-invalid="true"] { border-color: var(--danger); }
/* Wraps LTR credential fields (password + reveal button): the wrapper follows
   the field's direction so the button and the reserved padding share a side. */
.input-wrapper { position: relative; display: flex; align-items: center; direction: ltr; }
.input-wrapper .form-input { padding-inline-end: 46px; }
.input-wrapper .input-adornment { position: absolute; inset-inline-end: 4px; }

/* ------------------------------------------------------------------------------
   Badges / status (Qesh22 Badge tones). Text always accompanies color.
   ------------------------------------------------------------------------------ */
.badge, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}
.badge .icon { width: 14px; height: 14px; }
.badge-success, .status-pill.active { background: var(--success-soft); color: var(--success-ink); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning-ink); border-color: transparent; }
.badge-danger, .status-pill.disabled, .status-pill.danger { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.badge-info, .status-pill.session { background: var(--info-soft); color: var(--info-ink); border-color: transparent; }
.badge-gold { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-border); }
.badge-neutral { }

.count {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------------------
   Surfaces
   ------------------------------------------------------------------------------ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Inline notices (non-blocking) */
.notice, .alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.notice .icon { width: 18px; height: 18px; margin-top: 1px; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { font-weight: 600; color: var(--text-primary); }
.notice-info { background: var(--info-soft); color: var(--info-ink); border-color: transparent; }
.notice-warning { background: var(--warning-soft); color: var(--warning-ink); border-color: transparent; }
.notice-danger, .alert-danger { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.notice-success { background: var(--success-soft); color: var(--success-ink); border-color: transparent; }
.notice-gold { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-border); }
.notice .notice-title { color: inherit; }

/* ------------------------------------------------------------------------------
   Loading / empty states
   ------------------------------------------------------------------------------ */
.skeleton {
  display: block;
  height: 12px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-subtle) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: q-shimmer 1.4s ease-in-out infinite;
}
@keyframes q-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.state-panel, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 48px 24px;
  color: var(--text-secondary);
  height: 100%;
  min-height: 220px;
}
.state-icon, .empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.state-icon .icon { width: 26px; height: 26px; }
.state-panel.is-error .state-icon { background: var(--danger-soft); color: var(--danger); }
.state-panel.is-warning .state-icon { background: var(--warning-soft); color: var(--warning); }
.state-title, .empty-state-title { font-size: var(--text-md); font-weight: 600; color: var(--text-primary); }
.state-text, .empty-state-subtitle { font-size: var(--text-sm); max-width: 360px; line-height: 1.7; }
.state-panel .btn-secondary, .state-panel .btn-primary { margin-top: 10px; }

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  border-top-color: var(--accent);
  animation: q-spin 0.8s linear infinite;
}
.loading-inline { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: var(--text-sm); }

/* ------------------------------------------------------------------------------
   Modals (shared). Full-screen sheets on phones.
   ------------------------------------------------------------------------------ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(27, 28, 28, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: q-fade 160ms ease-out both;
}
@keyframes q-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-dialog {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: q-rise 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes q-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal-dialog-lg { max-width: 720px; }
.modal-dialog-xl { max-width: 1100px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title { font-size: var(--text-lg); font-weight: 600; color: var(--text-primary); }
.modal-subtitle { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.modal-close-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  flex-shrink: 0;
}
.modal-close-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.modal-footer .spacer { flex: 1; }
form > .modal-body + .modal-footer { flex-shrink: 0; }
.modal-dialog > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }

/* Confirmation dialog */
.confirm-dialog { max-width: 420px; }
.confirm-dialog .modal-body { display: flex; gap: 14px; align-items: flex-start; }
.confirm-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.confirm-dialog.is-danger .confirm-icon { background: var(--danger-soft); color: var(--danger); }
.confirm-message { font-size: var(--text-base); color: var(--text-primary); line-height: 1.8; }
.confirm-detail { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 4px; }

@media (max-width: 640px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-dialog, .modal-dialog-lg, .modal-dialog-xl {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .modal-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-footer .btn-primary, .modal-footer .btn-secondary, .modal-footer .btn-danger { flex: 1; }
}

/* ------------------------------------------------------------------------------
   Toasts — short-lived confirmations; aria-live region
   ------------------------------------------------------------------------------ */
.toast-container {
  position: fixed;
  z-index: 11000;
  inset-block-end: 20px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}
html[dir="rtl"] .toast-container { transform: translateX(50%); }
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius-md);
  background: #1f1e1c;
  color: #f6f3f2;
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  line-height: 1.6;
  animation: q-rise 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.toast .icon { width: 18px; height: 18px; margin-top: 1px; }
.toast-success .icon { color: #6ee7b7; }
.toast-warning .icon { color: #fcd34d; }
.toast-danger .icon { color: #fca5a5; }
.toast-info .icon { color: #e9c349; }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-close { color: #bdb6a8; width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.toast-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all 180ms ease; }
