/* ═══════════════════════════════════════════════════════════════
   LEGISITE — COMMAND SYSTEM v6
   "The interface should feel like piloting a spacecraft,
    not filling out a spreadsheet."
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* ── The Void ── */
  --bg:           #000000;
  --surface:      #0d0e15; /* Lighter surface for contrast */
  --surface-2:    #151722;
  --surface-edge: rgba(0, 102, 255, 0.20);
  --sidebar-bg:   #040407;

  /* ── Neon Blue (Primary) ── */
  --blue:         #0066ff;
  --blue-rgb:     0, 102, 255;
  --blue-soft:    rgba(0, 102, 255, 0.08);
  --blue-border:  rgba(0, 102, 255, 0.18);
  --blue-glow:    rgba(0, 102, 255, 0.25);

  /* ── Text Strata ── */
  --t1:           #f8fafc;
  --t2:           #cbd5e1; /* Brightened from 94a3b8 for better legibility */
  --t3:           #64748b;
  --t4:           #334155;

  /* ── Status Signals ── */
  --success:      #22c55e;
  --success-soft: rgba(34, 197, 94, 0.1);
  --danger:       #ef4444;
  --danger-soft:  rgba(239, 68, 68, 0.08);
  --warning:      #eab308;
  --warning-soft: rgba(234, 179, 8, 0.08);

  /* ── Geometry ── */
  --r:            14px;
  --r-lg:         20px;
  --r-sm:         8px;
  --sidebar-w:    260px;
  --transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #000000;
  color: var(--t1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 14px;
  padding: 0;
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

.watermark-title {
  text-align: center;
  color: #fff;
  padding-bottom: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

/* ═══ LAYOUT SHELL ═══ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #05050a; /* Extremely dark blue/black */
}

/* ═══ SIDEBAR — Command Rail ═══ */
.sidebar {
  width: var(--sidebar-w);
  background: #020204;
  border-right: 1px solid rgba(0, 102, 255, 0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: auto;
}

/* Glass sheen on top of sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(var(--blue-rgb), 0.05) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.main {
  flex: 1;
  padding: 24px 28px;
  height: 100%;
  overflow-y: auto;
  min-width: 0;
  background: radial-gradient(circle at top right, rgba(0, 102, 255, 0.03) 0%, transparent 40%);
}

/* ── KPI Grid Icons ── */
.kpi-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(var(--blue-rgb), 0.1);
  color: var(--blue);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.kpi-icon-box svg {
  width: 20px;
  height: 20px;
}


/* ── Brand ── */
.brand {
  padding: 28px 24px;
  border-bottom: 1px solid var(--surface-edge);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.brand img {
  width: 38px;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(var(--blue-rgb), 0.3));
  transition: var(--transition);
}
.brand:hover img {
  filter: drop-shadow(0 0 20px rgba(var(--blue-rgb), 0.5));
  transform: scale(1.05);
}

/* ── Navigation ── */
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 14px;
  position: relative;
  z-index: 1;
}

.nav-category {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--t4);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--t3);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav a:hover {
  color: var(--t1);
  background: rgba(255, 255, 255, 0.04);
}
.nav a:hover .nav-icon svg {
  color: var(--blue);
}

.nav a.active {
  color: #fff;
  background: rgba(var(--blue-rgb), 0.1);
  font-weight: 600;
}
.nav a.active .nav-icon svg {
  color: var(--blue);
  filter: drop-shadow(0 0 6px rgba(var(--blue-rgb), 0.4));
}
.nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--blue);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(var(--blue-rgb), 0.5);
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px 14px;
  border-top: 1px solid var(--surface-edge);
  position: relative;
  z-index: 1;
}

/* ═══ DASHBOARD SHELL ═══ */
.dashboard-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 1500px;
}

/* ═══ TYPOGRAPHY ═══ */
h1, h2, h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h1 { font-weight: 800; }

.muted {
  color: var(--t2);
  font-size: 0.85rem;
}

/* ═══ CARDS ═══ */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid rgba(0, 102, 255, 0.25);
  box-shadow: inset 0 0 10px rgba(0, 102, 255, 0.05);
  transition: var(--transition);
  position: relative;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03),
              0 0 0 1px rgba(var(--blue-rgb), 0.1);
}
.card:hover::after {
  opacity: 1;
}
.card:hover {
  border-color: rgba(var(--blue-rgb), 0.15);
}

/* ═══ KPI GRID ═══ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.big-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

/* ═══ PILL STATUS ═══ */
.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--surface-edge);
  color: var(--t2);
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.4;
}

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  color: var(--t2);
  border: 1px solid transparent;
}
.badge.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.2);
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}
.badge.warn {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(234, 179, 8, 0.2);
}
.badge.blue {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue-border);
}

/* ═══ BUTTONS ═══ */
.btn {
  background: var(--blue);
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn:hover {
  background: #1a7aff;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(var(--blue-rgb), 0.3);
}
.btn:hover::before {
  opacity: 1;
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(var(--blue-rgb), 0.2);
}

.btn-primary {
  background: var(--blue);
  box-shadow: 0 0 20px rgba(var(--blue-rgb), 0.15);
}

.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--surface-edge);
  color: var(--t2);
}
.btn-secondary:hover {
  background: rgba(var(--blue-rgb), 0.08);
  border-color: var(--blue-border);
  color: #fff;
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: inherit;
}
.btn-ghost:hover {
  background: var(--blue-soft);
  color: #fff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  border-radius: 8px;
}
.btn-xs {
  padding: 5px 12px;
  font-size: 0.72rem;
  border-radius: 6px;
}

/* ═══ TABLES ═══ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead th {
  text-align: left;
  padding: 14px 16px;
  color: var(--t4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--surface-edge);
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
  color: var(--t2);
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.15s;
}
.table tbody tr:hover {
  background: rgba(var(--blue-rgb), 0.03);
}

/* ═══ FORM ELEMENTS ═══ */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--surface-edge);
  color: var(--t1);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.85rem;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.1);
}

