/* موقت‌نامه — استایل رابط کاربری (بدون وابستگی به فریم‌ورک) */

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

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink-950: #080a0e;
  --ink-900: #0d1016;
  --ink-850: #12161d;
  --ink-800: #171c25;
  --ink-700: #222834;
  --ink-600: #2f3745;
  --ink-500: #475064;
  --ink-400: #7a8499;
  --ink-300: #a7b0c1;
  --ink-200: #d3d9e3;
  --ink-100: #eef1f6;
  --accent: #b5f24a;
  --accent-strong: #9bd92f;
  --rose-300: #fda4af;
  --line: rgba(34, 40, 52, 0.7);
  --font-sans: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-100);
  background-color: var(--ink-950);
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, rgba(181, 242, 74, 0.07), transparent 60%),
    radial-gradient(50rem 35rem at 0% 0%, rgba(56, 189, 248, 0.06), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--ink-950);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-600) transparent;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon.lg {
  width: 24px;
  height: 24px;
}

.icon.spin {
  animation: spin 1s linear infinite;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid rgba(167, 176, 193, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.sm {
  width: 14px;
  height: 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

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

.mono {
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------------ */
/*  دکمه‌ها                                                            */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  color: var(--ink-100);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn.sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.btn.primary {
  background: var(--accent);
  color: var(--ink-950);
  font-weight: 600;
  box-shadow: 0 0 24px rgba(181, 242, 74, 0.18);
}

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

.btn.subtle {
  background: var(--ink-800);
  border-color: var(--ink-700);
}

.btn.subtle:hover {
  background: var(--ink-700);
}

.btn.ghost {
  color: var(--ink-300);
}

.btn.ghost:hover {
  background: var(--ink-800);
  color: var(--ink-100);
}

.btn.danger {
  color: var(--rose-300);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn.danger:hover {
  background: rgba(244, 63, 94, 0.1);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.seg:focus-visible,
.link:focus-visible,
.msg-main:focus-visible,
.inbox-main:focus-visible,
.count-btn:focus-visible,
.code-chip:focus-visible,
.attachment:focus-visible,
.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink-300);
  transition: background-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--ink-800);
  color: var(--ink-100);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
  text-decoration: none;
}

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

.show-sm {
  display: inline;
}

.hide-sm {
  display: none;
}

@media (min-width: 640px) {
  .show-sm {
    display: none;
  }

  .hide-sm {
    display: inline;
  }
}

/* ------------------------------------------------------------------ */
/*  چیدمان کلی                                                         */
/* ------------------------------------------------------------------ */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

@media (min-width: 1024px) {
  .app {
    height: 100dvh;
    overflow: hidden;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  flex-shrink: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) {
  .topbar {
    padding: 0 20px;
  }
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.icon-btn.mobile-only {
  position: relative;
  border: 1px solid var(--ink-700);
  background: var(--ink-800);
  color: var(--ink-200);
}

@media (min-width: 1024px) {
  .icon-btn.mobile-only {
    display: none;
  }
}

.count-badge {
  position: absolute;
  top: -6px;
  inset-inline-start: -6px;
  display: grid;
  place-items: center;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink-950);
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 0 24px rgba(181, 242, 74, 0.3);
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mode-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 12px;
}

@media (min-width: 640px) {
  .mode-badge {
    display: inline-flex;
  }
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.mode-badge.live {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.mode-badge.demo {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  flex-shrink: 0;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
  font-size: 12px;
}

.banner-link {
  font-weight: 600;
  text-decoration: underline;
}

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 288px;
    flex-shrink: 0;
    border-inline-end: 1px solid var(--line);
  }
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  flex-shrink: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-400);
  font-size: 11px;
}

.footer a {
  text-decoration: none;
}

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

.footer span:last-child a {
  color: var(--accent);
}

.footer span:last-child a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/*  نوار کناری صندوق‌ها                                                */
/* ------------------------------------------------------------------ */

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink-800);
  color: var(--ink-300);
  font-size: 11px;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  padding: 0 8px 12px;
  overflow-y: auto;
}

.sidebar-empty {
  margin: 0;
  padding: 24px 8px;
  text-align: center;
  color: var(--ink-400);
  font-size: 12px;
}

.inbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background-color 0.15s, border-color 0.15s;
}

.inbox-item:hover {
  border-color: var(--ink-700);
  background: rgba(23, 28, 37, 0.7);
}

.inbox-item.active {
  border-color: rgba(181, 242, 74, 0.4);
  background: rgba(181, 242, 74, 0.08);
}

.inbox-main {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: start;
}

