/* ===============================================================
   AXLE Internal CRM — base layer
   This file is the small layer of CSS that sits beneath Tailwind:
     * Inter font feature settings + smooth rendering
     * Scrollbar polish
     * Form input baseline (so we never get the ugly browser default)
     * DataTables overrides to match the minimal aesthetic
     * ApexCharts overrides
     * A handful of reusable component classes built with @apply-style
       primitives (kept as plain CSS so they work without a build step)
   =============================================================== */

:root {
  --axle-bg:        #fafafa;
  --axle-surface:   #ffffff;
  --axle-fg:        #0a0a0a;
  --axle-fg-muted:  #525252;
  --axle-fg-subtle: #a3a3a3;
  --axle-border:    #e5e5e5;
  --axle-border-strong: #d4d4d4;
  --axle-hover:     #f5f5f5;
  --axle-accent:    #0a0a0a;     /* near-black primary */
  --axle-brand:     #4e897d;     /* AXLE teal — used sparingly for brand moments */
  --axle-success:   #0e7a3a;
  --axle-danger:    #b42318;
  --axle-warning:   #b54708;
  --axle-info:      #175cd3;
  --axle-radius:    8px;
  --axle-radius-sm: 6px;
  --axle-shadow:    0 1px 2px rgba(0, 0, 0, 0.04);
  --axle-shadow-lg: 0 10px 32px -12px rgba(0, 0, 0, 0.16);
}

/* ---------- Base ---------- */

html, body {
  background-color: var(--axle-bg);
  color: var(--axle-fg);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--axle-fg);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--axle-border-strong); text-underline-offset: 3px; }