/* ═══ FLASH MESSAGES ═══ */
.flash {
  padding: 14px 20px;
  border-radius: var(--r-sm);
  margin-bottom: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid;
  animation: flashIn 0.4s var(--ease-spring);
}
.flash.success {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.2);
  color: var(--success);
}
.flash.error {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

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

/* ═══ UTILITY CLASSES ═══ */
.flex {
  display: flex;
  align-items: center;
}
.stack {
  display: flex;
  flex-direction: column;
}
.grid {
  display: grid;
}

.mb-xs  { margin-bottom: 4px; }
.mb-sm  { margin-bottom: 8px; }
.mb-md  { margin-bottom: 16px; }
.mb-lg  { margin-bottom: 24px; }
.mt-sm  { margin-top: 8px; }
.mt-md  { margin-top: 16px; }
.mt-lg  { margin-top: 24px; }

.hidden { display: none !important; }
.text-danger { color: var(--danger) !important; }

/* ═══ CHARTS ═══ */
.chart-container {
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 16px;
}

/* Override ApexCharts tooltip for dark theme */
.apexcharts-tooltip {
  background: var(--surface) !important;
  border: 1px solid var(--surface-edge) !important;
  border-radius: 10px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}
.apexcharts-tooltip-title {
  background: var(--surface-2) !important;
  border-bottom-color: var(--surface-edge) !important;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-edge);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--t4);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px rgba(var(--blue-rgb), 0.2); }
  50% { box-shadow: 0 0 20px rgba(var(--blue-rgb), 0.4); }
}

.dashboard-shell > * {
  animation: fadeInUp 0.5s var(--ease-out) both;
}
.dashboard-shell > *:nth-child(1) { animation-delay: 0s; }
.dashboard-shell > *:nth-child(2) { animation-delay: 0.05s; }
.dashboard-shell > *:nth-child(3) { animation-delay: 0.1s; }
.dashboard-shell > *:nth-child(4) { animation-delay: 0.15s; }
.dashboard-shell > *:nth-child(5) { animation-delay: 0.2s; }

/* ═══ OPERATIONS SURFACES ═══ */
.section-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.section-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.section-toolbar-copy h2,
.section-toolbar-copy h3 {
  margin: 0;
  color: #fff;
}

.section-toolbar-copy p {
  margin: 0;
  color: var(--t3);
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: 56ch;
}

.section-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.compact-stat {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compact-stat-label {
  color: var(--t4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.compact-stat-value {
  color: #fff;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1;
}

.compact-stat-note {
  display: none;
}

.toolbar-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  color: var(--t4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.actions.wrap {
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--t2);
  font-size: 0.72rem;
  font-weight: 700;
}

.status-chip.info {
  color: var(--blue);
  border-color: rgba(var(--blue-rgb), 0.18);
  background: rgba(var(--blue-rgb), 0.08);
}

.status-chip.success {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(34, 197, 94, 0.08);
}

.status-chip.warn {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.18);
  background: rgba(250, 204, 21, 0.08);
}

.status-chip.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
}

.data-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.data-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.eyebrow {
  color: var(--t4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.metric-row strong {
  color: #fff;
  font-size: 0.8rem;
}

.metric-row span,
.metric-row div:last-child {
  color: var(--t2);
  font-size: 0.8rem;
  text-align: right;
}

.columns-2e {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.list-item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.list-item-copy strong {
  color: #fff;
  font-size: 0.84rem;
}

.list-item-copy span {
  color: var(--t3);
  font-size: 0.76rem;
}

.list-item-meta {
  color: var(--t4);
  font-size: 0.72rem;
  white-space: nowrap;
}

.entity-drawer-overlay,
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2200;
}

.entity-drawer-overlay.open,
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.entity-drawer,
.drawer {
  position: fixed;
  top: 0;
  right: -680px;
  bottom: 0;
  width: min(680px, 100vw);
  background: var(--surface);
  border-left: 1px solid rgba(var(--blue-rgb), 0.14);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.35);
  transition: right 0.3s var(--ease-out);
  z-index: 2201;
  display: flex;
  flex-direction: column;
}

.entity-drawer.open,
.drawer.open {
  right: 0;
}

.drawer-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.drawer-title {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
}

.drawer-subtitle {
  color: var(--t3);
  font-size: 0.76rem;
  line-height: 1.35;
  margin-top: 6px;
}

.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--t3);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.drawer-close:hover {
  color: #fff;
  border-color: rgba(var(--blue-rgb), 0.16);
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-section-title {
  color: var(--t4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.drawer-note {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(var(--blue-rgb), 0.08);
  border: 1px solid rgba(var(--blue-rgb), 0.14);
  color: var(--t2);
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--t2);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.pagination-link.is-active {
  color: #fff;
  background: rgba(var(--blue-rgb), 0.14);
  border-color: rgba(var(--blue-rgb), 0.22);
}

/* ═══ MAIL MODE ═══ */
.mail-workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 320px;
  gap: 20px;
  min-height: calc(100vh - 104px);
}

.mail-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mail-scroll {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 4px;
}

.mail-composer-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.mail-header-row {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(var(--blue-rgb), 0.14);
  display: flex;
  gap: 14px;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(var(--blue-rgb), 0.035), rgba(255,255,255,0.01) 24%, rgba(255,255,255,0));
  position: relative;
}

.mail-header-row::after {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--blue-rgb), 0), rgba(142, 226, 255, 0.24), rgba(var(--blue-rgb), 0));
  opacity: 0.8;
}

.mail-header-label {
    width: 68px;
    flex-shrink: 0;
    color: var(--t4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(var(--blue-rgb), 0.14);
}

.mail-header-input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #f4fbff !important;
  font-weight: 600;
  font-size: 0.95rem !important;
  letter-spacing: -0.01em;
}

.mail-editor {
  flex: 1;
  min-height: 360px;
  resize: none;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 24px !important;
  line-height: 1.7;
  color: #eef8ff !important;
  caret-color: #82daff;
  font-size: 0.95rem !important;
  letter-spacing: -0.012em;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
    linear-gradient(90deg, rgba(var(--blue-rgb), 0.025), rgba(255,255,255,0));
}

.mail-header-input::placeholder,
.mail-editor::placeholder {
  color: rgba(193, 226, 245, 0.32);
}

.mail-composer-shell .mail-header-row:first-child {
  padding-top: 18px;
}

.mail-composer-shell .mail-editor {
  position: relative;
  z-index: 1;
}

.mail-queue-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mail-queue-item.is-active {
  border-color: rgba(var(--blue-rgb), 0.24);
  background: rgba(var(--blue-rgb), 0.08);
}

.mail-queue-title {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.mail-queue-meta {
  color: var(--t3);
  font-size: 0.74rem;
  line-height: 1.5;
}

.timeline-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-item strong {
  color: #fff;
  font-size: 0.8rem;
}

.timeline-item span {
  color: var(--t3);
  font-size: 0.75rem;
  line-height: 1.45;
}

.outcome-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.outcome-button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(var(--blue-rgb), 0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)),
    linear-gradient(180deg, rgba(20, 24, 35, 0.98), rgba(8, 11, 18, 0.98));
  color: #fff;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 12px 22px rgba(0,0,0,0.12);
}

.outcome-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--blue-rgb), 0.15));
  opacity: 0;
  transition: var(--transition);
}