.inbox-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inbox-local {
  overflow: hidden;
  color: var(--ink-100);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink-950);
  font-size: 10px;
  font-weight: 700;
}

.inbox-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 11px;
}

.inbox-domain {
  overflow: hidden;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-btn {
  flex-shrink: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-300);
  font-size: 11px;
  font-weight: 600;
}

.confirm-btn:hover {
  background: rgba(244, 63, 94, 0.25);
}

.inbox-del {
  width: 28px;
  height: 28px;
  color: var(--ink-500);
}

.inbox-del:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose-300);
}

@media (min-width: 1024px) {
  .inbox-del {
    opacity: 0;
  }

  .inbox-item:hover .inbox-del,
  .inbox-item:focus-within .inbox-del {
    opacity: 1;
  }
}

/* ------------------------------------------------------------------ */
/*  کارت آدرس                                                          */
/* ------------------------------------------------------------------ */

.address {
  flex-shrink: 0;
  padding: 20px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(13, 16, 22, 0.9), rgba(8, 10, 14, 0.4));
}

@media (min-width: 640px) {
  .address {
    padding: 20px 24px;
  }
}

.address-inner {
  max-width: 768px;
  margin: 0 auto;
  text-align: center;
}

.address-label {
  margin: 0;
  color: var(--ink-400);
  font-size: 12px;
}

.address-value {
  margin: 8px 0 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-all;
  user-select: all;
}

@media (min-width: 640px) {
  .address-value {
    font-size: 24px;
  }
}

@media (min-width: 768px) {
  .address-value {
    font-size: 30px;
  }
}

.address-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.address-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 12px;
  color: var(--ink-400);
  font-size: 12px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.address-meta .link.meta-item {
  color: var(--ink-400);
}

.address-meta .link.meta-item:hover {
  color: var(--ink-200);
  text-decoration: none;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse 2s ease-in-out infinite;
}

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 40vh;
  padding: 48px 24px;
  color: var(--ink-400);
  text-align: center;
}

.boot p {
  margin: 0;
}

.boot-title {
  color: var(--ink-100);
  font-size: 16px;
  font-weight: 700;
}

.boot-text {
  max-width: 420px;
  font-size: 12px;
  line-height: 1.9;
}

.error-text {
  color: var(--rose-300);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--ink-700);
  border-radius: 16px;
  background: var(--ink-850);
  color: var(--ink-400);
}

/* ------------------------------------------------------------------ */
/*  فهرست ایمیل‌ها                                                     */
/* ------------------------------------------------------------------ */

.panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.list-pane,
.detail-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.list-pane {
  border-inline-end: 1px solid var(--line);
}

.panes.show-detail .list-pane {
  display: none;
}

.panes:not(.show-detail) .detail-pane {
  display: none;
}

@media (min-width: 1280px) {
  .panes {
    grid-template-columns: 380px minmax(0, 1fr);
  }

  .panes.show-detail .list-pane,
  .panes:not(.show-detail) .detail-pane {
    display: flex;
  }
}

.list-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) {
  .list-head {
    padding: 12px 16px;
  }
}

.list-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--ink-850);
}

.seg {
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-400);
  font-size: 12px;
  transition: background-color 0.15s, color 0.15s;
}

.seg:hover {
  color: var(--ink-200);
}

.seg.active {
  background: var(--ink-700);
  color: var(--ink-100);
}

.list-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.count-text {
  color: var(--ink-400);
  font-size: 12px;
}

.search {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 12px;
  display: flex;
  color: var(--ink-500);
  transform: translateY(-50%);
}

#search {
  width: 100%;
  height: 36px;
  padding-inline-start: 32px;
  padding-inline-end: 12px;
  border: 1px solid var(--ink-700);
  border-radius: 12px;
  outline: none;
  background: var(--ink-900);
  color: var(--ink-100);
  font-size: 12px;
}

#search::placeholder {
  color: var(--ink-500);
}

#search:focus {
  border-color: rgba(181, 242, 74, 0.6);
}

.list-state {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 24px;
  color: var(--ink-400);
  font-size: 12px;
  text-align: center;
}

.list-state p {
  margin: 0;
}

.state-title {
  color: var(--ink-200);
  font-size: 14px;
  font-weight: 600;
}

.state-text {
  max-width: 320px;
  line-height: 1.9;
}

.list-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(23, 28, 37, 0.8);
  transition: background-color 0.15s;
}

@media (min-width: 640px) {
  .msg {
    padding: 12px 16px;
  }
}

.msg:hover {
  background: rgba(23, 28, 37, 0.4);
}