::selection { background: #0a0a0a; color: #fff; }

/* ---------- Scrollbar ---------- */

* {
  scrollbar-width: thin;
  scrollbar-color: #d4d4d4 transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #e5e5e5;
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover { background-color: #d4d4d4; background-clip: padding-box; }

/* ---------- App shell ---------- */

.axle-sidebar {
  width: 240px;
  background: var(--axle-surface);
  border-right: 1px solid var(--axle-border);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.axle-topbar {
  height: 56px;
  background: var(--axle-surface);
  border-bottom: 1px solid var(--axle-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: visible;
  backdrop-filter: saturate(180%) blur(8px);
  background-color: rgba(255, 255, 255, 0.85);
}

.axle-topbar-divider {
  display: block;
  width: 1px;
  height: 22px;
  margin: 0 12px 0 14px;
  background: var(--axle-border-strong, #d4d4d4);
  flex-shrink: 0;
}

/* Topbar AI Reply — quiet pill; icon carries the accent */
.axle-ai-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  margin-left: 0;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--axle-border-strong, #d4d4d4);
  background: #fff;
  color: var(--axle-fg, #0a0a0a);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
  flex: 0 0 auto;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.axle-ai-reply-btn .material-symbols-outlined {
  font-size: 18px;
  color: #d97706;
}
.axle-ai-reply-btn:hover {
  background: #fafafa;
  border-color: #a3a3a3;
}
.axle-ai-reply-btn:active {
  background: #f5f5f5;
}
.axle-ai-reply-btn:focus-visible {
  outline: 2px solid #a3a3a3;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .axle-ai-reply-btn {
    padding: 0;
    width: 36px;
    justify-content: center;
  }
  .axle-ai-reply-btn__label { display: none; }
}

/* Topbar Compose + Ask AXLE — labeled cluster, divided from neighbors */
.axle-topbar-mail-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.axle-topbar-mail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
  flex: 0 0 auto;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.axle-topbar-mail-btn .material-symbols-outlined { font-size: 18px; }
.axle-topbar-mail-btn--compose {
  border: 1px solid #0a0a0a;
  background: #0a0a0a;
  color: #fff;
}
.axle-topbar-mail-btn--compose:hover {
  background: #262626;
  border-color: #262626;
  color: #fff;
}
.axle-topbar-mail-btn--compose:active { background: #171717; }
.axle-topbar-mail-btn--ask {
  border: 1px solid var(--axle-border-strong, #d4d4d4);
  background: #fff;
  color: var(--axle-fg, #0a0a0a);
}
.axle-topbar-mail-btn--ask .material-symbols-outlined {
  color: var(--axle-brand, #4e897d);
}
.axle-topbar-mail-btn--ask:hover {
  background: #fafafa;
  border-color: #a3a3a3;
}
.axle-topbar-mail-btn--ask:active { background: #f5f5f5; }
.axle-topbar-mail-btn:focus-visible {
  outline: 2px solid #a3a3a3;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .axle-topbar-mail-btn {
    padding: 0;
    width: 36px;
    justify-content: center;
  }
  .axle-topbar-mail-btn__label { display: none; }
}

/* Topbar ticket alert — yellow pill linking to Open Tickets */
.axle-topbar-ticket-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #b45309;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
  animation: axle-ticket-alert-pulse 2.6s ease-in-out infinite;
}
.axle-topbar-ticket-alert:hover { animation: none; border-color: #f59e0b; }
@keyframes axle-ticket-alert-pulse {
  0%, 100% {
    border-color: #fcd34d;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
  50% {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  }
}
@media (prefers-reduced-motion: reduce) {
  .axle-topbar-ticket-alert { animation: none; }
}
.axle-topbar-ticket-alert:hover {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
  text-decoration: none;
}
.axle-topbar-ticket-alert:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}
.axle-topbar-ticket-alert .material-symbols-outlined {
  font-size: 17px;
  color: #d97706;
}
.axle-topbar-ticket-alert__counts { font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
  .axle-topbar-ticket-alert__prefix { display: none; }
}

.axle-topbar-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 6px 0 10px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.axle-topbar-privacy-pill .material-symbols-outlined {
  font-size: 17px;
  color: #2563eb;
}
.axle-topbar-privacy-pill__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.axle-topbar-privacy-pill__off {
  border: 0;
  cursor: pointer;
  background: #1d4ed8;
  color: #fff;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.axle-topbar-privacy-pill__off:hover { background: #1e40af; }

.privacy-brand-list {
  /* Fixed height so the modal doesn't jump when brands finish loading */
  height: 260px;
  overflow-y: auto;
  border: 1px solid var(--axle-border);
  border-radius: var(--axle-radius-sm, 6px);
  padding: 4px;
}
.privacy-brand-skel {
  padding: 11px 10px;
}
.privacy-brand-skel .sk-line {
  display: block;
  margin: 0;
}
.privacy-brand-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  font-size: 13.5px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--axle-fg);
  cursor: pointer;
}
.privacy-brand-option:hover { background: var(--axle-hover); }

[x-cloak] { display: none !important; }

.axle-content {
  margin-left: 240px;
  min-height: 100vh;
}

.axle-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 32px 64px;
}

/* Horizontal scroll wrapper for wide tables */
.axle-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.axle-sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  html { overflow-x: hidden; }

  .axle-sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
    box-shadow: none;
  }
  .axle-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.14);
  }

  .axle-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 29;
  }
  .axle-sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .axle-content {
    margin-left: 0;
    min-width: 0;
    overflow-x: clip;
  }

  body.sidebar-open { overflow: hidden; }

  .axle-topbar {
    padding: 0 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .axle-topbar-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }
  .axle-topbar-actions {
    flex-shrink: 0;
    gap: 4px;
  }

  .axle-page {
    padding: 16px 16px 48px;
  }

  .axle-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .axle-page-header > .flex {
    flex-wrap: wrap;
    width: 100%;
  }
  .axle-page-title { font-size: 20px; }

  .axle-breadcrumb {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .axle-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .axle-card-header > .flex {
    flex-wrap: wrap;
    width: 100%;
  }
  .axle-card-body { padding: 16px; }

  .axle-tabs {
    flex-wrap: wrap;
    row-gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .axle-tabs::-webkit-scrollbar { display: none; }
  .axle-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Filter bars: search inputs full-width on first row */
  .axle-card > .flex.flex-wrap > .relative.flex-1,
  .axle-card > .flex.flex-wrap > .search-input {
    flex: 1 1 100%;
    min-width: 0 !important;
  }
  .summary-toolbar .summary-search {
    flex: 1 1 100%;
    min-width: 0 !important;
  }
  .summary-date-group {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .summary-date-field { flex: 1; min-width: 0; width: auto; }

  .axle-card > .flex.flex-wrap > .ml-auto {
    margin-left: 0;
    flex: 1 1 100%;
  }

  .axle-table-wrap,
  .axle-card-body[style*="overflow-x"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .dataTables_wrapper .dataTables_filter {
    width: 100%;
  }
  .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-top: 6px;
  }
  .dataTables_wrapper .dataTables_paginate {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .axle-topbar .axle-dropdown,
  .axle-page .axle-dropdown {
    max-width: min(320px, calc(100vw - 24px));
  }

  .btn-icon {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  .axle-nav-item {
    min-height: 44px;
    padding: 10px 12px;
  }
  .axle-tab {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .kpi-card .kpi-value { font-size: 24px; }

  .activity-item {
    flex-wrap: wrap;
    align-items: flex-start;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .activity-item > .badge,
  .activity-item > span.badge {
    margin-left: 44px;
  }

  .day-header {
    padding-left: 16px;
    padding-right: 16px;
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .day-header-count { margin-left: 0; width: 100%; }

  .report-card {
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
  }
  .report-card .report-arrow { opacity: 1; }

  .month-card .axle-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .month-card .month-summary {
    align-items: flex-start;
    text-align: left;
    margin-top: 4px;
  }

  .pay-meta {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .pay-balance {
    flex-wrap: wrap;
  }

  .axle-drawer {
    width: 100vw;
    max-width: 100vw;
  }
  .drawer-meta {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .drawer-meta dt { padding-top: 0; }
  .drawer-meta dd + dt { margin-top: 8px; }

  .axle-modal-backdrop { padding: 16px; }
  .axle-modal-footer {
    flex-wrap: wrap;
  }
  .axle-drawer-footer {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .axle-drawer-footer .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .axle-pills {
    flex-wrap: wrap;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .axle-page-title { font-size: 18px; }

  .kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .login-stage {
    padding: 24px 16px;
  }
  .login-stage::before {
    width: min(100vw, 320px);
    height: min(100vw, 320px);
    top: -8%;
    left: -24%;
  }
  .login-glow {
    width: min(100vw, 340px);
    height: min(100vw, 340px);
  }
  .login-card {
    padding: 36px 28px 32px;
    border-radius: 12px;
  }
  .login-brand {
    margin-bottom: 28px;
  }
  .login-form {
    gap: 18px;
  }
  .login-form .btn-primary {
    min-height: 48px;
  }
  .login-form .form-input {
    min-height: 44px;
  }
}

/* ---------- Sidebar nav ---------- */

.axle-nav-section {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--axle-fg-subtle);
  padding: 18px 20px 6px;
}
.axle-nav-section:first-child { padding-top: 8px; }

.axle-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 1px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--axle-fg-muted);
  border-radius: var(--axle-radius-sm);
  position: relative;
  transition: background 80ms ease, color 80ms ease;
}
.axle-nav-item:hover { background: var(--axle-hover); color: var(--axle-fg); text-decoration: none; }
/* ---------- Material Symbols ---------- */
/* Reserve a fixed icon box so layouts don't reflow while the icon font loads.
   Without width/height, the literal ligature text ("group_add", etc.) measures
   in the fallback font and shoves labels around until Material Symbols arrives. */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  width: 1em;
  height: 1em;
  overflow: hidden;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  flex-shrink: 0;
  vertical-align: middle;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.axle-nav-item .material-symbols-outlined { font-size: 19px; color: var(--axle-fg-subtle); }
.axle-nav-item:hover .material-symbols-outlined { color: var(--axle-fg); }
.axle-nav-brand-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  display: block;
}
.axle-nav-inbox-count {
  font-weight: 700;
  color: var(--axle-fg);
}
/* Scheduled-review lock: composer opened on a pending "Send later" email.
   Everything below the banner is inert until the schedule is cancelled. */
.mi-compose-sched-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 10px 24px;
  background: var(--axle-warning-bg, #fff7e6);
  border-bottom: 1px solid var(--axle-warning-border, #f0d9a8);
  color: var(--axle-fg);
  font-size: 13px;
}
.mi-compose-sched-banner .material-symbols-outlined {
  font-size: 19px;
  color: var(--axle-warning, #b25e09);
}
.mi-compose-sched-banner-copy { flex: 1 1 auto; min-width: 0; }
.mi-compose-sched-banner-copy strong { font-weight: 600; }
.mi-compose-sched-cancel { flex-shrink: 0; white-space: nowrap; }
.mi-compose-drawer.is-sched-review .mi-compose-body,
.mi-compose-drawer.is-sched-review footer {
  pointer-events: none;
  opacity: .6;
}

/* Outlook-style compose drawer: fixed rows, editor fills the balance */
.mi-compose-drawer .axle-drawer-body.mi-compose-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.mi-compose-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--axle-border);
}
.mi-compose-row:focus-within { border-bottom-color: var(--axle-border-strong, #d4d4d4); }
.mi-compose-row-label {
  flex: 0 0 56px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--axle-fg-muted);
  user-select: none;
}
.mi-compose-row-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: 13.5px;
  color: var(--axle-fg);
  padding: 9px 0;
}
.mi-compose-row-input::placeholder { color: var(--axle-fg-subtle); }
.mi-compose-pill-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  cursor: text;
}
.mi-compose-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 6px 3px 8px;
  border: 1px solid var(--axle-border);
  border-radius: 999px;
  background: var(--axle-hover, #f3f3f3);
  font-size: 12.5px;
  color: var(--axle-fg);
  line-height: 1.2;
}
.mi-compose-pill-label {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.mi-compose-pill-email {
  color: var(--axle-fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.mi-compose-pill button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--axle-fg-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  border-radius: 999px;
}
.mi-compose-pill button:hover { color: var(--axle-fg); background: rgba(0,0,0,.06); }
.mi-compose-pill-input {
  flex: 1 1 120px;
  min-width: 120px;
  border: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
  color: var(--axle-fg);
  padding: 4px 0;
}
.mi-compose-pill-input::placeholder { color: var(--axle-fg-subtle); }
.mi-compose-tb-ticket {
  gap: 4px;
  padding-left: 8px !important;
  padding-right: 10px !important;
  width: auto !important;
}
.mi-compose-tb-ticket-label {
  font-size: 12px;
  font-weight: 550;
}
.mi-compose-task-section {
  flex-shrink: 0;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--axle-border);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Cap the panel and scroll inside it so the email body below stays visible. */
  max-height: 55%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mi-compose-task-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.mi-compose-task-title {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--axle-fg-subtle);
}
.mi-compose-task-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--axle-fg-muted);
  line-height: 1.35;
}
.mi-compose-task-section #mi-compose-rte-description .rte-wrapper {
  border-color: var(--axle-border);
  border-radius: var(--axle-radius);
  background: #fff;
}
.mi-compose-remove-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--axle-fg);
  cursor: pointer;
  user-select: none;
}
.mi-compose-remove-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--axle-accent, #111);
}
.mi-compose-task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.mi-compose-row-toggles {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.mi-compose-cc-toggle {
  border: 0;
  background: transparent;
  color: var(--axle-fg-muted);
  font-size: 12.5px;
  font-weight: 550;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.mi-compose-cc-toggle:hover { background: rgba(0,0,0,.05); color: var(--axle-fg); }
.mi-compose-cc-toggle.is-on { color: var(--axle-fg); background: #f1f1f1; }
.mi-compose-ai-panel {
  flex-shrink: 0;
  margin: 0;
  padding: 12px 24px;
  border-radius: 0;
  background: linear-gradient(145deg, #faf5ff 0%, #f5f3ff 48%, #eef2ff 100%);
  border: 1px solid rgba(109, 40, 217, 0.18);
  border-left: 0;
  border-right: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.mi-compose-ai-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.mi-compose-ai-icon {
  font-size: 22px;
  color: #7e22ce;
  margin-top: 1px;
}
.mi-compose-ai-copy { flex: 1 1 auto; min-width: 0; }
.mi-compose-ai-title {
  font-size: 13.5px;
  font-weight: 650;
  color: #5b21b6;
  line-height: 1.25;
}
.mi-compose-ai-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
}
.mi-compose-drawer {
  position: relative;
}
.mi-compose-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: color-mix(in srgb, var(--axle-brand, #2563eb) 12%, rgba(255,255,255,.92));
  border: 2px dashed var(--axle-brand, #2563eb);
  border-radius: inherit;
  pointer-events: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--axle-fg);
}
.mi-compose-drop-overlay .material-symbols-outlined {
  font-size: 36px;
  color: var(--axle-brand, #2563eb);
}
.mi-compose-ai-btn {
  flex-shrink: 0;
  white-space: nowrap;
  gap: 6px;
}
.mi-compose-ai-kbd {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 5px;
  border: 1px solid var(--axle-border);
  border-radius: 4px;
  background: #fff;
  font-size: 10.5px;
  font-weight: 550;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--axle-fg-muted);
  line-height: 1.3;
}
.mi-compose-ai-input {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 64px;
  border: 1px solid rgba(109, 40, 217, 0.2);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--axle-fg);
  font-family: inherit;
  outline: none;
}
.mi-compose-ai-input:focus {
  border-color: rgba(109, 40, 217, 0.45);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.25);
}
.mi-compose-ai-input::placeholder { color: #9ca3af; }
.mi-compose-footerbar {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
}
.mi-compose-draft-saved {
  font-size: 12px;
  font-weight: 400;
  color: var(--axle-fg-muted);
  min-width: 0;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mi-compose-send-kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.9;
}
.mi-compose-send-kbd .mi-compose-kbd-hint {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 10px;
  padding: 0 5px;
}
.mi-compose-send-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.mi-compose-send-split .mi-compose-send-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.mi-compose-send-split .mi-compose-send-caret {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 6px;
  padding-right: 6px;
}
.mi-compose-send-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 60;
  min-width: 280px;
  padding: 4px;
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}
.mi-compose-send-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--axle-fg);
}
.mi-compose-send-opt:hover {
  background: var(--axle-hover);
}
.mi-compose-send-opt-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.mi-compose-send-opt-label {
  font-size: 13px;
  font-weight: 600;
}
.mi-compose-send-opt-sub {
  font-size: 11.5px;
  color: var(--axle-fg-muted);
}
.mi-compose-send-opt-check {
  color: var(--axle-brand, #4e897d);
  flex-shrink: 0;
}
.mi-compose-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  padding: 12px 20px;
  background: var(--axle-bg);
}
.mi-compose-footer-actions--end {
  justify-content: flex-end;
}
.mi-compose-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mi-compose-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.mi-compose-suggest {
  position: absolute;
  z-index: 40;
  left: 80px;
  right: 24px;
  top: calc(100% + 2px);
  background: #fff;
  border: 1px solid var(--axle-border-strong);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}
.mi-compose-suggest-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--axle-fg);
}
.mi-compose-suggest-opt:hover,
.mi-compose-suggest-opt.is-active { background: var(--axle-hover); }
.mi-compose-suggest-name { font-size: 13.5px; font-weight: 550; line-height: 1.25; }
.mi-compose-suggest-email { font-size: 12px; color: var(--axle-fg-muted); }
.mi-compose-editor-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  position: relative;
}
.mi-compose-link-pop {
  position: absolute;
  top: 42px;
  left: 8px;
  z-index: 30;
  width: 320px;
  max-width: calc(100% - 16px);
  background: #fff;
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  box-shadow: 0 10px 32px -12px rgba(0,0,0,.25);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mi-compose-link-pop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}
.mi-compose-tb-btn.is-open {
  background: rgba(0,0,0,.08);
  color: var(--axle-fg);
}
.mi-compose-scroll {
  flex: 1 1 auto;
  /* Keep the email visible even when the task panel / analyze callout are open. */
  min-height: 140px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mi-compose-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--axle-border);
  background: #fafafa;
  flex-shrink: 0;
}
.mi-compose-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--axle-fg-muted);
  cursor: pointer;
  padding: 0;
  position: relative;
}
.mi-compose-tb-btn:hover:not(:disabled) {
  background: rgba(0,0,0,.06);
  color: var(--axle-fg);
}
.mi-compose-tb-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.mi-compose-tb-btn .material-symbols-outlined { font-size: 18px; }
.mi-compose-tb-sep {
  width: 1px;
  height: 18px;
  background: var(--axle-border);
  margin: 0 4px;
}
.mi-compose-tb-color input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.mi-compose-editor {
  flex: 0 0 auto;
  min-height: 140px;
  max-height: none;
  overflow: visible;
  padding: 14px 24px;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 10pt !important;
  line-height: 1.45;
  /* Kill Inter shell inheritance (feature settings + tight tracking). */
  font-feature-settings: normal !important;
  font-variation-settings: normal !important;
  letter-spacing: normal !important;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: auto;
  white-space: normal;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none;
  color: #111;
}
.mi-compose-editor,
.mi-compose-editor *:not(.material-symbols-outlined):not(pre):not(code) {
  font-family: Arial, Helvetica, sans-serif !important;
  font-feature-settings: normal !important;
  font-variation-settings: normal !important;
  letter-spacing: normal !important;
}
.mi-compose-editor pre,
.mi-compose-editor code {
  font-family: 'Courier New', Courier, Menlo, Consolas, monospace !important;
  font-feature-settings: normal !important;
  font-variation-settings: normal !important;
  letter-spacing: normal !important;
}
.mi-compose-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--axle-fg-subtle);
  font-family: Arial, Helvetica, sans-serif !important;
}
.mi-compose-editor p { margin: 0 0 0.85em; }
.mi-compose-editor p:last-child { margin-bottom: 0; }
/* Tailwind Preflight sets list-style: none — restore markers in the editor */
.mi-compose-editor ul,
.mi-compose-editor ol {
  margin: 0 0 0.85em;
  padding-left: 1.4em;
}
.mi-compose-editor ul { list-style: disc outside; }
.mi-compose-editor ol { list-style: decimal outside; }
.mi-compose-editor ul ul { list-style: circle outside; }
.mi-compose-kbd-hint {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--axle-border);
  border-radius: 4px;
  background: #fff;
  font-size: 10.5px;
  font-family: inherit;
  line-height: 1.5;
}
.mi-compose-quote {
  flex: 0 0 auto;
  /* Separator lives inside Graph/Outlook quote HTML (single hr) — no extra border here. */
  border-top: 0;
  background: #fff;
}
.mi-compose-quote-loading {
  padding: 16px 24px;
  font-size: 13px;
  color: var(--axle-fg-muted);
}
.mi-compose-quote-frame {
  display: block;
  width: 100%;
  min-height: 40px;
  border: 0;
  background: #fff;
  pointer-events: none;
}
.mi-compose-editor li { margin: 0.2em 0; }
.mi-compose-editor .mi-compose-sig-block {
  margin-top: 12px;
  padding-top: 0;
  font-family: Arial, Helvetica, sans-serif !important;
  font-feature-settings: normal !important;
  font-variation-settings: normal !important;
  letter-spacing: normal !important;
  font-size: 10pt;
  line-height: 1.45;
  color: var(--axle-fg);
  user-select: none;
}
.mi-compose-editor .mi-compose-sig-block *:not(.material-symbols-outlined) {
  font-family: Arial, Helvetica, sans-serif !important;
  font-feature-settings: normal !important;
  font-variation-settings: normal !important;
  letter-spacing: normal !important;
}
.mi-compose-editor .mi-compose-sig-block img { max-width: 100%; height: auto; }
/* File download cards — lock icon aspect so Preflight img { height:auto } can't stretch. */
.mi-compose-editor .mi-file-card img {
  width: 22px !important;
  height: 27px !important;
  max-width: 22px !important;
  max-height: 27px !important;
  object-fit: contain;
}
.mi-compose-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 8px 24px;
  border-top: 1px solid var(--axle-border);
}
.mi-compose-progress-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--axle-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.mi-compose-progress-track {
  position: relative;
  flex: 1;
  min-width: 60px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.mi-compose-progress-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: var(--axle-brand, #4e897d);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.mi-compose-progress-track.is-indeterminate .mi-compose-progress-fill {
  width: 35%;
  animation: mi-compose-indet 1.1s ease-in-out infinite;
}
@keyframes mi-compose-indet {
  0% { left: -35%; }
  100% { left: 100%; }
}
.mi-compose-atts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 24px;
  border-top: 1px solid var(--axle-border);
  background: #fafafa;
}
.mi-compose-att {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 8px;
  border: 1px solid var(--axle-border);
  border-radius: 6px;
  font-size: 12.5px;
  background: #fff;
  max-width: 260px;
}