.outcome-button:hover {
  background:
    linear-gradient(180deg, rgba(var(--blue-rgb), 0.08), rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(20, 24, 35, 0.98), rgba(8, 11, 18, 0.98));
  border-color: var(--blue);
  box-shadow:
    inset 0 0 15px rgba(var(--blue-rgb), 0.12),
    0 0 15px rgba(var(--blue-rgb), 0.16),
    0 18px 26px rgba(0,0,0,0.14);
  transform: translateY(-1px);
}

.outcome-button:hover::before {
  opacity: 1;
}

.outcome-button:active {
  transform: translateY(0);
}

.outcome-button.is-primary {
  background:
    linear-gradient(180deg, rgba(var(--blue-rgb), 0.16), rgba(var(--blue-rgb), 0.05)),
    linear-gradient(180deg, rgba(15, 20, 31, 0.98), rgba(8, 11, 18, 0.98));
  border-color: var(--blue);
  box-shadow:
    inset 0 0 18px rgba(var(--blue-rgb), 0.16),
    0 0 20px rgba(var(--blue-rgb), 0.22);
}

.outcome-button-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 8px currentColor,
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.outcome-button[data-outcome="sent"] .outcome-button-icon,
.outcome-button[data-outcome="meeting_intent"] .outcome-button-icon {
  background:
    linear-gradient(180deg, rgba(var(--blue-rgb), 0.18), rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(15, 18, 29, 0.94), rgba(8, 11, 18, 0.98));
}

.outcome-button[data-outcome="follow_up"] .outcome-button-icon,
.outcome-button[data-outcome="scheduled"] .outcome-button-icon {
  background:
    linear-gradient(180deg, rgba(250, 204, 21, 0.14), rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(15, 18, 29, 0.94), rgba(8, 11, 18, 0.98));
}

.outcome-button[data-outcome="reply_received"] .outcome-button-icon {
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.16), rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(15, 18, 29, 0.94), rgba(8, 11, 18, 0.98));
}

.outcome-button[data-outcome="invalid_email"] .outcome-button-icon,
.outcome-button[data-outcome="not_relevant"] .outcome-button-icon {
  background:
    linear-gradient(180deg, rgba(239, 68, 68, 0.12), rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(15, 18, 29, 0.94), rgba(8, 11, 18, 0.98));
}

.outcome-button[data-outcome="skip"] .outcome-button-icon {
  background:
    linear-gradient(180deg, rgba(190, 198, 208, 0.12), rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(15, 18, 29, 0.94), rgba(8, 11, 18, 0.98));
}

.outcome-button-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  text-align: left;
}

.outcome-button-kicker {
  color: rgba(163, 214, 241, 0.54);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.outcome-button-label {
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(112, 204, 255, 0.18);
}

.outcome-button-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(15, 18, 29, 0.94), rgba(8, 11, 18, 0.98));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 10px 18px rgba(0,0,0,0.14);
}

.outcome-button-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
}

.outcome-button-meta {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(14px);
  display: none;
  place-items: center;
  z-index: 3000;
  padding: 24px;
}

.modal-shell.open {
  display: grid;
}

.modal-card {
  width: min(520px, 100%);
  padding: 32px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid rgba(var(--blue-rgb), 0.16);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.modal-card h3 {
  margin: 0 0 8px;
  color: #fff;
}

.modal-card p {
  margin: 0 0 20px;
  color: var(--t3);
  line-height: 1.55;
  font-size: 0.84rem;
}

body.mail-modal-open {
  overflow: hidden;
}

.mail-outcome-modal {
  background: rgba(2, 6, 12, 0.78);
  backdrop-filter: blur(6px) saturate(1.08);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mail-outcome-modal .modal-card {
  width: min(500px, 100%);
  max-height: min(84vh, 640px);
  overflow: auto;
  padding: 24px 26px 22px;
  background:
    radial-gradient(circle at top right, rgba(var(--blue-rgb), 0.16), transparent 42%),
    linear-gradient(180deg, rgba(23, 27, 39, 0.98), rgba(10, 13, 22, 0.98));
  border: 1px solid rgba(var(--blue-rgb), 0.22);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.mail-modal-seal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--blue-rgb), 0.2);
  background: rgba(255,255,255,0.03);
}

.mail-modal-seal-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #89d2ff;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.12), rgba(var(--blue-rgb), 0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 14px rgba(var(--blue-rgb), 0.18);
}

.mail-modal-seal-icon svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
}

.mail-modal-seal-copy {
  color: #d9f2ff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.modal-actions {
  position: sticky;
  bottom: -22px;
  margin: 0 -26px -22px;
  padding: 16px 26px 22px;
  background: linear-gradient(180deg, rgba(10, 13, 22, 0), rgba(10, 13, 22, 0.94) 36%);
}

/* ═══ LEDGER TABLE HELPERS ═══ */
.table-dense thead th {
  padding: 12px 14px;
}

.table-dense tbody td {
  padding: 12px 14px;
  font-size: 0.8rem;
}

.table-primary-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.table-primary-cell strong {
  color: #fff;
  font-size: 0.9rem;
}

.table-secondary {
  color: var(--t3);
  font-size: 0.74rem;
  line-height: 1.45;
}

.table-inline-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ═══ DIRECTORY PANELS ═══ */
.directory-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.directory-table-card {
  padding: 0;
  overflow: hidden;
}

.directory-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--t3);
}

/* ═══ DETAILS / COLLAPSIBLE ═══ */
details summary::-webkit-details-marker { display: none; }
details summary { list-style: none; }
details[open] summary { margin-bottom: 12px; }

/* ═══ SELECTION ═══ */
::selection {
  background: rgba(var(--blue-rgb), 0.3);
  color: #fff;
}

/* ═══ RESPONSIVE REFINEMENT ═══ */
@media (max-width: 1200px) {
  .main {
    padding: 24px 20px;
  }

  .mail-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .entity-drawer,
  .drawer {
    width: min(100vw, 100%);
  }
}