.msg.selected {
  background: var(--ink-800);
}

.dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.dot.ghost {
  background: transparent;
}

.msg-main {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: start;
}

.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.avatar.lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar.emerald { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.3); }
.avatar.sky { background: rgba(14, 165, 233, 0.15); color: #7dd3fc; border-color: rgba(14, 165, 233, 0.3); }
.avatar.amber { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border-color: rgba(245, 158, 11, 0.3); }
.avatar.violet { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.3); }
.avatar.rose { background: rgba(244, 63, 94, 0.15); color: #fda4af; border-color: rgba(244, 63, 94, 0.3); }
.avatar.teal { background: rgba(20, 184, 166, 0.15); color: #5eead4; border-color: rgba(20, 184, 166, 0.3); }

.msg-body {
  display: block;
  flex: 1;
  min-width: 0;
}

.msg-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.msg-top,
.msg-snippet,
.msg-sender,
.msg-subject,
.msg-snippet-text {
  min-width: 0;
}

.msg-sender,
.msg-subject,
.msg-snippet-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-sender {
  color: var(--ink-200);
  font-size: 14px;
}

.msg.unread .msg-sender {
  color: var(--ink-100);
  font-weight: 700;
}

.msg-time {
  flex-shrink: 0;
  color: var(--ink-400);
  font-size: 11px;
}

.msg-subject {
  display: block;
  margin-top: 2px;
  color: var(--ink-300);
  font-size: 14px;
}

.msg.unread .msg-subject {
  color: var(--ink-100);
  font-weight: 600;
}

.msg-snippet {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 12px;
}

.msg-snippet-text {
  min-width: 0;
}

.msg-snippet .icon {
  width: 12px;
  height: 12px;
}

.msg-del {
  display: none;
  width: 28px;
  height: 28px;
  color: var(--ink-500);
}

.msg:hover .msg-del,
.msg-del:focus-visible {
  display: grid;
}

.msg-del:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose-300);
}

/* ------------------------------------------------------------------ */
/*  نمایش ایمیل                                                        */
/* ------------------------------------------------------------------ */

.detail-state {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50dvh;
  padding: 24px;
  color: var(--ink-300);
  text-align: center;
}

.detail-state p {
  margin: 0;
  max-width: 360px;
}

.detail-head {
  flex-shrink: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) {
  .detail-head {
    padding: 12px 20px;
  }
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-title-row h2 {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .detail-title-row h2 {
    font-size: 18px;
  }
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

@media (min-width: 1280px) {
  .desktop-hide {
    display: none;
  }
}

.detail-sender {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
}

.sender-info {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

.sender-line {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}

.sender-name {
  font-weight: 600;
}

.sender-address {
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-size: 12px;
}

.sender-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-top: 4px;
  color: var(--ink-400);
  font-size: 12px;
}

.codes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(181, 242, 74, 0.3);
  border-radius: 12px;
  background: rgba(181, 242, 74, 0.08);
  color: var(--accent);
}

.codes-label {
  color: var(--ink-300);
  font-size: 12px;
}

.code-chip {
  padding: 4px 10px;
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-900);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.code-chip:hover {
  background: var(--ink-800);
}

.detail-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.detail-tabs-row .link.meta-item {
  color: var(--ink-400);
  font-size: 12px;
}

.detail-tabs-row .link.meta-item:hover {
  color: var(--ink-200);
  text-decoration: none;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--ink-700);
  border-radius: 12px;
  background: var(--ink-850);
  color: var(--ink-200);
  font-size: 12px;
}

.attachment:hover {
  border-color: rgba(181, 242, 74, 0.4);
  background: var(--ink-800);
}

.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-size {
  flex-shrink: 0;
  color: var(--ink-500);
}

.attachment .icon {
  color: var(--ink-400);
}

.detail-body {
  height: 70dvh;
  padding: 12px;
}

@media (min-width: 640px) {
  .detail-body {
    padding: 16px;
  }
}

@media (min-width: 1024px) {
  .detail-body {
    height: auto;
    flex: 1;
    min-height: 0;
  }
}

.email-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.note {
  flex-shrink: 0;
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.email-frame-box {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
}

#email-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.plain-text {
  height: 100%;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--ink-700);
  border-radius: 12px;
  background: var(--ink-900);
  color: var(--ink-200);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.headers {
  height: 100%;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--ink-700);
  border-radius: 12px;
  background: var(--ink-900);
  font-size: 12px;
}