/* ---------- Compose: From (mailbox) selector ---------- */

.mi-compose-from-wrap {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.22s ease, opacity 0.18s ease, transform 0.22s ease;
  /* Sit above To/Cc/Subject so the mailbox menu isn't painted under them
     (.mi-compose-row is position:relative — later siblings win without this). */
  position: relative;
  z-index: 1;
}
.mi-compose-from-wrap.is-open {
  /* Match To/Cc row height (~pill-field 6px + control ~28px + 6px). */
  max-height: 48px;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
  z-index: 20;
}
.mi-compose-from-wrap.is-menu-open {
  z-index: 120;
}
.mi-compose-from-picker {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  /* Same vertical padding as .mi-compose-pill-field on To/Cc/Bcc. */
  padding: 6px 0;
  display: flex;
  align-items: center;
}
/* One-line chip — size aligned with recipient pills in the To row. */
.mi-compose-from-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 550;
  background: #f3f4f6;
  color: var(--axle-fg);
  border: 1px solid var(--axle-border);
  max-width: 100%;
  line-height: 1.2;
  cursor: pointer;
}
.mi-compose-from-pill:hover { background: var(--axle-hover); }
.mi-compose-from-pill > .avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
}
.mi-compose-from-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  text-align: left;
}
.mi-compose-from-name {
  font-size: 12.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mi-compose-from-upn {
  font-size: 12px; font-weight: 400; color: var(--axle-fg-subtle); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mi-compose-from-dd {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  z-index: 130;
  width: min(340px, 92vw);
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  padding: 6px;
}
.mi-compose-from-search { margin-bottom: 4px; }
.mi-compose-from-list { max-height: 240px; overflow-y: auto; }
.mi-compose-from-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
}
.mi-compose-from-opt:hover { background: var(--axle-hover); }
/* Menu options keep name over email, like Nova's picker dropdown. */
.mi-compose-from-opt .mi-compose-from-copy {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.mi-compose-from-opt .mi-compose-from-name { font-size: 12.5px; }
.mi-compose-from-opt.is-active { background: #f1f1f1; }
.mi-compose-from-check { margin-left: auto; color: var(--axle-fg); }
.mi-compose-from-empty {
  font-size: 12.5px;
  color: var(--axle-fg-muted);
  padding: 10px 8px;
}

/* ---------- Compose: paste-choice + code modals ---------- */

.mi-compose-choice-modal { max-width: 440px; width: 100%; padding: 18px 20px; }
.mi-compose-code-modal { max-width: 560px; width: 100%; padding: 18px 20px; }
.mi-compose-choice-title { font-size: 15px; font-weight: 650; margin: 0 0 2px; }
.mi-compose-choice-sub { font-size: 12.5px; color: var(--axle-fg-muted); margin: 0 0 12px; }
.mi-compose-choice-opts { display: flex; flex-direction: column; gap: 6px; }
.mi-compose-choice-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}
.mi-compose-choice-opt:hover:not(:disabled) { background: var(--axle-hover); border-color: #cfcfcf; }
.mi-compose-choice-opt:disabled { opacity: 0.55; cursor: not-allowed; }
.mi-compose-choice-opt .material-symbols-outlined { font-size: 20px; color: var(--axle-fg-muted); flex-shrink: 0; }
.mi-compose-choice-copy { display: flex; flex-direction: column; }
.mi-compose-choice-label { font-size: 13px; font-weight: 600; }
.mi-compose-choice-desc { font-size: 11.5px; color: var(--axle-fg-muted); margin-top: 1px; }
.mi-compose-code-input {
  width: 100%;
  font-family: 'Courier New', Courier, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 6px;
  white-space: pre;
}
.mi-compose-modal .axle-modal-footer { margin-top: 12px; }

/* ---------- Compose: AI rewrite menu ---------- */

.mi-compose-tb-ai { position: relative; display: inline-flex; }
.mi-compose-tb-ai-btn .material-symbols-outlined { color: #7e22ce; }
.mi-compose-ai-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 70;
  min-width: 264px;
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  padding: 4px;
}
.mi-compose-ai-menu-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}
.mi-compose-ai-menu-opt:hover { background: var(--axle-hover); }
.mi-compose-ai-menu-opt .material-symbols-outlined { color: var(--axle-fg-muted); }
.mi-compose-ai-label { flex: 1; min-width: 0; white-space: nowrap; }
.mi-compose-ai-kbd {
  margin-left: 12px;
  font-size: 10.5px;
  color: var(--axle-fg-muted);
  white-space: nowrap;
  opacity: 0.8;
}
.mi-compose-ai-group {
  padding: 6px 10px 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--axle-fg-muted);
}
.mi-compose-ai-analyze { background: #fffbeb; }
.mi-compose-ai-analyze:hover { background: #fef3c7; }
.mi-compose-ai-analyze .material-symbols-outlined { color: #b45309; }
.mi-compose-ai-custom { border-top: 1px solid var(--axle-border); margin-top: 4px; padding-top: 4px; }
.mi-compose-ai-custom-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px;
}
.mi-compose-ai-custom-row .form-input {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  padding: 6px 8px;
}

/* ---------- Compose: analyze (boss review) panel ---------- */

.mi-compose-analyze {
  flex-shrink: 0;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  border-radius: 10px;
  background: #fffbeb;
  margin: 8px 12px 0;
  padding: 10px 12px;
  color: #78350f;
  max-height: 40%;
  display: flex;
  flex-direction: column;
}
.mi-compose-analyze-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12.5px;
  color: #92400e;
}
.mi-compose-analyze-head .material-symbols-outlined { color: #b45309; }
.mi-compose-analyze-title { flex: 1; }
.mi-compose-analyze-act {
  border: 0;
  background: transparent;
  color: #92400e;
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}
.mi-compose-analyze-act:hover { background: #fef3c7; }
.mi-compose-analyze-act:disabled { opacity: 0.6; cursor: default; }
.mi-compose-analyze-body {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-y: auto;
  white-space: normal;
}
.mi-compose-analyze-body .mi-compose-analyze-li {
  position: relative;
  padding-left: 14px;
}
.mi-compose-analyze-body .mi-compose-analyze-li::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: #b45309;
}
.mi-compose-analyze-gap { height: 6px; }
.mi-compose-analyze-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 2px;
  vertical-align: -2px;
  background: #b45309;
  animation: mi-analyze-blink 0.9s steps(2, start) infinite;
}
@keyframes mi-analyze-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- Compose: pasted-URL preview offer ---------- */

.mi-compose-linkprev-pop {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  padding: 8px 10px;
  font-size: 12.5px;
  max-width: min(520px, 92%);
}
.mi-compose-linkprev-url {
  color: var(--axle-fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Compose: schedule meeting ---------- */

.mi-compose-meeting {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 24px 12px;
  border: 1px solid #ddd6fe;
  border-left: 0;
  border-right: 0;
  background: #faf5ff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mi-compose-meeting-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.mi-compose-meeting-head > .material-symbols-outlined { font-size: 18px; color: #7c3aed; }
.mi-compose-meeting-title { font-size: 13px; font-weight: 650; color: #6d28d9; }
.mi-compose-meeting-sub {
  font-size: 11.5px;
  color: var(--axle-fg-subtle);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mi-compose-meeting-head .btn { margin-left: auto; }
.mi-compose-meeting-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 8px;
}
.mi-compose-meeting-grid--wide { grid-template-columns: 1fr 1.35fr; }
.mi-compose-meeting-grid label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mi-compose-meeting-grid input[type="time"].form-input {
  padding-left: 8px;
  padding-right: 6px;
}

/* ---------- Compose: send later ---------- */

.mi-compose-sched-pop {
  /* Wide enough that type=time inputs fit "hh:mm AM" plus the clock icon. */
  min-width: 480px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mi-compose-sched-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
}
.mi-compose-sched-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 8px;
}
.mi-compose-sched-grid label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mi-compose-sched-grid input[type="time"].form-input {
  padding-left: 8px;
  padding-right: 6px;
}
.mi-compose-sched-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px 24px;
  border-top: 1px solid #e9d5ff;
  background: #faf5ff;
  font-size: 12.5px;
  color: #6b21a8;
}
.mi-compose-sched-banner .material-symbols-outlined { color: #7e22ce; }
.mi-compose-sched-banner button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #7e22ce;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.axle-nav-item.active {
  background: #f1f1f1;
  color: var(--axle-fg);
  font-weight: 600;
}
.axle-nav-item.active .material-symbols-outlined { color: var(--axle-fg); }
.axle-nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--axle-fg);
  border-radius: 0 2px 2px 0;
}

/* ---------- Cards ---------- */

.axle-card {
  background: var(--axle-surface);
  border: 1px solid var(--axle-border);
  border-radius: var(--axle-radius);
  box-shadow: var(--axle-shadow);
}
.axle-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--axle-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.axle-card-body { padding: 20px; }
.axle-card-title { font-size: 14px; font-weight: 600; color: var(--axle-fg); margin: 0; }
.axle-card-subtitle { font-size: 12.5px; color: var(--axle-fg-muted); margin-top: 2px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 12px;
  border-radius: var(--axle-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 80ms ease, border-color 80ms ease, color 80ms ease;
  white-space: nowrap;
  user-select: none;
}
.btn .material-symbols-outlined { font-size: 16px; }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--axle-fg); color: #fff; border-color: var(--axle-fg); }
.btn-primary:hover { background: #262626; border-color: #262626; }

.btn-secondary { background: var(--axle-surface); color: var(--axle-fg); border-color: var(--axle-border-strong); }
.btn-secondary:hover { background: var(--axle-hover); border-color: var(--axle-border-strong); }

.btn-ghost { background: transparent; color: var(--axle-fg-muted); }
.btn-ghost:hover { background: var(--axle-hover); color: var(--axle-fg); }

.btn-outline-dark { background: transparent; color: var(--axle-fg); border-color: var(--axle-fg); }
.btn-outline-dark:hover { background: var(--axle-hover); }

/* Read-only notes body in the View Activity drawer */
.activity-view-notes p { margin: 0 0 8px; }
.activity-view-notes ul, .activity-view-notes ol { margin: 0 0 8px; padding-left: 20px; }
/* Tailwind Preflight sets list-style: none — restore markers */
.activity-view-notes ul { list-style: disc outside; }
.activity-view-notes ol { list-style: decimal outside; }
.activity-view-notes ul ul { list-style: circle outside; }
.activity-view-notes li { margin: 3px 0; }
.activity-view-notes a { color: var(--axle-fg); text-decoration: underline; }

/* AI summary callout — shared twin of the inbox Conversation Summary
   (.mi-conv-summary in mailbox-inbox-view.php). */
.axle-ai-callout {
  display: flex; gap: 10px; align-items: flex-start;
  background: #faf5ff;
  border: 1px solid var(--axle-border);
  border-left: 3px solid #7e22ce;
  border-radius: 8px; padding: 12px 14px;
}
.axle-ai-callout .material-symbols-outlined {
  font-size: 18px; color: #7e22ce; margin-top: 1px; flex-shrink: 0;
}
.axle-ai-callout-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: #7e22ce; margin-bottom: 2px;
}
.axle-ai-callout-text {
  font-size: 13px; line-height: 1.45; color: var(--axle-fg-muted);
  white-space: pre-wrap; word-break: break-word;
}

.btn-link {
  background: transparent;
  border-color: transparent;
  color: var(--axle-fg);
  padding: 0;
  height: auto;
  min-height: 0;
  gap: 4px;
  font-weight: 500;
}
.btn-link:hover {
  background: transparent;
  color: var(--axle-brand);
  text-decoration: underline;
}
.btn-link:disabled { text-decoration: none; }

.btn-danger { background: var(--axle-danger); color: #fff; border-color: var(--axle-danger); }
.btn-danger:hover { background: #93291a; border-color: #93291a; }

.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-sm .material-symbols-outlined { font-size: 14px; }
.btn-lg { padding: 11px 16px; font-size: 14px; }
.btn-icon { padding: 7px; }

/* ---------- Form fields ---------- */

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--axle-fg);
  margin-bottom: 6px;
}
.form-help { font-size: 12px; color: var(--axle-fg-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--axle-danger); margin-top: 4px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--axle-fg);
  background: var(--axle-surface);
  border: 1px solid var(--axle-border-strong);
  border-radius: var(--axle-radius-sm);
  padding: 8px 11px;
  transition: border-color 80ms ease, box-shadow 80ms ease;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--axle-fg-subtle); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--axle-fg);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--axle-danger);
}
.form-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1); }
.form-textarea { resize: vertical; min-height: 88px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' fill='none' stroke='%230a0a0a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}
/* Combobox triggers supply their own chevron icon; suppress the CSS arrow. */
.form-select.roi-combobox-trigger {
  background-image: none;
  padding-right: 11px;
}