@media (max-width: 900px) {
  .columns-2e,
  .toolbar-form-grid {
    grid-template-columns: 1fr;
  }

  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .section-toolbar-actions,
  .actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
/* --- MAIL MODE TOPFOLD --- */
@keyframes payload-arrive {
  from {
    opacity: 0;
    transform: translateX(-236px) scale(0.76) rotate(-5deg);
    filter: blur(1px);
  }
  62% {
    opacity: 1;
    transform: translateX(14px) scale(1.03) rotate(1deg);
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes payload-advance {
  0% { transform: translateX(0) scale(1); }
  68% { transform: translateX(68px) scale(1.03); }
  100% { transform: translateX(62px) scale(1); }
}

@keyframes belt-advance {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 44px 0, 120px 0, 0 0; }
}

@keyframes roller-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes payload-drop-off {
  0% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }
  14% {
    opacity: 1;
    transform: translateX(10px) translateY(-10px) rotate(-4deg) scale(1.06);
  }
  38% {
    opacity: 1;
    transform: translateX(36px) translateY(-4px) rotate(2deg) scale(1.03);
  }
  100% {
    opacity: 0;
    transform: translateX(106px) translateY(152px) rotate(20deg) scale(0.64);
  }
}

@keyframes ghost-enter {
  0% {
    opacity: 0;
    transform: translate(-248px, -50%) skewX(32deg) scale(0.78);
  }
  30% {
    opacity: 1;
  }
  76% {
    opacity: 1;
    transform: translate(8px, -50%) skewX(32deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translate(0, -50%) skewX(32deg) scale(1);
  }
}

@keyframes payload-idle {
  0%, 100% {
    transform: translateX(-50%) translateY(-7px) scale(1.08);
  }
  50% {
    transform: translateX(-50%) translateY(-9px) scale(1.095);
  }
}

@keyframes payload-shadow-idle {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.84;
  }
  50% {
    transform: translateX(-50%) scale(0.92);
    opacity: 0.64;
  }
}

@keyframes payload-launch {
  0% {
    transform: translateX(-50%) translateY(-7px) scale(1.08);
  }
  28% {
    transform: translateX(-50%) translateY(-16px) scale(1.13) rotate(-3deg);
  }
  62% {
    transform: translateX(-50%) translateY(-10px) scale(1.08) rotate(1deg);
  }
  100% {
    transform: translateX(-50%) translateY(-8px) scale(1.04) rotate(0deg);
  }
}

@keyframes belt-edge-pulse {
  0%, 100% {
    opacity: 0.82;
    box-shadow: 0 0 10px rgba(39, 248, 255, 0.2);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 18px rgba(39, 248, 255, 0.32);
  }
}

@keyframes payload-glint {
  0%, 100% {
    opacity: 0.42;
    transform: translateX(-12px);
  }
  50% {
    opacity: 0.88;
    transform: translateX(14px);
  }
}

@keyframes bin-ripple {
  0% {
    opacity: 0.58;
    transform: translate(-50%, 50%) scale(0.32);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 50%) scale(2.5);
  }
}

@keyframes catch-glass-flare {
  0% {
    opacity: 0.18;
    transform: translate3d(-18px, 10px, 0) rotate(-10deg);
  }
  45% {
    opacity: 0.5;
  }
  100% {
    opacity: 0.12;
    transform: translate3d(22px, -10px, 0) rotate(-10deg);
  }
}

@keyframes bin-halo-pulse {
  0%, 100% {
    opacity: 0.48;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.78;
    transform: scale(1.04);
  }
}

@keyframes floor-flash {
  0% {
    opacity: 0.3;
    transform: scale(0.92);
  }
  100% {
    opacity: 0.9;
    transform: scale(1.12);
  }
}

.mail-mode-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.mail-mode-page::before {
  content: '';
  position: absolute;
  inset: -24px -24px auto 0;
  height: 360px;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 14%, rgba(var(--blue-rgb), 0.08), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(87, 209, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  opacity: 0.9;
  z-index: 0;
}

.mail-topfold {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 280px;
  grid-template-rows: 88px minmax(0, 1fr);
  grid-template-areas:
    "conveyor conveyor conveyor"
    "left center right";
  gap: 18px;
  height: calc(100vh - 64px);
  overflow-x: visible;
  overflow-y: hidden;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.mail-topfold-conveyor {
  grid-area: conveyor;
  position: relative;
  left: calc(-1 * (var(--sidebar-w) + 1px));
  width: calc(100% + var(--sidebar-w) + 1px);
  padding: 0 16px 12px 0;
  display: block;
  align-items: center;
  overflow: visible;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  border-radius: 0;
  z-index: 0;
  isolation: isolate;
  perspective: 1400px;
}

.mail-conveyor-lane {
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 76px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  isolation: isolate;
  perspective: 1200px;
}

.mail-conveyor-lane::before {
  content: '';
  position: absolute;
  left: 24px;
  right: 12px;
  top: 14px;
  bottom: 4px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.012) 26%, rgba(0,0,0,0.16) 100%),
    radial-gradient(circle at top left, rgba(var(--blue-rgb), 0.1), transparent 26%),
    linear-gradient(180deg, rgba(23, 28, 40, 0.84), rgba(7, 10, 17, 0.28));
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -20px 26px rgba(0,0,0,0.22),
    0 24px 32px rgba(0, 0, 0, 0.22);
}

.mail-conveyor-lane::after {
  content: '';
  position: absolute;
  left: 78px;
  right: 32px;
  bottom: 0;
  height: 12px;
  transform: skewX(-32deg);
  border-radius: 0 0 16px 16px;
  background:
    linear-gradient(180deg, rgba(86, 92, 108, 0.58), rgba(11, 13, 20, 0.96)),
    linear-gradient(90deg, rgba(var(--blue-rgb), 0.1), transparent 18%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
}

.mail-topfold-conveyor.is-processing .mail-conveyor-lane::before {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -18px 24px rgba(0,0,0,0.18),
    0 24px 32px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(var(--blue-rgb), 0.06);
}

.mail-conveyor-infeed {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 232px;
  height: 50px;
  transform: translateY(-50%) skewX(-32deg);
  border-radius: 18px 0 0 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015)),
    linear-gradient(180deg, #424857, #1a1f2a 52%, #090b12);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    inset -18px 0 34px rgba(0, 0, 0, 0.42),
    0 18px 18px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.mail-conveyor-infeed::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.46), rgba(255,255,255,0.03) 32%, rgba(255,255,255,0) 52%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0) 18px, rgba(255,255,255,0.04) 18px, rgba(255,255,255,0.04) 20px);
  opacity: 0.72;
}

.mail-conveyor-belt {
  position: relative;
  width: 100%;
  height: 60px;
  margin-left: 18px;
  padding: 0 74px 0 184px;
  display: flex;
  align-items: center;
  transform: skewX(-32deg);
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.24));
}

.mail-conveyor-belt::before {
  content: '';
  position: absolute;
  left: -8px;
  right: 0;
  top: 5px;
  bottom: 8px;
  border-radius: 14px;
  clip-path: polygon(0 0, 100% 0, 97.2% 100%, 2% 100%);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.00) 0 31px,
      rgba(255,255,255,0.12) 31px 33px,
      rgba(255,255,255,0.00) 33px 64px
    ),
    linear-gradient(90deg, rgba(255,255,255,0.04), rgba(var(--blue-rgb), 0.09) 14%, rgba(255,255,255,0.02) 30%, rgba(255,255,255,0) 46%),
    linear-gradient(180deg, rgba(40, 44, 58, 0.98), rgba(10, 13, 22, 0.98));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -10px 18px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(4, 9, 16, 0.36);
}

