:root {
  --bg-page: #ffffff;
  --bg-subtle: #f4f4f5;
  --bg-header: rgba(250, 250, 250, 0.9);
  --bg-sidebar: rgba(250, 250, 250, 0.7);
  --bg-card: #ffffff;
  --bg-hover: #f4f4f5;
  --bg-active: #e4e4e7;
  --bg-blue-soft: rgba(239, 246, 255, 0.85);
  --bg-emerald-soft: rgba(236, 253, 245, 0.85);
  --bg-rose-soft: rgba(255, 241, 242, 0.85);
  --bg-amber-soft: rgba(255, 251, 235, 0.9);
  --bg-modal: #ffffff;
  --border-color: #e4e4e7;
  --border-subtle: #f4f4f5;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-blue: #2563eb;
  --text-emerald: #047857;
  --text-rose: #e11d48;
  --text-amber: #b45309;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

html.dark {
  --bg-page: #09090b;
  --bg-subtle: #18181b;
  --bg-header: rgba(24, 24, 27, 0.75);
  --bg-sidebar: rgba(24, 24, 27, 0.45);
  --bg-card: #09090b;
  --bg-hover: #18181b;
  --bg-active: #27272a;
  --bg-blue-soft: rgba(23, 37, 84, 0.45);
  --bg-emerald-soft: rgba(6, 78, 59, 0.3);
  --bg-rose-soft: rgba(76, 5, 25, 0.35);
  --bg-amber-soft: rgba(69, 26, 3, 0.4);
  --bg-modal: #18181b;
  --border-color: #27272a;
  --border-subtle: rgba(39, 39, 42, 0.6);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-blue: #60a5fa;
  --text-emerald: #34d399;
  --text-rose: #fb7185;
  --text-amber: #fbbf24;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.55), 0 8px 10px -6px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 13px;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.35);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.6);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-page);
}

/* Header */
.topbar {
  height: 48px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-header);
  backdrop-filter: blur(8px);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand-title {
  background: linear-gradient(to right, #2563eb, #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

html.dark .brand-title {
  background: linear-gradient(to right, #60a5fa, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
}

.upstream-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  max-width: 280px;
  transition: border-color 0.15s, background 0.15s;
}

.upstream-chip:hover {
  border-color: var(--text-blue);
  color: var(--text-primary);
}

.upstream-chip span.url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.stats-bar b {
  color: var(--text-primary);
}

.divider-v {
  width: 1px;
  height: 16px;
  background: var(--border-color);
}

/* Main 3-column Workbench */
.workbench {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.sidebar {
  width: 272px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  overflow: hidden;
}

.mail-list-col {
  width: 350px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid var(--border-color);
  background: var(--bg-page);
  overflow: hidden;
}

.mail-display-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-page);
  overflow: hidden;
}

.accounts-full-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-page);
  overflow: hidden;
}

/* Buttons & Inputs */
button {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  color: var(--text-rose);
  border-color: rgba(225, 29, 72, 0.35);
}

.btn-danger:hover:not(:disabled) {
  background: var(--bg-rose-soft);
}