.header-row {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

@media (min-width: 640px) {
  .header-row {
    grid-template-columns: 160px minmax(0, 1fr);
  }
}

.header-row dt {
  color: var(--ink-400);
  font-family: var(--font-mono);
}

.header-row dd {
  margin: 0;
  color: var(--ink-200);
  word-break: break-all;
}

/* ------------------------------------------------------------------ */
/*  پنجره ساخت ایمیل، کشوی موبایل و اعلان                              */
/* ------------------------------------------------------------------ */

.modal-root,
.drawer-root {
  position: fixed;
  inset: 0;
}

.modal-root {
  z-index: 50;
}

.drawer-root {
  z-index: 40;
}

@media (min-width: 1024px) {
  .drawer-root {
    display: none;
  }
}

.modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop,
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 448px;
  padding: 20px;
  border: 1px solid var(--ink-700);
  border-radius: 16px;
  background: var(--ink-900);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-300);
  font-size: 12px;
}

.field-row {
  display: flex;
  gap: 8px;
}

#local-part {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ink-700);
  border-radius: 12px;
  outline: none;
  background: var(--ink-950);
  color: var(--ink-100);
  font-family: var(--font-mono);
  font-size: 14px;
}

#local-part::placeholder {
  color: var(--ink-500);
}

#local-part:focus {
  border-color: rgba(181, 242, 74, 0.6);
}

.hint {
  margin: 6px 0 0;
  color: var(--ink-400);
  font-size: 11px;
}

.hint .mono {
  color: var(--ink-200);
}

.count-row {
  display: flex;
  gap: 8px;
}

.count-btn {
  flex: 1;
  height: 36px;
  border: 1px solid var(--ink-700);
  border-radius: 12px;
  background: var(--ink-850);
  color: var(--ink-300);
  font-size: 14px;
}

.count-btn:hover {
  background: var(--ink-800);
}

.count-btn.active {
  border-color: rgba(181, 242, 74, 0.5);
  background: rgba(181, 242, 74, 0.1);
  color: var(--accent);
  font-weight: 700;
}

.form-error {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.1);
  color: #fecdd3;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.drawer {
  position: absolute;
  inset: 0;
  display: flex;
}

.drawer-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  border-inline-end: 1px solid var(--ink-700);
  background: var(--ink-900);
}

.toast-root {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 60;
  max-width: 384px;
  padding: 10px 16px;
  border: 1px solid rgba(181, 242, 74, 0.4);
  border-radius: 12px;
  background: rgba(23, 28, 37, 0.95);
  color: var(--ink-100);
  font-size: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast-root.show {
  opacity: 1;
  transform: none;
  animation: toast-in 0.2s ease-out;
}

.toast-root.error {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(76, 5, 25, 0.92);
  color: #ffe4e6;
}

/* ------------------------------------------------------------------ */
/*  صفحه راهنما                                                        */
/* ------------------------------------------------------------------ */

.guide-topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.guide-topbar > * {
  max-width: 768px;
}

.guide-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guide-topbar .link {
  color: var(--ink-300);
  font-size: 14px;
}

.guide-topbar .link:hover {
  color: var(--accent);
  text-decoration: none;
}

.guide-brand {
  font-size: 14px;
  font-weight: 800;
}

.guide {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 768px;
  margin: 0 auto;
  padding: 32px 16px;
}

.guide h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

@media (min-width: 640px) {
  .guide h1 {
    font-size: 30px;
  }
}

.guide-lead {
  margin: 8px 0 0;
  color: var(--ink-300);
  font-size: 14px;
  line-height: 2;
}

.card {
  padding: 20px;
  border: 1px solid rgba(34, 40, 52, 0.8);
  border-radius: 16px;
  background: rgba(13, 16, 22, 0.7);
}

@media (min-width: 640px) {
  .card {
    padding: 24px;
  }
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(181, 242, 74, 0.1);
  color: var(--accent);
}

.card p,
.card li {
  color: var(--ink-200);
  font-size: 14px;
  line-height: 2;
}

.card p {
  margin: 0 0 8px;
}

.card ol,
.card ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 8px;
  padding-inline-start: 20px;
}

.card > :last-child {
  margin-bottom: 0;
}

.card code {
  color: var(--accent);
  font-family: var(--font-mono);
  unicode-bidi: isolate;
}

.card .muted {
  color: var(--ink-400);
  font-size: 12px;
}

.code {
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--ink-700);
  border-radius: 12px;
  background: var(--ink-950);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--ink-800);
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.copy-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-400);
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: none;
}

.copy-btn:hover {
  color: var(--ink-100);
}

.code pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  color: var(--ink-200);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
}

.code pre code {
  color: inherit;
}