.mail-topfold-conveyor.is-processing .mail-conveyor-belt::before {
  animation: belt-advance 0.36s linear infinite;
}

.mail-conveyor-belt::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 10px;
  bottom: 2px;
  height: 5px;
  clip-path: polygon(0 0, 100% 0, 97.2% 100%, 2% 100%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(39, 248, 255, 0.86), rgba(86, 209, 255, 0.74));
  box-shadow: 0 0 12px rgba(39, 248, 255, 0.22);
}

.mail-topfold-conveyor.is-processing .mail-conveyor-belt::after {
  animation: belt-edge-pulse 0.42s ease-in-out infinite;
}

.mail-conveyor-drop-mouth {
  position: absolute;
  top: 10px;
  right: 6px;
  width: 74px;
  height: 38px;
  transform: skewX(0deg);
  border-radius: 0 16px 18px 0;
  background:
    linear-gradient(180deg, rgba(35, 39, 52, 0.98), rgba(6, 8, 14, 0.98));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset -12px 0 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.mail-conveyor-drop-mouth::before {
  content: '';
  position: absolute;
  inset: 2px 10px 2px 6px;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(0,0,0,0.46));
  opacity: 0.74;
}

.mail-topfold-conveyor.is-processing .mail-conveyor-drop-mouth {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset -12px 0 20px rgba(0, 0, 0, 0.4),
    0 0 18px rgba(var(--blue-rgb), 0.16);
}

.mail-topfold-conveyor.is-processing .mail-conveyor-drop-mouth::before {
  background: linear-gradient(90deg, rgba(143, 223, 255, 0.2), rgba(0,0,0,0.52));
}

.mail-conveyor-rollers {
  position: absolute;
  left: 136px;
  right: 66px;
  bottom: -1px;
  display: flex;
  justify-content: space-between;
  z-index: 0;
  pointer-events: none;
}

.mail-conveyor-roller {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.24), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(0,0,0,0.46));
  box-shadow:
    inset 0 1px 4px rgba(0,0,0,0.32),
    0 2px 6px rgba(0,0,0,0.14);
}

.mail-topfold-conveyor.is-processing .mail-conveyor-roller {
  animation: roller-spin 0.36s linear infinite;
}

.mail-conveyor-items {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding-right: 12px;
  width: 100%;
  min-width: 0;
  transform: skewX(32deg) translateY(-5px);
  transform-origin: center;
}

.mail-conveyor-payload {
  position: relative;
  width: 54px;
  height: 46px;
  flex: 0 0 auto;
  animation: payload-arrive 0.65s var(--ease-spring) both;
  animation-delay: var(--payload-delay, 0s);
  will-change: transform, opacity, filter;
}

.mail-conveyor-payload.is-advancing {
  animation: payload-advance 0.42s var(--ease-out) forwards;
  animation-delay: var(--advance-delay, 0ms);
}

.mail-conveyor-payload.is-launching .mail-payload-box {
  animation: payload-launch 0.18s cubic-bezier(0.28, 0.84, 0.34, 1) forwards;
}

.mail-conveyor-payload.is-dropping {
  animation: payload-drop-off 0.56s var(--ease-out) forwards;
}

.mail-conveyor-payload.is-dropping .mail-payload-shadow {
  opacity: 0;
}

.mail-conveyor-ghost {
  position: absolute;
  left: 184px;
  top: 50%;
  width: 50px;
  height: 42px;
  transform: translate(-248px, -50%) skewX(32deg) scale(0.78);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  transform-origin: center;
  filter: drop-shadow(0 9px 12px rgba(0,0,0,0.26));
}

.mail-conveyor-ghost.is-entering {
  animation: ghost-enter 0.6s var(--ease-spring) forwards;
}

.mail-payload-shadow {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 34px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  filter: blur(6px);
  opacity: 0.76;
}

.mail-payload-box {
  position: absolute;
  left: 50%;
  bottom: 11px;
  width: 40px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02)),
    linear-gradient(180deg, #6e7687, #323a4a 62%, #161a22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -7px 10px rgba(0,0,0,0.2),
    0 12px 18px rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.mail-payload-box::before {
  content: '';
  position: absolute;
  top: 2px;
  right: -7px;
  bottom: 1px;
  width: 10px;
  border-radius: 0 8px 8px 0;
  transform: skewY(-44deg);
  transform-origin: left top;
  background: linear-gradient(180deg, #313744, #0f131b);
  border-right: 1px solid rgba(255,255,255,0.06);
}

.mail-payload-box::after {
  content: '';
  position: absolute;
  left: -18px;
  width: 22px;
  top: 3px;
  bottom: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0));
  transform: skewX(-18deg);
  filter: blur(1px);
  opacity: 0.48;
}

.mail-payload-box-lid {
  position: absolute;
  top: -5px;
  left: 5px;
  right: 8px;
  height: 8px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: none;
}

.mail-payload-emblem {
  position: relative;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), rgba(10, 13, 20, 0.96));
  border: 1px solid rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 4px 10px rgba(0,0,0,0.18);
}

.mail-payload-emblem::after {
  content: '';
  position: absolute;
  top: 2px;
  left: -6px;
  width: 18px;
  bottom: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
  opacity: 0.72;
  transform: rotate(-18deg);
  filter: blur(1px);
}