.form-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--axle-border-strong);
  background: var(--axle-surface);
  cursor: pointer;
  transition: background 80ms ease, border-color 80ms ease;
}
.form-check input[type="checkbox"] { border-radius: 4px; }
.form-check input[type="radio"]    { border-radius: 50%; }
.form-check input[type="checkbox"]:checked,
.form-check input[type="radio"]:checked {
  background: var(--axle-fg);
  border-color: var(--axle-fg);
}
.form-check input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 6.5l2.5 2.5 4.5-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}
.form-check input[type="radio"]:checked {
  box-shadow: inset 0 0 0 3px var(--axle-surface);
}

.form-switch {
  appearance: none;
  width: 30px; height: 18px;
  background: #d4d4d4;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 120ms ease;
}
.form-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 120ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.form-switch:checked { background: var(--axle-fg); }
.form-switch:checked::after { transform: translateX(12px); }

.input-group { display: flex; align-items: stretch; }
.input-group .form-input { border-radius: 0; }
.input-group .form-input:first-child { border-top-left-radius: var(--axle-radius-sm); border-bottom-left-radius: var(--axle-radius-sm); }
.input-group .form-input:last-child  { border-top-right-radius: var(--axle-radius-sm); border-bottom-right-radius: var(--axle-radius-sm); }
.input-group .input-addon {
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  font-size: 13px;
  background: #f5f5f5;
  border: 1px solid var(--axle-border-strong);
  color: var(--axle-fg-muted);
}
.input-group .input-addon:first-child { border-right: 0; border-top-left-radius: var(--axle-radius-sm); border-bottom-left-radius: var(--axle-radius-sm); }
.input-group .input-addon:last-child  { border-left: 0;  border-top-right-radius: var(--axle-radius-sm); border-bottom-right-radius: var(--axle-radius-sm); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--axle-border);
  background: #fafafa;
  color: var(--axle-fg-muted);
  line-height: 1.4;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge.is-active   { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.badge.is-pending  { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.badge.is-cancelled{ background: #fef3f2; border-color: #fecdca; color: #b42318; }
.badge.is-expired  { background: #f5f5f5; border-color: #e5e5e5; color: #525252; }
.badge.is-suspended{ background: #f8f9fc; border-color: #d5d9eb; color: #363f72; }

/* ---------- Alerts ---------- */

.alert {
  border: 1px solid var(--axle-border);
  border-radius: var(--axle-radius);
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.alert-info    { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.alert-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.alert-warning { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.alert-danger  { background: #fef3f2; border-color: #fecdca; color: #b42318; }

/* ---------- Tables ---------- */

.axle-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.axle-table thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--axle-fg-muted);
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--axle-border);
  white-space: nowrap;
}
.axle-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--axle-border);
  color: var(--axle-fg);
  vertical-align: middle;
}
.axle-table tbody tr:last-child td { border-bottom: 0; }
.axle-table tbody tr:hover td { background: #fafafa; }

/* Alignment utilities lose to the rules above on specificity — re-assert them
   so th/td can opt into right/center alignment. */
.axle-table thead th.text-right { text-align: right; }
.axle-table thead th.text-center { text-align: center; }
.axle-table tbody td.text-right { text-align: right; }
.axle-table tbody td.text-center { text-align: center; }

/* ---------- DataTables overrides ---------- */

.dataTables_wrapper { font-size: 13px; color: var(--axle-fg-muted); }
.dataTables_wrapper .dataTables_filter input {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 11px;
  border: 1px solid var(--axle-border-strong);
  border-radius: var(--axle-radius-sm);
  margin-left: 8px;
  outline: none;
  transition: border-color 80ms ease, box-shadow 80ms ease;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--axle-fg);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}
.dataTables_wrapper .dataTables_length select {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 26px 6px 10px;
  border: 1px solid var(--axle-border-strong);
  border-radius: var(--axle-radius-sm);
  margin: 0 6px;
}
.dataTables_wrapper table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0;
  width: 100% !important;
}
.dataTables_wrapper table.dataTable thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--axle-fg-muted);
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--axle-border);
  border-top: 1px solid var(--axle-border);
}
.dataTables_wrapper table.dataTable thead th:first-child { border-left: 1px solid var(--axle-border); }
.dataTables_wrapper table.dataTable thead th:last-child  { border-right: 1px solid var(--axle-border); }
.dataTables_wrapper table.dataTable tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--axle-border);
  font-size: 13px;
  color: var(--axle-fg);
  vertical-align: middle;
}
.dataTables_wrapper table.dataTable thead th {
  padding: 12px 18px;
}
.dataTables_wrapper table.dataTable tbody td:first-child { border-left: 1px solid var(--axle-border); }
.dataTables_wrapper table.dataTable tbody td:last-child  { border-right: 1px solid var(--axle-border); }
.dataTables_wrapper table.dataTable tbody tr:hover td { background: #fafafa; }
.dataTables_wrapper table.dataTable.no-footer { border-bottom: 0; }

/* Overdue / past-due row tint — mirrors the old CRM's #ffe5e5 cue but in a
   more refined way that matches our `is-cancelled` badge palette. The
   first cell carries an inset red rule so the row reads as urgent at a
   glance even when scrolling horizontally. */
.dataTables_wrapper table.dataTable tbody tr.is-overdue td,
.axle-table tbody tr.is-overdue td {
  background: #fef3f2;
}
.dataTables_wrapper table.dataTable tbody tr.is-overdue:hover td,
.axle-table tbody tr.is-overdue:hover td {
  background: #fde8e6;
}
.dataTables_wrapper table.dataTable tbody tr.is-overdue td:first-child,
.axle-table tbody tr.is-overdue td:first-child {
  box-shadow: inset 3px 0 0 #b42318;
}
.text-overdue,
.is-overdue .text-overdue { color: #b42318; font-weight: 500; }
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { padding-top: 14px; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 5px 10px !important;
  margin: 0 2px;
  font-size: 12.5px;
  border: 1px solid var(--axle-border) !important;
  background: var(--axle-surface) !important;
  border-radius: var(--axle-radius-sm);
  color: var(--axle-fg-muted) !important;
  box-shadow: none !important;
}
/* Override DataTables default hover (white text) so numbers stay readable. */
body .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--axle-hover) !important;
  border-color: var(--axle-border-strong) !important;
  color: var(--axle-fg) !important;
  box-shadow: none !important;
}
body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--axle-fg) !important;
  border-color: var(--axle-fg) !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.4;
  background: var(--axle-surface) !important;
  color: var(--axle-fg-muted) !important;
}
.dataTables_wrapper table.dataTable thead .sorting,
.dataTables_wrapper table.dataTable thead .sorting_asc,
.dataTables_wrapper table.dataTable thead .sorting_desc { cursor: pointer; }