.btn-warn {
  color: var(--text-amber);
  border-color: rgba(180, 83, 9, 0.35);
  background: var(--bg-amber-soft);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-xs {
  padding: 3px 7px;
  font-size: 11px;
  border-radius: 5px;
}

.btn-icon {
  padding: 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.input, .select, .textarea {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.textarea {
  resize: vertical;
  line-height: 1.5;
}

/* Account Switcher */
.switcher-box {
  position: relative;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.switcher-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.pill-count {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.switcher-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-align: left;
  transition: background 0.15s;
}

.switcher-trigger:hover {
  background: var(--bg-active);
}

.switcher-dropdown {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% - 4px);
  z-index: 60;
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.switcher-list {
  max-height: 270px;
  overflow-y: auto;
}

.switcher-item {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.switcher-item:hover {
  background: var(--bg-hover);
}

.switcher-item.active {
  background: var(--bg-blue-soft);
}

/* Status Dots & Badges */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  flex-shrink: 0;
  display: inline-block;
}

.dot-all { background: #3b82f6; }
.dot-active { background: #10b981; }
.dot-empty { background: #9ca3af; }
.dot-expired { background: #f43f5e; }
.dot-fetching { background: #f59e0b; animation: pulse 1.2s infinite; }
.dot-idle { background: #71717a; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-active { background: var(--bg-emerald-soft); color: var(--text-emerald); }
.badge-expired { background: var(--bg-rose-soft); color: var(--text-rose); }
.badge-empty { background: var(--bg-subtle); color: var(--text-muted); }
.badge-fetching { background: var(--bg-amber-soft); color: var(--text-amber); }
.badge-idle { background: var(--bg-subtle); color: var(--text-secondary); }
.badge-blue { background: var(--bg-blue-soft); color: var(--text-blue); font-weight: 600; }

/* Navigation */
.nav-section {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-btn.active.radar {
  background: var(--bg-blue-soft);
  color: var(--text-blue);
  border-color: rgba(37, 99, 235, 0.25);
}

.sidebar-card {
  margin: 0 12px 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-tile {
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
}

.stat-tile.ok {
  background: var(--bg-emerald-soft);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--text-emerald);
}

.stat-tile.err {
  background: var(--bg-rose-soft);
  border-color: rgba(244, 63, 94, 0.25);
  color: var(--text-rose);
}

.stat-tile .num {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

/* Toggle Switch */
.switch {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 9999px;
  border: 0;
  padding: 2px;
  background: #d4d4d8;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
}

html.dark .switch {
  background: #3f3f46;
}

.switch.on {
  background: var(--accent);
}

.switch-knob {
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: #ffffff;
  transition: transform 0.2s;
}

.switch.on .switch-knob {
  transform: translateX(16px);
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.preset-btn {
  padding: 3px 0;
  font-size: 10px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.preset-btn.active {
  background: var(--bg-blue-soft);
  color: var(--text-blue);
  border-color: rgba(37, 99, 235, 0.4);
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-header);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

/* Mail List */
.list-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-wrap {
  position: relative;
  flex: 1;
}

.search-wrap svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap .input {
  padding-left: 30px;
}

.subtabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-subtle);
  border-radius: 8px;
}

.subtab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.subtab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.mail-cards {
  flex: 1;
  overflow-y: auto;
}

.mail-card {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}

.mail-card:hover {
  background: var(--bg-hover);
}

.mail-card.selected {
  background: var(--bg-blue-soft);
  border-left-color: var(--accent);
}

.mail-card.unread .mail-card-sender,
.mail-card.unread .mail-card-subject {
  font-weight: 700;
}

.mail-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.mail-card-sender {
  font-size: 12px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-card-time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.mail-card-subject {
  font-size: 12px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.mail-card-preview {
  font-size: 11px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  margin-bottom: 8px;
}

.mail-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mail-target-pill {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mail Display */
.alert-expired {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-rose-soft);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--text-rose);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.display-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.display-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.display-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.code-card {
  padding: 10px 14px;
  background: var(--bg-blue-soft);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.code-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-blue);
  user-select: all;
}

.view-tabs {
  display: flex;
  gap: 6px;
}

.view-tab {
  padding: 4px 10px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.view-tab.active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.display-body {
  flex: 1;
  padding: 12px 16px;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mail-iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
}

.mail-pre {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.6;
}

/* Account Manager Table */
.manager-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.table-scroll {
  flex: 1;
  overflow: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

table.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

table.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.tag-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 500;
  background: var(--bg-blue-soft);
  color: var(--text-blue);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

/* Empty & Welcome Card */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  overflow-y: auto;
}

.welcome-card {
  width: 100%;
  max-width: 620px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

.welcome-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.welcome-card p {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-panel {
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.modal-header p {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.input-group {
  display: flex;
  gap: 6px;
}

.input-group .input {
  flex: 1;
}

.dropzone {
  border: 1.5px dashed var(--border-color);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--bg-blue-soft);
}

.preview-box {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: auto;
  max-height: 150px;
}

.log-box {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 11px;
  max-height: 110px;
  overflow-y: auto;
  color: var(--text-secondary);
}

/* Toast */
.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #18181b;
  color: #ffffff;
  font-size: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.toast.ok { border-left: 3px solid #10b981; }
.toast.err { border-left: 3px solid #f43f5e; }
.toast.warn { border-left: 3px solid #f59e0b; }

.hidden {
  display: none !important;
}

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

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

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

@media (max-width: 1024px) {
  .sidebar { width: 235px; }
  .mail-list-col { width: 290px; }
}

@media (max-width: 768px) {
  html, body { overflow: auto; }
  .workbench { flex-direction: column; overflow: visible; height: auto; }
  .sidebar, .mail-list-col, .mail-display-col { width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--border-color); }
  .mail-display-col { min-height: 460px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-bar { display: none; }
}