.mail-payload-icon {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.mail-payload-badge {
  position: absolute;
  right: -4px;
  bottom: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(8, 10, 17, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 6px 10px rgba(0,0,0,0.2);
}

.mail-mini-crate-icon {
  width: 8px;
  height: 8px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.mail-conveyor-payload.is-active .mail-payload-box {
  transform: translateX(-50%) translateY(-7px) scale(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 1px rgba(var(--blue-rgb), 0.12),
    0 18px 30px rgba(0, 0, 0, 0.32);
}

.mail-conveyor-payload.is-active .mail-payload-shadow {
  width: 34px;
  opacity: 0.86;
}

.mail-conveyor-payload.is-active:not(.is-launching):not(.is-dropping) .mail-payload-box {
  animation: payload-idle 2.2s ease-in-out infinite;
}

.mail-conveyor-payload.is-active:not(.is-launching):not(.is-dropping) .mail-payload-box::after {
  animation: payload-glint 1.9s ease-in-out infinite;
}

.mail-conveyor-payload.is-active:not(.is-launching):not(.is-dropping) .mail-payload-shadow {
  animation: payload-shadow-idle 2.2s ease-in-out infinite;
}

.mail-flying-payload {
  position: fixed;
  z-index: 5000;
  pointer-events: none;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,0.22));
}

.mail-flying-payload.is-flying {
  animation: payload-flight 0.72s cubic-bezier(0.14, 0.82, 0.22, 1) forwards;
}

.mail-flying-payload .mail-payload-box {
  bottom: 8px;
}

.mail-flying-payload .mail-payload-shadow {
  display: none;
}

@keyframes payload-flight {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  20% {
    transform: translate(calc(var(--fly-dx) * 0.16), calc(var(--fly-dy) * 0.02 - 18px)) rotate(-4deg) scale(1.04);
    opacity: 1;
  }
  46% {
    transform: translate(calc(var(--fly-dx) * 0.48), calc(var(--fly-dy) * 0.14 - 74px)) rotate(calc(var(--fly-r) * 0.12)) scale(0.99);
    opacity: 1;
  }
  76% {
    transform: translate(calc(var(--fly-dx) * 0.82), calc(var(--fly-dy) * 0.68 - 10px)) rotate(calc(var(--fly-r) * 0.74)) scale(0.9);
    opacity: 1;
  }
  100% {
    transform: translate(var(--fly-dx), var(--fly-dy)) rotate(var(--fly-r)) scale(0.72);
    opacity: 0.94;
  }
}

.mail-topfold-left {
  grid-area: left;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-height: 0;
}

.mail-topfold-center {
  grid-area: center;
  min-height: 0;
}

.mail-topfold-right {
  grid-area: right;
  min-height: 0;
}

.mail-brief-card {
  padding: 14px 16px;
  height: 100%;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(var(--blue-rgb), 0.12), transparent 46%),
    linear-gradient(180deg, rgba(18, 22, 33, 0.98), rgba(10, 13, 22, 0.98));
  border-color: rgba(var(--blue-rgb), 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 0 24px rgba(var(--blue-rgb), 0.03),
    0 20px 40px rgba(0, 0, 0, 0.18);
}

.mail-brief-card::after,
.mail-composer-shell::after,
.mail-outcome-shell::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    radial-gradient(circle at 30% 30%, rgba(var(--blue-rgb), 0.14), transparent 60%);
  border: 1px solid rgba(255,255,255,0.03);
  opacity: 0.78;
  pointer-events: none;
  mask-image: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.16));
}

.mail-brief-card-identity {
  background:
    radial-gradient(circle at top right, rgba(80, 168, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(19, 24, 37, 0.98), rgba(9, 13, 22, 0.98));
}

.mail-brief-card-facts {
  background:
    radial-gradient(circle at top right, rgba(88, 212, 255, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(16, 22, 34, 0.98), rgba(10, 13, 22, 0.98));
}

.mail-brief-card-briefing {
  background:
    radial-gradient(circle at top right, rgba(122, 184, 255, 0.14), transparent 44%),
    linear-gradient(180deg, rgba(17, 22, 35, 0.98), rgba(9, 12, 21, 0.98));
}

.mail-brief-card::before,
.mail-topfold-center .mail-composer-card::before,
.mail-outcome-card::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(var(--blue-rgb), 0), rgba(130, 218, 255, 0.84), rgba(var(--blue-rgb), 0));
  opacity: 0.92;
}

.mail-brief-card .section-shell {
  gap: 10px;
  height: 100%;
  position: relative;
  z-index: 1;
}

.mail-brief-card .eyebrow,
.mail-header-label {
  color: rgba(176, 226, 255, 0.72);
  letter-spacing: 0.16em;
}

.mail-brief-card .list-stack {
  gap: 4px;
}

.mail-brief-card .metric-row {
  padding: 7px 0;
  border-bottom-color: rgba(255,255,255,0.035);
}

.mail-brief-card .metric-row strong,
.mail-brief-card .metric-row span {
  font-size: 0.74rem;
}

.mail-brief-card .metric-row strong {
  color: rgba(209, 235, 250, 0.78);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.mail-brief-card .metric-row span,
.mail-brief-card .metric-row div:last-child {
  color: #edf7ff;
}

.mail-brief-title {
  margin: 0;
  color: #fff;
  font-size: 1.22rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.mail-brief-highlight {
  color: #83d9ff;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-brief-label {
  color: rgba(201, 229, 243, 0.86);
  display: block;
  margin-bottom: 5px;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mail-brief-copy {
  color: #d7e6f0;
  font-size: 0.76rem;
  line-height: 1.52;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mail-brief-copy-deep {
  -webkit-line-clamp: 3;
}

.mail-topfold-center .mail-composer-card {
  height: 100%;
  background:
    radial-gradient(circle at top right, rgba(var(--blue-rgb), 0.14), transparent 38%),
    linear-gradient(180deg, rgba(17, 21, 32, 0.98), rgba(9, 12, 20, 0.98));
  border: 1px solid rgba(var(--blue-rgb), 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 0 24px rgba(var(--blue-rgb), 0.04),
    0 24px 44px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
}

.mail-topfold-center .mail-editor {
  min-height: 0;
}

.mail-composer-shell::after {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  opacity: 0.72;
}

.mail-outcome-card {
  height: 100%;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(var(--blue-rgb), 0.14), transparent 38%),
    linear-gradient(180deg, rgba(17, 21, 33, 0.98), rgba(9, 12, 20, 0.98));
  border-color: rgba(var(--blue-rgb), 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 0 24px rgba(var(--blue-rgb), 0.04),
    0 24px 44px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
}

.mail-game-console {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mail-outcome-shell::after {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  opacity: 0.74;
}

.mail-game-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid rgba(var(--blue-rgb), 0.14);
  background:
    radial-gradient(circle at top center, rgba(var(--blue-rgb), 0.16), transparent 54%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.012)),
    rgba(255,255,255,0.015);
  padding: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.mail-game-stage::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.12), transparent 42%),
    linear-gradient(180deg, rgba(var(--blue-rgb), 0.12), rgba(255,255,255,0.02));
  border: 1px solid rgba(var(--blue-rgb), 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  opacity: 0.94;
  pointer-events: none;
}

.mail-game-stage::after {
  content: '';
  position: absolute;
  top: 24px;
  right: 24px;
  width: 22px;
  height: 22px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,0.14), transparent 44%),
    linear-gradient(180deg, rgba(var(--blue-rgb), 0.24), rgba(var(--blue-rgb), 0.08));
  clip-path: polygon(50% 0, 90% 18%, 90% 55%, 50% 100%, 10% 55%, 10% 18%);
  box-shadow: 0 0 16px rgba(var(--blue-rgb), 0.22);
  pointer-events: none;
}

.mail-drop-shaft {
  position: relative;
  flex: 1;
  min-height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

.mail-drop-guide {
  position: absolute;
  top: 0;
  bottom: 118px;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(var(--blue-rgb), 0.34), rgba(var(--blue-rgb), 0.02));
  box-shadow: 0 0 14px rgba(var(--blue-rgb), 0.16);
}

.mail-drop-shaft.is-catching .mail-drop-guide {
  background: linear-gradient(180deg, rgba(143, 223, 255, 0.76), rgba(var(--blue-rgb), 0.08));
  box-shadow: 0 0 22px rgba(143, 223, 255, 0.3);
}

.mail-catch-bin {
  position: relative;
  --collector-accent: 96, 194, 255;
  width: 100%;
  min-height: 118px;
  border-radius: 22px 22px 30px 30px;
  border: 1px solid rgba(var(--collector-accent), 0.2);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05) 18%, rgba(8, 11, 19, 0.44) 56%, rgba(6, 10, 18, 0.74) 100%),
    radial-gradient(circle at top center, rgba(var(--blue-rgb), 0.12), transparent 62%),
    rgba(6, 10, 18, 0.52);
  box-shadow:
    inset 0 0 18px rgba(255,255,255,0.04),
    inset 0 -22px 30px rgba(0,0,0,0.24),
    0 18px 26px rgba(0,0,0,0.14);
  padding: 26px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  transform-origin: center bottom;
  overflow: hidden;
  isolation: isolate;
}