/* Processing overlay — replace DataTables CDN blue dots with AXLE spinner */
.dataTables_wrapper .dataTables_processing {
  top: 50%;
  left: 50%;
  width: auto;
  min-width: 140px;
  margin: 0 !important;
  padding: 16px 20px;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--axle-fg-muted);
  background: var(--axle-surface);
  border: 1px solid var(--axle-border);
  border-radius: var(--axle-radius);
  box-shadow: var(--axle-shadow-lg);
  z-index: 10;
}
/* DataTables toggles visibility via inline display; upgrade block → flex without forcing always-on */
.dataTables_wrapper .dataTables_processing[style*="display: block"],
.dataTables_wrapper .dataTables_processing[style*="display:block"] {
  display: flex !important;
}
.dataTables_wrapper .dataTables_processing > div:last-child {
  display: none !important;
}
.dataTables_wrapper .dataTables_processing .axle-dt-spin {
  font-size: 20px;
  animation: axle-dt-spin 1s linear infinite;
}
@keyframes axle-dt-spin {
  to { transform: rotate(360deg); }
}

/* ---------- ApexCharts ---------- */

.apexcharts-tooltip.apexcharts-theme-light {
  border: 1px solid var(--axle-border) !important;
  box-shadow: var(--axle-shadow-lg) !important;
  border-radius: var(--axle-radius-sm) !important;
}
.apexcharts-tooltip-title {
  background: #fafafa !important;
  border-bottom: 1px solid var(--axle-border) !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
  background: var(--axle-fg) !important;
  color: #fff !important;
  border: 0 !important;
  font-size: 11px !important;
  border-radius: 4px !important;
}
.apexcharts-legend-text { color: var(--axle-fg-muted) !important; font-size: 12px !important; }

/* ---------- Utility ---------- */

.divider { height: 1px; background: var(--axle-border); width: 100%; }
.muted   { color: var(--axle-fg-muted); }
.subtle  { color: var(--axle-fg-subtle); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Modal (simple Alpine-friendly) ---------- */

.axle-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(2px);
  /* Above drawers (backdrop 1099 / panel 1100) so confirms work while a drawer is open. */
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.axle-modal {
  background: var(--axle-surface);
  border-radius: 12px;
  border: 1px solid var(--axle-border);
  box-shadow: var(--axle-shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
}
.axle-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--axle-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.axle-modal-body   { padding: 20px; }
.axle-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--axle-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fafafa;
  border-radius: 0 0 12px 12px;
}

/* ---------- Avatars ---------- */

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f1f1f1;
  color: var(--axle-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--axle-border);
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--axle-surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Avatar tones — muted, low-saturation palette that lives in the same
   family as the status badges (light tinted bg, muted border, medium fg).
   Auto-assigned by hashing the avatar's initials in app.js, so the same
   person reads the same color across every page. Keep in sync with
   axle-internal-app/lib/avatar-tone.ts (20 tones). */
.avatar.tone-1  { background: #f1f5f9; border-color: #e2e8f0; color: #475569; } /* slate   */
.avatar.tone-2  { background: #fef2f2; border-color: #fecaca; color: #b42318; } /* red     */
.avatar.tone-3  { background: #fff7ed; border-color: #fed7aa; color: #c2410c; } /* orange  */
.avatar.tone-4  { background: #fffbeb; border-color: #fde68a; color: #b45309; } /* amber   */
.avatar.tone-5  { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; } /* green   */
.avatar.tone-6  { background: #ebf5f2; border-color: #cfe3dd; color: #2f6358; } /* teal    */
.avatar.tone-7  { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; } /* cyan    */
.avatar.tone-8  { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; } /* blue    */
.avatar.tone-9  { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; } /* indigo  */
.avatar.tone-10 { background: #fdf2f8; border-color: #fbcfe8; color: #be185d; } /* pink    */
.avatar.tone-11 { background: #faf5ff; border-color: #e9d5ff; color: #7e22ce; } /* purple  */
.avatar.tone-12 { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; } /* violet  */
.avatar.tone-13 { background: #fdf4ff; border-color: #f5d0fe; color: #a21caf; } /* fuchsia */
.avatar.tone-14 { background: #fff1f2; border-color: #fecdd3; color: #be123c; } /* rose    */
.avatar.tone-15 { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; } /* sky     */
.avatar.tone-16 { background: #dcfce7; border-color: #86efac; color: #14532d; } /* dark green */
.avatar.tone-17 { background: #ecfdf5; border-color: #a7f3d0; color: #047857; } /* emerald */
.avatar.tone-18 { background: #fefce8; border-color: #fef08a; color: #a16207; } /* yellow  */
.avatar.tone-19 { background: #f7fee7; border-color: #d9f99d; color: #4d7c0f; } /* lime    */
.avatar.tone-20 { background: #fff7ed; border-color: #fdba74; color: #9a3412; } /* copper  */

/* ---------- Tabs ---------- */

.axle-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--axle-border);
}
.axle-tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--axle-fg-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 80ms ease, border-color 80ms ease;
}
.axle-tab:hover { color: var(--axle-fg); text-decoration: none; }
.axle-tab.active { color: var(--axle-fg); border-bottom-color: var(--axle-fg); font-weight: 600; }

.axle-pills { display: inline-flex; gap: 4px; padding: 3px; background: #f5f5f5; border-radius: var(--axle-radius-sm); }
.axle-pill {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--axle-fg-muted);
  border-radius: 5px;
  cursor: pointer;
  transition: background 80ms ease, color 80ms ease;
  user-select: none;
}
.axle-pill:hover { color: var(--axle-fg); text-decoration: none; }
.axle-pill.active { background: var(--axle-surface); color: var(--axle-fg); font-weight: 600; box-shadow: var(--axle-shadow); }

/* ---------- Dropdowns ---------- */

.axle-dropdown {
  background: var(--axle-surface);
  border: 1px solid var(--axle-border);
  border-radius: var(--axle-radius);
  box-shadow: var(--axle-shadow-lg);
  padding: 5px;
  min-width: 200px;
}

.axle-topbar .relative > .axle-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
}
.axle-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--axle-fg);
  border-radius: var(--axle-radius-sm);
  cursor: pointer;
}
.axle-dropdown-item:hover { background: var(--axle-hover); text-decoration: none; }
.axle-dropdown-item .material-symbols-outlined { font-size: 16px; color: var(--axle-fg-muted); }
.axle-dropdown-divider { height: 1px; background: var(--axle-border); margin: 5px 0; }

/* Dropdowns inside overflow-x table wrappers use fixed positioning (set via JS)
   so opening a menu does not expand the scrollable width. */
.axle-dropdown.is-fixed {
  position: fixed !important;
  z-index: 50;
}

/* Rich dropdown items — icon, bold title, and a short plain-English
   description. Used by topbar Quick Actions / Productivity and the inbox
   Tools menu. */
.axle-dropdown--rich { min-width: 280px; max-width: 320px; padding: 6px; }

/* Category separator between sections in a rich dropdown. */
.axle-dropdown-rich-item + .axle-dropdown-label {
  margin-top: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--axle-border);
}
.axle-dropdown-label {
  padding: 6px 10px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--axle-fg-subtle);
}
.axle-dropdown-rich-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: var(--axle-radius-sm);
  color: var(--axle-fg);
  cursor: pointer;
}
.axle-dropdown-rich-item:hover { background: var(--axle-hover); text-decoration: none; }
.axle-dropdown-rich-item > .material-symbols-outlined {
  font-size: 18px;
  color: var(--axle-fg-muted);
  margin-top: 1px;
  flex-shrink: 0;
}
.axle-dropdown-rich-item:hover > .material-symbols-outlined { color: var(--axle-fg); }
.axle-dropdown-rich-meta { min-width: 0; }
.axle-dropdown-rich-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.axle-dropdown-rich-desc {
  display: block;
  font-size: 11.5px;
  color: var(--axle-fg-muted);
  line-height: 1.35;
  margin-top: 1px;
}

/* ---------- Skeletons ---------- */

.skeleton {
  background: linear-gradient(90deg, #f1f1f1 0%, #e5e5e5 50%, #f1f1f1 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sk-line { height: 12px; }
.sk-line + .sk-line { margin-top: 8px; }

.sk-circle {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  flex-shrink: 0;
}

.skel-table { padding: 4px 0 8px; }
.skel-table table { width: 100%; border-collapse: collapse; }
.skel-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--axle-fg-subtle);
  padding: 10px 16px;
  border-bottom: 1px solid var(--axle-border);
}
.skel-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--axle-border);
  vertical-align: middle;
}
.skel-table tr:last-child td { border-bottom: 0; }
.skel-table .text-center { text-align: center; }
.skel-table .sk-line.ml-auto { margin-left: auto; }

.skel-kpi {
  height: 28px;
  width: 56%;
  max-width: 120px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.skel-list { list-style: none; margin: 0; padding: 0; }
.skel-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--axle-border);
}
.skel-list-item:last-child { border-bottom: 0; }
.skel-list-item .skel-list-body { flex: 1; min-width: 0; padding-top: 2px; }

.skel-chart {
  width: 100%;
  border-radius: var(--axle-radius);
}

/* ---------- Progress ---------- */

.axle-progress { width: 100%; height: 6px; background: #f1f1f1; border-radius: 999px; overflow: hidden; }
.axle-progress-bar { height: 100%; background: var(--axle-fg); border-radius: 999px; transition: width 200ms ease; }

/* ---------- Page header ---------- */

.axle-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.axle-page-title { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
.axle-page-subtitle { font-size: 13.5px; color: var(--axle-fg-muted); margin-top: 4px; }

.axle-breadcrumb { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--axle-fg-subtle); margin-bottom: 8px; }
.axle-breadcrumb a:hover { color: var(--axle-fg); text-decoration: none; }
.axle-breadcrumb .sep { font-size: 14px; color: var(--axle-fg-subtle); }

/* ---------- KPI ---------- */

.kpi-card .kpi-label {
  font-size: 12px;
  color: var(--axle-fg-muted);
  font-weight: 500;
  text-transform: none;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-card .kpi-label .material-symbols-outlined { font-size: 16px; color: var(--axle-fg-subtle); }
.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--axle-fg);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi-card .kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--axle-fg-muted);
}
.kpi-card .kpi-delta.up   { color: var(--axle-success); }
.kpi-card .kpi-delta.down { color: var(--axle-danger); }

/* ---------- Login (standalone auth) ---------- */

body.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: #f7f7f6;
}

.login-stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  overflow: hidden;
}

.login-stage::before {
  content: '';
  position: absolute;
  top: -18%;
  left: -12%;
  width: 52%;
  height: 52%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78, 137, 125, 0.09) 0%, transparent 68%);
  pointer-events: none;
}

.login-stage::after {
  content: '';
  position: absolute;
  bottom: -14%;
  right: -10%;
  width: 48%;
  height: 48%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 10, 10, 0.035) 0%, transparent 66%);
  pointer-events: none;
}