.mail-catch-bin::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 18px;
  right: 18px;
  height: 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.03));
}

.mail-catch-bin::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 26px;
  right: 26px;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid rgba(var(--collector-accent), 0.18);
}

.mail-catch-bin-halo {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 42px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(var(--collector-accent), 0.26), rgba(var(--collector-accent), 0) 72%);
  filter: blur(16px);
  opacity: 0.58;
  pointer-events: none;
  z-index: 0;
  animation: bin-halo-pulse 3.8s ease-in-out infinite;
}

.mail-catch-bin-glass {
  position: absolute;
  inset: 14px 10px 12px;
  border-radius: 18px 18px 26px 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02) 30%, rgba(255,255,255,0.01)),
    linear-gradient(110deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 34%, rgba(255,255,255,0.09) 62%, rgba(255,255,255,0) 78%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(6px) saturate(1.12);
  -webkit-backdrop-filter: blur(6px) saturate(1.12);
  pointer-events: none;
  z-index: 1;
}

.mail-catch-bin-floor {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(var(--collector-accent), 0.24), rgba(var(--collector-accent), 0) 72%);
  filter: blur(4px);
  pointer-events: none;
  z-index: 0;
}

.mail-catch-bin.is-catching {
  animation: collector-bump 0.48s var(--ease-spring);
  box-shadow:
    inset 0 0 18px rgba(255,255,255,0.05),
    inset 0 -18px 26px rgba(0,0,0,0.22),
    0 0 0 1px rgba(var(--collector-accent), 0.16),
    0 0 24px rgba(var(--collector-accent), 0.14);
}

.mail-catch-bin.is-catching .mail-catch-bin-glass {
  animation: catch-glass-flare 0.56s cubic-bezier(0.12, 0.78, 0.22, 1);
}

.mail-catch-bin.is-catching .mail-catch-bin-floor {
  animation: floor-flash 0.56s cubic-bezier(0.16, 0.84, 0.22, 1);
}

.mail-bin-score {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.mail-bin-score strong {
  color: #fff;
  font-size: 2.15rem;
  line-height: 1;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(var(--collector-accent), 0.22);
}

.mail-bin-score strong.is-popping {
  animation: score-pop 0.42s var(--ease-spring);
}

.mail-bin-stack {
  position: relative;
  min-height: 54px;
  height: 64px;
  z-index: 2;
}

.mail-bin-stack::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.mail-bin-stack::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 2px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.2));
}

.mail-bin-stack.is-celebrating::after {
  background: linear-gradient(180deg, rgba(117, 211, 255, 0), rgba(117, 211, 255, 0.16));
}

.mail-bin-empty {
  display: none;
}

.mail-mini-crate,
.mail-falling-crate {
  position: relative;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01)),
    linear-gradient(180deg, #505460, #242833 60%, #171a22);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 8px 14px rgba(0,0,0,0.18);
}

.mail-mini-crate::before,
.mail-falling-crate::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 9px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 6px 6px 0 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
}

.mail-mini-crate {
  position: absolute;
  left: var(--jar-x);
  bottom: var(--jar-y);
  width: 24px;
  height: 18px;
  transform: rotate(var(--jar-r));
  box-shadow: 0 6px 10px rgba(0,0,0,0.18);
}

.mail-mini-crate.is-landed {
  animation: jar-land 0.38s var(--ease-spring);
}

.mail-falling-crate {
  position: absolute;
  top: -34px;
  left: calc(50% - 27px);
  width: 54px;
  height: 30px;
  transform: translateX(0);
  opacity: 0;
  z-index: 4;
}

.mail-falling-crate.is-dropping {
  animation: payload-drop-off 0.58s var(--ease-out) forwards;
}

@keyframes jar-land {
  0% {
    opacity: 0;
    transform: translateY(-18px) rotate(calc(var(--jar-r) - 6deg)) scale(0.58);
  }
  60% {
    opacity: 1;
    transform: translateY(4px) rotate(calc(var(--jar-r) + 3deg)) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: rotate(var(--jar-r)) scale(1);
  }
}

.mail-mini-crate-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 12px;
  height: 12px;
  padding: 0 2px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.42rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: rgba(8, 10, 17, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 8px rgba(0,0,0,0.16);
}

.mail-outcome-dock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.mail-bin-ripple {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  transform: translate(-50%, 50%) scale(0.32);
  border: 1px solid currentColor;
  box-shadow: 0 0 12px currentColor;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.mail-bin-ripple.is-live {
  animation: bin-ripple 0.62s cubic-bezier(0.16, 0.84, 0.22, 1) forwards;
}

.outcome-stack-compact {
  gap: 10px;
}

.outcome-stack-compact .outcome-button {
  padding: 11px 12px;
  border-radius: 14px;
}

.outcome-stack-compact .outcome-button-kicker {
  font-size: 0.52rem;
}

.outcome-stack-compact .outcome-button-label {
  font-size: 0.66rem;
}

.mail-below-fold {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mail-flight-burst {
  position: fixed;
  width: 0;
  height: 0;
  z-index: 5100;
  pointer-events: none;
}

.mail-flight-burst-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  opacity: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255,255,255,0.96), currentColor 48%, rgba(255,255,255,0));
  box-shadow: 0 0 12px currentColor;
}

.mail-flight-burst.is-live .mail-flight-burst-particle {
  animation: collector-burst 0.52s cubic-bezier(0.12, 0.86, 0.24, 1) forwards;
  animation-delay: var(--burst-delay, 0ms);
}