.login-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(78, 137, 125, 0.07) 0%,
    rgba(255, 255, 255, 0) 72%
  );
  pointer-events: none;
}

.login-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 392px;
}

.login-card {
  position: relative;
  background: var(--axle-surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85) inset,
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 12px 40px -16px rgba(0, 0, 0, 0.11),
    0 24px 64px -32px rgba(78, 137, 125, 0.14);
  padding: 44px 40px 40px;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 8%,
    rgba(78, 137, 125, 0.42) 50%,
    transparent 92%
  );
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}

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

.login-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--axle-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 8px 24px -4px rgba(0, 0, 0, 0.16);
}

.login-icon::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 16px;
  background: radial-gradient(circle at center, rgba(78, 137, 125, 0.22) 0%, transparent 70%);
  z-index: -1;
  opacity: 0.55;
}

.login-icon img {
  display: block;
  width: 28px;
  height: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form .form-field {
  display: flex;
  flex-direction: column;
}

.login-form .form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--axle-fg-subtle);
  margin-bottom: 8px;
}

.login-form .form-input {
  font-size: 14px;
  padding: 11px 13px;
  border-color: var(--axle-border);
  background: #fcfcfc;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.login-form .form-input:hover {
  border-color: var(--axle-border-strong);
  background: var(--axle-surface);
}

.login-form .form-input:focus {
  outline: none;
  border-color: rgba(78, 137, 125, 0.55);
  background: var(--axle-surface);
  box-shadow:
    0 0 0 3px rgba(78, 137, 125, 0.1),
    0 0 0 1px rgba(78, 137, 125, 0.14);
}

.login-form .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.login-form .btn-primary:hover:not(:disabled) {
  background: #171717;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.login-form .btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.login-card .alert-danger {
  margin-bottom: 20px;
  border-radius: var(--axle-radius-sm);
}

/* ---------- Off-canvas drawer (right side) ----------
   Pattern: a fixed full-height panel that slides in from the right plus a
   dimming backdrop. Use it for any inline editor like "Answer Question",
   "Edit Client", etc. — toggle by adding `.is-open` to both elements.
*/

.axle-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  z-index: 1099;
}
.axle-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.axle-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--axle-surface);
  border-left: 1px solid var(--axle-border);
  box-shadow: -20px 0 48px -16px rgba(0, 0, 0, 0.18);
  transform: translateX(calc(100% + 24px));
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1100;
  display: flex;
  flex-direction: column;
}
.axle-drawer.is-open { transform: translateX(0); }

/* Wide drawer for dense detail (API logs, JSON payloads) */
.axle-drawer.axle-drawer--xl {
  width: min(720px, 100vw);
}
.axle-drawer.axle-drawer--xxl {
  width: min(1100px, 100vw);
}

/* Full-width drawer for immersive detail views (ad previews) */
.axle-drawer.axle-drawer--full {
  width: 100vw;
}

/* Email compose / reply drafting — was 1040px; ~20% narrower */
.axle-drawer.axle-drawer--email {
  width: min(832px, 100vw);
}

/* Ask AXLE — chat drawer */
.axle-drawer.axle-drawer--ask-axle {
  width: min(720px, 100vw);
}
.axle-drawer--ask-axle .spin {
  animation: axle-email-reply-spin 0.8s linear infinite;
}

/* Ask Nova floating action button — scoots left when other drawers open */
.axle-nova-fab {
  --axle-fab-drawer-inset: 0px;
  position: fixed;
  right: calc(24px + var(--axle-fab-drawer-inset));
  bottom: 24px;
  z-index: 1080;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #4e897d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(78, 137, 125, 0.38), 0 2px 6px rgba(0, 0, 0, 0.12);
  transition:
    right 240ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}
.axle-nova-fab .material-symbols-outlined {
  font-size: 28px;
  color: #fff;
  line-height: 1;
}
.axle-nova-fab:hover {
  transform: scale(1.1);
  background: #3f7368;
  box-shadow: 0 10px 24px rgba(78, 137, 125, 0.45), 0 3px 8px rgba(0, 0, 0, 0.14);
}
.axle-nova-fab:active {
  transform: scale(1.04);
  background: #35665c;
}
.axle-nova-fab:focus-visible {
  outline: 2px solid #9dc4bb;
  outline-offset: 3px;
}
.axle-nova-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}
/* Soft two-hop intro — once per session via JS */
.axle-nova-fab.is-bounce {
  animation: axle-nova-fab-bounce 0.95s cubic-bezier(0.34, 1.35, 0.64, 1) 1;
}
@keyframes axle-nova-fab-bounce {
  0%   { transform: translateY(0) scale(1); }
  18%  { transform: translateY(-11px) scale(1.05); }
  34%  { transform: translateY(0) scale(1); }
  50%  { transform: translateY(-5px) scale(1.02); }
  66%, 100% { transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .axle-nova-fab.is-bounce { animation: none; }
}
@media (max-width: 640px) {
  .axle-nova-fab {
    right: calc(16px + var(--axle-fab-drawer-inset));
    bottom: 16px;
    width: 52px;
    height: 52px;
  }
  .axle-nova-fab .material-symbols-outlined { font-size: 26px; }
}
.ask-axle-header { gap: 10px; }
.ask-axle-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* New chat is the primary drawer action — Nova green, pill shape. */
.ask-axle-new-chat {
  background: #4e897d;
  border-color: #4e897d;
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
}
.ask-axle-new-chat:hover:not(:disabled) {
  background: #41756a;
  border-color: #41756a;
  color: #fff;
}
.ask-axle-new-chat:disabled {
  opacity: 0.55;
}
/* Conversation history layer (ChatGPT-style panel sliding from the left) */
.axle-drawer--ask-axle {
  overflow: hidden;
}
.ask-axle-history-scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  z-index: 60;
}
.ask-axle-history-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}
.ask-axle-history-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(320px, 85%);
  background: var(--axle-surface, #fff);
  border-right: 1px solid var(--axle-border);
  box-shadow: 20px 0 48px -16px rgba(0, 0, 0, 0.18);
  transform: translateX(calc(-100% - 24px));
  transition: transform 240ms ease;
  z-index: 61;
  display: flex;
  flex-direction: column;
}
.ask-axle-history-panel.is-open {
  transform: translateX(0);
}
.ask-axle-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 10px 16px;
  border-bottom: 1px solid var(--axle-border);
  flex-shrink: 0;
}
.ask-axle-history-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.ask-axle-history-search {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--axle-border);
  flex-shrink: 0;
}
.ask-axle-history-search > .material-symbols-outlined {
  position: absolute;
  left: 22px;
  font-size: 17px;
  color: var(--axle-fg-subtle);
  pointer-events: none;
}
.ask-axle-history-search .form-input {
  width: 100%;
  padding-left: 32px;
  padding-right: 30px;
}
.ask-axle-history-search-clear {
  position: absolute;
  right: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--axle-fg-subtle);
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
}
.ask-axle-history-search-clear .material-symbols-outlined { font-size: 16px; }
.ask-axle-history-search-clear:hover { color: var(--axle-fg); background: rgba(0, 0, 0, 0.05); }
.ask-axle-history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ask-axle-history-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}
.ask-axle-history-row:hover,
.ask-axle-history-row:focus-visible {
  background: rgba(0, 0, 0, 0.05);
  outline: none;
}
.ask-axle-history-row.is-current {
  background: rgba(78, 137, 125, 0.1);
}
.ask-axle-history-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.ask-axle-history-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--axle-fg);
}
.ask-axle-history-row-title > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ask-axle-history-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--axle-brand, #4e897d);
  flex-shrink: 0;
}
.ask-axle-history-row-sub {
  font-size: 11.5px;
  color: var(--axle-fg-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ask-axle-history-trash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--axle-fg-subtle);
  cursor: pointer;
  padding: 5px;
  border-radius: 8px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, background 120ms ease;
}
.ask-axle-history-trash .material-symbols-outlined { font-size: 17px; }
.ask-axle-history-row:hover .ask-axle-history-trash,
.ask-axle-history-trash:focus-visible {
  opacity: 1;
}
.ask-axle-history-trash:hover {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}
@media (hover: none) {
  .ask-axle-history-trash { opacity: 1; }
}
.ask-axle-history-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--axle-border);
  flex-shrink: 0;
}
.ask-axle-history-clear-all {
  width: 100%;
  justify-content: center;
  color: #b91c1c;
}
.ask-axle-history-clear-all:hover:not(:disabled) {
  background: rgba(185, 28, 28, 0.08);
  color: #991b1b;
}
.ask-axle-layout {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Compact always-on filters */
.ask-axle-filters {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 12px;
  background: #fff;
  border-bottom: 1px solid var(--axle-border);
  position: relative;
  z-index: 2;
  max-height: min(46vh, 420px);
  overflow-y: auto;
}
.ask-axle-filters.is-picker-open {
  overflow: visible;
  z-index: 30;
}
.ask-axle-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.ask-axle-filter-row--time {
  flex-wrap: nowrap;
}
.ask-axle-filter-row--opts {
  gap: 10px 16px;
}
.ask-axle-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.ask-axle-micro {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--axle-fg-subtle);
  line-height: 1;
}
.ask-axle-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.ask-axle-chip {
  appearance: none;
  border: 1px solid var(--axle-border);
  background: #fff;
  color: var(--axle-fg);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.25;
  white-space: nowrap;
}
.ask-axle-chip.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.ask-axle-chip:disabled {
  opacity: 0.55;
  cursor: default;
}
.ask-axle-dates {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.ask-axle-dates .form-input {
  width: 132px;
  max-width: 100%;
  height: 30px;
  font-size: 12px;
  min-width: 0;
  flex: 0 1 132px;
  padding-top: 0;
  padding-bottom: 0;
}
.ask-axle-dates-sep {
  color: var(--axle-fg-subtle);
  font-size: 11.5px;
  font-weight: 550;
  flex-shrink: 0;
}
.ask-axle-filters-divider {
  height: 0;
  margin: 4px 0 2px;
  border: 0;
  border-top: 1px solid var(--axle-border);
}
.ask-axle-entity-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ask-axle-entity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ask-axle-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 550;
  background: #f3f4f6;
  color: var(--axle-fg);
  border: 1px solid var(--axle-border);
  max-width: 100%;
  line-height: 1.25;
}
.ask-axle-pill .avatar {
  width: 18px;
  height: 18px;
  font-size: 9px;
}
.ask-axle-pill .label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ask-axle-pill .label-sub {
  font-weight: 400;
  color: var(--axle-fg-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ask-axle-pill button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--axle-fg-subtle);
  display: inline-flex;
  padding: 0;
  line-height: 1;
}
.ask-axle-pill button:hover { color: #dc2626; }
.ask-axle-picker { position: relative; }
.ask-axle-chip-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 30px;
  padding: 3px 7px;
  border: 1px solid var(--axle-border);
  border-radius: 8px;
  background: #fff;
  cursor: text;
  box-sizing: border-box;
}
.ask-axle-chip-field:focus-within {
  border-color: var(--axle-fg, #111);
  box-shadow: 0 0 0 1px var(--axle-fg, #111);
}
.ask-axle-chip-input {
  flex: 1 1 100px;
  min-width: 100px;
  width: auto;
  border: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  color: var(--axle-fg);
  padding: 2px 0;
  height: auto;
}
.ask-axle-chip-input::placeholder { color: var(--axle-fg-subtle); }
.ask-axle-chip-input:disabled { opacity: 0.6; cursor: not-allowed; }
.ask-axle-picker-dd {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.ask-axle-picker-opt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--axle-fg);
}
.ask-axle-picker-opt:hover { background: var(--axle-hover, #f4f4f5); }
.ask-axle-picker-opt-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.ask-axle-picker-opt-sub { font-size: 11px; color: var(--axle-fg-subtle); }
.ask-axle-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--axle-fg-subtle);
}

/* Chat column fills remaining height; composer docks at bottom */
.ask-axle-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: #f3f4f5;
}
.ask-axle-progress {
  height: 2px;
  width: 100%;
  overflow: hidden;
  background: #e5e5e5;
  flex-shrink: 0;
}
.ask-axle-progress-bar {
  height: 100%;
  width: 40%;
  background: var(--axle-brand, #4e897d);
  animation: ask-axle-indeterminate 1.1s ease-in-out infinite;
}
@keyframes ask-axle-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.ask-axle-discussing {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 16px 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--axle-accent, #2563eb) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--axle-accent, #2563eb) 22%, transparent);
  flex-shrink: 0;
}
.ask-axle-discussing-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  color: var(--axle-fg-muted, var(--axle-fg-subtle));
}
.ask-axle-discussing-label .material-symbols-outlined {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}
.ask-axle-discussing-text {
  font-weight: 500;
  color: var(--axle-fg, inherit);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ask-axle-discussing-clear {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--axle-fg-subtle);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.ask-axle-discussing-clear:hover:not(:disabled) {
  color: var(--axle-fg);
  background: color-mix(in srgb, var(--axle-fg) 8%, transparent);
}
.ask-axle-discussing-clear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ask-axle-meta {
  font-size: 11px;
  color: var(--axle-fg-subtle);
  padding: 8px 16px 0;
  flex-shrink: 0;
}
.ask-axle-chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 20px;
}
.ask-axle-stack {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
}
.ask-axle-stack.is-user { align-items: flex-end; }
.ask-axle-stack.is-ai { align-items: flex-start; }
.ask-axle-stack-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(78%, 520px);
  min-width: 0;
}
.ask-axle-stack-inner.is-user {
  align-items: flex-end;
}
.ask-axle-stack-inner.is-ai {
  align-items: flex-start;
}
.ask-axle-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--axle-brand, #4e897d);
  padding: 0 2px;
  line-height: 1;
}
.ask-axle-role-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--axle-brand, #4e897d);
  color: #fff;
  flex-shrink: 0;
}
.ask-axle-role-avatar .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}
.ask-axle-msg {
  display: block;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ask-axle-msg.is-user {
  background: #111827;
  color: #fff;
  white-space: pre-wrap;
  border-bottom-right-radius: 5px;
}
.ask-axle-msg.is-ai {
  background: #fff;
  border: 1px solid var(--axle-border);
  color: var(--axle-fg);
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ask-axle-msg.is-ai.is-typing {
  min-width: 56px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.ask-axle-msg.is-ai :is(h3, h4) {
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.ask-axle-msg.is-ai :is(h3, h4):first-child { margin-top: 0; }
.ask-axle-msg.is-ai ul {
  /* Tailwind Preflight sets list-style: none — restore bullet markers */
  list-style: disc outside;
  margin: 2px 0 6px 1.25em;
  padding: 0;
}
.ask-axle-msg.is-ai li {
  margin: 2px 0;
  line-height: 1.45;
}
.ask-axle-msg.is-ai p { margin: 0 0 4px; line-height: 1.45; }
.ask-axle-msg.is-ai p:last-child { margin-bottom: 0; }
.ask-axle-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  min-height: 18px;
}
.ask-axle-stack-inner.is-user .ask-axle-msg-meta { flex-direction: row-reverse; }
.ask-axle-time {
  font-size: 11px;
  color: var(--axle-fg-subtle);
}
.ask-axle-copy {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--axle-fg-subtle);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 0;
}
.ask-axle-copy:hover { color: var(--axle-fg); }
.ask-axle-typing {
  display: inline-flex;
  align-items: center;
}
.ask-axle-typing-dots {
  display: flex;
  gap: 5px;
  padding: 2px 2px;
}
.ask-axle-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--axle-brand, #4e897d);
  opacity: 0.45;
  animation: ask-axle-typing 1.25s ease-in-out infinite;
}
.ask-axle-typing-dots span:nth-child(1) { animation-delay: 0s; }
.ask-axle-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.ask-axle-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ask-axle-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-6px); opacity: 1; }
}
.ask-axle-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--axle-border);
  background: #fff;
  flex-shrink: 0;
}
.ask-axle-compose-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  font-size: 13.5px;
  border-radius: 999px;
  padding-left: 16px;
  padding-right: 16px;
}
.ask-axle-send {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ask-axle-send .material-symbols-outlined { font-size: 20px; }

@media (max-width: 640px) {
  .ask-axle-filter-row--time {
    flex-wrap: wrap;
  }
  .ask-axle-dates .form-input {
    width: 120px;
    flex: 1 1 110px;
  }
}

.email-reply-draft {
  min-height: 240px;
  font-size: 14px;
  line-height: 1.55;
  outline: none;
}
.email-reply-draft:focus {
  border-color: var(--axle-border-strong, var(--axle-border));
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}
.email-reply-draft p { margin: 0 0 0.85em; }
.email-reply-draft p:last-child { margin-bottom: 0; }
/* Tailwind Preflight sets list-style: none — restore markers for the draft editor */
.email-reply-draft ul {
  list-style-type: disc;
  list-style-position: outside;
  margin: 0 0 0.85em;
  padding-left: 1.6em;
}
.email-reply-draft ol {
  list-style-type: decimal;
  list-style-position: outside;
  margin: 0 0 0.85em;
  padding-left: 1.6em;
}
.email-reply-draft li { margin: 0.25em 0; }

.axle-drawer--email .spin {
  animation: axle-email-reply-spin 0.8s linear infinite;
}
@keyframes axle-email-reply-spin {
  to { transform: rotate(360deg); }
}

.axle-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--axle-border);
  flex-shrink: 0;
}
.axle-drawer-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--axle-fg);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.005em;
}
.axle-drawer-title .material-symbols-outlined {
  font-size: 20px;
  color: var(--axle-fg-muted);
}

.axle-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 24px;
}

.axle-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--axle-border);
  background: var(--axle-bg);
  flex-shrink: 0;
}

/* Definition list rows used inside drawer bodies */
.drawer-meta {
  display: grid;
  grid-template-columns: 110px 1fr;
  row-gap: 10px;
  column-gap: 14px;
  font-size: 13px;
}
.drawer-meta dt {
  color: var(--axle-fg-subtle);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding-top: 1px;
}
.drawer-meta dd { color: var(--axle-fg); margin: 0; }

.drawer-section + .drawer-section { margin-top: 22px; }
.drawer-section-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--axle-fg-subtle);
  margin-bottom: 10px;
}

.drawer-question-card {
  background: var(--axle-bg);
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  padding: 14px 16px;
}
.drawer-question-card .q-text {
  font-size: 14px;
  color: var(--axle-fg);
  line-height: 1.55;
}
.drawer-question-card .q-meta {
  font-size: 12px;
  color: var(--axle-fg-subtle);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .axle-drawer-header,
  .axle-drawer-body { padding-left: 18px; padding-right: 18px; }
  .axle-drawer-footer { padding-left: 14px; padding-right: 14px; }
}

/* ---------- API Logs ---------- */
.api-logs-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.api-logs-stat {
  flex: 1 1 120px;
  min-width: 110px;
  background: var(--axle-surface);
  border: 1px solid var(--axle-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.api-logs-stat .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--axle-fg-subtle);
  margin-bottom: 4px;
}
.api-logs-stat .value {
  font-size: 18px;
  font-weight: 600;
  color: var(--axle-fg);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.api-logs-table-wrap {
  overflow-x: auto;
}
.api-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.api-logs-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--axle-fg-subtle);
  padding: 10px 12px;
  border-bottom: 1px solid var(--axle-border);
  white-space: nowrap;
  background: var(--axle-bg);
}
.api-logs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--axle-border);
  vertical-align: middle;
  color: var(--axle-fg);
}
.api-logs-table tr:hover td {
  background: #fafafa;
  cursor: pointer;
}
.api-logs-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}
.api-logs-table .tabular {
  font-variant-numeric: tabular-nums;
}

.api-logs-copy-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.api-logs-copy-row .copy-btn {
  flex-shrink: 0;
  opacity: 0.55;
}
.api-logs-copy-row:hover .copy-btn { opacity: 1; }

.api-logs-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--axle-bg);
  border: 1px solid var(--axle-border);
  border-radius: 8px;
  padding: 12px 14px;
  max-height: 320px;
  overflow: auto;
  margin: 0;
}

.api-logs-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #0a0a0a;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 1200;
}
.api-logs-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.api-logs-timebar .btn-ghost.is-active {
  background: #0a0a0a;
  color: #fff;
}