@keyframes collector-bump {
  0% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-3px) scale(1.02);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes score-pop {
  0% {
    transform: scale(1);
  }
  38% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes collector-burst {
  0% {
    opacity: 0;
    transform: rotate(var(--burst-angle)) translateX(0) scale(0.4);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--burst-angle)) translateX(var(--burst-distance)) scale(1);
  }
}

.mail-conveyor-payload,
.mail-conveyor-ghost {
  background: transparent !important;
  border: none !important;
}

.mail-topfold-conveyor.is-processing .mail-conveyor-payload.is-active,
.mail-topfold-conveyor.is-processing .mail-conveyor-ghost {
  will-change: transform, opacity;
}

.mission-first .mail-payload-emblem,
.mail-mini-crate.mission-first,
.mail-falling-crate.mission-first,
.mail-flight-burst.mission-first,
.mail-bin-ripple.mission-first {
  color: #7cc7ff;
}

.mission-first .mail-payload-box,
.mail-mini-crate.mission-first,
.mail-falling-crate.mission-first {
  border-color: rgba(124, 199, 255, 0.3);
  background:
    linear-gradient(180deg, rgba(124, 199, 255, 0.16), rgba(255,255,255,0.02)),
    linear-gradient(180deg, #52667c, #1f2b39 62%, #0f1722);
}

.mission-first .mail-payload-badge,
.mail-mini-crate.mission-first .mail-mini-crate-badge {
  color: #061521;
  background: linear-gradient(180deg, #9ed8ff, #58adff);
  border-color: rgba(255,255,255,0.18);
}

.mission-follow-up .mail-payload-emblem,
.mail-mini-crate.mission-follow-up,
.mail-falling-crate.mission-follow-up,
.mail-flight-burst.mission-follow-up,
.mail-bin-ripple.mission-follow-up {
  color: #ffd36a;
}

.mission-follow-up .mail-payload-box,
.mail-mini-crate.mission-follow-up,
.mail-falling-crate.mission-follow-up {
  border-color: rgba(255, 211, 106, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 211, 106, 0.16), rgba(255,255,255,0.02)),
    linear-gradient(180deg, #6c6141, #302717 62%, #17130d);
}

.mission-follow-up .mail-payload-badge,
.mail-mini-crate.mission-follow-up .mail-mini-crate-badge {
  color: #211704;
  background: linear-gradient(180deg, #ffe29d, #ffc64b);
  border-color: rgba(255,255,255,0.16);
}

.mission-meeting .mail-payload-emblem,
.mail-mini-crate.mission-meeting,
.mail-falling-crate.mission-meeting,
.mail-flight-burst.mission-meeting,
.mail-bin-ripple.mission-meeting {
  color: #86efac;
}

.mission-meeting .mail-payload-box,
.mail-mini-crate.mission-meeting,
.mail-falling-crate.mission-meeting {
  border-color: rgba(134, 239, 172, 0.3);
  background:
    linear-gradient(180deg, rgba(134, 239, 172, 0.14), rgba(255,255,255,0.02)),
    linear-gradient(180deg, #4a6957, #1d3026 62%, #0f1a14);
}

.mission-meeting .mail-payload-badge,
.mail-mini-crate.mission-meeting .mail-mini-crate-badge {
  color: #07190d;
  background: linear-gradient(180deg, #b8f5cc, #68d391);
  border-color: rgba(255,255,255,0.16);
}

.mission-reply .mail-payload-emblem,
.mail-mini-crate.mission-reply,
.mail-falling-crate.mission-reply,
.mail-flight-burst.mission-reply,
.mail-bin-ripple.mission-reply {
  color: #67e8f9;
}

.mission-reply .mail-payload-box,
.mail-mini-crate.mission-reply,
.mail-falling-crate.mission-reply {
  border-color: rgba(103, 232, 249, 0.3);
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.16), rgba(255,255,255,0.02)),
    linear-gradient(180deg, #4b6971, #18303a 62%, #0d171d);
}

.mission-reply .mail-payload-badge,
.mail-mini-crate.mission-reply .mail-mini-crate-badge {
  color: #06161b;
  background: linear-gradient(180deg, #baf6ff, #5bd8ef);
  border-color: rgba(255,255,255,0.16);
}

.mission-reengage .mail-payload-emblem,
.mail-mini-crate.mission-reengage,
.mail-falling-crate.mission-reengage,
.mail-flight-burst.mission-reengage,
.mail-bin-ripple.mission-reengage {
  color: #f9a8d4;
}

.mail-catch-bin[data-mission="mission-first"] {
  --collector-accent: 124, 199, 255;
}

.mail-catch-bin[data-mission="mission-follow-up"] {
  --collector-accent: 255, 211, 106;
}

.mail-catch-bin[data-mission="mission-meeting"] {
  --collector-accent: 134, 239, 172;
}

.mail-catch-bin[data-mission="mission-reply"] {
  --collector-accent: 103, 232, 249;
}

.mail-catch-bin[data-mission="mission-reengage"] {
  --collector-accent: 249, 168, 212;
}

.mission-reengage .mail-payload-box,
.mail-mini-crate.mission-reengage,
.mail-falling-crate.mission-reengage {
  border-color: rgba(249, 168, 212, 0.3);
  background:
    linear-gradient(180deg, rgba(249, 168, 212, 0.16), rgba(255,255,255,0.02)),
    linear-gradient(180deg, #70536a, #351a30 62%, #1b0f18);
}

.mission-reengage .mail-payload-badge,
.mail-mini-crate.mission-reengage .mail-mini-crate-badge {
  color: #220813;
  background: linear-gradient(180deg, #ffc5e2, #ef7eb8);
  border-color: rgba(255,255,255,0.16);
}

@media (max-width: 1100px) {
  .mail-topfold {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "conveyor"
      "left"
      "center"
      "right";
    height: auto;
    overflow: visible;
  }

  .mail-topfold-conveyor {
    left: 0;
    width: 100%;
    padding: 10px 12px;
    border-top-left-radius: var(--r-lg);
    border-bottom-left-radius: var(--r-lg);
  }

  .mail-conveyor-belt {
    padding: 0 44px 0 62px;
  }

  .mail-conveyor-items {
    gap: 10px;
  }

  .mail-topfold-left {
    grid-template-rows: none;
  }

  .mail-outcome-card,
  .mail-topfold-center .mail-composer-card {
    min-height: 420px;
  }
}

@media (max-width: 900px) {
  .mail-topfold-conveyor {
    padding: 14px;
  }

  .mail-conveyor-items {
    gap: 8px;
  }

  .mail-conveyor-belt {
    padding: 0 30px 0 56px;
  }

  .mail-conveyor-roller {
    width: 16px;
    height: 16px;
  }

  .mail-game-stage {
    min-height: 260px;
  }
}