.api-logs-subcall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--axle-border);
  border-radius: 8px;
  background: var(--axle-bg);
  cursor: pointer;
  margin-bottom: 8px;
}
.api-logs-subcall:hover {
  border-color: #d4d4d4;
  background: #fff;
}
.api-logs-subcall .sc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--axle-fg);
}
.api-logs-subcall .sc-meta {
  font-size: 12px;
  color: var(--axle-fg-subtle);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ---------- Global mail tool drawers ----------
   AI report / Email Opens tracking / Promise Tracker drawers, extracted from
   the inbox (includes/mail-tools-drawers.php + assets/js/mail-tools-drawers.js)
   so the tools open on any page. Class names kept from the inbox component.
   The .mi-empty / .mi-dl-progress helpers are shared with the inbox, which
   still ships its own copy for inbox-only panes. */
.mi-empty {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 0;
}
.mi-empty-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f5f5f5; border: 1px solid var(--axle-border);
  margin-bottom: 14px;
}
.mi-empty-icon .material-symbols-outlined {
  font-size: 26px; color: var(--axle-fg-subtle); display: block; margin: 0;
}
.mi-empty-title {
  font-size: 14px; font-weight: 600; color: var(--axle-fg); letter-spacing: -0.01em;
}
.mi-empty-sub {
  margin-top: 6px; max-width: 220px;
  font-size: 12.5px; color: var(--axle-fg-muted); line-height: 1.4;
}
.mi-dl-progress {
  height: 3px; width: 100%; overflow: hidden; background: #e5e5e5; flex-shrink: 0;
}
.mi-dl-progress-bar {
  height: 100%; width: 40%;
  background: var(--axle-brand, #4e897d);
  animation: mi-dl-indeterminate 1.1s ease-in-out infinite;
}
@keyframes mi-dl-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
@keyframes mi-spin { to { transform: rotate(360deg); } }

/* AI report drawer */
.mi-ai-report-drawer.axle-drawer {
  width: min(560px, 100vw);
  display: flex; flex-direction: column;
}
.mi-ai-report-body { padding: 16px 20px 12px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.mi-ai-report-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--axle-border); flex-shrink: 0; background: #fff;
}
.mi-ai-scope {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px;
}
.mi-ai-scope .form-label { width: 100%; margin-bottom: 0; }
.mi-ai-presets {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px;
}
.mi-ai-preset {
  appearance: none; border: 1px solid var(--axle-border); background: #fff;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 550;
  color: var(--axle-fg-muted); cursor: pointer;
}
.mi-ai-preset:hover { background: var(--axle-hover); color: var(--axle-fg); }
.mi-ai-preset.is-active {
  background: var(--axle-fg); border-color: var(--axle-fg); color: #fff;
}
.mi-ai-dates {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px;
}
.mi-ai-dates .form-input { max-width: 160px; height: 32px; font-size: 12.5px; }
.mi-ai-dates-sep { font-size: 12px; color: var(--axle-fg-subtle); }
.mi-ai-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px;
}
.mi-ai-picker { margin-bottom: 12px; position: relative; }
.mi-ai-picker .form-input { width: 100%; }
.mi-ai-picker-dd {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 220px; overflow-y: auto; background: #fff;
  border: 1px solid var(--axle-border-strong); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 4px;
}
.mi-ai-picker-opt {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  border: 0; background: transparent; padding: 8px 10px; border-radius: 6px;
  font-size: 13px; cursor: pointer; color: var(--axle-fg);
}
.mi-ai-picker-opt:hover, .mi-ai-picker-opt.is-active { background: var(--axle-hover); }
.mi-ai-picker-opt-text {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0;
}
.mi-ai-picker-opt-sub { font-size: 11.5px; color: var(--axle-fg-subtle); }
.mi-ai-meta { font-size: 12px; color: var(--axle-fg-subtle); margin-bottom: 8px; }
.mi-ai-stream-bar {
  height: 2px;
  width: 100%;
  overflow: hidden;
  background: #e5e5e5;
  border-radius: 999px;
  margin: 0 0 10px;
}
.mi-ai-stream-bar-fill {
  height: 100%;
  width: 40%;
  background: var(--axle-brand, #4e897d);
  animation: mi-ai-stream-indeterminate 1.1s ease-in-out infinite;
}
@keyframes mi-ai-stream-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.mi-ai-report-body > .mi-empty,
.mi-promise-body > .mi-empty,
.mi-tracking-body > .mi-empty {
  flex: 0 0 auto;
  min-height: 240px;
}
.mi-ai-report-body > .mi-empty .mi-empty-sub,
.mi-promise-body > .mi-empty .mi-empty-sub,
.mi-tracking-body > .mi-empty .mi-empty-sub {
  max-width: 280px;
}
.mi-empty-progress {
  width: min(220px, 100%);
  margin-top: 16px;
  border-radius: 999px;
  overflow: hidden;
}
.mi-empty-progress .mi-dl-progress { height: 3px; border-radius: 999px; }
.mi-dl-empty .mi-empty-progress { margin-top: 0; margin-bottom: 0; }
.mi-ai-output { font-size: 13.5px; line-height: 1.65; color: var(--axle-fg); }
.mi-ai-output h3 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.mi-ai-output h4 { font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.mi-ai-output p { margin: 8px 0; }
.mi-ai-output ul { margin: 8px 0; padding-left: 20px; list-style: disc; }
.mi-ai-output li { margin: 4px 0; }
.mi-ai-output h3:first-child, .mi-ai-output h4:first-child { margin-top: 0; }
.mi-ai-report-drawer .spin,
.mi-promise-drawer .spin,
.mi-tracking-drawer .spin { animation: mi-spin 0.8s linear infinite; }

/* VIP watchlist rows (inside the AI report drawer) */
.mi-vip-list { margin-bottom: 14px; }
.mi-vip-rows {
  border: 1px solid var(--axle-border); border-radius: 10px; overflow: hidden;
  max-height: 240px; overflow-y: auto;
}
.mi-vip-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--axle-border); background: #fff;
}
.mi-vip-row:last-child { border-bottom: 0; }
.mi-vip-row-meta { min-width: 0; flex: 1; }
.mi-vip-row-name {
  font-size: 13px; font-weight: 550; color: var(--axle-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mi-vip-row-sub {
  font-size: 11.5px; color: var(--axle-fg-subtle);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mi-vip-row-remove {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--axle-fg-subtle); border-radius: 6px; padding: 4px;
  display: inline-flex; align-items: center;
}
.mi-vip-row-remove:hover { background: var(--axle-hover); color: #dc2626; }

/* Email Opens tracking drawer */
.mi-tracking-drawer.axle-drawer { width: min(420px, 100vw); }
.mi-tracking-hero {
  padding: 16px 20px 12px;
  background: linear-gradient(160deg, #eff6ff 0%, #fff 55%);
  border-bottom: 1px solid var(--axle-border);
}
.mi-tracking-hero-kicker {
  font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  color: #2563eb; margin-bottom: 4px;
}
.mi-tracking-hero-title {
  font-size: 16px; font-weight: 650; color: var(--axle-fg); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mi-tracking-hero-meta {
  margin-top: 8px; font-size: 12.5px; color: var(--axle-fg-muted);
}
.mi-tracking-body { padding: 16px 20px 28px; overflow-y: auto; }
.mi-tracking-timeline { position: relative; padding-left: 18px; }
.mi-tracking-timeline:before {
  content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px;
  background: linear-gradient(180deg, #60a5fa, #bfdbfe 40%, transparent);
}
.mi-tracking-event {
  position: relative; margin-bottom: 12px; padding: 12px 14px;
  border: 1px solid var(--axle-border); border-radius: 10px; background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.mi-tracking-event:before {
  content: ''; position: absolute; left: -16px; top: 18px; width: 10px; height: 10px;
  border-radius: 50%; background: #3b82f6; box-shadow: 0 0 0 3px #dbeafe;
}
.mi-tracking-when { font-size: 13px; font-weight: 600; color: var(--axle-fg); }
.mi-tracking-subject {
  margin-top: 6px; font-size: 12.5px; font-weight: 550; color: var(--axle-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mi-tracking-meta-row {
  margin-top: 5px; font-size: 12.5px; color: var(--axle-fg-muted); line-height: 1.35;
}
.mi-tracking-meta-label {
  color: var(--axle-fg-subtle); font-weight: 550; margin-right: 4px;
}
.mi-tracking-loc { margin-top: 5px; font-size: 12.5px; color: var(--axle-fg-muted); }
.mi-tracking-details-toggle {
  margin-top: 8px; border: 0; background: transparent; padding: 0;
  font-size: 12px; font-weight: 550; color: #2563eb; cursor: pointer;
}
.mi-tracking-details-toggle:hover { text-decoration: underline; }
.mi-tracking-details { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--axle-border); }
.mi-tracking-ip {
  margin-top: 0; display: inline-flex; align-items: center; gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: #1d4ed8; background: #eff6ff; padding: 3px 8px; border-radius: 6px;
}
.mi-tracking-isp { margin-top: 6px; font-size: 12px; color: var(--axle-fg-subtle); }
.mi-tracking-coords { margin-top: 4px; font-size: 11px; color: var(--axle-fg-subtle); font-variant-numeric: tabular-nums; }
.mi-tracking-ua {
  margin-top: 8px; font-size: 11.5px; color: var(--axle-fg-subtle);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mi-tracking-digup {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: #b45309;
  background: #fef3c7; border: 1px solid #fde68a;
  padding: 2px 8px 2px 6px; border-radius: 999px;
}
.mi-tracking-digup .material-symbols-outlined { font-size: 14px; }
.mi-tracking-event.is-digup:before { background: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; }
/* Click events render in purple to stand apart from blue opens */
.mi-tracking-event.is-click:before { background: #7c3aed; box-shadow: 0 0 0 3px #ede9fe; }
.mi-tracking-event.is-click { border-color: #ddd6fe; }
.mi-tracking-click {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  font-size: 11.5px; font-weight: 600; color: #6d28d9;
  background: #ede9fe; border: 1px solid #ddd6fe;
  padding: 2px 8px 2px 6px; border-radius: 999px;
}
.mi-tracking-click .material-symbols-outlined { font-size: 14px; }
.mi-tracking-click-url {
  color: #6d28d9; text-decoration: underline; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.mi-tracking-click-url:hover { color: #5b21b6; }
.mi-tracking-brand {
  margin-top: 5px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: #1d4ed8;
  background: #eff6ff; border: 1px solid #dbeafe;
  padding: 2px 8px 2px 6px; border-radius: 999px;
}
.mi-tracking-brand .material-symbols-outlined { font-size: 14px; }
.mi-tracking-filters {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
}
.mi-tracking-filters input[type="text"] {
  flex: 1 1 auto; min-width: 0;
  font-size: 12.5px; padding: 5px 9px;
  border: 1px solid var(--axle-border); border-radius: 8px;
}
.mi-tracking-filters select {
  flex: 0 1 42%; min-width: 0;
  font-size: 12.5px; padding: 5px 6px;
  border: 1px solid var(--axle-border); border-radius: 8px;
  background: #fff;
}
.mi-tracking-others-toggle {
  border: 0; background: transparent; padding: 0;
  font-size: 12.5px; font-weight: 550; color: #2563eb; cursor: pointer;
}
.mi-tracking-others-toggle:hover { text-decoration: underline; }
.mi-tracking-others-list {
  margin-top: 4px; padding-left: 2px;
  font-size: 12px; color: var(--axle-fg-muted); line-height: 1.5;
}

/* Promise tracker drawer */
.mi-promise-drawer.axle-drawer { width: min(460px, 100vw); }
.mi-promise-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 20px; border-bottom: 1px solid var(--axle-border); flex-shrink: 0;
}
.mi-promise-tabs { display: flex; align-items: center; gap: 6px; }
.mi-promise-body { padding: 14px 20px 28px; overflow-y: auto; }
.mi-promise-card {
  border: 1px solid var(--axle-border); border-radius: 10px; background: #fff;
  padding: 12px 14px; margin-bottom: 10px;
}
.mi-promise-card.is-overdue { border-color: #fca5a5; background: #fff7f7; }
.mi-promise-text { font-size: 13.5px; font-weight: 550; color: var(--axle-fg); line-height: 1.45; }
.mi-promise-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 6px; font-size: 12.5px; color: var(--axle-fg-muted);
}
.mi-promise-due { font-weight: 600; color: #2563eb; }
.mi-promise-due.is-overdue { color: #dc2626; }
.mi-promise-src {
  display: flex; align-items: center; gap: 5px; margin-top: 6px;
  font-size: 12px; color: var(--axle-fg-subtle); min-width: 0;
}
.mi-promise-src span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-promise-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }

